1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1470],{71470:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==g(e)&&"function"!==typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var c=u?Object.getOwnPropertyDescriptor(e,a):null;c&&(c.get||c.set)?Object.defineProperty(r,a,c):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(67294)),u=["placeholder","separator","isLastChild","inputStyle","focus","isDisabled","hasErrored","errorStyle","focusStyle","disabledStyle","shouldAutoFocus","isInputNum","index","value","className","isInputSecure"];function o(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function p(e,t){if("function"!==typeof t&&null!==t)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}}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=v(e);if(t){var u=v(this).constructor;n=Reflect.construct(r,arguments,u)}else n=r.apply(this,arguments);return y(this,n)}}function y(e,t){return!t||"object"!==g(t)&&"function"!==typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){return(g="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var m=function(e){return"object"===g(e)},I=function(e){p(n,e);var t=d(n);function n(e){var u;return s(this,n),b(h(u=t.call(this,e)),"getClasses",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return!m(e)&&!1!==e})).join(" ")})),b(h(u),"getType",(function(){var e=u.props,t=e.isInputSecure,n=e.isInputNum;return t?"password":n?"tel":"text"})),u.input=r.default.createRef(),u}return l(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.focus,n=e.shouldAutoFocus,r=this.input.current;r&&t&&n&&r.focus()}},{key:"componentDidUpdate",value:function(e){var t=this.props.focus,n=this.input.current;e.focus!==t&&n&&t&&(n.focus(),n.select())}},{key:"render",value:function(){var e=this.props,t=e.placeholder,n=e.separator,o=e.isLastChild,s=e.inputStyle,i=e.focus,l=e.isDisabled,p=e.hasErrored,f=e.errorStyle,d=e.focusStyle,y=e.disabledStyle,h=(e.shouldAutoFocus,e.isInputNum),v=e.index,b=e.value,g=e.className,I=(e.isInputSecure,c(e,u));return r.default.createElement("div",{className:g,style:{display:"flex",alignItems:"center"}},r.default.createElement("input",a({"aria-label":"".concat(0===v?"Please enter verification code. ":"").concat(h?"Digit":"Character"," ").concat(v+1),autoComplete:"off",style:Object.assign({width:"1em",textAlign:"center"},m(s)&&s,i&&m(d)&&d,l&&m(y)&&y,p&&m(f)&&f),placeholder:t,className:this.getClasses(s,i&&d,l&&y,p&&f),type:this.getType(),maxLength:"1",ref:this.input,disabled:l,value:b||""},I)),!o&&n)}}]),n}(r.PureComponent),O=function(e){p(n,e);var t=d(n);function n(){var e;s(this,n);for(var u=arguments.length,o=new Array(u),a=0;a<u;a++)o[a]=arguments[a];return b(h(e=t.call.apply(t,[this].concat(o))),"state",{activeInput:0}),b(h(e),"getOtpValue",(function(){return e.props.value?e.props.value.toString().split(""):[]})),b(h(e),"getPlaceholderValue",(function(){var t=e.props,n=t.placeholder,r=t.numInputs;if("string"===typeof n){if(n.length===r)return n;n.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}})),b(h(e),"handleOtpChange",(function(t){(0,e.props.onChange)(t.join(""))})),b(h(e),"isInputValueValid",(function(t){return(e.props.isInputNum?!isNaN(parseInt(t,10)):"string"===typeof t)&&1===t.trim().length})),b(h(e),"focusInput",(function(t){var n=e.props.numInputs,r=Math.max(Math.min(n-1,t),0);e.setState({activeInput:r})})),b(h(e),"focusNextInput",(function(){var t=e.state.activeInput;e.focusInput(t+1)})),b(h(e),"focusPrevInput",(function(){var t=e.state.activeInput;e.focusInput(t-1)})),b(h(e),"changeCodeAtFocus",(function(t){var n=e.state.activeInput,r=e.getOtpValue();r[n]=t[0],e.handleOtpChange(r)})),b(h(e),"handleOnPaste",(function(t){t.preventDefault();var n=e.state.activeInput,r=e.props,u=r.numInputs;if(!r.isDisabled){for(var o=e.getOtpValue(),a=n,c=t.clipboardData.getData("text/plain").slice(0,u-n).split(""),s=0;s<u;++s)s>=n&&c.length>0&&(o[s]=c.shift(),a++);e.setState({activeInput:a},(function(){e.focusInput(a),e.handleOtpChange(o)}))}})),b(h(e),"handleOnChange",(function(t){var n=t.target.value;e.isInputValueValid(n)&&e.changeCodeAtFocus(n)})),b(h(e),"handleOnKeyDown",(function(t){8===t.keyCode||"Backspace"===t.key?(t.preventDefault(),e.changeCodeAtFocus(""),e.focusPrevInput()):46===t.keyCode||"Delete"===t.key?(t.preventDefault(),e.changeCodeAtFocus("")):37===t.keyCode||"ArrowLeft"===t.key?(t.preventDefault(),e.focusPrevInput()):39===t.keyCode||"ArrowRight"===t.key?(t.preventDefault(),e.focusNextInput()):32!==t.keyCode&&" "!==t.key&&"Spacebar"!==t.key&&"Space"!==t.key||t.preventDefault()})),b(h(e),"handleOnInput",(function(t){if(e.isInputValueValid(t.target.value))e.focu
1sNextInput();else if(!e.props.isInputNum){var n=t.nativeEvent;null===n.data&&"deleteContentBackward"===n.inputType&&(t.preventDefault(),e.changeCodeAtFocus(""),e.focusPrevInput())}})),b(h(e),"renderInputs",(function(){for(var t=e.state.activeInput,n=e.props,u=n.numInputs,o=n.inputStyle,a=n.focusStyle,c=n.separator,s=n.isDisabled,i=n.disabledStyle,l=n.hasErrored,p=n.errorStyle,f=n.shouldAutoFocus,d=n.isInputNum,y=n.isInputSecure,h=n.className,v=[],b=e.getOtpValue(),g=e.getPlaceholderValue(),m=e.props["data-cy"],O=e.props["data-testid"],S=function(n){v.push(r.default.createElement(I,{placeholder:g&&g[n],key:n,index:n,focus:t===n,value:b&&b[n],onChange:e.handleOnChange,onKeyDown:e.handleOnKeyDown,onInput:e.handleOnInput,onPaste:e.handleOnPaste,onFocus:function(t){e.setState({activeInput:n}),t.target.select()},onBlur:function(){return e.setState({activeInput:-1})},separator:c,inputStyle:o,focusStyle:a,isLastChild:n===u-1,isDisabled:s,disabledStyle:i,hasErrored:l,errorStyle:p,shouldAutoFocus:f,isInputNum:d,isInputSecure:y,className:h,"data-cy":m&&"".concat(m,"-").concat(n),"data-testid":O&&"".concat(O,"-").concat(n)}))},C=0;C<u;C++)S(C);return v})),e}return l(n,[{key:"render",value:function(){var e=this.props.containerStyle;return r.default.createElement("div",{style:Object.assign({display:"flex"},m(e)&&e),className:m(e)?"":e},this.renderInputs())}}]),n}(r.Component);b(O,"defaultProps",{numInputs:4,onChange:function(e){return console.log(e)},isDisabled:!1,shouldAutoFocus:!1,value:"",isInputSecure:!1});var S=O;t.default=S}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.