"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.TextInputSecureRender=exports.TextInputSecure=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativePaper=require("react-native-paper");var _TextInput=require("./TextInput");var _jsxFileName="/home/circleci/login-workflow/login-workflow/src/components/TextInputSecure.tsx";var _excluded=["style","theme"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var makeStyles=function makeStyles(){return _reactNative.StyleSheet.create({togglePadding:{paddingRight:48},visibilityToggleTouchable:{position:'absolute',right:8,bottom:16,height:48,width:48,padding:4,flex:1,justifyContent:'center'}});};var TextInputSecureRender=function TextInputSecureRender(props,ref){var style=props.style,customTheme=props.theme,inputProps=(0,_objectWithoutProperties2.default)(props,_excluded);var theme=(0,_reactNativePaper.useTheme)(customTheme);var styles=makeStyles();var _useState=(0,_react.useState)(true),_useState2=(0,_slicedToArray2.default)(_useState,2),shouldShowText=_useState2[0],setShouldShowText=_useState2[1];var inputRef=_react.default.useRef(null);_react.default.useImperativeHandle(ref,function(){return{focus:function focus(){if(inputRef&&inputRef.current)inputRef.current.focus();}};});return _react.default.createElement(_reactNative.View,{style:style,__source:{fileName:_jsxFileName,lineNumber:64,columnNumber:9}},_react.default.createElement(_TextInput.TextInput,(0,_extends2.default)({ref:inputRef,style:styles.togglePadding},inputProps,{secureTextEntry:shouldShowText,right:_react.default.createElement(_reactNativePaper.TextInput.Icon,{name:shouldShowText?'eye-off':'eye',color:theme.colors.placeholder,onPress:function onPress(){return setShouldShowText(!shouldShowText);},__source:{fileName:_jsxFileName,lineNumber:71,columnNumber:21}}),__source:{fileName:_jsxFileName,lineNumber:65,columnNumber:13}})));};exports.TextInputSecureRender=TextInputSecureRender;var TextInputSecure=_react.default.forwardRef(TextInputSecureRender);exports.TextInputSecure=TextInputSecure;TextInputSecure.displayName='TextInputSecure';
//# sourceMappingURL=TextInputSecure.js.map