@stlite/desktop 0.91.2 → 0.92.1
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/CHANGELOG.md +13 -1
- package/README.md +10 -0
- package/build/assets/{ErrorOutline.esm-CBPRrcCq-C9-TIHiy.js → ErrorOutline.esm-B7r5abii-8TGLClC0.js} +1 -1
- package/build/assets/{FileDownload.esm-zztsCQgv-C5piFaVt.js → FileDownload.esm-CYy3w3Vv-BwlEuFJu.js} +1 -1
- package/build/assets/{FileHelper-D9iak492-B1kwMP-N.js → FileHelper-8inOMdj8-8VXLhO12.js} +1 -1
- package/build/assets/{FormClearHelper-B-0AN2KG-drNJ-Zdq.js → FormClearHelper-DcUb9gFm-uvoV81fq.js} +1 -1
- package/build/assets/{Hooks-BLb3umpI-CC08A2wx.js → Hooks-BLb3umpI-BjA4i06_.js} +1 -1
- package/build/assets/{InputInstructions-w5hPdqFC-DnPj3I4S.js → InputInstructions-CWrzjlV--n3Hf1PP9.js} +1 -1
- package/build/assets/{Particles-DQoPZNo9-BWmBxXhd.js → Particles-DtETFR7S-2aUDxKFJ.js} +1 -1
- package/build/assets/{ProgressBar-DlHaaa-z-DdC3oXz0.js → ProgressBar-Q8F-JGwo-LczZQzat.js} +1 -1
- package/build/assets/{Toolbar-Cau3SOTY-cJ6wtM04.js → Toolbar-Dj6ALImb-BVamUnHI.js} +1 -1
- package/build/assets/{base-input-D-Fvddky-3QuAUeGB.js → base-input-GLmTpqXt-CImyaDRq.js} +1 -1
- package/build/assets/{checkbox-CjcIG3na-LB8a9-d7.js → checkbox-CEGFZTJa-C72AFGdh.js} +1 -1
- package/build/assets/{createSuper-B81LEHTk-DVB4ulOX.js → createSuper-DBoQFSgk-BYJ7jbld.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-C7-8Z8CC-CmhK1L1G.js → data-grid-overlay-editor-KB2z8mJP-C62BT9jT.js} +1 -1
- package/build/assets/{downloader-DcCTL3Wz-DfHnsO-D.js → downloader-DcCTL3Wz-DCpITTU1.js} +1 -1
- package/build/assets/{es6--XPcqeHG-CU-P5RWV.js → es6--XPcqeHG-DhJ5N6cn.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-vAQsQkcx-DjDgPkx5.js → iframeResizer.contentWindow-B8PMRo_J-DvNzNbbR.js} +1 -1
- package/build/assets/{index-6t9Tq-Ab-Cc_ees8I.js → index-B4C0HP4d-BkRIYQ6B.js} +1 -1
- package/build/assets/{index-DEKI5kx7-B8lK1On8.js → index-B8DruXv7-BsVgHQy8.js} +1 -1
- package/build/assets/{index-D6OV4wQy-CQIpYALu.js → index-BEhJ1GQx-Bd2m54CP.js} +1 -1
- package/build/assets/{index-Da8BucgM-CDMzLZMq.js → index-BIgXGMHt-JW2hwTbx.js} +1 -1
- package/build/assets/{index-BxpEVUJq.js → index-BIyIgwS4.js} +10 -10
- package/build/assets/{index-DVo6TdD5-Cigl7ucs.js → index-BOT4J8P2-nhENc6Pb.js} +1 -1
- package/build/assets/{index-Bx1YyC6x-bUWv5Yyf.js → index-BUQFjfFe-DhpyxZBa.js} +1 -1
- package/build/assets/{index-oFRA4JRK-kx0e_3zA.js → index-BcOX_8Yb-BQhvH4hh.js} +1 -1
- package/build/assets/{index-BNeCf0z6-eizg-dFz.js → index-BeQFPWOx-B1_VBork.js} +1 -1
- package/build/assets/{index-DqAvSOqr-BCGTFud5.js → index-BlHNutXS-Bf1cUsIS.js} +1 -1
- package/build/assets/{index-B5h0Xgw3-CNFqm9ip.js → index-Bn_Q7wro-BclOBnF3.js} +1 -1
- package/build/assets/{index-vdN_5NIh-CyyygayY.js → index-Bqaw3D2g-DJFA3vu1.js} +1 -1
- package/build/assets/{index-Ds3R2kL1-CFh_Kz3Y.js → index-BvmneqQT-C6pM51YE.js} +1 -1
- package/build/assets/{index-C5FPtYYS-BTTgdUI2.js → index-C43v7-zt-XSOlpSRO.js} +1 -1
- package/build/assets/{index--hiX6Uwv-DtKO9Hld.js → index-C5n_E3xJ-C9GlH5Bh.js} +1 -1
- package/build/assets/{index-COXlYbHo-B2m8urCs.js → index-C9MF7a8p-1U1wjf1z.js} +1 -1
- package/build/assets/{index-D4OS_mB9-BwMU_oxN.js → index-C9t9keZs-Cj8jGlNq.js} +1 -1
- package/build/assets/{index-JJq6JoHy-CX1Omp_x.js → index-CCBxT-Px-B32Uy-Qk.js} +1 -1
- package/build/assets/{index-D9xjkRNt-CFe8X0f3.js → index-CKhpdqU4-B-ULAgQ3.js} +1 -1
- package/build/assets/{index-Bt2pmgaJ-ymksNLCl.js → index-CRwtTJoc-DxkxT91b.js} +5 -5
- package/build/assets/{index-CUH8SI0g-CgCG3Tq7.js → index-CVVkGp8U-OXoobo4A.js} +1 -1
- package/build/assets/{index-BXbsmcnm-D0BJVs7R.js → index-CmxogrTC-CmhUjGHI.js} +1 -1
- package/build/assets/{index-PfjJDWy5-DkldmeJ8.js → index-DGEZt8XB-BPwUD6x9.js} +1 -1
- package/build/assets/{index-CeUKVR_x-6fYziq6X.js → index-DIlmdxHH-DZzaykGG.js} +1 -1
- package/build/assets/{index-CR_1rzEZ-DaqWZNME.js → index-DQkZMKcP-qmoywAyX.js} +1 -1
- package/build/assets/{index-D5GvvN8r-CL05rAIV.js → index-DXzYmrGv-DMgQyWr1.js} +1 -1
- package/build/assets/{index-FbSORAjW-Lthz52ML.js → index-DpJLAqiz-BkX4MLEb.js} +1 -1
- package/build/assets/{index-D8AcUh2z-BvmWAicd.js → index-Dws1I0Ds-DN2TZwAq.js} +1 -1
- package/build/assets/{index-BDD6ManL-XC9-hEWd.js → index-E8OLJqjb-DnzI_NxU.js} +1 -1
- package/build/assets/{index-kgY8PEpO-BUILDAe7.js → index-EY_iYK3N-Bp22waFF.js} +1 -1
- package/build/assets/{index-BDtR3I-m-C6v_enzF.js → index-MLOYywLc-D7-SprmM.js} +1 -1
- package/build/assets/{index-DbIPIRRU-UJS7GIgX.js → index-gFid1htU-BDjIBtvA.js} +1 -1
- package/build/assets/{index-D9Ww6wIM-CODTYNKi.js → index-h6RjFy4Y-C5de9ASo.js} +1 -1
- package/build/assets/{index-CL9VPrGG-DvzaBWYj.js → index-hQQyMr9F-eQNYPxka.js} +1 -1
- package/build/assets/{index-DYssp6us-ss1M0SKX.js → index-kEUlOODQ-D3h_Flo2.js} +1 -1
- package/build/assets/{index-OAJkEMe--vGYqEFkN.js → index-nCXiKSAh-DSiervQu.js} +1 -1
- package/build/assets/{index-DBM8Q3zu-1UaS0Le1.js → index-oX5euHW0-C-SIRbDl.js} +1 -1
- package/build/assets/{inherits-DIXnBNlu-DQhXiByk.js → inherits-BwU0tCO4-DkeIG_qH.js} +1 -1
- package/build/assets/{input-D3V-zfyu-Ca751_uU.js → input-DMrd22sk-UYShFfZu.js} +1 -1
- package/build/assets/{memory-B3L1Fctl-DNb7NEQl.js → memory-B3L1Fctl-WytsaLFU.js} +1 -1
- package/build/assets/{number-overlay-editor-ChRMsdOl-C6ThLwiC.js → number-overlay-editor-CdbzA3D_-BCwwbhhn.js} +1 -1
- package/build/assets/{sandbox-ChAzL-i--FikCfyDW.js → sandbox-ChAzL-i--CpDb1da2.js} +1 -1
- package/build/assets/{slicedToArray-BPQXLGHq-C21Y2TxO.js → slicedToArray-CQ1aOJ-Q-fFO-C-TS.js} +1 -1
- package/build/assets/{timepicker-B0aGGgzd-sxFvpbfo.js → timepicker-DZap2iV8-CkcqVZT5.js} +1 -1
- package/build/assets/{uniqueId-MHj2wT7u-DPxsodx6.js → uniqueId-Dmqdy5md-DdrLw8YB.js} +1 -1
- package/build/assets/{useBasicWidgetState-zjZCXhqV-BNiFnFun.js → useBasicWidgetState-DH5OpqC3-H5wMmJFo.js} +1 -1
- package/build/assets/{useTextInputAutoExpand-ox95UJrD-CZJQOtsK.js → useTextInputAutoExpand-B5nEdsJC-DTKFLxU2.js} +1 -1
- package/build/assets/{useUpdateUiValue-Yj1mvLxf-DIZzUp3u.js → useUpdateUiValue-CzJ3I42c-D42S2lbA.js} +1 -1
- package/build/assets/{withFullScreenWrapper-Ca0mIjWH-ClODS1xe.js → withFullScreenWrapper-CsmVH3u1-BwamaUTy.js} +1 -1
- package/build/index.html +1 -1
- package/package.json +3 -3
- package/wheels/streamlit-1.50.0-cp313-none-any.whl +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,f as P,m as D,bV as W,j as o,c as k,aI as H,aJ as U,b0 as $,aK as B,ap as M,F as _,bY as G}from"./index-
|
|
1
|
+
import{r as i,f as P,m as D,bV as W,j as o,c as k,aI as H,aJ as U,b0 as $,aK as B,ap as M,F as _,bY as G}from"./index-BIyIgwS4.js";import{I as K}from"./uniqueId-Dmqdy5md-DdrLw8YB.js";import{e as O}from"./InputInstructions-CWrzjlV--n3Hf1PP9.js";import{S as Y}from"./useBasicWidgetState-DH5OpqC3-H5wMmJFo.js";import{v as A,a as J,c as N}from"./useUpdateUiValue-CzJ3I42c-D42S2lbA.js";import{a as Z}from"./input-DMrd22sk-UYShFfZu.js";import"./FormClearHelper-DcUb9gFm-uvoV81fq.js";import"./inputUtils-DCYiajnz-DsrlAoKH.js";import"./base-input-GLmTpqXt-CImyaDRq.js";const q=k("div",{target:"e11y4ecf0"})({name:"bjn8wh",styles:"position:relative"});function Q({disabled:a,element:e,widgetMgr:r,fragmentId:d}){const[l,u]=i.useState(()=>S(r,e)??null),{width:I,elementRef:T}=P(),[s,p]=i.useState(!1),y=i.useCallback(()=>{u(e.default??null),p(!0)},[e.default]),[j,c]=Y({getStateFromWidgetMgr:S,getDefaultStateFromProto:X,getCurrStateFromProto:ee,updateWidgetMgrState:te,element:e,widgetMgr:r,fragmentId:d,onFormCleared:y});A(j,l,u,s);const[C,f]=i.useState(!1),t=D(),[h]=i.useState(()=>K("text_input_")),{placeholder:F,formId:n,icon:m,maxChars:b}=e,g=i.useCallback(()=>{p(!1),c({value:l,fromUi:!0})},[l,c]),V=W({formId:n})?r.allowFormEnterToSubmit(n):s,v=C&&I>t.breakpoints.hideWidgetDetails,E=i.useCallback(()=>{s&&g(),f(!1)},[s,g]),R=i.useCallback(()=>{f(!0)},[]),z=J({formId:n,maxChars:b,setDirty:p,setUiValue:u,setValueWithSource:c}),L=N(n,g,s,r,d),x=m?.startsWith(":material"),w=x?"lg":"base";return o.jsxs(q,{className:"stTextInput","data-testid":"stTextInput",ref:T,children:[o.jsx(H,{label:e.label,disabled:a,labelVisibility:U(e.labelVisibility?.value),htmlFor:h,children:e.help&&o.jsx($,{children:o.jsx(B,{content:e.help,placement:M.TOP_RIGHT})})}),o.jsx(Z,{value:l??"",placeholder:F,onBlur:E,onFocus:R,onChange:z,onKeyPress:L,"aria-label":e.label,disabled:a,id:h,type:ae(e),autoComplete:e.autocomplete,startEnhancer:m&&o.jsx(_,{"data-testid":"stTextInputIcon",iconValue:m,size:w}),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"}}}}),v&&o.jsx(O,{dirty:s,value:l??"",maxLength:b,inForm:W({formId:n}),allowEnterToSubmit:V})]})}function S(a,e){return a.getStringValue(e)??null}function X(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===G.Type.PASSWORD?"password":"text"}const pe=i.memo(Q);export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,m as k,M as T,j as n,b6 as y,b7 as C,aJ as S,H as $,aV as L,aK as w,ap as R,ao as W,b8 as B}from"./index-
|
|
1
|
+
import{r as p,m as k,M as T,j as n,b6 as y,b7 as C,aJ as S,H as $,aV as L,aK as w,ap as R,ao as W,b8 as B}from"./index-BIyIgwS4.js";import{S as v}from"./useBasicWidgetState-DH5OpqC3-H5wMmJFo.js";import{v as H,y as M,T as u}from"./checkbox-CEGFZTJa-C72AFGdh.js";import"./FormClearHelper-DcUb9gFm-uvoV81fq.js";function V({element:e,disabled:a,widgetMgr:s,fragmentId:c}){const[f,g]=v({getStateFromWidgetMgr:j,getDefaultStateFromProto:X,getCurrStateFromProto:I,updateWidgetMgrState:P,element:e,widgetMgr:s,fragmentId:c}),x=p.useCallback(i=>{g({value:i.target.checked,fromUi:!0})},[g]),t=k(),{colors:o,spacing:h,sizes:r}=t,b=T(t),m=a?o.fadedText40:o.bodyText;return n.jsx(y,{className:"row-widget stCheckbox","data-testid":"stCheckbox",children:n.jsx(H,{checked:f,disabled:a,onChange:x,"aria-label":e.label,checkmarkType:e.type===B.StyleType.TOGGLE?u.toggle:u.default,labelPlacement:M.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:h.none,marginTop:h.none,backgroundColor:i?o.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Toggle:{style:({$checked:i})=>{let d=b?o.bgColor:o.bodyText;return a&&(d=b?o.gray70:o.gray90),{width:`calc(${r.checkbox} - ${t.spacing.twoXS})`,height:`calc(${r.checkbox} - ${t.spacing.twoXS})`,transform:i?`translateX(${r.checkbox})`:"",backgroundColor:d,boxShadow:""}}},ToggleTrack:{style:({$checked:i,$isHovered:d})=>{let l=o.fadedText40;return d&&!a&&(l=o.fadedText20),i&&!a&&(l=o.primary),{marginRight:0,marginLeft:0,marginBottom:0,marginTop:t.spacing.twoXS,paddingLeft:t.spacing.threeXS,paddingRight:t.spacing.threeXS,width:`calc(2 * ${r.checkbox})`,minWidth:`calc(2 * ${r.checkbox})`,height:r.checkbox,minHeight:r.checkbox,borderBottomLeftRadius:t.radii.full,borderTopLeftRadius:t.radii.full,borderBottomRightRadius:t.radii.full,borderTopRightRadius:t.radii.full,backgroundColor:l}}},Checkmark:{style:({$isFocusVisible:i,$checked:d})=>{const l=d&&!a?o.primary:o.fadedText40;return{outline:0,width:r.checkbox,height:r.checkbox,marginTop:t.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&d?`0 0 0 0.2rem ${W(o.primary,.5)}`:"",borderLeftWidth:r.borderWidth,borderRightWidth:r.borderWidth,borderTopWidth:r.borderWidth,borderBottomWidth:r.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:t.lineHeights.small,paddingLeft:t.spacing.sm,position:"relative",color:m}}},children:n.jsxs(C,{visibility:S(e.labelVisibility?.value),"data-testid":"stWidgetLabel",children:[n.jsx($,{source:e.label,allowHTML:!1,isLabel:!0,largerLabel:!0}),e.help&&n.jsx(L,{color:m,children:n.jsx(w,{content:e.help,placement:R.TOP_RIGHT})})]})})})}function j(e,a){return e.getBoolValue(a)}function X(e){return e.default??null}function I(e){return e.value??null}function P(e,a,s,c){a.setBoolValue(e,s.value,{fromUi:s.fromUi},c)}const U=p.memo(V);export{U as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as h,m as vr,bd as xn,L as En,be as Xe,v as tn,j as Pe,aI as Hn,aJ as In,b0 as An,aK as Ln,ap as wr,bf as rn,aS as Tn,aR as Rn,H as Bn,M as $n,aX as G,aY as V,bg as nn,aZ as Qe,X as Fn,bh as Wn,bi as on,bj as Yn,aC as Nn,b9 as an,bk as zn,bl as Sr,bm as sn,bn as ln,bo as un,bp as cn,ba as Fe,bb as We,bq as Vn,br as _n,bs as qn,bt as Un,bu as Xn}from"./index-
|
|
1
|
+
import{r as h,m as vr,bd as xn,L as En,be as Xe,v as tn,j as Pe,aI as Hn,aJ as In,b0 as An,aK as Ln,ap as wr,bf as rn,aS as Tn,aR as Rn,H as Bn,M as $n,aX as G,aY as V,bg as nn,aZ as Qe,X as Fn,bh as Wn,bi as on,bj as Yn,aC as Nn,b9 as an,bk as zn,bl as Sr,bm as sn,bn as ln,bo as un,bp as cn,ba as Fe,bb as We,bq as Vn,br as _n,bs as qn,bt as Un,bu as Xn}from"./index-BIyIgwS4.js";import{S as Qn}from"./useBasicWidgetState-DH5OpqC3-H5wMmJFo.js";import{b as Re,z as Be,w as Kn}from"./timepicker-DZap2iV8-CkcqVZT5.js";import{a as Gn}from"./input-DMrd22sk-UYShFfZu.js";import{q as Zn}from"./base-input-GLmTpqXt-CImyaDRq.js";import{i as Jn}from"./ErrorOutline.esm-B7r5abii-8TGLClC0.js";import"./FormClearHelper-DcUb9gFm-uvoV81fq.js";import"./inherits-BwU0tCO4-DkeIG_qH.js";import"./createSuper-DBoQFSgk-BYJ7jbld.js";var eo=["title","size","color","overrides"];function Mt(){return Mt=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},Mt.apply(this,arguments)}function to(e,t){if(e==null)return{};var n=ro(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 ro(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 no(e,t){return so(e)||io(e,t)||ao(e,t)||oo()}function oo(){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 ao(e,t){if(e){if(typeof e=="string")return Dr(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 Dr(e,t)}}function Dr(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 io(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 so(e){if(Array.isArray(e))return e}function lo(e,t){var n=sn(),o=no(n,2),r=o[1],a=e.title,i=a===void 0?"Left":a,s=e.size,d=e.color,c=e.overrides,m=c===void 0?{}:c,u=to(e,eo),f=ln({component:r.icons&&r.icons.ChevronLeft?r.icons.ChevronLeft:null},m&&m.Svg?un(m.Svg):{});return h.createElement(cn,Mt({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 Or=h.forwardRef(lo);var uo=["title","size","color","overrides"];function Pt(){return Pt=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},Pt.apply(this,arguments)}function co(e,t){if(e==null)return{};var n=po(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 po(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 fo(e,t){return yo(e)||mo(e,t)||go(e,t)||ho()}function ho(){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 go(e,t){if(e){if(typeof e=="string")return kr(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 kr(e,t)}}function kr(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 mo(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 yo(e){if(Array.isArray(e))return e}function bo(e,t){var n=sn(),o=fo(n,2),r=o[1],a=e.title,i=a===void 0?"Right":a,s=e.size,d=e.color,c=e.overrides,m=c===void 0?{}:c,u=co(e,uo),f=ln({component:r.icons&&r.icons.ChevronRight?r.icons.ChevronRight:null},m&&m.Svg?un(m.Svg):{});return h.createElement(cn,Pt({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 Cr=h.forwardRef(bo);var Mr={exports:{}},mt,Pr;function vo(){if(Pr)return mt;Pr=1;function e(p){return p&&typeof p=="object"&&"default"in p?p.default:p}var t=e(Nn),n=Yn;function o(p,b){for(var O=Object.getOwnPropertyNames(b),g=0;g<O.length;g++){var l=O[g],x=Object.getOwnPropertyDescriptor(b,l);x&&x.configurable&&p[l]===void 0&&Object.defineProperty(p,l,x)}return p}function r(){return(r=Object.assign||function(p){for(var b=1;b<arguments.length;b++){var O=arguments[b];for(var g in O)Object.prototype.hasOwnProperty.call(O,g)&&(p[g]=O[g])}return p}).apply(this,arguments)}function a(p,b){p.prototype=Object.create(b.prototype),o(p.prototype.constructor=p,b)}function i(p,b){if(p==null)return{};var O,g,l={},x=Object.keys(p);for(g=0;g<x.length;g++)O=x[g],0<=b.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,b,O,g,l,x,U,te){if(!p){var L;if(b===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 Y=[O,g,l,x,U,te],z=0;(L=new Error(b.replace(/%s/g,function(){return Y[z++]}))).name="Invariant Violation"}throw L.framesToPop=1,L}},c=d;function m(p,b,O){if("selectionStart"in p&&"selectionEnd"in p)p.selectionStart=b,p.selectionEnd=O;else{var g=p.createTextRange();g.collapse(!0),g.moveStart("character",b),g.moveEnd("character",O-b),g.select()}}function u(p){var b=0,O=0;if("selectionStart"in p&&"selectionEnd"in p)b=p.selectionStart,O=p.selectionEnd;else{var g=document.selection.createRange();g.parentElement()===p&&(b=-g.moveStart("character",-p.value.length),O=-g.moveEnd("character",-p.value.length))}return{start:b,end:O,length:O-b}}var f={9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},w="_";function y(p,b,O){var g="",l="",x=null,U=[];if(b===void 0&&(b=w),O==null&&(O=f),!p||typeof p!="string")return{maskChar:b,formatChars:O,mask:null,prefix:null,lastEditablePosition:null,permanents:[]};var te=!1;return p.split("").forEach(function(L){te=!te&&L==="\\"||(te||!O[L]?(U.push(g.length),g.length===U.length-1&&(l+=L)):x=g.length+1,g+=L,!1)}),{maskChar:b,formatChars:O,prefix:l,mask:g,lastEditablePosition:x,permanents:U}}function v(p,b){return p.permanents.indexOf(b)!==-1}function S(p,b,O){var g=p.mask,l=p.formatChars;if(!O)return!1;if(v(p,b))return g[b]===O;var x=l[g[b]];return new RegExp(x).test(O)}function D(p,b){return b.split("").every(function(O,g){return v(p,g)||!S(p,g,O)})}function k(p,b){var O=p.maskChar,g=p.prefix;if(!O){for(;b.length>g.length&&v(p,b.length-1);)b=b.slice(0,b.length-1);return b.length}for(var l=g.length,x=b.length;x>=g.length;x--){var U=b[x];if(!v(p,x)&&S(p,x,U)){l=x+1;break}}return l}function C(p,b){return k(p,b)===p.mask.length}function M(p,b){var O=p.maskChar,g=p.mask,l=p.prefix;if(!O){for((b=T(p,"",b,0)).length<l.length&&(b=l);b.length<g.length&&v(p,b.length);)b+=g[b.length];return b}if(b)return T(p,M(p,""),b,0);for(var x=0;x<g.length;x++)v(p,x)?b+=g[x]:b+=O;return b}function B(p,b,O,g){var l=O+g,x=p.maskChar,U=p.mask,te=p.prefix,L=b.split("");if(x)return L.map(function(z,re){return re<O||l<=re?z:v(p,re)?U[re]:x}).join("");for(var Y=l;Y<L.length;Y++)v(p,Y)&&(L[Y]="");return O=Math.max(te.length,O),L.splice(O,l-O),b=L.join(""),M(p,b)}function T(p,b,O,g){var l=p.mask,x=p.maskChar,U=p.prefix,te=O.split(""),L=C(p,b);return!x&&g>b.length&&(b+=l.slice(b.length,g)),te.every(function(Y){for(;ie=Y,v(p,X=g)&&ie!==l[X];){if(g>=b.length&&(b+=l[g]),z=Y,re=g,x&&v(p,re)&&z===x)return!0;if(++g>=l.length)return!1}var z,re,X,ie;return!S(p,g,Y)&&Y!==x||(g<b.length?b=x||L||g<U.length?b.slice(0,g)+Y+b.slice(g+1):(b=b.slice(0,g)+Y+b.slice(g),M(p,b)):x||(b+=Y),++g<l.length)}),b}function $(p,b,O,g){var l=p.mask,x=p.maskChar,U=O.split(""),te=g;return U.every(function(L){for(;z=L,v(p,Y=g)&&z!==l[Y];)if(++g>=l.length)return!1;var Y,z;return(S(p,g,L)||L===x)&&g++,g<l.length}),g-te}function F(p,b){for(var O=b;0<=O;--O)if(!v(p,O))return O;return null}function E(p,b){for(var O=p.mask,g=b;g<O.length;++g)if(!v(p,g))return g;return null}function I(p){return p||p===0?p+"":""}function H(p,b,O,g,l){var x=p.mask,U=p.prefix,te=p.lastEditablePosition,L=b,Y="",z=0,re=0,X=Math.min(l.start,O.start);return O.end>l.start?re=(z=$(p,g,Y=L.slice(l.start,O.end),X))?l.length:0:L.length<g.length&&(re=g.length-L.length),L=g,re&&(re===1&&!l.length&&(X=l.start===O.start?E(p,O.start):F(p,O.start)),L=B(p,L,X,re)),L=T(p,L,Y,X),(X+=z)>=x.length?X=x.length:X<U.length&&!z?X=U.length:X>=U.length&&X<te&&z&&(X=E(p,X)),Y||(Y=null),{value:L=M(p,L),enteredString:Y,selection:{start:X,end:X}}}function j(){var p=new RegExp("windows","i"),b=new RegExp("phone","i"),O=navigator.userAgent;return p.test(O)&&b.test(O)}function A(p){return typeof p=="function"}function he(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame}function W(){return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame}function ge(p){return(W()?he():function(){return setTimeout(p,1e3/60)})(p)}function R(p){(W()||clearTimeout)(p)}var be=(function(p){function b(g){var l=p.call(this,g)||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=ge(l.saveSelectionLoop)},l.runSaveSelectionLoop=function(){l.saveSelectionLoopDeferId===null&&l.saveSelectionLoop()},l.stopSaveSelectionLoop=function(){l.saveSelectionLoopDeferId!==null&&(R(l.saveSelectionLoopDeferId),l.saveSelectionLoopDeferId=null,l.previousSelection=null)},l.getInputDOMNode=function(){if(!l.mounted)return null;var P=n.findDOMNode(s(s(l))),N=typeof window<"u"&&P instanceof window.Element;if(P&&!N)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 N=l.getInputDOMNode();N&&(l.value=P,N.value=P)},l.setCursorToEnd=function(){var P=k(l.maskOptions,l.value),N=E(l.maskOptions,P);N!==null&&l.setCursorPosition(N)},l.setSelection=function(P,N,Q){Q===void 0&&(Q={});var _=l.getInputDOMNode(),Z=l.isFocused();_&&Z&&(Q.deferred||m(_,P,N),l.selectionDeferId!==null&&R(l.selectionDeferId),l.selectionDeferId=ge(function(){l.selectionDeferId=null,m(_,P,N)}),l.previousSelection={start:P,end:N,length:Math.abs(N-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,N=P.mask,Q=P.maskChar,_=P.permanents,Z=P.formatChars;return{mask:N,maskChar:Q,permanents:_,alwaysShowMask:!!l.props.alwaysShowMask,formatChars:Z}},l.isInputAutofilled=function(P,N,Q,_){var Z=l.getInputDOMNode();try{if(Z.matches(":-webkit-autofill"))return!0}catch{}return!l.focused||_.end<Q.length&&N.end===P.length},l.onChange=function(P){var N=s(s(l)).beforePasteState,Q=s(s(l)).previousSelection,_=l.props.beforeMaskedValueChange,Z=l.getInputValue(),me=l.value,pe=l.getSelection();l.isInputAutofilled(Z,pe,me,Q)&&(me=M(l.maskOptions,""),Q={start:0,end:0,length:0}),N&&(Q=N.selection,me=N.value,pe={start:Q.start+Z.length,end:Q.start+Z.length,length:0},Z=me.slice(0,Q.start)+Z+me.slice(Q.end),l.beforePasteState=null);var Me=H(l.maskOptions,Z,pe,me,Q),Ze=Me.enteredString,ve=Me.selection,Ie=Me.value;if(A(_)){var $e=_({value:Ie,selection:ve},{value:me,selection:Q},Ze,l.getBeforeMaskedValueChangeConfig());Ie=$e.value,ve=$e.selection}l.setInputValue(Ie),A(l.props.onChange)&&l.props.onChange(P),l.isWindowsPhoneBrowser?l.setSelection(ve.start,ve.end,{deferred:!0}):l.setSelection(ve.start,ve.end)},l.onFocus=function(P){var N=l.props.beforeMaskedValueChange,Q=l.maskOptions,_=Q.mask,Z=Q.prefix;if(l.focused=!0,l.mounted=!0,_){if(l.value)k(l.maskOptions,l.value)<l.maskOptions.mask.length&&l.setCursorToEnd();else{var me=M(l.maskOptions,Z),pe=M(l.maskOptions,me),Me=k(l.maskOptions,pe),Ze=E(l.maskOptions,Me),ve={start:Ze,end:Ze};if(A(N)){var Ie=N({value:pe,selection:ve},{value:l.value,selection:null},null,l.getBeforeMaskedValueChangeConfig());pe=Ie.value,ve=Ie.selection}var $e=pe!==l.getInputValue();$e&&l.setInputValue(pe),$e&&A(l.props.onChange)&&l.props.onChange(P),l.setSelection(ve.start,ve.end)}l.runSaveSelectionLoop()}A(l.props.onFocus)&&l.props.onFocus(P)},l.onBlur=function(P){var N=l.props.beforeMaskedValueChange,Q=l.maskOptions.mask;if(l.stopSaveSelectionLoop(),l.focused=!1,Q&&!l.props.alwaysShowMask&&D(l.maskOptions,l.value)){var _="";A(N)&&(_=N({value:_,selection:null},{value:l.value,selection:l.previousSelection},null,l.getBeforeMaskedValueChangeConfig()).value);var Z=_!==l.getInputValue();Z&&l.setInputValue(_),Z&&A(l.props.onChange)&&l.props.onChange(P)}A(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 N=function Q(_){if(document.removeEventListener("mouseup",Q),l.focused){var Z=Math.abs(_.clientX-l.mouseDownX),me=Math.abs(_.clientY-l.mouseDownY),pe=Math.max(Z,me),Me=new Date().getTime()-l.mouseDownTime;(pe<=10&&Me<=200||pe<=5&&Me<=300)&&l.setCursorToEnd()}};document.addEventListener("mouseup",N)}A(l.props.onMouseDown)&&l.props.onMouseDown(P)},l.onPaste=function(P){A(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&&A(l.props.inputRef)&&l.props.inputRef(P)};var x=g.mask,U=g.maskChar,te=g.formatChars,L=g.alwaysShowMask,Y=g.beforeMaskedValueChange,z=g.defaultValue,re=g.value;l.maskOptions=y(x,U,te),z==null&&(z=""),re==null&&(re=z);var X=I(re);if(l.maskOptions.mask&&(L||X)&&(X=M(l.maskOptions,X),A(Y))){var ie=g.value;g.value==null&&(ie=z),X=Y({value:X,selection:null},{value:ie=I(ie),selection:null},null,l.getBeforeMaskedValueChangeConfig()).value}return l.value=X,l}a(b,p);var O=b.prototype;return O.componentDidMount=function(){this.mounted=!0,this.getInputDOMNode()&&(this.isWindowsPhoneBrowser=j(),this.maskOptions.mask&&this.getInputValue()!==this.value&&this.setInputValue(this.value))},O.componentDidUpdate=function(){var g=this.previousSelection,l=this.props,x=l.beforeMaskedValueChange,U=l.alwaysShowMask,te=l.mask,L=l.maskChar,Y=l.formatChars,z=this.maskOptions,re=U||this.isFocused(),X=this.props.value!=null,ie=X?I(this.props.value):this.value,P=g?g.start:null;if(this.maskOptions=y(te,L,Y),this.maskOptions.mask){!z.mask&&this.isFocused()&&this.runSaveSelectionLoop();var N=this.maskOptions.mask&&this.maskOptions.mask!==z.mask;if(z.mask||X||(ie=this.getInputValue()),(N||this.maskOptions.mask&&(ie||re))&&(ie=M(this.maskOptions,ie)),N){var Q=k(this.maskOptions,ie);(P===null||Q<P)&&(P=C(this.maskOptions,ie)?Q:E(this.maskOptions,Q))}!this.maskOptions.mask||!D(this.maskOptions,ie)||re||X&&this.props.value||(ie="");var _={start:P,end:P};if(A(x)){var Z=x({value:ie,selection:_},{value:this.value,selection:this.previousSelection},null,this.getBeforeMaskedValueChangeConfig());ie=Z.value,_=Z.selection}this.value=ie;var me=this.getInputValue()!==this.value;me?(this.setInputValue(this.value),this.forceUpdate()):N&&this.forceUpdate();var pe=!1;_.start!=null&&_.end!=null&&(pe=!g||g.start!==_.start||g.end!==_.end),(pe||me)&&this.setSelection(_.start,_.end)}else z.mask&&(this.stopSaveSelectionLoop(),this.forceUpdate())},O.componentWillUnmount=function(){this.mounted=!1,this.selectionDeferId!==null&&R(this.selectionDeferId),this.stopSaveSelectionLoop()},O.render=function(){var g,l=this.props,x=(l.mask,l.alwaysShowMask,l.maskChar,l.formatChars,l.inputRef,l.beforeMaskedValueChange,l.children),U=i(l,["mask","alwaysShowMask","maskChar","formatChars","inputRef","beforeMaskedValueChange","children"]);if(x){A(x)||c(!1);var te=["onChange","onPaste","onMouseDown","onFocus","onBlur","value","disabled","readOnly"],L=r({},U);te.forEach(function(z){return delete L[z]}),g=x(L),te.filter(function(z){return g.props[z]!=null&&g.props[z]!==U[z]}).length&&c(!1)}else g=t.createElement("input",r({ref:this.handleRef},U));var Y={onFocus:this.onFocus,onBlur:this.onBlur};return this.maskOptions.mask&&(U.disabled||U.readOnly||(Y.onChange=this.onChange,Y.onPaste=this.onPaste,Y.onMouseDown=this.onMouseDown),U.value!=null&&(Y.value=this.value)),g=t.cloneElement(g,Y)},b})(t.Component);return mt=be,mt}var jr;function wo(){return jr||(jr=1,Mr.exports=vo()),Mr.exports}var So=wo();const Do=Fn(So);var Oo=["startEnhancer","endEnhancer","error","positive","onChange","onFocus","onBlur","value","disabled","readOnly"],ko=["Input"],Co=["mask","maskChar","overrides"];function xr(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 yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xr(Object(n),!0).forEach(function(o){Mo(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xr(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 rt(e){"@babel/helpers - typeof";return rt=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},rt(e)}function Ke(){return Ke=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},Ke.apply(this,arguments)}function jt(e,t){if(e==null)return{};var n=Po(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 Po(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 dn=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=jt(e,Oo);return h.createElement(Do,Ke({onChange:n,onFocus:o,onBlur:r,value:a,disabled:i,readOnly:s},d),function(c){return h.createElement(Zn,Ke({ref:t,onChange:n,onFocus:o,onBlur:r,value:a,disabled:i,readOnly:s},c))})});dn.displayName="MaskOverride";function pn(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=jt(o,ko),s=jt(e,Co),d=dn,c={},m={};typeof a=="function"?d=a:rt(a)==="object"&&(d=a.component||d,c=a.props||{},m=a.style||{}),rt(c)==="object"&&(c=yt(yt({},c),{},{mask:c.mask||t,maskChar:c.maskChar||n}));var u=yt({Input:{component:d,props:c,style:m}},i);return h.createElement(Gn,Ke({},s,{overrides:u}))}pn.defaultProps={maskChar:" "};var Qt=Object.freeze({horizontal:"horizontal",vertical:"vertical"}),fn=[0,1,2,3,4,5,6],jo=[0,1,2,3,4,5,6,7,8,9,10,11],ae={high:"high",default:"default"},Ce={startDate:"startDate",endDate:"endDate"},xo={locked:"locked"};function Er(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 Te(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Er(Object(n),!0).forEach(function(o){Eo(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Er(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Eo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Kt=G("label",function(e){var t=e.$disabled,n=e.$theme,o=n.colors,r=n.typography;return Te(Te({},r.font250),{},{width:"100%",color:t?o.contentSecondary:o.contentPrimary,display:"block",paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0})});Kt.displayName="Label";Kt.displayName="Label";var Gt=G("span",function(e){var t=e.$theme.sizing;return{display:"flex",width:"100%",marginTop:t.scale300,marginRight:0,marginBottom:t.scale300,marginLeft:0}});Gt.displayName="LabelContainer";Gt.displayName="LabelContainer";var Zt=G("span",function(e){var t=e.$disabled,n=e.$counterError,o=e.$theme,r=o.colors,a=o.typography;return Te(Te({},a.font100),{},{flex:0,width:"100%",color:n?r.negative400:t?r.contentSecondary:r.contentPrimary})});Zt.displayName="LabelEndEnhancer";Zt.displayName="LabelEndEnhancer";var Jt=G("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),Te(Te({},i.font100),{},{color:s,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,marginTop:a.scale300,marginRight:0,marginBottom:a.scale300,marginLeft:0})});Jt.displayName="Caption";Jt.displayName="Caption";var er=G("div",function(e){var t=e.$theme.sizing;return{width:"100%",marginBottom:t.scale600}});er.displayName="ControlContainer";er.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 nt(e){"@babel/helpers - typeof";return nt=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},nt(e)}function Ho(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Io(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&&Io(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lo(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&&xt(e,t)}function xt(e,t){return xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},xt(e,t)}function To(e){var t=$o();return function(){var n=ot(e),o;if(t){var r=ot(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return Ro(this,o)}}function Ro(e,t){if(t&&(nt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bo(e)}function Bo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $o(){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 ot(e){return ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ot(e)}function Fo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wo(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 Et=(function(e){Lo(n,e);var t=To(n);function n(){return Ho(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,m=o.label,u=o.caption,f=o.disabled,w=o.error,y=o.positive,v=o.htmlFor,S=o.children,D=o.counter,k=h.Children.only(S).props,C={$disabled:!!f,$error:!!w,$positive:!!y},M=Fe(a)||Kt,B=Fe(i)||Zt,T=Fe(s)||Gt,$=Fe(d)||Jt,F=Fe(c)||er,E=Wo(u,w,y,C),I=this.props.labelEndEnhancer;if(D){var H=null,j=null,A=null;nt(D)==="object"&&(j=D.length,H=D.maxLength,A=D.error),H=H||k.maxLength,j==null&&typeof k.value=="string"&&(j=k.value.length),j==null&&(j=0),C.$length=j,H==null?I||(I="".concat(j)):(C.$maxLength=j,I||(I="".concat(j,"/").concat(H)),j>H&&A==null&&(A=!0)),A&&(C.$error=!0,C.$counterError=!0)}return h.createElement(h.Fragment,null,m&&h.createElement(T,He({},C,We(s)),h.createElement(M,He({"data-baseweb":"form-control-label",htmlFor:v||k.id},C,We(a)),typeof m=="function"?m(C):m),!!I&&h.createElement(B,He({},C,We(i)),typeof I=="function"?I(C):I)),h.createElement(Vn,null,function(he){return h.createElement(F,He({"data-baseweb":"form-control-container"},C,We(c)),h.Children.map(S,function(W,ge){if(W){var R=W.key||String(ge);return h.cloneElement(W,{key:R,"aria-errormessage":w?he:null,"aria-describedby":u||y?he:null,disabled:k.disabled||f,error:typeof k.error<"u"?k.error:C.$error,positive:typeof k.positive<"u"?k.positive:C.$positive})}}),(!!u||!!w||y)&&h.createElement($,He({"data-baseweb":"form-control-caption",id:he},C,We(d)),E))}))}}]),n})(h.Component);Fo(Et,"defaultProps",{overrides:{},label:null,caption:null,disabled:!1,counter:!1});function Hr(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 Ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hr(Object(n),!0).forEach(function(o){Yo(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Yo(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 jo.map(function(t){return{id:t.toString(),label:e(t)}})},zo=function(e,t){return e.map(function(n){return t.includes(Number(n.id))?n:Ir(Ir({},n),{},{disabled:!0})})},Vo=function(e){var t=e.filterMonthsList,n=e.formatMonthLabel,o=No(n);return t&&(o=zo(o,t)),o};function _o(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,m=c===void 0?!1:c,u=e.$hasRangeSelected,f=u===void 0?!1:u,w=e.$startDate,y=w===void 0?!1:w,v=e.$endDate,S=v===void 0?!1:v,D=e.$pseudoSelected,k=D===void 0?!1:D,C=e.$hasRangeHighlighted,M=C===void 0?!1:C,B=e.$pseudoHighlighted,T=B===void 0?!1:B,$=e.$hasRangeOnRight,F=$===void 0?!1:$,E=e.$startOfMonth,I=E===void 0?!1:E,H=e.$endOfMonth,j=H===void 0?!1:H,A=e.$outsideMonth,he=A===void 0?!1:A;return"".concat(+n).concat(+r).concat(+(i||d)).concat(+m).concat(+f).concat(+y).concat(+S).concat(+k).concat(+M).concat(+T).concat(+(M&&!T&&F)).concat(+(M&&!T&&!F)).concat(+I).concat(+j).concat(+he)}function qo(e,t){return Ko(e)||Qo(e,t)||Xo(e,t)||Uo()}function Uo(){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 Xo(e,t){if(e){if(typeof e=="string")return Ar(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 Ar(e,t)}}function Ar(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 Ko(e){if(Array.isArray(e))return e}function Lr(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 ne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lr(Object(n),!0).forEach(function(o){qe(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lr(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function qe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tr=G("div",function(e){var t=e.$separateRangeInputs;return ne({width:"100%"},t?{display:"flex",justifyContent:"center"}:{})});tr.displayName="StyledInputWrapper";tr.displayName="StyledInputWrapper";var rr=G("div",function(e){var t=e.$theme;return ne(ne({},t.typography.LabelMedium),{},{marginBottom:t.sizing.scale300})});rr.displayName="StyledInputLabel";rr.displayName="StyledInputLabel";var nr=G("div",function(e){var t=e.$theme;return{width:"100%",marginRight:t.sizing.scale300}});nr.displayName="StyledStartDate";nr.displayName="StyledStartDate";var or=G("div",function(e){return e.$theme,{width:"100%"}});or.displayName="StyledEndDate";or.displayName="StyledEndDate";var ar=G("div",function(e){var t=e.$theme,n=t.typography,o=t.colors,r=t.borders;return ne(ne({},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"})});ar.displayName="StyledRoot";ar.displayName="StyledRoot";var ir=G("div",function(e){var t=e.$orientation;return{display:"flex",flexDirection:t===Qt.vertical?"column":"row"}});ir.displayName="StyledMonthContainer";ir.displayName="StyledMonthContainer";var sr=G("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}});sr.displayName="StyledCalendarContainer";sr.displayName="StyledCalendarContainer";var at=G("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}});at.displayName="StyledSelectorContainer";at.displayName="StyledSelectorContainer";var lr=G("div",function(e){var t=e.$theme,n=t.typography,o=t.borders,r=t.colors,a=t.sizing,i=e.$density;return ne(ne({},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})});lr.displayName="StyledCalendarHeader";lr.displayName="StyledCalendarHeader";var ur=G("div",function(e){return{color:e.$theme.colors.calendarHeaderForeground,backgroundColor:e.$theme.colors.calendarHeaderBackground,whiteSpace:"nowrap"}});ur.displayName="StyledMonthHeader";ur.displayName="StyledMonthHeader";var cr=G("button",function(e){var t=e.$theme,n=t.typography,o=t.colors,r=e.$isFocusVisible,a=e.$density;return ne(ne({},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"}})});cr.displayName="StyledMonthYearSelectButton";cr.displayName="StyledMonthYearSelectButton";var dr=G("span",function(e){var t=e.$theme.direction==="rtl"?"marginRight":"marginLeft";return qe({alignItems:"center",display:"flex"},t,e.$theme.sizing.scale500)});dr.displayName="StyledMonthYearSelectIconContainer";dr.displayName="StyledMonthYearSelectIconContainer";function hn(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 pr=G("button",hn);pr.displayName="StyledPrevButton";pr.displayName="StyledPrevButton";var fr=G("button",hn);fr.displayName="StyledNextButton";fr.displayName="StyledNextButton";var hr=G("div",function(e){return{display:"inline-block"}});hr.displayName="StyledMonth";hr.displayName="StyledMonth";var gr=G("div",function(e){var t=e.$theme.sizing;return{whiteSpace:"nowrap",display:"flex",marginBottom:t.scale0}});gr.displayName="StyledWeek";gr.displayName="StyledWeek";function K(e,t){var n,o=e.substr(0,12)+"1"+e.substr(13),r=e.substr(0,13)+"1"+e.substr(14);return n={},qe(n,e,t),qe(n,o,t),qe(n,r,t),n}function bt(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({},K("001000000000000",{color:n.calendarDayForegroundPseudoSelected}),K("000100000000000",{color:n.calendarDayForegroundSelected}),K("001100000000000",{color:n.calendarDayForegroundSelectedHighlighted}),{"010000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},{"011000000000000":{color:n.calendarForegroundDisabled,":after":{content:null}}},K("000000000000001",i),K("101000000000000",s),K("101010000000000",s),K("100100000000000",{color:n.calendarDayForegroundSelected}),K("101100000000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),K("100111100000000",{color:n.calendarDayForegroundSelected,":before":{content:null}}),K("101111100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{content:null}}),K("100111000000000",{color:n.calendarDayForegroundSelected}),K("100110100000000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),K("100100001010000",{color:n.calendarDayForegroundSelected}),K("100100001001000",{color:n.calendarDayForegroundSelected,":before":{left:null,right:"50%"}}),K("101000001010000",{":before":{left:null,right:"50%"}}),{"101000001001000":{}},{"101000001001100":{}},{"101000001001010":{}},K("100010010000000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),{"101000001100000":{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}},K("100000001100000",{color:n.calendarDayForegroundPseudoSelected,":before":{left:"0",width:"100%"},":after":{content:null}}),K("101111000000000",{color:n.calendarDayForegroundSelectedHighlighted}),K("101110100000000",{color:n.calendarDayForegroundSelectedHighlighted,":before":{left:null,right:"50%"}}),K("101010010000000",{color:n.calendarDayForegroundPseudoSelectedHighlighted,":before":{left:"0",width:"100%"}}),K("100000000000001",i),K("100000001010001",i),K("100000001001001",i),K("100010000000001",i));return c[e]||r}var mr=G("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,m=e.$hasDateLabel,u=e.$density,f=e.$hasLockedBehavior,w=e.$selectedInput,y=e.$value,v=e.$theme,S=v.colors,D=v.typography,k=v.sizing,C=_o(e),M;m?u===ae.high?M="60px":M="70px":u===ae.high?M="40px":M="48px";var B=Array.isArray(y)?y:[y,null],T=qo(B,2),$=T[0],F=T[1],E=w===Ce.startDate?F!==null&&typeof F<"u":$!==null&&typeof $<"u",I=i&&!(f&&!E);return ne(ne(ne({},u===ae.high?D.ParagraphSmall:D.ParagraphMedium),{},{boxSizing:"border-box",position:"relative",cursor:t||!r&&d?"default":"pointer",color:S.calendarForeground,display:"inline-block",width:u===ae.high?"42px":"50px",height:M,lineHeight:u===ae.high?k.scale700:k.scale900,textAlign:"center",paddingTop:k.scale300,paddingBottom:k.scale300,paddingLeft:k.scale300,paddingRight:k.scale300,marginTop:0,marginBottom:0,marginLeft:0,marginRight:0,outline:"none",backgroundColor:"transparent",transform:"scale(1)"},bt(C,e.$theme)),{},{":after":ne(ne({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",boxShadow:n&&(!d||r)?"0 0 0 3px ".concat(S.accent):"none",backgroundColor:s?S.calendarDayBackgroundSelectedHighlighted:a&&o?S.calendarDayBackgroundPseudoSelectedHighlighted:S.calendarBackground,height:m?"100%":u===ae.high?"42px":"50px",width:"100%",position:"absolute",top:m?0:"-1px",left:0,paddingTop:k.scale200,paddingBottom:k.scale200,borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",borderTopColor:S.borderSelected,borderBottomColor:S.borderSelected,borderRightColor:S.borderSelected,borderLeftColor:S.borderSelected,borderTopLeftRadius:m?k.scale800:"100%",borderTopRightRadius:m?k.scale800:"100%",borderBottomLeftRadius:m?k.scale800:"100%",borderBottomRightRadius:m?k.scale800:"100%"},bt(C,e.$theme)[":after"]||{}),c?{content:null}:{})},I?{":before":ne(ne({zIndex:-1,content:'""',boxSizing:"border-box",display:"inline-block",backgroundColor:S.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"},bt(C,e.$theme)[":before"]||{}),c?{backgroundColor:S.mono300,left:"0",width:"100%",content:'""'}:{})}:{})});mr.displayName="StyledDay";mr.displayName="StyledDay";var yr=G("div",function(e){var t=e.$theme,n=t.typography,o=t.colors,r=e.$selected;return ne(ne({},n.ParagraphXSmall),{},{color:r?o.contentInverseTertiary:o.contentTertiary})});yr.displayName="StyledDayLabel";yr.displayName="StyledDayLabel";var br=G("div",function(e){var t=e.$theme,n=t.typography,o=t.colors,r=t.sizing,a=e.$density;return ne(ne({},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"})});br.displayName="StyledWeekdayHeader";br.displayName="StyledWeekdayHeader";function Ht(e){"@babel/helpers - typeof";return Ht=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},Ht(e)}function fe(){return fe=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},fe.apply(this,arguments)}function we(e,t){return ea(e)||Jo(e,t)||Zo(e,t)||Go()}function Go(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,m as pe,f as me,bV as fe,x as G,c7 as w,v as b,aB as O,j as l,aI as ge,aJ as he,b0 as be,aK as ye,ap as ve,c as S,F as we,aR as _,l as xe,E as J,_ as q}from"./index-
|
|
1
|
+
import{r as a,m as pe,f as me,bV as fe,x as G,c7 as w,v as b,aB as O,j as l,aI as ge,aJ as he,b0 as be,aK as ye,ap as ve,c as S,F as we,aR as _,l as xe,E as J,_ as q}from"./index-BIyIgwS4.js";import{I as Te}from"./uniqueId-Dmqdy5md-DdrLw8YB.js";import{e as Ie}from"./InputInstructions-CWrzjlV--n3Hf1PP9.js";import{m as Ce}from"./FormClearHelper-DcUb9gFm-uvoV81fq.js";import{_ as ke}from"./sprintf-D5E86llw-6tzWM3a-.js";import{a as Re}from"./input-DMrd22sk-UYShFfZu.js";import"./base-input-GLmTpqXt-CImyaDRq.js";var Q=a.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(J,q({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),a.createElement("path",{d:"M0 3v2h8V3H0z"}))});Q.displayName="Minus";var Y=a.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(J,q({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 8 8"},e,{ref:t}),a.createElement("path",{d:"M3 0v3H0v2h3v3h2V5h3V3H5V0H3z"}))});Y.displayName="Plus";const Ee=S("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}}}),""),Se=S("div",{target:"e116k4er2"})({name:"76z9jo",styles:"display:flex;flex-direction:row;align-self:stretch"}),K=S("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}}),""),Ve=S("div",{target:"e116k4er0"})(({theme:e,clearable:t})=>({position:"absolute",marginRight:e.spacing.twoXS,left:0,right:`calc(${e.sizes.numberInputControlsWidth} * 2 + ${t?"1em":"0em"})`}),""),Ne=xe.getLogger("NumberInput");function ze(e){return b(e)||e===""?void 0:e}const E=({value:e,format:t,step:n,dataType:f})=>{if(b(e))return null;let r=ze(t);if(b(r)&&G(n)){const i=n.toString();f===w.DataType.FLOAT&&n!==0&&i.includes(".")&&(r=`%0.${i.split(".")[1].length}f`)}if(b(r))return e.toString();try{return ke.sprintf(r,e)}catch(i){return Ne.warn(`Error in sprintf(${r}, ${e}): ${i}`),String(e)}},je=(e,t,n)=>b(e)?!1:e-t>=n,De=(e,t,n)=>b(e)?!1:e+t<=n,We=e=>(e.element.dataType===w.DataType.INT?e.widgetMgr.getIntValue(e.element):e.widgetMgr.getDoubleValue(e.element))??e.element.default??null,X=({step:e,dataType:t})=>e||(t===w.DataType.INT?1:.01),Fe=({disabled:e,element:t,widgetMgr:n,fragmentId:f})=>{const r=pe(),{dataType:i,id:V,formId:m,default:W,format:g,icon:N,min:y,max:v}=t,{width:F,elementRef:Z}=me(),[s,ee]=a.useState(()=>X(t)),L=We({element:t,widgetMgr:n}),[h,x]=a.useState(!1),[d,T]=a.useState(L),[B,U]=a.useState(!1),C=a.useRef(null),M=a.useRef(Te("number_input_")),[A,I]=a.useState(()=>E({value:L,dataType:i,format:g,step:s})),k=je(d,s,y),R=De(d,s,v),H=fe({formId:m}),te=H?n.allowFormEnterToSubmit(m):h,re=B&&F>r.breakpoints.hideWidgetDetails;a.useEffect(()=>{ee(X({step:t.step,dataType:t.dataType}))},[t.dataType,t.step]),a.useEffect(()=>{h||I(E({value:d,dataType:i,format:g,step:s}))},[i,g,s]);const c=a.useCallback(({value:o,source:u})=>{if(G(o)&&(y>o||o>v))C.current?.reportValidity();else{const p=o??W??null;switch(i){case w.DataType.INT:n.setIntValue({id:V,formId:m},p,u,f);break;case w.DataType.FLOAT:n.setDoubleValue({id:V,formId:m},p,u,f);break;default:throw new Error("Invalid data type")}x(!1),T(p),I(E({value:p,dataType:i,format:g,step:s}))}},[y,v,C,n,f,s,i,V,m,W,g]),ae=a.useCallback(()=>{h&&c({value:d,source:{fromUi:!0}}),U(!1)},[h,d,c]),oe=a.useCallback(()=>{U(!0)},[]),$=a.useCallback(()=>{const{value:o}=t;t.setValue=!1,T(o??null),I(E({value:o??null,dataType:i,format:g,step:s})),c({value:o??null,source:{fromUi:!1}})},[t,s,c,i,g]);a.useEffect(()=>{t.setValue?$():c({value:d,source:{fromUi:!1}});const o=C.current;if(o){const u=p=>{p.preventDefault()};return o.addEventListener("wheel",u),()=>{o.removeEventListener("wheel",u)}}},[]),t.setValue&&$();const z=b(t.default)&&!e,ne=a.useCallback(()=>{const o=t.default??null;T(o),c({value:o,source:{fromUi:!0}})},[t]);Ce({element:t,widgetMgr:n,onFormCleared:ne});const se=o=>{const{value:u}=o.target;if(u==="")x(!0),T(null),I(null);else{let p;t.dataType===w.DataType.INT?p=parseInt(u,10):p=parseFloat(u),x(!0),T(p),I(u)}},j=a.useCallback(()=>{R&&(x(!0),c({value:(d??y)+s,source:{fromUi:!0}}))},[d,y,s,R]),D=a.useCallback(()=>{k&&(x(!0),c({value:(d??v)-s,source:{fromUi:!0}}))},[d,v,s,k]),le=a.useCallback(o=>{const{key:u}=o;switch(u){case"ArrowUp":o.preventDefault(),j();break;case"ArrowDown":o.preventDefault(),D();break}},[j,D]),ie=a.useCallback(o=>{o.key==="Enter"&&(h&&c({value:d,source:{fromUi:!0}}),n.allowFormEnterToSubmit(m)&&n.submitForm(m,f))},[h,d,c,n,m,f]),P=N?.startsWith(":material"),de=P?"lg":"base",ue=O(r.iconSizes.lg)+2*O(r.spacing.twoXS),ce=N?r.breakpoints.hideNumberInputControls+ue:r.breakpoints.hideNumberInputControls;return l.jsxs("div",{className:"stNumberInput","data-testid":"stNumberInput",ref:Z,children:[l.jsx(ge,{label:t.label,disabled:e,labelVisibility:he(t.labelVisibility?.value),htmlFor:M.current,children:t.help&&l.jsx(be,{children:l.jsx(ye,{content:t.help,placement:ve.TOP_RIGHT})})}),l.jsxs(Ee,{className:B?"focused":"","data-testid":"stNumberInputContainer",children:[l.jsx(Re,{type:"number",inputRef:C,value:A??"",placeholder:t.placeholder,onBlur:ae,onFocus:oe,onChange:se,onKeyPress:ie,onKeyDown:le,clearable:z,clearOnEscape:z,disabled:e,"aria-label":t.label,startEnhancer:t.icon&&l.jsx(we,{"data-testid":"stNumberInputIcon",iconValue:t.icon,size:de}),id:M.current,overrides:{ClearIconContainer:{style:{padding:0}},ClearIcon:{props:{overrides:{Svg:{style:{color:r.colors.grayTextColor,padding:r.spacing.threeXS,height:r.sizes.clearIconSize,width:r.sizes.clearIconSize,":hover":{fill:r.colors.bodyText}}}}}},Input:{props:{"data-testid":"stNumberInputField",step:s,min:y,max:v,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:N?r.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:r.iconSizes.lg,color:P?r.colors.fadedText60:"inherit"}}}}),F>ce&&l.jsxs(Se,{children:[l.jsx(K,{"data-testid":"stNumberInputStepDown",onClick:D,disabled:!k||e,tabIndex:-1,children:l.jsx(_,{content:Q,size:"xs",color:k?"inherit":r.colors.fadedText40})}),l.jsx(K,{"data-testid":"stNumberInputStepUp",onClick:j,disabled:!R||e,tabIndex:-1,children:l.jsx(_,{content:Y,size:"xs",color:R?"inherit":r.colors.fadedText40})})]})]}),re&&l.jsx(Ve,{clearable:z,children:l.jsx(Ie,{dirty:h,value:A??"",inForm:H,allowEnterToSubmit:te})})]})},Pe=a.memo(Fe);export{Pe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as h,m as Zt,x as _,aH as Q,v as ut,aB as Jt,y as Kt,j as v,c as I,aI as Qt,aJ as te,aK as ee,ap as ie,l as re,as as Rt,aL as se,aM as ne,aN as oe,L as ae,aO as le,aP as de,aQ as ce,ai as he,aR as ue,E as Y,_ as Z}from"./index-BxpEVUJq.js";import{y as pe,X as St}from"./Toolbar-Cau3SOTY-cJ6wtM04.js";import{d as me,m as fe}from"./FormClearHelper-B-0AN2KG-drNJ-Zdq.js";import{a as ge}from"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import{o as ve}from"./Hooks-BLb3umpI-CC08A2wx.js";import{i as be,o as ye}from"./FileDownload.esm-zztsCQgv-C5piFaVt.js";var Tt=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),h.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});Tt.displayName="Mic";var It=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});It.displayName="Pause";var At=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});At.displayName="PlayArrow";var Lt=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Lt.displayName="Refresh";var Ot=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Ot.displayName="StopCircle";function T(r,t,e,i){return new(e||(e=Promise))(function(s,n){function d(a){try{c(i.next(a))}catch(o){n(o)}}function l(a){try{c(i.throw(a))}catch(o){n(o)}}function c(a){var o;a.done?s(a.value):(o=a.value,o instanceof e?o:new e(function(m){m(o)})).then(d,l)}c((i=i.apply(r,t||[])).next())})}let J=class{constructor(){this.listeners={}}on(r,t,e){if(this.listeners[r]||(this.listeners[r]=new Set),e?.once){const i=(...s)=>{this.un(r,i),t(...s)};return this.listeners[r].add(i),()=>this.un(r,i)}return this.listeners[r].add(t),()=>this.un(r,t)}un(r,t){var e;(e=this.listeners[r])===null||e===void 0||e.delete(t)}once(r,t){return this.on(r,t,{once:!0})}unAll(){this.listeners={}}emit(r,...t){this.listeners[r]&&this.listeners[r].forEach(e=>e(...t))}};const tt={decode:function(r,t){return T(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});try{return yield e.decodeAudioData(r)}finally{e.close()}})},createBuffer:function(r,t){if(!r||r.length===0)throw new Error("channelData must be a non-empty array");if(t<=0)throw new Error("duration must be greater than 0");if(typeof r[0]=="number"&&(r=[r]),!r[0]||r[0].length===0)throw new Error("channelData must contain non-empty channel arrays");(function(i){const s=i[0];if(s.some(n=>n>1||n<-1)){const n=s.length;let d=0;for(let l=0;l<n;l++){const c=Math.abs(s[l]);c>d&&(d=c)}for(const l of i)for(let c=0;c<n;c++)l[c]/=d}})(r);const e=r.map(i=>i instanceof Float32Array?i:Float32Array.from(i));return{duration:t,length:e[0].length,sampleRate:e[0].length/t,numberOfChannels:e.length,getChannelData:i=>{const s=e[i];if(!s)throw new Error(`Channel ${i} not found`);return s},copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function jt(r,t){const e=t.xmlns?document.createElementNS(t.xmlns,r):document.createElement(r);for(const[i,s]of Object.entries(t))if(i==="children"&&s)for(const[n,d]of Object.entries(s))d instanceof Node?e.appendChild(d):typeof d=="string"?e.appendChild(document.createTextNode(d)):e.appendChild(jt(n,d));else i==="style"?Object.assign(e.style,s):i==="textContent"?e.textContent=s:e.setAttribute(i,s.toString());return e}function Et(r,t,e){const i=jt(r,t||{});return e?.appendChild(i),i}var we=Object.freeze({__proto__:null,createElement:Et,default:Et});const Ce={fetchBlob:function(r,t,e){return T(this,void 0,void 0,function*(){const i=yield fetch(r,e);if(i.status>=400)throw new Error(`Failed to fetch ${r}: ${i.status} (${i.statusText})`);return(function(s,n){T(this,void 0,void 0,function*(){if(!s.body||!s.headers)return;const d=s.body.getReader(),l=Number(s.headers.get("Content-Length"))||0;let c=0;const a=o=>{c+=o?.length||0;const m=Math.round(c/l*100);n(m)};try{for(;;){const o=yield d.read();if(o.done)break;a(o.value)}}catch(o){console.warn("Progress tracking error:",o)}})})(i.clone(),t),i.blob()})}};class xe extends J{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const s=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;if(i&&this.media.removeAttribute("src"),s||t)try{this.media.src=s}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load(),this.media.remove())}setMediaElement(t){this.media=t}play(){return T(this,void 0,void 0,function*(){try{return yield this.media.play()}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;throw t}})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}function ot(r){return r<0?0:r>1?1:r}function Re({maxTop:r,maxBottom:t,halfHeight:e,vScale:i}){const s=Math.round(r*e*i);return{topHeight:s,totalHeight:s+Math.round(t*e*i)||1}}function Se({barAlign:r,halfHeight:t,topHeight:e,totalHeight:i,canvasHeight:s}){return r==="top"?0:r==="bottom"?s-i:t-e}function Pt(r,t,e){const i=t-r.left,s=e-r.top;return[i/r.width,s/r.height]}function Ut(r){return!!(r.barWidth||r.barGap||r.barAlign)}function Wt(r,t){if(!Ut(t))return r;const e=t.barWidth||.5,i=e+(t.barGap||e/2);return i===0?r:Math.floor(r/i)*i}function kt({scrollLeft:r,totalWidth:t,numCanvases:e}){if(t===0)return[0];const i=r/t,s=Math.floor(i*e);return[s-1,s,s+1]}function Dt({scrollLeft:r,clientWidth:t,scrollWidth:e}){return e===0?{startX:0,endX:0}:{startX:r/e,endX:(r+t)/e}}class Ee extends J{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.dragUnsubscribe=null,this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[s,n]=this.initHtml();i.appendChild(s),this.container=s,this.scrollContainer=n.querySelector(".scroll"),this.wrapper=n.querySelector(".wrapper"),this.canvasWrapper=n.querySelector(".canvases"),this.progressWrapper=n.querySelector(".progress"),this.cursor=n.querySelector(".cursor"),e&&n.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){if(this.wrapper.addEventListener("click",t=>{const e=this.wrapper.getBoundingClientRect(),[i,s]=Pt(e,t.clientX,t.clientY);this.emit("click",i,s)}),this.wrapper.addEventListener("dblclick",t=>{const e=this.wrapper.getBoundingClientRect(),[i,s]=Pt(e,t.clientX,t.clientY);this.emit("dblclick",i,s)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:t,scrollWidth:e,clientWidth:i}=this.scrollContainer,{startX:s,endX:n}=Dt({scrollLeft:t,scrollWidth:e,clientWidth:i});this.emit("scroll",s,n,t,t+i)}),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender(),this.emit("resize"))}initDrag(){this.dragUnsubscribe||(this.dragUnsubscribe=(function(t,e,i,s,n=3,d=0,l=100){if(!t)return()=>{};const c=new Map,a=matchMedia("(pointer: coarse)").matches;let o=()=>{};const m=f=>{if(f.button!==d||(c.set(f.pointerId,f),c.size>1))return;let u=f.clientX,p=f.clientY,b=!1;const g=Date.now(),D=y=>{if(y.defaultPrevented||c.size>1||a&&Date.now()-g<l)return;const C=y.clientX,E=y.clientY,A=C-u,j=E-p;if(b||Math.abs(A)>n||Math.abs(j)>n){y.preventDefault(),y.stopPropagation();const F=t.getBoundingClientRect(),{left:L,top:N}=F;b||(i?.(u-L,p-N),b=!0),e(A,j,C-L,E-N),u=C,p=E}},W=y=>{if(c.delete(y.pointerId),b){const C=y.clientX,E=y.clientY,A=t.getBoundingClientRect(),{left:j,top:F}=A;s?.(C-j,E-F)}o()},k=y=>{c.delete(y.pointerId),y.relatedTarget&&y.relatedTarget!==document.documentElement||W(y)},R=y=>{b&&(y.stopPropagation(),y.preventDefault())},S=y=>{y.defaultPrevented||c.size>1||b&&y.preventDefault()};document.addEventListener("pointermove",D),document.addEventListener("pointerup",W),document.addEventListener("pointerout",k),document.addEventListener("pointercancel",k),document.addEventListener("touchmove",S,{passive:!1}),document.addEventListener("click",R,{capture:!0}),o=()=>{document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",W),document.removeEventListener("pointerout",k),document.removeEventListener("pointercancel",k),document.removeEventListener("touchmove",S),setTimeout(()=>{document.removeEventListener("click",R,{capture:!0})},10)}};return t.addEventListener("pointerdown",m),()=>{o(),t.removeEventListener("pointerdown",m),c.clear()}})(this.wrapper,(t,e,i)=>{const s=this.wrapper.getBoundingClientRect().width;this.emit("drag",ot(i/s))},t=>{this.isDragging=!0;const e=this.wrapper.getBoundingClientRect().width;this.emit("dragstart",ot(t/e))},t=>{this.isDragging=!1;const e=this.wrapper.getBoundingClientRect().width;this.emit("dragend",ot(t/e))}),this.subscriptions.push(this.dragUnsubscribe))}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
|
|
1
|
+
import{r as h,m as Zt,x as _,aH as Q,v as ut,aB as Jt,y as Kt,j as v,c as I,aI as Qt,aJ as te,aK as ee,ap as ie,l as re,as as Rt,aL as se,aM as ne,aN as oe,L as ae,aO as le,aP as de,aQ as ce,ai as he,aR as ue,E as Y,_ as Z}from"./index-BIyIgwS4.js";import{y as pe,X as St}from"./Toolbar-Dj6ALImb-BVamUnHI.js";import{d as me,m as fe}from"./FormClearHelper-DcUb9gFm-uvoV81fq.js";import{a as ge}from"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import{o as ve}from"./Hooks-BLb3umpI-BjA4i06_.js";import{i as be,o as ye}from"./FileDownload.esm-CYy3w3Vv-BwlEuFJu.js";var Tt=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),h.createElement("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"}))});Tt.displayName="Mic";var It=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 19c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2v10c0 1.1.9 2 2 2zm6-12v10c0 1.1.9 2 2 2s2-.9 2-2V7c0-1.1-.9-2-2-2s-2 .9-2 2z"}))});It.displayName="Pause";var At=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("rect",{width:24,height:24,fill:"none"}),h.createElement("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18a1 1 0 000-1.69L9.54 5.98A.998.998 0 008 6.82z"}))});At.displayName="PlayArrow";var Lt=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M17.65 6.35a7.95 7.95 0 00-6.48-2.31c-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20a7.98 7.98 0 007.21-4.56c.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53a5.994 5.994 0 01-6.8 3.31c-2.22-.49-4.01-2.3-4.48-4.52A6.002 6.002 0 0112 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71l-.64.65z"}))});Lt.displayName="Refresh";var Ot=h.forwardRef(function(r,t){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Y,Z({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:t}),h.createElement("g",{fill:"none"},h.createElement("rect",{width:24,height:24}),h.createElement("rect",{width:24,height:24})),h.createElement("path",{fillRule:"evenodd",d:"M9 16h6c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm3-14C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}))});Ot.displayName="StopCircle";function T(r,t,e,i){return new(e||(e=Promise))(function(s,n){function d(a){try{c(i.next(a))}catch(o){n(o)}}function l(a){try{c(i.throw(a))}catch(o){n(o)}}function c(a){var o;a.done?s(a.value):(o=a.value,o instanceof e?o:new e(function(m){m(o)})).then(d,l)}c((i=i.apply(r,t||[])).next())})}let J=class{constructor(){this.listeners={}}on(r,t,e){if(this.listeners[r]||(this.listeners[r]=new Set),e?.once){const i=(...s)=>{this.un(r,i),t(...s)};return this.listeners[r].add(i),()=>this.un(r,i)}return this.listeners[r].add(t),()=>this.un(r,t)}un(r,t){var e;(e=this.listeners[r])===null||e===void 0||e.delete(t)}once(r,t){return this.on(r,t,{once:!0})}unAll(){this.listeners={}}emit(r,...t){this.listeners[r]&&this.listeners[r].forEach(e=>e(...t))}};const tt={decode:function(r,t){return T(this,void 0,void 0,function*(){const e=new AudioContext({sampleRate:t});try{return yield e.decodeAudioData(r)}finally{e.close()}})},createBuffer:function(r,t){if(!r||r.length===0)throw new Error("channelData must be a non-empty array");if(t<=0)throw new Error("duration must be greater than 0");if(typeof r[0]=="number"&&(r=[r]),!r[0]||r[0].length===0)throw new Error("channelData must contain non-empty channel arrays");(function(i){const s=i[0];if(s.some(n=>n>1||n<-1)){const n=s.length;let d=0;for(let l=0;l<n;l++){const c=Math.abs(s[l]);c>d&&(d=c)}for(const l of i)for(let c=0;c<n;c++)l[c]/=d}})(r);const e=r.map(i=>i instanceof Float32Array?i:Float32Array.from(i));return{duration:t,length:e[0].length,sampleRate:e[0].length/t,numberOfChannels:e.length,getChannelData:i=>{const s=e[i];if(!s)throw new Error(`Channel ${i} not found`);return s},copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function jt(r,t){const e=t.xmlns?document.createElementNS(t.xmlns,r):document.createElement(r);for(const[i,s]of Object.entries(t))if(i==="children"&&s)for(const[n,d]of Object.entries(s))d instanceof Node?e.appendChild(d):typeof d=="string"?e.appendChild(document.createTextNode(d)):e.appendChild(jt(n,d));else i==="style"?Object.assign(e.style,s):i==="textContent"?e.textContent=s:e.setAttribute(i,s.toString());return e}function Et(r,t,e){const i=jt(r,t||{});return e?.appendChild(i),i}var we=Object.freeze({__proto__:null,createElement:Et,default:Et});const Ce={fetchBlob:function(r,t,e){return T(this,void 0,void 0,function*(){const i=yield fetch(r,e);if(i.status>=400)throw new Error(`Failed to fetch ${r}: ${i.status} (${i.statusText})`);return(function(s,n){T(this,void 0,void 0,function*(){if(!s.body||!s.headers)return;const d=s.body.getReader(),l=Number(s.headers.get("Content-Length"))||0;let c=0;const a=o=>{c+=o?.length||0;const m=Math.round(c/l*100);n(m)};try{for(;;){const o=yield d.read();if(o.done)break;a(o.value)}}catch(o){console.warn("Progress tracking error:",o)}})})(i.clone(),t),i.blob()})}};class xe extends J{constructor(t){super(),this.isExternalMedia=!1,t.media?(this.media=t.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),t.mediaControls&&(this.media.controls=!0),t.autoplay&&(this.media.autoplay=!0),t.playbackRate!=null&&this.onMediaEvent("canplay",()=>{t.playbackRate!=null&&(this.media.playbackRate=t.playbackRate)},{once:!0})}onMediaEvent(t,e,i){return this.media.addEventListener(t,e,i),()=>this.media.removeEventListener(t,e,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const t=this.getSrc();t.startsWith("blob:")&&URL.revokeObjectURL(t)}canPlayType(t){return this.media.canPlayType(t)!==""}setSrc(t,e){const i=this.getSrc();if(t&&i===t)return;this.revokeSrc();const s=e instanceof Blob&&(this.canPlayType(e.type)||!t)?URL.createObjectURL(e):t;if(i&&this.media.removeAttribute("src"),s||t)try{this.media.src=s}catch{this.media.src=t}}destroy(){this.isExternalMedia||(this.media.pause(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load(),this.media.remove())}setMediaElement(t){this.media=t}play(){return T(this,void 0,void 0,function*(){try{return yield this.media.play()}catch(t){if(t instanceof DOMException&&t.name==="AbortError")return;throw t}})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(t){this.media.currentTime=Math.max(0,Math.min(t,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(t){this.media.volume=t}getMuted(){return this.media.muted}setMuted(t){this.media.muted=t}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(t,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=t}getMediaElement(){return this.media}setSinkId(t){return this.media.setSinkId(t)}}function ot(r){return r<0?0:r>1?1:r}function Re({maxTop:r,maxBottom:t,halfHeight:e,vScale:i}){const s=Math.round(r*e*i);return{topHeight:s,totalHeight:s+Math.round(t*e*i)||1}}function Se({barAlign:r,halfHeight:t,topHeight:e,totalHeight:i,canvasHeight:s}){return r==="top"?0:r==="bottom"?s-i:t-e}function Pt(r,t,e){const i=t-r.left,s=e-r.top;return[i/r.width,s/r.height]}function Ut(r){return!!(r.barWidth||r.barGap||r.barAlign)}function Wt(r,t){if(!Ut(t))return r;const e=t.barWidth||.5,i=e+(t.barGap||e/2);return i===0?r:Math.floor(r/i)*i}function kt({scrollLeft:r,totalWidth:t,numCanvases:e}){if(t===0)return[0];const i=r/t,s=Math.floor(i*e);return[s-1,s,s+1]}function Dt({scrollLeft:r,clientWidth:t,scrollWidth:e}){return e===0?{startX:0,endX:0}:{startX:r/e,endX:(r+t)/e}}class Ee extends J{constructor(t,e){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.dragUnsubscribe=null,this.subscriptions=[],this.options=t;const i=this.parentFromOptionsContainer(t.container);this.parent=i;const[s,n]=this.initHtml();i.appendChild(s),this.container=s,this.scrollContainer=n.querySelector(".scroll"),this.wrapper=n.querySelector(".wrapper"),this.canvasWrapper=n.querySelector(".canvases"),this.progressWrapper=n.querySelector(".progress"),this.cursor=n.querySelector(".cursor"),e&&n.appendChild(e),this.initEvents()}parentFromOptionsContainer(t){let e;if(typeof t=="string"?e=document.querySelector(t):t instanceof HTMLElement&&(e=t),!e)throw new Error("Container not found");return e}initEvents(){if(this.wrapper.addEventListener("click",t=>{const e=this.wrapper.getBoundingClientRect(),[i,s]=Pt(e,t.clientX,t.clientY);this.emit("click",i,s)}),this.wrapper.addEventListener("dblclick",t=>{const e=this.wrapper.getBoundingClientRect(),[i,s]=Pt(e,t.clientX,t.clientY);this.emit("dblclick",i,s)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:t,scrollWidth:e,clientWidth:i}=this.scrollContainer,{startX:s,endX:n}=Dt({scrollLeft:t,scrollWidth:e,clientWidth:i});this.emit("scroll",s,n,t,t+i)}),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const t=this.parent.clientWidth;t===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=t,this.reRender(),this.emit("resize"))}initDrag(){this.dragUnsubscribe||(this.dragUnsubscribe=(function(t,e,i,s,n=3,d=0,l=100){if(!t)return()=>{};const c=new Map,a=matchMedia("(pointer: coarse)").matches;let o=()=>{};const m=f=>{if(f.button!==d||(c.set(f.pointerId,f),c.size>1))return;let u=f.clientX,p=f.clientY,b=!1;const g=Date.now(),D=y=>{if(y.defaultPrevented||c.size>1||a&&Date.now()-g<l)return;const C=y.clientX,E=y.clientY,A=C-u,j=E-p;if(b||Math.abs(A)>n||Math.abs(j)>n){y.preventDefault(),y.stopPropagation();const F=t.getBoundingClientRect(),{left:L,top:N}=F;b||(i?.(u-L,p-N),b=!0),e(A,j,C-L,E-N),u=C,p=E}},W=y=>{if(c.delete(y.pointerId),b){const C=y.clientX,E=y.clientY,A=t.getBoundingClientRect(),{left:j,top:F}=A;s?.(C-j,E-F)}o()},k=y=>{c.delete(y.pointerId),y.relatedTarget&&y.relatedTarget!==document.documentElement||W(y)},R=y=>{b&&(y.stopPropagation(),y.preventDefault())},S=y=>{y.defaultPrevented||c.size>1||b&&y.preventDefault()};document.addEventListener("pointermove",D),document.addEventListener("pointerup",W),document.addEventListener("pointerout",k),document.addEventListener("pointercancel",k),document.addEventListener("touchmove",S,{passive:!1}),document.addEventListener("click",R,{capture:!0}),o=()=>{document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",W),document.removeEventListener("pointerout",k),document.removeEventListener("pointercancel",k),document.removeEventListener("touchmove",S),setTimeout(()=>{document.removeEventListener("click",R,{capture:!0})},10)}};return t.addEventListener("pointerdown",m),()=>{o(),t.removeEventListener("pointerdown",m),c.clear()}})(this.wrapper,(t,e,i)=>{const s=this.wrapper.getBoundingClientRect().width;this.emit("drag",ot(i/s))},t=>{this.isDragging=!0;const e=this.wrapper.getBoundingClientRect().width;this.emit("dragstart",ot(t/e))},t=>{this.isDragging=!1;const e=this.wrapper.getBoundingClientRect().width;this.emit("dragend",ot(t/e))}),this.subscriptions.push(this.dragUnsubscribe))}initHtml(){const t=document.createElement("div"),e=t.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return e.innerHTML=`
|
|
2
2
|
<style${i?` nonce="${i}"`:""}>
|
|
3
3
|
:host {
|
|
4
4
|
user-select: none;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,e as X,f as q,s as P,h as G,j as O,G as K,S as Q,i as Y,m as Z,n as ee,o as te,t as ne,l as J,E as B,_ as W,p as j,q as re,v as M,w as se,x as A,y as F,D as ae,z as ie,A as I,B as L,C as oe}from"./index-
|
|
1
|
+
import{r as a,e as X,f as q,s as P,h as G,j as O,G as K,S as Q,i as Y,m as Z,n as ee,o as te,t as ne,l as J,E as B,_ as W,p as j,q as re,v as M,w as se,x as A,y as F,D as ae,z as ie,A as I,B as L,C as oe}from"./index-BIyIgwS4.js";import{v as ce,d as le}from"./withFullScreenWrapper-CsmVH3u1-BwamaUTy.js";import{X as k,R as H,y as ue}from"./Toolbar-Dj6ALImb-BVamUnHI.js";import{T as fe}from"./index-CRwtTJoc-DxkxT91b.js";import{m as de}from"./FormClearHelper-DcUb9gFm-uvoV81fq.js";import"./sprintf-D5E86llw-6tzWM3a-.js";import"./checkbox-CEGFZTJa-C72AFGdh.js";import"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";import"./slicedToArray-CQ1aOJ-Q-fFO-C-TS.js";import"./inherits-BwU0tCO4-DkeIG_qH.js";import"./createSuper-DBoQFSgk-BYJ7jbld.js";import"./FileDownload.esm-CYy3w3Vv-BwlEuFJu.js";var _=a.forwardRef(function(n,t){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(B,W({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"}))});_.displayName="InsertChart";var U=a.forwardRef(function(n,t){var s={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(B,W({iconAttrs:s,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},n,{ref:t}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M20 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h15zm-5 14h-5v-9h5v9zM5 10h3v9H5v-9zm12 9v-9h3v9h-3z"}))});U.displayName="TableChart";const me=20;function he(n){"params"in n&&"encoding"in n&&n.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&M(t.select.encodings)&&(t.select.encodings=Object.keys(n.encoding)))})}const ge=(n,t,s,r,u,c,l,g)=>{const e=JSON.parse(n);if(r==="streamlit"?e.config=j(e.config,c):e.usermeta?.embedOptions?.theme==="streamlit"?(e.config=j(e.config,c),e.usermeta.embedOptions.theme=void 0):e.config=re(e.config,c),e.title&&(typeof e.title=="string"&&(e.title={text:e.title}),e.title.limit=e.title.limit??Math.max(l-40,0)),s&&(e.height=g),t&&(e.width=l,"vconcat"in e&&e.vconcat.forEach(d=>{d.width=l})),e.padding||(e.padding={}),M(e.padding.bottom)&&(e.padding.bottom=me),e.datasets)throw new Error("Datasets should not be passed as part of the spec");return u.length>0&&he(e),e},pe=(n,t,s,r,u)=>{const c=Z(),{id:l,formId:g,spec:e,data:d,datasets:i,vegaLiteTheme:f,selectionMode:o}=n,p=a.useMemo(()=>o,[JSON.stringify(o)]),v=a.useMemo(()=>ge(e,r,u,f,p,c,t,s),[e,r,u,f,p,c,t,s]);return{id:l,formId:g,vegaLiteTheme:f,spec:v,selectionMode:p,data:d,datasets:i,useContainerWidth:r}},we={DATAFRAME_INDEX:"(index)"};function ye(n){return!n||n.dimensions.numDataRows===0?null:z(n)}function ve(n){const t=D(n);if(M(t))return null;const s={};for(const[r,u]of Object.entries(t))s[r]=z(u);return s}function D(n){if(n?.length===0)return null;const t={};return n.forEach(s=>{if(!s)return;const r=s.hasName?s.name:null;t[r]=s.data}),t}function z(n,t=0){if(n.dimensions.numDataRows===0)return[];const s=[],{numDataRows:r,numDataColumns:u,numIndexColumns:c}=n.dimensions,l=n.columnTypes[0]??void 0,g=l&&l.type===ae.INDEX&&(ie(l)||I(l)||L(l));for(let e=t;e<r;e++){const d={};if(g){const{content:i}=n.getCell(e,0);d[we.DATAFRAME_INDEX]=typeof i=="bigint"?Number(i):i}for(let i=0;i<u;i++){const f=i+c,{content:o,contentType:p}=n.getCell(e,f);if((o instanceof Date||typeof o=="number"&&Number.isFinite(o))&&(I(p)||L(p))&&!oe(p)){const v=new Date(o).getTimezoneOffset()*60*1e3;d[n.columnNames[0][f]]=o.valueOf()+v}else d[n.columnNames[0][f]]=typeof o=="bigint"?Number(o):o}s.push(d)}return s}const be=150,Ce=J.getLogger("useVegaLiteSelections"),Ee=(n,t,s)=>{const{id:r,formId:u,selectionMode:c}=n,l=a.useCallback(e=>{c.forEach(i=>{e.addSignalListener(i,se(be,(f,o)=>{const p=e.getState({data:(w,y)=>c.some(E=>`${E}_store`===w),recurse:!1});A(p)&&t.setElementState(r,"viewState",p);let v=o;"vlPoint"in o&&"or"in o.vlPoint&&(v=o.vlPoint.or);const T={id:r,formId:u},h=JSON.parse(t.getStringValue(T)||"{}"),m={selection:{...h?.selection||{},[f]:v||{}}};F(h,m)||t.setStringValue(T,JSON.stringify(m),{fromUi:!0},s)}))});const d=t.getElementState(r,"viewState");if(A(d))try{return e.setState(d)}catch(i){Ce.warn("Failed to restore view state",i)}return e},[r,c,t,u,s]),g=a.useCallback(()=>{const e={selection:{}};c.forEach(o=>{e.selection[o]={}});const d={id:r,formId:u},i=t.getStringValue(d),f=i?JSON.parse(i):e;F(f,e)||t.setStringValue(d,JSON.stringify(e),{fromUi:!0},s)},[r,u,s,c,t]);return{maybeConfigureSelections:l,onFormCleared:g}},$="source",Se=J.getLogger("useVegaEmbed");function Ve(n,t,s){const r=a.useRef(null),u=a.useRef(null),c=a.useRef($),l=a.useRef(null),g=a.useRef([]),{maybeConfigureSelections:e,onFormCleared:d}=Ee(n,t,s);de({widgetMgr:t,element:n,onFormCleared:d});const{data:i,datasets:f}=n;a.useEffect(()=>{r.current===null&&(l.current=i,g.current=f)},[i,f]);const o=a.useCallback(()=>{u.current&&u.current(),u.current=null,r.current=null},[]),p=a.useCallback(async(h,m)=>{if(h.current===null)throw new Error("Element missing.");o();const w={ast:!0,expr:te,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:y,view:E,finalize:x}=await ee(h.current,m,w);r.current=e(E),u.current=x;const b=ve(g.current),S=b?Object.keys(b):[];if(S.length===1){const[C]=S;c.current=C}else S.length===0&&y.data&&(c.current=$);const V=ye(l.current);if(V&&r.current.insert(c.current,V),b)for(const[C,N]of Object.entries(b))r.current.insert(C,N);return await r.current.runAsync(),await r.current.resize().runAsync(),r.current},[o,e]),v=a.useCallback((h,m,w,y)=>{if(!y||y.dimensions.numDataRows===0){try{h.remove(m,ne)}finally{}return}if(!w||w.dimensions.numDataRows===0){h.insert(m,z(y));return}y.hash!==w.hash&&(h.data(m,z(y)),Se.info(`Had to clear the ${m} dataset before inserting data through Vega view.`))},[]),T=a.useCallback(async(h,m)=>{if(r.current===null)return null;const w=l.current,y=g.current;(w||h)&&v(r.current,c.current,w,h);const E=D(y)??{},x=D(m)??{};for(const[b,S]of Object.entries(x)){const V=b||c.current,C=E[V];v(r.current,V,C,S)}for(const b of Object.keys(E))!Object.hasOwn(x,b)&&b!==c.current&&v(r.current,b,null,null);return await r.current?.resize().runAsync(),l.current=h,g.current=m,r.current},[v]);return{createView:p,updateView:T,finalizeView:o}}function xe(n){try{const t=typeof n=="string"?JSON.parse(n):n;return!!(t.facet||t.encoding?.row||t.encoding?.column||t.encoding?.facet)}catch{return!1}}const Ne=({disableFullscreenMode:n,element:t,fragmentId:s,widgetMgr:r,widthConfig:u,heightConfig:c})=>{const[l,g]=a.useState(!1),[e,d]=a.useState(!1),{expanded:i,height:f,width:o,expand:p,collapse:v}=X(le),{width:T,height:h,elementRef:m}=q([l],0),w=P(u)||t.useContainerWidth,y=G(c),E=xe(t.spec),x=pe(t,E?o??0:T,(i?f:h)??0,i?!0:w,i?!0:y),{createView:b,updateView:S,finalizeView:V}=Ve(x,r,s),{data:C,datasets:N,spec:R}=x;return a.useLayoutEffect(()=>(m.current!==null&&b(m,R),V),[b,V,R,o,f,l,m]),a.useEffect(()=>{S(C,N)},[C,N,S]),a.useEffect(()=>{C||N?.[0]?.data?d(!0):d(!1)},[C,N]),l?O.jsx(fe,{data:C??N[0]?.data,height:f??h??void 0,customToolbarActions:[O.jsx(k,{label:"Show chart",icon:_,onClick:()=>{g(!1)}},"show-chart")]}):O.jsxs(H,{height:y?i?f:"100%":f,useContainerWidth:i?!0:w,children:[O.jsx(ue,{target:H,isFullScreen:i,onExpand:p,onCollapse:v,disableFullscreenMode:n,children:e&&O.jsx(k,{label:"Show data",icon:U,onClick:()=>{g(!0)}})}),O.jsx(K,{styles:Q}),O.jsx(Y,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:w,useContainerHeight:y,ref:m})]})},Oe=ce(Ne),$e=a.memo(Oe);export{Q as StyledVegaLiteChartTooltips,j as applyStreamlitTheme,$e as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as u,j as m,aJ as ge,m as ye,aI as ve,aV as we,aK as Oe,ap as Re,H as re,aB as oe,bA as ne,aX as R,b9 as ke,aY as w}from"./index-
|
|
1
|
+
import{r as u,j as m,aJ as ge,m as ye,aI as ve,aV as we,aK as Oe,ap as Re,H as re,aB as oe,bA as ne,aX as R,b9 as ke,aY as w}from"./index-BIyIgwS4.js";import{S as je}from"./useBasicWidgetState-DH5OpqC3-H5wMmJFo.js";import"./FormClearHelper-DcUb9gFm-uvoV81fq.js";var ie={vertical:"vertical",horizontal:"horizontal"};function ae(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),o.push.apply(o,r)}return o}function A(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?ae(Object(o),!0).forEach(function(r){O(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ae(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function O(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var x=0,E=1,I=2;function B(e){return e.$isActive?I:e.$isHovered?E:x}function Se(e){var t=e.$theme.colors,o=e.$disabled,r=e.$checked,n=e.$isFocusVisible,i=e.$error;if(o)return t.tickFillDisabled;if(r)if(i)switch(B(e)){case x:return t.tickFillErrorSelected;case E:return t.tickFillErrorSelectedHover;case I:return t.tickFillErrorSelectedHoverActive}else switch(B(e)){case x:return t.tickFillSelected;case E:return t.tickFillSelectedHover;case I:return t.tickFillSelectedHoverActive}else return n?t.borderSelected:i?t.tickBorderError:t.tickBorder;return null}function Me(e){var t=e.$theme.colors;if(e.$disabled)return t.tickMarkFillDisabled;if(e.$checked)return t.tickMarkFill;if(e.$error)switch(B(e)){case x:return t.tickFillError;case E:return t.tickFillErrorHover;case I:return t.tickFillErrorHoverActive}else switch(B(e)){case x:return t.tickFill;case E:return t.tickFillHover;case I:return t.tickFillActive}}function $e(e){var t=e.$labelPlacement,o=t===void 0?"":t,r=e.$theme,n;switch(o){case"top":n="Bottom";break;case"bottom":n="Top";break;case"left":n=r.direction==="rtl"?"Left":"Right";break;default:case"right":n=r.direction==="rtl"?"Right":"Left";break}var i=r.sizing,a=i.scale300;return O({},"padding".concat(n),a)}function Fe(e){var t=e.$disabled,o=e.$theme,r=o.colors;return t?r.contentSecondary:r.contentPrimary}var W=R("div",function(e){var t=e.$disabled,o=e.$align;return{display:"flex",flexWrap:"wrap",flexDirection:o==="horizontal"?"row":"column",alignItems:o==="horizontal"?"center":"flex-start",cursor:t?"not-allowed":"pointer","-webkit-tap-highlight-color":"transparent"}});W.displayName="RadioGroupRoot";W.displayName="RadioGroupRoot";var X=R("label",function(e){var t,o=e.$disabled,r=e.$hasDescription,n=e.$labelPlacement,i=e.$theme,a=e.$align,s=i.sizing,c=a==="horizontal",d=i.direction==="rtl"?"Left":"Right";return t={flexDirection:n==="top"||n==="bottom"?"column":"row",display:"flex",alignItems:"center",cursor:o?"not-allowed":"pointer",marginTop:s.scale200},O(t,"margin".concat(d),c?s.scale200:null),O(t,"marginBottom",r&&!c?null:s.scale200),t});X.displayName="Root";X.displayName="Root";var J=R("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{backgroundColor:Me(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",height:e.$checked?r.scale200:r.scale550,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve,width:e.$checked?r.scale200:r.scale550}});J.displayName="RadioMarkInner";J.displayName="RadioMarkInner";var K=R("div",function(e){var t=e.$theme,o=t.animation,r=t.sizing;return{alignItems:"center",backgroundColor:Se(e),borderTopLeftRadius:"50%",borderTopRightRadius:"50%",borderBottomRightRadius:"50%",borderBottomLeftRadius:"50%",boxShadow:e.$isFocusVisible&&e.$checked?"0 0 0 3px ".concat(e.$theme.colors.accent):"none",display:"flex",height:r.scale700,justifyContent:"center",marginTop:r.scale0,marginRight:r.scale0,marginBottom:r.scale0,marginLeft:r.scale0,outline:"none",verticalAlign:"middle",width:r.scale700,flexShrink:0,transitionDuration:o.timing200,transitionTimingFunction:o.easeOutCurve}});K.displayName="RadioMarkOuter";K.displayName="RadioMarkOuter";var Y=R("div",function(e){var t=e.$theme.typography;return A(A({verticalAlign:"middle"},$e(e)),{},{color:Fe(e)},t.LabelMedium)});Y.displayName="Label";Y.displayName="Label";var Q=R("input",{width:0,height:0,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,clip:"rect(0 0 0 0)",position:"absolute"});Q.displayName="Input";Q.displayName="Input";var Z=R("div",function(e){var t,o=e.$theme,r=e.$align,n=r==="horizontal",i=o.direction==="rtl"?"Right":"Left",a=o.direction==="rtl"?"Left":"Right";return A(A({},o.typography.ParagraphSmall),{},(t={color:o.colors.contentSecondary,cursor:"auto"},O(t,"margin".concat(i),r==="horizontal"?null:o.sizing.scale900),O(t,"margin".concat(a),n?o.sizing.scale200:null),O(t,"maxWidth","240px"),t))});Z.displayName="Description";Z.displayName="Description";function N(e){"@babel/helpers - typeof";return N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(e)}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},_.apply(this,arguments)}function Pe(e,t){return Le(e)||Ie(e,t)||Ee(e,t)||xe()}function xe(){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 Ee(e,t){if(e){if(typeof e=="string")return se(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(e);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return se(e,t)}}function se(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function Ie(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,i=!1,a,s;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,s=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function Le(e){if(Array.isArray(e))return e}function Te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ce(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ae(e,t,o){return t&&Ce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Be(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U(e,t)}function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},U(e,t)}function De(e){var t=ze();return function(){var o=D(e),r;if(t){var n=D(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Ve(this,r)}}function Ve(e,t){if(t&&(N(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}function T(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ze(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},D(e)}function C(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var ue=(function(e){Be(o,e);var t=De(o);function o(){var r;Te(this,o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),C(T(r),"state",{isFocusVisible:!1,focusedRadioIndex:-1}),C(T(r),"handleFocus",function(s,c){ke(s)&&r.setState({isFocusVisible:!0}),r.setState({focusedRadioIndex:c}),r.props.onFocus&&r.props.onFocus(s)}),C(T(r),"handleBlur",function(s,c){r.state.isFocusVisible!==!1&&r.setState({isFocusVisible:!1}),r.setState({focusedRadioIndex:-1}),r.props.onBlur&&r.props.onBlur(s)}),r}return Ae(o,[{key:"render",value:function(){var r=this,n=this.props.overrides,i=n===void 0?{}:n,a=w(i.RadioGroupRoot,W),s=Pe(a,2),c=s[0],d=s[1];return u.createElement(c,_({id:this.props.id,role:"radiogroup","aria-describedby":this.props["aria-describedby"],"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props.error||null,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],$align:this.props.align,$disabled:this.props.disabled,$error:this.props.error,$required:this.props.required},d),u.Children.map(this.props.children,function(p,b){if(!u.isValidElement(p))return null;var l=r.props.value===p.props.value;return u.cloneElement(p,{align:r.props.align,autoFocus:r.props.autoFocus,checked:l,disabled:r.props.disabled||p.props.disabled,error:r.props.error,isFocused:r.state.focusedRadioIndex===b,isFocusVisible:r.state.isFocusVisible,tabIndex:b===0&&!r.props.value||l?"0":"-1",labelPlacement:r.props.labelPlacement,name:r.props.name,onBlur:function(f){return r.handleBlur(f,b)},onFocus:function(f){return r.handleFocus(f,b)},onChange:r.props.onChange,onMouseEnter:r.props.onMouseEnter,onMouseLeave:r.props.onMouseLeave})}))}}]),o})(u.Component);C(ue,"defaultProps",{name:"",value:"",disabled:!1,autoFocus:!1,labelPlacement:"right",align:"vertical",error:!1,required:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onFocus:function(){},onBlur:function(){},overrides:{}});function q(e){"@babel/helpers - typeof";return q=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},q(e)}function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},v.apply(this,arguments)}function S(e,t){return Ue(e)||_e(e,t)||Ne(e,t)||He()}function He(){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 Ne(e,t){if(e){if(typeof e=="string")return le(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(e);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return le(e,t)}}function le(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,r=new Array(t);o<t;o++)r[o]=e[o];return r}function _e(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r=[],n=!0,i=!1,a,s;try{for(o=o.call(e);!(n=(a=o.next()).done)&&(r.push(a.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,s=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function Ue(e){if(Array.isArray(e))return e}function qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ge(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function We(e,t,o){return t&&Ge(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xe(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&&G(e,t)}function G(e,t){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},G(e,t)}function Je(e){var t=Ye();return function(){var o=V(e),r;if(t){var n=V(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return Ke(this,r)}}function Ke(e,t){if(t&&(q(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M(e)}function M(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ye(){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 V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},V(e)}function $(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function Qe(e){return e==="top"||e==="left"}function Ze(e){return e==="bottom"||e==="right"}var et=function(e){return e.stopPropagation()},ce=(function(e){Xe(o,e);var t=Je(o);function o(){var r;qe(this,o);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),$(M(r),"state",{isActive:!1,isHovered:!1}),$(M(r),"onMouseEnter",function(s){r.setState({isHovered:!0}),r.props.onMouseEnter&&r.props.onMouseEnter(s)}),$(M(r),"onMouseLeave",function(s){r.setState({isHovered:!1}),r.props.onMouseLeave&&r.props.onMouseLeave(s)}),$(M(r),"onMouseDown",function(s){r.setState({isActive:!0}),r.props.onMouseDown&&r.props.onMouseDown(s)}),$(M(r),"onMouseUp",function(s){r.setState({isActive:!1}),r.props.onMouseUp&&r.props.onMouseUp(s)}),r}return We(o,[{key:"componentDidMount",value:function(){var r;this.props.autoFocus&&(r=this.props.inputRef)!==null&&r!==void 0&&r.current&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var r=this.props.overrides,n=r===void 0?{}:r,i=w(n.Root,X),a=S(i,2),s=a[0],c=a[1],d=w(n.Label,Y),p=S(d,2),b=p[0],l=p[1],f=w(n.Input,Q),F=S(f,2),z=F[0],k=F[1],H=w(n.Description,Z),P=S(H,2),L=P[0],g=P[1],y=w(n.RadioMarkInner,J),h=S(y,2),pe=h[0],fe=h[1],de=w(n.RadioMarkOuter,K),ee=S(de,2),be=ee[0],he=ee[1],j={$align:this.props.align,$checked:this.props.checked,$disabled:this.props.disabled,$hasDescription:!!this.props.description,$isActive:this.state.isActive,$error:this.props.error,$isFocused:this.props.isFocused,$isFocusVisible:this.props.isFocused&&this.props.isFocusVisible,$isHovered:this.state.isHovered,$labelPlacement:this.props.labelPlacement,$required:this.props.required,$value:this.props.value},te=u.createElement(b,v({},j,l),this.props.containsInteractiveElement?u.createElement("div",{onClick:function(me){return me.preventDefault()}},this.props.children):this.props.children);return u.createElement(u.Fragment,null,u.createElement(s,v({"data-baseweb":"radio",onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp},j,c),Qe(this.props.labelPlacement)&&te,u.createElement(be,v({},j,he),u.createElement(pe,v({},j,fe))),u.createElement(z,v({"aria-invalid":this.props.error||null,checked:this.props.checked,disabled:this.props.disabled,name:this.props.name,onBlur:this.props.onBlur,onFocus:this.props.onFocus,onClick:et,onChange:this.props.onChange,ref:this.props.inputRef,required:this.props.required,tabIndex:this.props.tabIndex,type:"radio",value:this.props.value},j,k)),Ze(this.props.labelPlacement)&&te),!!this.props.description&&u.createElement(L,v({},j,g),this.props.description))}}]),o})(u.Component);$(ce,"defaultProps",{overrides:{},containsInteractiveElement:!1,checked:!1,disabled:!1,autoFocus:!1,inputRef:u.createRef(),align:"vertical",error:!1,onChange:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseDown:function(){},onMouseUp:function(){},onFocus:function(){},onBlur:function(){}});function tt(e){const t=parseFloat(e.sizes.checkbox),o=parseFloat(e.spacing.threeXS),r=oe(t.toString()),n=Math.round(r*.375);let i=Math.round(oe((t-o).toString()));return i>=r&&(i-=1),[ne(n,"px"),ne(i,"px")]}function rt({disabled:e,horizontal:t,value:o,onChange:r,options:n,captions:i,label:a,labelVisibility:s,help:c}){const[d,p]=u.useState(o??null);u.useEffect(()=>{o!==d&&p(o??null)},[o]);const b=u.useCallback(g=>{const y=parseInt(g.target.value,10);p(y),r(y)},[r]),l=ye(),f=i.length>0,F=n.length>0,z=F?n:["No options to select."],k=e||!F,H=g=>g==""&&t&&f?" ":g,[P,L]=tt(l);return m.jsxs("div",{className:"stRadio","data-testid":"stRadio",children:[m.jsx(ve,{label:a,disabled:k,labelVisibility:s,children:c&&m.jsx(we,{children:m.jsx(Oe,{content:c,placement:Re.TOP_RIGHT})})}),m.jsx(ue,{onChange:b,value:d!==null?d.toString():void 0,disabled:k,align:t?ie.horizontal:ie.vertical,"aria-label":a,"data-testid":"stRadioGroup",overrides:{RadioGroupRoot:{style:{gap:f?l.spacing.sm:l.spacing.none,minHeight:l.sizes.minElementHeight}}},children:z.map((g,y)=>m.jsxs(ce,{value:y.toString(),overrides:{Root:{style:({$isFocusVisible:h})=>({marginBottom:l.spacing.none,marginTop:l.spacing.none,marginRight:f?l.spacing.sm:l.spacing.lg,paddingLeft:l.spacing.none,alignItems:"start",paddingRight:l.spacing.threeXS,backgroundColor:h?l.colors.darkenedBgMix25:""})},RadioMarkOuter:{style:({$checked:h})=>({width:l.sizes.checkbox,height:l.sizes.checkbox,marginTop:"0.35rem",marginRight:l.spacing.none,marginLeft:l.spacing.none,backgroundColor:h&&!k?l.colors.primary:l.colors.fadedText40})},RadioMarkInner:{style:({$checked:h})=>({height:h?P:L,width:h?P:L})},Label:{style:{color:k?l.colors.fadedText40:l.colors.bodyText,position:"relative",top:l.spacing.px}}},children:[m.jsx(re,{source:g,allowHTML:!1,isLabel:!0,largerLabel:!0}),f&&m.jsx(re,{source:H(i[y]),allowHTML:!1,isCaption:!0,isLabel:!0})]},y))})]})}const ot=u.memo(rt);function nt({disabled:e,element:t,widgetMgr:o,fragmentId:r}){const[n,i]=je({getStateFromWidgetMgr:it,getDefaultStateFromProto:at,getCurrStateFromProto:st,updateWidgetMgrState:lt,element:t,widgetMgr:o,fragmentId:r}),a=u.useCallback(f=>{i({value:f,fromUi:!0})},[i]),{horizontal:s,options:c,captions:d,label:p,labelVisibility:b,help:l}=t;return m.jsx(ot,{label:p,onChange:a,options:c,captions:d,disabled:e,horizontal:s,labelVisibility:ge(b?.value),value:n??null,help:l})}function it(e,t){return e.getIntValue(t)}function at(e){return e.default??null}function st(e){return e.value??null}function lt(e,t,o,r){t.setIntValue(e,o.value??null,{fromUi:o.fromUi},r)}const ft=u.memo(nt);export{ft as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,L as A,ai as h,j as u,ak as C,aQ as E,al as R,am as T,a_ as B}from"./index-
|
|
1
|
+
import{r as c,L as A,ai as h,j as u,ak as C,aQ as E,al as R,am as T,a_ as B}from"./index-BIyIgwS4.js";import{a as v}from"./createDownloadLinkElement-CbRjLJ8e-NbV49OP9.js";const L=/%([0-9A-Fa-f]{2})/g,$=/[^\x20-\x7e\xa0-\xff]/g,k=/\\([\u0000-\u007f])/g,w=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,z=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,I=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/,U=r=>String(r).replace($,"?");class j{constructor(e,t){this.type=e,this.parameters=t}}const D=(r,e)=>String.fromCharCode(Number.parseInt(e,16));function Z(r){const e=z.exec(r);if(!e)throw new TypeError("invalid extended field value");const t=e[1].toLowerCase(),a=e[2];let n;switch(t){case"iso-8859-1":n=U(a.replace(L,D));break;case"utf-8":try{n=decodeURIComponent(a)}catch{throw new TypeError("invalid encoded utf-8")}break;default:throw new TypeError("unsupported charset in extended field")}return n}function S(r){let e=I.exec(r);if(!e)throw new TypeError("invalid type format");let t=e[0].length;const a=e[1].toLowerCase();let n;const l=[],i={};let o;for(t=w.lastIndex=e[0].slice(-1)===";"?t-1:t;e=w.exec(r);){if(e.index!==t)throw new TypeError("invalid parameter format");if(t+=e[0].length,n=e[1].toLowerCase(),o=e[2],l.indexOf(n)!==-1)throw new TypeError("invalid duplicate parameter");if(l.push(n),n.indexOf("*")+1===n.length){n=n.slice(0,-1),o=Z(o),i[n]=o;continue}typeof i[n]!="string"&&(o[0]==='"'&&(o=o.slice(1,o.length-1).replace(k,"$1")),i[n]=o)}if(t!==-1&&t!==r.length)throw new TypeError("invalid parameter format");return new j(a,i)}function _(r){const e=S(r);if(e.type!=="attachment")return;const t=e.parameters.filename;if(typeof t=="string")return t}function N(r,e){return r.sendHttpRequest({method:"GET",path:`${e}?title=${encodeURIComponent(document.title)}`,headers:{},body:""}).then(({statusCode:t,headers:a,body:n})=>{if(t!==200)return;const l=a.get("Content-Disposition"),i=(l&&_(l))??"",o=a.get("Content-Type"),f=new Blob([n],o?{type:o}:void 0),d=URL.createObjectURL(f),s=document.createElement("a");s.setAttribute("href",d),s.setAttribute("target","_blank"),s.setAttribute("download",i),s.click(),URL.revokeObjectURL(d),s.remove()})}function O(){const r=B();return c.useCallback(e=>N(r,e),[r])}function M(r){const{disabled:e,element:t,widgetMgr:a,endpoints:n,fragmentId:l}=r,{help:i,label:o,icon:f,ignoreRerun:d,type:s,url:m}=t,{libConfig:{enforceDownloadInNewTab:b=!1}}=c.useContext(A);let p=h.SECONDARY;s==="primary"?p=h.PRIMARY:s==="tertiary"&&(p=h.TERTIARY);const x=c.useMemo(()=>n.buildDownloadUrl(m),[n,m]);c.useEffect(()=>{n.checkSourceUrlResponse(x,"Download Button")},[x,n]);const g=O(),y=()=>{if(d||a.setTriggerValue(t,{fromUi:!0},l),t.url.startsWith("/media")){g(t.url);return}v({filename:"",url:x,enforceDownloadInNewTab:b}).click()};return u.jsx("div",{className:"stDownloadButton","data-testid":"stDownloadButton",children:u.jsx(C,{help:i,containerWidth:!0,children:u.jsx(E,{kind:p,size:R.SMALL,disabled:e,onClick:y,containerWidth:!0,children:u.jsx(T,{icon:f,label:o})})})})}const Y=c.memo(M);export{Y as default};
|