UNPKG

fe-pilot

Version:

scanner in web, phonebook in web, autofill otp in web, share web, TextToSpeech in web, Voice Recognition in web, live location tracking in web, detect my location web, wakelock in web, color picker, WhatsappShare, SnapScanner, NetworkMonitor, View360

1 lines 2.21 kB
function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d["return"]&&(k=d["return"](),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}import React,{useEffect,useState}from"react";import{browserDimensions}from"../utils/utils";function ScannerScanBox(a){var b=a.zIndex,c=void 0===b?9:b,d=a.marginTop,e=a.background,f=a.children,g=useState(!1),h=_slicedToArray(g,2),i=h[0],j=h[1],k=useState({}),l=_slicedToArray(k,2),m=l[0],n=l[1];return useEffect(function(){var a=browserDimensions(),b="".concat((a.height-a.width)/2-80+d,"px"),c="".concat((a.height-a.width)/2+150-d,"px");j(!0),n({borderTop:b,borderBottom:c,width:a.width,height:a.height})},[]),i&&(f||React.createElement("div",{id:"fe-pilot-scan-box",style:{left:"0px",top:"0",zIndex:c,position:"absolute",boxSizing:"border-box",width:m.width,height:m.height,borderLeft:"25px",borderRight:"25px",borderTop:m.borderTop,borderBottom:m.borderBottom,borderColor:e,borderStyle:"solid"}}))}ScannerScanBox.defaultProps={zIndex:9,marginTop:0,background:"rgba(0, 0, 0, 0.7)"};export{ScannerScanBox};export default{ScannerScanBox:ScannerScanBox};