@stlite/desktop 0.83.0 → 0.83.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/bin/dump_artifacts.js +31 -31
- package/build/assets/{ErrorOutline.esm-w3SotGgg.js → ErrorOutline.esm-Cdc3NAX8.js} +1 -1
- package/build/assets/{FileDownload.esm-DNaG7mhy.js → FileDownload.esm-CbXaPbiH.js} +1 -1
- package/build/assets/{FileHelper-DoUfoupm.js → FileHelper-WDsMYNBw.js} +1 -1
- package/build/assets/{FormClearHelper-DI9KwuTl.js → FormClearHelper-CT0Jwp4X.js} +1 -1
- package/build/assets/{Hooks-BRr-mPDr.js → Hooks-BKPTn6xf.js} +1 -1
- package/build/assets/{InputInstructions-mpv25B9R.js → InputInstructions-Cyg7opie.js} +1 -1
- package/build/assets/{ProgressBar-DalMRT-4.js → ProgressBar-CA-bplbU.js} +1 -1
- package/build/assets/{RenderInPortalIfExists-CfX3LXlx.js → RenderInPortalIfExists-BozYGWdi.js} +1 -1
- package/build/assets/{Toolbar-1r13KE9d.js → Toolbar-DlGOP7h4.js} +1 -1
- package/build/assets/{base-input-BJ4WO1K3.js → base-input-BnIlcFzX.js} +1 -1
- package/build/assets/{checkbox-COr-UunX.js → checkbox-CGvNPQQ1.js} +1 -1
- package/build/assets/{createSuper-BD8Om4of.js → createSuper-B8yCxQGq.js} +1 -1
- package/build/assets/{data-grid-overlay-editor-DUKLRWRf.js → data-grid-overlay-editor-CltKX1-_.js} +1 -1
- package/build/assets/{downloader-K2yu2VBv.js → downloader-Cof1FiXt.js} +1 -1
- package/build/assets/{es6-CqFPgbyx.js → es6-Ca0BcWDW.js} +2 -2
- package/build/assets/{iframeResizer.contentWindow-CYxwXEKD.js → iframeResizer.contentWindow-3AhBUVoO.js} +1 -1
- package/build/assets/{index-DIR2fiU3.js → index--NPqZQqZ.js} +1 -1
- package/build/assets/{index-Bga7N97D.js → index-2MeZae5n.js} +1 -1
- package/build/assets/{index-Dkkplt7E.js → index-BBjBAKoV.js} +1 -1
- package/build/assets/{index-CgIf_789.js → index-BMvzOjlv.js} +1 -1
- package/build/assets/{index-CBHSzhtV.js → index-BUOOlidY.js} +1 -1
- package/build/assets/{index-CgaLKbNA.js → index-BafYTuwa.js} +1 -1
- package/build/assets/{index-CbGVTpRX.js → index-Bc7AX3-A.js} +1 -1
- package/build/assets/{index-h6PFbOmO.js → index-Bcsdrj2S.js} +5 -5
- package/build/assets/{index-DAyJZph2.js → index-C8-4FAc1.js} +1 -1
- package/build/assets/{index-CG0w2Shn.js → index-CLBVu_mK.js} +1 -1
- package/build/assets/{index-BTWAYrEA.js → index-CN5CjLsc.js} +1 -1
- package/build/assets/{index-GeTKqk0L.js → index-COAtiAK0.js} +1 -1
- package/build/assets/{index-oIFkiM-w.js → index-CS3tnJiL.js} +1 -1
- package/build/assets/{index-DAFr20lD.js → index-CVrdwKzt.js} +1 -1
- package/build/assets/{index-BY2_5dEP.js → index-CWEVeVJ6.js} +1 -1
- package/build/assets/{index-CJj5-jL6.js → index-C_kIyk9w.js} +1 -1
- package/build/assets/{index-CVPZJuoC.js → index-Cbvbjd8C.js} +4 -4
- package/build/assets/{index-DJ9ENWJ6.js → index-ChbiMLbp.js} +1 -1
- package/build/assets/{index-QxKGd3KZ.js → index-DCoy2PDE.js} +1 -1
- package/build/assets/{index-Cy3sYumn.js → index-DIBxvKdk.js} +1 -1
- package/build/assets/{index-BVYhtbL7.js → index-DSVyX96W.js} +1 -1
- package/build/assets/{index-CTKSPDuj.js → index-DfeaHlsl.js} +1 -1
- package/build/assets/{index-D4DI0i3_.js → index-Do3iUH-x.js} +1 -1
- package/build/assets/{index-DhpOSNWU.js → index-Dw5G4t9P.js} +1 -1
- package/build/assets/{index-B7nFcP4b.js → index-Dx-GFi6o.js} +1 -1
- package/build/assets/{index-TIqCq-vm.js → index-J-18FLnE.js} +1 -1
- package/build/assets/{index-BBSx627c.js → index-PRsYLT-9.js} +1 -1
- package/build/assets/{index-Chg_Z_Ai.js → index-TkDz3vqu.js} +1 -1
- package/build/assets/{index-DHvjd_NM.js → index-XyUVDWZe.js} +1 -1
- package/build/assets/{index-WJi2gbUd.js → index-Zd66ep5J.js} +1 -1
- package/build/assets/{index-D_aTbShm.js → index-ax2rbmoZ.js} +1 -1
- package/build/assets/{index-qPiigGKE.js → index-bQj3l0zc.js} +1 -1
- package/build/assets/{index-DZGNB9Z2.js → index-bfhlF0Xi.js} +1 -1
- package/build/assets/{index-dOLNZa0u.js → index-dalh9Y65.js} +1 -1
- package/build/assets/{index-FQnDjdgN.js → index-ocHxXLCt.js} +1 -1
- package/build/assets/{index-bXFpQSEH.js → index-uxEQ8qdA.js} +1 -1
- package/build/assets/{index-DbWqdg_N.js → index-wCYAC2ZH.js} +1 -1
- package/build/assets/{inherits-DtR6i4OG.js → inherits-BaopKHev.js} +1 -1
- package/build/assets/{input-9qldoJOB.js → input-BH9uqfZf.js} +1 -1
- package/build/assets/{memory-Cy3-iIgx.js → memory-DWTwf9Ch.js} +1 -1
- package/build/assets/{mergeWith-DdD-5zWL.js → mergeWith-Bt-C9xRx.js} +1 -1
- package/build/assets/{number-overlay-editor-DmP64vrs.js → number-overlay-editor-Dm8-09pg.js} +1 -1
- package/build/assets/{sandbox-DzhFXmWd.js → sandbox-DGYybjEz.js} +1 -1
- package/build/assets/{slicedToArray-CNrowD0v.js → slicedToArray-CEuyIGI5.js} +1 -1
- package/build/assets/{textarea-Bql4j-_M.js → textarea-BKB-3cBX.js} +1 -1
- package/build/assets/{timepicker-sEhIITXf.js → timepicker-B1BEcpbo.js} +1 -1
- package/build/assets/{uniqueId-DfRnwW3q.js → uniqueId-BSuwhGjw.js} +1 -1
- package/build/assets/{useBasicWidgetState-DJ8kXLgn.js → useBasicWidgetState-D3a9XYx3.js} +1 -1
- package/build/assets/{useOnInputChange-CZX_IkMh.js → useOnInputChange-BlFu2GNS.js} +1 -1
- package/build/assets/{withFullScreenWrapper-DBlEST2L.js → withFullScreenWrapper-D8NJOCKn.js} +1 -1
- package/build/assets/worker-Cy9Gj5BL.js +113 -0
- package/build/electron/worker.js +10 -112
- package/build/index.html +1 -1
- package/package.json +4 -4
- package/wheels/streamlit-1.45.1-cp312-none-any.whl +0 -0
- package/build/assets/worker-CXcujS1W.js +0 -215
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as Ae,c1 as G,r as C,cw as pt,cj as gt,c2 as Q,cx as mt,cy as vt,c as le,I as bt,cb as yt,A as wt,bf as xt,j as Z,R as _e,cW as kt,bZ as Tt,b_ as Ot,cc as Mt,b$ as Rt,bI as St,Q as Dt,cX as Me}from"./index-CVPZJuoC.js";import{s as ze}from"./sprintf-D7DtBTRn.js";import{a as Et}from"./useBasicWidgetState-DJ8kXLgn.js";import"./FormClearHelper-DI9KwuTl.js";var de={},H={},he={},Fe={},Ve;function Re(){return Ve||(Ve=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Direction=void 0,function(n){n.Right="to right",n.Left="to left",n.Down="to bottom",n.Up="to top"}(e.Direction||(e.Direction={}))}(Fe)),Fe}var Ne;function Ue(){return Ne||(Ne=1,function(e){var n=he&&he.__spreadArray||function(o,i,u){if(u||arguments.length===2)for(var f=0,S=i.length,v;f<S;f++)(v||!(f in i))&&(v||(v=Array.prototype.slice.call(i,0,f)),v[f]=i[f]);return o.concat(v||Array.prototype.slice.call(i))};Object.defineProperty(e,"__esModule",{value:!0}),e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var a=Ae(),s=Re(),g=function(o){var i=o.toString().split(".")[1];return i?i.length:0};e.getStepDecimals=g;function k(o){return o.touches&&o.touches.length||o.changedTouches&&o.changedTouches.length}e.isTouchEvent=k;function l(o,i,u){var f=(i-o)/u,S=8,v=Number(f.toFixed(S));return parseInt(v.toString(),10)===v}e.isStepDivisible=l;function h(o,i,u,f,S,v,w){var b=1e11;if(o=Math.round(o*b)/b,!v){var P=w[i-1],j=w[i+1];if(P&&P>o)return P;if(j&&j<o)return j}if(o>f)return f;if(o<u)return u;var L=Math.floor(o*b-u*b)%Math.floor(S*b),N=Math.floor(o*b-Math.abs(L)),X=L===0?o:N/b,A=Math.abs(L/b)<S/2?X:X+S,U=(0,e.getStepDecimals)(S);return parseFloat(A.toFixed(U))}e.normalizeValue=h;function _(o,i,u){return(o-i)/(u-i)}e.relativeValue=_;function V(o){return o===s.Direction.Up||o===s.Direction.Down}e.isVertical=V;function z(o,i,u){if(i>=u)throw new RangeError("min (".concat(i,") is equal/bigger than max (").concat(u,")"));if(o<i)throw new RangeError("value (".concat(o,") is smaller than min (").concat(i,")"));if(o>u)throw new RangeError("value (".concat(o,") is bigger than max (").concat(u,")"))}e.checkBoundaries=z;function O(o,i,u){return o<i?i:o>u?u:o}e.checkValuesAgainstBoundaries=O;function x(o){if(!(o.length<2)&&!o.slice(1).every(function(i,u){return o[u]<=i}))throw new RangeError("values={[".concat(o,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=x;function d(o){var i=window.getComputedStyle(o);return{top:parseInt(i["margin-top"],10),bottom:parseInt(i["margin-bottom"],10),left:parseInt(i["margin-left"],10),right:parseInt(i["margin-right"],10)}}e.getMargin=d;function t(o){var i=window.getComputedStyle(o);return{top:parseInt(i["padding-top"],10)+parseInt(i["border-top-width"],10),bottom:parseInt(i["padding-bottom"],10)+parseInt(i["border-bottom-width"],10),left:parseInt(i["padding-left"],10)+parseInt(i["border-left-width"],10),right:parseInt(i["padding-right"],10)+parseInt(i["border-right-width"],10)}}e.getPaddingAndBorder=t;function r(o,i,u){var f=u?-1:1;o.forEach(function(S,v){return p(S,f*i[v].x,i[v].y)})}e.translateThumbs=r;function c(o,i,u,f){for(var S=0,v=B(o[0],i,u,f),w=1;w<o.length;w++){var b=B(o[w],i,u,f);b<v&&(v=b,S=w)}return S}e.getClosestThumbIndex=c;function p(o,i,u){o.style.transform="translate(".concat(i,"px, ").concat(u,"px)")}e.translate=p;var y=function(o){var i=[],u=null,f=function(){for(var S=[],v=0;v<arguments.length;v++)S[v]=arguments[v];i=S,!u&&(u=requestAnimationFrame(function(){u=null,o.apply(void 0,i)}))};return f};e.schd=y;function T(o,i,u){var f=o.slice(0);return f[i]=u,f}e.replaceAt=T;function E(o){var i=o.values,u=o.colors,f=o.min,S=o.max,v=o.direction,w=v===void 0?s.Direction.Right:v,b=o.rtl,P=b===void 0?!1:b;P&&w===s.Direction.Right?w=s.Direction.Left:P&&s.Direction.Left&&(w=s.Direction.Right);var j=i.slice(0).sort(function(N,X){return N-X}).map(function(N){return(N-f)/(S-f)*100}),L=j.reduce(function(N,X,A){return"".concat(N,", ").concat(u[A]," ").concat(X,"%, ").concat(u[A+1]," ").concat(X,"%")},"");return"linear-gradient(".concat(w,", ").concat(u[0]," 0%").concat(L,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=E;function D(){}e.voidFn=D;function R(o){throw new Error("Didn't expect to get here")}e.assertUnreachable=R;var M=function(o,i,u,f,S){S===void 0&&(S=function(w){return w});var v=Math.ceil(n([o],Array.from(o.children),!0).reduce(function(w,b){var P=Math.ceil(b.getBoundingClientRect().width);if(b.innerText&&b.innerText.includes(u)&&b.childElementCount===0){var j=b.cloneNode(!0);j.innerHTML=S(i.toFixed(f)),j.style.visibility="hidden",document.body.appendChild(j),P=Math.ceil(j.getBoundingClientRect().width),document.body.removeChild(j)}return P>w?P:w},o.getBoundingClientRect().width));return v},I=function(o,i,u,f,S,v,w){w===void 0&&(w=function(j){return j});var b=[],P=function(j){var L=M(u[j],f[j],S,v,w),N=i[j].x;i.forEach(function(X,A){var U=X.x,F=M(u[A],f[A],S,v,w);j!==A&&(N>=U&&N<=U+F||N+L>=U&&N+L<=U+F)&&(b.includes(A)||(b.push(j),b.push(A),b=n(n([],b,!0),[j,A],!1),P(A)))})};return P(o),Array.from(new Set(b.sort()))},m=function(o,i,u,f,S,v){f===void 0&&(f=.1),S===void 0&&(S=" - "),v===void 0&&(v=function(A){return A});var w=(0,e.getStepDecimals)(f),b=(0,a.useState)({}),P=b[0],j=b[1],L=(0,a.useState)(v(i[u].toFixed(w))),N=L[0],X=L[1];return(0,a.useEffect)(function(){if(o){var A=o.getThumbs();if(A.length<1)return;var U={},F=o.getOffsets(),te=I(u,F,A,i,S,w,v),oe=v(i[u].toFixed(w));if(te.length){var ne=te.reduce(function(J,ue,se,ce){return J.length?n(n([],J,!0),[F[ce[se]].x],!1):[F[ce[se]].x]},[]);if(Math.min.apply(Math,ne)===F[u].x){var re=[];te.forEach(function(J){re.push(i[J].toFixed(w))}),oe=Array.from(new Set(re.sort(function(J,ue){return parseFloat(J)-parseFloat(ue)}))).map(v).join(S);var Te=Math.min.apply(Math,ne),ie=Math.max.apply(Math,ne),Oe=A[te[ne.indexOf(ie)]].getBoundingClientRect().width;U.left="".concat(Math.abs(Te-(ie+Oe))/2,"px"),U.transform="translate(-50%, 0)"}else U.visibility="hidden"}X(oe),j(U)}},[o,i]),[N,P]};e.useThumbOverlap=m;function B(o,i,u,f){var S=o.getBoundingClientRect(),v=S.left,w=S.top,b=S.width,P=S.height;return V(f)?Math.abs(u-(w+P/2)):Math.abs(i-(v+b/2))}}(he)),he}var He;function Ct(){if(He)return H;He=1;var e=H&&H.__extends||function(){var O=function(x,d){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(t[c]=r[c])},O(x,d)};return function(x,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");O(x,d);function t(){this.constructor=x}x.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}}(),n=H&&H.__createBinding||(Object.create?function(O,x,d,t){t===void 0&&(t=d);var r=Object.getOwnPropertyDescriptor(x,d);(!r||("get"in r?!x.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return x[d]}}),Object.defineProperty(O,t,r)}:function(O,x,d,t){t===void 0&&(t=d),O[t]=x[d]}),a=H&&H.__setModuleDefault||(Object.create?function(O,x){Object.defineProperty(O,"default",{enumerable:!0,value:x})}:function(O,x){O.default=x}),s=H&&H.__importStar||function(O){if(O&&O.__esModule)return O;var x={};if(O!=null)for(var d in O)d!=="default"&&Object.prototype.hasOwnProperty.call(O,d)&&n(x,O,d);return a(x,O),x},g=H&&H.__spreadArray||function(O,x,d){if(d||arguments.length===2)for(var t=0,r=x.length,c;t<r;t++)(c||!(t in x))&&(c||(c=Array.prototype.slice.call(x,0,t)),c[t]=x[t]);return O.concat(c||Array.prototype.slice.call(x))};Object.defineProperty(H,"__esModule",{value:!0});var k=s(Ae()),l=Ue(),h=Re(),_=["ArrowRight","ArrowUp","k","PageUp"],V=["ArrowLeft","ArrowDown","j","PageDown"],z=function(O){e(x,O);function x(d){var t=O.call(this,d)||this;if(t.trackRef=k.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(r,c){return c}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var r=t.props,c=r.direction,p=r.values,y=r.min,T=r.max,E=t.trackRef.current,D=E.getBoundingClientRect(),R=(0,l.getPaddingAndBorder)(E);return t.getThumbs().map(function(M,I){var m={x:0,y:0},B=M.getBoundingClientRect(),o=(0,l.getMargin)(M);switch(c){case h.Direction.Right:return m.x=(o.left+R.left)*-1,m.y=((B.height-D.height)/2+R.top)*-1,m.x+=D.width*(0,l.relativeValue)(p[I],y,T)-B.width/2,m;case h.Direction.Left:return m.x=(o.right+R.right)*-1,m.y=((B.height-D.height)/2+R.top)*-1,m.x+=D.width-D.width*(0,l.relativeValue)(p[I],y,T)-B.width/2,m;case h.Direction.Up:return m.x=((B.width-D.width)/2+o.left+R.left)*-1,m.y=-R.left,m.y+=D.height-D.height*(0,l.relativeValue)(p[I],y,T)-B.height/2,m;case h.Direction.Down:return m.x=((B.width-D.width)/2+o.left+R.left)*-1,m.y=-R.left,m.y+=D.height*(0,l.relativeValue)(p[I],y,T)-B.height/2,m;default:return(0,l.assertUnreachable)(c)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(r){return r.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(r){return t.getThumbs().findIndex(function(c){return c===r.target||c.contains(r.target)})},t.addTouchEvents=function(r){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(r){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(r){var c;if(r.button===0)if(r.persist(),r.preventDefault(),t.addMouseEvents(r.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var T;return(T=y.current)===null||T===void 0?void 0:T.contains(r.target)}))return;t.setState({draggedTrackPos:[r.clientX,r.clientY]},function(){return t.onMove(r.clientX,r.clientY)})}else{var p=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),r.clientX,r.clientY,t.props.direction);(c=t.thumbRefs[p].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:p},function(){return t.onMove(r.clientX,r.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(r){var c;if(r.persist(),t.addTouchEvents(r.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var T;return(T=y.current)===null||T===void 0?void 0:T.contains(r.target)}))return;t.setState({draggedTrackPos:[r.touches[0].clientX,r.touches[0].clientY]},function(){return t.onMove(r.touches[0].clientX,r.touches[0].clientY)})}else{var p=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),r.touches[0].clientX,r.touches[0].clientY,t.props.direction);(c=t.thumbRefs[p].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:p},function(){return t.onMove(r.touches[0].clientX,r.touches[0].clientY)})}},t.onMouseOrTouchStart=function(r){if(!t.props.disabled){var c=(0,l.isTouchEvent)(r);if(!(!c&&r.button!==0)){var p=t.getTargetIndex(r);p!==-1&&(c?t.addTouchEvents(r):t.addMouseEvents(r),t.setState({draggedThumbIndex:p,thumbZIndexes:t.state.thumbZIndexes.map(function(y,T){return T===p?Math.max.apply(Math,t.state.thumbZIndexes):y<=t.state.thumbZIndexes[p]?y:y-1})}))}}},t.onMouseMove=function(r){r.preventDefault(),t.onMove(r.clientX,r.clientY)},t.onTouchMove=function(r){r.preventDefault(),t.onMove(r.touches[0].clientX,r.touches[0].clientY)},t.onKeyDown=function(r){var c=t.props,p=c.values,y=c.onChange,T=c.step,E=c.rtl,D=c.direction,R=t.state.isChanged,M=t.getTargetIndex(r.nativeEvent),I=E||D===h.Direction.Left||D===h.Direction.Down?-1:1;M!==-1&&(_.includes(r.key)?(r.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(p,M,t.normalizeValue(p[M]+I*(r.key==="PageUp"?T*10:T),M)))):V.includes(r.key)?(r.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(p,M,t.normalizeValue(p[M]-I*(r.key==="PageDown"?T*10:T),M)))):r.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){R&&t.fireOnFinalChange()}):R&&t.fireOnFinalChange())},t.onKeyUp=function(r){var c=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){c&&t.fireOnFinalChange()})},t.onMove=function(r,c){var p=t.state,y=p.draggedThumbIndex,T=p.draggedTrackPos,E=t.props,D=E.direction,R=E.min,M=E.max,I=E.onChange,m=E.values,B=E.step,o=E.rtl;if(y===-1&&T[0]===-1&&T[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var u=i.getBoundingClientRect(),f=(0,l.isVertical)(D)?u.height:u.width;if(T[0]!==-1&&T[1]!==-1){var S=r-T[0],v=c-T[1],w=0;switch(D){case h.Direction.Right:case h.Direction.Left:w=S/f*(M-R);break;case h.Direction.Down:case h.Direction.Up:w=v/f*(M-R);break;default:(0,l.assertUnreachable)(D)}if(o&&(w*=-1),Math.abs(w)>=B/2){for(var b=0;b<t.thumbRefs.length;b++){if(m[b]===M&&Math.sign(w)===1||m[b]===R&&Math.sign(w)===-1)return;var P=m[b]+w;P>M?w=M-m[b]:P<R&&(w=R-m[b])}for(var j=m.slice(0),b=0;b<t.thumbRefs.length;b++)j=(0,l.replaceAt)(j,b,t.normalizeValue(m[b]+w,b));t.setState({draggedTrackPos:[r,c]}),I(j)}}else{var L=0;switch(D){case h.Direction.Right:L=(r-u.left)/f*(M-R)+R;break;case h.Direction.Left:L=(f-(r-u.left))/f*(M-R)+R;break;case h.Direction.Down:L=(c-u.top)/f*(M-R)+R;break;case h.Direction.Up:L=(f-(c-u.top))/f*(M-R)+R;break;default:(0,l.assertUnreachable)(D)}o&&(L=M+R-L),Math.abs(m[y]-L)>=B/2&&I((0,l.replaceAt)(m,y,t.normalizeValue(L,y)))}},t.normalizeValue=function(r,c){var p=t.props,y=p.min,T=p.max,E=p.step,D=p.allowOverlap,R=p.values;return(0,l.normalizeValue)(r,c,y,T,E,D,R)},t.onEnd=function(r){if(r.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var r=t.props,c=r.onFinalChange,p=r.values;c&&c(p)},t.updateMarkRefs=function(r){if(!r.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(r.max-r.min)/t.props.step,t.markRefs=[];for(var c=0;c<t.numOfMarks+1;c++)t.markRefs[c]=k.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var r=window.getComputedStyle(t.trackRef.current),c=parseInt(r.width,10),p=parseInt(r.height,10),y=parseInt(r.paddingLeft,10),T=parseInt(r.paddingTop,10),E=[],D=0;D<t.numOfMarks+1;D++){var R=9999,M=9999;if(t.markRefs[D].current){var I=t.markRefs[D].current.getBoundingClientRect();R=I.height,M=I.width}t.props.direction===h.Direction.Left||t.props.direction===h.Direction.Right?E.push([Math.round(c/t.numOfMarks*D+y-M/2),-Math.round((R-p)/2)]):E.push([Math.round(p/t.numOfMarks*D+T-R/2),-Math.round((M-c)/2)])}t.setState({markOffsets:E})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return k.createRef()}),t.updateMarkRefs(d),t}return x.prototype.componentDidMount=function(){var d=this,t=this.props,r=t.values,c=t.min,p=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(y){return(0,l.checkBoundaries)(y,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),r.forEach(function(y){(0,l.isStepDivisible)(c,y,p)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},x.prototype.componentDidUpdate=function(d,t){var r=this.props,c=r.max,p=r.min,y=r.step,T=r.values,E=r.rtl;(d.max!==c||d.min!==p||d.step!==y)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),E),(d.max!==c||d.min!==p||d.step!==y||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),T.forEach(function(D){(0,l.isStepDivisible)(p,D,y)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},x.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},x.prototype.render=function(){var d=this,t=this.props,r=t.renderTrack,c=t.renderThumb,p=t.renderMark,y=p===void 0?function(){return null}:p,T=t.values,E=t.min,D=t.max,R=t.allowOverlap,M=t.disabled,I=this.state,m=I.draggedThumbIndex,B=I.thumbZIndexes,o=I.markOffsets;return r({props:{style:{transform:"scale(1)",cursor:m>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":T.length===1&&!M?"pointer":"inherit"},onMouseDown:M?l.voidFn:this.onMouseDownTrack,onTouchStart:M?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:M,children:g(g([],o.map(function(i,u,f){return y({props:{style:d.props.direction===h.Direction.Left||d.props.direction===h.Direction.Right?{position:"absolute",left:"".concat(i[0],"px"),marginTop:"".concat(i[1],"px")}:{position:"absolute",top:"".concat(i[0],"px"),marginLeft:"".concat(i[1],"px")},key:"mark".concat(u),ref:d.markRefs[u]},index:u})}),!0),T.map(function(i,u){var f=d.state.draggedThumbIndex===u;return c({index:u,value:i,isDragged:f,props:{style:{position:"absolute",zIndex:B[u],cursor:M?"inherit":f?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:u,tabIndex:M?void 0:0,"aria-valuemax":R?D:T[u+1]||D,"aria-valuemin":R?E:T[u-1]||E,"aria-valuenow":i,draggable:!1,ref:d.thumbRefs[u],role:"slider",onKeyDown:M?l.voidFn:d.onKeyDown,onKeyUp:M?l.voidFn:d.onKeyUp}})}),!0)})},x.defaultProps={step:1,direction:h.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},x}(k.Component);return H.default=z,H}var Xe;function jt(){return Xe||(Xe=1,function(e){var n=de&&de.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var a=n(Ct());e.Range=a.default;var s=Ue();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return s.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return s.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return s.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return s.checkValuesAgainstBoundaries}});var g=Re();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return g.Direction}})}(de)),de}var We=jt();function qe(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);n&&(s=s.filter(function(g){return Object.getOwnPropertyDescriptor(e,g).enumerable})),a.push.apply(a,s)}return a}function fe(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?qe(Object(a),!0).forEach(function(s){It(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):qe(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}function It(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}var pe=G("div",{position:"relative",width:"100%"});pe.displayName="Root",pe.displayName="Root",pe.displayName="StyledRoot";var ge=G("div",function(e){var n=e.$theme,a=e.$value,s=a===void 0?[]:a,g=e.$disabled,k=e.$isDragged,l=n.sizing,h="inherit";return g?h="not-allowed":k?h="grabbing":s.length===1&&(h="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:h,backgroundColor:n.colors.sliderTrackFill}});ge.displayName="Track",ge.displayName="Track",ge.displayName="StyledTrack";var me=G("div",function(e){var n=e.$theme,a=e.$value,s=a===void 0?[]:a,g=e.$min,k=e.$max,l=e.$disabled,h=n.colors,_=n.borders,V=n.direction,z=n.borders.useRoundedCorners?_.radius100:0;return{borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,background:We.getTrackBackground({values:s,colors:s.length===1?[l?h.borderOpaque:h.primary,l?h.backgroundSecondary:h.borderOpaque]:[l?h.backgroundSecondary:h.borderOpaque,l?h.borderOpaque:h.primary,l?h.backgroundSecondary:h.borderOpaque],min:g||0,max:k||0,rtl:V==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});me.displayName="InnerTrack",me.displayName="InnerTrack",me.displayName="StyledInnerTrack";var ve=G("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});ve.displayName="Mark",ve.displayName="Mark",ve.displayName="StyledMark";var be=G("div",function(e){return fe(fe({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});be.displayName="Tick",be.displayName="Tick",be.displayName="StyledTick";var ye=G("div",function(e){var n=e.$theme,a=n.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:a.scale600,paddingLeft:a.scale600,paddingBottom:a.scale400}});ye.displayName="TickBar",ye.displayName="TickBar",ye.displayName="StyledTickBar";var we=G("div",function(e){var n=e.$theme,a=e.$value,s=a===void 0?[]:a,g=e.$thumbIndex,k=e.$disabled,l=s.length===2&&g===0,h=s.length===2&&g===1;return n.direction==="rtl"&&(h||l)&&(l=!l,h=!h),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:k?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(n.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:k?"not-allowed":"inherit"}});we.displayName="Thumb",we.displayName="Thumb",we.displayName="StyledThumb";var xe=G("div",function(e){var n=e.$disabled,a=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:n?a.colors.sliderHandleFillDisabled:a.colors.sliderHandleInnerFill}});xe.displayName="InnerThumb",xe.displayName="InnerThumb",xe.displayName="StyledInnerThumb";var ke=G("div",function(e){var n=e.$disabled,a=e.$theme;return fe(fe({position:"absolute",top:"-".concat(a.sizing.scale1400)},a.typography.font200),{},{backgroundColor:n?a.colors.sliderHandleFillDisabled:a.colors.sliderHandleInnerFill,color:a.colors.contentInversePrimary,paddingLeft:a.sizing.scale600,paddingRight:a.sizing.scale600,paddingTop:a.sizing.scale500,paddingBottom:a.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});ke.displayName="ThumbValue",ke.displayName="ThumbValue",ke.displayName="StyledThumbValue";function Ke(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);n&&(s=s.filter(function(g){return Object.getOwnPropertyDescriptor(e,g).enumerable})),a.push.apply(a,s)}return a}function Bt(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Ke(Object(a),!0).forEach(function(s){Pt(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ke(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}function Pt(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function q(){return q=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},q.apply(this,arguments)}function K(e,n){return _t(e)||At(e,n)||$t(e,n)||Lt()}function Lt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1
|
+
import{e as Ae,c1 as G,r as C,cw as pt,cj as gt,c2 as Q,cx as mt,cy as vt,c as le,I as bt,cb as yt,A as wt,bf as xt,j as Z,R as _e,cW as kt,bZ as Tt,b_ as Ot,cc as Mt,b$ as Rt,bI as St,Q as Dt,cX as Me}from"./index-Cbvbjd8C.js";import{s as ze}from"./sprintf-D7DtBTRn.js";import{a as Et}from"./useBasicWidgetState-D3a9XYx3.js";import"./FormClearHelper-CT0Jwp4X.js";var de={},H={},he={},Fe={},Ve;function Re(){return Ve||(Ve=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Direction=void 0,function(n){n.Right="to right",n.Left="to left",n.Down="to bottom",n.Up="to top"}(e.Direction||(e.Direction={}))}(Fe)),Fe}var Ne;function Ue(){return Ne||(Ne=1,function(e){var n=he&&he.__spreadArray||function(o,i,u){if(u||arguments.length===2)for(var f=0,S=i.length,v;f<S;f++)(v||!(f in i))&&(v||(v=Array.prototype.slice.call(i,0,f)),v[f]=i[f]);return o.concat(v||Array.prototype.slice.call(i))};Object.defineProperty(e,"__esModule",{value:!0}),e.useThumbOverlap=e.assertUnreachable=e.voidFn=e.getTrackBackground=e.replaceAt=e.schd=e.translate=e.getClosestThumbIndex=e.translateThumbs=e.getPaddingAndBorder=e.getMargin=e.checkInitialOverlap=e.checkValuesAgainstBoundaries=e.checkBoundaries=e.isVertical=e.relativeValue=e.normalizeValue=e.isStepDivisible=e.isTouchEvent=e.getStepDecimals=void 0;var a=Ae(),s=Re(),g=function(o){var i=o.toString().split(".")[1];return i?i.length:0};e.getStepDecimals=g;function k(o){return o.touches&&o.touches.length||o.changedTouches&&o.changedTouches.length}e.isTouchEvent=k;function l(o,i,u){var f=(i-o)/u,S=8,v=Number(f.toFixed(S));return parseInt(v.toString(),10)===v}e.isStepDivisible=l;function h(o,i,u,f,S,v,w){var b=1e11;if(o=Math.round(o*b)/b,!v){var P=w[i-1],j=w[i+1];if(P&&P>o)return P;if(j&&j<o)return j}if(o>f)return f;if(o<u)return u;var L=Math.floor(o*b-u*b)%Math.floor(S*b),N=Math.floor(o*b-Math.abs(L)),X=L===0?o:N/b,A=Math.abs(L/b)<S/2?X:X+S,U=(0,e.getStepDecimals)(S);return parseFloat(A.toFixed(U))}e.normalizeValue=h;function _(o,i,u){return(o-i)/(u-i)}e.relativeValue=_;function V(o){return o===s.Direction.Up||o===s.Direction.Down}e.isVertical=V;function z(o,i,u){if(i>=u)throw new RangeError("min (".concat(i,") is equal/bigger than max (").concat(u,")"));if(o<i)throw new RangeError("value (".concat(o,") is smaller than min (").concat(i,")"));if(o>u)throw new RangeError("value (".concat(o,") is bigger than max (").concat(u,")"))}e.checkBoundaries=z;function O(o,i,u){return o<i?i:o>u?u:o}e.checkValuesAgainstBoundaries=O;function x(o){if(!(o.length<2)&&!o.slice(1).every(function(i,u){return o[u]<=i}))throw new RangeError("values={[".concat(o,"]} needs to be sorted when allowOverlap={false}"))}e.checkInitialOverlap=x;function d(o){var i=window.getComputedStyle(o);return{top:parseInt(i["margin-top"],10),bottom:parseInt(i["margin-bottom"],10),left:parseInt(i["margin-left"],10),right:parseInt(i["margin-right"],10)}}e.getMargin=d;function t(o){var i=window.getComputedStyle(o);return{top:parseInt(i["padding-top"],10)+parseInt(i["border-top-width"],10),bottom:parseInt(i["padding-bottom"],10)+parseInt(i["border-bottom-width"],10),left:parseInt(i["padding-left"],10)+parseInt(i["border-left-width"],10),right:parseInt(i["padding-right"],10)+parseInt(i["border-right-width"],10)}}e.getPaddingAndBorder=t;function r(o,i,u){var f=u?-1:1;o.forEach(function(S,v){return p(S,f*i[v].x,i[v].y)})}e.translateThumbs=r;function c(o,i,u,f){for(var S=0,v=B(o[0],i,u,f),w=1;w<o.length;w++){var b=B(o[w],i,u,f);b<v&&(v=b,S=w)}return S}e.getClosestThumbIndex=c;function p(o,i,u){o.style.transform="translate(".concat(i,"px, ").concat(u,"px)")}e.translate=p;var y=function(o){var i=[],u=null,f=function(){for(var S=[],v=0;v<arguments.length;v++)S[v]=arguments[v];i=S,!u&&(u=requestAnimationFrame(function(){u=null,o.apply(void 0,i)}))};return f};e.schd=y;function T(o,i,u){var f=o.slice(0);return f[i]=u,f}e.replaceAt=T;function E(o){var i=o.values,u=o.colors,f=o.min,S=o.max,v=o.direction,w=v===void 0?s.Direction.Right:v,b=o.rtl,P=b===void 0?!1:b;P&&w===s.Direction.Right?w=s.Direction.Left:P&&s.Direction.Left&&(w=s.Direction.Right);var j=i.slice(0).sort(function(N,X){return N-X}).map(function(N){return(N-f)/(S-f)*100}),L=j.reduce(function(N,X,A){return"".concat(N,", ").concat(u[A]," ").concat(X,"%, ").concat(u[A+1]," ").concat(X,"%")},"");return"linear-gradient(".concat(w,", ").concat(u[0]," 0%").concat(L,", ").concat(u[u.length-1]," 100%)")}e.getTrackBackground=E;function D(){}e.voidFn=D;function R(o){throw new Error("Didn't expect to get here")}e.assertUnreachable=R;var M=function(o,i,u,f,S){S===void 0&&(S=function(w){return w});var v=Math.ceil(n([o],Array.from(o.children),!0).reduce(function(w,b){var P=Math.ceil(b.getBoundingClientRect().width);if(b.innerText&&b.innerText.includes(u)&&b.childElementCount===0){var j=b.cloneNode(!0);j.innerHTML=S(i.toFixed(f)),j.style.visibility="hidden",document.body.appendChild(j),P=Math.ceil(j.getBoundingClientRect().width),document.body.removeChild(j)}return P>w?P:w},o.getBoundingClientRect().width));return v},I=function(o,i,u,f,S,v,w){w===void 0&&(w=function(j){return j});var b=[],P=function(j){var L=M(u[j],f[j],S,v,w),N=i[j].x;i.forEach(function(X,A){var U=X.x,F=M(u[A],f[A],S,v,w);j!==A&&(N>=U&&N<=U+F||N+L>=U&&N+L<=U+F)&&(b.includes(A)||(b.push(j),b.push(A),b=n(n([],b,!0),[j,A],!1),P(A)))})};return P(o),Array.from(new Set(b.sort()))},m=function(o,i,u,f,S,v){f===void 0&&(f=.1),S===void 0&&(S=" - "),v===void 0&&(v=function(A){return A});var w=(0,e.getStepDecimals)(f),b=(0,a.useState)({}),P=b[0],j=b[1],L=(0,a.useState)(v(i[u].toFixed(w))),N=L[0],X=L[1];return(0,a.useEffect)(function(){if(o){var A=o.getThumbs();if(A.length<1)return;var U={},F=o.getOffsets(),te=I(u,F,A,i,S,w,v),oe=v(i[u].toFixed(w));if(te.length){var ne=te.reduce(function(J,ue,se,ce){return J.length?n(n([],J,!0),[F[ce[se]].x],!1):[F[ce[se]].x]},[]);if(Math.min.apply(Math,ne)===F[u].x){var re=[];te.forEach(function(J){re.push(i[J].toFixed(w))}),oe=Array.from(new Set(re.sort(function(J,ue){return parseFloat(J)-parseFloat(ue)}))).map(v).join(S);var Te=Math.min.apply(Math,ne),ie=Math.max.apply(Math,ne),Oe=A[te[ne.indexOf(ie)]].getBoundingClientRect().width;U.left="".concat(Math.abs(Te-(ie+Oe))/2,"px"),U.transform="translate(-50%, 0)"}else U.visibility="hidden"}X(oe),j(U)}},[o,i]),[N,P]};e.useThumbOverlap=m;function B(o,i,u,f){var S=o.getBoundingClientRect(),v=S.left,w=S.top,b=S.width,P=S.height;return V(f)?Math.abs(u-(w+P/2)):Math.abs(i-(v+b/2))}}(he)),he}var He;function Ct(){if(He)return H;He=1;var e=H&&H.__extends||function(){var O=function(x,d){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(t[c]=r[c])},O(x,d)};return function(x,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");O(x,d);function t(){this.constructor=x}x.prototype=d===null?Object.create(d):(t.prototype=d.prototype,new t)}}(),n=H&&H.__createBinding||(Object.create?function(O,x,d,t){t===void 0&&(t=d);var r=Object.getOwnPropertyDescriptor(x,d);(!r||("get"in r?!x.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return x[d]}}),Object.defineProperty(O,t,r)}:function(O,x,d,t){t===void 0&&(t=d),O[t]=x[d]}),a=H&&H.__setModuleDefault||(Object.create?function(O,x){Object.defineProperty(O,"default",{enumerable:!0,value:x})}:function(O,x){O.default=x}),s=H&&H.__importStar||function(O){if(O&&O.__esModule)return O;var x={};if(O!=null)for(var d in O)d!=="default"&&Object.prototype.hasOwnProperty.call(O,d)&&n(x,O,d);return a(x,O),x},g=H&&H.__spreadArray||function(O,x,d){if(d||arguments.length===2)for(var t=0,r=x.length,c;t<r;t++)(c||!(t in x))&&(c||(c=Array.prototype.slice.call(x,0,t)),c[t]=x[t]);return O.concat(c||Array.prototype.slice.call(x))};Object.defineProperty(H,"__esModule",{value:!0});var k=s(Ae()),l=Ue(),h=Re(),_=["ArrowRight","ArrowUp","k","PageUp"],V=["ArrowLeft","ArrowDown","j","PageDown"],z=function(O){e(x,O);function x(d){var t=O.call(this,d)||this;if(t.trackRef=k.createRef(),t.thumbRefs=[],t.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(t.props.values.length).fill(0).map(function(r,c){return c}),isChanged:!1,markOffsets:[]},t.getOffsets=function(){var r=t.props,c=r.direction,p=r.values,y=r.min,T=r.max,E=t.trackRef.current,D=E.getBoundingClientRect(),R=(0,l.getPaddingAndBorder)(E);return t.getThumbs().map(function(M,I){var m={x:0,y:0},B=M.getBoundingClientRect(),o=(0,l.getMargin)(M);switch(c){case h.Direction.Right:return m.x=(o.left+R.left)*-1,m.y=((B.height-D.height)/2+R.top)*-1,m.x+=D.width*(0,l.relativeValue)(p[I],y,T)-B.width/2,m;case h.Direction.Left:return m.x=(o.right+R.right)*-1,m.y=((B.height-D.height)/2+R.top)*-1,m.x+=D.width-D.width*(0,l.relativeValue)(p[I],y,T)-B.width/2,m;case h.Direction.Up:return m.x=((B.width-D.width)/2+o.left+R.left)*-1,m.y=-R.left,m.y+=D.height-D.height*(0,l.relativeValue)(p[I],y,T)-B.height/2,m;case h.Direction.Down:return m.x=((B.width-D.width)/2+o.left+R.left)*-1,m.y=-R.left,m.y+=D.height*(0,l.relativeValue)(p[I],y,T)-B.height/2,m;default:return(0,l.assertUnreachable)(c)}})},t.getThumbs=function(){return t.trackRef&&t.trackRef.current?Array.from(t.trackRef.current.children).filter(function(r){return r.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},t.getTargetIndex=function(r){return t.getThumbs().findIndex(function(c){return c===r.target||c.contains(r.target)})},t.addTouchEvents=function(r){document.addEventListener("touchmove",t.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",t.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",t.schdOnEnd,{passive:!1})},t.addMouseEvents=function(r){document.addEventListener("mousemove",t.schdOnMouseMove),document.addEventListener("mouseup",t.schdOnEnd)},t.onMouseDownTrack=function(r){var c;if(r.button===0)if(r.persist(),r.preventDefault(),t.addMouseEvents(r.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var T;return(T=y.current)===null||T===void 0?void 0:T.contains(r.target)}))return;t.setState({draggedTrackPos:[r.clientX,r.clientY]},function(){return t.onMove(r.clientX,r.clientY)})}else{var p=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),r.clientX,r.clientY,t.props.direction);(c=t.thumbRefs[p].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:p},function(){return t.onMove(r.clientX,r.clientY)})}},t.onResize=function(){(0,l.translateThumbs)(t.getThumbs(),t.getOffsets(),t.props.rtl),t.calculateMarkOffsets()},t.onTouchStartTrack=function(r){var c;if(r.persist(),t.addTouchEvents(r.nativeEvent),t.props.values.length>1&&t.props.draggableTrack){if(t.thumbRefs.some(function(y){var T;return(T=y.current)===null||T===void 0?void 0:T.contains(r.target)}))return;t.setState({draggedTrackPos:[r.touches[0].clientX,r.touches[0].clientY]},function(){return t.onMove(r.touches[0].clientX,r.touches[0].clientY)})}else{var p=(0,l.getClosestThumbIndex)(t.thumbRefs.map(function(y){return y.current}),r.touches[0].clientX,r.touches[0].clientY,t.props.direction);(c=t.thumbRefs[p].current)===null||c===void 0||c.focus(),t.setState({draggedThumbIndex:p},function(){return t.onMove(r.touches[0].clientX,r.touches[0].clientY)})}},t.onMouseOrTouchStart=function(r){if(!t.props.disabled){var c=(0,l.isTouchEvent)(r);if(!(!c&&r.button!==0)){var p=t.getTargetIndex(r);p!==-1&&(c?t.addTouchEvents(r):t.addMouseEvents(r),t.setState({draggedThumbIndex:p,thumbZIndexes:t.state.thumbZIndexes.map(function(y,T){return T===p?Math.max.apply(Math,t.state.thumbZIndexes):y<=t.state.thumbZIndexes[p]?y:y-1})}))}}},t.onMouseMove=function(r){r.preventDefault(),t.onMove(r.clientX,r.clientY)},t.onTouchMove=function(r){r.preventDefault(),t.onMove(r.touches[0].clientX,r.touches[0].clientY)},t.onKeyDown=function(r){var c=t.props,p=c.values,y=c.onChange,T=c.step,E=c.rtl,D=c.direction,R=t.state.isChanged,M=t.getTargetIndex(r.nativeEvent),I=E||D===h.Direction.Left||D===h.Direction.Down?-1:1;M!==-1&&(_.includes(r.key)?(r.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(p,M,t.normalizeValue(p[M]+I*(r.key==="PageUp"?T*10:T),M)))):V.includes(r.key)?(r.preventDefault(),t.setState({draggedThumbIndex:M,isChanged:!0}),y((0,l.replaceAt)(p,M,t.normalizeValue(p[M]-I*(r.key==="PageDown"?T*10:T),M)))):r.key==="Tab"?t.setState({draggedThumbIndex:-1},function(){R&&t.fireOnFinalChange()}):R&&t.fireOnFinalChange())},t.onKeyUp=function(r){var c=t.state.isChanged;t.setState({draggedThumbIndex:-1},function(){c&&t.fireOnFinalChange()})},t.onMove=function(r,c){var p=t.state,y=p.draggedThumbIndex,T=p.draggedTrackPos,E=t.props,D=E.direction,R=E.min,M=E.max,I=E.onChange,m=E.values,B=E.step,o=E.rtl;if(y===-1&&T[0]===-1&&T[1]===-1)return null;var i=t.trackRef.current;if(!i)return null;var u=i.getBoundingClientRect(),f=(0,l.isVertical)(D)?u.height:u.width;if(T[0]!==-1&&T[1]!==-1){var S=r-T[0],v=c-T[1],w=0;switch(D){case h.Direction.Right:case h.Direction.Left:w=S/f*(M-R);break;case h.Direction.Down:case h.Direction.Up:w=v/f*(M-R);break;default:(0,l.assertUnreachable)(D)}if(o&&(w*=-1),Math.abs(w)>=B/2){for(var b=0;b<t.thumbRefs.length;b++){if(m[b]===M&&Math.sign(w)===1||m[b]===R&&Math.sign(w)===-1)return;var P=m[b]+w;P>M?w=M-m[b]:P<R&&(w=R-m[b])}for(var j=m.slice(0),b=0;b<t.thumbRefs.length;b++)j=(0,l.replaceAt)(j,b,t.normalizeValue(m[b]+w,b));t.setState({draggedTrackPos:[r,c]}),I(j)}}else{var L=0;switch(D){case h.Direction.Right:L=(r-u.left)/f*(M-R)+R;break;case h.Direction.Left:L=(f-(r-u.left))/f*(M-R)+R;break;case h.Direction.Down:L=(c-u.top)/f*(M-R)+R;break;case h.Direction.Up:L=(f-(c-u.top))/f*(M-R)+R;break;default:(0,l.assertUnreachable)(D)}o&&(L=M+R-L),Math.abs(m[y]-L)>=B/2&&I((0,l.replaceAt)(m,y,t.normalizeValue(L,y)))}},t.normalizeValue=function(r,c){var p=t.props,y=p.min,T=p.max,E=p.step,D=p.allowOverlap,R=p.values;return(0,l.normalizeValue)(r,c,y,T,E,D,R)},t.onEnd=function(r){if(r.preventDefault(),document.removeEventListener("mousemove",t.schdOnMouseMove),document.removeEventListener("touchmove",t.schdOnTouchMove),document.removeEventListener("mouseup",t.schdOnEnd),document.removeEventListener("touchend",t.schdOnEnd),document.removeEventListener("touchcancel",t.schdOnEnd),t.state.draggedThumbIndex===-1&&t.state.draggedTrackPos[0]===-1&&t.state.draggedTrackPos[1]===-1)return null;t.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){t.fireOnFinalChange()})},t.fireOnFinalChange=function(){t.setState({isChanged:!1});var r=t.props,c=r.onFinalChange,p=r.values;c&&c(p)},t.updateMarkRefs=function(r){if(!r.renderMark){t.numOfMarks=void 0,t.markRefs=void 0;return}t.numOfMarks=(r.max-r.min)/t.props.step,t.markRefs=[];for(var c=0;c<t.numOfMarks+1;c++)t.markRefs[c]=k.createRef()},t.calculateMarkOffsets=function(){if(!(!t.props.renderMark||!t.trackRef||!t.numOfMarks||!t.markRefs||t.trackRef.current===null)){for(var r=window.getComputedStyle(t.trackRef.current),c=parseInt(r.width,10),p=parseInt(r.height,10),y=parseInt(r.paddingLeft,10),T=parseInt(r.paddingTop,10),E=[],D=0;D<t.numOfMarks+1;D++){var R=9999,M=9999;if(t.markRefs[D].current){var I=t.markRefs[D].current.getBoundingClientRect();R=I.height,M=I.width}t.props.direction===h.Direction.Left||t.props.direction===h.Direction.Right?E.push([Math.round(c/t.numOfMarks*D+y-M/2),-Math.round((R-p)/2)]):E.push([Math.round(p/t.numOfMarks*D+T-R/2),-Math.round((M-c)/2)])}t.setState({markOffsets:E})}},d.step===0)throw new Error('"step" property should be a positive number');return t.schdOnMouseMove=(0,l.schd)(t.onMouseMove),t.schdOnTouchMove=(0,l.schd)(t.onTouchMove),t.schdOnEnd=(0,l.schd)(t.onEnd),t.thumbRefs=d.values.map(function(){return k.createRef()}),t.updateMarkRefs(d),t}return x.prototype.componentDidMount=function(){var d=this,t=this.props,r=t.values,c=t.min,p=t.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",d.onResize)},unobserve:function(){return window.removeEventListener("resize",d.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,l.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(y){return(0,l.checkBoundaries)(y,d.props.min,d.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),r.forEach(function(y){(0,l.isStepDivisible)(c,y,p)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},x.prototype.componentDidUpdate=function(d,t){var r=this.props,c=r.max,p=r.min,y=r.step,T=r.values,E=r.rtl;(d.max!==c||d.min!==p||d.step!==y)&&this.updateMarkRefs(this.props),(0,l.translateThumbs)(this.getThumbs(),this.getOffsets(),E),(d.max!==c||d.min!==p||d.step!==y||t.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),T.forEach(function(D){(0,l.isStepDivisible)(p,D,y)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},x.prototype.componentWillUnmount=function(){var d={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,d),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},x.prototype.render=function(){var d=this,t=this.props,r=t.renderTrack,c=t.renderThumb,p=t.renderMark,y=p===void 0?function(){return null}:p,T=t.values,E=t.min,D=t.max,R=t.allowOverlap,M=t.disabled,I=this.state,m=I.draggedThumbIndex,B=I.thumbZIndexes,o=I.markOffsets;return r({props:{style:{transform:"scale(1)",cursor:m>-1?"grabbing":this.props.draggableTrack?(0,l.isVertical)(this.props.direction)?"ns-resize":"ew-resize":T.length===1&&!M?"pointer":"inherit"},onMouseDown:M?l.voidFn:this.onMouseDownTrack,onTouchStart:M?l.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:M,children:g(g([],o.map(function(i,u,f){return y({props:{style:d.props.direction===h.Direction.Left||d.props.direction===h.Direction.Right?{position:"absolute",left:"".concat(i[0],"px"),marginTop:"".concat(i[1],"px")}:{position:"absolute",top:"".concat(i[0],"px"),marginLeft:"".concat(i[1],"px")},key:"mark".concat(u),ref:d.markRefs[u]},index:u})}),!0),T.map(function(i,u){var f=d.state.draggedThumbIndex===u;return c({index:u,value:i,isDragged:f,props:{style:{position:"absolute",zIndex:B[u],cursor:M?"inherit":f?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:u,tabIndex:M?void 0:0,"aria-valuemax":R?D:T[u+1]||D,"aria-valuemin":R?E:T[u-1]||E,"aria-valuenow":i,draggable:!1,ref:d.thumbRefs[u],role:"slider",onKeyDown:M?l.voidFn:d.onKeyDown,onKeyUp:M?l.voidFn:d.onKeyUp}})}),!0)})},x.defaultProps={step:1,direction:h.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},x}(k.Component);return H.default=z,H}var Xe;function jt(){return Xe||(Xe=1,function(e){var n=de&&de.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(e,"__esModule",{value:!0}),e.checkValuesAgainstBoundaries=e.relativeValue=e.useThumbOverlap=e.Direction=e.getTrackBackground=e.Range=void 0;var a=n(Ct());e.Range=a.default;var s=Ue();Object.defineProperty(e,"getTrackBackground",{enumerable:!0,get:function(){return s.getTrackBackground}}),Object.defineProperty(e,"useThumbOverlap",{enumerable:!0,get:function(){return s.useThumbOverlap}}),Object.defineProperty(e,"relativeValue",{enumerable:!0,get:function(){return s.relativeValue}}),Object.defineProperty(e,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return s.checkValuesAgainstBoundaries}});var g=Re();Object.defineProperty(e,"Direction",{enumerable:!0,get:function(){return g.Direction}})}(de)),de}var We=jt();function qe(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);n&&(s=s.filter(function(g){return Object.getOwnPropertyDescriptor(e,g).enumerable})),a.push.apply(a,s)}return a}function fe(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?qe(Object(a),!0).forEach(function(s){It(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):qe(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}function It(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}var pe=G("div",{position:"relative",width:"100%"});pe.displayName="Root",pe.displayName="Root",pe.displayName="StyledRoot";var ge=G("div",function(e){var n=e.$theme,a=e.$value,s=a===void 0?[]:a,g=e.$disabled,k=e.$isDragged,l=n.sizing,h="inherit";return g?h="not-allowed":k?h="grabbing":s.length===1&&(h="pointer"),{paddingTop:l.scale600,paddingBottom:l.scale600,paddingRight:l.scale600,paddingLeft:l.scale600,display:"flex",cursor:h,backgroundColor:n.colors.sliderTrackFill}});ge.displayName="Track",ge.displayName="Track",ge.displayName="StyledTrack";var me=G("div",function(e){var n=e.$theme,a=e.$value,s=a===void 0?[]:a,g=e.$min,k=e.$max,l=e.$disabled,h=n.colors,_=n.borders,V=n.direction,z=n.borders.useRoundedCorners?_.radius100:0;return{borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,background:We.getTrackBackground({values:s,colors:s.length===1?[l?h.borderOpaque:h.primary,l?h.backgroundSecondary:h.borderOpaque]:[l?h.backgroundSecondary:h.borderOpaque,l?h.borderOpaque:h.primary,l?h.backgroundSecondary:h.borderOpaque],min:g||0,max:k||0,rtl:V==="rtl"}),height:"2px",width:"100%",alignSelf:"center",cursor:l?"not-allowed":"inherit"}});me.displayName="InnerTrack",me.displayName="InnerTrack",me.displayName="StyledInnerTrack";var ve=G("div",function(e){return{width:"4px",height:"2px",backgroundColor:e.$theme.colors.backgroundPrimary,marginLeft:"16px"}});ve.displayName="Mark",ve.displayName="Mark",ve.displayName="StyledMark";var be=G("div",function(e){return fe(fe({},e.$theme.typography.font200),{},{color:e.$theme.colors.contentPrimary})});be.displayName="Tick",be.displayName="Tick",be.displayName="StyledTick";var ye=G("div",function(e){var n=e.$theme,a=n.sizing;return{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:a.scale600,paddingLeft:a.scale600,paddingBottom:a.scale400}});ye.displayName="TickBar",ye.displayName="TickBar",ye.displayName="StyledTickBar";var we=G("div",function(e){var n=e.$theme,a=e.$value,s=a===void 0?[]:a,g=e.$thumbIndex,k=e.$disabled,l=s.length===2&&g===0,h=s.length===2&&g===1;return n.direction==="rtl"&&(h||l)&&(l=!l,h=!h),{height:"24px",width:"24px",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",borderBottomLeftRadius:"24px",borderBottomRightRadius:"24px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:k?n.colors.sliderHandleFillDisabled:n.colors.sliderHandleFill,outline:"none",boxShadow:e.$isFocusVisible?"0 0 0 3px ".concat(n.colors.accent):"0 1px 4px rgba(0, 0, 0, 0.12)",cursor:k?"not-allowed":"inherit"}});we.displayName="Thumb",we.displayName="Thumb",we.displayName="StyledThumb";var xe=G("div",function(e){var n=e.$disabled,a=e.$theme;return{position:"absolute",top:"-16px",width:"4px",height:"20px",backgroundColor:n?a.colors.sliderHandleFillDisabled:a.colors.sliderHandleInnerFill}});xe.displayName="InnerThumb",xe.displayName="InnerThumb",xe.displayName="StyledInnerThumb";var ke=G("div",function(e){var n=e.$disabled,a=e.$theme;return fe(fe({position:"absolute",top:"-".concat(a.sizing.scale1400)},a.typography.font200),{},{backgroundColor:n?a.colors.sliderHandleFillDisabled:a.colors.sliderHandleInnerFill,color:a.colors.contentInversePrimary,paddingLeft:a.sizing.scale600,paddingRight:a.sizing.scale600,paddingTop:a.sizing.scale500,paddingBottom:a.sizing.scale500,borderBottomLeftRadius:"48px",borderBottomRightRadius:"48px",borderTopLeftRadius:"48px",borderTopRightRadius:"48px",whiteSpace:"nowrap"})});ke.displayName="ThumbValue",ke.displayName="ThumbValue",ke.displayName="StyledThumbValue";function Ke(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);n&&(s=s.filter(function(g){return Object.getOwnPropertyDescriptor(e,g).enumerable})),a.push.apply(a,s)}return a}function Bt(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Ke(Object(a),!0).forEach(function(s){Pt(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Ke(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}function Pt(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function q(){return q=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},q.apply(this,arguments)}function K(e,n){return _t(e)||At(e,n)||$t(e,n)||Lt()}function Lt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $t(e,n){if(e){if(typeof e=="string")return Ye(e,n);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Ye(e,n)}}function Ye(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,s=new Array(n);a<n;a++)s[a]=e[a];return s}function At(e,n){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var s=[],g=!0,k=!1,l,h;try{for(a=a.call(e);!(g=(l=a.next()).done)&&(s.push(l.value),!(n&&s.length===n));g=!0);}catch(_){k=!0,h=_}finally{try{!g&&a.return!=null&&a.return()}finally{if(k)throw h}}return s}}function _t(e){if(Array.isArray(e))return e}var zt=function(e){if(e.length>2||e.length===0)throw new Error("the value prop represents positions of thumbs, so its length can be only one or two");return e};function Ft(e){var n=e.overrides,a=n===void 0?{}:n,s=e.disabled,g=s===void 0?!1:s,k=e.marks,l=k===void 0?!1:k,h=e.onChange,_=h===void 0?function(){}:h,V=e.onFinalChange,z=V===void 0?function(){}:V,O=e.min,x=O===void 0?0:O,d=e.max,t=d===void 0?100:d,r=e.step,c=r===void 0?1:r,p=e.persistentThumb,y=p===void 0?!1:p,T=e.valueToLabel,E=T===void 0?function($){return $}:T,D=e.value,R=C.useContext(pt),M=C.useState(!1),I=K(M,2),m=I[0],B=I[1],o=C.useState(!1),i=K(o,2),u=i[0],f=i[1],S=C.useState(!1),v=K(S,2),w=v[0],b=v[1],P=C.useState(-1),j=K(P,2),L=j[0],N=j[1],X=C.useCallback(function($){gt($)&&b(!0);var Y=$.target.parentNode.firstChild===$.target?0:1;N(Y)},[]),A=C.useCallback(function($){w!==!1&&b(!1),N(-1)},[]),U=zt(D),F={$disabled:g,$step:c,$min:x,$max:t,$marks:l,$value:U,$isFocusVisible:w},te=Q(a.Root,pe),oe=K(te,2),ne=oe[0],re=oe[1],Te=Q(a.Track,ge),ie=K(Te,2),Oe=ie[0],J=ie[1],ue=Q(a.InnerTrack,me),se=K(ue,2),ce=se[0],Ge=se[1],Qe=Q(a.Thumb,we),De=K(Qe,2),Je=De[0],et=De[1],tt=Q(a.InnerThumb,xe),Ee=K(tt,2),nt=Ee[0],rt=Ee[1],at=Q(a.ThumbValue,ke),Ce=K(at,2),ot=Ce[0],it=Ce[1],st=Q(a.Tick,be),je=K(st,2),Ie=je[0],Be=je[1],ut=Q(a.TickBar,ye),Pe=K(ut,2),ct=Pe[0],lt=Pe[1],dt=Q(a.Mark,ve),Le=K(dt,2),ht=Le[0],ft=Le[1];return C.createElement(ne,q({"data-baseweb":"slider"},F,re,{onFocus:vt(re,X),onBlur:mt(re,A)}),C.createElement(We.Range,q({step:c,min:x,max:t,values:U,disabled:g,onChange:function($){return _({value:$})},onFinalChange:function($){return z({value:$})},rtl:R.direction==="rtl",renderTrack:function($){var Y=$.props,W=$.children,ee=$.isDragged;return C.createElement(Oe,q({onMouseDown:Y.onMouseDown,onTouchStart:Y.onTouchStart,$isDragged:ee},F,J),C.createElement(ce,q({$isDragged:ee,ref:Y.ref},F,Ge),W))},renderThumb:function($){var Y=$.props,W=$.index,ee=$.isDragged,$e=y||(!!W&&u||!W&&m||ee)&&!g;return C.createElement(Je,q({},Y,{onMouseEnter:function(){W===0?B(!0):f(!0)},onMouseLeave:function(){W===0?B(!1):f(!1)},$thumbIndex:W,$isDragged:ee,style:Bt({},Y.style)},F,et,{$isFocusVisible:w&&L===W}),$e&&C.createElement(ot,q({$thumbIndex:W,$isDragged:ee},F,it),E(U[W])),$e&&C.createElement(nt,q({$thumbIndex:W,$isDragged:ee},F,rt)))}},l?{renderMark:function($){var Y=$.props,W=$.index;return C.createElement(ht,q({$markIndex:W},Y,F,ft))}}:{})),C.createElement(ct,q({},F,lt),C.createElement(Ie,q({},F,Be),E(x)),C.createElement(Ie,q({},F,Be),E(t))))}const Vt=le("div",{target:"ew7r33m3"})(({disabled:e,theme:n})=>({alignItems:"center",backgroundColor:e?n.colors.gray:n.colors.primary,borderTopLeftRadius:"100%",borderTopRightRadius:"100%",borderBottomLeftRadius:"100%",borderBottomRightRadius:"100%",borderTopStyle:"none",borderBottomStyle:"none",borderRightStyle:"none",borderLeftStyle:"none",boxShadow:"none",display:"flex",justifyContent:"center",height:n.sizes.sliderThumb,width:n.sizes.sliderThumb,":focus":{outline:"none"},":focus-visible":{boxShadow:`0 0 0 0.2rem ${bt(n.colors.primary,.5)}`}}),""),Nt=le("div",{target:"ew7r33m2"})(({disabled:e,theme:n})=>({fontFamily:n.genericFonts.codeFont,fontSize:n.fontSizes.sm,color:e?n.colors.gray:n.colors.primary,top:"-1.6em",position:"absolute",whiteSpace:"nowrap",backgroundColor:n.colors.transparent,lineHeight:n.lineHeights.base,fontWeight:n.fontWeights.normal,pointerEvents:"none"}),""),Ut=le("div",{target:"ew7r33m1"})(({theme:e})=>({fontSize:e.fontSizes.sm,paddingBottom:e.spacing.none,paddingLeft:e.spacing.none,paddingRight:e.spacing.none,paddingTop:"0.65em",justifyContent:"space-between",alignItems:"center",display:"flex"}),""),Ze=le("div",{target:"ew7r33m0"})(({disabled:e,theme:n})=>({lineHeight:n.lineHeights.base,fontWeight:n.fontWeights.normal,fontFamily:n.genericFonts.codeFont,color:e?n.colors.fadedText40:"inherit"}),""),Ht=200;function Xt({disabled:e,element:n,widgetMgr:a,fragmentId:s}){var g;const[k,l]=Et({getStateFromWidgetMgr:Wt,getDefaultStateFromProto:qt,getCurrStateFromProto:Kt,updateWidgetMgrState:Yt,element:n,widgetMgr:a,fragmentId:s}),[h,_]=C.useState(k),V=C.useRef(null),[z]=C.useState([]),[O]=C.useState([]),{colors:x,fonts:d,fontSizes:t,spacing:r}=wt(),c=h.map(m=>Se(m,n)),p=Se(n.min,n),y=Se(n.max,n),T=n.label;C.useEffect(()=>{_(k)},[k]);const E=C.useCallback(xt(Ht,m=>{l({value:m,fromUi:!0})}),[]),D=C.useCallback(({value:m})=>{_(m),E(m)},[E]),R=C.useCallback(()=>Z.jsxs(Ut,{"data-testid":"stSliderTickBar",children:[Z.jsx(Ze,{disabled:e,"data-testid":"stSliderTickBarMin",children:p}),Z.jsx(Ze,{disabled:e,"data-testid":"stSliderTickBarMax",children:y})]}),[p,y,e]),M=C.useCallback(_e.forwardRef(function(m,B){const{$thumbIndex:o}=m,i=o||0;z[i]=B,O[i]||(O[i]=_e.createRef());const u=kt(m,["role","style","aria-valuemax","aria-valuemin","aria-valuenow","tabIndex","onKeyUp","onKeyDown","onMouseEnter","onMouseLeave","draggable"]),f=c[i];return Z.jsx(Vt,{...u,disabled:m.$disabled===!0,ref:z[i],"aria-valuetext":f,"aria-label":T,children:Z.jsx(Nt,{"data-testid":"stSliderThumbValue",disabled:m.$disabled===!0,ref:O[i],children:f})})}),[]);C.useEffect(()=>{var m,B;O.map((v,w)=>{v.current&&(v.current.innerText=c[w])}),z.map((v,w)=>{v.current&&v.current.setAttribute("aria-valuetext",c[w])});const o=V.current??null,i=z[0].current,u=(m=z[1])==null?void 0:m.current,f=O[0].current,S=(B=O[1])==null?void 0:B.current;Qt(o,i,u,f,S)});const I=C.useCallback(({$disabled:m})=>({height:r.twoXS,...m?{background:x.darkenedBgMix25}:{}}),[x,r]);return Z.jsxs("div",{ref:V,className:"stSlider","data-testid":"stSlider",children:[Z.jsx(Tt,{label:n.label,disabled:e,labelVisibility:Ot((g=n.labelVisibility)==null?void 0:g.value),children:n.help&&Z.jsx(Mt,{children:Z.jsx(Rt,{content:n.help,placement:St.TOP_RIGHT})})}),Z.jsx(Ft,{min:n.min,max:n.max,step:n.step,value:Gt(h,n),onChange:D,disabled:e,overrides:{Thumb:M,Tick:{style:{fontFamily:d.monospace}},Track:{style:{backgroundColor:"none !important",paddingBottom:r.none,paddingLeft:r.none,paddingRight:r.none,paddingTop:`calc(${t.sm} * 1.35)`}},InnerTrack:{style:I},TickBar:R}})]})}function Wt(e,n){return e.getDoubleArrayValue(n)}function qt(e){return e.default}function Kt(e){return e.value}function Yt(e,n,a,s){n.setDoubleArrayValue(e,a.value,{fromUi:a.fromUi},s)}function Zt(e){const{dataType:n}=e;return n===Me.DataType.DATETIME||n===Me.DataType.DATE||n===Me.DataType.TIME}function Se(e,n){const{format:a,options:s}=n;return Zt(n)?Dt.utc(e/1e3).format(a):s.length>0?ze.sprintf(a,s[e]):ze.sprintf(a,e)}function Gt(e,n){const{min:a,max:s}=n;let g=e[0],k=e.length>1?e[1]:e[0];return g>k&&(g=k),g<a&&(g=a),g>s&&(g=s),k<a&&(k=a),k>s&&(k=s),e.length>1?[g,k]:[g]}function Qt(e,n,a,s,g){!e||!n||!s||(ae(e,n,s),a&&g&&(ae(e,a,g),Jt(e,n,a,s,g)))}function ae(e,n,a){const s=e.getBoundingClientRect(),g=n.getBoundingClientRect(),k=a.getBoundingClientRect(),l=g.left+g.width/2,h=l-k.width/2<s.left,_=l+k.width/2>s.right;a.style.left=h?"0":"",a.style.right=_?"0":""}function Jt(e,n,a,s,g){const k=e.getBoundingClientRect(),l=n.getBoundingClientRect(),h=a.getBoundingClientRect(),_=s.getBoundingClientRect(),V=g.getBoundingClientRect(),z=k.left+k.width/2,O=l.left+l.width/2,x=h.left+h.width/2,d=O-_.width/2>=k.left,t=x+V.width/2<=k.right,r=l.left-_.width>=k.left,c=h.right+V.width<=k.right,p=d?_.width/2:_.width,y=t?V.width/2:V.width,T=O+p;if(x-y-T>24){ae(e,n,s),ae(e,a,g);return}if(r&&c){s.style.left="",s.style.right=`${Math.round(l.width)}px`,g.style.left=`${Math.round(h.width)}px`,g.style.right="";return}O<z?(ae(e,n,s),g.style.left=`${Math.round(O+p+24-x)}px`,g.style.right=""):(ae(e,a,g),s.style.left="",s.style.right=`${-Math.round(x-y-24-O)}px`)}const en=yt(C.memo(Xt));export{en as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as L,r as i,bP as _,A as D,c_ as W,j as s,bZ as H,b_ as M,cc as U,b$ as B,bI as A,F as O,c$ as $}from"./index-
|
|
1
|
+
import{c as L,r as i,bP as _,A as D,c_ as W,j as s,bZ as H,b_ as M,cc as U,b$ as B,bI as A,F as O,c$ as $}from"./index-Cbvbjd8C.js";import{u as G}from"./uniqueId-BSuwhGjw.js";import{u as K,a as N,b as Z}from"./useOnInputChange-BlFu2GNS.js";import{a as q}from"./useBasicWidgetState-D3a9XYx3.js";import{I as J}from"./InputInstructions-Cyg7opie.js";import{I as Q}from"./input-BH9uqfZf.js";import"./inputUtils-CQWz5UKz.js";import"./FormClearHelper-CT0Jwp4X.js";import"./base-input-BnIlcFzX.js";const X=L("div",{target:"e11y4ecf0"})({name:"bjn8wh",styles:"position:relative"});function Y({disabled:a,element:e,widgetMgr:r,fragmentId:u}){var h;const[l,m]=i.useState(()=>I(r,e)??null),[y,v]=_(),[o,p]=i.useState(!1),T=i.useCallback(()=>{m(e.default??null),p(!0)},[e.default]),[C,c]=q({getStateFromWidgetMgr:I,getDefaultStateFromProto:ee,getCurrStateFromProto:te,updateWidgetMgrState:ae,element:e,widgetMgr:r,fragmentId:u,onFormCleared:T});K(C,l,m,o);const[j,b]=i.useState(!1),t=D(),[f]=i.useState(()=>G("text_input_")),{placeholder:F,formId:n,icon:d,maxChars:x}=e,g=i.useCallback(()=>{p(!1),c({value:l,fromUi:!0})},[l,c]),z=W({formId:n})?r.allowFormEnterToSubmit(n):o,R=j&&y>t.breakpoints.hideWidgetDetails,V=i.useCallback(()=>{o&&g(),b(!1)},[o,g]),w=i.useCallback(()=>{b(!0)},[]),E=N({formId:n,maxChars:x,setDirty:p,setUiValue:m,setValueWithSource:c}),P=Z(n,g,o,r,u),S=d==null?void 0:d.startsWith(":material"),k=S?"lg":"base";return s.jsxs(X,{className:"stTextInput","data-testid":"stTextInput",ref:v,children:[s.jsx(H,{label:e.label,disabled:a,labelVisibility:M((h=e.labelVisibility)==null?void 0:h.value),htmlFor:f,children:e.help&&s.jsx(U,{children:s.jsx(B,{content:e.help,placement:A.TOP_RIGHT})})}),s.jsx(Q,{value:l??"",placeholder:F,onBlur:V,onFocus:w,onChange:E,onKeyPress:P,"aria-label":e.label,disabled:a,id:f,type:ie(e),autoComplete:e.autocomplete,startEnhancer:d&&s.jsx(O,{"data-testid":"stTextInputIcon",iconValue:d,size:k}),overrides:{Input:{style:{minWidth:0,"::placeholder":{opacity:"0.7"},lineHeight:t.lineHeights.inputWidget,paddingRight:t.spacing.sm,paddingLeft:t.spacing.md,paddingBottom:t.spacing.sm,paddingTop:t.spacing.sm}},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:d?t.spacing.sm:0}},StartEnhancer:{style:{paddingLeft:0,paddingRight:0,minWidth:t.iconSizes.lg,color:S?t.colors.fadedText60:"inherit"}}}}),R&&s.jsx(J,{dirty:o,value:l??"",maxLength:x,inForm:W({formId:n}),allowEnterToSubmit:z})]})}function I(a,e){return a.getStringValue(e)??null}function ee(a){return a.default??null}function te(a){return a.value??null}function ae(a,e,r,u){e.setStringValue(a,r.value,{fromUi:r.fromUi},u)}function ie(a){return a.type===$.Type.PASSWORD?"password":"text"}const re=i.memo(Y);export{re as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{cw as ce,d0 as se,d1 as de,d2 as pe,d3 as fe,d4 as ge,cK as ye,c1 as be,cn as me,d5 as ve,cL as he,d6 as Oe,e as U,d7 as Se,c as je,r as J,L as Y,A as Pe,j as L,bZ as Ce,b_ as Ie,cc as Ee,b$ as we,bI as Te,cv as De}from"./index-
|
|
1
|
+
import{cw as ce,d0 as se,d1 as de,d2 as pe,d3 as fe,d4 as ge,cK as ye,c1 as be,cn as me,d5 as ve,cL as he,d6 as Oe,e as U,d7 as Se,c as je,r as J,L as Y,A as Pe,j as L,bZ as Ce,b_ as Ie,cc as Ee,b$ as we,bI as Te,cv as De}from"./index-Cbvbjd8C.js";import{a as xe}from"./useBasicWidgetState-D3a9XYx3.js";import{T as Re}from"./timepicker-B1BEcpbo.js";import"./FormClearHelper-CT0Jwp4X.js";import"./inherits-BaopKHev.js";import"./createSuper-B8yCxQGq.js";var _e=ce.Consumer;const $e=Object.freeze(Object.defineProperty({__proto__:null,ThemeConsumer:_e,ThemeProvider:se,createThemedStyled:de,createThemedUseStyletron:pe,createThemedWithStyle:fe,expandBorderStyles:ge,hexToRgb:ye,styled:be,useStyletron:me,withStyle:ve,withWrapper:he},Symbol.toStringTag,{value:"Module"}));var P={};const G=Oe($e);var D={},K;function ke(){if(K)return D;K=1,Object.defineProperty(D,"__esModule",{value:!0}),D.STATE_CHANGE_TYPE=D.SIZE=D.ENHANCER_POSITION=D.CUSTOM_INPUT_TYPE=D.ADJOINED=void 0;var g={change:"change"};D.STATE_CHANGE_TYPE=g;var d={textarea:"textarea"};D.CUSTOM_INPUT_TYPE=d;var h={none:"none",left:"left",right:"right",both:"both"};D.ADJOINED=h;var b={mini:"mini",default:"default",compact:"compact",large:"large"};D.SIZE=b;var v={start:"start",end:"end"};return D.ENHANCER_POSITION=v,D}var F={},_={},H={},X;function Be(){if(X)return H;X=1,Object.defineProperty(H,"__esModule",{value:!0}),H.default=d;function g(b){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},g(b)}function d(b){b=b||{};for(var v=arguments.length<=1?0:arguments.length-1,m,y,S=0;S<v;S++){m=(S+1<1||arguments.length<=S+1?void 0:arguments[S+1])||{};for(var f in m)g(m[f])!==void 0&&(y=m[f],h(y)?b[f]=d(b[f]||Array.isArray(y)&&[]||{},y):b[f]=y)}return b}function h(b){return Array.isArray(b)||{}.toString.call(b)=="[object Object]"}return H}var Q;function ee(){if(Q)return _;Q=1,Object.defineProperty(_,"__esModule",{value:!0}),_.getOverride=T,_.getOverrideProps=E,_.getOverrides=z,_.mergeConfigurationOverrides=B,_.mergeOverride=R,_.mergeOverrides=k,_.toObjectOverride=x,_.useOverrides=N;var g=m(U()),d=Se(),h=b(Be());function b(i){return i&&i.__esModule?i:{default:i}}function v(i){if(typeof WeakMap!="function")return null;var r=new WeakMap,u=new WeakMap;return(v=function(c){return c?u:r})(i)}function m(i,r){if(i&&i.__esModule)return i;if(i===null||C(i)!=="object"&&typeof i!="function")return{default:i};var u=v(r);if(u&&u.has(i))return u.get(i);var c={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in i)if(a!=="default"&&Object.prototype.hasOwnProperty.call(i,a)){var l=t?Object.getOwnPropertyDescriptor(i,a):null;l&&(l.get||l.set)?Object.defineProperty(c,a,l):c[a]=i[a]}return c.default=i,u&&u.set(i,c),c}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var r=1;r<arguments.length;r++){var u=arguments[r];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(i[c]=u[c])}return i},y.apply(this,arguments)}function S(i,r){var u=Object.keys(i);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(i);r&&(c=c.filter(function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})),u.push.apply(u,c)}return u}function f(i){for(var r=1;r<arguments.length;r++){var u=arguments[r]!=null?arguments[r]:{};r%2?S(Object(u),!0).forEach(function(c){I(i,c,u[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):S(Object(u)).forEach(function(c){Object.defineProperty(i,c,Object.getOwnPropertyDescriptor(u,c))})}return i}function I(i,r,u){return r in i?Object.defineProperty(i,r,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[r]=u,i}function C(i){"@babel/helpers - typeof";return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},C(i)}function T(i){return(0,d.isValidElementType)(i)?i:i&&C(i)==="object"?i.component:i}function E(i){return i&&C(i)==="object"?C(i.props)==="object"?f(f({},i.props),{},{$style:i.style}):{$style:i.style}:{}}function x(i){return(0,d.isValidElementType)(i)?{component:i}:i||{}}function z(i,r){var u=T(i)||r;if(i&&C(i)==="object"&&typeof i.props=="function"){var c=g.forwardRef(function(a,l){var e=i.props(a),o=E(f(f({},i),{},{props:e}));return g.createElement(u,y({ref:l},o))});return c.displayName=u.displayName,[c,{}]}var t=E(i);return[u,t]}function k(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=Object.assign({},i,r),c=Object.keys(u);return c.reduce(function(t,a){return t[a]=R(x(i[a]),x(r[a])),t},{})}function R(i,r){var u=f(f({},i),r);return i.props&&r.props&&(u.props=B(i.props,r.props)),i.style&&r.style&&(u.style=B(i.style,r.style)),u}function B(i,r){return C(i)==="object"&&C(r)==="object"?(0,h.default)({},i,r):function(){return(0,h.default)({},typeof i=="function"?i.apply(void 0,arguments):i,typeof r=="function"?r.apply(void 0,arguments):r)}}function N(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return g.useMemo(function(){return Object.keys(i).reduce(function(u,c){return u[c]=z(r[c],i[c]),u},{})},[r])}return _}var Z={},W={},te;function Me(){if(te)return W;te=1,Object.defineProperty(W,"__esModule",{value:!0}),W.Svg=void 0,W.getSvgStyles=d;var g=G;function d(b){var v=b.$theme,m=b.$size,y=b.$color,S=v.sizing.scale600;m&&(v.sizing[m]?S=v.sizing[m]:typeof m=="number"?S="".concat(m,"px"):S=m);var f="currentColor";return y&&(v.colors[y]?f=v.colors[y]:f=y),{display:"inline-block",fill:f,color:f,height:S,width:S}}var h=(0,g.styled)("svg",d);return W.Svg=h,h.displayName="Svg",h.displayName="Svg",W}var V={},re;function ze(){if(re)return V;re=1,Object.defineProperty(V,"__esModule",{value:!0}),V.default=g;function g(d){var h={};for(var b in d)b[0]!=="$"&&(h[b]=d[b]);return h}return V}var oe;function Ne(){if(oe)return Z;oe=1;function g(t){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},g(t)}Object.defineProperty(Z,"__esModule",{value:!0}),Z.default=void 0;var d=f(U()),h=ee(),b=Me(),v=y(ze()),m=["children","title","size","color","overrides"];function y(t){return t&&t.__esModule?t:{default:t}}function S(t){if(typeof WeakMap!="function")return null;var a=new WeakMap,l=new WeakMap;return(S=function(e){return e?l:a})(t)}function f(t,a){if(t&&t.__esModule)return t;if(t===null||g(t)!=="object"&&typeof t!="function")return{default:t};var l=S(a);if(l&&l.has(t))return l.get(t);var e={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in t)if(n!=="default"&&Object.prototype.hasOwnProperty.call(t,n)){var p=o?Object.getOwnPropertyDescriptor(t,n):null;p&&(p.get||p.set)?Object.defineProperty(e,n,p):e[n]=t[n]}return e.default=t,l&&l.set(t,e),e}function I(){return I=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var e in l)Object.prototype.hasOwnProperty.call(l,e)&&(t[e]=l[e])}return t},I.apply(this,arguments)}function C(t,a){var l=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);a&&(e=e.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),l.push.apply(l,e)}return l}function T(t){for(var a=1;a<arguments.length;a++){var l=arguments[a]!=null?arguments[a]:{};a%2?C(Object(l),!0).forEach(function(e){E(t,e,l[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(l)):C(Object(l)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(l,e))})}return t}function E(t,a,l){return a in t?Object.defineProperty(t,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):t[a]=l,t}function x(t,a){return N(t)||B(t,a)||k(t,a)||z()}function z(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k(t,a){if(t){if(typeof t=="string")return R(t,a);var l=Object.prototype.toString.call(t).slice(8,-1);if(l==="Object"&&t.constructor&&(l=t.constructor.name),l==="Map"||l==="Set")return Array.from(t);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return R(t,a)}}function R(t,a){(a==null||a>t.length)&&(a=t.length);for(var l=0,e=new Array(a);l<a;l++)e[l]=t[l];return e}function B(t,a){var l=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(l!=null){var e=[],o=!0,n=!1,p,s;try{for(l=l.call(t);!(o=(p=l.next()).done)&&(e.push(p.value),!(a&&e.length===a));o=!0);}catch(O){n=!0,s=O}finally{try{!o&&l.return!=null&&l.return()}finally{if(n)throw s}}return e}}function N(t){if(Array.isArray(t))return t}function i(t,a){if(t==null)return{};var l=r(t,a),e,o;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(o=0;o<n.length;o++)e=n[o],!(a.indexOf(e)>=0)&&Object.prototype.propertyIsEnumerable.call(t,e)&&(l[e]=t[e])}return l}function r(t,a){if(t==null)return{};var l={},e=Object.keys(t),o,n;for(n=0;n<e.length;n++)o=e[n],!(a.indexOf(o)>=0)&&(l[o]=t[o]);return l}var u=function(t,a){var l=t.children,e=t.title,o=t.size,n=t.color,p=t.overrides,s=p===void 0?{}:p,O=i(t,m),j=(0,h.getOverrides)(s.Svg,b.Svg),$=x(j,2),w=$[0],M=$[1],A=w.__STYLETRON__?T(T({title:e,$color:n,$size:o},O),M):T(T({title:e,color:n,size:o},(0,v.default)(O)),(0,v.default)(M));return d.createElement(w,I({"data-baseweb":"icon",ref:a},A),e?d.createElement("title",null,e):null,l)},c=d.forwardRef(u);return Z.default=c,Z}var ne;function Le(){if(ne)return F;ne=1;function g(r){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},g(r)}Object.defineProperty(F,"__esModule",{value:!0}),F.default=void 0;var d=f(U()),h=G,b=ee(),v=y(Ne()),m=["title","size","color","overrides"];function y(r){return r&&r.__esModule?r:{default:r}}function S(r){if(typeof WeakMap!="function")return null;var u=new WeakMap,c=new WeakMap;return(S=function(t){return t?c:u})(r)}function f(r,u){if(r&&r.__esModule)return r;if(r===null||g(r)!=="object"&&typeof r!="function")return{default:r};var c=S(u);if(c&&c.has(r))return c.get(r);var t={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in r)if(l!=="default"&&Object.prototype.hasOwnProperty.call(r,l)){var e=a?Object.getOwnPropertyDescriptor(r,l):null;e&&(e.get||e.set)?Object.defineProperty(t,l,e):t[l]=r[l]}return t.default=r,c&&c.set(r,t),t}function I(){return I=Object.assign?Object.assign.bind():function(r){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var t in c)Object.prototype.hasOwnProperty.call(c,t)&&(r[t]=c[t])}return r},I.apply(this,arguments)}function C(r,u){if(r==null)return{};var c=T(r,u),t,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);for(a=0;a<l.length;a++)t=l[a],!(u.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(c[t]=r[t])}return c}function T(r,u){if(r==null)return{};var c={},t=Object.keys(r),a,l;for(l=0;l<t.length;l++)a=t[l],!(u.indexOf(a)>=0)&&(c[a]=r[a]);return c}function E(r,u){return B(r)||R(r,u)||z(r,u)||x()}function x(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z(r,u){if(r){if(typeof r=="string")return k(r,u);var c=Object.prototype.toString.call(r).slice(8,-1);if(c==="Object"&&r.constructor&&(c=r.constructor.name),c==="Map"||c==="Set")return Array.from(r);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return k(r,u)}}function k(r,u){(u==null||u>r.length)&&(u=r.length);for(var c=0,t=new Array(u);c<u;c++)t[c]=r[c];return t}function R(r,u){var c=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(c!=null){var t=[],a=!0,l=!1,e,o;try{for(c=c.call(r);!(a=(e=c.next()).done)&&(t.push(e.value),!(u&&t.length===u));a=!0);}catch(n){l=!0,o=n}finally{try{!a&&c.return!=null&&c.return()}finally{if(l)throw o}}return t}}function B(r){if(Array.isArray(r))return r}function N(r,u){var c=(0,h.useStyletron)(),t=E(c,2),a=t[1],l=r.title,e=l===void 0?"Delete Alt":l,o=r.size,n=r.color,p=r.overrides,s=p===void 0?{}:p,O=C(r,m),j=(0,b.mergeOverride)({component:a.icons&&a.icons.DeleteAlt?a.icons.DeleteAlt:null},s&&s.Svg?(0,b.toObjectOverride)(s.Svg):{});return d.createElement(v.default,I({viewBox:"0 0 24 24",ref:u,title:e,size:o,color:n,overrides:{Svg:j}},O),d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58173 16.4183 4 12 4C7.58173 4 4 7.58173 4 12C4 16.4183 7.58173 20 12 20ZM10.0303 8.96967C9.73743 8.67679 9.26257 8.67679 8.96967 8.96967C8.67676 9.26257 8.67676 9.73743 8.96967 10.0303L10.9393 12L8.96967 13.9697C8.67676 14.2626 8.67676 14.7374 8.96967 15.0303C9.26257 15.3232 9.73743 15.3232 10.0303 15.0303L12 13.0607L13.9697 15.0303C14.2626 15.3232 14.7374 15.3232 15.0303 15.0303C15.3232 14.7374 15.3232 14.2626 15.0303 13.9697L13.0607 12L15.0303 10.0303C15.3232 9.73743 15.3232 9.26257 15.0303 8.96967C14.7374 8.67679 14.2626 8.67679 13.9697 8.96967L12 10.9393L10.0303 8.96967Z"}))}var i=d.forwardRef(N);return F.default=i,F}var ie;function Ae(){if(ie)return P;ie=1,Object.defineProperty(P,"__esModule",{value:!0}),P.getRootStyles=P.getInputStyles=P.getInputContainerStyles=P.StyledMaskToggleButton=P.StyledClearIconContainer=P.StyledClearIcon=P.Root=P.InputEnhancer=P.InputContainer=P.Input=void 0;var g=G,d=ke(),h=b(Le());function b(e){return e&&e.__esModule?e:{default:e}}function v(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);o&&(p=p.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,p)}return n}function m(e){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?v(Object(n),!0).forEach(function(p){y(e,p,n[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(p){Object.defineProperty(e,p,Object.getOwnPropertyDescriptor(n,p))})}return e}function y(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}var S=(0,g.styled)("button",function(e){var o,n=e.$theme,p=e.$size,s=e.$isFocusVisible,O=(o={},y(o,d.SIZE.mini,n.sizing.scale400),y(o,d.SIZE.compact,n.sizing.scale400),y(o,d.SIZE.default,n.sizing.scale300),y(o,d.SIZE.large,n.sizing.scale200),o)[p];return{display:"flex",alignItems:"center",borderTopStyle:"none",borderBottomStyle:"none",borderLeftStyle:"none",borderRightStyle:"none",background:"none",paddingLeft:O,paddingRight:O,outline:s?"solid 3px ".concat(n.colors.accent):"none",color:n.colors.contentPrimary}});P.StyledMaskToggleButton=S,S.displayName="StyledMaskToggleButton",S.displayName="StyledMaskToggleButton";var f=(0,g.styled)("div",function(e){var o,n=e.$alignTop,p=n===void 0?!1:n,s=e.$size,O=e.$theme,j=(o={},y(o,d.SIZE.mini,O.sizing.scale200),y(o,d.SIZE.compact,O.sizing.scale200),y(o,d.SIZE.default,O.sizing.scale100),y(o,d.SIZE.large,O.sizing.scale0),o)[s];return{display:"flex",alignItems:p?"flex-start":"center",paddingLeft:j,paddingRight:j,paddingTop:p?O.sizing.scale500:"0px",color:O.colors.contentPrimary}});P.StyledClearIconContainer=f,f.displayName="StyledClearIconContainer",f.displayName="StyledClearIconContainer";var I=(0,g.styled)(h.default,function(e){var o=e.$theme,n=e.$isFocusVisible;return{cursor:"pointer",outline:n?"solid 3px ".concat(o.colors.accent):"none"}});P.StyledClearIcon=I,I.displayName="StyledClearIcon",I.displayName="StyledClearIcon";function C(e,o){var n;return(n={},y(n,d.SIZE.mini,{paddingTop:o.scale100,paddingBottom:o.scale100,paddingLeft:o.scale550,paddingRight:o.scale550}),y(n,d.SIZE.compact,{paddingTop:o.scale200,paddingBottom:o.scale200,paddingLeft:o.scale550,paddingRight:o.scale550}),y(n,d.SIZE.default,{paddingTop:o.scale400,paddingBottom:o.scale400,paddingLeft:o.scale550,paddingRight:o.scale550}),y(n,d.SIZE.large,{paddingTop:o.scale550,paddingBottom:o.scale550,paddingLeft:o.scale550,paddingRight:o.scale550}),n)[e]}function T(e,o,n,p,s){var O=e===d.ADJOINED.both||e===d.ADJOINED.left&&p!=="rtl"||e===d.ADJOINED.right&&p==="rtl"||s&&p==="rtl",j=e===d.ADJOINED.both||e===d.ADJOINED.right&&p!=="rtl"||e===d.ADJOINED.left&&p==="rtl"||s&&p!=="rtl";return{paddingLeft:O?n.scale550:"0px",paddingRight:j?n.scale550:"0px"}}function E(e,o){var n;return(n={},y(n,d.SIZE.mini,o.font100),y(n,d.SIZE.compact,o.font200),y(n,d.SIZE.default,o.font300),y(n,d.SIZE.large,o.font400),n)[e]}function x(e,o,n){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=arguments.length>4?arguments[4]:void 0;return e?{borderLeftColor:s.inputFillDisabled,borderRightColor:s.inputFillDisabled,borderTopColor:s.inputFillDisabled,borderBottomColor:s.inputFillDisabled,backgroundColor:s.inputFillDisabled}:o?{borderLeftColor:s.borderSelected,borderRightColor:s.borderSelected,borderTopColor:s.borderSelected,borderBottomColor:s.borderSelected,backgroundColor:s.inputFillActive}:n?{borderLeftColor:s.inputBorderError,borderRightColor:s.inputBorderError,borderTopColor:s.inputBorderError,borderBottomColor:s.inputBorderError,backgroundColor:s.inputFillError}:p?{borderLeftColor:s.inputBorderPositive,borderRightColor:s.inputBorderPositive,borderTopColor:s.inputBorderPositive,borderBottomColor:s.inputBorderPositive,backgroundColor:s.inputFillPositive}:{borderLeftColor:s.inputBorder,borderRightColor:s.inputBorder,borderTopColor:s.inputBorder,borderBottomColor:s.inputBorder,backgroundColor:s.inputFill}}function z(e,o){var n=o.inputBorderRadius;return e===d.SIZE.mini&&(n=o.inputBorderRadiusMini),{borderTopLeftRadius:n,borderBottomLeftRadius:n,borderTopRightRadius:n,borderBottomRightRadius:n}}var k=function(e){var o=e.$isFocused,n=e.$adjoined,p=e.$error,s=e.$disabled,O=e.$positive,j=e.$size,$=e.$theme,w=e.$theme,M=w.borders,A=w.colors,ae=w.sizing,le=w.typography,q=w.animation,ue=e.$hasIconTrailing;return m(m(m(m({boxSizing:"border-box",display:"flex",overflow:"hidden",width:"100%",borderLeftWidth:"2px",borderRightWidth:"2px",borderTopWidth:"2px",borderBottomWidth:"2px",borderLeftStyle:"solid",borderRightStyle:"solid",borderTopStyle:"solid",borderBottomStyle:"solid",transitionProperty:"border",transitionDuration:q.timing200,transitionTimingFunction:q.easeOutCurve},z(j,M)),E(j,le)),x(s,o,p,O,A)),T(n,j,ae,$.direction,ue))};P.getRootStyles=k;var R=(0,g.styled)("div",k);P.Root=R,R.displayName="Root",R.displayName="Root";function B(e,o){var n;return(n={},y(n,d.SIZE.mini,{paddingRight:o.scale400,paddingLeft:o.scale400}),y(n,d.SIZE.compact,{paddingRight:o.scale400,paddingLeft:o.scale400}),y(n,d.SIZE.default,{paddingRight:o.scale300,paddingLeft:o.scale300}),y(n,d.SIZE.large,{paddingRight:o.scale200,paddingLeft:o.scale200}),n)[e]}function N(e,o,n,p,s){return e?{color:s.inputEnhancerTextDisabled,backgroundColor:s.inputFillDisabled}:o?{color:s.contentPrimary,backgroundColor:s.inputFillActive}:n?{color:s.contentPrimary,backgroundColor:s.inputFillError}:p?{color:s.contentPrimary,backgroundColor:s.inputFillPositive}:{color:s.contentPrimary,backgroundColor:s.inputFill}}var i=(0,g.styled)("div",function(e){var o=e.$size,n=e.$disabled,p=e.$isFocused,s=e.$error,O=e.$positive,j=e.$theme,$=j.colors,w=j.sizing,M=j.typography,A=j.animation;return m(m(m({display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"color, background-color",transitionDuration:A.timing200,transitionTimingFunction:A.easeOutCurve},E(o,M)),B(o,w)),N(n,p,s,O,$))});P.InputEnhancer=i,i.displayName="InputEnhancer",i.displayName="InputEnhancer";function r(e,o,n,p,s){return e?{color:s.inputTextDisabled,backgroundColor:s.inputFillDisabled}:o?{color:s.contentPrimary,backgroundColor:s.inputFillActive}:n?{color:s.contentPrimary,backgroundColor:s.inputFillError}:p?{color:s.contentPrimary,backgroundColor:s.inputFillPositive}:{color:s.contentPrimary,backgroundColor:s.inputFill}}var u=function(e){var o=e.$isFocused,n=e.$error,p=e.$disabled,s=e.$positive,O=e.$size,j=e.$theme,$=j.colors,w=j.typography,M=j.animation;return m(m({display:"flex",width:"100%",transitionProperty:"background-color",transitionDuration:M.timing200,transitionTimingFunction:M.easeOutCurve},E(O,w)),r(p,o,n,s,$))};P.getInputContainerStyles=u;var c=(0,g.styled)("div",u);P.InputContainer=c,c.displayName="InputContainer",c.displayName="InputContainer";function t(e,o,n,p){return e?{color:p.inputTextDisabled,"-webkit-text-fill-color":p.inputTextDisabled,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholderDisabled}}:{color:p.contentPrimary,caretColor:p.contentPrimary,"::placeholder":{color:p.inputPlaceholder}}}var a=function(e){var o=e.$disabled,n=e.$isFocused,p=e.$error,s=e.$size,O=e.$theme,j=O.colors,$=O.sizing,w=O.typography;return m(m(m({boxSizing:"border-box",backgroundColor:"transparent",borderLeftWidth:0,borderRightWidth:0,borderTopWidth:0,borderBottomWidth:0,borderLeftStyle:"none",borderRightStyle:"none",borderTopStyle:"none",borderBottomStyle:"none",outline:"none",width:"100%",minWidth:0,maxWidth:"100%",cursor:o?"not-allowed":"text",margin:"0",paddingTop:"0",paddingBottom:"0",paddingLeft:"0",paddingRight:"0"},E(s,w)),C(s,$)),t(o,n,p,j))};P.getInputStyles=a;var l=(0,g.styled)("input",a);return P.Input=l,l.displayName="Input",l.displayName="Input",P}var We=Ae();const Fe=je("div",{target:"e1ipygm10"})({name:"1ucqwki",styles:"position:absolute;top:50%;right:2.05em"});function Ze({disabled:g,element:d,widgetMgr:h,fragmentId:b}){var v;const[m,y]=xe({getStateFromWidgetMgr:He,getDefaultStateFromProto:Ve,getCurrStateFromProto:Ue,updateWidgetMgrState:Je,element:d,widgetMgr:h,fragmentId:b}),S=Y(d.default)&&!g,f=Pe(),I={Select:{props:{disabled:g,overrides:{ControlContainer:{style:{height:f.sizes.minElementHeight,borderLeftWidth:f.sizes.borderWidth,borderRightWidth:f.sizes.borderWidth,borderTopWidth:f.sizes.borderWidth,borderBottomWidth:f.sizes.borderWidth}},IconsContainer:{style:()=>({paddingRight:f.spacing.sm})},ValueContainer:{style:()=>({lineHeight:f.lineHeights.inputWidget,paddingRight:f.spacing.sm,paddingLeft:f.spacing.md,paddingBottom:f.spacing.sm,paddingTop:f.spacing.sm})},SingleValue:{props:{"data-testid":"stTimeInputTimeDisplay"}},Dropdown:{style:()=>({paddingTop:f.spacing.none,paddingBottom:f.spacing.none,boxShadow:"none",maxHeight:f.sizes.maxDropdownHeight})},DropdownListItem:{style:()=>({paddingRight:f.spacing.lg,paddingLeft:f.spacing.lg,paddingTop:f.spacing.sm,paddingBottom:f.spacing.sm})},Popover:{props:{overrides:{Body:{style:()=>({marginTop:f.spacing.px})}}}},SelectArrow:{component:De,props:{overrides:{Svg:{style:()=>({width:f.iconSizes.xl,height:f.iconSizes.xl})}}}}}}}},C=J.useCallback(E=>{const x=E===null?null:Ye(E);y({value:x,fromUi:!0})},[y]),T=J.useCallback(()=>{C(null)},[C]);return L.jsxs("div",{className:"stTimeInput","data-testid":"stTimeInput",children:[L.jsx(Ce,{label:d.label,disabled:g,labelVisibility:Ie((v=d.labelVisibility)==null?void 0:v.value),children:d.help&&L.jsx(Ee,{children:L.jsx(we,{content:d.help,placement:Te.TOP_RIGHT})})}),L.jsx(Re,{format:"24",step:d.step?Number(d.step):900,value:Y(m)?void 0:Ge(m),onChange:C,overrides:I,nullable:S,creatable:!0,"aria-label":d.label}),S&&!Y(m)&&L.jsx(Fe,{onClick:T,"data-testid":"stTimeInputClearButton",children:L.jsx(We.StyledClearIcon,{overrides:{Svg:{style:{color:f.colors.darkGray,padding:f.spacing.threeXS,height:f.sizes.clearIconSize,width:f.sizes.clearIconSize,":hover":{fill:f.colors.bodyText}}}},$isFocusVisible:!1})})]})}function He(g,d){return g.getStringValue(d)??null}function Ve(g){return g.default??null}function Ue(g){return g.value??null}function Je(g,d,h,b){d.setStringValue(g,h.value,{fromUi:h.fromUi},b)}function Ye(g){const d=g.getHours().toString().padStart(2,"0"),h=g.getMinutes().toString().padStart(2,"0");return`${d}:${h}`}function Ge(g){if(g===null)return null;const[d,h]=g.split(":").map(Number),b=new Date;return b.setHours(d),b.setMinutes(h),b}const qe=J.memo(Ze);export{qe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as s,cm as d,b_ as n}from"./index-
|
|
1
|
+
import{r as o,j as s,cm as d,b_ as n}from"./index-Cbvbjd8C.js";import{a as b}from"./useBasicWidgetState-D3a9XYx3.js";import"./FormClearHelper-CT0Jwp4X.js";const f=(e,a)=>e.getStringValue(a),p=e=>e.default??null,v=e=>e.value??null,S=(e,a,l,t)=>{a.setStringValue(e,l.value,{fromUi:l.fromUi},t)},c=({element:e,disabled:a,widgetMgr:l,fragmentId:t})=>{var r;const[m,i]=b({getStateFromWidgetMgr:f,getDefaultStateFromProto:p,getCurrStateFromProto:v,updateWidgetMgrState:S,element:e,widgetMgr:l,fragmentId:t}),g=o.useCallback(u=>{i({value:u,fromUi:!0})},[i]);return s.jsx(d,{label:e.label,labelVisibility:n((r=e.labelVisibility)==null?void 0:r.value),help:e.help,onChange:g,disabled:a,value:m})},h=o.memo(c);export{h as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as h,E as U,_ as B,bq as pe,bR as Ve,bS as _e,bT as $e,L as H,N as X,R as me,b7 as He,c as k,bU as Xe,j as f,bV as Ge,bW as qe,bD as Ye,bX as Ze,l as Je,A as Ke,bY as ee,G as Qe,b3 as et,bZ as tt,b_ as it,b$ as rt,bI as st}from"./index-CVPZJuoC.js";import{u as nt,F as ot}from"./FormClearHelper-DI9KwuTl.js";import{T as at,a as ge}from"./Toolbar-1r13KE9d.js";import{u as lt}from"./Hooks-BRr-mPDr.js";import{c as dt}from"./createDownloadLinkElement-DZMwyjvU.js";import{F as ct,D as ht}from"./FileDownload.esm-DNaG7mhy.js";var fe=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),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"}))});fe.displayName="Mic";var ve=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),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"}))});ve.displayName="Pause";var be=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),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"}))});be.displayName="PlayArrow";var ye=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),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"}))});ye.displayName="Refresh";var we=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),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"}))});we.displayName="StopCircle";function P(r,e,t,i){return new(t||(t=Promise))(function(s,o){function n(c){try{a(i.next(c))}catch(l){o(l)}}function d(c){try{a(i.throw(c))}catch(l){o(l)}}function a(c){var l;c.done?s(c.value):(l=c.value,l instanceof t?l:new t(function(p){p(l)})).then(n,d)}a((i=i.apply(r,e||[])).next())})}let z=class{constructor(){this.listeners={}}on(r,e,t){if(this.listeners[r]||(this.listeners[r]=new Set),this.listeners[r].add(e),t==null?void 0:t.once){const i=()=>{this.un(r,i),this.un(r,e)};return this.on(r,i),i}return()=>this.un(r,e)}un(r,e){var t;(t=this.listeners[r])===null||t===void 0||t.delete(e)}once(r,e){return this.on(r,e,{once:!0})}unAll(){this.listeners={}}emit(r,...e){this.listeners[r]&&this.listeners[r].forEach(t=>t(...e))}};const G={decode:function(r,e){return P(this,void 0,void 0,function*(){const t=new AudioContext({sampleRate:e});return t.decodeAudioData(r).finally(()=>t.close())})},createBuffer:function(r,e){return typeof r[0]=="number"&&(r=[r]),function(t){const i=t[0];if(i.some(s=>s>1||s<-1)){const s=i.length;let o=0;for(let n=0;n<s;n++){const d=Math.abs(i[n]);d>o&&(o=d)}for(const n of t)for(let d=0;d<s;d++)n[d]/=o}}(r),{duration:e,length:r[0].length,sampleRate:r[0].length/e,numberOfChannels:r.length,getChannelData:t=>r==null?void 0:r[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Ce(r,e){const t=e.xmlns?document.createElementNS(e.xmlns,r):document.createElement(r);for(const[i,s]of Object.entries(e))if(i==="children")for(const[o,n]of Object.entries(e))typeof n=="string"?t.appendChild(document.createTextNode(n)):t.appendChild(Ce(o,n));else i==="style"?Object.assign(t.style,s):i==="textContent"?t.textContent=s:t.setAttribute(i,s.toString());return t}function xe(r,e,t){const i=Ce(r,e||{});return t==null||t.appendChild(i),i}var ut=Object.freeze({__proto__:null,createElement:xe,default:xe});const pt={fetchBlob:function(r,e,t){return P(this,void 0,void 0,function*(){const i=yield fetch(r,t);if(i.status>=400)throw new Error(`Failed to fetch ${r}: ${i.status} (${i.statusText})`);return function(s,o){P(this,void 0,void 0,function*(){if(!s.body||!s.headers)return;const n=s.body.getReader(),d=Number(s.headers.get("Content-Length"))||0;let a=0;const c=p=>P(this,void 0,void 0,function*(){a+=(p==null?void 0:p.length)||0;const m=Math.round(a/d*100);o(m)}),l=()=>P(this,void 0,void 0,function*(){let p;try{p=yield n.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),e),i.blob()})}};class mt extends z{constructor(e){super(),this.isExternalMedia=!1,e.media?(this.media=e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),e.mediaControls&&(this.media.controls=!0),e.autoplay&&(this.media.autoplay=!0),e.playbackRate!=null&&this.onMediaEvent("canplay",()=>{e.playbackRate!=null&&(this.media.playbackRate=e.playbackRate)},{once:!0})}onMediaEvent(e,t,i){return this.media.addEventListener(e,t,i),()=>this.media.removeEventListener(e,t,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const e=this.getSrc();e.startsWith("blob:")&&URL.revokeObjectURL(e)}canPlayType(e){return this.media.canPlayType(e)!==""}setSrc(e,t){const i=this.getSrc();if(e&&i===e)return;this.revokeSrc();const s=t instanceof Blob&&(this.canPlayType(t.type)||!e)?URL.createObjectURL(t):e;i&&(this.media.src="");try{this.media.src=s}catch{this.media.src=e}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(e){this.media=e}play(){return P(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(e){this.media.currentTime=Math.max(0,Math.min(e,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(e){this.media.volume=e}getMuted(){return this.media.muted}setMuted(e){this.media.muted=e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(e,t){t!=null&&(this.media.preservesPitch=t),this.media.playbackRate=e}getMediaElement(){return this.media}setSinkId(e){return this.media.setSinkId(e)}}class I extends z{constructor(e,t){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=e;const i=this.parentFromOptionsContainer(e.container);this.parent=i;const[s,o]=this.initHtml();i.appendChild(s),this.container=s,this.scrollContainer=o.querySelector(".scroll"),this.wrapper=o.querySelector(".wrapper"),this.canvasWrapper=o.querySelector(".canvases"),this.progressWrapper=o.querySelector(".progress"),this.cursor=o.querySelector(".cursor"),t&&o.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if(typeof e=="string"?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=t=>{const i=this.wrapper.getBoundingClientRect(),s=t.clientX-i.left,o=t.clientY-i.top;return[s/i.width,o/i.height]};if(this.wrapper.addEventListener("click",t=>{const[i,s]=e(t);this.emit("click",i,s)}),this.wrapper.addEventListener("dblclick",t=>{const[i,s]=e(t);this.emit("dblclick",i,s)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:t,scrollWidth:i,clientWidth:s}=this.scrollContainer,o=t/i,n=(t+s)/i;this.emit("scroll",o,n,t,t+s)}),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=e,this.reRender())}initDrag(){this.subscriptions.push(function(e,t,i,s,o=3,n=0,d=100){if(!e)return()=>{};const a=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==n)return;p.preventDefault(),p.stopPropagation();let m=p.clientX,u=p.clientY,g=!1;const b=Date.now(),v=C=>{if(C.preventDefault(),C.stopPropagation(),a&&Date.now()-b<d)return;const M=C.clientX,T=C.clientY,D=M-m,j=T-u;if(g||Math.abs(D)>o||Math.abs(j)>o){const W=e.getBoundingClientRect(),{left:_,top:N}=W;g||(i==null||i(m-_,u-N),g=!0),t(D,j,M-_,T-N),m=M,u=T}},y=C=>{if(g){const M=C.clientX,T=C.clientY,D=e.getBoundingClientRect(),{left:j,top:W}=D;s==null||s(M-j,T-W)}c()},S=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||y(C)},w=C=>{g&&(C.stopPropagation(),C.preventDefault())},E=C=>{g&&C.preventDefault()};document.addEventListener("pointermove",v),document.addEventListener("pointerup",y),document.addEventListener("pointerout",S),document.addEventListener("pointercancel",S),document.addEventListener("touchmove",E,{passive:!1}),document.addEventListener("click",w,{capture:!0}),c=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",y),document.removeEventListener("pointerout",S),document.removeEventListener("pointercancel",S),document.removeEventListener("touchmove",E),setTimeout(()=>{document.removeEventListener("click",w,{capture:!0})},10)}};return e.addEventListener("pointerdown",l),()=>{c(),e.removeEventListener("pointerdown",l)}}(this.wrapper,(e,t,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))}))}getHeight(e,t){var i;const s=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(e==null)return 128;if(!isNaN(Number(e)))return Number(e);if(e==="auto"){const o=this.parent.clientHeight||128;return t!=null&&t.every(n=>!n.overlay)?o/s:o}return 128}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return t.innerHTML=`
|
|
1
|
+
import{r as h,E as U,_ as B,bq as pe,bR as Ve,bS as _e,bT as $e,L as H,N as X,R as me,b7 as He,c as k,bU as Xe,j as f,bV as Ge,bW as qe,bD as Ye,bX as Ze,l as Je,A as Ke,bY as ee,G as Qe,b3 as et,bZ as tt,b_ as it,b$ as rt,bI as st}from"./index-Cbvbjd8C.js";import{u as nt,F as ot}from"./FormClearHelper-CT0Jwp4X.js";import{T as at,a as ge}from"./Toolbar-DlGOP7h4.js";import{u as lt}from"./Hooks-BKPTn6xf.js";import{c as dt}from"./createDownloadLinkElement-DZMwyjvU.js";import{F as ct,D as ht}from"./FileDownload.esm-CbXaPbiH.js";var fe=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),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"}))});fe.displayName="Mic";var ve=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),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"}))});ve.displayName="Pause";var be=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),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"}))});be.displayName="PlayArrow";var ye=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),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"}))});ye.displayName="Refresh";var we=h.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(U,B({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),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"}))});we.displayName="StopCircle";function P(r,e,t,i){return new(t||(t=Promise))(function(s,o){function n(c){try{a(i.next(c))}catch(l){o(l)}}function d(c){try{a(i.throw(c))}catch(l){o(l)}}function a(c){var l;c.done?s(c.value):(l=c.value,l instanceof t?l:new t(function(p){p(l)})).then(n,d)}a((i=i.apply(r,e||[])).next())})}let z=class{constructor(){this.listeners={}}on(r,e,t){if(this.listeners[r]||(this.listeners[r]=new Set),this.listeners[r].add(e),t==null?void 0:t.once){const i=()=>{this.un(r,i),this.un(r,e)};return this.on(r,i),i}return()=>this.un(r,e)}un(r,e){var t;(t=this.listeners[r])===null||t===void 0||t.delete(e)}once(r,e){return this.on(r,e,{once:!0})}unAll(){this.listeners={}}emit(r,...e){this.listeners[r]&&this.listeners[r].forEach(t=>t(...e))}};const G={decode:function(r,e){return P(this,void 0,void 0,function*(){const t=new AudioContext({sampleRate:e});return t.decodeAudioData(r).finally(()=>t.close())})},createBuffer:function(r,e){return typeof r[0]=="number"&&(r=[r]),function(t){const i=t[0];if(i.some(s=>s>1||s<-1)){const s=i.length;let o=0;for(let n=0;n<s;n++){const d=Math.abs(i[n]);d>o&&(o=d)}for(const n of t)for(let d=0;d<s;d++)n[d]/=o}}(r),{duration:e,length:r[0].length,sampleRate:r[0].length/e,numberOfChannels:r.length,getChannelData:t=>r==null?void 0:r[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Ce(r,e){const t=e.xmlns?document.createElementNS(e.xmlns,r):document.createElement(r);for(const[i,s]of Object.entries(e))if(i==="children")for(const[o,n]of Object.entries(e))typeof n=="string"?t.appendChild(document.createTextNode(n)):t.appendChild(Ce(o,n));else i==="style"?Object.assign(t.style,s):i==="textContent"?t.textContent=s:t.setAttribute(i,s.toString());return t}function xe(r,e,t){const i=Ce(r,e||{});return t==null||t.appendChild(i),i}var ut=Object.freeze({__proto__:null,createElement:xe,default:xe});const pt={fetchBlob:function(r,e,t){return P(this,void 0,void 0,function*(){const i=yield fetch(r,t);if(i.status>=400)throw new Error(`Failed to fetch ${r}: ${i.status} (${i.statusText})`);return function(s,o){P(this,void 0,void 0,function*(){if(!s.body||!s.headers)return;const n=s.body.getReader(),d=Number(s.headers.get("Content-Length"))||0;let a=0;const c=p=>P(this,void 0,void 0,function*(){a+=(p==null?void 0:p.length)||0;const m=Math.round(a/d*100);o(m)}),l=()=>P(this,void 0,void 0,function*(){let p;try{p=yield n.read()}catch{return}p.done||(c(p.value),yield l())});l()})}(i.clone(),e),i.blob()})}};class mt extends z{constructor(e){super(),this.isExternalMedia=!1,e.media?(this.media=e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),e.mediaControls&&(this.media.controls=!0),e.autoplay&&(this.media.autoplay=!0),e.playbackRate!=null&&this.onMediaEvent("canplay",()=>{e.playbackRate!=null&&(this.media.playbackRate=e.playbackRate)},{once:!0})}onMediaEvent(e,t,i){return this.media.addEventListener(e,t,i),()=>this.media.removeEventListener(e,t,i)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const e=this.getSrc();e.startsWith("blob:")&&URL.revokeObjectURL(e)}canPlayType(e){return this.media.canPlayType(e)!==""}setSrc(e,t){const i=this.getSrc();if(e&&i===e)return;this.revokeSrc();const s=t instanceof Blob&&(this.canPlayType(t.type)||!e)?URL.createObjectURL(t):e;i&&(this.media.src="");try{this.media.src=s}catch{this.media.src=e}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(e){this.media=e}play(){return P(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(e){this.media.currentTime=Math.max(0,Math.min(e,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(e){this.media.volume=e}getMuted(){return this.media.muted}setMuted(e){this.media.muted=e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(e,t){t!=null&&(this.media.preservesPitch=t),this.media.playbackRate=e}getMediaElement(){return this.media}setSinkId(e){return this.media.setSinkId(e)}}class I extends z{constructor(e,t){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=e;const i=this.parentFromOptionsContainer(e.container);this.parent=i;const[s,o]=this.initHtml();i.appendChild(s),this.container=s,this.scrollContainer=o.querySelector(".scroll"),this.wrapper=o.querySelector(".wrapper"),this.canvasWrapper=o.querySelector(".canvases"),this.progressWrapper=o.querySelector(".progress"),this.cursor=o.querySelector(".cursor"),t&&o.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if(typeof e=="string"?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=t=>{const i=this.wrapper.getBoundingClientRect(),s=t.clientX-i.left,o=t.clientY-i.top;return[s/i.width,o/i.height]};if(this.wrapper.addEventListener("click",t=>{const[i,s]=e(t);this.emit("click",i,s)}),this.wrapper.addEventListener("dblclick",t=>{const[i,s]=e(t);this.emit("dblclick",i,s)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:t,scrollWidth:i,clientWidth:s}=this.scrollContainer,o=t/i,n=(t+s)/i;this.emit("scroll",o,n,t,t+s)}),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=e,this.reRender())}initDrag(){this.subscriptions.push(function(e,t,i,s,o=3,n=0,d=100){if(!e)return()=>{};const a=matchMedia("(pointer: coarse)").matches;let c=()=>{};const l=p=>{if(p.button!==n)return;p.preventDefault(),p.stopPropagation();let m=p.clientX,u=p.clientY,g=!1;const b=Date.now(),v=C=>{if(C.preventDefault(),C.stopPropagation(),a&&Date.now()-b<d)return;const M=C.clientX,T=C.clientY,D=M-m,j=T-u;if(g||Math.abs(D)>o||Math.abs(j)>o){const W=e.getBoundingClientRect(),{left:_,top:N}=W;g||(i==null||i(m-_,u-N),g=!0),t(D,j,M-_,T-N),m=M,u=T}},y=C=>{if(g){const M=C.clientX,T=C.clientY,D=e.getBoundingClientRect(),{left:j,top:W}=D;s==null||s(M-j,T-W)}c()},S=C=>{C.relatedTarget&&C.relatedTarget!==document.documentElement||y(C)},w=C=>{g&&(C.stopPropagation(),C.preventDefault())},E=C=>{g&&C.preventDefault()};document.addEventListener("pointermove",v),document.addEventListener("pointerup",y),document.addEventListener("pointerout",S),document.addEventListener("pointercancel",S),document.addEventListener("touchmove",E,{passive:!1}),document.addEventListener("click",w,{capture:!0}),c=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",y),document.removeEventListener("pointerout",S),document.removeEventListener("pointercancel",S),document.removeEventListener("touchmove",E),setTimeout(()=>{document.removeEventListener("click",w,{capture:!0})},10)}};return e.addEventListener("pointerdown",l),()=>{c(),e.removeEventListener("pointerdown",l)}}(this.wrapper,(e,t,i)=>{this.emit("drag",Math.max(0,Math.min(1,i/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))},e=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))}))}getHeight(e,t){var i;const s=((i=this.audioData)===null||i===void 0?void 0:i.numberOfChannels)||1;if(e==null)return 128;if(!isNaN(Number(e)))return Number(e);if(e==="auto"){const o=this.parent.clientHeight||128;return t!=null&&t.every(n=>!n.overlay)?o/s:o}return 128}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"}),i=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return t.innerHTML=`
|
|
2
2
|
<style${i?` nonce="${i}"`:""}>
|
|
3
3
|
:host {
|
|
4
4
|
user-select: none;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cI as c,a$ as i,bn as f,cJ as u}from"./index-
|
|
1
|
+
import{cI as c,a$ as i,bn as f,cJ as u}from"./index-Cbvbjd8C.js";function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function b(e,t,o){return t&&a(e.prototype,t),o&&a(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){if(t&&(i(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}function l(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}export{l as _,b as a,p as b,n as c,s as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c2 as m,r as f,cQ as U,cV as S,cS as p}from"./index-
|
|
1
|
+
import{c2 as m,r as f,cQ as U,cV as S,cS as p}from"./index-Cbvbjd8C.js";import{R as V,c as P,d as G,B as H}from"./base-input-BnIlcFzX.js";function v(t){"@babel/helpers - typeof";return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},v(t)}var J=["Root","StartEnhancer","EndEnhancer"],K=["startEnhancer","endEnhancer","overrides"];function i(){return i=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t},i.apply(this,arguments)}function O(t,r){return X(t)||W(t,r)||N(t,r)||L()}function L(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N(t,r){if(t){if(typeof t=="string")return F(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(t,r)}}function F(t,r){(r==null||r>t.length)&&(r=t.length);for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function W(t,r){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var e=[],o=!0,u=!1,a,c;try{for(n=n.call(t);!(o=(a=n.next()).done)&&(e.push(a.value),!(r&&e.length===r));o=!0);}catch(d){u=!0,c=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(u)throw c}}return e}}function X(t){if(Array.isArray(t))return t}function R(t,r){if(t==null)return{};var n=Y(t,r),e,o;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(o=0;o<u.length;o++)e=u[o],!(r.indexOf(e)>=0)&&Object.prototype.propertyIsEnumerable.call(t,e)&&(n[e]=t[e])}return n}function Y(t,r){if(t==null)return{};var n={},e=Object.keys(t),o,u;for(u=0;u<e.length;u++)o=e[u],!(r.indexOf(o)>=0)&&(n[o]=t[o]);return n}function Z(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function tt(t,r){for(var n=0;n<r.length;n++){var e=r[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function rt(t,r,n){return r&&tt(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function et(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&g(t,r)}function g(t,r){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},g(t,r)}function nt(t){var r=ut();return function(){var n=b(t),e;if(r){var o=b(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return ot(this,e)}}function ot(t,r){if(r&&(v(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(t)}function y(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ut(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},b(t)}function h(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}var B=function(t){et(n,t);var r=nt(n);function n(){var e;Z(this,n);for(var o=arguments.length,u=new Array(o),a=0;a<o;a++)u[a]=arguments[a];return e=r.call.apply(r,[this].concat(u)),h(y(e),"state",{isFocused:e.props.autoFocus||!1}),h(y(e),"onFocus",function(c){e.setState({isFocused:!0}),e.props.onFocus(c)}),h(y(e),"onBlur",function(c){e.setState({isFocused:!1}),e.props.onBlur(c)}),e}return rt(n,[{key:"render",value:function(){var e=this.props,o=e.startEnhancer,u=e.endEnhancer,a=e.overrides,c=a.Root,d=a.StartEnhancer,x=a.EndEnhancer,A=R(a,J),I=R(e,K),T=m(c,V),j=O(T,2),$=j[0],C=j[1],k=m(d,P),w=O(k,2),q=w[0],z=w[1],D=m(x,P),E=O(D,2),M=E[0],Q=E[1],s=G(this.props,this.state);return f.createElement($,i({"data-baseweb":"input"},s,C,{$adjoined:_(o,u),$hasIconTrailing:this.props.clearable||this.props.type=="password"}),l(o)&&f.createElement(q,i({},s,z,{$position:S.start}),typeof o=="function"?o(s):o),f.createElement(H,i({},I,{overrides:A,adjoined:_(o,u),onFocus:this.onFocus,onBlur:this.onBlur})),l(u)&&f.createElement(M,i({},s,Q,{$position:S.end}),typeof u=="function"?u(s):u))}}]),n}(f.Component);h(B,"defaultProps",{autoComplete:"on",autoFocus:!1,disabled:!1,name:"",onBlur:function(){},onFocus:function(){},overrides:{},required:!1,size:U.default,startEnhancer:null,endEnhancer:null,clearable:!1,type:"text",readOnly:!1});function _(t,r){return l(t)&&l(r)?p.both:l(t)?p.left:l(r)?p.right:p.none}function l(t){return!!(t||t===0)}export{B as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,e as y}from"./es6-
|
|
1
|
+
import{c as p,e as y}from"./es6-Ca0BcWDW.js";import"./index-Cbvbjd8C.js";const{File:r,Blob:_,DOMException:s}=p,{INVALID:z,GONE:n,MISMATCH:f,MOD_ERR:m,SYNTAX:w,SECURITY:A,DISALLOWED:b}=y;class c{constructor(i,e){this.fileHandle=i,this.file=e,this.size=e.size,this.position=0}write(i){let e=this.file;if(typeof i=="object"){if(i.type==="write"){if(Number.isInteger(i.position)&&i.position>=0&&(this.position=i.position,this.size<i.position&&(this.file=new r([this.file,new ArrayBuffer(i.position-this.size)],this.file.name,this.file))),!("data"in i))throw new s(...w("write requires a data argument"));i=i.data}else if(i.type==="seek")if(Number.isInteger(i.position)&&i.position>=0){if(this.size<i.position)throw new s(...z);this.position=i.position;return}else throw new s(...w("seek requires a position argument"));else if(i.type==="truncate")if(Number.isInteger(i.size)&&i.size>=0){e=i.size<this.size?new r([e.slice(0,i.size)],e.name,e):new r([e,new Uint8Array(i.size-this.size)],e.name),this.size=e.size,this.position>e.size&&(this.position=e.size),this.file=e;return}else throw new s(...w("truncate requires a size argument"))}i=new _([i]);let t=this.file;const o=t.slice(0,this.position),u=t.slice(this.position+i.size);let a=this.position-o.size;a<0&&(a=0),t=new r([o,new Uint8Array(a),i,u],t.name),this.size=t.size,this.position+=i.size,this.file=t}close(){if(this.fileHandle._deleted)throw new s(...n);this.fileHandle._file=this.file,this.file=this.position=this.size=null,this.fileHandle.onclose&&this.fileHandle.onclose(this.fileHandle)}}class h{constructor(i="",e=new r([],i),t=!0){this._file=e,this.name=i,this.kind="file",this._deleted=!1,this.writable=t,this.readable=!0}async getFile(){if(this._deleted)throw new s(...n);return this._file}async createWritable(i){if(!this.writable)throw new s(...b);if(this._deleted)throw new s(...n);const e=i.keepExistingData?await this.getFile():new r([],this.name);return new c(this,e)}async isSameEntry(i){return this===i}async _destroy(){this._deleted=!0,this._file=null}}class l{constructor(i,e=!0){this.name=i,this.kind="directory",this._deleted=!1,this._entries={},this.writable=e,this.readable=!0}async*entries(){if(this._deleted)throw new s(...n);yield*Object.entries(this._entries)}async isSameEntry(i){return this===i}async getDirectoryHandle(i,e){if(this._deleted)throw new s(...n);const t=this._entries[i];if(t){if(t instanceof h)throw new s(...f);return t}else{if(e.create)return this._entries[i]=new l(i);throw new s(...n)}}async getFileHandle(i,e){const t=this._entries[i],o=t instanceof h;if(t&&o)return t;if(t&&!o)throw new s(...f);if(!t&&!e.create)throw new s(...n);if(!t&&e.create)return this._entries[i]=new h(i)}async removeEntry(i,e){const t=this._entries[i];if(!t)throw new s(...n);await t._destroy(e.recursive),delete this._entries[i]}async _destroy(i){for(let e of Object.values(this._entries)){if(!i)throw new s(...m);await e._destroy(i)}this._entries={},this._deleted=!0}}const g=new l(""),H=()=>g;export{h as FileHandle,l as FolderHandle,c as Sink,H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bh as e,bi as f,g as m}from"./index-
|
|
1
|
+
import{bh as e,bi as f,g as m}from"./index-Cbvbjd8C.js";var r,a;function v(){if(a)return r;a=1;var t=e(),n=f(),i=n(function(o,s,u,c){t(o,s,u,c)});return r=i,r}var b=v();const h=m(b);export{h as m};
|
package/build/assets/{number-overlay-editor-DmP64vrs.js → number-overlay-editor-Dm8-09pg.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as Q,r as T}from"./index-CVPZJuoC.js";import{s as Ie}from"./index-h6PFbOmO.js";import"./FormClearHelper-DI9KwuTl.js";import"./withFullScreenWrapper-DBlEST2L.js";import"./Toolbar-1r13KE9d.js";import"./checkbox-COr-UunX.js";import"./mergeWith-DdD-5zWL.js";import"./sprintf-D7DtBTRn.js";import"./createDownloadLinkElement-DZMwyjvU.js";import"./slicedToArray-CNrowD0v.js";import"./inherits-DtR6i4OG.js";import"./createSuper-BD8Om4of.js";import"./FileDownload.esm-DNaG7mhy.js";const Re=Ie("div")({name:"NumberOverlayEditorStyle",class:"gdg-n15fjm3e",propsAsIs:!1});function se(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var X;(function(e){e.event="event",e.props="prop"})(X||(X={}));function G(){}function Ae(e){var t,r=void 0;return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t&&n.length===t.length&&n.every(function(u,l){return u===t[l]})||(t=n,r=e.apply(void 0,n)),r}}function ee(e){return!!(e||"").match(/\d/)}function Z(e){return e==null}function je(e){return typeof e=="number"&&isNaN(e)}function ce(e){return Z(e)||je(e)||typeof e=="number"&&!isFinite(e)}function fe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Te(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Fe(e,t,r){var n=Te(r),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}function Be(e){var t=T.useRef(e);t.current=e;var r=T.useRef(function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t.current.apply(t,n)});return r.current}function oe(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var a=e.split("."),u=a[0],l=a[1]||"";return{beforeDecimal:u,afterDecimal:l,hasNegation:r,addNegation:n}}function Me(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(t?"-":"")+n+(a?"."+a:"")}function ve(e,t,r){for(var n="",a=r?"0":"",u=0;u<=t-1;u++)n+=e[u]||a;return n}function de(e,t){return Array(t+1).join(e)}function me(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),a=n[0],u=n[1];if(u=Number(u),!u)return r+a;a=a.replace(".","");var l=1+u,g=a.length;return l<0?a="0."+de("0",Math.abs(l))+a:l>=g?a=a+de("0",l-g):a=(a.substring(0,l)||"0")+"."+a.substring(l),r+a}function ge(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,a=oe(e),u=a.beforeDecimal,l=a.afterDecimal,g=a.hasNegation,S=parseFloat("0."+(l||"0")),y=l.length<=t?"0."+l:S.toFixed(t),p=y.split("."),d=u.split("").reverse().reduce(function(w,O,m){return w.length>m?(Number(w[0])+Number(O)).toString()+w.substring(1,w.length):O+w},p[0]),h=ve(p[1]||"",t,r),b=g?"-":"",v=n?".":"";return""+b+d+v+h}function z(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var pe=Ae(function(e,t){for(var r=0,n=0,a=e.length,u=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[u-1-n]&&u-n>r&&a-n>r;)n++;return{from:{start:r,end:a-n},to:{start:r,end:u-n}}});function Pe(e,t,r){return Math.min(Math.max(e,t),r)}function ie(e){return Math.max(e.selectionStart,e.selectionEnd)}function ke(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Le(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function We(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function Ke(e,t,r,n,a,u,l){l===void 0&&(l=We);var g=a.findIndex(function(W){return W}),S=e.slice(0,g);!t&&!r.startsWith(S)&&(t=S,r=S+r,n=n+S.length);for(var y=r.length,p=e.length,d={},h=new Array(y),b=0;b<y;b++){h[b]=-1;for(var v=0,w=p;v<w;v++){var O=l({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:v});if(O&&d[v]!==!0){h[b]=v,d[v]=!0;break}}}for(var m=n;m<y&&(h[m]===-1||!u(r[m]));)m++;var F=m===y||h[m]===-1?p:h[m];for(m=n-1;m>0&&h[m]===-1;)m--;var M=m===-1||h[m]===-1?0:h[m]+1;return M>F?F:n-M<F-n?M:F}function he(e,t,r,n){var a=e.length;if(t=Pe(t,0,a),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=a&&!r[t];)t++;t>a&&(t=r.lastIndexOf(!0))}return t===-1&&(t=a),t}function Ue(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(ee(e[r])||ee(e[r-1]));return t}function Se(e,t,r,n,a,u){u===void 0&&(u=G);var l=Be(function(v,w){var O,m;return ce(v)?(m="",O=""):typeof v=="number"||w?(m=typeof v=="number"?me(v):v,O=n(m)):(m=a(v,void 0),O=n(m)),{formattedValue:O,numAsString:m}}),g=T.useState(function(){return l(Z(e)?t:e,r)}),S=g[0],y=g[1],p=function(v,w){v.formattedValue!==S.formattedValue&&y({formattedValue:v.formattedValue,numAsString:v.value}),u(v,w)},d=e,h=r;Z(e)&&(d=S.numAsString,h=!0);var b=l(d,h);return T.useMemo(function(){y(b)},[b.formattedValue]),[S,p]}function Ge(e){return e.replace(/[^0-9]/g,"")}function _e(e){return e}function $e(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,a=e.renderText,u=e.getInputRef,l=e.format;l===void 0&&(l=_e);var g=e.removeFormatting;g===void 0&&(g=Ge);var S=e.defaultValue,y=e.valueIsNumericString,p=e.onValueChange,d=e.isAllowed,h=e.onChange;h===void 0&&(h=G);var b=e.onKeyDown;b===void 0&&(b=G);var v=e.onMouseUp;v===void 0&&(v=G);var w=e.onFocus;w===void 0&&(w=G);var O=e.onBlur;O===void 0&&(O=G);var m=e.value,F=e.getCaretBoundary;F===void 0&&(F=Ue);var M=e.isValidInputCharacter;M===void 0&&(M=ee);var W=e.isCharacterSame,P=se(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),_=Se(m,S,!!y,l,g,p),K=_[0],V=K.formattedValue,k=K.numAsString,$=_[1],L=T.useRef({formattedValue:V,numAsString:k}),J=function(o,i){L.current={formattedValue:o.formattedValue,numAsString:o.value},$(o,i)},U=T.useState(!1),q=U[0],H=U[1],s=T.useRef(null),c=T.useRef({setCaretTimeout:null,focusTimeout:null});T.useEffect(function(){return H(!0),function(){clearTimeout(c.current.setCaretTimeout),clearTimeout(c.current.focusTimeout)}},[]);var R=l,N=function(o,i){var f=parseFloat(i);return{formattedValue:o,value:i,floatValue:isNaN(f)?void 0:f}},D=function(o,i,f){o.selectionStart===0&&o.selectionEnd===o.value.length||(z(o,i),c.current.setCaretTimeout=setTimeout(function(){o.value===f&&o.selectionStart!==o.selectionEnd&&z(o,i)},0))},E=function(o,i,f){return he(o,i,F(o),f)},B=function(o,i,f){var A=F(i),C=Ke(i,V,o,f,A,M,W);return C=he(i,C,A),C},te=function(o){var i=o.formattedValue;i===void 0&&(i="");var f=o.input,A=o.setCaretPosition,C=o.source,x=o.event,I=o.numAsString,j=o.caretPos;if(f){if(j===void 0&&A){var Y=o.inputValue||f.value,ue=ie(f);f.value=i,j=B(Y,i,ue)}f.value=i,j!==void 0&&D(f,j,i)}i!==V&&J(N(i,I),{event:x,source:C})};T.useEffect(function(){var o=L.current,i=o.formattedValue,f=o.numAsString;V!==i&&(V!==k||i!==f)&&J(N(V,k),{event:void 0,source:X.props})},[V,k]);var ne=s.current?ie(s.current):void 0,re=typeof window<"u"?T.useLayoutEffect:T.useEffect;re(function(){var o=s.current;if(V!==L.current.formattedValue&&o){var i=B(L.current.formattedValue,V,ne);o.value=V,D(o,i,V)}},[V]);var Ve=function(o,i,f){var A=pe(V,o),C=Object.assign(Object.assign({},A),{lastValue:V}),x=g(o,C),I=R(x);if(x=g(I,void 0),d&&!d(N(I,x))){var j=i.target,Y=ie(j),ue=B(o,V,Y);return j.value=V,D(j,ue,V),!1}return te({formattedValue:I,numAsString:x,inputValue:o,event:i,source:f,setCaretPosition:!0,input:i.target}),!0},xe=function(o){var i=o.target,f=i.value,A=Ve(f,o,X.event);A&&h(o)},we=function(o){var i=o.target,f=o.key,A=i.selectionStart,C=i.selectionEnd,x=i.value;x===void 0&&(x="");var I;if(f==="ArrowLeft"||f==="Backspace"?I=Math.max(A-1,0):f==="ArrowRight"?I=Math.min(A+1,x.length):f==="Delete"&&(I=A),I===void 0||A!==C){b(o);return}var j=I;if(f==="ArrowLeft"||f==="ArrowRight"){var Y=f==="ArrowLeft"?"left":"right";j=E(x,I,Y),j!==I&&o.preventDefault()}else f==="Delete"&&!M(x[I])?j=E(x,I,"right"):f==="Backspace"&&!M(x[I])&&(j=E(x,I,"left"));j!==I&&D(i,j,x),o.isUnitTestRun&&D(i,j,x),b(o)},Oe=function(o){var i=o.target,f=i.selectionStart,A=i.selectionEnd,C=i.value;if(C===void 0&&(C=""),f===A){var x=E(C,f);x!==f&&D(i,x,C)}v(o)},Ne=function(o){o.persist&&o.persist();var i=o.target;s.current=i,c.current.focusTimeout=setTimeout(function(){var f=i.selectionStart,A=i.selectionEnd,C=i.value;C===void 0&&(C="");var x=E(C,f);x!==f&&!(f===0&&A===C.length)&&D(i,x,C),w(o)},0)},De=function(o){s.current=null,clearTimeout(c.current.focusTimeout),clearTimeout(c.current.setCaretTimeout),O(o)},Ce=q&&ke()?"numeric":void 0,le=Object.assign({inputMode:Ce},P,{type:t,value:V,onChange:xe,onKeyDown:we,onMouseUp:Oe,onFocus:Ne,onBlur:De});if(r==="text")return a?Q.createElement(Q.Fragment,null,a(V,P)||null):Q.createElement("span",Object.assign({},P,{ref:u}),V);if(n){var Ee=n;return Q.createElement(Ee,Object.assign({},le,{ref:u}))}return Q.createElement("input",Object.assign({},le,{ref:u}))}function be(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var u=t.suffix;u===void 0&&(u="");var l=t.allowNegative,g=t.thousandsGroupStyle;if(g===void 0&&(g="thousand"),e===""||e==="-")return e;var S=ae(t),y=S.thousandSeparator,p=S.decimalSeparator,d=r!==0&&e.indexOf(".")!==-1||r&&n,h=oe(e,l),b=h.beforeDecimal,v=h.afterDecimal,w=h.addNegation;return r!==void 0&&(v=ve(v,r,!!n)),y&&(b=Fe(b,y,g)),a&&(b=a+b),u&&(v=v+u),w&&(b="-"+b),e=b+(d&&p||"")+v,e}function ae(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function ze(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),u=n.test(e);return e=e.replace(/-/g,""),a&&!u&&t&&(e="-"+e),e}function Je(e,t){return new RegExp("(^-)|[0-9]|"+fe(e),"g")}function Qe(e,t,r){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(r!=null&&r.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function Ze(e,t,r){var n;t===void 0&&(t=Le(e));var a=r.allowNegative,u=r.prefix;u===void 0&&(u="");var l=r.suffix;l===void 0&&(l="");var g=r.decimalScale,S=t.from,y=t.to,p=y.start,d=y.end,h=ae(r),b=h.allowedDecimalSeparators,v=h.decimalSeparator,w=e[d]===v;if(ee(e)&&(e===u||e===l)&&t.lastValue==="")return e;if(d-p===1&&b.indexOf(e[p])!==-1){var O=g===0?"":v;e=e.substring(0,p)+O+e.substring(p+1,e.length)}var m=function(c,R,N){var D=!1,E=!1;u.startsWith("-")?D=!1:c.startsWith("--")?(D=!1,E=!0):l.startsWith("-")&&c.length===l.length?D=!1:c[0]==="-"&&(D=!0);var B=D?1:0;return E&&(B=2),B&&(c=c.substring(B),R-=B,N-=B),{value:c,start:R,end:N,hasNegation:D}},F=m(e,p,d),M=F.hasNegation;n=F,e=n.value,p=n.start,d=n.end;var W=m(t.lastValue,S.start,S.end),P=W.start,_=W.end,K=W.value,V=e.substring(p,d);e.length&&K.length&&(P>K.length-l.length||_<u.length)&&!(V&&l.startsWith(V))&&(e=K);var k=0;e.startsWith(u)?k+=u.length:p<u.length&&(k=p),e=e.substring(k),d-=k;var $=e.length,L=e.length-l.length;e.endsWith(l)?$=L:(d>L||d>e.length-l.length)&&($=d),e=e.substring(0,$),e=ze(M?"-"+e:e,a),e=(e.match(Je(v))||[]).join("");var J=e.indexOf(v);e=e.replace(new RegExp(fe(v),"g"),function(c,R){return R===J?".":""});var U=oe(e,a),q=U.beforeDecimal,H=U.afterDecimal,s=U.addNegation;return y.end-y.start<S.end-S.start&&q===""&&w&&!parseFloat(H)&&(e=s?"-":""),e}function qe(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var a=Array.from({length:e.length+1}).map(function(){return!0}),u=e[0]==="-";a.fill(!1,0,r.length+(u?1:0));var l=e.length;return a.fill(!1,l-n.length+1,l+1),a}function He(e){var t=ae(e),r=t.thousandSeparator,n=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var u=e.allowNegative;if(u===void 0&&(u=!0),r===n)throw new Error(`
|
|
1
|
+
import{R as Q,r as T}from"./index-Cbvbjd8C.js";import{s as Ie}from"./index-Bcsdrj2S.js";import"./FormClearHelper-CT0Jwp4X.js";import"./withFullScreenWrapper-D8NJOCKn.js";import"./Toolbar-DlGOP7h4.js";import"./checkbox-CGvNPQQ1.js";import"./mergeWith-Bt-C9xRx.js";import"./sprintf-D7DtBTRn.js";import"./createDownloadLinkElement-DZMwyjvU.js";import"./slicedToArray-CEuyIGI5.js";import"./inherits-BaopKHev.js";import"./createSuper-B8yCxQGq.js";import"./FileDownload.esm-CbXaPbiH.js";const Re=Ie("div")({name:"NumberOverlayEditorStyle",class:"gdg-n15fjm3e",propsAsIs:!1});function se(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var X;(function(e){e.event="event",e.props="prop"})(X||(X={}));function G(){}function Ae(e){var t,r=void 0;return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t&&n.length===t.length&&n.every(function(u,l){return u===t[l]})||(t=n,r=e.apply(void 0,n)),r}}function ee(e){return!!(e||"").match(/\d/)}function Z(e){return e==null}function je(e){return typeof e=="number"&&isNaN(e)}function ce(e){return Z(e)||je(e)||typeof e=="number"&&!isFinite(e)}function fe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Te(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function Fe(e,t,r){var n=Te(r),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(n,"$1"+t)}function Be(e){var t=T.useRef(e);t.current=e;var r=T.useRef(function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];return t.current.apply(t,n)});return r.current}function oe(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var a=e.split("."),u=a[0],l=a[1]||"";return{beforeDecimal:u,afterDecimal:l,hasNegation:r,addNegation:n}}function Me(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",a=r[1]||"";return(t?"-":"")+n+(a?"."+a:"")}function ve(e,t,r){for(var n="",a=r?"0":"",u=0;u<=t-1;u++)n+=e[u]||a;return n}function de(e,t){return Array(t+1).join(e)}function me(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),a=n[0],u=n[1];if(u=Number(u),!u)return r+a;a=a.replace(".","");var l=1+u,g=a.length;return l<0?a="0."+de("0",Math.abs(l))+a:l>=g?a=a+de("0",l-g):a=(a.substring(0,l)||"0")+"."+a.substring(l),r+a}function ge(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,a=oe(e),u=a.beforeDecimal,l=a.afterDecimal,g=a.hasNegation,S=parseFloat("0."+(l||"0")),y=l.length<=t?"0."+l:S.toFixed(t),p=y.split("."),d=u.split("").reverse().reduce(function(w,O,m){return w.length>m?(Number(w[0])+Number(O)).toString()+w.substring(1,w.length):O+w},p[0]),h=ve(p[1]||"",t,r),b=g?"-":"",v=n?".":"";return""+b+d+v+h}function z(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var pe=Ae(function(e,t){for(var r=0,n=0,a=e.length,u=t.length;e[r]===t[r]&&r<a;)r++;for(;e[a-1-n]===t[u-1-n]&&u-n>r&&a-n>r;)n++;return{from:{start:r,end:a-n},to:{start:r,end:u-n}}});function Pe(e,t,r){return Math.min(Math.max(e,t),r)}function ie(e){return Math.max(e.selectionStart,e.selectionEnd)}function ke(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function Le(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function We(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,a=e.formattedValueIndex;return t[n]===r[a]}function Ke(e,t,r,n,a,u,l){l===void 0&&(l=We);var g=a.findIndex(function(W){return W}),S=e.slice(0,g);!t&&!r.startsWith(S)&&(t=S,r=S+r,n=n+S.length);for(var y=r.length,p=e.length,d={},h=new Array(y),b=0;b<y;b++){h[b]=-1;for(var v=0,w=p;v<w;v++){var O=l({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:v});if(O&&d[v]!==!0){h[b]=v,d[v]=!0;break}}}for(var m=n;m<y&&(h[m]===-1||!u(r[m]));)m++;var F=m===y||h[m]===-1?p:h[m];for(m=n-1;m>0&&h[m]===-1;)m--;var M=m===-1||h[m]===-1?0:h[m]+1;return M>F?F:n-M<F-n?M:F}function he(e,t,r,n){var a=e.length;if(t=Pe(t,0,a),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=a&&!r[t];)t++;t>a&&(t=r.lastIndexOf(!0))}return t===-1&&(t=a),t}function Ue(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(ee(e[r])||ee(e[r-1]));return t}function Se(e,t,r,n,a,u){u===void 0&&(u=G);var l=Be(function(v,w){var O,m;return ce(v)?(m="",O=""):typeof v=="number"||w?(m=typeof v=="number"?me(v):v,O=n(m)):(m=a(v,void 0),O=n(m)),{formattedValue:O,numAsString:m}}),g=T.useState(function(){return l(Z(e)?t:e,r)}),S=g[0],y=g[1],p=function(v,w){v.formattedValue!==S.formattedValue&&y({formattedValue:v.formattedValue,numAsString:v.value}),u(v,w)},d=e,h=r;Z(e)&&(d=S.numAsString,h=!0);var b=l(d,h);return T.useMemo(function(){y(b)},[b.formattedValue]),[S,p]}function Ge(e){return e.replace(/[^0-9]/g,"")}function _e(e){return e}function $e(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,a=e.renderText,u=e.getInputRef,l=e.format;l===void 0&&(l=_e);var g=e.removeFormatting;g===void 0&&(g=Ge);var S=e.defaultValue,y=e.valueIsNumericString,p=e.onValueChange,d=e.isAllowed,h=e.onChange;h===void 0&&(h=G);var b=e.onKeyDown;b===void 0&&(b=G);var v=e.onMouseUp;v===void 0&&(v=G);var w=e.onFocus;w===void 0&&(w=G);var O=e.onBlur;O===void 0&&(O=G);var m=e.value,F=e.getCaretBoundary;F===void 0&&(F=Ue);var M=e.isValidInputCharacter;M===void 0&&(M=ee);var W=e.isCharacterSame,P=se(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),_=Se(m,S,!!y,l,g,p),K=_[0],V=K.formattedValue,k=K.numAsString,$=_[1],L=T.useRef({formattedValue:V,numAsString:k}),J=function(o,i){L.current={formattedValue:o.formattedValue,numAsString:o.value},$(o,i)},U=T.useState(!1),q=U[0],H=U[1],s=T.useRef(null),c=T.useRef({setCaretTimeout:null,focusTimeout:null});T.useEffect(function(){return H(!0),function(){clearTimeout(c.current.setCaretTimeout),clearTimeout(c.current.focusTimeout)}},[]);var R=l,N=function(o,i){var f=parseFloat(i);return{formattedValue:o,value:i,floatValue:isNaN(f)?void 0:f}},D=function(o,i,f){o.selectionStart===0&&o.selectionEnd===o.value.length||(z(o,i),c.current.setCaretTimeout=setTimeout(function(){o.value===f&&o.selectionStart!==o.selectionEnd&&z(o,i)},0))},E=function(o,i,f){return he(o,i,F(o),f)},B=function(o,i,f){var A=F(i),C=Ke(i,V,o,f,A,M,W);return C=he(i,C,A),C},te=function(o){var i=o.formattedValue;i===void 0&&(i="");var f=o.input,A=o.setCaretPosition,C=o.source,x=o.event,I=o.numAsString,j=o.caretPos;if(f){if(j===void 0&&A){var Y=o.inputValue||f.value,ue=ie(f);f.value=i,j=B(Y,i,ue)}f.value=i,j!==void 0&&D(f,j,i)}i!==V&&J(N(i,I),{event:x,source:C})};T.useEffect(function(){var o=L.current,i=o.formattedValue,f=o.numAsString;V!==i&&(V!==k||i!==f)&&J(N(V,k),{event:void 0,source:X.props})},[V,k]);var ne=s.current?ie(s.current):void 0,re=typeof window<"u"?T.useLayoutEffect:T.useEffect;re(function(){var o=s.current;if(V!==L.current.formattedValue&&o){var i=B(L.current.formattedValue,V,ne);o.value=V,D(o,i,V)}},[V]);var Ve=function(o,i,f){var A=pe(V,o),C=Object.assign(Object.assign({},A),{lastValue:V}),x=g(o,C),I=R(x);if(x=g(I,void 0),d&&!d(N(I,x))){var j=i.target,Y=ie(j),ue=B(o,V,Y);return j.value=V,D(j,ue,V),!1}return te({formattedValue:I,numAsString:x,inputValue:o,event:i,source:f,setCaretPosition:!0,input:i.target}),!0},xe=function(o){var i=o.target,f=i.value,A=Ve(f,o,X.event);A&&h(o)},we=function(o){var i=o.target,f=o.key,A=i.selectionStart,C=i.selectionEnd,x=i.value;x===void 0&&(x="");var I;if(f==="ArrowLeft"||f==="Backspace"?I=Math.max(A-1,0):f==="ArrowRight"?I=Math.min(A+1,x.length):f==="Delete"&&(I=A),I===void 0||A!==C){b(o);return}var j=I;if(f==="ArrowLeft"||f==="ArrowRight"){var Y=f==="ArrowLeft"?"left":"right";j=E(x,I,Y),j!==I&&o.preventDefault()}else f==="Delete"&&!M(x[I])?j=E(x,I,"right"):f==="Backspace"&&!M(x[I])&&(j=E(x,I,"left"));j!==I&&D(i,j,x),o.isUnitTestRun&&D(i,j,x),b(o)},Oe=function(o){var i=o.target,f=i.selectionStart,A=i.selectionEnd,C=i.value;if(C===void 0&&(C=""),f===A){var x=E(C,f);x!==f&&D(i,x,C)}v(o)},Ne=function(o){o.persist&&o.persist();var i=o.target;s.current=i,c.current.focusTimeout=setTimeout(function(){var f=i.selectionStart,A=i.selectionEnd,C=i.value;C===void 0&&(C="");var x=E(C,f);x!==f&&!(f===0&&A===C.length)&&D(i,x,C),w(o)},0)},De=function(o){s.current=null,clearTimeout(c.current.focusTimeout),clearTimeout(c.current.setCaretTimeout),O(o)},Ce=q&&ke()?"numeric":void 0,le=Object.assign({inputMode:Ce},P,{type:t,value:V,onChange:xe,onKeyDown:we,onMouseUp:Oe,onFocus:Ne,onBlur:De});if(r==="text")return a?Q.createElement(Q.Fragment,null,a(V,P)||null):Q.createElement("span",Object.assign({},P,{ref:u}),V);if(n){var Ee=n;return Q.createElement(Ee,Object.assign({},le,{ref:u}))}return Q.createElement("input",Object.assign({},le,{ref:u}))}function be(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var u=t.suffix;u===void 0&&(u="");var l=t.allowNegative,g=t.thousandsGroupStyle;if(g===void 0&&(g="thousand"),e===""||e==="-")return e;var S=ae(t),y=S.thousandSeparator,p=S.decimalSeparator,d=r!==0&&e.indexOf(".")!==-1||r&&n,h=oe(e,l),b=h.beforeDecimal,v=h.afterDecimal,w=h.addNegation;return r!==void 0&&(v=ve(v,r,!!n)),y&&(b=Fe(b,y,g)),a&&(b=a+b),u&&(v=v+u),w&&(b="-"+b),e=b+(d&&p||"")+v,e}function ae(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function ze(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),a=r.test(e),u=n.test(e);return e=e.replace(/-/g,""),a&&!u&&t&&(e="-"+e),e}function Je(e,t){return new RegExp("(^-)|[0-9]|"+fe(e),"g")}function Qe(e,t,r){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(r!=null&&r.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function Ze(e,t,r){var n;t===void 0&&(t=Le(e));var a=r.allowNegative,u=r.prefix;u===void 0&&(u="");var l=r.suffix;l===void 0&&(l="");var g=r.decimalScale,S=t.from,y=t.to,p=y.start,d=y.end,h=ae(r),b=h.allowedDecimalSeparators,v=h.decimalSeparator,w=e[d]===v;if(ee(e)&&(e===u||e===l)&&t.lastValue==="")return e;if(d-p===1&&b.indexOf(e[p])!==-1){var O=g===0?"":v;e=e.substring(0,p)+O+e.substring(p+1,e.length)}var m=function(c,R,N){var D=!1,E=!1;u.startsWith("-")?D=!1:c.startsWith("--")?(D=!1,E=!0):l.startsWith("-")&&c.length===l.length?D=!1:c[0]==="-"&&(D=!0);var B=D?1:0;return E&&(B=2),B&&(c=c.substring(B),R-=B,N-=B),{value:c,start:R,end:N,hasNegation:D}},F=m(e,p,d),M=F.hasNegation;n=F,e=n.value,p=n.start,d=n.end;var W=m(t.lastValue,S.start,S.end),P=W.start,_=W.end,K=W.value,V=e.substring(p,d);e.length&&K.length&&(P>K.length-l.length||_<u.length)&&!(V&&l.startsWith(V))&&(e=K);var k=0;e.startsWith(u)?k+=u.length:p<u.length&&(k=p),e=e.substring(k),d-=k;var $=e.length,L=e.length-l.length;e.endsWith(l)?$=L:(d>L||d>e.length-l.length)&&($=d),e=e.substring(0,$),e=ze(M?"-"+e:e,a),e=(e.match(Je(v))||[]).join("");var J=e.indexOf(v);e=e.replace(new RegExp(fe(v),"g"),function(c,R){return R===J?".":""});var U=oe(e,a),q=U.beforeDecimal,H=U.afterDecimal,s=U.addNegation;return y.end-y.start<S.end-S.start&&q===""&&w&&!parseFloat(H)&&(e=s?"-":""),e}function qe(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var a=Array.from({length:e.length+1}).map(function(){return!0}),u=e[0]==="-";a.fill(!1,0,r.length+(u?1:0));var l=e.length;return a.fill(!1,l-n.length+1,l+1),a}function He(e){var t=ae(e),r=t.thousandSeparator,n=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var u=e.allowNegative;if(u===void 0&&(u=!0),r===n)throw new Error(`
|
|
2
2
|
Decimal separator can't be same as thousand separator.
|
|
3
3
|
thousandSeparator: `+r+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
4
4
|
decimalSeparator: `+n+` (default value for decimalSeparator is .)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l}from"./es6-
|
|
1
|
+
import{e as l}from"./es6-Ca0BcWDW.js";import"./index-Cbvbjd8C.js";const{DISALLOWED:h}=l;class w{constructor(e,t){this.writer=e,this.fileEntry=t}async write(e){if(typeof e=="object"){if(e.type==="write"){if(Number.isInteger(e.position)&&e.position>=0&&(this.writer.seek(e.position),this.writer.position!==e.position&&(await new Promise((t,i)=>{this.writer.onwriteend=t,this.writer.onerror=i,this.writer.truncate(e.position)}),this.writer.seek(e.position))),!("data"in e))throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. write requires a data argument","SyntaxError");e=e.data}else if(e.type==="seek")if(Number.isInteger(e.position)&&e.position>=0){if(this.writer.seek(e.position),this.writer.position!==e.position)throw new DOMException("seeking position failed","InvalidStateError");return}else throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. seek requires a position argument","SyntaxError");else if(e.type==="truncate")return new Promise(t=>{if(Number.isInteger(e.size)&&e.size>=0)this.writer.onwriteend=i=>t(),this.writer.truncate(e.size);else throw new DOMException("Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. truncate requires a size argument","SyntaxError")})}await new Promise((t,i)=>{this.writer.onwriteend=t,this.writer.onerror=i,this.writer.write(new Blob([e]))})}close(){return new Promise(this.fileEntry.file.bind(this.fileEntry))}}class a{constructor(e,t=!0){this.file=e,this.kind="file",this.writable=t,this.readable=!0}get name(){return this.file.name}isSameEntry(e){return this.file.toURL()===e.file.toURL()}getFile(){return new Promise(this.file.file.bind(this.file))}createWritable(e){if(!this.writable)throw new DOMException(...h);return new Promise((t,i)=>this.file.createWriter(r=>{e.keepExistingData===!1?(r.onwriteend=n=>t(new w(r,this.file)),r.truncate(0)):t(new w(r,this.file))},i))}}class s{constructor(e,t=!0){this.dir=e,this.writable=t,this.readable=!0,this.kind="directory",this.name=e.name}isSameEntry(e){return this.dir.fullPath===e.dir.fullPath}async*entries(){const e=this.dir.createReader(),t=await new Promise(e.readEntries.bind(e));for(const i of t)yield[i.name,i.isFile?new a(i,this.writable):new s(i,this.writable)]}getDirectoryHandle(e,t){return new Promise((i,r)=>{this.dir.getDirectory(e,t,n=>{i(new s(n))},r)})}getFileHandle(e,t){return new Promise((i,r)=>this.dir.getFile(e,t,n=>i(new a(n)),r))}async removeEntry(e,t){const i=await this.getDirectoryHandle(e,{create:!1}).catch(r=>r.name==="TypeMismatchError"?this.getFileHandle(e,{create:!1}):r);if(i instanceof Error)throw i;return new Promise((r,n)=>{i instanceof s?t.recursive?i.dir.removeRecursively(()=>r(),n):i.dir.remove(()=>r(),n):i.file&&i.file.remove(()=>r(),n)})}}const d=(o={})=>new Promise((e,t)=>window.webkitRequestFileSystem(o._persistent,0,i=>e(new s(i.root)),t));export{a as FileHandle,s as FolderHandle,d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as a,E as y,_ as d,bx as h}from"./index-
|
|
1
|
+
import{r as a,E as y,_ as d,bx as h}from"./index-Cbvbjd8C.js";var s=a.forwardRef(function(r,e){var t={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return a.createElement(y,d({iconAttrs:t,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},r,{ref:e}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),a.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))});s.displayName="Close";function b(r){if(Array.isArray(r))return r}function p(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var i,u,f,l,o=[],n=!0,c=!1;try{if(f=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;n=!1}else for(;!(n=(i=f.call(t)).done)&&(o.push(i.value),o.length!==e);n=!0);}catch(m){c=!0,u=m}finally{try{if(!n&&t.return!=null&&(l=t.return(),Object(l)!==l))return}finally{if(c)throw u}}return o}}function v(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w(r,e){return b(r)||p(r,e)||h(r,e)||v()}export{s as C,w as _};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c1 as b,c2 as x,cu as $,r as d,cQ as F,cR as T}from"./index-
|
|
1
|
+
import{c1 as b,c2 as x,cu as $,r as d,cQ as F,cR as T}from"./index-Cbvbjd8C.js";import{g as R,a as A,b as E,B as z}from"./base-input-BnIlcFzX.js";function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j(Object(r),!0).forEach(function(n){B(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var m=b("div",function(e){return c(c({},R(c(c({$positive:!1},e),{},{$hasIconTrailing:!1}))),{},{width:e.$resize?"fit-content":"100%"})});m.displayName="StyledTextAreaRoot",m.displayName="StyledTextAreaRoot";var h=b("div",function(e){return A(c({$positive:!1},e))});h.displayName="StyledTextareaContainer",h.displayName="StyledTextareaContainer";var v=b("textarea",function(e){return c(c({},E(e)),{},{resize:e.$resize||"none"})});v.displayName="StyledTextarea",v.displayName="StyledTextarea";function O(e){"@babel/helpers - typeof";return O=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},O(e)}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}function _(e,t){return N(e)||I(e,t)||D(e,t)||C()}function C(){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 D(e,t){if(e){if(typeof e=="string")return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return w(e,t)}}function w(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function I(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,u=!1,i,a;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(y){u=!0,a=y}finally{try{!o&&r.return!=null&&r.return()}finally{if(u)throw a}}return n}}function N(e){if(Array.isArray(e))return e}function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function k(e,t,r){return t&&K(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function U(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(r,n){return r.__proto__=n,r},g(e,t)}function M(e){var t=H();return function(){var r=f(e),n;if(t){var o=f(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Q(this,n)}}function Q(e,t){if(t&&(O(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H(){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 f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(e)}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var P=function(e){U(r,e);var t=M(r);function r(){var n;q(this,r);for(var o=arguments.length,u=new Array(o),i=0;i<o;i++)u[i]=arguments[i];return n=t.call.apply(t,[this].concat(u)),p(l(n),"state",{isFocused:n.props.autoFocus||!1}),p(l(n),"onFocus",function(a){n.setState({isFocused:!0}),n.props.onFocus(a)}),p(l(n),"onBlur",function(a){n.setState({isFocused:!1}),n.props.onBlur(a)}),n}return k(r,[{key:"render",value:function(){var n=this.props.overrides,o=n===void 0?{}:n,u=x(o.Root,m),i=_(u,2),a=i[0],y=i[1],S=$({Input:{component:v},InputContainer:{component:h}},o);return d.createElement(a,s({"data-baseweb":"textarea",$isFocused:this.state.isFocused,$isReadOnly:this.props.readOnly,$disabled:this.props.disabled,$error:this.props.error,$positive:this.props.positive,$required:this.props.required,$resize:this.props.resize},y),d.createElement(z,s({},this.props,{type:T.textarea,overrides:S,onFocus:this.onFocus,onBlur:this.onBlur,resize:this.props.resize})))}}]),r}(d.Component);p(P,"defaultProps",{autoFocus:!1,disabled:!1,readOnly:!1,error:!1,name:"",onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){},onFocus:function(){},overrides:{},placeholder:"",required:!1,rows:3,size:F.default});export{P as T};
|