mirror of
https://github.com/owncast/owncast.git
synced 2024-12-23 09:40:49 +03:00
1 line
No EOL
19 KiB
JavaScript
Vendored
1 line
No EOL
19 KiB
JavaScript
Vendored
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[173],{9708:function(e,t,n){n.d(t,{F:function(){return u},Z:function(){return l}});var r=n(4942),a=n(94184),o=n.n(a);function l(e,t,n){var a;return o()((a={},(0,r.Z)(a,"".concat(e,"-status-success"),"success"===t),(0,r.Z)(a,"".concat(e,"-status-warning"),"warning"===t),(0,r.Z)(a,"".concat(e,"-status-error"),"error"===t),(0,r.Z)(a,"".concat(e,"-status-validating"),"validating"===t),(0,r.Z)(a,"".concat(e,"-has-feedback"),n),a))}(0,n(93355).b)("warning","error","");var u=function(e,t){return t||e}},82586:function(e,t,n){n.d(t,{ZP:function(){return y},D7:function(){return Z},rJ:function(){return C},nH:function(){return w}});var r=n(4942),a=n(87462),o=n(71002),l=n(4340),u=n(94184),i=n.n(u),c=n(59775),s=n(42550),f=n(67294),d=n(53124),p=n(98866),v=n(97647),m=n(65223),g=n(4173),h=n(9708),b=n(72922),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};function Z(e){return null==e?"":String(e)}function C(e,t,n,r){if(n){var a=t;if("click"===t.type){var o=e.cloneNode(!0);a=Object.create(t,{target:{value:o},currentTarget:{value:o}}),o.value="",n(a);return}if(void 0!==r){a=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,n(a);return}n(a)}}function w(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}var y=(0,f.forwardRef)(function(e,t){var n,u,Z,C,w=e.prefixCls,y=e.bordered,E=void 0===y||y,N=e.status,S=e.size,z=e.disabled,A=e.onBlur,R=e.onFocus,k=e.suffix,T=e.allowClear,O=e.addonAfter,P=e.addonBefore,F=e.className,I=e.onChange,j=x(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","onChange"]),B=f.useContext(d.E_),V=B.getPrefixCls,D=B.direction,H=B.input,M=V("input",w),K=(0,f.useRef)(null),L=(0,g.ri)(M,D),_=L.compactSize,W=L.compactItemClassnames,J=f.useContext(v.Z),U=_||S||J,Y=f.useContext(p.Z),Q=(0,f.useContext)(m.aM),X=Q.status,q=Q.hasFeedback,G=Q.feedbackIcon,$=(0,h.F)(X,N),ee=!!(e.prefix||e.suffix||e.allowClear)||!!q,et=(0,f.useRef)(ee);(0,f.useEffect)(function(){ee&&et.current,et.current=ee},[ee]);var en=(0,b.Z)(K,!0),er=(q||k)&&f.createElement(f.Fragment,null,k,q&&G);return"object"===(0,o.Z)(T)&&(null==T?void 0:T.clearIcon)?C=T:T&&(C={clearIcon:f.createElement(l.Z,null)}),f.createElement(c.default,(0,a.Z)({ref:(0,s.sQ)(t,K),prefixCls:M,autoComplete:null==H?void 0:H.autoComplete},j,{disabled:(null!=z?z:Y)||void 0,onBlur:function(e){en(),null==A||A(e)},onFocus:function(e){en(),null==R||R(e)},suffix:er,allowClear:C,className:i()(F,W),onChange:function(e){en(),null==I||I(e)},addonAfter:O&&f.createElement(g.BR,null,f.createElement(m.Ux,{override:!0,status:!0},O)),addonBefore:P&&f.createElement(g.BR,null,f.createElement(m.Ux,{override:!0,status:!0},P)),inputClassName:i()((n={},(0,r.Z)(n,"".concat(M,"-sm"),"small"===U),(0,r.Z)(n,"".concat(M,"-lg"),"large"===U),(0,r.Z)(n,"".concat(M,"-rtl"),"rtl"===D),(0,r.Z)(n,"".concat(M,"-borderless"),!E),n),!ee&&(0,h.Z)(M,$)),affixWrapperClassName:i()((u={},(0,r.Z)(u,"".concat(M,"-affix-wrapper-sm"),"small"===U),(0,r.Z)(u,"".concat(M,"-affix-wrapper-lg"),"large"===U),(0,r.Z)(u,"".concat(M,"-affix-wrapper-rtl"),"rtl"===D),(0,r.Z)(u,"".concat(M,"-affix-wrapper-borderless"),!E),u),(0,h.Z)("".concat(M,"-affix-wrapper"),$,q)),wrapperClassName:i()((0,r.Z)({},"".concat(M,"-group-rtl"),"rtl"===D)),groupClassName:i()((Z={},(0,r.Z)(Z,"".concat(M,"-group-wrapper-sm"),"small"===U),(0,r.Z)(Z,"".concat(M,"-group-wrapper-lg"),"large"===U),(0,r.Z)(Z,"".concat(M,"-group-wrapper-rtl"),"rtl"===D),Z),(0,h.Z)("".concat(M,"-group-wrapper"),$,q))}))})},80173:function(e,t,n){n.d(t,{Z:function(){return T}});var r=n(71002),a=n(4942),o=n(87462),l=n(97685),u=n(74902),i=n(94184),c=n.n(i),s=n(57239),f=n(21770),d=n(98423),p=n(67294),v=n(53124),m=n(98866),g=n(97647),h=n(65223),b=n(9708),x=n(15671),Z=n(43144),C=n(60136),w=n(33643),y=n(4340),E=n(96159),N=(0,n(93355).b)("text","input"),S=function(e){(0,C.Z)(n,e);var t=(0,w.Z)(n);function n(){return(0,x.Z)(this,n),t.apply(this,arguments)}return(0,Z.Z)(n,[{key:"renderClearIcon",value:function(e){var t,n=this.props,r=n.value,o=n.disabled,l=n.readOnly,u=n.handleReset,i=n.suffix,s="".concat(e,"-clear-icon");return p.createElement(y.Z,{onClick:u,onMouseDown:function(e){return e.preventDefault()},className:c()((t={},(0,a.Z)(t,"".concat(s,"-hidden"),!(!o&&!l&&r)),(0,a.Z)(t,"".concat(s,"-has-suffix"),!!i),t),s),role:"button"})}},{key:"renderTextAreaWithClearIcon",value:function(e,t,n){var r,o,l=this.props,u=l.value,i=l.allowClear,s=l.className,f=l.style,d=l.direction,v=l.bordered,m=l.hidden,g=l.status,h=n.status,x=n.hasFeedback;if(!i)return(0,E.Tm)(t,{value:u});var Z=c()("".concat(e,"-affix-wrapper"),"".concat(e,"-affix-wrapper-textarea-with-clear-btn"),(0,b.Z)("".concat(e,"-affix-wrapper"),(0,b.F)(h,g),x),(o={},(0,a.Z)(o,"".concat(e,"-affix-wrapper-rtl"),"rtl"===d),(0,a.Z)(o,"".concat(e,"-affix-wrapper-borderless"),!v),(0,a.Z)(o,"".concat(s),!((r=this.props).addonBefore||r.addonAfter)&&s),o));return p.createElement("span",{className:Z,style:f,hidden:m},(0,E.Tm)(t,{style:null,value:u}),this.renderClearIcon(e))}},{key:"render",value:function(){var e=this;return p.createElement(h.aM.Consumer,null,function(t){var n=e.props,r=n.prefixCls,a=n.inputType,o=n.element;if(a===N[0])return e.renderTextAreaWithClearIcon(r,o,t)})}}]),n}(p.Component),z=n(82586),A=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};function R(e,t){return(0,u.Z)(e||"").slice(0,t).join("")}function k(e,t,n,r){var a=n;return e?a=R(n,r):(0,u.Z)(t||"").length<n.length&&(0,u.Z)(n||"").length>r&&(a=t),a}var T=p.forwardRef(function(e,t){var n=e.prefixCls,i=e.bordered,x=void 0===i||i,Z=e.showCount,C=void 0!==Z&&Z,w=e.maxLength,y=e.className,E=e.style,N=e.size,T=e.disabled,O=e.onCompositionStart,P=e.onCompositionEnd,F=e.onChange,I=e.status,j=A(e,["prefixCls","bordered","showCount","maxLength","className","style","size","disabled","onCompositionStart","onCompositionEnd","onChange","status"]),B=p.useContext(v.E_),V=B.getPrefixCls,D=B.direction,H=p.useContext(g.Z),M=p.useContext(m.Z),K=null!=T?T:M,L=p.useContext(h.aM),_=L.status,W=L.hasFeedback,J=L.isFormItemInput,U=L.feedbackIcon,Y=(0,b.F)(_,I),Q=p.useRef(null),X=p.useRef(null),q=p.useState(!1),G=(0,l.Z)(q,2),$=G[0],ee=G[1],et=p.useRef(),en=p.useRef(0),er=(0,f.Z)(j.defaultValue,{value:j.value}),ea=(0,l.Z)(er,2),eo=ea[0],el=ea[1],eu=j.hidden,ei=function(e,t){void 0===j.value&&(el(e),null==t||t())},ec=Number(w)>0,es=V("input",n);p.useImperativeHandle(t,function(){var e;return{resizableTextArea:null===(e=Q.current)||void 0===e?void 0:e.resizableTextArea,focus:function(e){var t,n;(0,z.nH)(null===(n=null===(t=Q.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:function(){var e;return null===(e=Q.current)||void 0===e?void 0:e.blur()}}});var ef=p.createElement(s.default,(0,o.Z)({},(0,d.Z)(j,["allowClear"]),{disabled:K,className:c()((ev={},(0,a.Z)(ev,"".concat(es,"-borderless"),!x),(0,a.Z)(ev,y,y&&!C),(0,a.Z)(ev,"".concat(es,"-sm"),"small"===H||"small"===N),(0,a.Z)(ev,"".concat(es,"-lg"),"large"===H||"large"===N),ev),(0,b.Z)(es,Y)),style:C?{resize:null==E?void 0:E.resize}:E,prefixCls:es,onCompositionStart:function(e){ee(!0),et.current=eo,en.current=e.currentTarget.selectionStart,null==O||O(e)},onChange:function(e){var t=e.target.value;!$&&ec&&(t=k(e.target.selectionStart>=w+1||e.target.selectionStart===t.length||!e.target.selectionStart,eo,t,w)),ei(t),(0,z.rJ)(e.currentTarget,e,F,t)},onCompositionEnd:function(e){ee(!1);var t,n=e.currentTarget.value;ec&&(n=k(en.current>=w+1||en.current===(null===(t=et.current)||void 0===t?void 0:t.length),et.current,n,w)),n!==eo&&(ei(n),(0,z.rJ)(e.currentTarget,e,F,n)),null==P||P(e)},ref:Q})),ed=(0,z.D7)(eo);!$&&ec&&(null===j.value||void 0===j.value)&&(ed=R(ed,w));var ep=p.createElement(S,(0,o.Z)({disabled:K},j,{prefixCls:es,direction:D,inputType:"text",value:ed,element:ef,handleReset:function(e){var t,n,r;ei(""),null===(t=Q.current)||void 0===t||t.focus(),(0,z.rJ)(null===(r=null===(n=Q.current)||void 0===n?void 0:n.resizableTextArea)||void 0===r?void 0:r.textArea,e,F)},ref:X,bordered:x,status:I,style:C?void 0:E}));if(C||W){var ev,em,eg=(0,u.Z)(ed).length,eh="";return eh="object"===(0,r.Z)(C)?C.formatter({value:ed,count:eg,maxLength:w}):"".concat(eg).concat(ec?" / ".concat(w):""),p.createElement("div",{hidden:eu,className:c()("".concat(es,"-textarea"),(em={},(0,a.Z)(em,"".concat(es,"-textarea-rtl"),"rtl"===D),(0,a.Z)(em,"".concat(es,"-textarea-show-count"),C),(0,a.Z)(em,"".concat(es,"-textarea-in-form-item"),J),em),(0,b.Z)("".concat(es,"-textarea"),Y,W),y),style:E,"data-count":eh},ep,W&&p.createElement("span",{className:"".concat(es,"-textarea-suffix")},U))}return ep})},72922:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(67294);function a(e,t){var n=(0,r.useRef)([]),a=function(){n.current.push(setTimeout(function(){var t,n,r,a;(null===(t=e.current)||void 0===t?void 0:t.input)&&(null===(n=e.current)||void 0===n?void 0:n.input.getAttribute("type"))==="password"&&(null===(r=e.current)||void 0===r?void 0:r.input.hasAttribute("value"))&&(null===(a=e.current)||void 0===a||a.input.removeAttribute("value"))}))};return(0,r.useEffect)(function(){return t&&a(),function(){return n.current.forEach(function(e){e&&clearTimeout(e)})}},[]),a}},59775:function(e,t,n){n.r(t),n.d(t,{BaseInput:function(){return d},default:function(){return Z}});var r=n(4942),a=n(71002),o=n(67294),l=n(94184),u=n.n(l);function i(e){return!!(e.addonBefore||e.addonAfter)}function c(e){return!!(e.prefix||e.suffix||e.allowClear)}function s(e,t,n,r){if(n){var a=t;if("click"===t.type){var o=e.cloneNode(!0);a=Object.create(t,{target:{value:o},currentTarget:{value:o}}),o.value="",n(a);return}if(void 0!==r){a=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,n(a);return}n(a)}}function f(e){return null==e?"":String(e)}var d=function(e){var t=e.inputElement,n=e.prefixCls,l=e.prefix,s=e.suffix,f=e.addonBefore,d=e.addonAfter,p=e.className,v=e.style,m=e.affixWrapperClassName,g=e.groupClassName,h=e.wrapperClassName,b=e.disabled,x=e.readOnly,Z=e.focused,C=e.triggerFocus,w=e.allowClear,y=e.value,E=e.handleReset,N=e.hidden,S=(0,o.useRef)(null),z=(0,o.cloneElement)(t,{value:y,hidden:N});if(c(e)){var A,R="".concat(n,"-affix-wrapper"),k=u()(R,(A={},(0,r.Z)(A,"".concat(R,"-disabled"),b),(0,r.Z)(A,"".concat(R,"-focused"),Z),(0,r.Z)(A,"".concat(R,"-readonly"),x),(0,r.Z)(A,"".concat(R,"-input-with-clear-btn"),s&&w&&y),A),!i(e)&&p,m),T=(s||w)&&o.createElement("span",{className:"".concat(n,"-suffix")},function(){if(!w)return null;var e,t="".concat(n,"-clear-icon"),l="object"===(0,a.Z)(w)&&null!=w&&w.clearIcon?w.clearIcon:"✖";return o.createElement("span",{onClick:E,onMouseDown:function(e){return e.preventDefault()},className:u()(t,(e={},(0,r.Z)(e,"".concat(t,"-hidden"),!(!b&&!x&&y)),(0,r.Z)(e,"".concat(t,"-has-suffix"),!!s),e)),role:"button",tabIndex:-1},l)}(),s);z=o.createElement("span",{className:k,style:v,hidden:!i(e)&&N,onClick:function(e){var t;null!==(t=S.current)&&void 0!==t&&t.contains(e.target)&&(null==C||C())},ref:S},l&&o.createElement("span",{className:"".concat(n,"-prefix")},l),(0,o.cloneElement)(t,{style:null,value:y,hidden:null}),T)}if(i(e)){var O="".concat(n,"-group"),P="".concat(O,"-addon"),F=u()("".concat(n,"-wrapper"),O,h),I=u()("".concat(n,"-group-wrapper"),p,g);return o.createElement("span",{className:I,style:v,hidden:N},o.createElement("span",{className:F},f&&o.createElement("span",{className:P},f),(0,o.cloneElement)(z,{style:null,hidden:null}),d&&o.createElement("span",{className:P},d)))}return z},p=n(74902),v=n(87462),m=n(97685),g=n(45987),h=n(98423),b=n(21770),x=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],Z=(0,o.forwardRef)(function(e,t){var n,l=e.autoComplete,Z=e.onChange,C=e.onFocus,w=e.onBlur,y=e.onPressEnter,E=e.onKeyDown,N=e.prefixCls,S=void 0===N?"rc-input":N,z=e.disabled,A=e.htmlSize,R=e.className,k=e.maxLength,T=e.suffix,O=e.showCount,P=e.type,F=e.inputClassName,I=(0,g.Z)(e,x),j=(0,b.Z)(e.defaultValue,{value:e.value}),B=(0,m.Z)(j,2),V=B[0],D=B[1],H=(0,o.useState)(!1),M=(0,m.Z)(H,2),K=M[0],L=M[1],_=(0,o.useRef)(null),W=function(e){_.current&&function(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}(_.current,e)};return(0,o.useImperativeHandle)(t,function(){return{focus:W,blur:function(){var e;null===(e=_.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=_.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=_.current)||void 0===e||e.select()},input:_.current}}),(0,o.useEffect)(function(){L(function(e){return(!e||!z)&&e})},[z]),o.createElement(d,(0,v.Z)({},I,{prefixCls:S,className:R,inputElement:(n=(0,h.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]),o.createElement("input",(0,v.Z)({autoComplete:l},n,{onChange:function(t){void 0===e.value&&D(t.target.value),_.current&&s(_.current,t,Z)},onFocus:function(e){L(!0),null==C||C(e)},onBlur:function(e){L(!1),null==w||w(e)},onKeyDown:function(e){y&&"Enter"===e.key&&y(e),null==E||E(e)},className:u()(S,(0,r.Z)({},"".concat(S,"-disabled"),z),F,!i(e)&&!c(e)&&R),ref:_,size:A,type:void 0===P?"text":P}))),handleReset:function(e){D(""),W(),_.current&&s(_.current,e,Z)},value:f(V),focused:K,triggerFocus:W,suffix:function(){var e=Number(k)>0;if(T||O){var t=f(V),n=(0,p.Z)(t).length,l="object"===(0,a.Z)(O)?O.formatter({value:t,count:n,maxLength:k}):"".concat(n).concat(e?" / ".concat(k):"");return o.createElement(o.Fragment,null,!!O&&o.createElement("span",{className:u()("".concat(S,"-show-count-suffix"),(0,r.Z)({},"".concat(S,"-show-count-has-suffix"),!!T))},l),T)}return null}(),disabled:z}))})},57239:function(e,t,n){n.r(t),n.d(t,{ResizableTextArea:function(){return E},default:function(){return N}});var r,a=n(87462),o=n(15671),l=n(43144),u=n(60136),i=n(33643),c=n(67294),s=n(4942),f=n(1413),d=n(71002),p=n(97685),v=n(45987),m=n(48555),g=n(8410),h=n(75164),b=n(21770),x=n(94184),Z=n.n(x),C=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],w={},y=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],E=c.forwardRef(function(e,t){var n=e.prefixCls,o=void 0===n?"rc-textarea":n,l=(e.onPressEnter,e.defaultValue),u=e.value,i=e.autoSize,x=e.onResize,E=e.className,N=e.style,S=e.disabled,z=e.onChange,A=(e.onInternalAutoSize,(0,v.Z)(e,y)),R=(0,b.Z)(l,{value:u,postState:function(e){return null!=e?e:""}}),k=(0,p.Z)(R,2),T=k[0],O=k[1],P=c.useRef();c.useImperativeHandle(t,function(){return{textArea:P.current}});var F=c.useMemo(function(){return i&&"object"===(0,d.Z)(i)?[i.minRows,i.maxRows]:[]},[i]),I=(0,p.Z)(F,2),j=I[0],B=I[1],V=!!i,D=function(){try{if(document.activeElement===P.current){var e=P.current,t=e.selectionStart,n=e.selectionEnd,r=e.scrollTop;P.current.setSelectionRange(t,n),P.current.scrollTop=r}}catch(e){}},H=c.useState(2),M=(0,p.Z)(H,2),K=M[0],L=M[1],_=c.useState(),W=(0,p.Z)(_,2),J=W[0],U=W[1],Y=function(){L(0)};(0,g.Z)(function(){V&&Y()},[u,j,B,V]),(0,g.Z)(function(){if(0===K)L(1);else if(1===K){var e=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),e.getAttribute("wrap")?r.setAttribute("wrap",e.getAttribute("wrap")):r.removeAttribute("wrap");var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&w[n])return w[n];var r=window.getComputedStyle(e),a=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),o=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),l=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),u={sizingStyle:C.map(function(e){return"".concat(e,":").concat(r.getPropertyValue(e))}).join(";"),paddingSize:o,borderSize:l,boxSizing:a};return t&&n&&(w[n]=u),u}(e,n),u=l.paddingSize,i=l.borderSize,c=l.boxSizing,s=l.sizingStyle;r.setAttribute("style","".concat(s,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),r.value=e.value||e.placeholder||"";var f=void 0,d=void 0,p=r.scrollHeight;if("border-box"===c?p+=i:"content-box"===c&&(p-=u),null!==a||null!==o){r.value=" ";var v=r.scrollHeight-u;null!==a&&(f=v*a,"border-box"===c&&(f=f+u+i),p=Math.max(f,p)),null!==o&&(d=v*o,"border-box"===c&&(d=d+u+i),t=p>d?"":"hidden",p=Math.min(d,p))}var m={height:p,overflowY:t,resize:"none"};return f&&(m.minHeight=f),d&&(m.maxHeight=d),m}(P.current,!1,j,B);L(2),U(e)}else D()},[K]);var Q=c.useRef(),X=function(){h.Z.cancel(Q.current)};c.useEffect(function(){return X},[]);var q=(0,f.Z)((0,f.Z)({},N),V?J:null);return(0===K||1===K)&&(q.overflowY="hidden",q.overflowX="hidden"),c.createElement(m.default,{onResize:function(e){2===K&&(null==x||x(e),i&&(X(),Q.current=(0,h.Z)(function(){Y()})))},disabled:!(i||x)},c.createElement("textarea",(0,a.Z)({},A,{ref:P,style:q,className:Z()(o,E,(0,s.Z)({},"".concat(o,"-disabled"),S)),disabled:S,value:T,onChange:function(e){O(e.target.value),null==z||z(e)}})))}),N=function(e){(0,u.Z)(n,e);var t=(0,i.Z)(n);function n(e){(0,o.Z)(this,n),(r=t.call(this,e)).resizableTextArea=void 0,r.focus=function(){r.resizableTextArea.textArea.focus()},r.saveTextArea=function(e){r.resizableTextArea=e},r.handleChange=function(e){var t=r.props.onChange;r.setValue(e.target.value),t&&t(e)},r.handleKeyDown=function(e){var t=r.props,n=t.onPressEnter,a=t.onKeyDown;13===e.keyCode&&n&&n(e),a&&a(e)};var r,a=void 0===e.value||null===e.value?e.defaultValue:e.value;return r.state={value:a},r}return(0,l.Z)(n,[{key:"setValue",value:function(e,t){"value"in this.props||this.setState({value:e},t)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return c.createElement(E,(0,a.Z)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),n}(c.Component)}}]); |