mirror of
https://github.com/owncast/owncast.git
synced 2024-12-23 09:40:49 +03:00
1 line
No EOL
16 KiB
JavaScript
Vendored
1 line
No EOL
16 KiB
JavaScript
Vendored
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9915],{79915:function(e,t,n){n.d(t,{Z:function(){return K}});var r=n(87462),a=n(4942),i=n(71002),u=n(97685),c=n(80882),o=n(1413),l=n(67294),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},f=n(42135),d=function(e,t){return l.createElement(f.Z,(0,o.Z)((0,o.Z)({},e),{},{ref:t,icon:s}))};d.displayName="UpOutlined";var m=l.forwardRef(d),v=n(94184),p=n.n(v),g=n(45987),h=n(15105),N=n(8410),b=n(42550),S=n(15671),y=n(43144);function E(){return"function"==typeof BigInt}function w(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),(t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(t="0".concat(t));var r=t||"0",a=r.split("."),i=a[0]||"0",u=a[1]||"0";"0"===i&&"0"===u&&(n=!1);var c=n?"-":"";return{negative:n,negativeStr:c,trimStr:r,integerStr:i,decimalStr:u,fullStr:"".concat(c).concat(r)}}function Z(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function I(e){var t=String(e);if(Z(e)){var n=Number(t.slice(t.indexOf("e-")+2)),r=t.match(/\.(\d+)/);return(null==r?void 0:r[1])&&(n+=r[1].length),n}return t.includes(".")&&k(t)?t.length-t.indexOf(".")-1:0}function x(e){var t=String(e);if(Z(e)){if(e>Number.MAX_SAFE_INTEGER)return String(E()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e<Number.MIN_SAFE_INTEGER)return String(E()?BigInt(e).toString():Number.MIN_SAFE_INTEGER);t=e.toFixed(I(t))}return w(t).fullStr}function k(e){return"number"==typeof e?!Number.isNaN(e):!!e&&(/^\s*-?\d+(\.\d+)?\s*$/.test(e)||/^\s*-?\d+\.\s*$/.test(e)||/^\s*-?\.\d+\s*$/.test(e))}function M(e){var t="number"==typeof e?x(e):w(e).fullStr;return t.includes(".")?w(t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:e+"0"}var R=function(){function e(t){if((0,S.Z)(this,e),this.origin="",this.number=void 0,this.empty=void 0,!t&&0!==t||!String(t).trim()){this.empty=!0;return}this.origin=String(t),this.number=Number(t)}return(0,y.Z)(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=Number(t);if(Number.isNaN(n))return this;var r=this.number+n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r<Number.MIN_SAFE_INTEGER)return new e(Number.MIN_SAFE_INTEGER);var a=Math.max(I(this.number),I(n));return new e(r.toFixed(a))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toNumber()===(null==e?void 0:e.toNumber())}},{key:"lessEquals",value:function(e){return 0>=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":x(this.number):this.origin}}]),e}(),C=function(){function e(t){if((0,S.Z)(this,e),this.origin="",this.negative=void 0,this.integer=void 0,this.decimal=void 0,this.decimalLen=void 0,this.empty=void 0,this.nan=void 0,!t&&0!==t||!String(t).trim()){this.empty=!0;return}if(this.origin=String(t),"-"===t){this.nan=!0;return}var n=t;if(Z(n)&&(n=Number(n)),k(n="string"==typeof n?n:x(n))){var r=w(n);this.negative=r.negative;var a=r.trimStr.split(".");this.integer=BigInt(a[0]);var i=a[1]||"0";this.decimal=BigInt(i),this.decimalLen=i.length}else this.nan=!0}return(0,y.Z)(e,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(e){return BigInt("".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(e,"0")))}},{key:"negate",value:function(){var t=new e(this.toString());return t.negative=!t.negative,t}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=new e(t);if(n.isInvalidate())return this;var r=Math.max(this.getDecimalStr().length,n.getDecimalStr().length),a=w((this.alignDecimal(r)+n.alignDecimal(r)).toString()),i=a.negativeStr,u=a.trimStr,c="".concat(i).concat(u.padStart(r+1,"0"));return new e("".concat(c.slice(0,-r),".").concat(c.slice(-r)))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(e){return this.toString()===(null==e?void 0:e.toString())}},{key:"lessEquals",value:function(e){return 0>=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":w("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}();function _(e){return E()?new C(e):new R(e)}function O(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===e)return"";var a=w(e),i=a.negativeStr,u=a.integerStr,c=a.decimalStr,o="".concat(t).concat(c),l="".concat(i).concat(u);if(n>=0){var s=Number(c[n]);return s>=5&&!r?O(_(e).add("".concat(i,"0.").concat("0".repeat(n)).concat(10-s)).toString(),t,n,r):0===n?l:"".concat(l).concat(t).concat(c.padEnd(n,"0").slice(0,n))}return".0"===o?l:"".concat(l).concat(o)}var T=n(31131);function D(e){var t=e.prefixCls,n=e.upNode,i=e.downNode,u=e.upDisabled,c=e.downDisabled,o=e.onStep,s=l.useRef(),f=l.useRef();f.current=o;var d=function(e,t){e.preventDefault(),f.current(t),s.current=setTimeout(function e(){f.current(t),s.current=setTimeout(e,200)},600)},m=function(){clearTimeout(s.current)};if(l.useEffect(function(){return m},[]),(0,T.Z)())return null;var v="".concat(t,"-handler"),g=p()(v,"".concat(v,"-up"),(0,a.Z)({},"".concat(v,"-up-disabled"),u)),h=p()(v,"".concat(v,"-down"),(0,a.Z)({},"".concat(v,"-down-disabled"),c)),N={unselectable:"on",role:"button",onMouseUp:m,onMouseLeave:m};return l.createElement("div",{className:"".concat(v,"-wrap")},l.createElement("span",(0,r.Z)({},N,{onMouseDown:function(e){d(e,!0)},"aria-label":"Increase Value","aria-disabled":u,className:g}),n||l.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})),l.createElement("span",(0,r.Z)({},N,{onMouseDown:function(e){d(e,!1)},"aria-label":"Decrease Value","aria-disabled":c,className:h}),i||l.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})))}var F=n(80334),A=n(75164),B=function(){var e=(0,l.useRef)(0),t=function(){A.Z.cancel(e.current)};return(0,l.useEffect)(function(){return t},[]),function(n){t(),e.current=(0,A.Z)(function(){n()})}},q=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],P=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},G=function(e){var t=_(e);return t.isInvalidate()?null:t},U=l.forwardRef(function(e,t){var n,c,o,s=e.prefixCls,f=void 0===s?"rc-input-number":s,d=e.className,m=e.style,v=e.min,S=e.max,y=e.step,E=void 0===y?1:y,w=e.defaultValue,Z=e.value,R=e.disabled,C=e.readOnly,T=e.upHandler,A=e.downHandler,U=e.keyboard,$=e.controls,H=e.stringMode,L=e.parser,j=e.formatter,W=e.precision,z=e.decimalSeparator,V=e.onChange,X=e.onInput,K=e.onPressEnter,Q=e.onStep,J=(0,g.Z)(e,q),Y="".concat(f,"-input"),ee=l.useRef(null),et=l.useState(!1),en=(0,u.Z)(et,2),er=en[0],ea=en[1],ei=l.useRef(!1),eu=l.useRef(!1),ec=l.useRef(!1),eo=l.useState(function(){return _(null!=Z?Z:w)}),el=(0,u.Z)(eo,2),es=el[0],ef=el[1],ed=l.useCallback(function(e,t){return t?void 0:W>=0?W:Math.max(I(e),I(E))},[W,E]),em=l.useCallback(function(e){var t=String(e);if(L)return L(t);var n=t;return z&&(n=n.replace(z,".")),n.replace(/[^\w.-]+/g,"")},[L,z]),ev=l.useRef(""),ep=l.useCallback(function(e,t){if(j)return j(e,{userTyping:t,input:String(ev.current)});var n="number"==typeof e?x(e):e;if(!t){var r=ed(n,t);k(n)&&(z||r>=0)&&(n=O(n,z||".",r))}return n},[j,ed,z]),eg=l.useState(function(){var e=null!=w?w:Z;return es.isInvalidate()&&["string","number"].includes((0,i.Z)(e))?Number.isNaN(e)?"":e:ep(es.toString(),!1)}),eh=(0,u.Z)(eg,2),eN=eh[0],eb=eh[1];function eS(e,t){eb(ep(e.isInvalidate()?e.toString(!1):e.toString(!t),t))}ev.current=eN;var ey=l.useMemo(function(){return G(S)},[S,W]),eE=l.useMemo(function(){return G(v)},[v,W]),ew=l.useMemo(function(){return!(!ey||!es||es.isInvalidate())&&ey.lessEquals(es)},[ey,es]),eZ=l.useMemo(function(){return!(!eE||!es||es.isInvalidate())&&es.lessEquals(eE)},[eE,es]),eI=(n=ee.current,c=(0,l.useRef)(null),[function(){try{var e=n.selectionStart,t=n.selectionEnd,r=n.value,a=r.substring(0,e),i=r.substring(t);c.current={start:e,end:t,value:r,beforeTxt:a,afterTxt:i}}catch(e){}},function(){if(n&&c.current&&er)try{var e=n.value,t=c.current,r=t.beforeTxt,a=t.afterTxt,i=t.start,u=e.length;if(e.endsWith(a))u=e.length-c.current.afterTxt.length;else if(e.startsWith(r))u=r.length;else{var o=r[i-1],l=e.indexOf(o,i-1);-1!==l&&(u=l+1)}n.setSelectionRange(u,u)}catch(e){(0,F.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(e.message))}}]),ex=(0,u.Z)(eI,2),ek=ex[0],eM=ex[1],eR=function(e){return ey&&!e.lessEquals(ey)?ey:eE&&!eE.lessEquals(e)?eE:null},eC=function(e){return!eR(e)},e_=function(e,t){var n=e,r=eC(n)||n.isEmpty();if(n.isEmpty()||t||(n=eR(n)||n,r=!0),!C&&!R&&r){var a,i=n.toString(),u=ed(i,t);return u>=0&&!eC(n=_(O(i,".",u)))&&(n=_(O(i,".",u,!0))),n.equals(es)||(a=n,void 0===Z&&ef(a),null==V||V(n.isEmpty()?null:P(H,n)),void 0===Z&&eS(n,t)),n}return es},eO=B(),eT=function e(t){if(ek(),eb(t),!eu.current){var n=_(em(t));n.isNaN()||e_(n,!0)}null==X||X(t),eO(function(){var n=t;L||(n=t.replace(/。/g,".")),n!==t&&e(n)})},eD=function(e){if((!e||!ew)&&(e||!eZ)){ei.current=!1;var t,n=_(ec.current?M(E):E);e||(n=n.negate());var r=e_((es||_(0)).add(n.toString()),!1);null==Q||Q(P(H,r),{offset:ec.current?M(E):E,type:e?"up":"down"}),null===(t=ee.current)||void 0===t||t.focus()}},eF=function(e){var t=_(em(eN)),n=t;n=t.isNaN()?es:e_(t,e),void 0!==Z?eS(es,!1):n.isNaN()||eS(n,!1)};return(0,N.o)(function(){es.isInvalidate()||eS(es,!1)},[W]),(0,N.o)(function(){var e=_(Z);ef(e);var t=_(em(eN));e.equals(t)&&ei.current&&!j||eS(e,ei.current)},[Z]),(0,N.o)(function(){j&&eM()},[eN]),l.createElement("div",{className:p()(f,d,(o={},(0,a.Z)(o,"".concat(f,"-focused"),er),(0,a.Z)(o,"".concat(f,"-disabled"),R),(0,a.Z)(o,"".concat(f,"-readonly"),C),(0,a.Z)(o,"".concat(f,"-not-a-number"),es.isNaN()),(0,a.Z)(o,"".concat(f,"-out-of-range"),!es.isInvalidate()&&!eC(es)),o)),style:m,onFocus:function(){ea(!0)},onBlur:function(){eF(!1),ea(!1),ei.current=!1},onKeyDown:function(e){var t=e.which,n=e.shiftKey;ei.current=!0,n?ec.current=!0:ec.current=!1,t===h.Z.ENTER&&(eu.current||(ei.current=!1),eF(!1),null==K||K(e)),!1!==U&&!eu.current&&[h.Z.UP,h.Z.DOWN].includes(t)&&(eD(h.Z.UP===t),e.preventDefault())},onKeyUp:function(){ei.current=!1,ec.current=!1},onCompositionStart:function(){eu.current=!0},onCompositionEnd:function(){eu.current=!1,eT(ee.current.value)},onBeforeInput:function(){ei.current=!0}},(void 0===$||$)&&l.createElement(D,{prefixCls:f,upNode:T,downNode:A,upDisabled:ew,downDisabled:eZ,onStep:eD}),l.createElement("div",{className:"".concat(Y,"-wrap")},l.createElement("input",(0,r.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":v,"aria-valuemax":S,"aria-valuenow":es.isInvalidate()?null:es.toString(),step:E},J,{ref:(0,b.sQ)(ee,t),className:Y,value:eN,onChange:function(e){eT(e.target.value)},disabled:R,readOnly:C}))))});U.displayName="InputNumber";var $=n(53124),H=n(98866),L=n(97647),j=n(65223),W=n(4173),z=n(96159),V=n(9708),X=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>t.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n},K=l.forwardRef(function(e,t){var n=l.useContext($.E_),o=n.getPrefixCls,s=n.direction,f=l.useContext(L.Z),d=l.useState(!1),v=(0,u.Z)(d,2),g=v[0],h=v[1],N=l.useRef(null);l.useImperativeHandle(t,function(){return N.current});var b=e.className,S=e.size,y=e.disabled,E=e.prefixCls,w=e.addonBefore,Z=e.addonAfter,I=e.prefix,x=e.bordered,k=void 0===x||x,M=e.readOnly,R=e.status,C=e.controls,_=X(e,["className","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),O=o("input-number",E),T=(0,W.ri)(O,s),D=T.compactSize,F=T.compactItemClassnames,A=l.createElement(m,{className:"".concat(O,"-handler-up-inner")}),B=l.createElement(c.Z,{className:"".concat(O,"-handler-down-inner")});"object"===(0,i.Z)(C)&&(A=void 0===C.upIcon?A:l.createElement("span",{className:"".concat(O,"-handler-up-inner")},C.upIcon),B=void 0===C.downIcon?B:l.createElement("span",{className:"".concat(O,"-handler-down-inner")},C.downIcon));var q=(0,l.useContext)(j.aM),P=q.hasFeedback,G=q.status,K=q.isFormItemInput,Q=q.feedbackIcon,J=(0,V.F)(G,R),Y=D||S||f,ee=l.useContext(H.Z),et=null!=y?y:ee,en=p()((ea={},(0,a.Z)(ea,"".concat(O,"-lg"),"large"===Y),(0,a.Z)(ea,"".concat(O,"-sm"),"small"===Y),(0,a.Z)(ea,"".concat(O,"-rtl"),"rtl"===s),(0,a.Z)(ea,"".concat(O,"-borderless"),!k),(0,a.Z)(ea,"".concat(O,"-in-form-item"),K),ea),(0,V.Z)(O,J),F,b),er=l.createElement(U,(0,r.Z)({ref:N,disabled:et,className:en,upHandler:A,downHandler:B,prefixCls:O,readOnly:M,controls:"boolean"==typeof C?C:void 0},_));if(null!=I||P){var ea,ei,eu=p()("".concat(O,"-affix-wrapper"),(0,V.Z)("".concat(O,"-affix-wrapper"),J,P),(ei={},(0,a.Z)(ei,"".concat(O,"-affix-wrapper-focused"),g),(0,a.Z)(ei,"".concat(O,"-affix-wrapper-disabled"),e.disabled),(0,a.Z)(ei,"".concat(O,"-affix-wrapper-sm"),"small"===f),(0,a.Z)(ei,"".concat(O,"-affix-wrapper-lg"),"large"===f),(0,a.Z)(ei,"".concat(O,"-affix-wrapper-rtl"),"rtl"===s),(0,a.Z)(ei,"".concat(O,"-affix-wrapper-readonly"),M),(0,a.Z)(ei,"".concat(O,"-affix-wrapper-borderless"),!k),(0,a.Z)(ei,"".concat(b),!(w||Z)&&b),ei));er=l.createElement("div",{className:eu,style:e.style,onMouseUp:function(){return N.current.focus()}},I&&l.createElement("span",{className:"".concat(O,"-prefix")},I),(0,z.Tm)(er,{style:null,value:e.value,onFocus:function(t){var n;h(!0),null===(n=e.onFocus)||void 0===n||n.call(e,t)},onBlur:function(t){var n;h(!1),null===(n=e.onBlur)||void 0===n||n.call(e,t)}}),P&&l.createElement("span",{className:"".concat(O,"-suffix")},Q))}if(null!=w||null!=Z){var ec,eo="".concat(O,"-group"),el="".concat(eo,"-addon"),es=w?l.createElement("div",{className:el},w):null,ef=Z?l.createElement("div",{className:el},Z):null,ed=p()("".concat(O,"-wrapper"),eo,(0,a.Z)({},"".concat(eo,"-rtl"),"rtl"===s)),em=p()("".concat(O,"-group-wrapper"),(ec={},(0,a.Z)(ec,"".concat(O,"-group-wrapper-sm"),"small"===f),(0,a.Z)(ec,"".concat(O,"-group-wrapper-lg"),"large"===f),(0,a.Z)(ec,"".concat(O,"-group-wrapper-rtl"),"rtl"===s),ec),(0,V.Z)("".concat(O,"-group-wrapper"),J,P),b);er=l.createElement("div",{className:em,style:e.style},l.createElement("div",{className:ed},es&&l.createElement(W.BR,null,l.createElement(j.Ux,{status:!0,override:!0},es)),(0,z.Tm)(er,{style:null,disabled:et}),ef&&l.createElement(W.BR,null,l.createElement(j.Ux,{status:!0,override:!0},ef))))}return er})}}]); |