@stlite/desktop 0.87.0 → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{ErrorOutline.esm-C8z2dN3x.js → ErrorOutline.esm-D5Ifiwqa.js} +1 -1
- package/build/assets/{FileDownload.esm-kSzyJagP.js → FileDownload.esm-DOHSKnrq.js} +1 -1
- package/build/assets/{FileHelper-BbrZYz8x.js → FileHelper-BTXiVf4-.js} +1 -1
- package/build/assets/{FormClearHelper-fvwQICEk.js → FormClearHelper-BC4K9Zmh.js} +1 -1
- package/build/assets/{Hooks-CCS44jMc.js → Hooks-GYU3aDYH.js} +1 -1
- package/build/assets/{InputInstructions-BgxdtQsQ.js → InputInstructions-CqSmotDL.js} +1 -1
- package/build/assets/{Particles-C6lCS8Mc.js → Particles-DKyXwmGK.js} +1 -1
- package/build/assets/{ProgressBar-CXipOcU9.js → ProgressBar-B7cXo5Zk.js} +1 -1
- package/build/assets/{Toolbar-DiWCQxr5.js → Toolbar-CF99-ktZ.js} +1 -1
- package/build/assets/{base-input-D2OIsCyG.js → base-input-Bu7lYJya.js} +1 -1
- package/build/assets/{checkbox-BNaalk8J.js → checkbox-vy_88iMk.js} +1 -1
- package/build/assets/{createSuper-CQM18OGw.js → createSuper-BZDCsfCp.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-CK8RiHSC.js → data-grid-overlay-editor-P0wPqvRS.js} +1 -1
- package/build/assets/{downloader-CE817MUq.js → downloader-E6SH6tis.js} +1 -1
- package/build/assets/{es6-D9GNxEuI.js → es6-lWl2HAKQ.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-CNYkPhE6.js → iframeResizer.contentWindow-BblXhc8K.js} +1 -1
- package/build/assets/{index-cAlcGRT2.js → index-3q7VEUlu.js} +1 -1
- package/build/assets/{index-B-7mLFMQ.js → index-9Wb22-Zl.js} +1 -1
- package/build/assets/{index-DCNLpqIv.js → index-B2QqSXxG.js} +4 -4
- package/build/assets/{index-C1VFEx3W.js → index-BAt37HPV.js} +1 -1
- package/build/assets/{index-DFlTnZFo.js → index-BHD6dN1i.js} +1 -1
- package/build/assets/{index-CDtHDDVr.js → index-BHYA8KUU.js} +1 -1
- package/build/assets/{index-B5zkrGKq.js → index-Ba8Fd3Iw.js} +1 -1
- package/build/assets/{index-CjHv4qYi.js → index-Bl3t7YE9.js} +1 -1
- package/build/assets/{index-BGbl-ncy.js → index-C0rU7wjo.js} +1 -1
- package/build/assets/{index-mlKr_pQQ.js → index-C8408c32.js} +1 -1
- package/build/assets/{index--SdlqSfi.js → index-C9dv_cRO.js} +1 -1
- package/build/assets/{index-CnRs0MgX.js → index-CBgaSeZa.js} +1 -1
- package/build/assets/{index-BI9UgvCi.js → index-CESihKoP.js} +1 -1
- package/build/assets/{index-X9E9p-kg.js → index-CHcwRuRz.js} +1 -1
- package/build/assets/{index-C6fUDD3N.js → index-CO2uSAB4.js} +1 -1
- package/build/assets/{index-DFWekVRf.js → index-COVY3it_.js} +1 -1
- package/build/assets/{index-DDiZtaVk.js → index-C_XWYeXZ.js} +1 -1
- package/build/assets/{index-Wzix0Ssr.js → index-CcNoZyGq.js} +1 -1
- package/build/assets/{index-7qt3HHfl.js → index-CeooaFxj.js} +1 -1
- package/build/assets/{index-B3wu97uA.js → index-Ck8oqwxV.js} +1 -1
- package/build/assets/{index-CGMUJ4kd.js → index-D1lT9gPf.js} +1 -1
- package/build/assets/{index-DhqQeff3.js → index-D7qhlvAL.js} +5 -5
- package/build/assets/{index-DqnX_TF4.js → index-DDHABoz7.js} +1 -1
- package/build/assets/{index-DhxOxSgZ.js → index-DKJBdNcR.js} +1 -1
- package/build/assets/{index-CT5_r023.js → index-DLKkPsKG.js} +1 -1
- package/build/assets/{index-CI7_FxNG.js → index-DPhgZ6z8.js} +1 -1
- package/build/assets/{index---v6J_Xe.js → index-DodBZ077.js} +1 -1
- package/build/assets/{index-DXGgezsh.js → index-E1lgIpin.js} +1 -1
- package/build/assets/{index-D0YDqQsn.js → index-IjmnJRcJ.js} +1 -1
- package/build/assets/{index-Vs85zs5K.js → index-J69gSkQ7.js} +1 -1
- package/build/assets/{index-Bnvb95fQ.js → index-LjAoKxoo.js} +1 -1
- package/build/assets/{index-Dc2c4xJB.js → index-NFS9SZBh.js} +1 -1
- package/build/assets/{index-XLeMBlQJ.js → index-UG5gS873.js} +1 -1
- package/build/assets/{index-CxsEqDQL.js → index-oUxYecyl.js} +1 -1
- package/build/assets/{index-BDOZpIxN.js → index-rGN93mnX.js} +1 -1
- package/build/assets/{index-CKEBU2Tu.js → index-sNwZkMcg.js} +1 -1
- package/build/assets/{index-DyVqVg90.js → index-tGudOCY7.js} +1 -1
- package/build/assets/{inherits-BWX75f6B.js → inherits-CxdXuG_P.js} +1 -1
- package/build/assets/{input-DTfsWA-x.js → input-CK3Z1ctS.js} +1 -1
- package/build/assets/{memory-DS2CpVMo.js → memory-F_WtxrTu.js} +1 -1
- package/build/assets/{mergeWith-fWFIuGgc.js → mergeWith-DB-_2-Rw.js} +1 -1
- package/build/assets/{number-overlay-editor-DDQgeQYn.js → number-overlay-editor-B9-dA9Oc.js} +1 -1
- package/build/assets/{sandbox-VD4WfD0W.js → sandbox-OL9X-HVr.js} +1 -1
- package/build/assets/{slicedToArray-CgI3PJi3.js → slicedToArray-Dcf1iVtV.js} +1 -1
- package/build/assets/{timepicker-qd0SiRjC.js → timepicker-CNx-qwHe.js} +1 -1
- package/build/assets/{uniqueId-Dgo2nsPZ.js → uniqueId-B67KB2Sb.js} +1 -1
- package/build/assets/{useBasicWidgetState-9vtYd9vP.js → useBasicWidgetState-DVIC6bdr.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-BFx1z0yW.js → useTextInputAutoExpand-D9ObUIEt.js} +1 -1
- package/build/assets/{useUpdateUiValue-BF7Ryinr.js → useUpdateUiValue-BpA660Wd.js} +1 -1
- package/build/assets/{withFullScreenWrapper-C3PKUCi4.js → withFullScreenWrapper-CQbXKdaQ.js} +1 -1
- package/build/assets/worker-Cet_Vg8m.js +105 -0
- package/build/electron/worker.js +9 -9
- package/build/index.html +1 -1
- package/package.json +5 -5
- package/wheels/streamlit-1.48.0-cp312-none-any.whl +0 -0
- package/build/assets/worker-B7Gzidb7.js +0 -105
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,bD as d,b1 as v,bE as i,r as g,bF as t,j as s,bG as f,bH as x,bI as C}from"./index-
|
|
1
|
+
import{c as a,bD as d,b1 as v,bE as i,r as g,bF as t,j as s,bG as f,bH as x,bI as C}from"./index-B2QqSXxG.js";function k(o,e){switch(o){case i.XSMALL:return{padding:`${e.spacing.twoXS} ${e.spacing.sm}`,fontSize:e.fontSizes.sm};case i.SMALL:return{padding:`${e.spacing.twoXS} ${e.spacing.md}`};case i.LARGE:return{padding:`${e.spacing.md} ${e.spacing.md}`};default:return{padding:`${e.spacing.xs} ${e.spacing.md}`}}}const b=a("a",{target:"e16zdaao3"})(({containerWidth:o,size:e,theme:r})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:r.fontWeights.normal,padding:`${r.spacing.xs} ${r.spacing.md}`,borderRadius:r.radii.button,minHeight:r.sizes.minElementHeight,margin:0,lineHeight:r.lineHeights.base,color:r.colors.primary,textDecoration:"none",width:o?"100%":"auto",userSelect:"none","&:visited":{color:r.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${v(r.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...k(e,r)}),""),y=a(b,{target:"e16zdaao2"})(({theme:o})=>({backgroundColor:o.colors.primary,color:o.colors.white,border:`${o.sizes.borderWidth} solid ${o.colors.primary}`,"&:hover, &:focus-visible":{backgroundColor:d(o.colors.primary,.15),borderColor:d(o.colors.primary,.15)},"&:active":{backgroundColor:o.colors.primary,borderColor:d(o.colors.primary,.15)},"&:visited:not(:active)":{color:o.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}),""),$=a(b,{target:"e16zdaao1"})(({theme:o})=>({backgroundColor:o.colors.lightenedBg05,color:o.colors.bodyText,border:`${o.sizes.borderWidth} solid ${o.colors.borderColor}`,"&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{backgroundColor:o.colors.darkenedBgMix15},"&:active":{backgroundColor:o.colors.darkenedBgMix25},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}),""),z=a(b,{target:"e16zdaao0"})(({theme:o})=>({padding:o.spacing.none,backgroundColor:o.colors.transparent,color:o.colors.bodyText,border:"none","&:visited":{color:o.colors.bodyText},"&:hover, &:focus-visible":{color:o.colors.primary},"&:hover:not([disabled]), &:focus-visible:not([disabled])":{"span.stMarkdownColoredText":{color:"inherit !important"}},"&:active":{color:d(o.colors.primary,.25)},"&[disabled], &[disabled]:hover, &[disabled]:active":{backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}}),"");function T({kind:o,size:e,disabled:r,children:n,autoFocus:l,href:u,rel:p,target:h,onClick:m}){let c=y;return o===t.SECONDARY?c=$:o===t.TERTIARY&&(c=z),s.jsx(c,{kind:o,size:e||i.MEDIUM,containerWidth:!0,disabled:r||!1,autoFocus:l||!1,href:u,target:h,rel:p,onClick:m,tabIndex:r?-1:0,"data-testid":`stBaseLinkButton-${o}`,children:n})}const w=g.memo(T);function S(o){const{element:e}=o;let r=t.SECONDARY;e.type==="primary"?r=t.PRIMARY:e.type==="tertiary"&&(r=t.TERTIARY);const n=l=>{e.disabled&&l.preventDefault()};return s.jsx(f,{className:"stLinkButton","data-testid":"stLinkButton",children:s.jsx(x,{help:e.help,containerWidth:!0,children:s.jsx(w,{kind:r,size:i.SMALL,disabled:e.disabled,onClick:n,href:e.url,target:"_blank",rel:"noreferrer","aria-disabled":e.disabled,children:s.jsx(C,{icon:e.icon,label:e.label})})})})}const L=g.memo(S);export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,r as a,j as s,bc as r}from"./index-
|
|
1
|
+
import{c as t,r as a,j as s,bc as r}from"./index-B2QqSXxG.js";import{P as o}from"./ProgressBar-B7cXo5Zk.js";const i=t("div",{target:"e18r7x300"})(({theme:e})=>({paddingBottom:e.spacing.sm,lineHeight:"normal"}),"");function l({element:e}){return s.jsxs("div",{className:"stProgress","data-testid":"stProgress",children:[s.jsx(i,{children:s.jsx(r,{source:e.text,allowHTML:!1,isLabel:!0})}),s.jsx(o,{value:e.value})]})}const m=a.memo(l);export{m as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as h,cr as vr,cs as wr,ct as Dr,cu as Sr,h as Hn,cv as xn,g as En,c3 as K,co as Fe,cp as We,cw as An,cn as Or,c4 as z,b5 as kr,cx as In,cy as Mr,cz as Cr,cA as Ln,c5 as Ne,cB as Rn,cC as Tn,cD as Bn,b6 as Pr,ba as $n,ap as jr,cE as Fn,L as Wn,J as Ye,F as Hr,j as Ce,b$ as Nn,c0 as Yn,ch as zn,c1 as Vn,bJ as xr,b8 as mt,c2 as _n,bY as qn,bc as Un}from"./index-
|
|
1
|
+
import{r as h,cr as vr,cs as wr,ct as Dr,cu as Sr,h as Hn,cv as xn,g as En,c3 as K,co as Fe,cp as We,cw as An,cn as Or,c4 as z,b5 as kr,cx as In,cy as Mr,cz as Cr,cA as Ln,c5 as Ne,cB as Rn,cC as Tn,cD as Bn,b6 as Pr,ba as $n,ap as jr,cE as Fn,L as Wn,J as Ye,F as Hr,j as Ce,b$ as Nn,c0 as Yn,ch as zn,c1 as Vn,bJ as xr,b8 as mt,c2 as _n,bY as qn,bc as Un}from"./index-B2QqSXxG.js";import{a as Qn}from"./useBasicWidgetState-DVIC6bdr.js";import{D as Ae,a as Ie,T as Xn}from"./timepicker-CNx-qwHe.js";import{I as Gn}from"./input-CK3Z1ctS.js";import{I as Kn}from"./base-input-Bu7lYJya.js";import{E as Jn}from"./ErrorOutline.esm-D5Ifiwqa.js";import"./FormClearHelper-BC4K9Zmh.js";import"./inherits-CxdXuG_P.js";import"./createSuper-BZDCsfCp.js";var Zn=["title","size","color","overrides"];function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},yt.apply(this,arguments)}function eo(e,t){if(e==null)return{};var n=to(e,t),o,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)o=a[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function to(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,a;for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function ro(e,t){return io(e)||ao(e,t)||oo(e,t)||no()}function no(){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 oo(e,t){if(e){if(typeof e=="string")return Er(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 Er(e,t)}}function Er(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function ao(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],r=!0,a=!1,i,s;try{for(n=n.call(e);!(r=(i=n.next()).done)&&(o.push(i.value),!(t&&o.length===t));r=!0);}catch(d){a=!0,s=d}finally{try{!r&&n.return!=null&&n.return()}finally{if(a)throw s}}return o}}function io(e){if(Array.isArray(e))return e}function so(e,t){var n=vr(),o=ro(n,2),r=o[1],a=e.title,i=a===void 0?"Left":a,s=e.size,d=e.color,c=e.overrides,y=c===void 0?{}:c,u=eo(e,Zn),f=wr({component:r.icons&&r.icons.ChevronLeft?r.icons.ChevronLeft:null},y&&y.Svg?Dr(y.Svg):{});return h.createElement(Sr,yt({viewBox:"0 0 24 24",ref:t,title:i,size:s,color:d,overrides:{Svg:f}},u),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 12C9 12.2652 9.10536 12.5196 9.29289 12.7071L13.2929 16.7071C13.6834 17.0976 14.3166 17.0976 14.7071 16.7071C15.0976 16.3166 15.0976 15.6834 14.7071 15.2929L11.4142 12L14.7071 8.70711C15.0976 8.31658 15.0976 7.68342 14.7071 7.29289C14.3166 6.90237 13.6834 6.90237 13.2929 7.29289L9.29289 11.2929C9.10536 11.4804 9 11.7348 9 12Z"}))}const Ar=h.forwardRef(so);var lo=["title","size","color","overrides"];function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},bt.apply(this,arguments)}function uo(e,t){if(e==null)return{};var n=co(e,t),o,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)o=a[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function co(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,a;for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function po(e,t){return mo(e)||go(e,t)||ho(e,t)||fo()}function fo(){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 ho(e,t){if(e){if(typeof e=="string")return Ir(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 Ir(e,t)}}function Ir(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function go(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],r=!0,a=!1,i,s;try{for(n=n.call(e);!(r=(i=n.next()).done)&&(o.push(i.value),!(t&&o.length===t));r=!0);}catch(d){a=!0,s=d}finally{try{!r&&n.return!=null&&n.return()}finally{if(a)throw s}}return o}}function mo(e){if(Array.isArray(e))return e}function yo(e,t){var n=vr(),o=po(n,2),r=o[1],a=e.title,i=a===void 0?"Right":a,s=e.size,d=e.color,c=e.overrides,y=c===void 0?{}:c,u=uo(e,lo),f=wr({component:r.icons&&r.icons.ChevronRight?r.icons.ChevronRight:null},y&&y.Svg?Dr(y.Svg):{});return h.createElement(Sr,bt({viewBox:"0 0 24 24",ref:t,title:i,size:s,color:d,overrides:{Svg:f}},u),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 7.29289C8.90237 7.68342 8.90237 8.31658 9.29289 8.70711L12.5858 12L9.29289 15.2929C8.90237 15.6834 8.90237 16.3166 9.29289 16.7071C9.68342 17.0976 10.3166 17.0976 10.7071 16.7071L14.7071 12.7071C14.8946 12.5196 15 12.2652 15 12C15 11.7348 14.8946 11.4804 14.7071 11.2929L10.7071 7.29289C10.3166 6.90237 9.68342 6.90237 9.29289 7.29289Z"}))}const Lr=h.forwardRef(yo);var Rr={exports:{}},vt,Tr;function bo(){if(Tr)return vt;Tr=1;function e(p){return p&&typeof p=="object"&&"default"in p?p.default:p}var t=e(Hn()),n=xn();function o(p,v){for(var O=Object.getOwnPropertyNames(v),m=0;m<O.length;m++){var l=O[m],j=Object.getOwnPropertyDescriptor(v,l);j&&j.configurable&&p[l]===void 0&&Object.defineProperty(p,l,j)}return p}function r(){return(r=Object.assign||function(p){for(var v=1;v<arguments.length;v++){var O=arguments[v];for(var m in O)Object.prototype.hasOwnProperty.call(O,m)&&(p[m]=O[m])}return p}).apply(this,arguments)}function a(p,v){p.prototype=Object.create(v.prototype),o(p.prototype.constructor=p,v)}function i(p,v){if(p==null)return{};var O,m,l={},j=Object.keys(p);for(m=0;m<j.length;m++)O=j[m],0<=v.indexOf(O)||(l[O]=p[O]);return l}function s(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}var d=function(p,v,O,m,l,j,q,re){if(!p){var L;if(v===void 0)L=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var F=[O,m,l,j,q,re],Y=0;(L=new Error(v.replace(/%s/g,function(){return F[Y++]}))).name="Invariant Violation"}throw L.framesToPop=1,L}},c=d;function y(p,v,O){if("selectionStart"in p&&"selectionEnd"in p)p.selectionStart=v,p.selectionEnd=O;else{var m=p.createTextRange();m.collapse(!0),m.moveStart("character",v),m.moveEnd("character",O-v),m.select()}}function u(p){var v=0,O=0;if("selectionStart"in p&&"selectionEnd"in p)v=p.selectionStart,O=p.selectionEnd;else{var m=document.selection.createRange();m.parentElement()===p&&(v=-m.moveStart("character",-p.value.length),O=-m.moveEnd("character",-p.value.length))}return{start:v,end:O,length:O-v}}var f={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},w="_";function b(p,v,O){var m="",l="",j=null,q=[];if(v===void 0&&(v=w),O==null&&(O=f),!p||typeof p!="string")return{maskChar:v,formatChars:O,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var re=!1;return p.split("").forEach(function(L){re=!re&&L==="\\"||(re||!O[L]?(q.push(m.length),m.length===q.length-1&&(l+=L)):j=m.length+1,m+=L,!1)}),{maskChar:v,formatChars:O,prefix:l,mask:m,lastEditablePosition:j,permanents:q}}function g(p,v){return p.permanents.indexOf(v)!==-1}function D(p,v,O){var m=p.mask,l=p.formatChars;if(!O)return!1;if(g(p,v))return m[v]===O;var j=l[m[v]];return new RegExp(j).test(O)}function M(p,v){return v.split("").every(function(O,m){return g(p,m)||!D(p,m,O)})}function S(p,v){var O=p.maskChar,m=p.prefix;if(!O){for(;v.length>m.length&&g(p,v.length-1);)v=v.slice(0,v.length-1);return v.length}for(var l=m.length,j=v.length;j>=m.length;j--){var q=v[j];if(!g(p,j)&&D(p,j,q)){l=j+1;break}}return l}function k(p,v){return S(p,v)===p.mask.length}function C(p,v){var O=p.maskChar,m=p.mask,l=p.prefix;if(!O){for((v=R(p,"",v,0)).length<l.length&&(v=l);v.length<m.length&&g(p,v.length);)v+=m[v.length];return v}if(v)return R(p,C(p,""),v,0);for(var j=0;j<m.length;j++)g(p,j)?v+=m[j]:v+=O;return v}function N(p,v,O,m){var l=O+m,j=p.maskChar,q=p.mask,re=p.prefix,L=v.split("");if(j)return L.map(function(Y,ne){return ne<O||l<=ne?Y:g(p,ne)?q[ne]:j}).join("");for(var F=l;F<L.length;F++)g(p,F)&&(L[F]="");return O=Math.max(re.length,O),L.splice(O,l-O),v=L.join(""),C(p,v)}function R(p,v,O,m){var l=p.mask,j=p.maskChar,q=p.prefix,re=O.split(""),L=k(p,v);return!j&&m>v.length&&(v+=l.slice(v.length,m)),re.every(function(F){for(;se=F,g(p,U=m)&&se!==l[U];){if(m>=v.length&&(v+=l[m]),Y=F,ne=m,j&&g(p,ne)&&Y===j)return!0;if(++m>=l.length)return!1}var Y,ne,U,se;return!D(p,m,F)&&F!==j||(m<v.length?v=j||L||m<q.length?v.slice(0,m)+F+v.slice(m+1):(v=v.slice(0,m)+F+v.slice(m),C(p,v)):j||(v+=F),++m<l.length)}),v}function T(p,v,O,m){var l=p.mask,j=p.maskChar,q=O.split(""),re=m;return q.every(function(L){for(;Y=L,g(p,F=m)&&Y!==l[F];)if(++m>=l.length)return!1;var F,Y;return(D(p,m,L)||L===j)&&m++,m<l.length}),m-re}function B(p,v){for(var O=v;0<=O;--O)if(!g(p,O))return O;return null}function A(p,v){for(var O=p.mask,m=v;m<O.length;++m)if(!g(p,m))return m;return null}function x(p){return p||p===0?p+"":""}function E(p,v,O,m,l){var j=p.mask,q=p.prefix,re=p.lastEditablePosition,L=v,F="",Y=0,ne=0,U=Math.min(l.start,O.start);return O.end>l.start?ne=(Y=T(p,m,F=L.slice(l.start,O.end),U))?l.length:0:L.length<m.length&&(ne=m.length-L.length),L=m,ne&&(ne===1&&!l.length&&(U=l.start===O.start?A(p,O.start):B(p,O.start)),L=N(p,L,U,ne)),L=R(p,L,F,U),(U+=Y)>=j.length?U=j.length:U<q.length&&!Y?U=q.length:U>=q.length&&U<re&&Y&&(U=A(p,U)),F||(F=null),{value:L=C(p,L),enteredString:F,selection:{start:U,end:U}}}function H(){var p=new RegExp("windows","i"),v=new RegExp("phone","i"),O=navigator.userAgent;return p.test(O)&&v.test(O)}function I(p){return typeof p=="function"}function X(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function G(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function me(p){return(G()?X():function(){return setTimeout(p,1e3/60)})(p)}function $(p){(G()||clearTimeout)(p)}var Be=function(p){function v(m){var l=p.call(this,m)||this;l.focused=!1,l.mounted=!1,l.previousSelection=null,l.selectionDeferId=null,l.saveSelectionLoopDeferId=null,l.saveSelectionLoop=function(){l.previousSelection=l.getSelection(),l.saveSelectionLoopDeferId=me(l.saveSelectionLoop)},l.runSaveSelectionLoop=function(){l.saveSelectionLoopDeferId===null&&l.saveSelectionLoop()},l.stopSaveSelectionLoop=function(){l.saveSelectionLoopDeferId!==null&&($(l.saveSelectionLoopDeferId),l.saveSelectionLoopDeferId=null,l.previousSelection=null)},l.getInputDOMNode=function(){if(!l.mounted)return null;var P=n.findDOMNode(s(s(l))),W=typeof window<"u"&&P instanceof window.Element;if(P&&!W)return null;if(P.nodeName!=="INPUT"&&(P=P.querySelector("input")),!P)throw new Error("react-input-mask: inputComponent doesn't contain input node");return P},l.getInputValue=function(){var P=l.getInputDOMNode();return P?P.value:null},l.setInputValue=function(P){var W=l.getInputDOMNode();W&&(l.value=P,W.value=P)},l.setCursorToEnd=function(){var P=S(l.maskOptions,l.value),W=A(l.maskOptions,P);W!==null&&l.setCursorPosition(W)},l.setSelection=function(P,W,Q){Q===void 0&&(Q={});var V=l.getInputDOMNode(),Z=l.isFocused();V&&Z&&(Q.deferred||y(V,P,W),l.selectionDeferId!==null&&$(l.selectionDeferId),l.selectionDeferId=me(function(){l.selectionDeferId=null,y(V,P,W)}),l.previousSelection={start:P,end:W,length:Math.abs(W-P)})},l.getSelection=function(){return u(l.getInputDOMNode())},l.getCursorPosition=function(){return l.getSelection().start},l.setCursorPosition=function(P){l.setSelection(P,P)},l.isFocused=function(){return l.focused},l.getBeforeMaskedValueChangeConfig=function(){var P=l.maskOptions,W=P.mask,Q=P.maskChar,V=P.permanents,Z=P.formatChars;return{mask:W,maskChar:Q,permanents:V,alwaysShowMask:!!l.props.alwaysShowMask,formatChars:Z}},l.isInputAutofilled=function(P,W,Q,V){var Z=l.getInputDOMNode();try{if(Z.matches(":-webkit-autofill"))return!0}catch{}return!l.focused||V.end<Q.length&&W.end===P.length},l.onChange=function(P){var W=s(s(l)).beforePasteState,Q=s(s(l)).previousSelection,V=l.props.beforeMaskedValueChange,Z=l.getInputValue(),ge=l.value,fe=l.getSelection();l.isInputAutofilled(Z,fe,ge,Q)&&(ge=C(l.maskOptions,""),Q={start:0,end:0,length:0}),W&&(Q=W.selection,ge=W.value,fe={start:Q.start+Z.length,end:Q.start+Z.length,length:0},Z=ge.slice(0,Q.start)+Z+ge.slice(Q.end),l.beforePasteState=null);var Me=E(l.maskOptions,Z,fe,ge,Q),Je=Me.enteredString,be=Me.selection,Ee=Me.value;if(I(V)){var $e=V({value:Ee,selection:be},{value:ge,selection:Q},Je,l.getBeforeMaskedValueChangeConfig());Ee=$e.value,be=$e.selection}l.setInputValue(Ee),I(l.props.onChange)&&l.props.onChange(P),l.isWindowsPhoneBrowser?l.setSelection(be.start,be.end,{deferred:!0}):l.setSelection(be.start,be.end)},l.onFocus=function(P){var W=l.props.beforeMaskedValueChange,Q=l.maskOptions,V=Q.mask,Z=Q.prefix;if(l.focused=!0,l.mounted=!0,V){if(l.value)S(l.maskOptions,l.value)<l.maskOptions.mask.length&&l.setCursorToEnd();else{var ge=C(l.maskOptions,Z),fe=C(l.maskOptions,ge),Me=S(l.maskOptions,fe),Je=A(l.maskOptions,Me),be={start:Je,end:Je};if(I(W)){var Ee=W({value:fe,selection:be},{value:l.value,selection:null},null,l.getBeforeMaskedValueChangeConfig());fe=Ee.value,be=Ee.selection}var $e=fe!==l.getInputValue();$e&&l.setInputValue(fe),$e&&I(l.props.onChange)&&l.props.onChange(P),l.setSelection(be.start,be.end)}l.runSaveSelectionLoop()}I(l.props.onFocus)&&l.props.onFocus(P)},l.onBlur=function(P){var W=l.props.beforeMaskedValueChange,Q=l.maskOptions.mask;if(l.stopSaveSelectionLoop(),l.focused=!1,Q&&!l.props.alwaysShowMask&&M(l.maskOptions,l.value)){var V="";I(W)&&(V=W({value:V,selection:null},{value:l.value,selection:l.previousSelection},null,l.getBeforeMaskedValueChangeConfig()).value);var Z=V!==l.getInputValue();Z&&l.setInputValue(V),Z&&I(l.props.onChange)&&l.props.onChange(P)}I(l.props.onBlur)&&l.props.onBlur(P)},l.onMouseDown=function(P){if(!l.focused&&document.addEventListener){l.mouseDownX=P.clientX,l.mouseDownY=P.clientY,l.mouseDownTime=new Date().getTime();var W=function Q(V){if(document.removeEventListener("mouseup",Q),l.focused){var Z=Math.abs(V.clientX-l.mouseDownX),ge=Math.abs(V.clientY-l.mouseDownY),fe=Math.max(Z,ge),Me=new Date().getTime()-l.mouseDownTime;(fe<=10&&Me<=200||fe<=5&&Me<=300)&&l.setCursorToEnd()}};document.addEventListener("mouseup",W)}I(l.props.onMouseDown)&&l.props.onMouseDown(P)},l.onPaste=function(P){I(l.props.onPaste)&&l.props.onPaste(P),P.defaultPrevented||(l.beforePasteState={value:l.getInputValue(),selection:l.getSelection()},l.setInputValue(""))},l.handleRef=function(P){l.props.children==null&&I(l.props.inputRef)&&l.props.inputRef(P)};var j=m.mask,q=m.maskChar,re=m.formatChars,L=m.alwaysShowMask,F=m.beforeMaskedValueChange,Y=m.defaultValue,ne=m.value;l.maskOptions=b(j,q,re),Y==null&&(Y=""),ne==null&&(ne=Y);var U=x(ne);if(l.maskOptions.mask&&(L||U)&&(U=C(l.maskOptions,U),I(F))){var se=m.value;m.value==null&&(se=Y),U=F({value:U,selection:null},{value:se=x(se),selection:null},null,l.getBeforeMaskedValueChangeConfig()).value}return l.value=U,l}a(v,p);var O=v.prototype;return O.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=H(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},O.componentDidUpdate=function(){var m=this.previousSelection,l=this.props,j=l.beforeMaskedValueChange,q=l.alwaysShowMask,re=l.mask,L=l.maskChar,F=l.formatChars,Y=this.maskOptions,ne=q||this.isFocused(),U=this.props.value!=null,se=U?x(this.props.value):this.value,P=m?m.start:null;if(this.maskOptions=b(re,L,F),this.maskOptions.mask){!Y.mask&&this.isFocused()&&this.runSaveSelectionLoop();var W=this.maskOptions.mask&&this.maskOptions.mask!==Y.mask;if(Y.mask||U||(se=this.getInputValue()),(W||this.maskOptions.mask&&(se||ne))&&(se=C(this.maskOptions,se)),W){var Q=S(this.maskOptions,se);(P===null||Q<P)&&(P=k(this.maskOptions,se)?Q:A(this.maskOptions,Q))}!this.maskOptions.mask||!M(this.maskOptions,se)||ne||U&&this.props.value||(se="");var V={start:P,end:P};if(I(j)){var Z=j({value:se,selection:V},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());se=Z.value,V=Z.selection}this.value=se;var ge=this.getInputValue()!==this.value;ge?(this.setInputValue(this.value),this.forceUpdate()):W&&this.forceUpdate();var fe=!1;V.start!=null&&V.end!=null&&(fe=!m||m.start!==V.start||m.end!==V.end),(fe||ge)&&this.setSelection(V.start,V.end)}else Y.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},O.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&$(this.selectionDeferId),this.stopSaveSelectionLoop()},O.render=function(){var m,l=this.props,j=(l.mask,l.alwaysShowMask,l.maskChar,l.formatChars,l.inputRef,l.beforeMaskedValueChange,l.children),q=i(l,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(j){I(j)||c(!1);var re=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],L=r({},q);re.forEach(function(Y){return delete L[Y]}),m=j(L),re.filter(function(Y){return m.props[Y]!=null&&m.props[Y]!==q[Y]}).length&&c(!1)}else m=t.createElement("input",r({ref:this.handleRef},q));var F={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(q.disabled||q.readOnly||(F.onChange=this.onChange,F.onPaste=this.onPaste,F.onMouseDown=this.onMouseDown),q.value!=null&&(F.value=this.value)),m=t.cloneElement(m,F)},v}(t.Component);return vt=Be,vt}var Br;function vo(){return Br||(Br=1,Rr.exports=bo()),Rr.exports}var wo=vo();const Do=En(wo);var So=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],Oo=["Input"],ko=["mask","maskChar","overrides"];function $r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$r(Object(n),!0).forEach(function(o){Mo(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$r(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Mo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ze(e){"@babel/helpers - typeof";return Ze=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},Ze(e)}function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ze.apply(this,arguments)}function Dt(e,t){if(e==null)return{};var n=Co(e,t),o,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)o=a[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Co(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,a;for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var Fr=h.forwardRef(function(e,t){e.startEnhancer,e.endEnhancer,e.error,e.positive;var n=e.onChange,o=e.onFocus,r=e.onBlur,a=e.value,i=e.disabled,s=e.readOnly,d=Dt(e,So);return h.createElement(Do,ze({onChange:n,onFocus:o,onBlur:r,value:a,disabled:i,readOnly:s},d),function(c){return h.createElement(Kn,ze({ref:t,onChange:n,onFocus:o,onBlur:r,value:a,disabled:i,readOnly:s},c))})});Fr.displayName="MaskOverride";function Wr(e){var t=e.mask,n=e.maskChar,o=e.overrides;o=o===void 0?{}:o;var r=o.Input,a=r===void 0?{}:r,i=Dt(o,Oo),s=Dt(e,ko),d=Fr,c={},y={};typeof a=="function"?d=a:Ze(a)==="object"&&(d=a.component||d,c=a.props||{},y=a.style||{}),Ze(c)==="object"&&(c=wt(wt({},c),{},{mask:c.mask||t,maskChar:c.maskChar||n}));var u=wt({Input:{component:d,props:c,style:y}},i);return h.createElement(Gn,ze({},s,{overrides:u}))}Wr.defaultProps={maskChar:" "};var St=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),Nr=[0,1,2,3,4,5,6],Po=[0,1,2,3,4,5,6,7,8,9,10,11],ae={high:"high",default:"default"},ke={startDate:"startDate",endDate:"endDate"},jo={locked:"locked"};function Yr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Le(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yr(Object(n),!0).forEach(function(o){Ho(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yr(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ho(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ot=K("label",function(e){var t=e.$disabled,n=e.$theme,o=n.colors,r=n.typography;return Le(Le({},r.font250),{},{width:"100%",color:t?o.contentSecondary:o.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});Ot.displayName="Label",Ot.displayName="Label";var kt=K("span",function(e){var t=e.$theme.sizing;return{display:"flex",width:"100%",marginTop:t.scale300,marginRight:0,marginBottom:t.scale300,marginLeft:0}});kt.displayName="LabelContainer",kt.displayName="LabelContainer";var Mt=K("span",function(e){var t=e.$disabled,n=e.$counterError,o=e.$theme,r=o.colors,a=o.typography;return Le(Le({},a.font100),{},{flex:0,width:"100%",color:n?r.negative400:t?r.contentSecondary:r.contentPrimary})});Mt.displayName="LabelEndEnhancer",Mt.displayName="LabelEndEnhancer";var Ct=K("div",function(e){var t=e.$error,n=e.$positive,o=e.$theme,r=o.colors,a=o.sizing,i=o.typography,s=r.contentSecondary;return t?s=r.negative400:n&&(s=r.positive400),Le(Le({},i.font100),{},{color:s,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:a.scale300,marginRight:0,marginBottom:a.scale300,marginLeft:0})});Ct.displayName="Caption",Ct.displayName="Caption";var Pt=K("div",function(e){var t=e.$theme.sizing;return{width:"100%",marginBottom:t.scale600}});Pt.displayName="ControlContainer",Pt.displayName="ControlContainer";function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},He.apply(this,arguments)}function et(e){"@babel/helpers - typeof";return et=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},et(e)}function xo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eo(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Ao(e,t,n){return t&&Eo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Io(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&&jt(e,t)}function jt(e,t){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},jt(e,t)}function Lo(e){var t=Bo();return function(){var n=tt(e),o;if(t){var r=tt(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return Ro(this,o)}}function Ro(e,t){if(t&&(et(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return To(e)}function To(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bo(){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 tt(e){return tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tt(e)}function $o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fo(e,t,n,o){return t&&typeof t!="boolean"?typeof t=="function"?t(o):t:n&&typeof n!="boolean"?typeof n=="function"?n(o):n:e?typeof e=="function"?e(o):e:null}var Ht=function(e){Io(n,e);var t=Lo(n);function n(){return xo(this,n),t.apply(this,arguments)}return Ao(n,[{key:"render",value:function(){var o=this.props,r=o.overrides,a=r.Label,i=r.LabelEndEnhancer,s=r.LabelContainer,d=r.Caption,c=r.ControlContainer,y=o.label,u=o.caption,f=o.disabled,w=o.error,b=o.positive,g=o.htmlFor,D=o.children,M=o.counter,S=h.Children.only(D).props,k={$disabled:!!f,$error:!!w,$positive:!!b},C=Fe(a)||Ot,N=Fe(i)||Mt,R=Fe(s)||kt,T=Fe(d)||Ct,B=Fe(c)||Pt,A=Fo(u,w,b,k),x=this.props.labelEndEnhancer;if(M){var E=null,H=null,I=null;et(M)==="object"&&(H=M.length,E=M.maxLength,I=M.error),E=E||S.maxLength,H==null&&typeof S.value=="string"&&(H=S.value.length),H==null&&(H=0),k.$length=H,E==null?x||(x="".concat(H)):(k.$maxLength=H,x||(x="".concat(H,"/").concat(E)),H>E&&I==null&&(I=!0)),I&&(k.$error=!0,k.$counterError=!0)}return h.createElement(h.Fragment,null,y&&h.createElement(R,He({},k,We(s)),h.createElement(C,He({"data-baseweb":"form-control-label",htmlFor:g||S.id},k,We(a)),typeof y=="function"?y(k):y),!!x&&h.createElement(N,He({},k,We(i)),typeof x=="function"?x(k):x)),h.createElement(An,null,function(X){return h.createElement(B,He({"data-baseweb":"form-control-container"},k,We(c)),h.Children.map(D,function(G,me){if(G){var $=G.key||String(me);return h.cloneElement(G,{key:$,"aria-errormessage":w?X:null,"aria-describedby":u||b?X:null,disabled:S.disabled||f,error:typeof S.error<"u"?S.error:k.$error,positive:typeof S.positive<"u"?S.positive:k.$positive})}}),(!!u||!!w||b)&&h.createElement(T,He({"data-baseweb":"form-control-caption",id:X},k,We(d)),A))}))}}]),n}(h.Component);$o(Ht,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Vr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zr(Object(n),!0).forEach(function(o){Wo(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Wo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var No=function(e){return Po.map(function(t){return{id:t.toString(),label:e(t)}})},Yo=function(e,t){return e.map(function(n){return t.includes(Number(n.id))?n:Vr(Vr({},n),{},{disabled:!0})})},zo=function(e){var t=e.filterMonthsList,n=e.formatMonthLabel,o=No(n);return t&&(o=Yo(o,t)),o};function Vo(e){var t=e.$range,n=t===void 0?!1:t,o=e.$disabled,r=o===void 0?!1:o,a=e.$isHighlighted,i=a===void 0?!1:a,s=e.$isHovered,d=s===void 0?!1:s,c=e.$selected,y=c===void 0?!1:c,u=e.$hasRangeSelected,f=u===void 0?!1:u,w=e.$startDate,b=w===void 0?!1:w,g=e.$endDate,D=g===void 0?!1:g,M=e.$pseudoSelected,S=M===void 0?!1:M,k=e.$hasRangeHighlighted,C=k===void 0?!1:k,N=e.$pseudoHighlighted,R=N===void 0?!1:N,T=e.$hasRangeOnRight,B=T===void 0?!1:T,A=e.$startOfMonth,x=A===void 0?!1:A,E=e.$endOfMonth,H=E===void 0?!1:E,I=e.$outsideMonth,X=I===void 0?!1:I;return"".concat(+n).concat(+r).concat(+(i||d)).concat(+y).concat(+f).concat(+b).concat(+D).concat(+S).concat(+C).concat(+R).concat(+(C&&!R&&B)).concat(+(C&&!R&&!B)).concat(+x).concat(+H).concat(+X)}function _o(e,t){return Xo(e)||Qo(e,t)||Uo(e,t)||qo()}function qo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uo(e,t){if(e){if(typeof e=="string")return _r(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 _r(e,t)}}function _r(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Qo(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var o=[],r=!0,a=!1,i,s;try{for(n=n.call(e);!(r=(i=n.next()).done)&&(o.push(i.value),!(t&&o.length===t));r=!0);}catch(d){a=!0,s=d}finally{try{!r&&n.return!=null&&n.return()}finally{if(a)throw s}}return o}}function Xo(e){if(Array.isArray(e))return e}function qr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qr(Object(n),!0).forEach(function(o){Ve(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qr(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xt=K("div",function(e){var t=e.$separateRangeInputs;return oe({width:"100%"},t?{display:"flex",justifyContent:"center"}:{})});xt.displayName="StyledInputWrapper",xt.displayName="StyledInputWrapper";var Et=K("div",function(e){var t=e.$theme;return oe(oe({},t.typography.LabelMedium),{},{marginBottom:t.sizing.scale300})});Et.displayName="StyledInputLabel",Et.displayName="StyledInputLabel";var At=K("div",function(e){var t=e.$theme;return{width:"100%",marginRight:t.sizing.scale300}});At.displayName="StyledStartDate",At.displayName="StyledStartDate";var It=K("div",function(e){return e.$theme,{width:"100%"}});It.displayName="StyledEndDate",It.displayName="StyledEndDate";var Lt=K("div",function(e){var t=e.$theme,n=t.typography,o=t.colors,r=t.borders;return oe(oe({},n.font200),{},{color:o.calendarForeground,backgroundColor:o.calendarBackground,textAlign:"center",borderTopLeftRadius:r.surfaceBorderRadius,borderTopRightRadius:r.surfaceBorderRadius,borderBottomRightRadius:r.surfaceBorderRadius,borderBottomLeftRadius:r.surfaceBorderRadius,display:"inline-block"})});Lt.displayName="StyledRoot",Lt.displayName="StyledRoot";var Rt=K("div",function(e){var t=e.$orientation;return{display:"flex",flexDirection:t===St.vertical?"column":"row"}});Rt.displayName="StyledMonthContainer",Rt.displayName="StyledMonthContainer";var Tt=K("div",function(e){var t=e.$theme.sizing,n=e.$density;return{paddingTop:t.scale300,paddingBottom:n===ae.high?t.scale400:t.scale300,paddingLeft:t.scale500,paddingRight:t.scale500}});Tt.displayName="StyledCalendarContainer",Tt.displayName="StyledCalendarContainer";var rt=K("div",function(e){var t=e.$theme,n=t.direction==="rtl"?"right":"left";return{marginBottom:t.sizing.scale600,paddingLeft:t.sizing.scale600,paddingRight:t.sizing.scale600,textAlign:n}});rt.displayName="StyledSelectorContainer",rt.displayName="StyledSelectorContainer";var Bt=K("div",function(e){var t=e.$theme,n=t.typography,o=t.borders,r=t.colors,a=t.sizing,i=e.$density;return oe(oe({},i===ae.high?n.LabelMedium:n.LabelLarge),{},{color:r.calendarHeaderForeground,display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:a.scale600,paddingBottom:a.scale300,paddingLeft:a.scale600,paddingRight:a.scale600,backgroundColor:r.calendarHeaderBackground,borderTopLeftRadius:o.surfaceBorderRadius,borderTopRightRadius:o.surfaceBorderRadius,borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:i===ae.high?"calc(".concat(a.scale800," + ").concat(a.scale0,")"):a.scale950})});Bt.displayName="StyledCalendarHeader",Bt.displayName="StyledCalendarHeader";var $t=K("div",function(e){return{color:e.$theme.colors.calendarHeaderForeground,backgroundColor:e.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});$t.displayName="StyledMonthHeader",$t.displayName="StyledMonthHeader";var Ft=K("button",function(e){var t=e.$theme,n=t.typography,o=t.colors,r=e.$isFocusVisible,a=e.$density;return oe(oe({},a===ae.high?n.LabelMedium:n.LabelLarge),{},{alignItems:"center",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,color:o.calendarHeaderForeground,cursor:"pointer",display:"flex",outline:"none",":focus":{boxShadow:r?"0 0 0 3px ".concat(o.accent):"none"}})});Ft.displayName="StyledMonthYearSelectButton",Ft.displayName="StyledMonthYearSelectButton";var Wt=K("span",function(e){var t=e.$theme.direction==="rtl"?"marginRight":"marginLeft";return Ve({alignItems:"center",display:"flex"},t,e.$theme.sizing.scale500)});Wt.displayName="StyledMonthYearSelectIconContainer",Wt.displayName="StyledMonthYearSelectIconContainer";function Ur(e){var t=e.$theme,n=e.$disabled,o=e.$isFocusVisible;return{boxSizing:"border-box",display:"flex",color:n?t.colors.calendarHeaderForegroundDisabled:t.colors.calendarHeaderForeground,cursor:n?"default":"pointer",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",marginBottom:0,marginTop:0,outline:"none",":focus":n?{}:{boxShadow:o?"0 0 0 3px ".concat(t.colors.accent):"none"}}}var Nt=K("button",Ur);Nt.displayName="StyledPrevButton",Nt.displayName="StyledPrevButton";var Yt=K("button",Ur);Yt.displayName="StyledNextButton",Yt.displayName="StyledNextButton";var zt=K("div",function(e){return{display:"inline-block"}});zt.displayName="StyledMonth",zt.displayName="StyledMonth";var Vt=K("div",function(e){var t=e.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:t.scale0}});Vt.displayName="StyledWeek",Vt.displayName="StyledWeek";function J(e,t){var n,o=e.substr(0,12)+"1"+e.substr(13),r=e.substr(0,13)+"1"+e.substr(14);return n={},Ve(n,e,t),Ve(n,o,t),Ve(n,r,t),n}function _t(e,t){var n=t.colors,o={":before":{content:null},":after":{content:null}},r=o,a={color:n.calendarForegroundDisabled,":before":{content:null},":after":{content:null}},i={color:n.calendarForegroundDisabled,":before":{borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",backgroundColor:"transparent"},":after":{borderTopLeftRadius:"0%",borderTopRightRadius:"0%",borderBottomLeftRadius:"0%",borderBottomRightRadius:"0%",borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}},s={":before":{content:null}},d=1;e&&e[d]==="1"&&(r=a);var c=Object.assign({},J("001000000000000",{color:n.calendarDayForegroundPseudoSelected}),J("000100000000000",{color:n.calendarDayForegroundSelected}),J("001100000000000",{color:n.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},J("000000000000001",i),J("101000000000000",s),J("101010000000000",s),J("100100000000000",{color:n.calendarDayForegroundSelected}),J("101100000000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),J("100111100000000",{color:n.calendarDayForegroundSelected,":before":{content:null}}),J("101111100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),J("100111000000000",{color:n.calendarDayForegroundSelected}),J("100110100000000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),J("100100001010000",{color:n.calendarDayForegroundSelected}),J("100100001001000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),J("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},J("100010010000000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},J("100000001100000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),J("101111000000000",{color:n.calendarDayForegroundSelectedHighlighted}),J("101110100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),J("101010010000000",{color:n.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),J("100000000000001",i),J("100000001010001",i),J("100000001001001",i),J("100010000000001",i));return c[e]||r}var qt=K("div",function(e){var t=e.$disabled,n=e.$isFocusVisible,o=e.$isHighlighted,r=e.$peekNextMonth,a=e.$pseudoSelected,i=e.$range,s=e.$selected,d=e.$outsideMonth,c=e.$outsideMonthWithinRange,y=e.$hasDateLabel,u=e.$density,f=e.$hasLockedBehavior,w=e.$selectedInput,b=e.$value,g=e.$theme,D=g.colors,M=g.typography,S=g.sizing,k=Vo(e),C;y?u===ae.high?C="60px":C="70px":u===ae.high?C="40px":C="48px";var N=Array.isArray(b)?b:[b,null],R=_o(N,2),T=R[0],B=R[1],A=w===ke.startDate?B!==null&&typeof B<"u":T!==null&&typeof T<"u",x=i&&!(f&&!A);return oe(oe(oe({},u===ae.high?M.ParagraphSmall:M.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:t||!r&&d?"default":"pointer",color:D.calendarForeground,display:"inline-block",width:u===ae.high?"42px":"50px",height:C,lineHeight:u===ae.high?S.scale700:S.scale900,textAlign:"center",paddingTop:S.scale300,paddingBottom:S.scale300,paddingLeft:S.scale300,paddingRight:S.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},_t(k,e.$theme)),{},{":after":oe(oe({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:n&&(!d||r)?"0 0 0 3px ".concat(D.accent):"none",backgroundColor:s?D.calendarDayBackgroundSelectedHighlighted:a&&o?D.calendarDayBackgroundPseudoSelectedHighlighted:D.calendarBackground,height:y?"100%":u===ae.high?"42px":"50px",width:"100%",position:"absolute",top:y?0:"-1px",left:0,paddingTop:S.scale200,paddingBottom:S.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:D.borderSelected,borderBottomColor:D.borderSelected,borderRightColor:D.borderSelected,borderLeftColor:D.borderSelected,borderTopLeftRadius:y?S.scale800:"100%",borderTopRightRadius:y?S.scale800:"100%",borderBottomLeftRadius:y?S.scale800:"100%",borderBottomRightRadius:y?S.scale800:"100%"},_t(k,e.$theme)[":after"]||{}),c?{content:null}:{})},x?{":before":oe(oe({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:D.mono300,position:"absolute",height:"100%",width:"50%",top:0,left:"50%",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftWidth:"0",borderRightWidth:"0",borderTopStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},_t(k,e.$theme)[":before"]||{}),c?{backgroundColor:D.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});qt.displayName="StyledDay",qt.displayName="StyledDay";var Ut=K("div",function(e){var t=e.$theme,n=t.typography,o=t.colors,r=e.$selected;return oe(oe({},n.ParagraphXSmall),{},{color:r?o.contentInverseTertiary:o.contentTertiary})});Ut.displayName="StyledDayLabel",Ut.displayName="StyledDayLabel";var Qt=K("div",function(e){var t=e.$theme,n=t.typography,o=t.colors,r=t.sizing,a=e.$density;return oe(oe({},n.LabelMedium),{},{color:o.contentTertiary,boxSizing:"border-box",position:"relative",cursor:"default",display:"inline-block",width:a===ae.high?"42px":"50px",height:a===ae.high?"40px":"48px",textAlign:"center",lineHeight:r.scale900,paddingTop:r.scale300,paddingBottom:r.scale300,paddingLeft:r.scale200,paddingRight:r.scale200,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,backgroundColor:"transparent"})});Qt.displayName="StyledWeekdayHeader",Qt.displayName="StyledWeekdayHeader";function Xt(e){"@babel/helpers - typeof";return Xt=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},Xt(e)}function he(){return he=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},he.apply(this,arguments)}function ve(e,t){return Zo(e)||Jo(e,t)||Ko(e,t)||Go()}function Go(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as V,r as n,u as N,bC as R,a as P,bS as U,j as m,l as M}from"./index-
|
|
1
|
+
import{c as V,r as n,u as N,bC as R,a as P,bS as U,j as m,l as M}from"./index-B2QqSXxG.js";const w=V("iframe",{target:"evvcert0"})(({theme:r})=>({colorScheme:"normal",border:"none",padding:r.spacing.none,margin:r.spacing.none,width:"100%",aspectRatio:"16 / 9"}),""),j=M.getLogger("Video"),x={width:"100%"};function O({element:r,endpoints:i,elementMgr:p}){const o=n.useRef(null),{type:h,url:v,startTime:a,subtitles:y,endTime:s,loop:d,autoplay:f,muted:g}=r,u=N(v),c=R(y);let S=P(u);const T=n.useMemo(()=>{if(!r.id)return!0;const e=p.getElementState(r.id,"preventAutoplay");return e||p.setElementState(r.id,"preventAutoplay",!0),e??!1},[r.id,p]),E=n.useMemo(()=>JSON.stringify(c?c.map(e=>i.buildMediaURL(`${e.url}`)):[]),[c,i]);n.useEffect(()=>{const e=JSON.parse(E);e.length!==0&&e.forEach(t=>{i.checkSourceUrlResponse(t,"Video Subtitle")})},[E,i]),n.useEffect(()=>{o.current&&(o.current.currentTime=a)},[a]),n.useEffect(()=>{const e=o.current,t=()=>{e&&(e.currentTime=r.startTime)};return e&&e.addEventListener("loadedmetadata",t),()=>{e&&e.removeEventListener("loadedmetadata",t)}},[r]),n.useEffect(()=>{const e=o.current;if(!e)return;let t=!1;const l=()=>{s>0&&e.currentTime>=s&&(d?(e.currentTime=a||0,e.play()):t||(t=!0,e.pause()))};return s>0&&e.addEventListener("timeupdate",l),()=>{e&&s>0&&e.removeEventListener("timeupdate",l)}},[s,d,a]),n.useEffect(()=>{const e=o.current;if(!e)return;const t=()=>{d&&(e.currentTime=a||0,e.play())};return e.addEventListener("ended",t),()=>{e&&e.removeEventListener("ended",t)}},[d,a]);const b=e=>{const t=new URL(e);if(a&&!isNaN(a)&&t.searchParams.append("start",a.toString()),s&&!isNaN(s)&&t.searchParams.append("end",s.toString()),d){t.searchParams.append("loop","1");const l=t.pathname.split("/").pop();l&&t.searchParams.append("playlist",l)}return f&&t.searchParams.append("autoplay","1"),g&&t.searchParams.append("mute","1"),t.toString()};if(h===U.Type.YOUTUBE_IFRAME)return m.jsx(w,{className:"stVideo","data-testid":"stVideo",title:u,src:b(u),allow:"autoplay; encrypted-media",allowFullScreen:!0});const L=e=>{const t=e.currentTarget.src;j.error(`Client Error: Video source error - ${t}`),i.sendClientErrorToHost("Video","Video source failed to load","onerror triggered",t)};return m.jsx("video",{className:"stVideo","data-testid":"stVideo",ref:o,controls:!0,muted:g,autoPlay:f&&!T,src:i.buildMediaURL(u),style:x,crossOrigin:S,onError:L,children:c&&c.map((e,t)=>m.jsx("track",{kind:"captions",src:i.buildMediaURL(`${e.url}`),label:`${e.label}`,default:t===0,"data-testid":"stVideoSubtitle"},t))})}const $=n.memo(O);export{$ as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as Pe,c3 as Z,r as I,cA as dt,cn as ht,c4 as G,cB as ft,cC as pt,c as Ae,b1 as gt,cf as mt,ap as vt,bl as bt,d0 as yt,j as ee,b$ as wt,c0 as kt,ch as Tt,c1 as xt,bJ as Ot,J as Mt,d1 as Oe}from"./index-DCNLpqIv.js";import{s as Fe}from"./sprintf-D7DtBTRn.js";import{a as Rt}from"./useBasicWidgetState-9vtYd9vP.js";import"./FormClearHelper-fvwQICEk.js";var le={},X={},de={},Le={},_e;function Me(){return _e||(_e=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Direction=void 0,function(n){n.Right="to right",n.Left="to left",n.Down="to bottom",n.Up="to top"}(e.Direction||(e.Direction={}))}(Le)),Le}var ze;function Ve(){return ze||(ze=1,function(e){var n=de&&de.__spreadArray||function(o,s,c){if(c||arguments.length===2)for(var m=0,D=s.length,R;m<D;m++)(R||!(m in s))&&(R||(R=Array.prototype.slice.call(s,0,m)),R[m]=s[m]);return o.concat(R||Array.prototype.slice.call(s))};Object.defineProperty(e,"__esModule",{value:!0}),e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var r=Pe(),i=Me(),g=function(o){var s=o.toString().split(".")[1];return s?s.length:0};e.getStepDecimals=g;function x(o){return o.touches&&o.touches.length||o.changedTouches&&o.changedTouches.length}e.isTouchEvent=x;function l(o,s,c){var m=(s-o)/c,D=8,R=Number(m.toFixed(D));return parseInt(R.toString(),10)===R}e.isStepDivisible=l;function f(o,s,c,m,D,R,O){var b=1e11;if(o=Math.round(o*b)/b,!R){var $=O[s-1],j=O[s+1];if($&&$>o)return $;if(j&&j<o)return j}if(o>m)return m;if(o<c)return c;var C=Math.floor(o*b-c*b)%Math.floor(D*b),N=Math.floor(o*b-Math.abs(C)),H=C===0?o:N/b,F=Math.abs(C/b)<D/2?H:H+D,U=(0,e.getStepDecimals)(D);return parseFloat(F.toFixed(U))}e.normalizeValue=f;function L(o,s,c){return(o-s)/(c-s)}e.relativeValue=L;function A(o){return o===i.Direction.Up||o===i.Direction.Down}e.isVertical=A;function z(o,s,c){if(s>=c)throw new RangeError("min (".concat(s,") is equal/bigger than max (").concat(c,")"));if(o<s)throw new RangeError("value (".concat(o,") is smaller than min (").concat(s,")"));if(o>c)throw new RangeError("value (".concat(o,") is bigger than max (").concat(c,")"))}e.checkBoundaries=z;function k(o,s,c){return o<s?s:o>c?c:o}e.checkValuesAgainstBoundaries=k;function y(o){if(!(o.length<2)&&!o.slice(1).every(function(s,c){return o[c]<=s}))throw new RangeError("values={[".concat(o,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=y;function h(o){var s=window.getComputedStyle(o);return{top:parseInt(s["margin-top"],10),bottom:parseInt(s["margin-bottom"],10),left:parseInt(s["margin-left"],10),right:parseInt(s["margin-right"],10)}}e.getMargin=h;function t(o){var s=window.getComputedStyle(o);return{top:parseInt(s["padding-top"],10)+parseInt(s["border-top-width"],10),bottom:parseInt(s["padding-bottom"],10)+parseInt(s["border-bottom-width"],10),left:parseInt(s["padding-left"],10)+parseInt(s["border-left-width"],10),right:parseInt(s["padding-right"],10)+parseInt(s["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(o,s,c){var m=c?-1:1;o.forEach(function(D,R){return p(D,m*s[R].x,s[R].y)})}e.translateThumbs=a;function u(o,s,c,m){for(var D=0,R=_(o[0],s,c,m),O=1;O<o.length;O++){var b=_(o[O],s,c,m);b<R&&(R=b,D=O)}return D}e.getClosestThumbIndex=u;function p(o,s,c){o.style.transform="translate(".concat(s,"px, ").concat(c,"px)")}e.translate=p;var d=function(o){var s=[],c=null,m=function(){for(var D=[],R=0;R<arguments.length;R++)D[R]=arguments[R];s=D,!c&&(c=requestAnimationFrame(function(){c=null,o.apply(void 0,s)}))};return m};e.schd=d;function w(o,s,c){var m=o.slice(0);return m[s]=c,m}e.replaceAt=w;function E(o){var s=o.values,c=o.colors,m=o.min,D=o.max,R=o.direction,O=R===void 0?i.Direction.Right:R,b=o.rtl,$=b===void 0?!1:b;$&&O===i.Direction.Right?O=i.Direction.Left:$&&i.Direction.Left&&(O=i.Direction.Right);var j=s.slice(0).sort(function(N,H){return N-H}).map(function(N){return(N-m)/(D-m)*100}),C=j.reduce(function(N,H,F){return"".concat(N,", ").concat(c[F]," ").concat(H,"%, ").concat(c[F+1]," ").concat(H,"%")},"");return"linear-gradient(".concat(O,", ").concat(c[0]," 0%").concat(C,", ").concat(c[c.length-1]," 100%)")}e.getTrackBackground=E;function T(){}e.voidFn=T;function M(o){throw new Error("Didn't expect to get here")}e.assertUnreachable=M;var v=function(o,s,c,m,D){D===void 0&&(D=function(O){return O});var R=Math.ceil(n([o],Array.from(o.children),!0).reduce(function(O,b){var $=Math.ceil(b.getBoundingClientRect().width);if(b.innerText&&b.innerText.includes(c)&&b.childElementCount===0){var j=b.cloneNode(!0);j.innerHTML=D(s.toFixed(m)),j.style.visibility="hidden",document.body.appendChild(j),$=Math.ceil(j.getBoundingClientRect().width),document.body.removeChild(j)}return $>O?$:O},o.getBoundingClientRect().width));return R},B=function(o,s,c,m,D,R,O){O===void 0&&(O=function(j){return j});var b=[],$=function(j){var C=v(c[j],m[j],D,R,O),N=s[j].x;s.forEach(function(H,F){var U=H.x,V=v(c[F],m[F],D,R,O);j!==F&&(N>=U&&N<=U+V||N+C>=U&&N+C<=U+V)&&(b.includes(F)||(b.push(j),b.push(F),b=n(n([],b,!0),[j,F],!1),$(F)))})};return $(o),Array.from(new Set(b.sort()))},S=function(o,s,c,m,D,R){m===void 0&&(m=.1),D===void 0&&(D=" - "),R===void 0&&(R=function(F){return F});var O=(0,e.getStepDecimals)(m),b=(0,r.useState)({}),$=b[0],j=b[1],C=(0,r.useState)(R(s[c].toFixed(O))),N=C[0],H=C[1];return(0,r.useEffect)(function(){if(o){var F=o.getThumbs();if(F.length<1)return;var U={},V=o.getOffsets(),te=B(c,V,F,s,D,O,R),oe=R(s[c].toFixed(O));if(te.length){var ne=te.reduce(function(J,ce,se,ue){return J.length?n(n([],J,!0),[V[ue[se]].x],!1):[V[ue[se]].x]},[]);if(Math.min.apply(Math,ne)===V[c].x){var re=[];te.forEach(function(J){re.push(s[J].toFixed(O))}),oe=Array.from(new Set(re.sort(function(J,ce){return parseFloat(J)-parseFloat(ce)}))).map(R).join(D);var Te=Math.min.apply(Math,ne),ie=Math.max.apply(Math,ne),xe=F[te[ne.indexOf(ie)]].getBoundingClientRect().width;U.left="".concat(Math.abs(Te-(ie+xe))/2,"px"),U.transform="translate(-50%, 0)"}else U.visibility="hidden"}H(oe),j(U)}},[o,s]),[N,$]};e.useThumbOverlap=S;function _(o,s,c,m){var D=o.getBoundingClientRect(),R=D.left,O=D.top,b=D.width,$=D.height;return A(m)?Math.abs(c-(O+$/2)):Math.abs(s-(R+b/2))}}(de)),de}var Ne;function Dt(){if(Ne)return X;Ne=1;var e=X&&X.__extends||function(){var k=function(y,h){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(t[u]=a[u])},k(y,h)};return function(y,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");k(y,h);function t(){this.constructor=y}y.prototype=h===null?Object.create(h):(t.prototype=h.prototype,new t)}}(),n=X&&X.__createBinding||(Object.create?function(k,y,h,t){t===void 0&&(t=h);var a=Object.getOwnPropertyDescriptor(y,h);(!a||("get"in a?!y.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return y[h]}}),Object.defineProperty(k,t,a)}:function(k,y,h,t){t===void 0&&(t=h),k[t]=y[h]}),r=X&&X.__setModuleDefault||(Object.create?function(k,y){Object.defineProperty(k,"default",{enumerable:!0,value:y})}:function(k,y){k.default=y}),i=X&&X.__importStar||function(k){if(k&&k.__esModule)return k;var y={};if(k!=null)for(var h in k)h!=="default"&&Object.prototype.hasOwnProperty.call(k,h)&&n(y,k,h);return r(y,k),y},g=X&&X.__spreadArray||function(k,y,h){if(h||arguments.length===2)for(var t=0,a=y.length,u;t<a;t++)(u||!(t in y))&&(u||(u=Array.prototype.slice.call(y,0,t)),u[t]=y[t]);return k.concat(u||Array.prototype.slice.call(y))};Object.defineProperty(X,"__esModule",{value:!0});var x=i(Pe()),l=Ve(),f=Me(),L=["ArrowRight","ArrowUp","k","PageUp"],A=["ArrowLeft","ArrowDown","j","PageDown"],z=function(k){e(y,k);function y(h){var t=k.call(this,h)||this;if(t.trackRef=x.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(a,u){return u}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var a=t.props,u=a.direction,p=a.values,d=a.min,w=a.max,E=t.trackRef.current,T=E.getBoundingClientRect(),M=(0,l.getPaddingAndBorder)(E);return t.getThumbs().map(function(v,B){var S={x:0,y:0},_=v.getBoundingClientRect(),o=(0,l.getMargin)(v);switch(u){case f.Direction.Right:return S.x=(o.left+M.left)*-1,S.y=((_.height-T.height)/2+M.top)*-1,S.x+=T.width*(0,l.relativeValue)(p[B],d,w)-_.width/2,S;case f.Direction.Left:return S.x=(o.right+M.right)*-1,S.y=((_.height-T.height)/2+M.top)*-1,S.x+=T.width-T.width*(0,l.relativeValue)(p[B],d,w)-_.width/2,S;case f.Direction.Up:return S.x=((_.width-T.width)/2+o.left+M.left)*-1,S.y=-M.left,S.y+=T.height-T.height*(0,l.relativeValue)(p[B],d,w)-_.height/2,S;case f.Direction.Down:return S.x=((_.width-T.width)/2+o.left+M.left)*-1,S.y=-M.left,S.y+=T.height*(0,l.relativeValue)(p[B],d,w)-_.height/2,S;default:return(0,l.assertUnreachable)(u)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(a){return a.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(a){return t.getThumbs().findIndex(function(u){return u===a.target||u.contains(a.target)})},t.addTouchEvents=function(a){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(a){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(a){var u;if(a.button===0)if(a.persist(),a.preventDefault(),t.addMouseEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(d){var w;return(w=d.current)===null||w===void 0?void 0:w.contains(a.target)}))return;t.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return t.onMove(a.clientX,a.clientY)})}else{var p=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(d){return d.current}),a.clientX,a.clientY,t.props.direction);(u=t.thumbRefs[p].current)===null||u===void 0||u.focus(),t.setState({draggedThumbIndex:p},function(){return t.onMove(a.clientX,a.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(a){var u;if(a.persist(),t.addTouchEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(d){var w;return(w=d.current)===null||w===void 0?void 0:w.contains(a.target)}))return;t.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var p=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(d){return d.current}),a.touches[0].clientX,a.touches[0].clientY,t.props.direction);(u=t.thumbRefs[p].current)===null||u===void 0||u.focus(),t.setState({draggedThumbIndex:p},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},t.onMouseOrTouchStart=function(a){if(!t.props.disabled){var u=(0,l.isTouchEvent)(a);if(!(!u&&a.button!==0)){var p=t.getTargetIndex(a);p!==-1&&(u?t.addTouchEvents(a):t.addMouseEvents(a),t.setState({draggedThumbIndex:p,thumbZIndexes:t.state.thumbZIndexes.map(function(d,w){return w===p?Math.max.apply(Math,t.state.thumbZIndexes):d<=t.state.thumbZIndexes[p]?d:d-1})}))}}},t.onMouseMove=function(a){a.preventDefault(),t.onMove(a.clientX,a.clientY)},t.onTouchMove=function(a){a.preventDefault(),t.onMove(a.touches[0].clientX,a.touches[0].clientY)},t.onKeyDown=function(a){var u=t.props,p=u.values,d=u.onChange,w=u.step,E=u.rtl,T=u.direction,M=t.state.isChanged,v=t.getTargetIndex(a.nativeEvent),B=E||T===f.Direction.Left||T===f.Direction.Down?-1:1;v!==-1&&(L.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:v,isChanged:!0}),d((0,l.replaceAt)(p,v,t.normalizeValue(p[v]+B*(a.key==="PageUp"?w*10:w),v)))):A.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:v,isChanged:!0}),d((0,l.replaceAt)(p,v,t.normalizeValue(p[v]-B*(a.key==="PageDown"?w*10:w),v)))):a.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){M&&t.fireOnFinalChange()}):M&&t.fireOnFinalChange())},t.onKeyUp=function(a){var u=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){u&&t.fireOnFinalChange()})},t.onMove=function(a,u){var p=t.state,d=p.draggedThumbIndex,w=p.draggedTrackPos,E=t.props,T=E.direction,M=E.min,v=E.max,B=E.onChange,S=E.values,_=E.step,o=E.rtl;if(d===-1&&w[0]===-1&&w[1]===-1)return null;var s=t.trackRef.current;if(!s)return null;var c=s.getBoundingClientRect(),m=(0,l.isVertical)(T)?c.height:c.width;if(w[0]!==-1&&w[1]!==-1){var D=a-w[0],R=u-w[1],O=0;switch(T){case f.Direction.Right:case f.Direction.Left:O=D/m*(v-M);break;case f.Direction.Down:case f.Direction.Up:O=R/m*(v-M);break;default:(0,l.assertUnreachable)(T)}if(o&&(O*=-1),Math.abs(O)>=_/2){for(var b=0;b<t.thumbRefs.length;b++){if(S[b]===v&&Math.sign(O)===1||S[b]===M&&Math.sign(O)===-1)return;var $=S[b]+O;$>v?O=v-S[b]:$<M&&(O=M-S[b])}for(var j=S.slice(0),b=0;b<t.thumbRefs.length;b++)j=(0,l.replaceAt)(j,b,t.normalizeValue(S[b]+O,b));t.setState({draggedTrackPos:[a,u]}),B(j)}}else{var C=0;switch(T){case f.Direction.Right:C=(a-c.left)/m*(v-M)+M;break;case f.Direction.Left:C=(m-(a-c.left))/m*(v-M)+M;break;case f.Direction.Down:C=(u-c.top)/m*(v-M)+M;break;case f.Direction.Up:C=(m-(u-c.top))/m*(v-M)+M;break;default:(0,l.assertUnreachable)(T)}o&&(C=v+M-C),Math.abs(S[d]-C)>=_/2&&B((0,l.replaceAt)(S,d,t.normalizeValue(C,d)))}},t.normalizeValue=function(a,u){var p=t.props,d=p.min,w=p.max,E=p.step,T=p.allowOverlap,M=p.values;return(0,l.normalizeValue)(a,u,d,w,E,T,M)},t.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var a=t.props,u=a.onFinalChange,p=a.values;u&&u(p)},t.updateMarkRefs=function(a){if(!a.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(a.max-a.min)/t.props.step,t.markRefs=[];for(var u=0;u<t.numOfMarks+1;u++)t.markRefs[u]=x.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var a=window.getComputedStyle(t.trackRef.current),u=parseInt(a.width,10),p=parseInt(a.height,10),d=parseInt(a.paddingLeft,10),w=parseInt(a.paddingTop,10),E=[],T=0;T<t.numOfMarks+1;T++){var M=9999,v=9999;if(t.markRefs[T].current){var B=t.markRefs[T].current.getBoundingClientRect();M=B.height,v=B.width}t.props.direction===f.Direction.Left||t.props.direction===f.Direction.Right?E.push([Math.round(u/t.numOfMarks*T+d-v/2),-Math.round((M-p)/2)]):E.push([Math.round(p/t.numOfMarks*T+w-M/2),-Math.round((v-u)/2)])}t.setState({markOffsets:E})}},h.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=h.values.map(function(){return x.createRef()}),t.updateMarkRefs(h),t}return y.prototype.componentDidMount=function(){var h=this,t=this.props,a=t.values,u=t.min,p=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",h.onResize)},unobserve:function(){return window.removeEventListener("resize",h.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(d){return(0,l.checkBoundaries)(d,h.props.min,h.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(d){(0,l.isStepDivisible)(u,d,p)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},y.prototype.componentDidUpdate=function(h,t){var a=this.props,u=a.max,p=a.min,d=a.step,w=a.values,E=a.rtl;(h.max!==u||h.min!==p||h.step!==d)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),E),(h.max!==u||h.min!==p||h.step!==d||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),w.forEach(function(T){(0,l.isStepDivisible)(p,T,d)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},y.prototype.componentWillUnmount=function(){var h={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,h),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},y.prototype.render=function(){var h=this,t=this.props,a=t.renderTrack,u=t.renderThumb,p=t.renderMark,d=p===void 0?function(){return null}:p,w=t.values,E=t.min,T=t.max,M=t.allowOverlap,v=t.disabled,B=this.state,S=B.draggedThumbIndex,_=B.thumbZIndexes,o=B.markOffsets;return a({props:{style:{transform:"scale(1)",cursor:S>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":w.length===1&&!v?"pointer":"inherit"},onMouseDown:v?l.voidFn:this.onMouseDownTrack,onTouchStart:v?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:v,children:g(g([],o.map(function(s,c,m){return d({props:{style:h.props.direction===f.Direction.Left||h.props.direction===f.Direction.Right?{position:"absolute",left:"".concat(s[0],"px"),marginTop:"".concat(s[1],"px")}:{position:"absolute",top:"".concat(s[0],"px"),marginLeft:"".concat(s[1],"px")},key:"mark".concat(c),ref:h.markRefs[c]},index:c})}),!0),w.map(function(s,c){var m=h.state.draggedThumbIndex===c;return u({index:c,value:s,isDragged:m,props:{style:{position:"absolute",zIndex:_[c],cursor:v?"inherit":m?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:c,tabIndex:v?void 0:0,"aria-valuemax":M?T:w[c+1]||T,"aria-valuemin":M?E:w[c-1]||E,"aria-valuenow":s,draggable:!1,ref:h.thumbRefs[c],role:"slider",onKeyDown:v?l.voidFn:h.onKeyDown,onKeyUp:v?l.voidFn:h.onKeyUp}})}),!0)})},y.defaultProps={step:1,direction:f.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},y}(x.Component);return X.default=z,X}var Ue;function Et(){return Ue||(Ue=1,function(e){var n=le&&le.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var r=n(Dt());e.Range=r.default;var i=Ve();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return i.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return i.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return i.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return i.checkValuesAgainstBoundaries}});var g=Me();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return g.Direction}})}(le)),le}var Xe=Et();function He(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(g){return Object.getOwnPropertyDescriptor(e,g).enumerable})),r.push.apply(r,i)}return r}function he(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?He(Object(r),!0).forEach(function(i){St(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):He(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function St(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}var fe=Z("div",{position:"relative",width:"100%"});fe.displayName="Root",fe.displayName="Root",fe.displayName="StyledRoot";var pe=Z("div",function(e){var n=e.$theme,r=e.$value,i=r===void 0?[]:r,g=e.$disabled,x=e.$isDragged,l=n.sizing,f="inherit";return g?f="not-allowed":x?f="grabbing":i.length===1&&(f="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:f,backgroundColor:n.colors.sliderTrackFill}});pe.displayName="Track",pe.displayName="Track",pe.displayName="StyledTrack";var ge=Z("div",function(e){var n=e.$theme,r=e.$value,i=r===void 0?[]:r,g=e.$min,x=e.$max,l=e.$disabled,f=n.colors,L=n.borders,A=n.direction,z=n.borders.useRoundedCorners?L.radius100:0;return{borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,background:Xe.getTrackBackground({values:i,colors:i.length===1?[l?f.borderOpaque:f.primary,l?f.backgroundSecondary:f.borderOpaque]:[l?f.backgroundSecondary:f.borderOpaque,l?f.borderOpaque:f.primary,l?f.backgroundSecondary:f.borderOpaque],min:g||0,max:x||0,rtl:A==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});ge.displayName="InnerTrack",ge.displayName="InnerTrack",ge.displayName="StyledInnerTrack";var me=Z("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});me.displayName="Mark",me.displayName="Mark",me.displayName="StyledMark";var ve=Z("div",function(e){return he(he({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});ve.displayName="Tick",ve.displayName="Tick",ve.displayName="StyledTick";var be=Z("div",function(e){var n=e.$theme,r=n.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:r.scale600,paddingLeft:r.scale600,paddingBottom:r.scale400}});be.displayName="TickBar",be.displayName="TickBar",be.displayName="StyledTickBar";var ye=Z("div",function(e){var n=e.$theme,r=e.$value,i=r===void 0?[]:r,g=e.$thumbIndex,x=e.$disabled,l=i.length===2&&g===0,f=i.length===2&&g===1;return n.direction==="rtl"&&(f||l)&&(l=!l,f=!f),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:x?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(n.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:x?"not-allowed":"inherit"}});ye.displayName="Thumb",ye.displayName="Thumb",ye.displayName="StyledThumb";var we=Z("div",function(e){var n=e.$disabled,r=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:n?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleInnerFill}});we.displayName="InnerThumb",we.displayName="InnerThumb",we.displayName="StyledInnerThumb";var ke=Z("div",function(e){var n=e.$disabled,r=e.$theme;return he(he({position:"absolute",top:"-".concat(r.sizing.scale1400)},r.typography.font200),{},{backgroundColor:n?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleInnerFill,color:r.colors.contentInversePrimary,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,paddingTop:r.sizing.scale500,paddingBottom:r.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});ke.displayName="ThumbValue",ke.displayName="ThumbValue",ke.displayName="StyledThumbValue";function qe(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(g){return Object.getOwnPropertyDescriptor(e,g).enumerable})),r.push.apply(r,i)}return r}function It(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?qe(Object(r),!0).forEach(function(i){jt(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function jt(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function K(){return K=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},K.apply(this,arguments)}function W(e,n){return Pt(e)||Ct(e,n)||$t(e,n)||Bt()}function Bt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1
|
+
import{h as Pe,c3 as Z,r as I,cA as dt,cn as ht,c4 as G,cB as ft,cC as pt,c as Ae,b1 as gt,cf as mt,ap as vt,bl as bt,d0 as yt,j as ee,b$ as wt,c0 as kt,ch as Tt,c1 as xt,bJ as Ot,J as Mt,d1 as Oe}from"./index-B2QqSXxG.js";import{s as Fe}from"./sprintf-D7DtBTRn.js";import{a as Rt}from"./useBasicWidgetState-DVIC6bdr.js";import"./FormClearHelper-BC4K9Zmh.js";var le={},X={},de={},Le={},_e;function Me(){return _e||(_e=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Direction=void 0,function(n){n.Right="to right",n.Left="to left",n.Down="to bottom",n.Up="to top"}(e.Direction||(e.Direction={}))}(Le)),Le}var ze;function Ve(){return ze||(ze=1,function(e){var n=de&&de.__spreadArray||function(o,s,c){if(c||arguments.length===2)for(var m=0,D=s.length,R;m<D;m++)(R||!(m in s))&&(R||(R=Array.prototype.slice.call(s,0,m)),R[m]=s[m]);return o.concat(R||Array.prototype.slice.call(s))};Object.defineProperty(e,"__esModule",{value:!0}),e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var r=Pe(),i=Me(),g=function(o){var s=o.toString().split(".")[1];return s?s.length:0};e.getStepDecimals=g;function x(o){return o.touches&&o.touches.length||o.changedTouches&&o.changedTouches.length}e.isTouchEvent=x;function l(o,s,c){var m=(s-o)/c,D=8,R=Number(m.toFixed(D));return parseInt(R.toString(),10)===R}e.isStepDivisible=l;function f(o,s,c,m,D,R,O){var b=1e11;if(o=Math.round(o*b)/b,!R){var $=O[s-1],j=O[s+1];if($&&$>o)return $;if(j&&j<o)return j}if(o>m)return m;if(o<c)return c;var C=Math.floor(o*b-c*b)%Math.floor(D*b),N=Math.floor(o*b-Math.abs(C)),H=C===0?o:N/b,F=Math.abs(C/b)<D/2?H:H+D,U=(0,e.getStepDecimals)(D);return parseFloat(F.toFixed(U))}e.normalizeValue=f;function L(o,s,c){return(o-s)/(c-s)}e.relativeValue=L;function A(o){return o===i.Direction.Up||o===i.Direction.Down}e.isVertical=A;function z(o,s,c){if(s>=c)throw new RangeError("min (".concat(s,") is equal/bigger than max (").concat(c,")"));if(o<s)throw new RangeError("value (".concat(o,") is smaller than min (").concat(s,")"));if(o>c)throw new RangeError("value (".concat(o,") is bigger than max (").concat(c,")"))}e.checkBoundaries=z;function k(o,s,c){return o<s?s:o>c?c:o}e.checkValuesAgainstBoundaries=k;function y(o){if(!(o.length<2)&&!o.slice(1).every(function(s,c){return o[c]<=s}))throw new RangeError("values={[".concat(o,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=y;function h(o){var s=window.getComputedStyle(o);return{top:parseInt(s["margin-top"],10),bottom:parseInt(s["margin-bottom"],10),left:parseInt(s["margin-left"],10),right:parseInt(s["margin-right"],10)}}e.getMargin=h;function t(o){var s=window.getComputedStyle(o);return{top:parseInt(s["padding-top"],10)+parseInt(s["border-top-width"],10),bottom:parseInt(s["padding-bottom"],10)+parseInt(s["border-bottom-width"],10),left:parseInt(s["padding-left"],10)+parseInt(s["border-left-width"],10),right:parseInt(s["padding-right"],10)+parseInt(s["border-right-width"],10)}}e.getPaddingAndBorder=t;function a(o,s,c){var m=c?-1:1;o.forEach(function(D,R){return p(D,m*s[R].x,s[R].y)})}e.translateThumbs=a;function u(o,s,c,m){for(var D=0,R=_(o[0],s,c,m),O=1;O<o.length;O++){var b=_(o[O],s,c,m);b<R&&(R=b,D=O)}return D}e.getClosestThumbIndex=u;function p(o,s,c){o.style.transform="translate(".concat(s,"px, ").concat(c,"px)")}e.translate=p;var d=function(o){var s=[],c=null,m=function(){for(var D=[],R=0;R<arguments.length;R++)D[R]=arguments[R];s=D,!c&&(c=requestAnimationFrame(function(){c=null,o.apply(void 0,s)}))};return m};e.schd=d;function w(o,s,c){var m=o.slice(0);return m[s]=c,m}e.replaceAt=w;function E(o){var s=o.values,c=o.colors,m=o.min,D=o.max,R=o.direction,O=R===void 0?i.Direction.Right:R,b=o.rtl,$=b===void 0?!1:b;$&&O===i.Direction.Right?O=i.Direction.Left:$&&i.Direction.Left&&(O=i.Direction.Right);var j=s.slice(0).sort(function(N,H){return N-H}).map(function(N){return(N-m)/(D-m)*100}),C=j.reduce(function(N,H,F){return"".concat(N,", ").concat(c[F]," ").concat(H,"%, ").concat(c[F+1]," ").concat(H,"%")},"");return"linear-gradient(".concat(O,", ").concat(c[0]," 0%").concat(C,", ").concat(c[c.length-1]," 100%)")}e.getTrackBackground=E;function T(){}e.voidFn=T;function M(o){throw new Error("Didn't expect to get here")}e.assertUnreachable=M;var v=function(o,s,c,m,D){D===void 0&&(D=function(O){return O});var R=Math.ceil(n([o],Array.from(o.children),!0).reduce(function(O,b){var $=Math.ceil(b.getBoundingClientRect().width);if(b.innerText&&b.innerText.includes(c)&&b.childElementCount===0){var j=b.cloneNode(!0);j.innerHTML=D(s.toFixed(m)),j.style.visibility="hidden",document.body.appendChild(j),$=Math.ceil(j.getBoundingClientRect().width),document.body.removeChild(j)}return $>O?$:O},o.getBoundingClientRect().width));return R},B=function(o,s,c,m,D,R,O){O===void 0&&(O=function(j){return j});var b=[],$=function(j){var C=v(c[j],m[j],D,R,O),N=s[j].x;s.forEach(function(H,F){var U=H.x,V=v(c[F],m[F],D,R,O);j!==F&&(N>=U&&N<=U+V||N+C>=U&&N+C<=U+V)&&(b.includes(F)||(b.push(j),b.push(F),b=n(n([],b,!0),[j,F],!1),$(F)))})};return $(o),Array.from(new Set(b.sort()))},S=function(o,s,c,m,D,R){m===void 0&&(m=.1),D===void 0&&(D=" - "),R===void 0&&(R=function(F){return F});var O=(0,e.getStepDecimals)(m),b=(0,r.useState)({}),$=b[0],j=b[1],C=(0,r.useState)(R(s[c].toFixed(O))),N=C[0],H=C[1];return(0,r.useEffect)(function(){if(o){var F=o.getThumbs();if(F.length<1)return;var U={},V=o.getOffsets(),te=B(c,V,F,s,D,O,R),oe=R(s[c].toFixed(O));if(te.length){var ne=te.reduce(function(J,ce,se,ue){return J.length?n(n([],J,!0),[V[ue[se]].x],!1):[V[ue[se]].x]},[]);if(Math.min.apply(Math,ne)===V[c].x){var re=[];te.forEach(function(J){re.push(s[J].toFixed(O))}),oe=Array.from(new Set(re.sort(function(J,ce){return parseFloat(J)-parseFloat(ce)}))).map(R).join(D);var Te=Math.min.apply(Math,ne),ie=Math.max.apply(Math,ne),xe=F[te[ne.indexOf(ie)]].getBoundingClientRect().width;U.left="".concat(Math.abs(Te-(ie+xe))/2,"px"),U.transform="translate(-50%, 0)"}else U.visibility="hidden"}H(oe),j(U)}},[o,s]),[N,$]};e.useThumbOverlap=S;function _(o,s,c,m){var D=o.getBoundingClientRect(),R=D.left,O=D.top,b=D.width,$=D.height;return A(m)?Math.abs(c-(O+$/2)):Math.abs(s-(R+b/2))}}(de)),de}var Ne;function Dt(){if(Ne)return X;Ne=1;var e=X&&X.__extends||function(){var k=function(y,h){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(t[u]=a[u])},k(y,h)};return function(y,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");k(y,h);function t(){this.constructor=y}y.prototype=h===null?Object.create(h):(t.prototype=h.prototype,new t)}}(),n=X&&X.__createBinding||(Object.create?function(k,y,h,t){t===void 0&&(t=h);var a=Object.getOwnPropertyDescriptor(y,h);(!a||("get"in a?!y.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return y[h]}}),Object.defineProperty(k,t,a)}:function(k,y,h,t){t===void 0&&(t=h),k[t]=y[h]}),r=X&&X.__setModuleDefault||(Object.create?function(k,y){Object.defineProperty(k,"default",{enumerable:!0,value:y})}:function(k,y){k.default=y}),i=X&&X.__importStar||function(k){if(k&&k.__esModule)return k;var y={};if(k!=null)for(var h in k)h!=="default"&&Object.prototype.hasOwnProperty.call(k,h)&&n(y,k,h);return r(y,k),y},g=X&&X.__spreadArray||function(k,y,h){if(h||arguments.length===2)for(var t=0,a=y.length,u;t<a;t++)(u||!(t in y))&&(u||(u=Array.prototype.slice.call(y,0,t)),u[t]=y[t]);return k.concat(u||Array.prototype.slice.call(y))};Object.defineProperty(X,"__esModule",{value:!0});var x=i(Pe()),l=Ve(),f=Me(),L=["ArrowRight","ArrowUp","k","PageUp"],A=["ArrowLeft","ArrowDown","j","PageDown"],z=function(k){e(y,k);function y(h){var t=k.call(this,h)||this;if(t.trackRef=x.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(a,u){return u}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var a=t.props,u=a.direction,p=a.values,d=a.min,w=a.max,E=t.trackRef.current,T=E.getBoundingClientRect(),M=(0,l.getPaddingAndBorder)(E);return t.getThumbs().map(function(v,B){var S={x:0,y:0},_=v.getBoundingClientRect(),o=(0,l.getMargin)(v);switch(u){case f.Direction.Right:return S.x=(o.left+M.left)*-1,S.y=((_.height-T.height)/2+M.top)*-1,S.x+=T.width*(0,l.relativeValue)(p[B],d,w)-_.width/2,S;case f.Direction.Left:return S.x=(o.right+M.right)*-1,S.y=((_.height-T.height)/2+M.top)*-1,S.x+=T.width-T.width*(0,l.relativeValue)(p[B],d,w)-_.width/2,S;case f.Direction.Up:return S.x=((_.width-T.width)/2+o.left+M.left)*-1,S.y=-M.left,S.y+=T.height-T.height*(0,l.relativeValue)(p[B],d,w)-_.height/2,S;case f.Direction.Down:return S.x=((_.width-T.width)/2+o.left+M.left)*-1,S.y=-M.left,S.y+=T.height*(0,l.relativeValue)(p[B],d,w)-_.height/2,S;default:return(0,l.assertUnreachable)(u)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(a){return a.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(a){return t.getThumbs().findIndex(function(u){return u===a.target||u.contains(a.target)})},t.addTouchEvents=function(a){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(a){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(a){var u;if(a.button===0)if(a.persist(),a.preventDefault(),t.addMouseEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(d){var w;return(w=d.current)===null||w===void 0?void 0:w.contains(a.target)}))return;t.setState({draggedTrackPos:[a.clientX,a.clientY]},function(){return t.onMove(a.clientX,a.clientY)})}else{var p=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(d){return d.current}),a.clientX,a.clientY,t.props.direction);(u=t.thumbRefs[p].current)===null||u===void 0||u.focus(),t.setState({draggedThumbIndex:p},function(){return t.onMove(a.clientX,a.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(a){var u;if(a.persist(),t.addTouchEvents(a.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(d){var w;return(w=d.current)===null||w===void 0?void 0:w.contains(a.target)}))return;t.setState({draggedTrackPos:[a.touches[0].clientX,a.touches[0].clientY]},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}else{var p=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(d){return d.current}),a.touches[0].clientX,a.touches[0].clientY,t.props.direction);(u=t.thumbRefs[p].current)===null||u===void 0||u.focus(),t.setState({draggedThumbIndex:p},function(){return t.onMove(a.touches[0].clientX,a.touches[0].clientY)})}},t.onMouseOrTouchStart=function(a){if(!t.props.disabled){var u=(0,l.isTouchEvent)(a);if(!(!u&&a.button!==0)){var p=t.getTargetIndex(a);p!==-1&&(u?t.addTouchEvents(a):t.addMouseEvents(a),t.setState({draggedThumbIndex:p,thumbZIndexes:t.state.thumbZIndexes.map(function(d,w){return w===p?Math.max.apply(Math,t.state.thumbZIndexes):d<=t.state.thumbZIndexes[p]?d:d-1})}))}}},t.onMouseMove=function(a){a.preventDefault(),t.onMove(a.clientX,a.clientY)},t.onTouchMove=function(a){a.preventDefault(),t.onMove(a.touches[0].clientX,a.touches[0].clientY)},t.onKeyDown=function(a){var u=t.props,p=u.values,d=u.onChange,w=u.step,E=u.rtl,T=u.direction,M=t.state.isChanged,v=t.getTargetIndex(a.nativeEvent),B=E||T===f.Direction.Left||T===f.Direction.Down?-1:1;v!==-1&&(L.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:v,isChanged:!0}),d((0,l.replaceAt)(p,v,t.normalizeValue(p[v]+B*(a.key==="PageUp"?w*10:w),v)))):A.includes(a.key)?(a.preventDefault(),t.setState({draggedThumbIndex:v,isChanged:!0}),d((0,l.replaceAt)(p,v,t.normalizeValue(p[v]-B*(a.key==="PageDown"?w*10:w),v)))):a.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){M&&t.fireOnFinalChange()}):M&&t.fireOnFinalChange())},t.onKeyUp=function(a){var u=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){u&&t.fireOnFinalChange()})},t.onMove=function(a,u){var p=t.state,d=p.draggedThumbIndex,w=p.draggedTrackPos,E=t.props,T=E.direction,M=E.min,v=E.max,B=E.onChange,S=E.values,_=E.step,o=E.rtl;if(d===-1&&w[0]===-1&&w[1]===-1)return null;var s=t.trackRef.current;if(!s)return null;var c=s.getBoundingClientRect(),m=(0,l.isVertical)(T)?c.height:c.width;if(w[0]!==-1&&w[1]!==-1){var D=a-w[0],R=u-w[1],O=0;switch(T){case f.Direction.Right:case f.Direction.Left:O=D/m*(v-M);break;case f.Direction.Down:case f.Direction.Up:O=R/m*(v-M);break;default:(0,l.assertUnreachable)(T)}if(o&&(O*=-1),Math.abs(O)>=_/2){for(var b=0;b<t.thumbRefs.length;b++){if(S[b]===v&&Math.sign(O)===1||S[b]===M&&Math.sign(O)===-1)return;var $=S[b]+O;$>v?O=v-S[b]:$<M&&(O=M-S[b])}for(var j=S.slice(0),b=0;b<t.thumbRefs.length;b++)j=(0,l.replaceAt)(j,b,t.normalizeValue(S[b]+O,b));t.setState({draggedTrackPos:[a,u]}),B(j)}}else{var C=0;switch(T){case f.Direction.Right:C=(a-c.left)/m*(v-M)+M;break;case f.Direction.Left:C=(m-(a-c.left))/m*(v-M)+M;break;case f.Direction.Down:C=(u-c.top)/m*(v-M)+M;break;case f.Direction.Up:C=(m-(u-c.top))/m*(v-M)+M;break;default:(0,l.assertUnreachable)(T)}o&&(C=v+M-C),Math.abs(S[d]-C)>=_/2&&B((0,l.replaceAt)(S,d,t.normalizeValue(C,d)))}},t.normalizeValue=function(a,u){var p=t.props,d=p.min,w=p.max,E=p.step,T=p.allowOverlap,M=p.values;return(0,l.normalizeValue)(a,u,d,w,E,T,M)},t.onEnd=function(a){if(a.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var a=t.props,u=a.onFinalChange,p=a.values;u&&u(p)},t.updateMarkRefs=function(a){if(!a.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(a.max-a.min)/t.props.step,t.markRefs=[];for(var u=0;u<t.numOfMarks+1;u++)t.markRefs[u]=x.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var a=window.getComputedStyle(t.trackRef.current),u=parseInt(a.width,10),p=parseInt(a.height,10),d=parseInt(a.paddingLeft,10),w=parseInt(a.paddingTop,10),E=[],T=0;T<t.numOfMarks+1;T++){var M=9999,v=9999;if(t.markRefs[T].current){var B=t.markRefs[T].current.getBoundingClientRect();M=B.height,v=B.width}t.props.direction===f.Direction.Left||t.props.direction===f.Direction.Right?E.push([Math.round(u/t.numOfMarks*T+d-v/2),-Math.round((M-p)/2)]):E.push([Math.round(p/t.numOfMarks*T+w-M/2),-Math.round((v-u)/2)])}t.setState({markOffsets:E})}},h.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=h.values.map(function(){return x.createRef()}),t.updateMarkRefs(h),t}return y.prototype.componentDidMount=function(){var h=this,t=this.props,a=t.values,u=t.min,p=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",h.onResize)},unobserve:function(){return window.removeEventListener("resize",h.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(d){return(0,l.checkBoundaries)(d,h.props.min,h.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),a.forEach(function(d){(0,l.isStepDivisible)(u,d,p)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},y.prototype.componentDidUpdate=function(h,t){var a=this.props,u=a.max,p=a.min,d=a.step,w=a.values,E=a.rtl;(h.max!==u||h.min!==p||h.step!==d)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),E),(h.max!==u||h.min!==p||h.step!==d||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),w.forEach(function(T){(0,l.isStepDivisible)(p,T,d)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},y.prototype.componentWillUnmount=function(){var h={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,h),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},y.prototype.render=function(){var h=this,t=this.props,a=t.renderTrack,u=t.renderThumb,p=t.renderMark,d=p===void 0?function(){return null}:p,w=t.values,E=t.min,T=t.max,M=t.allowOverlap,v=t.disabled,B=this.state,S=B.draggedThumbIndex,_=B.thumbZIndexes,o=B.markOffsets;return a({props:{style:{transform:"scale(1)",cursor:S>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":w.length===1&&!v?"pointer":"inherit"},onMouseDown:v?l.voidFn:this.onMouseDownTrack,onTouchStart:v?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:v,children:g(g([],o.map(function(s,c,m){return d({props:{style:h.props.direction===f.Direction.Left||h.props.direction===f.Direction.Right?{position:"absolute",left:"".concat(s[0],"px"),marginTop:"".concat(s[1],"px")}:{position:"absolute",top:"".concat(s[0],"px"),marginLeft:"".concat(s[1],"px")},key:"mark".concat(c),ref:h.markRefs[c]},index:c})}),!0),w.map(function(s,c){var m=h.state.draggedThumbIndex===c;return u({index:c,value:s,isDragged:m,props:{style:{position:"absolute",zIndex:_[c],cursor:v?"inherit":m?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:c,tabIndex:v?void 0:0,"aria-valuemax":M?T:w[c+1]||T,"aria-valuemin":M?E:w[c-1]||E,"aria-valuenow":s,draggable:!1,ref:h.thumbRefs[c],role:"slider",onKeyDown:v?l.voidFn:h.onKeyDown,onKeyUp:v?l.voidFn:h.onKeyUp}})}),!0)})},y.defaultProps={step:1,direction:f.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},y}(x.Component);return X.default=z,X}var Ue;function Et(){return Ue||(Ue=1,function(e){var n=le&&le.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var r=n(Dt());e.Range=r.default;var i=Ve();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return i.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return i.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return i.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return i.checkValuesAgainstBoundaries}});var g=Me();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return g.Direction}})}(le)),le}var Xe=Et();function He(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(g){return Object.getOwnPropertyDescriptor(e,g).enumerable})),r.push.apply(r,i)}return r}function he(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?He(Object(r),!0).forEach(function(i){St(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):He(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function St(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}var fe=Z("div",{position:"relative",width:"100%"});fe.displayName="Root",fe.displayName="Root",fe.displayName="StyledRoot";var pe=Z("div",function(e){var n=e.$theme,r=e.$value,i=r===void 0?[]:r,g=e.$disabled,x=e.$isDragged,l=n.sizing,f="inherit";return g?f="not-allowed":x?f="grabbing":i.length===1&&(f="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:f,backgroundColor:n.colors.sliderTrackFill}});pe.displayName="Track",pe.displayName="Track",pe.displayName="StyledTrack";var ge=Z("div",function(e){var n=e.$theme,r=e.$value,i=r===void 0?[]:r,g=e.$min,x=e.$max,l=e.$disabled,f=n.colors,L=n.borders,A=n.direction,z=n.borders.useRoundedCorners?L.radius100:0;return{borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,background:Xe.getTrackBackground({values:i,colors:i.length===1?[l?f.borderOpaque:f.primary,l?f.backgroundSecondary:f.borderOpaque]:[l?f.backgroundSecondary:f.borderOpaque,l?f.borderOpaque:f.primary,l?f.backgroundSecondary:f.borderOpaque],min:g||0,max:x||0,rtl:A==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});ge.displayName="InnerTrack",ge.displayName="InnerTrack",ge.displayName="StyledInnerTrack";var me=Z("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});me.displayName="Mark",me.displayName="Mark",me.displayName="StyledMark";var ve=Z("div",function(e){return he(he({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});ve.displayName="Tick",ve.displayName="Tick",ve.displayName="StyledTick";var be=Z("div",function(e){var n=e.$theme,r=n.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:r.scale600,paddingLeft:r.scale600,paddingBottom:r.scale400}});be.displayName="TickBar",be.displayName="TickBar",be.displayName="StyledTickBar";var ye=Z("div",function(e){var n=e.$theme,r=e.$value,i=r===void 0?[]:r,g=e.$thumbIndex,x=e.$disabled,l=i.length===2&&g===0,f=i.length===2&&g===1;return n.direction==="rtl"&&(f||l)&&(l=!l,f=!f),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:x?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(n.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:x?"not-allowed":"inherit"}});ye.displayName="Thumb",ye.displayName="Thumb",ye.displayName="StyledThumb";var we=Z("div",function(e){var n=e.$disabled,r=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:n?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleInnerFill}});we.displayName="InnerThumb",we.displayName="InnerThumb",we.displayName="StyledInnerThumb";var ke=Z("div",function(e){var n=e.$disabled,r=e.$theme;return he(he({position:"absolute",top:"-".concat(r.sizing.scale1400)},r.typography.font200),{},{backgroundColor:n?r.colors.sliderHandleFillDisabled:r.colors.sliderHandleInnerFill,color:r.colors.contentInversePrimary,paddingLeft:r.sizing.scale600,paddingRight:r.sizing.scale600,paddingTop:r.sizing.scale500,paddingBottom:r.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});ke.displayName="ThumbValue",ke.displayName="ThumbValue",ke.displayName="StyledThumbValue";function qe(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(g){return Object.getOwnPropertyDescriptor(e,g).enumerable})),r.push.apply(r,i)}return r}function It(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?qe(Object(r),!0).forEach(function(i){jt(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function jt(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function K(){return K=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},K.apply(this,arguments)}function W(e,n){return Pt(e)||Ct(e,n)||$t(e,n)||Bt()}function Bt(){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 $t(e,n){if(e){if(typeof e=="string")return Ke(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ke(e,n)}}function Ke(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function Ct(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i=[],g=!0,x=!1,l,f;try{for(r=r.call(e);!(g=(l=r.next()).done)&&(i.push(l.value),!(n&&i.length===n));g=!0);}catch(L){x=!0,f=L}finally{try{!g&&r.return!=null&&r.return()}finally{if(x)throw f}}return i}}function Pt(e){if(Array.isArray(e))return e}var At=function(e){if(e.length>2||e.length===0)throw new Error("the value prop represents positions of thumbs, so its length can be only one or two");return e};function Ft(e){var n=e.overrides,r=n===void 0?{}:n,i=e.disabled,g=i===void 0?!1:i,x=e.marks,l=x===void 0?!1:x,f=e.onChange,L=f===void 0?function(){}:f,A=e.onFinalChange,z=A===void 0?function(){}:A,k=e.min,y=k===void 0?0:k,h=e.max,t=h===void 0?100:h,a=e.step,u=a===void 0?1:a,p=e.persistentThumb,d=p===void 0?!1:p,w=e.valueToLabel,E=w===void 0?function(P){return P}:w,T=e.value,M=I.useContext(dt),v=I.useState(!1),B=W(v,2),S=B[0],_=B[1],o=I.useState(!1),s=W(o,2),c=s[0],m=s[1],D=I.useState(!1),R=W(D,2),O=R[0],b=R[1],$=I.useState(-1),j=W($,2),C=j[0],N=j[1],H=I.useCallback(function(P){ht(P)&&b(!0);var Y=P.target.parentNode.firstChild===P.target?0:1;N(Y)},[]),F=I.useCallback(function(P){O!==!1&&b(!1),N(-1)},[]),U=At(T),V={$disabled:g,$step:u,$min:y,$max:t,$marks:l,$value:U,$isFocusVisible:O},te=G(r.Root,fe),oe=W(te,2),ne=oe[0],re=oe[1],Te=G(r.Track,pe),ie=W(Te,2),xe=ie[0],J=ie[1],ce=G(r.InnerTrack,ge),se=W(ce,2),ue=se[0],We=se[1],Ye=G(r.Thumb,ye),Re=W(Ye,2),Ze=Re[0],Ge=Re[1],Je=G(r.InnerThumb,we),De=W(Je,2),Qe=De[0],et=De[1],tt=G(r.ThumbValue,ke),Ee=W(tt,2),nt=Ee[0],rt=Ee[1],at=G(r.Tick,ve),Se=W(at,2),Ie=Se[0],je=Se[1],ot=G(r.TickBar,be),Be=W(ot,2),it=Be[0],st=Be[1],ct=G(r.Mark,me),$e=W(ct,2),ut=$e[0],lt=$e[1];return I.createElement(ne,K({"data-baseweb":"slider"},V,re,{onFocus:pt(re,H),onBlur:ft(re,F)}),I.createElement(Xe.Range,K({step:u,min:y,max:t,values:U,disabled:g,onChange:function(P){return L({value:P})},onFinalChange:function(P){return z({value:P})},rtl:M.direction==="rtl",renderTrack:function(P){var Y=P.props,q=P.children,Q=P.isDragged;return I.createElement(xe,K({onMouseDown:Y.onMouseDown,onTouchStart:Y.onTouchStart,$isDragged:Q},V,J),I.createElement(ue,K({$isDragged:Q,ref:Y.ref},V,We),q))},renderThumb:function(P){var Y=P.props,q=P.index,Q=P.isDragged,Ce=d||(!!q&&c||!q&&S||Q)&&!g;return I.createElement(Ze,K({},Y,{onMouseEnter:function(){q===0?_(!0):m(!0)},onMouseLeave:function(){q===0?_(!1):m(!1)},$thumbIndex:q,$isDragged:Q,style:It({},Y.style)},V,Ge,{$isFocusVisible:O&&C===q}),Ce&&I.createElement(nt,K({$thumbIndex:q,$isDragged:Q},V,rt),E(U[q])),Ce&&I.createElement(Qe,K({$thumbIndex:q,$isDragged:Q},V,et)))}},l?{renderMark:function(P){var Y=P.props,q=P.index;return I.createElement(ut,K({$markIndex:q},Y,V,lt))}}:{})),I.createElement(it,K({},V,st),I.createElement(Ie,K({},V,je),E(y)),I.createElement(Ie,K({},V,je),E(t))))}const Lt=Ae("div",{target:"ew7r33m1"})(({disabled:e,theme:n})=>({alignItems:"center",backgroundColor:e?n.colors.gray:n.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",justifyContent:"center",height:n.sizes.sliderThumb,width:n.sizes.sliderThumb,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${gt(n.colors.primary,.5)}`}}),""),_t=Ae("div",{target:"ew7r33m0"})(({disabled:e,theme:n})=>({fontFamily:n.genericFonts.bodyFont,fontSize:n.fontSizes.sm,color:e?n.colors.gray:n.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:n.colors.transparent,lineHeight:n.lineHeights.base,fontWeight:n.fontWeights.normal,pointerEvents:"none"}),""),zt=200;function Vt({disabled:e,element:n,widgetMgr:r,fragmentId:i}){const[g,x]=Rt({getStateFromWidgetMgr:Nt,getDefaultStateFromProto:Ut,getCurrStateFromProto:Xt,updateWidgetMgrState:Ht,element:n,widgetMgr:r,fragmentId:i}),[l,f]=I.useState(g),L=I.useRef(null),[A]=I.useState([]),[z]=I.useState([]),k=vt(),y=l.map(d=>Kt(d,n)),h=n.label;I.useEffect(()=>{f(g)},[g]);const t=I.useCallback(bt(zt,d=>{x({value:d,fromUi:!0})}),[]),a=I.useCallback(({value:d})=>{f(d),t(d)},[t]),u=I.useCallback(I.forwardRef(function(d,w){const{$thumbIndex:E}=d,T=E||0;A[T]=w,z[T]||=I.createRef();const M=yt(d,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),v=y[T];return ee.jsx(Lt,{...M,disabled:d.$disabled===!0,ref:A[T],"aria-valuetext":v,"aria-label":h,children:ee.jsx(_t,{"data-testid":"stSliderThumbValue",disabled:d.$disabled===!0,ref:z[T],children:v})})}),[]);I.useEffect(()=>{z.map((v,B)=>{v.current&&(v.current.innerText=y[B])}),A.map((v,B)=>{v.current&&v.current.setAttribute("aria-valuetext",y[B])});const d=L.current??null,w=A[0].current,E=A[1]?.current,T=z[0].current,M=z[1]?.current;Yt(d,w,E,T,M)});const p=I.useCallback(({$disabled:d})=>({height:k.spacing.twoXS,...d?{background:k.colors.darkenedBgMix25}:{}}),[k.colors.darkenedBgMix25,k.spacing.twoXS]);return ee.jsxs("div",{ref:L,className:"stSlider","data-testid":"stSlider",children:[ee.jsx(wt,{label:n.label,disabled:e,labelVisibility:kt(n.labelVisibility?.value),children:n.help&&ee.jsx(Tt,{children:ee.jsx(xt,{content:n.help,placement:Ot.TOP_RIGHT})})}),ee.jsx(Ft,{min:n.min,max:n.max,step:n.step,value:Wt(l,n),onChange:a,disabled:e,overrides:{Thumb:u,Track:{style:{backgroundColor:"none !important",paddingLeft:k.spacing.none,paddingRight:k.spacing.none,paddingTop:`calc((${k.sizes.minElementHeight} - ${k.spacing.twoXS}) / 2)`,paddingBottom:`calc((${k.sizes.minElementHeight} - ${k.spacing.twoXS}) / 2)`}},InnerTrack:{style:p},TickBar:()=>null}})]})}function Nt(e,n){return e.getDoubleArrayValue(n)}function Ut(e){return e.default}function Xt(e){return e.value}function Ht(e,n,r,i){n.setDoubleArrayValue(e,r.value,{fromUi:r.fromUi},i)}function qt(e){const{dataType:n}=e;return n===Oe.DataType.DATETIME||n===Oe.DataType.DATE||n===Oe.DataType.TIME}function Kt(e,n){const{format:r,options:i}=n;return qt(n)?Mt.utc(e/1e3).format(r):i.length>0?Fe.sprintf(r,i[e]):Fe.sprintf(r,e)}function Wt(e,n){const{min:r,max:i}=n;let g=e[0],x=e.length>1?e[1]:e[0];return g>x&&(g=x),g<r&&(g=r),g>i&&(g=i),x<r&&(x=r),x>i&&(x=i),e.length>1?[g,x]:[g]}function Yt(e,n,r,i,g){!e||!n||!i||(ae(e,n,i),r&&g&&(ae(e,r,g),Zt(e,n,r,i,g)))}function ae(e,n,r){const i=e.getBoundingClientRect(),g=n.getBoundingClientRect(),x=r.getBoundingClientRect(),l=g.left+g.width/2,f=l-x.width/2<i.left,L=l+x.width/2>i.right;r.style.left=f?"0":"",r.style.right=L?"0":""}function Zt(e,n,r,i,g){const x=e.getBoundingClientRect(),l=n.getBoundingClientRect(),f=r.getBoundingClientRect(),L=i.getBoundingClientRect(),A=g.getBoundingClientRect(),z=x.left+x.width/2,k=l.left+l.width/2,y=f.left+f.width/2,h=k-L.width/2>=x.left,t=y+A.width/2<=x.right,a=l.left-L.width>=x.left,u=f.right+A.width<=x.right,p=h?L.width/2:L.width,d=t?A.width/2:A.width,w=k+p;if(y-d-w>24){ae(e,n,i),ae(e,r,g);return}if(a&&u){i.style.left="",i.style.right=`${Math.round(l.width)}px`,g.style.left=`${Math.round(f.width)}px`,g.style.right="";return}k<z?(ae(e,n,i),g.style.left=`${Math.round(k+p+24-y)}px`,g.style.right=""):(ae(e,r,g),i.style.left="",i.style.right=`${-Math.round(y-d-24-k)}px`)}const Gt=mt(I.memo(Vt));export{Gt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as M,r as s,ap as I,cE as T,cF as $,cG as j,cH as k,j as r,b$ as L,c0 as V,ch as B,c1 as F,bJ as H,cD as O,cI as A,cz as N,cJ as P,cd as D}from"./index-
|
|
1
|
+
import{c as M,r as s,ap as I,cE as T,cF as $,cG as j,cH as k,j as r,b$ as L,c0 as V,ch as B,c1 as F,bJ as H,cD as O,cI as A,cz as N,cJ as P,cd as D}from"./index-B2QqSXxG.js";import{a as E}from"./useBasicWidgetState-DVIC6bdr.js";import"./FormClearHelper-BC4K9Zmh.js";const G=M("div",{target:"e6zijwc0"})(({theme:i})=>({"span[aria-disabled='true']":{background:i.colors.fadedText05}}),""),U=(i,t)=>i.getStringArrayValue(t),J=i=>i.default.map(t=>i.options[t])??null,K=i=>i.rawValues??null,Y=(i,t,l,n)=>{t.setStringArrayValue(i,l.value,{fromUi:l.fromUi},n)},_=i=>{const{element:t,widgetMgr:l,fragmentId:n}=i,e=I(),h=s.useContext(T),[a,g]=E({getStateFromWidgetMgr:U,getDefaultStateFromProto:J,getCurrStateFromProto:K,updateWidgetMgrState:Y,element:t,widgetMgr:l,fragmentId:n}),m=t.maxSelections>0&&a.length>=t.maxSelections,b=s.useMemo(()=>{if(t.maxSelections===0)return"No results";if(a.length===t.maxSelections){const o=t.maxSelections!==1?"options":"option";return`You can only select up to ${t.maxSelections} ${o}. Remove an option first.`}return"No results"},[t.maxSelections,a.length]),f=s.useMemo(()=>a.map(o=>({value:o,label:o})),[a]),u=s.useCallback(o=>{switch(o.type){case"remove":return $(a,o.option?.value);case"clear":return[];case"select":return a.concat([o.option?.value]);default:throw new Error(`State transition is unknown: ${o.type}`)}},[a]),S=s.useCallback(o=>{t.maxSelections&&o.type==="select"&&a.length>=t.maxSelections||g({value:u(o),fromUi:!0})},[t.maxSelections,u,g,a.length]),y=s.useCallback((o,p)=>{if(m)return[];const W=o.filter(C=>!a.includes(C.value));return j(W,p)},[m,a]),{options:c}=t,{placeholder:x,shouldDisable:v}=k(t.placeholder,c,t.acceptNewOptions??!1,!0),d=i.disabled||v,z=c.map((o,p)=>({label:o,value:o,id:`${o}_${p}`})),w=c.length>10,R=s.useMemo(()=>{const o=e.fontSizes.baseFontSize*1.6+14;return`${Math.round(o*4.25)}px`},[e.fontSizes.baseFontSize]);return r.jsxs("div",{className:"stMultiSelect","data-testid":"stMultiSelect",children:[r.jsx(L,{label:t.label,disabled:d,labelVisibility:V(t.labelVisibility?.value),children:t.help&&r.jsx(B,{children:r.jsx(F,{content:t.help,placement:H.TOP_RIGHT})})}),r.jsx(G,{children:r.jsx(O,{creatable:t.acceptNewOptions??!1,options:z,labelKey:"label",valueKey:"value","aria-label":t.label,placeholder:x,type:P.select,multi:!0,onChange:S,value:f,disabled:d,size:"compact",noResultsMsg:b,filterOptions:y,closeOnSelect:!1,ignoreCase:!1,overrides:{Popover:{props:{ignoreBoundary:h,overrides:{Body:{style:()=>({marginTop:e.spacing.px})}}}},SelectArrow:{component:N,props:{style:{cursor:"pointer"},overrides:{Svg:{style:()=>({width:e.iconSizes.xl,height:e.iconSizes.xl})}}}},IconsContainer:{style:()=>({paddingRight:e.spacing.sm})},ControlContainer:{style:{maxHeight:R,minHeight:e.sizes.minElementHeight,borderLeftWidth:e.sizes.borderWidth,borderRightWidth:e.sizes.borderWidth,borderTopWidth:e.sizes.borderWidth,borderBottomWidth:e.sizes.borderWidth}},Placeholder:{style:()=>({flex:"inherit",color:d?e.colors.fadedText40:e.colors.fadedText60})},ValueContainer:{style:()=>({overflowY:"auto",paddingLeft:e.spacing.sm,paddingTop:e.spacing.none,paddingBottom:e.spacing.none,paddingRight:e.spacing.none})},ClearIcon:{props:{overrides:{Svg:{style:{color:e.colors.darkGray,padding:e.spacing.threeXS,height:e.sizes.clearIconSize,width:e.sizes.clearIconSize,cursor:"pointer",":hover":{fill:e.colors.bodyText}}}}}},SearchIcon:{style:{color:e.colors.darkGray}},Tag:{props:{overrides:{Root:{style:{fontWeight:e.fontWeights.normal,borderTopLeftRadius:e.radii.md,borderTopRightRadius:e.radii.md,borderBottomRightRadius:e.radii.md,borderBottomLeftRadius:e.radii.md,fontSize:e.fontSizes.md,paddingLeft:e.spacing.sm,marginLeft:e.spacing.none,marginRight:e.spacing.sm,height:`calc(${e.sizes.minElementHeight} - 2 * ${e.spacing.xs})`,maxWidth:`calc(100% - ${e.spacing.lg})`,cursor:"default !important"}},Action:{style:{paddingLeft:0}},ActionIcon:{props:{overrides:{Svg:{style:{width:"0.625em",height:"0.625em"}}}}}}}},MultiValue:{props:{overrides:{Root:{style:{fontSize:e.fontSizes.sm}}}}},Input:{props:{readOnly:D()&&w===!1?"readonly":null}},Dropdown:{component:A}}})})]})},X=s.memo(_);export{X as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{cA as ce,d5 as se,d6 as de,d7 as pe,d8 as fe,d9 as ge,cQ as ye,c3 as be,cr as me,da as ve,cR as he,db as Oe,h as J,dc as Se,c as je,r as H,cE as Pe,F as Y,ap as Ce,j as L,b$ as Ie,c0 as Ee,ch as Te,c1 as we,bJ as De,cz as xe}from"./index-
|
|
1
|
+
import{cA as ce,d5 as se,d6 as de,d7 as pe,d8 as fe,d9 as ge,cQ as ye,c3 as be,cr as me,da as ve,cR as he,db as Oe,h as J,dc as Se,c as je,r as H,cE as Pe,F as Y,ap as Ce,j as L,b$ as Ie,c0 as Ee,ch as Te,c1 as we,bJ as De,cz as xe}from"./index-B2QqSXxG.js";import{a as Re}from"./useBasicWidgetState-DVIC6bdr.js";import{T as $e}from"./timepicker-CNx-qwHe.js";import"./FormClearHelper-BC4K9Zmh.js";import"./inherits-CxdXuG_P.js";import"./createSuper-BZDCsfCp.js";var _e=ce.Consumer;const Be=Object.freeze(Object.defineProperty({__proto__:null,ThemeConsumer:_e,ThemeProvider:se,createThemedStyled:de,createThemedUseStyletron:pe,createThemedWithStyle:fe,expandBorderStyles:ge,hexToRgb:ye,styled:be,useStyletron:me,withStyle:ve,withWrapper:he},Symbol.toStringTag,{value:"Module"}));var P={};const G=Oe(Be);var D={},K;function ke(){if(K)return D;K=1,Object.defineProperty(D,"__esModule",{value:!0}),D.STATE_CHANGE_TYPE=D.SIZE=D.ENHANCER_POSITION=D.CUSTOM_INPUT_TYPE=D.ADJOINED=void 0;var g={change:"change"};D.STATE_CHANGE_TYPE=g;var d={textarea:"textarea"};D.CUSTOM_INPUT_TYPE=d;var h={none:"none",left:"left",right:"right",both:"both"};D.ADJOINED=h;var b={mini:"mini",default:"default",compact:"compact",large:"large"};D.SIZE=b;var v={start:"start",end:"end"};return D.ENHANCER_POSITION=v,D}var F={},$={},U={},Q;function Me(){if(Q)return U;Q=1,Object.defineProperty(U,"__esModule",{value:!0}),U.default=d;function g(b){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},g(b)}function d(b){b=b||{};for(var v=arguments.length<=1?0:arguments.length-1,m,y,S=0;S<v;S++){m=(S+1<1||arguments.length<=S+1?void 0:arguments[S+1])||{};for(var f in m)g(m[f])!==void 0&&(y=m[f],h(y)?b[f]=d(b[f]||Array.isArray(y)&&[]||{},y):b[f]=y)}return b}function h(b){return Array.isArray(b)||{}.toString.call(b)=="[object Object]"}return U}var X;function ee(){if(X)return $;X=1,Object.defineProperty($,"__esModule",{value:!0}),$.getOverride=w,$.getOverrideProps=E,$.getOverrides=z,$.mergeConfigurationOverrides=k,$.mergeOverride=R,$.mergeOverrides=B,$.toObjectOverride=x,$.useOverrides=N;var g=m(J()),d=Se(),h=b(Me());function b(i){return i&&i.__esModule?i:{default:i}}function v(i){if(typeof WeakMap!="function")return null;var r=new WeakMap,u=new WeakMap;return(v=function(c){return c?u:r})(i)}function m(i,r){if(i&&i.__esModule)return i;if(i===null||C(i)!=="object"&&typeof i!="function")return{default:i};var u=v(r);if(u&&u.has(i))return u.get(i);var c={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in i)if(a!=="default"&&Object.prototype.hasOwnProperty.call(i,a)){var l=t?Object.getOwnPropertyDescriptor(i,a):null;l&&(l.get||l.set)?Object.defineProperty(c,a,l):c[a]=i[a]}return c.default=i,u&&u.set(i,c),c}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var r=1;r<arguments.length;r++){var u=arguments[r];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(i[c]=u[c])}return i},y.apply(this,arguments)}function S(i,r){var u=Object.keys(i);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(i);r&&(c=c.filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})),u.push.apply(u,c)}return u}function f(i){for(var r=1;r<arguments.length;r++){var u=arguments[r]!=null?arguments[r]:{};r%2?S(Object(u),!0).forEach(function(c){I(i,c,u[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):S(Object(u)).forEach(function(c){Object.defineProperty(i,c,Object.getOwnPropertyDescriptor(u,c))})}return i}function I(i,r,u){return r in i?Object.defineProperty(i,r,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[r]=u,i}function C(i){"@babel/helpers - typeof";return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},C(i)}function w(i){return(0,d.isValidElementType)(i)?i:i&&C(i)==="object"?i.component:i}function E(i){return i&&C(i)==="object"?C(i.props)==="object"?f(f({},i.props),{},{$style:i.style}):{$style:i.style}:{}}function x(i){return(0,d.isValidElementType)(i)?{component:i}:i||{}}function z(i,r){var u=w(i)||r;if(i&&C(i)==="object"&&typeof i.props=="function"){var c=g.forwardRef(function(a,l){var e=i.props(a),o=E(f(f({},i),{},{props:e}));return g.createElement(u,y({ref:l},o))});return c.displayName=u.displayName,[c,{}]}var t=E(i);return[u,t]}function B(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=Object.assign({},i,r),c=Object.keys(u);return c.reduce(function(t,a){return t[a]=R(x(i[a]),x(r[a])),t},{})}function R(i,r){var u=f(f({},i),r);return i.props&&r.props&&(u.props=k(i.props,r.props)),i.style&&r.style&&(u.style=k(i.style,r.style)),u}function k(i,r){return C(i)==="object"&&C(r)==="object"?(0,h.default)({},i,r):function(){return(0,h.default)({},typeof i=="function"?i.apply(void 0,arguments):i,typeof r=="function"?r.apply(void 0,arguments):r)}}function N(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return g.useMemo(function(){return Object.keys(i).reduce(function(u,c){return u[c]=z(r[c],i[c]),u},{})},[r])}return $}var Z={},W={},te;function ze(){if(te)return W;te=1,Object.defineProperty(W,"__esModule",{value:!0}),W.Svg=void 0,W.getSvgStyles=d;var g=G;function d(b){var v=b.$theme,m=b.$size,y=b.$color,S=v.sizing.scale600;m&&(v.sizing[m]?S=v.sizing[m]:typeof m=="number"?S="".concat(m,"px"):S=m);var f="currentColor";return y&&(v.colors[y]?f=v.colors[y]:f=y),{display:"inline-block",fill:f,color:f,height:S,width:S}}var h=(0,g.styled)("svg",d);return W.Svg=h,h.displayName="Svg",h.displayName="Svg",W}var V={},re;function Ne(){if(re)return V;re=1,Object.defineProperty(V,"__esModule",{value:!0}),V.default=g;function g(d){var h={};for(var b in d)b[0]!=="$"&&(h[b]=d[b]);return h}return V}var oe;function Le(){if(oe)return Z;oe=1;function g(t){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},g(t)}Object.defineProperty(Z,"__esModule",{value:!0}),Z.default=void 0;var d=f(J()),h=ee(),b=ze(),v=y(Ne()),m=["children","title","size","color","overrides"];function y(t){return t&&t.__esModule?t:{default:t}}function S(t){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(S=function(e){return e?l:a})(t)}function f(t,a){if(t&&t.__esModule)return t;if(t===null||g(t)!=="object"&&typeof t!="function")return{default:t};var l=S(a);if(l&&l.has(t))return l.get(t);var e={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in t)if(n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)){var p=o?Object.getOwnPropertyDescriptor(t,n):null;p&&(p.get||p.set)?Object.defineProperty(e,n,p):e[n]=t[n]}return e.default=t,l&&l.set(t,e),e}function I(){return I=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var e in l)Object.prototype.hasOwnProperty.call(l,e)&&(t[e]=l[e])}return t},I.apply(this,arguments)}function C(t,a){var l=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);a&&(e=e.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),l.push.apply(l,e)}return l}function w(t){for(var a=1;a<arguments.length;a++){var l=arguments[a]!=null?arguments[a]:{};a%2?C(Object(l),!0).forEach(function(e){E(t,e,l[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(l)):C(Object(l)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(l,e))})}return t}function E(t,a,l){return a in t?Object.defineProperty(t,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):t[a]=l,t}function x(t,a){return N(t)||k(t,a)||B(t,a)||z()}function z(){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 B(t,a){if(t){if(typeof t=="string")return R(t,a);var l=Object.prototype.toString.call(t).slice(8,-1);if(l==="Object"&&t.constructor&&(l=t.constructor.name),l==="Map"||l==="Set")return Array.from(t);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return R(t,a)}}function R(t,a){(a==null||a>t.length)&&(a=t.length);for(var l=0,e=new Array(a);l<a;l++)e[l]=t[l];return e}function k(t,a){var l=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(l!=null){var e=[],o=!0,n=!1,p,s;try{for(l=l.call(t);!(o=(p=l.next()).done)&&(e.push(p.value),!(a&&e.length===a));o=!0);}catch(O){n=!0,s=O}finally{try{!o&&l.return!=null&&l.return()}finally{if(n)throw s}}return e}}function N(t){if(Array.isArray(t))return t}function i(t,a){if(t==null)return{};var l=r(t,a),e,o;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(o=0;o<n.length;o++)e=n[o],!(a.indexOf(e)>=0)&&Object.prototype.propertyIsEnumerable.call(t,e)&&(l[e]=t[e])}return l}function r(t,a){if(t==null)return{};var l={},e=Object.keys(t),o,n;for(n=0;n<e.length;n++)o=e[n],!(a.indexOf(o)>=0)&&(l[o]=t[o]);return l}var u=function(t,a){var l=t.children,e=t.title,o=t.size,n=t.color,p=t.overrides,s=p===void 0?{}:p,O=i(t,m),j=(0,h.getOverrides)(s.Svg,b.Svg),_=x(j,2),T=_[0],M=_[1],A=T.__STYLETRON__?w(w({title:e,$color:n,$size:o},O),M):w(w({title:e,color:n,size:o},(0,v.default)(O)),(0,v.default)(M));return d.createElement(T,I({"data-baseweb":"icon",ref:a},A),e?d.createElement("title",null,e):null,l)},c=d.forwardRef(u);return Z.default=c,Z}var ne;function Ae(){if(ne)return F;ne=1;function g(r){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},g(r)}Object.defineProperty(F,"__esModule",{value:!0}),F.default=void 0;var d=f(J()),h=G,b=ee(),v=y(Le()),m=["title","size","color","overrides"];function y(r){return r&&r.__esModule?r:{default:r}}function S(r){if(typeof WeakMap!="function")return null;var u=new WeakMap,c=new WeakMap;return(S=function(t){return t?c:u})(r)}function f(r,u){if(r&&r.__esModule)return r;if(r===null||g(r)!=="object"&&typeof r!="function")return{default:r};var c=S(u);if(c&&c.has(r))return c.get(r);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in r)if(l!=="default"&&Object.prototype.hasOwnProperty.call(r,l)){var e=a?Object.getOwnPropertyDescriptor(r,l):null;e&&(e.get||e.set)?Object.defineProperty(t,l,e):t[l]=r[l]}return t.default=r,c&&c.set(r,t),t}function I(){return I=Object.assign?Object.assign.bind():function(r){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var t in c)Object.prototype.hasOwnProperty.call(c,t)&&(r[t]=c[t])}return r},I.apply(this,arguments)}function C(r,u){if(r==null)return{};var c=w(r,u),t,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);for(a=0;a<l.length;a++)t=l[a],!(u.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(c[t]=r[t])}return c}function w(r,u){if(r==null)return{};var c={},t=Object.keys(r),a,l;for(l=0;l<t.length;l++)a=t[l],!(u.indexOf(a)>=0)&&(c[a]=r[a]);return c}function E(r,u){return k(r)||R(r,u)||z(r,u)||x()}function x(){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 z(r,u){if(r){if(typeof r=="string")return B(r,u);var c=Object.prototype.toString.call(r).slice(8,-1);if(c==="Object"&&r.constructor&&(c=r.constructor.name),c==="Map"||c==="Set")return Array.from(r);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return B(r,u)}}function B(r,u){(u==null||u>r.length)&&(u=r.length);for(var c=0,t=new Array(u);c<u;c++)t[c]=r[c];return t}function R(r,u){var c=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(c!=null){var t=[],a=!0,l=!1,e,o;try{for(c=c.call(r);!(a=(e=c.next()).done)&&(t.push(e.value),!(u&&t.length===u));a=!0);}catch(n){l=!0,o=n}finally{try{!a&&c.return!=null&&c.return()}finally{if(l)throw o}}return t}}function k(r){if(Array.isArray(r))return r}function N(r,u){var c=(0,h.useStyletron)(),t=E(c,2),a=t[1],l=r.title,e=l===void 0?"Delete Alt":l,o=r.size,n=r.color,p=r.overrides,s=p===void 0?{}:p,O=C(r,m),j=(0,b.mergeOverride)({component:a.icons&&a.icons.DeleteAlt?a.icons.DeleteAlt:null},s&&s.Svg?(0,b.toObjectOverride)(s.Svg):{});return d.createElement(v.default,I({viewBox:"0 0 24 24",ref:u,title:e,size:o,color:n,overrides:{Svg:j}},O),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"}))}var i=d.forwardRef(N);return F.default=i,F}var ie;function We(){if(ie)return P;ie=1,Object.defineProperty(P,"__esModule",{value:!0}),P.getRootStyles=P.getInputStyles=P.getInputContainerStyles=P.StyledMaskToggleButton=P.StyledClearIconContainer=P.StyledClearIcon=P.Root=P.InputEnhancer=P.InputContainer=P.Input=void 0;var g=G,d=ke(),h=b(Ae());function b(e){return e&&e.__esModule?e:{default:e}}function v(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);o&&(p=p.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,p)}return n}function m(e){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?v(Object(n),!0).forEach(function(p){y(e,p,n[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(p){Object.defineProperty(e,p,Object.getOwnPropertyDescriptor(n,p))})}return e}function y(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}var S=(0,g.styled)("button",function(e){var o,n=e.$theme,p=e.$size,s=e.$isFocusVisible,O=(o={},y(o,d.SIZE.mini,n.sizing.scale400),y(o,d.SIZE.compact,n.sizing.scale400),y(o,d.SIZE.default,n.sizing.scale300),y(o,d.SIZE.large,n.sizing.scale200),o)[p];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:O,paddingRight:O,outline:s?"solid 3px ".concat(n.colors.accent):"none",color:n.colors.contentPrimary}});P.StyledMaskToggleButton=S,S.displayName="StyledMaskToggleButton",S.displayName="StyledMaskToggleButton";var f=(0,g.styled)("div",function(e){var o,n=e.$alignTop,p=n===void 0?!1:n,s=e.$size,O=e.$theme,j=(o={},y(o,d.SIZE.mini,O.sizing.scale200),y(o,d.SIZE.compact,O.sizing.scale200),y(o,d.SIZE.default,O.sizing.scale100),y(o,d.SIZE.large,O.sizing.scale0),o)[s];return{display:"flex",alignItems:p?"flex-start":"center",paddingLeft:j,paddingRight:j,paddingTop:p?O.sizing.scale500:"0px",color:O.colors.contentPrimary}});P.StyledClearIconContainer=f,f.displayName="StyledClearIconContainer",f.displayName="StyledClearIconContainer";var I=(0,g.styled)(h.default,function(e){var o=e.$theme,n=e.$isFocusVisible;return{cursor:"pointer",outline:n?"solid 3px ".concat(o.colors.accent):"none"}});P.StyledClearIcon=I,I.displayName="StyledClearIcon",I.displayName="StyledClearIcon";function C(e,o){var n;return(n={},y(n,d.SIZE.mini,{paddingTop:o.scale100,paddingBottom:o.scale100,paddingLeft:o.scale550,paddingRight:o.scale550}),y(n,d.SIZE.compact,{paddingTop:o.scale200,paddingBottom:o.scale200,paddingLeft:o.scale550,paddingRight:o.scale550}),y(n,d.SIZE.default,{paddingTop:o.scale400,paddingBottom:o.scale400,paddingLeft:o.scale550,paddingRight:o.scale550}),y(n,d.SIZE.large,{paddingTop:o.scale550,paddingBottom:o.scale550,paddingLeft:o.scale550,paddingRight:o.scale550}),n)[e]}function w(e,o,n,p,s){var O=e===d.ADJOINED.both||e===d.ADJOINED.left&&p!=="rtl"||e===d.ADJOINED.right&&p==="rtl"||s&&p==="rtl",j=e===d.ADJOINED.both||e===d.ADJOINED.right&&p!=="rtl"||e===d.ADJOINED.left&&p==="rtl"||s&&p!=="rtl";return{paddingLeft:O?n.scale550:"0px",paddingRight:j?n.scale550:"0px"}}function E(e,o){var n;return(n={},y(n,d.SIZE.mini,o.font100),y(n,d.SIZE.compact,o.font200),y(n,d.SIZE.default,o.font300),y(n,d.SIZE.large,o.font400),n)[e]}function x(e,o,n){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=arguments.length>4?arguments[4]:void 0;return e?{borderLeftColor:s.inputFillDisabled,borderRightColor:s.inputFillDisabled,borderTopColor:s.inputFillDisabled,borderBottomColor:s.inputFillDisabled,backgroundColor:s.inputFillDisabled}:o?{borderLeftColor:s.borderSelected,borderRightColor:s.borderSelected,borderTopColor:s.borderSelected,borderBottomColor:s.borderSelected,backgroundColor:s.inputFillActive}:n?{borderLeftColor:s.inputBorderError,borderRightColor:s.inputBorderError,borderTopColor:s.inputBorderError,borderBottomColor:s.inputBorderError,backgroundColor:s.inputFillError}:p?{borderLeftColor:s.inputBorderPositive,borderRightColor:s.inputBorderPositive,borderTopColor:s.inputBorderPositive,borderBottomColor:s.inputBorderPositive,backgroundColor:s.inputFillPositive}:{borderLeftColor:s.inputBorder,borderRightColor:s.inputBorder,borderTopColor:s.inputBorder,borderBottomColor:s.inputBorder,backgroundColor:s.inputFill}}function z(e,o){var n=o.inputBorderRadius;return e===d.SIZE.mini&&(n=o.inputBorderRadiusMini),{borderTopLeftRadius:n,borderBottomLeftRadius:n,borderTopRightRadius:n,borderBottomRightRadius:n}}var B=function(e){var o=e.$isFocused,n=e.$adjoined,p=e.$error,s=e.$disabled,O=e.$positive,j=e.$size,_=e.$theme,T=e.$theme,M=T.borders,A=T.colors,ae=T.sizing,le=T.typography,q=T.animation,ue=e.$hasIconTrailing;return m(m(m(m({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:q.timing200,transitionTimingFunction:q.easeOutCurve},z(j,M)),E(j,le)),x(s,o,p,O,A)),w(n,j,ae,_.direction,ue))};P.getRootStyles=B;var R=(0,g.styled)("div",B);P.Root=R,R.displayName="Root",R.displayName="Root";function k(e,o){var n;return(n={},y(n,d.SIZE.mini,{paddingRight:o.scale400,paddingLeft:o.scale400}),y(n,d.SIZE.compact,{paddingRight:o.scale400,paddingLeft:o.scale400}),y(n,d.SIZE.default,{paddingRight:o.scale300,paddingLeft:o.scale300}),y(n,d.SIZE.large,{paddingRight:o.scale200,paddingLeft:o.scale200}),n)[e]}function N(e,o,n,p,s){return e?{color:s.inputEnhancerTextDisabled,backgroundColor:s.inputFillDisabled}:o?{color:s.contentPrimary,backgroundColor:s.inputFillActive}:n?{color:s.contentPrimary,backgroundColor:s.inputFillError}:p?{color:s.contentPrimary,backgroundColor:s.inputFillPositive}:{color:s.contentPrimary,backgroundColor:s.inputFill}}var i=(0,g.styled)("div",function(e){var o=e.$size,n=e.$disabled,p=e.$isFocused,s=e.$error,O=e.$positive,j=e.$theme,_=j.colors,T=j.sizing,M=j.typography,A=j.animation;return m(m(m({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:A.timing200,transitionTimingFunction:A.easeOutCurve},E(o,M)),k(o,T)),N(n,p,s,O,_))});P.InputEnhancer=i,i.displayName="InputEnhancer",i.displayName="InputEnhancer";function r(e,o,n,p,s){return e?{color:s.inputTextDisabled,backgroundColor:s.inputFillDisabled}:o?{color:s.contentPrimary,backgroundColor:s.inputFillActive}:n?{color:s.contentPrimary,backgroundColor:s.inputFillError}:p?{color:s.contentPrimary,backgroundColor:s.inputFillPositive}:{color:s.contentPrimary,backgroundColor:s.inputFill}}var u=function(e){var o=e.$isFocused,n=e.$error,p=e.$disabled,s=e.$positive,O=e.$size,j=e.$theme,_=j.colors,T=j.typography,M=j.animation;return m(m({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:M.timing200,transitionTimingFunction:M.easeOutCurve},E(O,T)),r(p,o,n,s,_))};P.getInputContainerStyles=u;var c=(0,g.styled)("div",u);P.InputContainer=c,c.displayName="InputContainer",c.displayName="InputContainer";function t(e,o,n,p){return e?{color:p.inputTextDisabled,"-webkit-text-fill-color":p.inputTextDisabled,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholderDisabled}}:{color:p.contentPrimary,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholder}}}var a=function(e){var o=e.$disabled,n=e.$isFocused,p=e.$error,s=e.$size,O=e.$theme,j=O.colors,_=O.sizing,T=O.typography;return m(m(m({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:o?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},E(s,T)),C(s,_)),t(o,n,p,j))};P.getInputStyles=a;var l=(0,g.styled)("input",a);return P.Input=l,l.displayName="Input",l.displayName="Input",P}var Fe=We();const Ze=je("div",{target:"e1ipygm10"})({name:"1ucqwki",styles:"position:absolute;top:50%;right:2.05em"});function He({disabled:g,element:d,widgetMgr:h,fragmentId:b}){const[v,m]=Re({getStateFromWidgetMgr:Ue,getDefaultStateFromProto:Ve,getCurrStateFromProto:Je,updateWidgetMgrState:Ye,element:d,widgetMgr:h,fragmentId:b}),y=H.useContext(Pe),S=Y(d.default)&&!g,f=Ce(),I={Select:{props:{disabled:g,overrides:{ControlContainer:{style:{height:f.sizes.minElementHeight,borderLeftWidth:f.sizes.borderWidth,borderRightWidth:f.sizes.borderWidth,borderTopWidth:f.sizes.borderWidth,borderBottomWidth:f.sizes.borderWidth}},IconsContainer:{style:()=>({paddingRight:f.spacing.sm})},ValueContainer:{style:()=>({lineHeight:f.lineHeights.inputWidget,paddingRight:f.spacing.sm,paddingLeft:f.spacing.md,paddingBottom:f.spacing.sm,paddingTop:f.spacing.sm})},SingleValue:{style:{fontWeight:f.fontWeights.normal},props:{"data-testid":"stTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:f.spacing.none,paddingBottom:f.spacing.none,boxShadow:"none",maxHeight:f.sizes.maxDropdownHeight})},DropdownListItem:{style:()=>({paddingRight:f.spacing.lg,paddingLeft:f.spacing.lg,paddingTop:f.spacing.sm,paddingBottom:f.spacing.sm})},Popover:{props:{ignoreBoundary:y,overrides:{Body:{style:()=>({marginTop:f.spacing.px})}}}},Placeholder:{style:()=>({color:f.colors.fadedText60})},SelectArrow:{component:xe,props:{overrides:{Svg:{style:()=>({width:f.iconSizes.xl,height:f.iconSizes.xl})}}}}}}}},C=H.useCallback(E=>{const x=E===null?null:Ge(E);m({value:x,fromUi:!0})},[m]),w=H.useCallback(()=>{C(null)},[C]);return L.jsxs("div",{className:"stTimeInput","data-testid":"stTimeInput",children:[L.jsx(Ie,{label:d.label,disabled:g,labelVisibility:Ee(d.labelVisibility?.value),children:d.help&&L.jsx(Te,{children:L.jsx(we,{content:d.help,placement:De.TOP_RIGHT})})}),L.jsx($e,{format:"24",step:d.step?Number(d.step):900,value:Y(v)?void 0:qe(v),onChange:C,overrides:I,nullable:S,creatable:!0,"aria-label":d.label}),S&&!Y(v)&&L.jsx(Ze,{onClick:w,"data-testid":"stTimeInputClearButton",children:L.jsx(Fe.StyledClearIcon,{overrides:{Svg:{style:{color:f.colors.darkGray,padding:f.spacing.threeXS,height:f.sizes.clearIconSize,width:f.sizes.clearIconSize,":hover":{fill:f.colors.bodyText}}}},$isFocusVisible:!1})})]})}function Ue(g,d){return g.getStringValue(d)??null}function Ve(g){return g.default??null}function Je(g){return g.value??null}function Ye(g,d,h,b){d.setStringValue(g,h.value,{fromUi:h.fromUi},b)}function Ge(g){const d=g.getHours().toString().padStart(2,"0"),h=g.getMinutes().toString().padStart(2,"0");return`${d}:${h}`}function qe(g){if(g===null)return null;const[d,h]=g.split(":").map(Number),b=new Date;return b.setHours(d),b.setMinutes(h),b}const Ke=H.memo(He);export{Ke as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as L,r as i,bm as P,ap as D,d3 as W,j as s,b$ as H,c0 as M,ch as U,c1 as B,bJ as _,b9 as O,d4 as A}from"./index-
|
|
1
|
+
import{c as L,r as i,bm as P,ap as D,d3 as W,j as s,b$ as H,c0 as M,ch as U,c1 as B,bJ as _,b9 as O,d4 as A}from"./index-B2QqSXxG.js";import{u as G}from"./uniqueId-B67KB2Sb.js";import{I as J}from"./InputInstructions-CqSmotDL.js";import{a as K}from"./useBasicWidgetState-DVIC6bdr.js";import{u as N,a as $,b as q}from"./useUpdateUiValue-BpA660Wd.js";import{I as Q}from"./input-CK3Z1ctS.js";import"./FormClearHelper-BC4K9Zmh.js";import"./inputUtils-CptNuJwn.js";import"./base-input-Bu7lYJya.js";const X=L("div",{target:"e11y4ecf0"})({name:"bjn8wh",styles:"position:relative"});function Y({disabled:a,element:e,widgetMgr:r,fragmentId:d}){const[l,u]=i.useState(()=>S(r,e)??null),[I,y]=P(),[o,p]=i.useState(!1),T=i.useCallback(()=>{u(e.default??null),p(!0)},[e.default]),[C,c]=K({getStateFromWidgetMgr:S,getDefaultStateFromProto:Z,getCurrStateFromProto:ee,updateWidgetMgrState:te,element:e,widgetMgr:r,fragmentId:d,onFormCleared:T});N(C,l,u,o);const[j,h]=i.useState(!1),t=D(),[f]=i.useState(()=>G("text_input_")),{placeholder:v,formId:n,icon:m,maxChars:b}=e,g=i.useCallback(()=>{p(!1),c({value:l,fromUi:!0})},[l,c]),F=W({formId:n})?r.allowFormEnterToSubmit(n):o,z=j&&I>t.breakpoints.hideWidgetDetails,R=i.useCallback(()=>{o&&g(),h(!1)},[o,g]),V=i.useCallback(()=>{h(!0)},[]),w=$({formId:n,maxChars:b,setDirty:p,setUiValue:u,setValueWithSource:c}),E=q(n,g,o,r,d),x=m?.startsWith(":material"),k=x?"lg":"base";return s.jsxs(X,{className:"stTextInput","data-testid":"stTextInput",ref:y,children:[s.jsx(H,{label:e.label,disabled:a,labelVisibility:M(e.labelVisibility?.value),htmlFor:f,children:e.help&&s.jsx(U,{children:s.jsx(B,{content:e.help,placement:_.TOP_RIGHT})})}),s.jsx(Q,{value:l??"",placeholder:v,onBlur:R,onFocus:V,onChange:w,onKeyPress:E,"aria-label":e.label,disabled:a,id:f,type:ae(e),autoComplete:e.autocomplete,startEnhancer:m&&s.jsx(O,{"data-testid":"stTextInputIcon",iconValue:m,size:k}),overrides:{Input:{style:{fontWeight:t.fontWeights.normal,minWidth:0,lineHeight:t.lineHeights.inputWidget,paddingRight:t.spacing.sm,paddingLeft:t.spacing.md,paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm,"::placeholder":{color:t.colors.fadedText60}}},Root:{props:{"data-testid":"stTextInputRootElement"},style:{height:t.sizes.minElementHeight,borderLeftWidth:t.sizes.borderWidth,borderRightWidth:t.sizes.borderWidth,borderTopWidth:t.sizes.borderWidth,borderBottomWidth:t.sizes.borderWidth,paddingLeft:m?t.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:t.iconSizes.lg,color:x?t.colors.fadedText60:"inherit"}}}}),z&&s.jsx(J,{dirty:o,value:l??"",maxLength:b,inForm:W({formId:n}),allowEnterToSubmit:F})]})}function S(a,e){return a.getStringValue(e)??null}function Z(a){return a.default??null}function ee(a){return a.value??null}function te(a,e,r,d){e.setStringValue(a,r.value,{fromUi:r.fromUi},d)}function ae(a){return a.type===A.Type.PASSWORD?"password":"text"}const ie=i.memo(Y);export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,E as P,_,c as R,dd as v,F as g,H as X,l as pe,ap as me,bm as be,d3 as ge,aq as G,j as i,b$ as fe,c0 as he,ch as ye,c1 as ve,bJ as we,b9 as Ie,bY as K}from"./index-
|
|
1
|
+
import{r as a,E as P,_,c as R,dd as v,F as g,H as X,l as pe,ap as me,bm as be,d3 as ge,aq as G,j as i,b$ as fe,c0 as he,ch as ye,c1 as ve,bJ as we,b9 as Ie,bY as K}from"./index-B2QqSXxG.js";import{u as xe}from"./uniqueId-B67KB2Sb.js";import{I as Te}from"./InputInstructions-CqSmotDL.js";import{u as ke}from"./FormClearHelper-BC4K9Zmh.js";import{s as Ce}from"./sprintf-D7DtBTRn.js";import{I as Re}from"./input-CK3Z1ctS.js";import"./base-input-Bu7lYJya.js";var q=a.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(P,_({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),a.createElement("path",{d:"M0 3v2h8V3H0z"}))});q.displayName="Minus";var J=a.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(P,_({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),a.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});J.displayName="Plus";const Se=R("div",{target:"e116k4er3"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",height:e.sizes.minElementHeight,borderWidth:e.sizes.borderWidth,borderStyle:"solid",borderColor:e.colors.widgetBorderColor??e.colors.secondaryBg,transitionDuration:"200ms",transitionProperty:"border",transitionTimingFunction:"cubic-bezier(0.2, 0.8, 0.4, 1)",borderRadius:e.radii.default,overflow:"hidden","&.focused":{borderColor:e.colors.primary},input:{MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:e.spacing.none}}}),""),ze=R("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),Y=R("button",{target:"e116k4er1"})(({theme:e})=>({margin:e.spacing.none,border:"none",height:e.sizes.full,display:"flex",alignItems:"center",width:e.sizes.numberInputControlsWidth,justifyContent:"center",color:e.colors.bodyText,transition:"color 300ms, backgroundColor 300ms",backgroundColor:e.colors.secondaryBg,"&:hover:enabled, &:focus:enabled":{color:e.colors.white,backgroundColor:e.colors.primary,transition:"none",outline:"none"},"&:active":{outline:"none",border:"none"},"&:disabled":{cursor:"not-allowed",color:e.colors.fadedText40}}),""),Ee=R("div",{target:"e116k4er0"})(({theme:e,clearable:t})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:`calc(${e.sizes.numberInputControlsWidth} * 2 + ${t?"1em":"0em"})`}),""),Ve=pe.getLogger("NumberInput");function Ne(e){return g(e)||e===""?void 0:e}const j=({value:e,format:t,step:n,dataType:b})=>{if(g(e))return null;let r=Ne(t);if(g(r)&&X(n)){const p=n.toString();b===v.DataType.FLOAT&&n!==0&&p.includes(".")&&(r=`%0.${p.split(".")[1].length}f`)}if(g(r))return e.toString();try{return Ce.sprintf(r,e)}catch(p){return Ve.warn(`Error in sprintf(${r}, ${e}): ${p}`),String(e)}},je=(e,t,n)=>g(e)?!1:e-t>=n,De=(e,t,n)=>g(e)?!1:e+t<=n,We=e=>(e.element.dataType===v.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element))??e.element.default??null,Q=({step:e,dataType:t})=>e||(t===v.DataType.INT?1:.01),Fe=({disabled:e,element:t,widgetMgr:n,fragmentId:b})=>{const r=me(),{dataType:p,id:S,formId:m,default:D,format:W,icon:z,min:f,max:h}=t,[F,Z]=be(),[l,ee]=a.useState(()=>Q(t)),B=We({element:t,widgetMgr:n}),[y,w]=a.useState(!1),[d,I]=a.useState(B),[L,x]=a.useState(()=>j({value:B,...t,step:l})),[A,M]=a.useState(!1),T=a.useRef(null),H=a.useRef(xe("number_input_")),k=je(d,l,f),C=De(d,l,h),U=ge({formId:m}),te=U?n.allowFormEnterToSubmit(m):y,re=A&&F>r.breakpoints.hideWidgetDetails;a.useEffect(()=>{ee(Q({step:t.step,dataType:t.dataType}))},[t.dataType,t.step]);const c=a.useCallback(({value:o,source:s})=>{if(X(o)&&(f>o||o>h))T.current?.reportValidity();else{const u=o??D??null;switch(p){case v.DataType.INT:n.setIntValue({id:S,formId:m},u,s,b);break;case v.DataType.FLOAT:n.setDoubleValue({id:S,formId:m},u,s,b);break;default:throw new Error("Invalid data type")}w(!1),I(u),x(j({value:u,dataType:p,format:W,step:l}))}},[f,h,T,n,b,l,p,S,m,D,W]),ae=a.useCallback(()=>{y&&c({value:d,source:{fromUi:!0}}),M(!1)},[y,d,c]),oe=a.useCallback(()=>{M(!0)},[]),$=a.useCallback(()=>{const{value:o}=t;t.setValue=!1,I(o??null),x(j({value:o??null,...t,step:l})),c({value:o??null,source:{fromUi:!1}})},[t,l,c]);a.useEffect(()=>{t.setValue?$():c({value:d,source:{fromUi:!1}});const o=T.current;if(o){const s=u=>{u.preventDefault()};return o.addEventListener("wheel",s),()=>{o.removeEventListener("wheel",s)}}},[]),t.setValue&&$();const E=g(t.default)&&!e,ne=a.useCallback(()=>{const o=t.default??null;I(o),c({value:o,source:{fromUi:!0}})},[t]);ke({element:t,widgetMgr:n,onFormCleared:ne});const ie=o=>{const{value:s}=o.target;if(s==="")w(!0),I(null),x(null);else{let u;t.dataType===v.DataType.INT?u=parseInt(s,10):u=parseFloat(s),w(!0),I(u),x(s)}},V=a.useCallback(()=>{C&&(w(!0),c({value:(d??f)+l,source:{fromUi:!0}}))},[d,f,l,C]),N=a.useCallback(()=>{k&&(w(!0),c({value:(d??h)-l,source:{fromUi:!0}}))},[d,h,l,k]),le=a.useCallback(o=>{const{key:s}=o;switch(s){case"ArrowUp":o.preventDefault(),V();break;case"ArrowDown":o.preventDefault(),N();break}},[V,N]),se=a.useCallback(o=>{o.key==="Enter"&&(y&&c({value:d,source:{fromUi:!0}}),n.allowFormEnterToSubmit(m)&&n.submitForm(m,b))},[y,d,c,n,m,b]),O=z?.startsWith(":material"),de=O?"lg":"base",ce=G(r.iconSizes.lg)+2*G(r.spacing.twoXS),ue=z?r.breakpoints.hideNumberInputControls+ce:r.breakpoints.hideNumberInputControls;return i.jsxs("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:Z,children:[i.jsx(fe,{label:t.label,disabled:e,labelVisibility:he(t.labelVisibility?.value),htmlFor:H.current,children:t.help&&i.jsx(ye,{children:i.jsx(ve,{content:t.help,placement:we.TOP_RIGHT})})}),i.jsxs(Se,{className:A?"focused":"","data-testid":"stNumberInputContainer",children:[i.jsx(Re,{type:"number",inputRef:T,value:L??"",placeholder:t.placeholder,onBlur:ae,onFocus:oe,onChange:ie,onKeyPress:se,onKeyDown:le,clearable:E,clearOnEscape:E,disabled:e,"aria-label":t.label,startEnhancer:t.icon&&i.jsx(Ie,{"data-testid":"stNumberInputIcon",iconValue:t.icon,size:de}),id:H.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:r.colors.darkGray,padding:r.spacing.threeXS,height:r.sizes.clearIconSize,width:r.sizes.clearIconSize,":hover":{fill:r.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:l,min:f,max:h,type:"number",inputMode:""},style:{fontWeight:r.fontWeights.normal,lineHeight:r.lineHeights.inputWidget,paddingRight:r.spacing.sm,paddingLeft:r.spacing.md,paddingBottom:r.spacing.sm,paddingTop:r.spacing.sm,"::placeholder":{color:r.colors.fadedText60}}},InputContainer:{style:()=>({borderTopRightRadius:0,borderBottomRightRadius:0})},Root:{style:{borderTopRightRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:0,borderBottomLeftRadius:0,borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,paddingRight:0,paddingLeft:z?r.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:r.iconSizes.lg,color:O?r.colors.fadedText60:"inherit"}}}}),F>ue&&i.jsxs(ze,{children:[i.jsx(Y,{"data-testid":"stNumberInputStepDown",onClick:N,disabled:!k||e,tabIndex:-1,children:i.jsx(K,{content:q,size:"xs",color:k?"inherit":r.colors.disabled})}),i.jsx(Y,{"data-testid":"stNumberInputStepUp",onClick:V,disabled:!C||e,tabIndex:-1,children:i.jsx(K,{content:J,size:"xs",color:C?"inherit":r.colors.disabled})})]})]}),re&&i.jsx(Ee,{clearable:E,children:i.jsx(Te,{dirty:y,value:L??"",inForm:U,allowEnterToSubmit:te})})]})},Be=a.memo(Fe);export{Be as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as h,r as I,bC as j,bd as C,j as t,a as y,bc as E,l as L}from"./index-
|
|
1
|
+
import{c as h,r as I,bC as j,bd as C,j as t,a as y,bc as E,l as L}from"./index-B2QqSXxG.js";import{w as M,E as S}from"./withFullScreenWrapper-CQbXKdaQ.js";import{S as u,T as v}from"./Toolbar-CF99-ktZ.js";const W=h("div",{target:"e115fcil2"})(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",rowGap:e.spacing.lg,maxWidth:"100%",width:"fit-content"}),""),F=h("div",{target:"e115fcil1"})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"stretch",width:"auto",flexGrow:0,">img":{borderRadius:e.radii.default}}),""),R=h("div",{target:"e115fcil0"})(({theme:e})=>({textAlign:"center",marginTop:e.spacing.xs,wordWrap:"break-word",padding:e.spacing.threeXS}),""),T=L.getLogger("ImageList"),H=({itemKey:e,image:i,imgStyle:d,buildMediaURL:n,handleImageError:r})=>{const c=y(i.url);return t.jsxs(F,{"data-testid":"stImageContainer",children:[t.jsx("img",{style:d,src:n(i.url),alt:e,onError:r,crossOrigin:c}),i.caption&&t.jsx(R,{"data-testid":"stImageCaption",style:d,children:t.jsx(E,{source:i.caption,allowHTML:!1,isCaption:!0,isLabel:!0})})]})};function G({element:e,endpoints:i,disableFullscreenMode:d}){const n=j(e.imgs),{expanded:r,width:c,height:g,expand:x,collapse:f}=C(S),p=c||0;let l;const s=e.width;if([-1,-3,-4].includes(s))l=void 0;else if([-2,-5].includes(s))l=p;else if(s>0)l=s;else throw Error(`Invalid image width: ${s}`);const a={};g&&r?(a.maxHeight=g,a.objectFit="contain",a.width="100%"):(a.width=l??"100%",a.maxWidth="100%");const w=m=>{const o=m.currentTarget.src;T.error(`Client Error: Image source error - ${o}`),i.sendClientErrorToHost("Image","Image source failed to load","onerror triggered",o)};return t.jsxs(u,{width:p,height:g,useContainerWidth:r,topCentered:!0,children:[t.jsx(v,{target:u,isFullScreen:r,onExpand:x,onCollapse:f,disableFullscreenMode:d}),t.jsx(W,{className:"stImage","data-testid":"stImage",children:n.map((m,o)=>t.jsx(H,{itemKey:o.toString(),image:m,imgStyle:a,buildMediaURL:b=>i.buildMediaURL(b),handleImageError:w},o))})]})}const U=M(G),A=I.memo(U);export{A as default};
|