@tsocial/tvweb-sdk.vib 5.17.2 → 5.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@
25
25
  *
26
26
  * Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
27
27
  * Dual licensed under GPLv2 or MIT
28
- */!function(o,i){var a="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",m="console",g="mobile",v="tablet",y="smarttv",b="wearable",w={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:i},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},C={rgx:function(e,t){for(var r,n,o,s,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(o=0;o<p.length;o++)l=u[++n],By(s=p[o])===c&&s.length>0?2==s.length?By(s[1])==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?By(s[1])!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):i:this[s[0]]=l?s[1].call(this,l,s[2]):i:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):i):this[s]=l||i;d+=2}},str:function(e,t){for(var r in t)if(By(t[r])===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(w.has(t[r][n],e))return"?"===r?i:r}else if(w.has(t[r],e))return"?"===r?i:r;return e}},k={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},S={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,p],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],p],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[l,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[l,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[l,p],[/(QQ)\/([\d\.]+)/i],[l,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[l,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,p],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[l,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,l],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[p,C.str,k.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],p],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,w.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",w.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,w.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,f,[d,v]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[d,v]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[f,u,[d,v]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[u,[f,"Amazon"],[d,v]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[u,C.str,k.device.amazon.model],[f,"Amazon"],[d,g]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[d,g]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[d,g]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[f,u,[d,g]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[d,g]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[u,[f,"Asus"],[d,v]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[d,v]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[u,[f,"Sony"],[d,g]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[d,m]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[d,m]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[d,m]],[/(sprint\s(\w+))/i],[[f,C.str,k.device.sprint.vendor],[u,C.str,k.device.sprint.model],[d,g]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[f,u,[d,v]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[d,g]],[/(nexus\s9)/i],[u,[f,"HTC"],[d,v]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[u,[f,"Huawei"],[d,g]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[d,g]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[d,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[d,g]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[u,[f,"Motorola"],[d,g]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[d,v]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,w.trim],[u,w.trim],[d,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[d,y]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[d,y]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[f,"Samsung"],u,[d,v]],[/smart-tv.+(samsung)/i],[f,[d,y],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[d,g]],[/sie-(\w*)/i],[u,[f,"Siemens"],[d,g]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[d,g]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[u,[f,"Acer"],[d,v]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[d,v]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[d,v]],[/(lg) netcast\.tv/i],[f,u,[d,y]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[d,g]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[d,v]],[/linux;.+((jolla));/i],[f,u,[d,g]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[d,b]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[d,g]],[/crkey/i],[[u,"Chromecast"],[f,"Google"]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[d,b]],[/android.+;\s(pixel c)\s/i],[u,[f,"Google"],[d,v]],[/android.+;\s(pixel xl|pixel)\s/i],[u,[f,"Google"],[d,g]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,g]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,v]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[d,v]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[u,[f,"OnePlus"],[d,g]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[d,v]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[d,v]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[d,v]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[d,v]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[d,v]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[d,v]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[d,g]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[d,v]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[d,v]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[d,v]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[d,v]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[d,v]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[d,g]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[d,g]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[d,v]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[u,[f,"MachSpeed"],[d,v]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[d,v]],[/android.+(KS(.+))\s+build/i],[u,[f,"Amazon"],[d,v]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[d,v]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[d,w.lowerize],f,u],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,p],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[p,C.str,k.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,C.str,k.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],p],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[l,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],p],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],p],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[l,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,p],[/(haiku)\s(\w+)/i],[l,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[l,p]]},E=function e(t,r){if("object"==By(t)&&(r=t,t=i),!(this instanceof e))return new e(t,r).getResult();var n=t||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),a=r?w.extend(S,r):S;return this.getBrowser=function(){var e={name:i,version:i};return C.rgx.call(e,n,a.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:i};return C.rgx.call(e,n,a.cpu),e},this.getDevice=function(){var e={vendor:i,model:i,type:i};return C.rgx.call(e,n,a.device),e},this.getEngine=function(){var e={name:i,version:i};return C.rgx.call(e,n,a.engine),e},this.getOS=function(){var e={name:i,version:i};return C.rgx.call(e,n,a.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};E.VERSION="0.7.18",E.BROWSER={NAME:l,MAJOR:"major",VERSION:p},E.CPU={ARCHITECTURE:h},E.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:m,MOBILE:g,SMARTTV:y,TABLET:v,WEARABLE:b,EMBEDDED:"embedded"},E.ENGINE={NAME:l,VERSION:p},E.OS={NAME:l,VERSION:p},By(t)!==s?(By(e)!==s&&e.exports&&(t=e.exports=E),t.UAParser=E):r(3)?(n=function(){return E}.call(t,r,t,e))===i||(e.exports=n):o&&(o.UAParser=E);var B=o&&(o.jQuery||o.Zepto);if(By(B)!==s){var _=new E;B.ua=_.getResult(),B.ua.get=function(){return _.getUA()},B.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":By(window))?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),i=o.DEVICE_TYPES,a=o.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case i.MOBILE:return{isMobile:!0};case i.TABLET:return{isTablet:!0};case i.SMART_TV:return{isSmartTV:!0};case i.CONSOLE:return{isConsole:!0};case i.WEARABLE:return{isWearable:!0};case i.BROWSER:return{isBrowser:!0};default:return a}},broPayload:function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:o}},mobilePayload:function(e,t,r,o){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:o})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])}));function Ij(){return"5.17.2"}function Pj(){return{"X-TV-Device-Model":"".concat(Aj.browserName," ").concat(Aj.browserVersion),"X-TV-OS-Version":"".concat(Aj.osName," ").concat(Aj.osVersion),"X-TV-OS-Platform":Aj.isMobile?"".concat(Aj.osName.toLowerCase(),"_web"):"web","X-TV-SDK-Version":"5.17.2"}}var Rj=Object.freeze({__proto__:null,getUAMetadata:Pj});function Dj(e){return e<10?"0".concat(e):e}function Oj(e){return"".concat(e.getFullYear(),"-").concat(Dj(e.getMonth()+1),"-").concat(Dj(e.getDate()),"T").concat(Dj(e.getHours()),":").concat(Dj(e.getMinutes()),":").concat(Dj(e.getSeconds())).concat(function(e){if(0===e)return"Z";var t=e>0?"-":"+";return e=Math.abs(e),"".concat(t+Dj(Math.floor(e/60)),":").concat(Dj(e%60))}(e.getTimezoneOffset()))}var Nj=Object.freeze({__proto__:null,rfc3339:Oj});function Lj(e,t){window.localStorage&&window.JSON&&t&&localStorage.setItem(t,JSON.stringify(e))}function Mj(e){if(window.localStorage&&window.JSON&&e){var t=localStorage.getItem(e);if(t)return JSON.parse(t)}}var Fj=Object.freeze({__proto__:null,storeData:Lj,getData:Mj,removeData:function(e){window.localStorage&&window.JSON&&e&&localStorage.removeItem(e)}}),Uj=zL((function(e,t){var r;e.exports=r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==jL&&jL.crypto&&(r=jL.crypto),!r)try{r=bj}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var a=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=a<<24-(n+i)%4*8}else for(var s=0;s<o;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new c.init(t,e)}}),u=i.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},d=u.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},f=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*u,i);if(u){for(var d=0;d<u;d+=a)this._doProcessBlock(o,d);r=o.splice(0,u),n.sigBytes-=l}return new c.init(r,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),h=(a.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}}),i.algo={});return i}(Math)})),jj=(zL((function(e,t){var r,n,o,i,a,s;e.exports=(n=(r=s=Uj).lib,o=n.Base,i=n.WordArray,(a=r.x64={}).Word=o.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var o=e[n];r.push(o.high),r.push(o.low)}return i.create(r,this.sigBytes)},clone:function(){for(var e=o.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),s)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){if("function"==typeof ArrayBuffer){var e=r.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],o=0;o<r;o++)n[o>>>2]|=e[o]<<24-o%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var i=t[o>>>2]>>>16-o%4*8&65535;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o<r;o++)n[o>>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var a=o(t[i>>>2]>>>16-i%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var o=[],i=0,a=0;a<r;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return t.create(o,i)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],i=0;i<r;i+=3)for(var a=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s<r;s++)o.push(n.charAt(a>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return n(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var o=[],i=0,a=0;a<r;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return t.create(o,i)}e.enc.Base64url={stringify:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.words,n=e.sigBytes,o=t?this._safe_map:this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var s=(r[a>>>2]>>>24-a%4*8&255)<<16|(r[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|r[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c<n;c++)i.push(o.charAt(s>>>6*(3-c)&63));var u=o.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.length,o=t?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<o.length;a++)i[o.charCodeAt(a)]=a}var s=o.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(r=c)}return n(e,r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),r.enc.Base64url)})),zL((function(e,t){var r;e.exports=(r=Uj,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=a.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,o=e[n];e[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=e[t+0],c=e[t+1],p=e[t+2],h=e[t+3],m=e[t+4],g=e[t+5],v=e[t+6],y=e[t+7],b=e[t+8],w=e[t+9],C=e[t+10],k=e[t+11],S=e[t+12],E=e[t+13],B=e[t+14],_=e[t+15],x=i[0],T=i[1],A=i[2],I=i[3];x=u(x,T,A,I,a,7,s[0]),I=u(I,x,T,A,c,12,s[1]),A=u(A,I,x,T,p,17,s[2]),T=u(T,A,I,x,h,22,s[3]),x=u(x,T,A,I,m,7,s[4]),I=u(I,x,T,A,g,12,s[5]),A=u(A,I,x,T,v,17,s[6]),T=u(T,A,I,x,y,22,s[7]),x=u(x,T,A,I,b,7,s[8]),I=u(I,x,T,A,w,12,s[9]),A=u(A,I,x,T,C,17,s[10]),T=u(T,A,I,x,k,22,s[11]),x=u(x,T,A,I,S,7,s[12]),I=u(I,x,T,A,E,12,s[13]),A=u(A,I,x,T,B,17,s[14]),x=l(x,T=u(T,A,I,x,_,22,s[15]),A,I,c,5,s[16]),I=l(I,x,T,A,v,9,s[17]),A=l(A,I,x,T,k,14,s[18]),T=l(T,A,I,x,a,20,s[19]),x=l(x,T,A,I,g,5,s[20]),I=l(I,x,T,A,C,9,s[21]),A=l(A,I,x,T,_,14,s[22]),T=l(T,A,I,x,m,20,s[23]),x=l(x,T,A,I,w,5,s[24]),I=l(I,x,T,A,B,9,s[25]),A=l(A,I,x,T,h,14,s[26]),T=l(T,A,I,x,b,20,s[27]),x=l(x,T,A,I,E,5,s[28]),I=l(I,x,T,A,p,9,s[29]),A=l(A,I,x,T,y,14,s[30]),x=d(x,T=l(T,A,I,x,S,20,s[31]),A,I,g,4,s[32]),I=d(I,x,T,A,b,11,s[33]),A=d(A,I,x,T,k,16,s[34]),T=d(T,A,I,x,B,23,s[35]),x=d(x,T,A,I,c,4,s[36]),I=d(I,x,T,A,m,11,s[37]),A=d(A,I,x,T,y,16,s[38]),T=d(T,A,I,x,C,23,s[39]),x=d(x,T,A,I,E,4,s[40]),I=d(I,x,T,A,a,11,s[41]),A=d(A,I,x,T,h,16,s[42]),T=d(T,A,I,x,v,23,s[43]),x=d(x,T,A,I,w,4,s[44]),I=d(I,x,T,A,S,11,s[45]),A=d(A,I,x,T,_,16,s[46]),x=f(x,T=d(T,A,I,x,p,23,s[47]),A,I,a,6,s[48]),I=f(I,x,T,A,y,10,s[49]),A=f(A,I,x,T,B,15,s[50]),T=f(T,A,I,x,g,21,s[51]),x=f(x,T,A,I,S,6,s[52]),I=f(I,x,T,A,h,10,s[53]),A=f(A,I,x,T,C,15,s[54]),T=f(T,A,I,x,c,21,s[55]),x=f(x,T,A,I,b,6,s[56]),I=f(I,x,T,A,_,10,s[57]),A=f(A,I,x,T,v,15,s[58]),T=f(T,A,I,x,E,21,s[59]),x=f(x,T,A,I,m,6,s[60]),I=f(I,x,T,A,k,10,s[61]),A=f(A,I,x,T,p,15,s[62]),T=f(T,A,I,x,w,21,s[63]),i[0]=i[0]+x|0,i[1]=i[1]+T|0,i[2]=i[2]+A|0,i[3]=i[3]+I|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;r[o>>>5]|=128<<24-o%32;var i=e.floor(n/4294967296),a=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,o,i,a){var s=e+(t&r|~t&n)+o+a;return(s<<i|s>>>32-i)+t}function l(e,t,r,n,o,i,a){var s=e+(t&n|r&~n)+o+a;return(s<<i|s>>>32-i)+t}function d(e,t,r,n,o,i,a){var s=e+(t^r^n)+o+a;return(s<<i|s>>>32-i)+t}function f(e,t,r,n,o,i,a){var s=e+(r^(t|~n))+o+a;return(s<<i|s>>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),r.MD5)})),zL((function(e,t){var r,n,o,i,a,s,c,u;e.exports=(n=(r=u=Uj).lib,o=n.WordArray,i=n.Hasher,a=r.algo,s=[],c=a.SHA1=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],c=r[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}var d=(n<<5|n>>>27)+c+s[u];d+=u<20?1518500249+(o&i|~o&a):u<40?1859775393+(o^i^a):u<60?(o&i|o&a|i&a)-1894007588:(o^i^a)-899497514,c=a,a=i,i=o<<30|o>>>2,o=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=i._createHelper(c),r.HmacSHA1=i._createHmacHelper(c),u.SHA1)})),zL((function(e,t){var r;e.exports=(r=Uj,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,o=0;o<64;)t(n)&&(o<8&&(s[o]=r(e.pow(n,.5))),c[o]=r(e.pow(n,1/3)),o++),n++}();var u=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,g=u[p-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[p]=m+u[p-7]+v+u[p-16]}var y=n&o^n&i^o&i,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+c[p]+u[p];f=d,d=l,l=s,s=a+w|0,a=i,i=o,o=n,n=w+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+d|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=e.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),r.SHA256)})),zL((function(e,t){var r,n,o,i,a,s;e.exports=(n=(r=s=Uj).lib.WordArray,o=r.algo,i=o.SHA256,a=o.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=i._createHelper(a),r.HmacSHA224=i._createHmacHelper(a),s.SHA224)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,a=e.algo;function s(){return o.create.apply(o,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var l=a.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=n.high,h=n.low,m=o.high,g=o.low,v=i.high,y=i.low,b=a.high,w=a.low,C=s.high,k=s.low,S=l.high,E=l.low,B=d.high,_=d.low,x=f.high,T=f.low,A=p,I=h,P=m,R=g,D=v,O=y,N=b,L=w,M=C,F=k,U=S,j=E,V=B,z=_,q=x,H=T,W=0;W<80;W++){var K,Q,G=u[W];if(W<16)Q=G.high=0|e[t+2*W],K=G.low=0|e[t+2*W+1];else{var X=u[W-15],Y=X.high,$=X.low,Z=(Y>>>1|$<<31)^(Y>>>8|$<<24)^Y>>>7,J=($>>>1|Y<<31)^($>>>8|Y<<24)^($>>>7|Y<<25),ee=u[W-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,oe=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ie=u[W-7],ae=ie.high,se=ie.low,ce=u[W-16],ue=ce.high,le=ce.low;Q=(Q=(Q=Z+ae+((K=J+se)>>>0<J>>>0?1:0))+ne+((K+=oe)>>>0<oe>>>0?1:0))+ue+((K+=le)>>>0<le>>>0?1:0),G.high=Q,G.low=K}var de,fe=M&U^~M&V,pe=F&j^~F&z,he=A&P^A&D^P&D,me=I&R^I&O^R&O,ge=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),ve=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ye=(M>>>14|F<<18)^(M>>>18|F<<14)^(M<<23|F>>>9),be=(F>>>14|M<<18)^(F>>>18|M<<14)^(F<<23|M>>>9),we=c[W],Ce=we.high,ke=we.low,Se=q+ye+((de=H+be)>>>0<H>>>0?1:0),Ee=ve+me;q=V,H=z,V=U,z=j,U=M,j=F,M=N+(Se=(Se=(Se=Se+fe+((de+=pe)>>>0<pe>>>0?1:0))+Ce+((de+=ke)>>>0<ke>>>0?1:0))+Q+((de+=K)>>>0<K>>>0?1:0))+((F=L+de|0)>>>0<L>>>0?1:0)|0,N=D,L=O,D=P,O=R,P=A,R=I,A=Se+(ge+he+(Ee>>>0<ve>>>0?1:0))+((I=de+Ee|0)>>>0<de>>>0?1:0)|0}h=n.low=h+I,n.high=p+A+(h>>>0<I>>>0?1:0),g=o.low=g+R,o.high=m+P+(g>>>0<R>>>0?1:0),y=i.low=y+O,i.high=v+D+(y>>>0<O>>>0?1:0),w=a.low=w+L,a.high=b+N+(w>>>0<L>>>0?1:0),k=s.low=k+F,s.high=C+M+(k>>>0<F>>>0?1:0),E=l.low=E+j,l.high=S+U+(E>>>0<j>>>0?1:0),_=d.low=_+z,d.high=B+V+(_>>>0<z>>>0?1:0),T=f.low=T+H,f.high=x+q+(T>>>0<H>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),r.SHA512)})),zL((function(e,t){var r,n,o,i,a,s,c,u;e.exports=(n=(r=u=Uj).x64,o=n.Word,i=n.WordArray,a=r.algo,s=a.SHA512,c=a.SHA384=s.extend({_doReset:function(){this._hash=new i.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=s._createHelper(c),r.HmacSHA384=s._createHmacHelper(c),u.SHA384)})),zL((function(e,t){var r;e.exports=(r=Uj,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.x64.Word,s=t.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,i=0;i<24;i++){for(var s=0,d=0,f=0;f<7;f++){if(1&o){var p=(1<<f)-1;p<32?d^=1<<p:s^=1<<p-32}128&o?o=o<<1^113:o<<=1}l[i]=a.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=a.create()}();var f=s.SHA3=i.extend({cfg:i.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,o=0;o<n;o++){var i=e[t+2*o],a=e[t+2*o+1];i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(T=r[o]).high^=a,T.low^=i}for(var s=0;s<24;s++){for(var f=0;f<5;f++){for(var p=0,h=0,m=0;m<5;m++)p^=(T=r[f+5*m]).high,h^=T.low;var g=d[f];g.high=p,g.low=h}for(f=0;f<5;f++){var v=d[(f+4)%5],y=d[(f+1)%5],b=y.high,w=y.low;for(p=v.high^(b<<1|w>>>31),h=v.low^(w<<1|b>>>31),m=0;m<5;m++)(T=r[f+5*m]).high^=p,T.low^=h}for(var C=1;C<25;C++){var k=(T=r[C]).high,S=T.low,E=c[C];E<32?(p=k<<E|S>>>32-E,h=S<<E|k>>>32-E):(p=S<<E-32|k>>>64-E,h=k<<E-32|S>>>64-E);var B=d[u[C]];B.high=p,B.low=h}var _=d[0],x=r[0];for(_.high=x.high,_.low=x.low,f=0;f<5;f++)for(m=0;m<5;m++){var T=r[C=f+5*m],A=d[C],I=d[(f+1)%5+5*m],P=d[(f+2)%5+5*m];T.high=A.high^~I.high&P.high,T.low=A.low^~I.low&P.low}T=r[0];var R=l[s];T.high^=R.high,T.low^=R.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l<c;l++){var d=a[l],f=d.high,p=d.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(f)}return new o.init(u,s)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=i._createHelper(f),t.HmacSHA3=i._createHmacHelper(f)}(Math),r.SHA3)})),zL((function(e,t){var r;e.exports=(r=Uj,
28
+ */!function(o,i){var a="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",m="console",g="mobile",v="tablet",y="smarttv",b="wearable",w={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:i},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},C={rgx:function(e,t){for(var r,n,o,s,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(o=0;o<p.length;o++)l=u[++n],By(s=p[o])===c&&s.length>0?2==s.length?By(s[1])==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?By(s[1])!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):i:this[s[0]]=l?s[1].call(this,l,s[2]):i:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):i):this[s]=l||i;d+=2}},str:function(e,t){for(var r in t)if(By(t[r])===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(w.has(t[r][n],e))return"?"===r?i:r}else if(w.has(t[r],e))return"?"===r?i:r;return e}},k={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},S={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,p],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],p],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[l,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[l,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[l,p],[/(QQ)\/([\d\.]+)/i],[l,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[l,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,p],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[l,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,l],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[p,C.str,k.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],p],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,w.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",w.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,w.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,f,[d,v]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[d,v]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[f,u,[d,v]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[u,[f,"Amazon"],[d,v]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[u,C.str,k.device.amazon.model],[f,"Amazon"],[d,g]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[d,g]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[d,g]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[f,u,[d,g]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[d,g]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[u,[f,"Asus"],[d,v]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[d,v]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[u,[f,"Sony"],[d,g]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[d,m]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[d,m]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[d,m]],[/(sprint\s(\w+))/i],[[f,C.str,k.device.sprint.vendor],[u,C.str,k.device.sprint.model],[d,g]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[f,u,[d,v]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[d,g]],[/(nexus\s9)/i],[u,[f,"HTC"],[d,v]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[u,[f,"Huawei"],[d,g]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[d,g]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[d,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[d,g]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[u,[f,"Motorola"],[d,g]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[d,v]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,w.trim],[u,w.trim],[d,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[d,y]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[d,y]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[f,"Samsung"],u,[d,v]],[/smart-tv.+(samsung)/i],[f,[d,y],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[d,g]],[/sie-(\w*)/i],[u,[f,"Siemens"],[d,g]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[d,g]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[u,[f,"Acer"],[d,v]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[d,v]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[d,v]],[/(lg) netcast\.tv/i],[f,u,[d,y]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[d,g]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[d,v]],[/linux;.+((jolla));/i],[f,u,[d,g]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[d,b]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[d,g]],[/crkey/i],[[u,"Chromecast"],[f,"Google"]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[d,b]],[/android.+;\s(pixel c)\s/i],[u,[f,"Google"],[d,v]],[/android.+;\s(pixel xl|pixel)\s/i],[u,[f,"Google"],[d,g]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,g]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,v]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[d,v]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[u,[f,"OnePlus"],[d,g]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[d,v]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[d,v]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[d,v]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[d,v]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[d,v]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[d,v]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[d,g]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[d,v]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[d,v]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[d,v]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[d,v]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[d,v]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[d,g]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[d,g]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[d,v]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[u,[f,"MachSpeed"],[d,v]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[d,v]],[/android.+(KS(.+))\s+build/i],[u,[f,"Amazon"],[d,v]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[d,v]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[d,w.lowerize],f,u],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,p],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[p,C.str,k.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,C.str,k.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],p],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[l,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],p],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],p],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[l,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,p],[/(haiku)\s(\w+)/i],[l,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[l,p]]},E=function e(t,r){if("object"==By(t)&&(r=t,t=i),!(this instanceof e))return new e(t,r).getResult();var n=t||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),a=r?w.extend(S,r):S;return this.getBrowser=function(){var e={name:i,version:i};return C.rgx.call(e,n,a.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:i};return C.rgx.call(e,n,a.cpu),e},this.getDevice=function(){var e={vendor:i,model:i,type:i};return C.rgx.call(e,n,a.device),e},this.getEngine=function(){var e={name:i,version:i};return C.rgx.call(e,n,a.engine),e},this.getOS=function(){var e={name:i,version:i};return C.rgx.call(e,n,a.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};E.VERSION="0.7.18",E.BROWSER={NAME:l,MAJOR:"major",VERSION:p},E.CPU={ARCHITECTURE:h},E.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:m,MOBILE:g,SMARTTV:y,TABLET:v,WEARABLE:b,EMBEDDED:"embedded"},E.ENGINE={NAME:l,VERSION:p},E.OS={NAME:l,VERSION:p},By(t)!==s?(By(e)!==s&&e.exports&&(t=e.exports=E),t.UAParser=E):r(3)?(n=function(){return E}.call(t,r,t,e))===i||(e.exports=n):o&&(o.UAParser=E);var B=o&&(o.jQuery||o.Zepto);if(By(B)!==s){var _=new E;B.ua=_.getResult(),B.ua.get=function(){return _.getUA()},B.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":By(window))?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),i=o.DEVICE_TYPES,a=o.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case i.MOBILE:return{isMobile:!0};case i.TABLET:return{isTablet:!0};case i.SMART_TV:return{isSmartTV:!0};case i.CONSOLE:return{isConsole:!0};case i.WEARABLE:return{isWearable:!0};case i.BROWSER:return{isBrowser:!0};default:return a}},broPayload:function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:o}},mobilePayload:function(e,t,r,o){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:o})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])}));function Ij(){return"5.17.3"}function Pj(){return{"X-TV-Device-Model":"".concat(Aj.browserName," ").concat(Aj.browserVersion),"X-TV-OS-Version":"".concat(Aj.osName," ").concat(Aj.osVersion),"X-TV-OS-Platform":Aj.isMobile?"".concat(Aj.osName.toLowerCase(),"_web"):"web","X-TV-SDK-Version":"5.17.3"}}var Rj=Object.freeze({__proto__:null,getUAMetadata:Pj});function Dj(e){return e<10?"0".concat(e):e}function Oj(e){return"".concat(e.getFullYear(),"-").concat(Dj(e.getMonth()+1),"-").concat(Dj(e.getDate()),"T").concat(Dj(e.getHours()),":").concat(Dj(e.getMinutes()),":").concat(Dj(e.getSeconds())).concat(function(e){if(0===e)return"Z";var t=e>0?"-":"+";return e=Math.abs(e),"".concat(t+Dj(Math.floor(e/60)),":").concat(Dj(e%60))}(e.getTimezoneOffset()))}var Nj=Object.freeze({__proto__:null,rfc3339:Oj});function Lj(e,t){window.localStorage&&window.JSON&&t&&localStorage.setItem(t,JSON.stringify(e))}function Mj(e){if(window.localStorage&&window.JSON&&e){var t=localStorage.getItem(e);if(t)return JSON.parse(t)}}var Fj=Object.freeze({__proto__:null,storeData:Lj,getData:Mj,removeData:function(e){window.localStorage&&window.JSON&&e&&localStorage.removeItem(e)}}),Uj=zL((function(e,t){var r;e.exports=r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==jL&&jL.crypto&&(r=jL.crypto),!r)try{r=bj}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var a=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=a<<24-(n+i)%4*8}else for(var s=0;s<o;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new c.init(t,e)}}),u=i.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},d=u.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},f=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*u,i);if(u){for(var d=0;d<u;d+=a)this._doProcessBlock(o,d);r=o.splice(0,u),n.sigBytes-=l}return new c.init(r,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),h=(a.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}}),i.algo={});return i}(Math)})),jj=(zL((function(e,t){var r,n,o,i,a,s;e.exports=(n=(r=s=Uj).lib,o=n.Base,i=n.WordArray,(a=r.x64={}).Word=o.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var o=e[n];r.push(o.high),r.push(o.low)}return i.create(r,this.sigBytes)},clone:function(){for(var e=o.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),s)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){if("function"==typeof ArrayBuffer){var e=r.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],o=0;o<r;o++)n[o>>>2]|=e[o]<<24-o%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var i=t[o>>>2]>>>16-o%4*8&65535;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o<r;o++)n[o>>>1]|=e.charCodeAt(o)<<16-o%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var a=o(t[i>>>2]>>>16-i%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=o(e.charCodeAt(i)<<16-i%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var o=[],i=0,a=0;a<r;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return t.create(o,i)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],i=0;i<r;i+=3)for(var a=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s<r;s++)o.push(n.charAt(a>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return n(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var o=[],i=0,a=0;a<r;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return t.create(o,i)}e.enc.Base64url={stringify:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.words,n=e.sigBytes,o=t?this._safe_map:this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var s=(r[a>>>2]>>>24-a%4*8&255)<<16|(r[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|r[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c<n;c++)i.push(o.charAt(s>>>6*(3-c)&63));var u=o.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.length,o=t?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<o.length;a++)i[o.charCodeAt(a)]=a}var s=o.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(r=c)}return n(e,r,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),r.enc.Base64url)})),zL((function(e,t){var r;e.exports=(r=Uj,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=a.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,o=e[n];e[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var i=this._hash.words,a=e[t+0],c=e[t+1],p=e[t+2],h=e[t+3],m=e[t+4],g=e[t+5],v=e[t+6],y=e[t+7],b=e[t+8],w=e[t+9],C=e[t+10],k=e[t+11],S=e[t+12],E=e[t+13],B=e[t+14],_=e[t+15],x=i[0],T=i[1],A=i[2],I=i[3];x=u(x,T,A,I,a,7,s[0]),I=u(I,x,T,A,c,12,s[1]),A=u(A,I,x,T,p,17,s[2]),T=u(T,A,I,x,h,22,s[3]),x=u(x,T,A,I,m,7,s[4]),I=u(I,x,T,A,g,12,s[5]),A=u(A,I,x,T,v,17,s[6]),T=u(T,A,I,x,y,22,s[7]),x=u(x,T,A,I,b,7,s[8]),I=u(I,x,T,A,w,12,s[9]),A=u(A,I,x,T,C,17,s[10]),T=u(T,A,I,x,k,22,s[11]),x=u(x,T,A,I,S,7,s[12]),I=u(I,x,T,A,E,12,s[13]),A=u(A,I,x,T,B,17,s[14]),x=l(x,T=u(T,A,I,x,_,22,s[15]),A,I,c,5,s[16]),I=l(I,x,T,A,v,9,s[17]),A=l(A,I,x,T,k,14,s[18]),T=l(T,A,I,x,a,20,s[19]),x=l(x,T,A,I,g,5,s[20]),I=l(I,x,T,A,C,9,s[21]),A=l(A,I,x,T,_,14,s[22]),T=l(T,A,I,x,m,20,s[23]),x=l(x,T,A,I,w,5,s[24]),I=l(I,x,T,A,B,9,s[25]),A=l(A,I,x,T,h,14,s[26]),T=l(T,A,I,x,b,20,s[27]),x=l(x,T,A,I,E,5,s[28]),I=l(I,x,T,A,p,9,s[29]),A=l(A,I,x,T,y,14,s[30]),x=d(x,T=l(T,A,I,x,S,20,s[31]),A,I,g,4,s[32]),I=d(I,x,T,A,b,11,s[33]),A=d(A,I,x,T,k,16,s[34]),T=d(T,A,I,x,B,23,s[35]),x=d(x,T,A,I,c,4,s[36]),I=d(I,x,T,A,m,11,s[37]),A=d(A,I,x,T,y,16,s[38]),T=d(T,A,I,x,C,23,s[39]),x=d(x,T,A,I,E,4,s[40]),I=d(I,x,T,A,a,11,s[41]),A=d(A,I,x,T,h,16,s[42]),T=d(T,A,I,x,v,23,s[43]),x=d(x,T,A,I,w,4,s[44]),I=d(I,x,T,A,S,11,s[45]),A=d(A,I,x,T,_,16,s[46]),x=f(x,T=d(T,A,I,x,p,23,s[47]),A,I,a,6,s[48]),I=f(I,x,T,A,y,10,s[49]),A=f(A,I,x,T,B,15,s[50]),T=f(T,A,I,x,g,21,s[51]),x=f(x,T,A,I,S,6,s[52]),I=f(I,x,T,A,h,10,s[53]),A=f(A,I,x,T,C,15,s[54]),T=f(T,A,I,x,c,21,s[55]),x=f(x,T,A,I,b,6,s[56]),I=f(I,x,T,A,_,10,s[57]),A=f(A,I,x,T,v,15,s[58]),T=f(T,A,I,x,E,21,s[59]),x=f(x,T,A,I,m,6,s[60]),I=f(I,x,T,A,k,10,s[61]),A=f(A,I,x,T,p,15,s[62]),T=f(T,A,I,x,w,21,s[63]),i[0]=i[0]+x|0,i[1]=i[1]+T|0,i[2]=i[2]+A|0,i[3]=i[3]+I|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;r[o>>>5]|=128<<24-o%32;var i=e.floor(n/4294967296),a=n;r[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,o,i,a){var s=e+(t&r|~t&n)+o+a;return(s<<i|s>>>32-i)+t}function l(e,t,r,n,o,i,a){var s=e+(t&n|r&~n)+o+a;return(s<<i|s>>>32-i)+t}function d(e,t,r,n,o,i,a){var s=e+(t^r^n)+o+a;return(s<<i|s>>>32-i)+t}function f(e,t,r,n,o,i,a){var s=e+(r^(t|~n))+o+a;return(s<<i|s>>>32-i)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),r.MD5)})),zL((function(e,t){var r,n,o,i,a,s,c,u;e.exports=(n=(r=u=Uj).lib,o=n.WordArray,i=n.Hasher,a=r.algo,s=[],c=a.SHA1=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],c=r[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}var d=(n<<5|n>>>27)+c+s[u];d+=u<20?1518500249+(o&i|~o&a):u<40?1859775393+(o^i^a):u<60?(o&i|o&a|i&a)-1894007588:(o^i^a)-899497514,c=a,a=i,i=o<<30|o>>>2,o=n,n=d}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=i._createHelper(c),r.HmacSHA1=i._createHmacHelper(c),u.SHA1)})),zL((function(e,t){var r;e.exports=(r=Uj,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,o=0;o<64;)t(n)&&(o<8&&(s[o]=r(e.pow(n,.5))),c[o]=r(e.pow(n,1/3)),o++),n++}();var u=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,g=u[p-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[p]=m+u[p-7]+v+u[p-16]}var y=n&o^n&i^o&i,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&d)+c[p]+u[p];f=d,d=l,l=s,s=a+w|0,a=i,i=o,o=n,n=w+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+d|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=e.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),r.SHA256)})),zL((function(e,t){var r,n,o,i,a,s;e.exports=(n=(r=s=Uj).lib.WordArray,o=r.algo,i=o.SHA256,a=o.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=i._createHelper(a),r.HmacSHA224=i._createHmacHelper(a),s.SHA224)})),zL((function(e,t){var r;e.exports=(r=Uj,function(){var e=r,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,a=e.algo;function s(){return o.create.apply(o,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var l=a.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],l=r[5],d=r[6],f=r[7],p=n.high,h=n.low,m=o.high,g=o.low,v=i.high,y=i.low,b=a.high,w=a.low,C=s.high,k=s.low,S=l.high,E=l.low,B=d.high,_=d.low,x=f.high,T=f.low,A=p,I=h,P=m,R=g,D=v,O=y,N=b,L=w,M=C,F=k,U=S,j=E,V=B,z=_,q=x,H=T,W=0;W<80;W++){var K,Q,G=u[W];if(W<16)Q=G.high=0|e[t+2*W],K=G.low=0|e[t+2*W+1];else{var X=u[W-15],Y=X.high,$=X.low,Z=(Y>>>1|$<<31)^(Y>>>8|$<<24)^Y>>>7,J=($>>>1|Y<<31)^($>>>8|Y<<24)^($>>>7|Y<<25),ee=u[W-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,oe=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ie=u[W-7],ae=ie.high,se=ie.low,ce=u[W-16],ue=ce.high,le=ce.low;Q=(Q=(Q=Z+ae+((K=J+se)>>>0<J>>>0?1:0))+ne+((K+=oe)>>>0<oe>>>0?1:0))+ue+((K+=le)>>>0<le>>>0?1:0),G.high=Q,G.low=K}var de,fe=M&U^~M&V,pe=F&j^~F&z,he=A&P^A&D^P&D,me=I&R^I&O^R&O,ge=(A>>>28|I<<4)^(A<<30|I>>>2)^(A<<25|I>>>7),ve=(I>>>28|A<<4)^(I<<30|A>>>2)^(I<<25|A>>>7),ye=(M>>>14|F<<18)^(M>>>18|F<<14)^(M<<23|F>>>9),be=(F>>>14|M<<18)^(F>>>18|M<<14)^(F<<23|M>>>9),we=c[W],Ce=we.high,ke=we.low,Se=q+ye+((de=H+be)>>>0<H>>>0?1:0),Ee=ve+me;q=V,H=z,V=U,z=j,U=M,j=F,M=N+(Se=(Se=(Se=Se+fe+((de+=pe)>>>0<pe>>>0?1:0))+Ce+((de+=ke)>>>0<ke>>>0?1:0))+Q+((de+=K)>>>0<K>>>0?1:0))+((F=L+de|0)>>>0<L>>>0?1:0)|0,N=D,L=O,D=P,O=R,P=A,R=I,A=Se+(ge+he+(Ee>>>0<ve>>>0?1:0))+((I=de+Ee|0)>>>0<de>>>0?1:0)|0}h=n.low=h+I,n.high=p+A+(h>>>0<I>>>0?1:0),g=o.low=g+R,o.high=m+P+(g>>>0<R>>>0?1:0),y=i.low=y+O,i.high=v+D+(y>>>0<O>>>0?1:0),w=a.low=w+L,a.high=b+N+(w>>>0<L>>>0?1:0),k=s.low=k+F,s.high=C+M+(k>>>0<F>>>0?1:0),E=l.low=E+j,l.high=S+U+(E>>>0<j>>>0?1:0),_=d.low=_+z,d.high=B+V+(_>>>0<z>>>0?1:0),T=f.low=T+H,f.high=x+q+(T>>>0<H>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),r.SHA512)})),zL((function(e,t){var r,n,o,i,a,s,c,u;e.exports=(n=(r=u=Uj).x64,o=n.Word,i=n.WordArray,a=r.algo,s=a.SHA512,c=a.SHA384=s.extend({_doReset:function(){this._hash=new i.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=s._createHelper(c),r.HmacSHA384=s._createHmacHelper(c),u.SHA384)})),zL((function(e,t){var r;e.exports=(r=Uj,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.x64.Word,s=t.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var o=1,i=0;i<24;i++){for(var s=0,d=0,f=0;f<7;f++){if(1&o){var p=(1<<f)-1;p<32?d^=1<<p:s^=1<<p-32}128&o?o=o<<1^113:o<<=1}l[i]=a.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=a.create()}();var f=s.SHA3=i.extend({cfg:i.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,o=0;o<n;o++){var i=e[t+2*o],a=e[t+2*o+1];i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(T=r[o]).high^=a,T.low^=i}for(var s=0;s<24;s++){for(var f=0;f<5;f++){for(var p=0,h=0,m=0;m<5;m++)p^=(T=r[f+5*m]).high,h^=T.low;var g=d[f];g.high=p,g.low=h}for(f=0;f<5;f++){var v=d[(f+4)%5],y=d[(f+1)%5],b=y.high,w=y.low;for(p=v.high^(b<<1|w>>>31),h=v.low^(w<<1|b>>>31),m=0;m<5;m++)(T=r[f+5*m]).high^=p,T.low^=h}for(var C=1;C<25;C++){var k=(T=r[C]).high,S=T.low,E=c[C];E<32?(p=k<<E|S>>>32-E,h=S<<E|k>>>32-E):(p=S<<E-32|k>>>64-E,h=k<<E-32|S>>>64-E);var B=d[u[C]];B.high=p,B.low=h}var _=d[0],x=r[0];for(_.high=x.high,_.low=x.low,f=0;f<5;f++)for(m=0;m<5;m++){var T=r[C=f+5*m],A=d[C],I=d[(f+1)%5+5*m],P=d[(f+2)%5+5*m];T.high=A.high^~I.high&P.high,T.low=A.low^~I.low&P.low}T=r[0];var R=l[s];T.high^=R.high,T.low^=R.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l<c;l++){var d=a[l],f=d.high,p=d.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(f)}return new o.init(u,s)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=i._createHelper(f),t.HmacSHA3=i._createHmacHelper(f)}(Math),r.SHA3)})),zL((function(e,t){var r;e.exports=(r=Uj,
29
29
  /** @preserve
30
30
  (c) 2012 by Cédric Mesnil. All rights reserved.
31
31
 
@@ -57,7 +57,7 @@ function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,a=t.algo,s=o.create([0,1,2,
57
57
  * @since jsrsasign 2.1
58
58
  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
59
59
  */
60
- var KH={};void 0!==KH.asn1&&KH.asn1||(KH.asn1={}),KH.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",o=0;o<r;o++)n+="f";t=new bH(n,16).xor(e).add(bH.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=KH.asn1,r=t.DERBoolean,n=t.DERInteger,o=t.DERBitString,i=t.DEROctetString,a=t.DERNull,s=t.DERObjectIdentifier,c=t.DEREnumerated,u=t.DERUTF8String,l=t.DERNumericString,d=t.DERPrintableString,f=t.DERTeletexString,p=t.DERIA5String,h=t.DERUTCTime,m=t.DERGeneralizedTime,g=t.DERSequence,v=t.DERSet,y=t.DERTaggedObject,b=t.ASN1Util.newObject,w=Object.keys(e);if(1!=w.length)throw"key of param shall be only one.";var C=w[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+C+":"))throw"undefined key: "+C;if("bool"==C)return new r(e[C]);if("int"==C)return new n(e[C]);if("bitstr"==C)return new o(e[C]);if("octstr"==C)return new i(e[C]);if("null"==C)return new a(e[C]);if("oid"==C)return new s(e[C]);if("enum"==C)return new c(e[C]);if("utf8str"==C)return new u(e[C]);if("numstr"==C)return new l(e[C]);if("prnstr"==C)return new d(e[C]);if("telstr"==C)return new f(e[C]);if("ia5str"==C)return new p(e[C]);if("utctime"==C)return new h(e[C]);if("gentime"==C)return new m(e[C]);if("seq"==C){for(var k=e[C],S=[],E=0;E<k.length;E++){var B=b(k[E]);S.push(B)}return new g({array:S})}if("set"==C){for(k=e[C],S=[],E=0;E<k.length;E++)B=b(k[E]),S.push(B);return new v({array:S})}if("tag"==C){var _=e[C];if("[object Array]"===Object.prototype.toString.call(_)&&3==_.length){var x=b(_[2]);return new y({tag:_[0],explicit:_[1],obj:x})}var T={};if(void 0!==_.explicit&&(T.explicit=_.explicit),void 0!==_.tag&&(T.tag=_.tag),void 0===_.obj)throw"obj shall be specified for 'tag'.";return T.obj=b(_.obj),new y(T)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},KH.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),o=2;o<e.length;o+=2){var i=("00000000"+parseInt(e.substr(o,2),16).toString(2)).slice(-8);n+=i.substr(1,7),"0"==i.substr(0,1)&&(t=t+"."+new bH(n,2).toString(10),n="")}return t},KH.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new bH(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);return n},KH.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KH.asn1.DERAbstractString=function(e){KH.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},WH.lang.extend(KH.asn1.DERAbstractString,KH.asn1.ASN1Object),KH.asn1.DERAbstractTime=function(e){KH.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,r){var n=this.zeroPadding,o=this.localDateToUTC(e),i=String(o.getFullYear());"utc"==t&&(i=i.substr(2,2));var a=i+n(String(o.getMonth()+1),2)+n(String(o.getDate()),2)+n(String(o.getHours()),2)+n(String(o.getMinutes()),2)+n(String(o.getSeconds()),2);if(!0===r){var s=o.getMilliseconds();if(0!=s){var c=n(String(s),3);a=a+"."+(c=c.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,r,n,o,i){var a=new Date(Date.UTC(e,t-1,r,n,o,i,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},WH.lang.extend(KH.asn1.DERAbstractTime,KH.asn1.ASN1Object),KH.asn1.DERAbstractStructured=function(e){KH.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},WH.lang.extend(KH.asn1.DERAbstractStructured,KH.asn1.ASN1Object),KH.asn1.DERBoolean=function(){KH.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},WH.lang.extend(KH.asn1.DERBoolean,KH.asn1.ASN1Object),KH.asn1.DERInteger=function(e){KH.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=KH.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},WH.lang.extend(KH.asn1.DERInteger,KH.asn1.ASN1Object),KH.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=KH.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}KH.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var o=e.substr(r,8),i=parseInt(o,2).toString(16);1==i.length&&(i="0"+i),n+=i}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},WH.lang.extend(KH.asn1.DERBitString,KH.asn1.ASN1Object),KH.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=KH.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}KH.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},WH.lang.extend(KH.asn1.DEROctetString,KH.asn1.DERAbstractString),KH.asn1.DERNull=function(){KH.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},WH.lang.extend(KH.asn1.DERNull,KH.asn1.ASN1Object),KH.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new bH(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};KH.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var t=KH.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},WH.lang.extend(KH.asn1.DERObjectIdentifier,KH.asn1.ASN1Object),KH.asn1.DEREnumerated=function(e){KH.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=KH.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},WH.lang.extend(KH.asn1.DEREnumerated,KH.asn1.ASN1Object),KH.asn1.DERUTF8String=function(e){KH.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},WH.lang.extend(KH.asn1.DERUTF8String,KH.asn1.DERAbstractString),KH.asn1.DERNumericString=function(e){KH.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},WH.lang.extend(KH.asn1.DERNumericString,KH.asn1.DERAbstractString),KH.asn1.DERPrintableString=function(e){KH.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},WH.lang.extend(KH.asn1.DERPrintableString,KH.asn1.DERAbstractString),KH.asn1.DERTeletexString=function(e){KH.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},WH.lang.extend(KH.asn1.DERTeletexString,KH.asn1.DERAbstractString),KH.asn1.DERIA5String=function(e){KH.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},WH.lang.extend(KH.asn1.DERIA5String,KH.asn1.DERAbstractString),KH.asn1.DERUTCTime=function(e){KH.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},WH.lang.extend(KH.asn1.DERUTCTime,KH.asn1.DERAbstractTime),KH.asn1.DERGeneralizedTime=function(e){KH.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},WH.lang.extend(KH.asn1.DERGeneralizedTime,KH.asn1.DERAbstractTime),KH.asn1.DERSequence=function(e){KH.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},WH.lang.extend(KH.asn1.DERSequence,KH.asn1.DERAbstractStructured),KH.asn1.DERSet=function(e){KH.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},WH.lang.extend(KH.asn1.DERSet,KH.asn1.DERAbstractStructured),KH.asn1.DERTaggedObject=function(e){KH.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},WH.lang.extend(KH.asn1.DERTaggedObject,KH.asn1.ASN1Object);var QH,GH,XH,YH,$H=(QH=function(e,t){return(QH=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}QH(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ZH=function(e){function t(r){var n=e.call(this)||this;return r&&("string"==typeof r?n.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&n.parsePropertiesFrom(r)),n}return $H(t,e),t.prototype.parseKey=function(e){try{var t=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?aH(e):sH.unarmor(e),o=mH.decode(n);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=BH(t,16),r=o.sub[2].getHexStringValue(),this.e=parseInt(r,16);var i=o.sub[3].getHexStringValue();this.d=BH(i,16);var a=o.sub[4].getHexStringValue();this.p=BH(a,16);var s=o.sub[5].getHexStringValue();this.q=BH(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=BH(c,16);var u=o.sub[7].getHexStringValue();this.dmq1=BH(u,16);var l=o.sub[8].getHexStringValue();this.coeff=BH(l,16)}else{if(2!==o.sub.length)return!1;if(o.sub[0].sub){var d=o.sub[1].sub[0];t=d.sub[0].getHexStringValue(),this.n=BH(t,16),r=d.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=o.sub[0].getHexStringValue(),this.n=BH(t,16),r=o.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new KH.asn1.DERInteger({int:0}),new KH.asn1.DERInteger({bigint:this.n}),new KH.asn1.DERInteger({int:this.e}),new KH.asn1.DERInteger({bigint:this.d}),new KH.asn1.DERInteger({bigint:this.p}),new KH.asn1.DERInteger({bigint:this.q}),new KH.asn1.DERInteger({bigint:this.dmp1}),new KH.asn1.DERInteger({bigint:this.dmq1}),new KH.asn1.DERInteger({bigint:this.coeff})]};return new KH.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return nH(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new KH.asn1.DERSequence({array:[new KH.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new KH.asn1.DERNull]}),t=new KH.asn1.DERSequence({array:[new KH.asn1.DERInteger({bigint:this.n}),new KH.asn1.DERInteger({int:this.e})]}),r=new KH.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new KH.asn1.DERSequence({array:[e,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return nH(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return(e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return(e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(qH),JH=function(){function e(e){void 0===e&&(e={}),e=e||{},this.default_key_size=e.default_key_size?parseInt(e.default_key_size,10):1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}return e.prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ZH(e)},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt(oH(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return nH(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,t,r){try{return nH(this.getKey().sign(e,t,r))}catch(e){return!1}},e.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,oH(t),r)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new ZH,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version="3.3.0",e}(),eW=function(e,t,r,n){if(!iM(e))return e;for(var o=-1,i=(t=UU(t,e)).length,a=i-1,s=e;null!=s&&++o<i;){var c=VU(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var l=s[c];void 0===(u=n?n(l,c,s):void 0)&&(u=iM(l)?l:sF(t[o+1])?[]:{})}GM(s,c,u),s=s[c]}return e},tW=function(e,t,r){return null==e?e:eW(e,t,r)},rW=["-","-","-","-","-","B","E","G","I","N"," ","P","U","B","L","I","C"," ","K","E","Y","-","-","-","-","-","\n"," "," ","M","I","I","B","I","j","A","N","B","g","k","q","h","k","i","G","9","w","0","B","A","Q","E","F","A","A","O","C","A","Q","8","A","M","I","I","B","C","g","K","C","A","Q","E","A","z","7","v","7","a","s","x","M","n","j","L","3","/","j","G","E","d","M","3","T","\n"," "," ","j","0","h","X","b","h","r","/","m","N","2","B","m","j","/","Y","e","6","I","y","1","T","t","g","E","S","W","j","r","V","Y","Z","J","k","a","+","T","L","+","L","0","U","n","h","i","8","l","W","x","2","w","R","s","+","N","i","u","Y","f","g","+","B","U","b","\n"," "," ","s","e","y","L","j","G","B","q","N","t","z","x","H","Z","K","v","d","h","d","i","r","o","y","R","y","C","S","f","p","m","f","h","Q","C","P","s","K","q","/","y","k","1","m","A","e","/","9","1","W","Y","J","b","l","K","h","W","Y","q","W","0","2","I","G","/","\n"," "," ","g","h","r","z","0","b","i","Y","X","C","b","5","m","6","s","R","o","7","e","J","p","4","F","e","2","1","U","N","Q","W","O","o","y","V","2","M","9","o","+","n","G","l","0","P","+","V","A","I","z","q","Z","m","l","P","w","w","v","w","B","i","l","f","X","e","\n"," "," ","W","V","P","x","9","6","f","2","c","A","I","h","S","2","b","W","f","f","d","X","3","w","p","c","1","C","E","m","c","v","9","V","E","f","o","j","j","i","X","O","7","I","n","k","u","P","t","H","4","W","2","E","P","Z","0","8","C","z","3","+","e","Q","2","k","\n"," "," ","D","z","c","j","P","9","8","Q","T","p","u","w","2","E","X","C","S","1","w","s","k","Z","C","2","1","j","L","8","j","z","X","H","a","W","3","B","q","O","h","s","V","G","9","T","F","S","y","c","l","F","g","e","n","r","G","s","Z","i","t","h","l","l","K","/","\n"," "," ","t","Q","I","D","A","Q","A","B","\n"," "," ","-","-","-","-","-","E","N","D"," ","P","U","B","L","I","C"," ","K","E","Y","-","-","-","-","-"],nW={},oW={SELFIE:"selfie",ID_CARD:"id_card"},iW=Oq((function(e){var t=new JH,r=e||rW.join("");return t.setPublicKey(r),t})),aW=function(e){var t=e.gesture;return{capture_time:e.captureTime,type:t,frames:e.frames,blur_score:e.blurScore,step:e.step}},sW=function(e){var t=e.detectedCard,r=e.captureTime,n=e.vCam,o=e.captureCount,i=e.captureDuration,a=e.captureType,s=e.cardTracking;return{capture_time:r,type:null==t?void 0:t.label,v_cam:n,capture_count:o,capture_duration:i,capture_type:a,card_tracking:s}},cW=function(){var e=dL(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return CL(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},e.abrupt("return",new Promise((function(e){var o=new TextEncoder,i=o.encode(t),a=o.encode(r);window.crypto.subtle.importKey("raw",a,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,i).then((function(t){e("".concat(YH,".").concat(n(t)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),uW=function(){var e=dL(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.mode,o=t.imageData,t.enableExifData){e.next=3;break}return e.abrupt("return",new Promise((function(e){return e(o.blob)})));case 3:return i=yL(yL({},nW),n===oW.SELFIE?aW(o):sW(o)),a=yL(yL({},i),{},{sensor_data:"sensor data exceed 64KB"}),null!=o&&null!==(r=o.type)&&void 0!==r&&r.includes("qr")&&(i={capture_time:null==o?void 0:o.captureTime,type:null==o?void 0:o.type,qr_string:null==o?void 0:o.result}),e.next=8,cW(JSON.stringify(a),XH);case 8:return s=e.sent,e.next=11,cW(JSON.stringify(i),XH);case 11:return c=e.sent,u=Qq.dump({Exif:mL({},Qq.ExifIFD.MakerNote,c)}),l=Qq.dump({Exif:mL({},Qq.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var t=new FileReader;t.onload=function(){var t=dL(regeneratorRuntime.mark((function t(r){var n,i,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{n=Qq.insert(u,r.target.result)}catch(t){try{n=Qq.insert(l,r.target.result)}catch(t){e(o.blob)}}return t.prev=1,t.next=4,fetch(n);case 4:return i=t.sent,t.next=7,i.blob();case 7:a=t.sent,URL.revokeObjectURL(n),e(a),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(1),e(o.blob);case 15:case"end":return t.stop()}}),t,null,[[1,12]])})));return function(e){return t.apply(this,arguments)}}(),t.readAsDataURL(o.blob)})));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),lW=Object.freeze({__proto__:null,MODE:oW,initExifData:function(){nW={device_info:{device_brand_name:"".concat("none"===Aj.mobileVendor?"null":Aj.mobileVendor),device_model:"".concat("none"===Aj.mobileModel?"null":Aj.mobileModel),browser_version:"".concat(Aj.browserName," ").concat(Aj.browserVersion),browser_userAgent:"".concat(Aj.getUA),os:Aj.osName,os_version:Aj.osVersion},sdk_version:"5.17.2",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,t){tW(nW,e,t)},preWriteExif:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mode,r=(e.motionData,e.orientationData,e.startTime),n=e.endTime,o=e.exifKey,i=void 0===o?"":o;nW.user_action=yL({},t===oW.SELFIE?{start_selfie:r,end_selfie:n}:{start_id_card:r,end_id_card:n}),XH=xj().replace(/-/g,""),GH||(GH=iW(i)),YH=oH(GH.encrypt(XH))},writeExif:uW}),dW="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",fW=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dW,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.342,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:368,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;fL(this,e),this.model_path=t,this.threshold=r,this.size=Math.round(n/2),this.enable_profiling=o,this.num_threads=i}var t,r;return hL(e,[{key:"load",value:(r=dL(regeneratorRuntime.mark((function e(){var t,r,n,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,e.next=3,Uq({modelUrl:this.model_path,options:{numThreads:this.num_threads,enableProfiling:this.enable_profiling}});case 3:this.model=e.sent,n=this.model.inputs[0],this.input_width=n.shape[1],this.input_height=n.shape[2],r.tidy((function(){var e=r.randomNormal([1,o.input_width,o.input_height,3]);o.model.predict(e)}));case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"crop_eyes",value:function(e,t){var r=this,n=window.tf,o=t[0].map((function(e){return Math.round(e)})),i=t[1].map((function(e){return Math.round(e)}));o[0]>i[0]&&(o=t[1].map((function(e){return Math.round(e)})),i=t[0].map((function(e){return Math.round(e)})));var a=Math.round((o[0]+i[0])/2),s=a-o[0],c=i[0]-a;s>=this.size&&(s=this.size),c>=this.size&&(c=this.size);var u=Math.max(o[0]-s,0),l=Math.max(o[1]-s,0),d=Math.max(i[0]-c,0),f=Math.max(i[1]-c,0);return n.tidy((function(){var t=e.slice([l,u,0],[2*s,2*s,3]),o=e.slice([f,d,0],[2*c,2*c,3]);return{l_img:t=n.expandDims(n.image.resizeBilinear(t,[r.input_width,r.input_height])),r_img:o=n.expandDims(n.image.resizeBilinear(o,[r.input_width,r.input_height]))}}))}},{key:"predict",value:(t=dL(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,s,c,u,l,d,f=this,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>2&&void 0!==p[2]?p[2]:this.threshold,o=window,i=o.tf,a=t.getContext("2d"),s=a.getImageData(0,0,t.height,t.width),c=i.tidy((function(){var e=i.browser.fromPixels(s),t=f.crop_eyes(e,r),o=t.l_img,a=t.r_img,c=f.model.predict(o).arraySync()[0],u=f.model.predict(a).arraySync()[0];return[c>n,u>n]})),u=wL(c,2),l=u[0],d=u[1],e.abrupt("return",{isEyeClose:l||d});case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}(),pW=function(){var e=dL(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!DeviceMotionEvent||"function"!=typeof DeviceMotionEvent.requestPermission){e.next=2;break}return e.abrupt("return",DeviceMotionEvent.requestPermission());case 2:return e.abrupt("return",new Promise((function(e){return e("granted")})));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function hW(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,r=void 0===t?100:t,n=xw.useRef([]),o=xw.useRef([]),i=(xw.useRef(!1),xw.useRef({})),a=xw.useCallback((function(e){var t=Date.now(),n=e.type;return!!(i.current[n]&&t-i.current[n]<r)||(i.current[n]=t,!1)}),[r]),s=xw.useCallback((function(e){a(e)||o.current.push({time:Date.now(),alpha:null==e?void 0:e.alpha,beta:null==e?void 0:e.beta,gamma:null==e?void 0:e.gamma})}),[a]),c=xw.useCallback((function(e){var t,r,o,i,s,c;a(e)||n.current.push({time:Date.now(),Accelerometer:{x:null==e||null===(t=e.acceleration)||void 0===t?void 0:t.x,y:null==e||null===(r=e.acceleration)||void 0===r?void 0:r.y,z:null==e||null===(o=e.acceleration)||void 0===o?void 0:o.z},Gyroscope:{z:null==e||null===(i=e.rotationRate)||void 0===i?void 0:i.alpha,x:null==e||null===(s=e.rotationRate)||void 0===s?void 0:s.beta,y:null==e||null===(c=e.rotationRate)||void 0===c?void 0:c.gamma}})}),[a]),u=xw.useCallback((function(){}),[c,s]),l=xw.useCallback((function(){}),[c,s]);return xw.useEffect((function(){return function(){l()}}),[l]),{motionData:n.current,orientationData:o.current,startMotion:u,stopMotion:l}}var mW=function(){return URL.createObjectURL(new Blob(['\'use strict\';(function(){function T(a,b){let c=[],d="";b=a.readBits([8,16,16][b]);for(let d=0;d<b;d++){let b=a.readBits(8);c.push(b)}try{d+=decodeURIComponent(c.map(a=>`%${("0"+a.toString(16)).substr(-2)}`).join(""))}catch(e){}return{bytes:c,text:d}}function U(a,b){a=new V(a);let c=9>=b?0:26>=b?1:2;for(b={text:"",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===t.Terminator)return b;if(d===t.ECI)0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(7)}):\n0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:r.ECI,assignmentNumber:-1});else if(d===t.Numeric){var e=a;d=[];for(var f="",g=e.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error("Invalid numeric value above 999");var k=Math.floor(h/100),n=Math.floor(h/10)%10;h%=10;d.push(48+k,48+n,48+h);f+=k.toString()+n.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);\nif(100<=g)throw Error("Invalid numeric value above 99");e=Math.floor(g/10);g%=10;d.push(48+e,48+g);f+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error("Invalid numeric value above 9");d.push(48+e);f+=e.toString()}d={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Numeric,text:d.text})}else if(d===t.Alphanumeric){e=a;d=[];f="";for(g=e.readBits([9,11,13][c]);2<=g;)n=e.readBits(11),k=Math.floor(n/45),n%=45,d.push(B[k].charCodeAt(0),B[n].charCodeAt(0)),\nf+=B[k]+B[n],g-=2;1===g&&(e=e.readBits(6),d.push(B[e].charCodeAt(0)),f+=B[e]);d={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Alphanumeric,text:d.text})}else if(d===t.Byte)d=T(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:r.Byte,bytes:d.bytes,text:d.text});else if(d===t.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder("shift-jis")).decode(Uint8Array.from(d));\nd={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Kanji,bytes:d.bytes,text:d.text})}else d===t.StructuredAppend&&b.chunks.push({type:r.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}function J(a,b){return a^b}function W(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let d=e;b=c;e=f;if(b.isZero())return null;\nc=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let d=c.degree()-b.degree(),e=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(d,e));c=c.addOrSubtract(b.multiplyByMonomial(d,e))}f=f.multiplyPoly(e).addOrSubtract(d);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);if(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}function X(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new Y(285,\n256,0);var d=new w(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new w(a,e);d=W(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;d=d[1];e=b.length;f=Array(e);for(g=0;g<e;g++){h=a.inverse(b[g]);let c=1;for(let d=\n0;d<e;d++)g!==d&&(c=a.multiply(c,J(1,a.multiply(b[d],h))));f[g]=a.multiply(d.evaluateAt(h),a.inverse(c));0!==a.generatorBase&&(f[g]=a.multiply(f[g],h))}d=f;for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}function E(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function C(a,b){return b<<1|a}function Z(a,b,c){c=aa[c.dataMask];let d=a.height;var e=17+4*b.versionNumber,f=A.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===\ng&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=f;g=[];e=h=0;f=!0;for(let k=d-1;0<k;k-=2){6===k&&k--;for(let n=0;n<d;n++){let m=f?d-1-n:n;for(let d=0;2>d;d++){let f=k-d;if(!b.get(f,m)){e++;let b=a.get(f,m);c({y:m,x:f})&&(b=!b);h=h<<1|b;8===e&&(g.push(h),h=e=0)}}}f=!f}return g}function ba(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return K[c-\n1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=C(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let c=b-9;c>=b-11;c--)d=C(a.get(e,c),d);a=Infinity;let f;for(let e of K){if(e.infoBits===c||e.infoBits===d)return e;b=E(c,e.infoBits);b<a&&(f=e,a=b);b=E(d,e.infoBits);b<a&&(f=e,a=b)}if(3>=a)return f}function ca(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=C(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=C(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=C(a.get(8,e),c);for(e=d-8;e<d;e++)c=C(a.get(e,\n8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of da){if(f===b||f===c)return g;e=E(b,f);e<a&&(d=g,a=e);b!==c&&(e=E(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}function ea(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(a=>{for(let b=0;b<a.numBlocks;b++)e.push({numDataCodewords:a.dataCodewordsPerBlock,codewords:[]}),f+=a.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());\nif(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let b of e)b.codewords.push(a.shift());return e}function L(a){let b=ba(a);if(!b)return null;var c=ca(a);if(!c)return null;a=Z(a,b,c);var d=ea(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((a,b)=>a+b.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let b of d){d=X(b.codewords,b.codewords.length-b.numDataCodewords);if(!d)return null;for(let e=\n0;e<b.numDataCodewords;e++)c[a++]=d[e]}try{return U(c,b.versionNumber)}catch(e){return null}}function M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};{let h=b.x-c.x;var g=d.x-c.x;let k=b.y-c.y,n=d.y-c.y;c=h*n-g*k;g=(e*n-g*f)/c;e=(h*f-e*k)/c;return{a11:b.x-a.x+g*b.x,a12:b.y-a.y+g*b.y,a13:g,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}}function fa(a,b,c,d){a=M(a,b,c,d);\nreturn{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}function ha(a,b){var c=fa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+\nd.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,n=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,m=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,l=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,p=d.a13*c.a31+d.a23*c.a32+d.a33*c.a33;c=A.createEmpty(b.dimension,b.dimension);d=(a,b)=>{const c=g*a+n*b+p;return{x:(e*a+h*b+m)/c,y:(f*a+k*b+l)/c}};for(let e=0;e<b.dimension;e++)for(let f=0;f<b.dimension;f++){let b=d(f+.5,e+.5);c.set(f,e,a.get(Math.floor(b.x),\nMath.floor(b.y)))}return{matrix:c,mappingFunction:d}}function x(a){return a.reduce((a,c)=>a+c)}function ia(a,b,c){let d=y(a,b),e=y(b,c),f=y(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}function ja(a,b,c,d){d=(x(z(a,c,d,5))/7+x(z(a,b,d,5))/7+x(z(c,a,d,5))/7+x(z(b,a,d,5))/7)/4;if(1>d)throw Error("Invalid module size");b=Math.round(y(a,b)/d);a=Math.round(y(a,c)/d);a=\nMath.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}function N(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),n=Math.abs(b-h),m=Math.floor(-k/2),l=g<a?1:-1,p=h<b?1:-1,q=!0;for(let v=g,u=h;v!==a+l;v+=l){g=f?u:v;h=f?v:u;if(c.get(g,\nh)!==q&&(q=!q,e.push({x:g,y:h}),e.length===d+1))break;m+=n;if(0<m){if(u===b)break;u+=p;m-=k}}c=[];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(y(e[f],e[f+1])):c.push(0);return c}function z(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=N(a,b,c,Math.ceil(d/2));a=N(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function F(a,b){let c=x(a)/x(b),d=0;b.forEach((b,f)=>{d+=Math.pow(a[f]-b*c,2)});return{averageSize:c,error:d}}function O(a,b,c){try{let d=z(a,{x:-1,y:a.y},c,b.length),\ne=z(a,{x:a.x,y:-1},c,b.length),f=z(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=z(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=F(d,b),k=F(e,b),n=F(f,b),m=F(g,b),l=(h.averageSize+k.averageSize+n.averageSize+m.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+n.error*n.error+m.error*m.error)+(Math.pow(h.averageSize-l,2)+Math.pow(k.averageSize-l,2)+Math.pow(n.averageSize-l,2)+Math.pow(m.averageSize-l,2))/l}catch(d){return Infinity}}\nfunction H(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}function ka(a){var b=[],c=[];let d=[];var e=[];for(let m=0;m<=a.height;m++){var f=0,g=!1;let l=[0,0,0,0,0];for(let b=-1;b<=a.width;b++){var h=a.get(b,m);if(h===g)f++;else{l=[l[1],l[2],l[3],l[4],f];f=1;g=h;var k=x(l)/7;k=Math.abs(l[0]-k)<k&&Math.abs(l[1]-\nk)<k&&Math.abs(l[2]-3*k)<3*k&&Math.abs(l[3]-k)<k&&Math.abs(l[4]-k)<k&&!h;var n=x(l.slice(-3))/3;h=Math.abs(l[2]-n)<n&&Math.abs(l[3]-n)<n&&Math.abs(l[4]-n)<n&&h;if(k){let a=b-l[3]-l[4],d=a-l[2];k={startX:d,endX:a,y:m};n=c.filter(b=>d>=b.bottom.startX&&d<=b.bottom.endX||a>=b.bottom.startX&&d<=b.bottom.endX||d<=b.bottom.startX&&a>=b.bottom.endX&&1.5>l[2]/(b.bottom.endX-b.bottom.startX)&&.5<l[2]/(b.bottom.endX-b.bottom.startX));0<n.length?n[0].bottom=k:c.push({top:k,bottom:k})}if(h){let a=b-l[4],c=a-\nl[3];h={startX:c,y:m,endX:a};k=e.filter(b=>c>=b.bottom.startX&&c<=b.bottom.endX||a>=b.bottom.startX&&c<=b.bottom.endX||c<=b.bottom.startX&&a>=b.bottom.endX&&1.5>l[2]/(b.bottom.endX-b.bottom.startX)&&.5<l[2]/(b.bottom.endX-b.bottom.startX));0<k.length?k[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(a=>a.bottom.y!==m&&2<=a.bottom.y-a.top.y));c=c.filter(a=>a.bottom.y===m);d.push(...e.filter(a=>a.bottom.y!==m));e=e.filter(a=>a.bottom.y===m)}b.push(...c.filter(a=>2<=a.bottom.y-a.top.y));d.push(...e);\nc=[];for(var m of b)2>m.bottom.y-m.top.y||(b=(m.top.startX+m.top.endX+m.bottom.startX+m.bottom.endX)/4,e=(m.top.y+m.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[m.top.endX-m.top.startX,m.bottom.endX-m.bottom.startX,m.bottom.y-m.top.y+1],f=x(f)/f.length,g=O({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((a,b)=>a.score-b.score);m=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var l of c)l!==e&&f.push(Object.assign(Object.assign({},\nl),{score:l.score+Math.pow(l.size-e.size,2)/e.size}));f.sort((a,b)=>a.score-b.score);m.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}m.sort((a,b)=>a.score-b.score);let {topRight:p,topLeft:q,bottomLeft:v}=ia(...m[0].points);m=P(a,d,p,q,v);l=[];m&&l.push({alignmentPattern:{x:m.alignmentPattern.x,y:m.alignmentPattern.y},bottomLeft:{x:v.x,y:v.y},dimension:m.dimension,topLeft:{x:q.x,y:q.y},topRight:{x:p.x,y:p.y}});m=H(a,p);b=H(a,q);c=H(a,v);(a=P(a,d,m,b,c))&&l.push({alignmentPattern:{x:a.alignmentPattern.x,\ny:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:m.x,y:m.y},dimension:a.dimension});return 0===l.length?null:l}function P(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ja(d,c,e,a))}catch(m){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(y(d,e)+y(d,c))/2/g;e=1-3/c;let n={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(b=>{const c=(b.top.startX+b.top.endX+b.bottom.startX+b.bottom.endX)/4;b=(b.top.y+b.bottom.y+1)/2;if(a.get(Math.floor(c),Math.floor(b))){var d=O({x:Math.floor(c),\ny:Math.floor(b)},[1,1,1],a)+y({x:c,y:b},n);return{x:c,y:b,score:d}}}).filter(a=>!!a).sort((a,b)=>a.score-b.score);return{alignmentPattern:15<=c&&b.length?b[0]:n,dimension:f}}function Q(a){var b=ka(a);if(!b)return null;for(let e of b){b=ha(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let a=d+1;a<c.height;a++)c.get(d,a)!==c.get(a,d)&&(c.set(d,a,!c.get(d,a)),c.set(a,d,!c.get(a,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,\nlocation:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,e.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}function R(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}function I(a,b,c,d={}){let e=Object.create(null);R(e,la);R(e,d);\nd="onlyInvert"===e.inversionAttempts||"invertFirst"===e.inversionAttempts;var f="attemptBoth"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error("Malformed data passed to binarizer.");var n=0;if(h){var m=new Uint8ClampedArray(a.buffer,n,k);n+=k}m=new S(b,c,m);if(g.useIntegerApproximation)for(var l=0;l<c;l++)for(var p=0;p<b;p++){var q=4*(l*b+p);m.set(p,l,g.red*a[q]+g.green*a[q+1]+g.blue*a[q+2]+128>>8)}else for(l=0;l<c;l++)for(p=0;p<b;p++)q=4*\n(l*b+p),m.set(p,l,g.red*a[q]+g.green*a[q+1]+g.blue*a[q+2]);g=Math.ceil(b/8);l=Math.ceil(c/8);p=g*l;if(h){var v=new Uint8ClampedArray(a.buffer,n,p);n+=p}v=new S(g,l,v);for(p=0;p<l;p++)for(q=0;q<g;q++){var u=Infinity,r=0;for(var t=0;8>t;t++)for(let a=0;8>a;a++){let b=m.get(8*q+a,8*p+t);u=Math.min(u,b);r=Math.max(r,b)}t=(u+r)/2;t=Math.min(255,1.11*t);24>=r-u&&(t=u/2,0<p&&0<q&&(r=(v.get(q,p-1)+2*v.get(q-1,p)+v.get(q-1,p-1))/4,u<r&&(t=r)));v.set(q,p,t)}h?(p=new Uint8ClampedArray(a.buffer,n,k),n+=k,p=new A(p,\nb)):p=A.createEmpty(b,c);q=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,n,k),q=new A(a,b)):q=A.createEmpty(b,c));for(b=0;b<l;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=l-3;h=2>b?2:b>h?h:b;k=0;for(n=-2;2>=n;n++)for(u=-2;2>=u;u++)k+=v.get(c+n,h+u);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)n=8*a+h,u=8*b+k,r=m.get(n,u),p.set(n,u,r<=c),f&&q.set(n,u,!(r<=c))}f=f?{binarized:p,inverted:q}:{binarized:p};let {binarized:w,inverted:x}=f;(f=Q(d?x:w))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||\n(f=Q(d?w:x));return f}class A{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new A(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let b=a;b<a+c;b++)this.set(b,f,!!e)}}class S{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,\nb){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}class V{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,\na-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var r;(function(a){a.Numeric="numeric";a.Alphanumeric="alphanumeric";a.Byte="byte";a.Kanji="kanji";a.ECI="eci";a.StructuredAppend="structuredappend"})(r||(r={}));var t;(function(a){a[a.Terminator=0]="Terminator";a[a.Numeric=1]="Numeric";a[a.Alphanumeric=2]="Alphanumeric";a[a.Byte=4]="Byte";a[a.Kanji=8]="Kanji";a[a.ECI=7]="ECI";a[a.StructuredAppend=\n3]="StructuredAppend"})(t||(t={}));let B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");class w{constructor(a,b){if(0===b.length)throw Error("No coefficients.");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===\nthis.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;if(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new w(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);\nfor(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new w(this.field,c)}multiplyPoly(a){if(this.isZero()||a.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let h=0;h<c;h++){let c=b[h];for(let b=0;b<d;b++){var f=h+b,g=this.field.multiply(c,a[b]);e[f]=e[h+b]^g}}return new w(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error("Invalid degree less than 0");if(0===b)return this.field.zero;\nlet c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new w(this.field,a)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(a=>{b^=a}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=J(this.field.multiply(a,b),this.coefficients[d]);return b}}class Y{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);\nthis.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new w(this,Uint8ClampedArray.from([0]));this.one=new w(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===a)throw Error("Can\'t invert 0");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,\nb){if(0>a)throw Error("Invalid monomial degree less than 0");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new w(this,a)}log(a){if(0===a)throw Error("Can\'t take log(0)");return this.logTable[a]}exp(a){return this.expTable[a]}}let K=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,\necBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},\n{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,\ndataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,\necBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},\n{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},\n{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},\n{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,\ndataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,\ndataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},\n{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},\n{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},\n{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},\n{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,\necBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,\ndataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,\ndataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,\necBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,\necBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,\ndataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,\n32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},\n{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},\n{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,\ndataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},\n{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,\necBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},\n{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,\n30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},\n{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,\ndataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},\n{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,\ndataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},\n{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,\ndataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}],da=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,\ndataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,\nformatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,\ndataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,\ndataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],aa=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2],y=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2)),la={inversionAttempts:"attemptBoth",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},\ncanOverwriteImage:!0};I.default=I;let G="dontInvert",D={red:77,green:150,blue:29,useIntegerApproximation:!0};self.onmessage=a=>{let b=a.data.data;switch(a.data.type){case "decode":a=I(b.data,b.width,b.height,{inversionAttempts:G,greyScaleWeights:D});self.postMessage({type:"qrResult",data:a?a.data:null});break;case "grayscaleWeights":D.red=b.red;D.green=b.green;D.blue=b.blue;D.useIntegerApproximation=b.useIntegerApproximation;break;case "inversionMode":switch(b){case "original":G="dontInvert";break;\ncase "invert":G="onlyInvert";break;case "both":G="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}})()\n\n']))},gW=function(e,t,r,n,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,i,a,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},vW=Pj(),yW=function(){function e(t){var r=this,n=t.container,o=t.lang,i=void 0===o?"en":o,a=t.assetRoot,s=void 0===a?"https://unpkg.com/@tsocial/tvweb-sdk@beta/assets":a,c=t.resourceRoot,u=t.customUrls,l=void 0===u?{}:u,d=t.enableAntiDebug,f=void 0===d||d,p=t.warmupMessage,h=t.baseComponent,m=t.component,g=void 0===m?{}:m,v=t.country,y=void 0===v?"vn":v,b=t.idCardContext,w=t.exifKey,C=void 0===w?"":w;fL(this,e),mL(this,"initNativeCamera",(function(e){var t=document.createElement("div");document.body.appendChild(t);var n=xw.createRef(),o=r.component.NativeCamera;return aL.render(xw.createElement(o,gL({},e,{ref:n})),t),{openCamera:function(){n.current.click()}}})),mL(this,"runWarmUpReadIDCard",dL(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.commonSettings.customUrls,e.abrupt("return",r.component.warmUpReadIdCard(t));case 2:case"end":return e.stop()}}),e)})))),mL(this,"runPreloadEKYCResources",dL(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=r.commonSettings.customUrls,r.component.preloadEKYCResources(t);case 2:case"end":return e.stop()}}),e)})))),mL(this,"destroyView",(function(){aL.unmountComponentAtNode(r.container)})),gW(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var k=pj({resourceRoot:c,initCustomUrls:l,country:y});this.commonSettings=yL({lang:i,assetRoot:s,customUrls:k,enableAntiDebug:f,debug:!1,warmupMessage:p,country:y,exifKey:C},b),this.component=yL(yL({},h),g)}return hL(e,[{key:"checkCamera",value:function(){return(0,this.component.checkCamera)()}},{key:"getListCamera",value:function(){return(0,this.component.getListCamera)()}},{key:"readIDCardWithApiCall",value:function(e){var t=this.component.ReadIDCardWithApiCall;aL.render(xw.createElement(mj,{value:this.commonSettings},xw.createElement(t,gL({onClose:this.destroyView},e))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var t=this.component.ReadIDCardUIOnly;aL.render(xw.createElement(mj,{value:this.commonSettings},xw.createElement(t,gL({onClose:this.destroyView},e))),this.container)}},{key:"livenessDetection",value:function(e){var t=this.component.LivenessDetection;aL.render(xw.createElement(mj,{value:this.commonSettings},xw.createElement(t,gL({onClose:this.destroyView},e))),this.container)}},{key:"compareFaces",value:function(e){var t=e.accessKey,r=e.secretKey,n=e.apiUrl,o=e.image1,i=e.image2,a=e.onSuccess,s=e.onError;dq(new wj(t,r,n,{httpHeaders:vW})).compareFaces({image1:{id:o},image2:{id:i}}).then((function(e){a(e)})).catch((function(e){s(e)}))}}]),e}();function bW(e){return(bW="function"==typeof Symbol&&"symbol"==By(Symbol.iterator)?function(e){return By(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":By(e)})(e)}function wW(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function CW(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){wW(i,n,o,a,s,"next",e)}function s(e){wW(i,n,o,a,s,"throw",e)}a(void 0)}))}}function kW(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function SW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EW(){return(EW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function BW(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?BW(Object(r),!0).forEach((function(t){SW(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BW(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xW(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function TW(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function AW(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}(e,t)||PW(e,t)||function(){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 IW(e){return function(e){if(Array.isArray(e))return RW(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||PW(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PW(e,t){if(e){if("string"==typeof e)return RW(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?RW(e,t):void 0}}function RW(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var DW="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function OW(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function NW(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var LW,MW=NW((function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){e.exports={BROWSER_TYPES:{CHROME:"Chrome",FIREFOX:"Firefox",OPERA:"Opera",YANDEX:"Yandex",SAFARI:"Safari",INTERNET_EXPLORER:"Internet Explorer",EDGE:"Edge",CHROMIUM:"Chromium",IE:"IE",MOBILE_SAFARI:"Mobile Safari",EDGE_CHROMIUM:"Edge Chromium"},DEVICE_TYPES:{MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0},OS_TYPES:{IOS:"iOS",ANDROID:"Android",WINDOWS_PHONE:"Windows Phone",WINDOWS:"Windows",MAC_OS:"Mac OS"},defaultData:{isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1}}},function(e,t,r){var n,o=r(2),i=r(0),a=i.BROWSER_TYPES,s=i.OS_TYPES,c=i.DEVICE_TYPES,u=r(4),l=u.checkType,d=u.broPayload,f=u.mobilePayload,p=u.wearPayload,h=u.consolePayload,m=u.stvPayload,g=u.getNavigatorInstance,v=u.isIOS13Check,y=new o,b=y.getBrowser(),w=y.getDevice(),C=y.getEngine(),k=y.getOS(),S=y.getUA(),E=a.CHROME,B=a.CHROMIUM,_=a.IE,x=a.INTERNET_EXPLORER,T=a.OPERA,A=a.FIREFOX,I=a.SAFARI,P=a.EDGE,R=a.YANDEX,D=a.MOBILE_SAFARI,O=c.MOBILE,N=c.TABLET,L=c.SMART_TV,M=c.BROWSER,F=c.WEARABLE,U=c.CONSOLE,j=s.ANDROID,V=s.WINDOWS_PHONE,z=s.IOS,q=s.WINDOWS,H=s.MAC_OS,W=function(){return k.name===s.WINDOWS&&"10"===k.version&&"string"==typeof S&&-1!==S.indexOf("Edg/")},K=function(){return b.name===P},Q=function(){return v("iPad")},G=w.type===L,X=w.type===U,Y=w.type===F,$=b.name===D||Q(),Z=b.name===B,J=function(){switch(w.type){case O:case N:return!0;default:return!1}}()||Q(),ee=w.type===O,te=w.type===N||Q(),re=w.type===M,ne=k.name===j,oe=k.name===V,ie=k.name===z||Q(),ae=b.name===E,se=b.name===A,ce=b.name===I||b.name===D,ue=b.name===T,le=b.name===x||b.name===_,de=k.version?k.version:"none",fe=k.name?k.name:"none",pe=b.major,he=b.version,me=b.name,ge=w.vendor?w.vendor:"none",ve=w.model?w.model:"none",ye=C.name,be=C.version,we=S,Ce=K()||W(),ke=b.name===R,Se=w.type,Ee=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Be=Q(),_e=v("iPhone"),xe=v("iPod"),Te=function(){var e=g(),t=e&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)}(),Ae=W(),Ie=K(),Pe=k.name===q,Re=k.name===H,De=l(w.type);e.exports={deviceDetect:function(){var e=De.isBrowser,t=De.isMobile,r=De.isTablet,n=De.isSmartTV,o=De.isConsole,i=De.isWearable;return e?d(e,b,C,k,S):n?m(n,C,k,S):o?h(o,C,k,S):t||r?f(De,w,k,S):i?p(i,C,k,S):void 0},isSmartTV:G,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ie,isChrome:ae,isFirefox:se,isSafari:ce,isOpera:ue,isIE:le,osVersion:de,osName:fe,fullBrowserVersion:pe,browserVersion:he,browserName:me,mobileVendor:ge,mobileModel:ve,engineName:ye,engineVersion:be,getUA:we,isEdge:Ce,isYandex:ke,deviceType:Se,isIOS13:Ee,isIPad13:Be,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Ie,isWindows:Pe,isMacOs:Re}},function(e,t,r){var n;
60
+ var KH={};void 0!==KH.asn1&&KH.asn1||(KH.asn1={}),KH.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",o=0;o<r;o++)n+="f";t=new bH(n,16).xor(e).add(bH.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=KH.asn1,r=t.DERBoolean,n=t.DERInteger,o=t.DERBitString,i=t.DEROctetString,a=t.DERNull,s=t.DERObjectIdentifier,c=t.DEREnumerated,u=t.DERUTF8String,l=t.DERNumericString,d=t.DERPrintableString,f=t.DERTeletexString,p=t.DERIA5String,h=t.DERUTCTime,m=t.DERGeneralizedTime,g=t.DERSequence,v=t.DERSet,y=t.DERTaggedObject,b=t.ASN1Util.newObject,w=Object.keys(e);if(1!=w.length)throw"key of param shall be only one.";var C=w[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+C+":"))throw"undefined key: "+C;if("bool"==C)return new r(e[C]);if("int"==C)return new n(e[C]);if("bitstr"==C)return new o(e[C]);if("octstr"==C)return new i(e[C]);if("null"==C)return new a(e[C]);if("oid"==C)return new s(e[C]);if("enum"==C)return new c(e[C]);if("utf8str"==C)return new u(e[C]);if("numstr"==C)return new l(e[C]);if("prnstr"==C)return new d(e[C]);if("telstr"==C)return new f(e[C]);if("ia5str"==C)return new p(e[C]);if("utctime"==C)return new h(e[C]);if("gentime"==C)return new m(e[C]);if("seq"==C){for(var k=e[C],S=[],E=0;E<k.length;E++){var B=b(k[E]);S.push(B)}return new g({array:S})}if("set"==C){for(k=e[C],S=[],E=0;E<k.length;E++)B=b(k[E]),S.push(B);return new v({array:S})}if("tag"==C){var _=e[C];if("[object Array]"===Object.prototype.toString.call(_)&&3==_.length){var x=b(_[2]);return new y({tag:_[0],explicit:_[1],obj:x})}var T={};if(void 0!==_.explicit&&(T.explicit=_.explicit),void 0!==_.tag&&(T.tag=_.tag),void 0===_.obj)throw"obj shall be specified for 'tag'.";return T.obj=b(_.obj),new y(T)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},KH.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),o=2;o<e.length;o+=2){var i=("00000000"+parseInt(e.substr(o,2),16).toString(2)).slice(-8);n+=i.substr(1,7),"0"==i.substr(0,1)&&(t=t+"."+new bH(n,2).toString(10),n="")}return t},KH.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new bH(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);return n},KH.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KH.asn1.DERAbstractString=function(e){KH.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},WH.lang.extend(KH.asn1.DERAbstractString,KH.asn1.ASN1Object),KH.asn1.DERAbstractTime=function(e){KH.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,r){var n=this.zeroPadding,o=this.localDateToUTC(e),i=String(o.getFullYear());"utc"==t&&(i=i.substr(2,2));var a=i+n(String(o.getMonth()+1),2)+n(String(o.getDate()),2)+n(String(o.getHours()),2)+n(String(o.getMinutes()),2)+n(String(o.getSeconds()),2);if(!0===r){var s=o.getMilliseconds();if(0!=s){var c=n(String(s),3);a=a+"."+(c=c.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,r,n,o,i){var a=new Date(Date.UTC(e,t-1,r,n,o,i,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},WH.lang.extend(KH.asn1.DERAbstractTime,KH.asn1.ASN1Object),KH.asn1.DERAbstractStructured=function(e){KH.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},WH.lang.extend(KH.asn1.DERAbstractStructured,KH.asn1.ASN1Object),KH.asn1.DERBoolean=function(){KH.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},WH.lang.extend(KH.asn1.DERBoolean,KH.asn1.ASN1Object),KH.asn1.DERInteger=function(e){KH.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=KH.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},WH.lang.extend(KH.asn1.DERInteger,KH.asn1.ASN1Object),KH.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=KH.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}KH.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var o=e.substr(r,8),i=parseInt(o,2).toString(16);1==i.length&&(i="0"+i),n+=i}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},WH.lang.extend(KH.asn1.DERBitString,KH.asn1.ASN1Object),KH.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=KH.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}KH.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},WH.lang.extend(KH.asn1.DEROctetString,KH.asn1.DERAbstractString),KH.asn1.DERNull=function(){KH.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},WH.lang.extend(KH.asn1.DERNull,KH.asn1.ASN1Object),KH.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new bH(e,10).toString(2),o=7-n.length%7;7==o&&(o=0);for(var i="",a=0;a<o;a++)i+="0";for(n=i+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};KH.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);n+=t(i),o.splice(0,2);for(var a=0;a<o.length;a++)n+=r(o[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var t=KH.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},WH.lang.extend(KH.asn1.DERObjectIdentifier,KH.asn1.ASN1Object),KH.asn1.DEREnumerated=function(e){KH.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=KH.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bH(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},WH.lang.extend(KH.asn1.DEREnumerated,KH.asn1.ASN1Object),KH.asn1.DERUTF8String=function(e){KH.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},WH.lang.extend(KH.asn1.DERUTF8String,KH.asn1.DERAbstractString),KH.asn1.DERNumericString=function(e){KH.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},WH.lang.extend(KH.asn1.DERNumericString,KH.asn1.DERAbstractString),KH.asn1.DERPrintableString=function(e){KH.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},WH.lang.extend(KH.asn1.DERPrintableString,KH.asn1.DERAbstractString),KH.asn1.DERTeletexString=function(e){KH.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},WH.lang.extend(KH.asn1.DERTeletexString,KH.asn1.DERAbstractString),KH.asn1.DERIA5String=function(e){KH.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},WH.lang.extend(KH.asn1.DERIA5String,KH.asn1.DERAbstractString),KH.asn1.DERUTCTime=function(e){KH.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},WH.lang.extend(KH.asn1.DERUTCTime,KH.asn1.DERAbstractTime),KH.asn1.DERGeneralizedTime=function(e){KH.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},WH.lang.extend(KH.asn1.DERGeneralizedTime,KH.asn1.DERAbstractTime),KH.asn1.DERSequence=function(e){KH.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},WH.lang.extend(KH.asn1.DERSequence,KH.asn1.DERAbstractStructured),KH.asn1.DERSet=function(e){KH.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},WH.lang.extend(KH.asn1.DERSet,KH.asn1.DERAbstractStructured),KH.asn1.DERTaggedObject=function(e){KH.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},WH.lang.extend(KH.asn1.DERTaggedObject,KH.asn1.ASN1Object);var QH,GH,XH,YH,$H=(QH=function(e,t){return(QH=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}QH(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ZH=function(e){function t(r){var n=e.call(this)||this;return r&&("string"==typeof r?n.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&n.parsePropertiesFrom(r)),n}return $H(t,e),t.prototype.parseKey=function(e){try{var t=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?aH(e):sH.unarmor(e),o=mH.decode(n);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){t=o.sub[1].getHexStringValue(),this.n=BH(t,16),r=o.sub[2].getHexStringValue(),this.e=parseInt(r,16);var i=o.sub[3].getHexStringValue();this.d=BH(i,16);var a=o.sub[4].getHexStringValue();this.p=BH(a,16);var s=o.sub[5].getHexStringValue();this.q=BH(s,16);var c=o.sub[6].getHexStringValue();this.dmp1=BH(c,16);var u=o.sub[7].getHexStringValue();this.dmq1=BH(u,16);var l=o.sub[8].getHexStringValue();this.coeff=BH(l,16)}else{if(2!==o.sub.length)return!1;if(o.sub[0].sub){var d=o.sub[1].sub[0];t=d.sub[0].getHexStringValue(),this.n=BH(t,16),r=d.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=o.sub[0].getHexStringValue(),this.n=BH(t,16),r=o.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new KH.asn1.DERInteger({int:0}),new KH.asn1.DERInteger({bigint:this.n}),new KH.asn1.DERInteger({int:this.e}),new KH.asn1.DERInteger({bigint:this.d}),new KH.asn1.DERInteger({bigint:this.p}),new KH.asn1.DERInteger({bigint:this.q}),new KH.asn1.DERInteger({bigint:this.dmp1}),new KH.asn1.DERInteger({bigint:this.dmq1}),new KH.asn1.DERInteger({bigint:this.coeff})]};return new KH.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return nH(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new KH.asn1.DERSequence({array:[new KH.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new KH.asn1.DERNull]}),t=new KH.asn1.DERSequence({array:[new KH.asn1.DERInteger({bigint:this.n}),new KH.asn1.DERInteger({int:this.e})]}),r=new KH.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new KH.asn1.DERSequence({array:[e,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return nH(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return(e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return(e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(qH),JH=function(){function e(e){void 0===e&&(e={}),e=e||{},this.default_key_size=e.default_key_size?parseInt(e.default_key_size,10):1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}return e.prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ZH(e)},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt(oH(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return nH(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,t,r){try{return nH(this.getKey().sign(e,t,r))}catch(e){return!1}},e.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,oH(t),r)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new ZH,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version="3.3.0",e}(),eW=function(e,t,r,n){if(!iM(e))return e;for(var o=-1,i=(t=UU(t,e)).length,a=i-1,s=e;null!=s&&++o<i;){var c=VU(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=a){var l=s[c];void 0===(u=n?n(l,c,s):void 0)&&(u=iM(l)?l:sF(t[o+1])?[]:{})}GM(s,c,u),s=s[c]}return e},tW=function(e,t,r){return null==e?e:eW(e,t,r)},rW=["-","-","-","-","-","B","E","G","I","N"," ","P","U","B","L","I","C"," ","K","E","Y","-","-","-","-","-","\n"," "," ","M","I","I","B","I","j","A","N","B","g","k","q","h","k","i","G","9","w","0","B","A","Q","E","F","A","A","O","C","A","Q","8","A","M","I","I","B","C","g","K","C","A","Q","E","A","z","7","v","7","a","s","x","M","n","j","L","3","/","j","G","E","d","M","3","T","\n"," "," ","j","0","h","X","b","h","r","/","m","N","2","B","m","j","/","Y","e","6","I","y","1","T","t","g","E","S","W","j","r","V","Y","Z","J","k","a","+","T","L","+","L","0","U","n","h","i","8","l","W","x","2","w","R","s","+","N","i","u","Y","f","g","+","B","U","b","\n"," "," ","s","e","y","L","j","G","B","q","N","t","z","x","H","Z","K","v","d","h","d","i","r","o","y","R","y","C","S","f","p","m","f","h","Q","C","P","s","K","q","/","y","k","1","m","A","e","/","9","1","W","Y","J","b","l","K","h","W","Y","q","W","0","2","I","G","/","\n"," "," ","g","h","r","z","0","b","i","Y","X","C","b","5","m","6","s","R","o","7","e","J","p","4","F","e","2","1","U","N","Q","W","O","o","y","V","2","M","9","o","+","n","G","l","0","P","+","V","A","I","z","q","Z","m","l","P","w","w","v","w","B","i","l","f","X","e","\n"," "," ","W","V","P","x","9","6","f","2","c","A","I","h","S","2","b","W","f","f","d","X","3","w","p","c","1","C","E","m","c","v","9","V","E","f","o","j","j","i","X","O","7","I","n","k","u","P","t","H","4","W","2","E","P","Z","0","8","C","z","3","+","e","Q","2","k","\n"," "," ","D","z","c","j","P","9","8","Q","T","p","u","w","2","E","X","C","S","1","w","s","k","Z","C","2","1","j","L","8","j","z","X","H","a","W","3","B","q","O","h","s","V","G","9","T","F","S","y","c","l","F","g","e","n","r","G","s","Z","i","t","h","l","l","K","/","\n"," "," ","t","Q","I","D","A","Q","A","B","\n"," "," ","-","-","-","-","-","E","N","D"," ","P","U","B","L","I","C"," ","K","E","Y","-","-","-","-","-"],nW={},oW={SELFIE:"selfie",ID_CARD:"id_card"},iW=Oq((function(e){var t=new JH,r=e||rW.join("");return t.setPublicKey(r),t})),aW=function(e){var t=e.gesture;return{capture_time:e.captureTime,type:t,frames:e.frames,blur_score:e.blurScore,selfie_label:e.selfieLabel}},sW=function(e){var t=e.detectedCard,r=e.captureTime,n=e.vCam,o=e.captureCount,i=e.captureDuration,a=e.captureType,s=e.cardTracking;return{capture_time:r,type:null==t?void 0:t.label,v_cam:n,capture_count:o,capture_duration:i,capture_type:a,card_tracking:s}},cW=function(){var e=dL(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return CL(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},e.abrupt("return",new Promise((function(e){var o=new TextEncoder,i=o.encode(t),a=o.encode(r);window.crypto.subtle.importKey("raw",a,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,i).then((function(t){e("".concat(YH,".").concat(n(t)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),uW=function(){var e=dL(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.mode,o=t.imageData,t.enableExifData){e.next=3;break}return e.abrupt("return",new Promise((function(e){return e(o.blob)})));case 3:return i=yL(yL({},nW),n===oW.SELFIE?aW(o):sW(o)),a=yL(yL({},i),{},{sensor_data:"sensor data exceed 64KB"}),null!=o&&null!==(r=o.type)&&void 0!==r&&r.includes("qr")&&(i={capture_time:null==o?void 0:o.captureTime,type:null==o?void 0:o.type,qr_string:null==o?void 0:o.result}),e.next=8,cW(JSON.stringify(a),XH);case 8:return s=e.sent,e.next=11,cW(JSON.stringify(i),XH);case 11:return c=e.sent,u=Qq.dump({Exif:mL({},Qq.ExifIFD.MakerNote,c)}),l=Qq.dump({Exif:mL({},Qq.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var t=new FileReader;t.onload=function(){var t=dL(regeneratorRuntime.mark((function t(r){var n,i,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{n=Qq.insert(u,r.target.result)}catch(t){try{n=Qq.insert(l,r.target.result)}catch(t){e(o.blob)}}return t.prev=1,t.next=4,fetch(n);case 4:return i=t.sent,t.next=7,i.blob();case 7:a=t.sent,URL.revokeObjectURL(n),e(a),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(1),e(o.blob);case 15:case"end":return t.stop()}}),t,null,[[1,12]])})));return function(e){return t.apply(this,arguments)}}(),t.readAsDataURL(o.blob)})));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),lW=Object.freeze({__proto__:null,MODE:oW,initExifData:function(){nW={device_info:{device_brand_name:"".concat("none"===Aj.mobileVendor?"null":Aj.mobileVendor),device_model:"".concat("none"===Aj.mobileModel?"null":Aj.mobileModel),browser_version:"".concat(Aj.browserName," ").concat(Aj.browserVersion),browser_userAgent:"".concat(Aj.getUA),os:Aj.osName,os_version:Aj.osVersion},sdk_version:"5.17.3",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,t){tW(nW,e,t)},preWriteExif:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mode,r=(e.motionData,e.orientationData,e.startTime),n=e.endTime,o=e.exifKey,i=void 0===o?"":o;nW.user_action=yL({},t===oW.SELFIE?{start_selfie:r,end_selfie:n}:{start_id_card:r,end_id_card:n}),XH=xj().replace(/-/g,""),GH||(GH=iW(i)),YH=oH(GH.encrypt(XH))},writeExif:uW}),dW="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",fW=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dW,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.342,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:368,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;fL(this,e),this.model_path=t,this.threshold=r,this.size=Math.round(n/2),this.enable_profiling=o,this.num_threads=i}var t,r;return hL(e,[{key:"load",value:(r=dL(regeneratorRuntime.mark((function e(){var t,r,n,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,e.next=3,Uq({modelUrl:this.model_path,options:{numThreads:this.num_threads,enableProfiling:this.enable_profiling}});case 3:this.model=e.sent,n=this.model.inputs[0],this.input_width=n.shape[1],this.input_height=n.shape[2],r.tidy((function(){var e=r.randomNormal([1,o.input_width,o.input_height,3]);o.model.predict(e)}));case 8:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"crop_eyes",value:function(e,t){var r=this,n=window.tf,o=t[0].map((function(e){return Math.round(e)})),i=t[1].map((function(e){return Math.round(e)}));o[0]>i[0]&&(o=t[1].map((function(e){return Math.round(e)})),i=t[0].map((function(e){return Math.round(e)})));var a=Math.round((o[0]+i[0])/2),s=a-o[0],c=i[0]-a;s>=this.size&&(s=this.size),c>=this.size&&(c=this.size);var u=Math.max(o[0]-s,0),l=Math.max(o[1]-s,0),d=Math.max(i[0]-c,0),f=Math.max(i[1]-c,0);return n.tidy((function(){var t=e.slice([l,u,0],[2*s,2*s,3]),o=e.slice([f,d,0],[2*c,2*c,3]);return{l_img:t=n.expandDims(n.image.resizeBilinear(t,[r.input_width,r.input_height])),r_img:o=n.expandDims(n.image.resizeBilinear(o,[r.input_width,r.input_height]))}}))}},{key:"predict",value:(t=dL(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,s,c,u,l,d,f=this,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>2&&void 0!==p[2]?p[2]:this.threshold,o=window,i=o.tf,a=t.getContext("2d"),s=a.getImageData(0,0,t.height,t.width),c=i.tidy((function(){var e=i.browser.fromPixels(s),t=f.crop_eyes(e,r),o=t.l_img,a=t.r_img,c=f.model.predict(o).arraySync()[0],u=f.model.predict(a).arraySync()[0];return[c>n,u>n]})),u=wL(c,2),l=u[0],d=u[1],e.abrupt("return",{isEyeClose:l||d});case 6:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}(),pW=function(){var e=dL(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!DeviceMotionEvent||"function"!=typeof DeviceMotionEvent.requestPermission){e.next=2;break}return e.abrupt("return",DeviceMotionEvent.requestPermission());case 2:return e.abrupt("return",new Promise((function(e){return e("granted")})));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function hW(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,r=void 0===t?100:t,n=xw.useRef([]),o=xw.useRef([]),i=(xw.useRef(!1),xw.useRef({})),a=xw.useCallback((function(e){var t=Date.now(),n=e.type;return!!(i.current[n]&&t-i.current[n]<r)||(i.current[n]=t,!1)}),[r]),s=xw.useCallback((function(e){a(e)||o.current.push({time:Date.now(),alpha:null==e?void 0:e.alpha,beta:null==e?void 0:e.beta,gamma:null==e?void 0:e.gamma})}),[a]),c=xw.useCallback((function(e){var t,r,o,i,s,c;a(e)||n.current.push({time:Date.now(),Accelerometer:{x:null==e||null===(t=e.acceleration)||void 0===t?void 0:t.x,y:null==e||null===(r=e.acceleration)||void 0===r?void 0:r.y,z:null==e||null===(o=e.acceleration)||void 0===o?void 0:o.z},Gyroscope:{z:null==e||null===(i=e.rotationRate)||void 0===i?void 0:i.alpha,x:null==e||null===(s=e.rotationRate)||void 0===s?void 0:s.beta,y:null==e||null===(c=e.rotationRate)||void 0===c?void 0:c.gamma}})}),[a]),u=xw.useCallback((function(){}),[c,s]),l=xw.useCallback((function(){}),[c,s]);return xw.useEffect((function(){return function(){l()}}),[l]),{motionData:n.current,orientationData:o.current,startMotion:u,stopMotion:l}}var mW=function(){return URL.createObjectURL(new Blob(['\'use strict\';(function(){function T(a,b){let c=[],d="";b=a.readBits([8,16,16][b]);for(let d=0;d<b;d++){let b=a.readBits(8);c.push(b)}try{d+=decodeURIComponent(c.map(a=>`%${("0"+a.toString(16)).substr(-2)}`).join(""))}catch(e){}return{bytes:c,text:d}}function U(a,b){a=new V(a);let c=9>=b?0:26>=b?1:2;for(b={text:"",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===t.Terminator)return b;if(d===t.ECI)0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(7)}):\n0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:r.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:r.ECI,assignmentNumber:-1});else if(d===t.Numeric){var e=a;d=[];for(var f="",g=e.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error("Invalid numeric value above 999");var k=Math.floor(h/100),n=Math.floor(h/10)%10;h%=10;d.push(48+k,48+n,48+h);f+=k.toString()+n.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);\nif(100<=g)throw Error("Invalid numeric value above 99");e=Math.floor(g/10);g%=10;d.push(48+e,48+g);f+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error("Invalid numeric value above 9");d.push(48+e);f+=e.toString()}d={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Numeric,text:d.text})}else if(d===t.Alphanumeric){e=a;d=[];f="";for(g=e.readBits([9,11,13][c]);2<=g;)n=e.readBits(11),k=Math.floor(n/45),n%=45,d.push(B[k].charCodeAt(0),B[n].charCodeAt(0)),\nf+=B[k]+B[n],g-=2;1===g&&(e=e.readBits(6),d.push(B[e].charCodeAt(0)),f+=B[e]);d={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Alphanumeric,text:d.text})}else if(d===t.Byte)d=T(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:r.Byte,bytes:d.bytes,text:d.text});else if(d===t.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder("shift-jis")).decode(Uint8Array.from(d));\nd={bytes:d,text:f};b.text+=d.text;b.bytes.push(...d.bytes);b.chunks.push({type:r.Kanji,bytes:d.bytes,text:d.text})}else d===t.StructuredAppend&&b.chunks.push({type:r.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}function J(a,b){return a^b}function W(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let d=e;b=c;e=f;if(b.isZero())return null;\nc=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let d=c.degree()-b.degree(),e=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(d,e));c=c.addOrSubtract(b.multiplyByMonomial(d,e))}f=f.multiplyPoly(e).addOrSubtract(d);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);if(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}function X(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new Y(285,\n256,0);var d=new w(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new w(a,e);d=W(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;d=d[1];e=b.length;f=Array(e);for(g=0;g<e;g++){h=a.inverse(b[g]);let c=1;for(let d=\n0;d<e;d++)g!==d&&(c=a.multiply(c,J(1,a.multiply(b[d],h))));f[g]=a.multiply(d.evaluateAt(h),a.inverse(c));0!==a.generatorBase&&(f[g]=a.multiply(f[g],h))}d=f;for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}function E(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function C(a,b){return b<<1|a}function Z(a,b,c){c=aa[c.dataMask];let d=a.height;var e=17+4*b.versionNumber,f=A.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===\ng&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=f;g=[];e=h=0;f=!0;for(let k=d-1;0<k;k-=2){6===k&&k--;for(let n=0;n<d;n++){let m=f?d-1-n:n;for(let d=0;2>d;d++){let f=k-d;if(!b.get(f,m)){e++;let b=a.get(f,m);c({y:m,x:f})&&(b=!b);h=h<<1|b;8===e&&(g.push(h),h=e=0)}}}f=!f}return g}function ba(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return K[c-\n1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=C(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let c=b-9;c>=b-11;c--)d=C(a.get(e,c),d);a=Infinity;let f;for(let e of K){if(e.infoBits===c||e.infoBits===d)return e;b=E(c,e.infoBits);b<a&&(f=e,a=b);b=E(d,e.infoBits);b<a&&(f=e,a=b)}if(3>=a)return f}function ca(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=C(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=C(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=C(a.get(8,e),c);for(e=d-8;e<d;e++)c=C(a.get(e,\n8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of da){if(f===b||f===c)return g;e=E(b,f);e<a&&(d=g,a=e);b!==c&&(e=E(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}function ea(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(a=>{for(let b=0;b<a.numBlocks;b++)e.push({numDataCodewords:a.dataCodewordsPerBlock,codewords:[]}),f+=a.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());\nif(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let b of e)b.codewords.push(a.shift());return e}function L(a){let b=ba(a);if(!b)return null;var c=ca(a);if(!c)return null;a=Z(a,b,c);var d=ea(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((a,b)=>a+b.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let b of d){d=X(b.codewords,b.codewords.length-b.numDataCodewords);if(!d)return null;for(let e=\n0;e<b.numDataCodewords;e++)c[a++]=d[e]}try{return U(c,b.versionNumber)}catch(e){return null}}function M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};{let h=b.x-c.x;var g=d.x-c.x;let k=b.y-c.y,n=d.y-c.y;c=h*n-g*k;g=(e*n-g*f)/c;e=(h*f-e*k)/c;return{a11:b.x-a.x+g*b.x,a12:b.y-a.y+g*b.y,a13:g,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}}function fa(a,b,c,d){a=M(a,b,c,d);\nreturn{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}function ha(a,b){var c=fa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+\nd.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,n=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,m=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,l=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,p=d.a13*c.a31+d.a23*c.a32+d.a33*c.a33;c=A.createEmpty(b.dimension,b.dimension);d=(a,b)=>{const c=g*a+n*b+p;return{x:(e*a+h*b+m)/c,y:(f*a+k*b+l)/c}};for(let e=0;e<b.dimension;e++)for(let f=0;f<b.dimension;f++){let b=d(f+.5,e+.5);c.set(f,e,a.get(Math.floor(b.x),\nMath.floor(b.y)))}return{matrix:c,mappingFunction:d}}function x(a){return a.reduce((a,c)=>a+c)}function ia(a,b,c){let d=y(a,b),e=y(b,c),f=y(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}function ja(a,b,c,d){d=(x(z(a,c,d,5))/7+x(z(a,b,d,5))/7+x(z(c,a,d,5))/7+x(z(b,a,d,5))/7)/4;if(1>d)throw Error("Invalid module size");b=Math.round(y(a,b)/d);a=Math.round(y(a,c)/d);a=\nMath.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}function N(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),n=Math.abs(b-h),m=Math.floor(-k/2),l=g<a?1:-1,p=h<b?1:-1,q=!0;for(let v=g,u=h;v!==a+l;v+=l){g=f?u:v;h=f?v:u;if(c.get(g,\nh)!==q&&(q=!q,e.push({x:g,y:h}),e.length===d+1))break;m+=n;if(0<m){if(u===b)break;u+=p;m-=k}}c=[];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(y(e[f],e[f+1])):c.push(0);return c}function z(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=N(a,b,c,Math.ceil(d/2));a=N(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function F(a,b){let c=x(a)/x(b),d=0;b.forEach((b,f)=>{d+=Math.pow(a[f]-b*c,2)});return{averageSize:c,error:d}}function O(a,b,c){try{let d=z(a,{x:-1,y:a.y},c,b.length),\ne=z(a,{x:a.x,y:-1},c,b.length),f=z(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=z(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=F(d,b),k=F(e,b),n=F(f,b),m=F(g,b),l=(h.averageSize+k.averageSize+n.averageSize+m.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+n.error*n.error+m.error*m.error)+(Math.pow(h.averageSize-l,2)+Math.pow(k.averageSize-l,2)+Math.pow(n.averageSize-l,2)+Math.pow(m.averageSize-l,2))/l}catch(d){return Infinity}}\nfunction H(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}function ka(a){var b=[],c=[];let d=[];var e=[];for(let m=0;m<=a.height;m++){var f=0,g=!1;let l=[0,0,0,0,0];for(let b=-1;b<=a.width;b++){var h=a.get(b,m);if(h===g)f++;else{l=[l[1],l[2],l[3],l[4],f];f=1;g=h;var k=x(l)/7;k=Math.abs(l[0]-k)<k&&Math.abs(l[1]-\nk)<k&&Math.abs(l[2]-3*k)<3*k&&Math.abs(l[3]-k)<k&&Math.abs(l[4]-k)<k&&!h;var n=x(l.slice(-3))/3;h=Math.abs(l[2]-n)<n&&Math.abs(l[3]-n)<n&&Math.abs(l[4]-n)<n&&h;if(k){let a=b-l[3]-l[4],d=a-l[2];k={startX:d,endX:a,y:m};n=c.filter(b=>d>=b.bottom.startX&&d<=b.bottom.endX||a>=b.bottom.startX&&d<=b.bottom.endX||d<=b.bottom.startX&&a>=b.bottom.endX&&1.5>l[2]/(b.bottom.endX-b.bottom.startX)&&.5<l[2]/(b.bottom.endX-b.bottom.startX));0<n.length?n[0].bottom=k:c.push({top:k,bottom:k})}if(h){let a=b-l[4],c=a-\nl[3];h={startX:c,y:m,endX:a};k=e.filter(b=>c>=b.bottom.startX&&c<=b.bottom.endX||a>=b.bottom.startX&&c<=b.bottom.endX||c<=b.bottom.startX&&a>=b.bottom.endX&&1.5>l[2]/(b.bottom.endX-b.bottom.startX)&&.5<l[2]/(b.bottom.endX-b.bottom.startX));0<k.length?k[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(a=>a.bottom.y!==m&&2<=a.bottom.y-a.top.y));c=c.filter(a=>a.bottom.y===m);d.push(...e.filter(a=>a.bottom.y!==m));e=e.filter(a=>a.bottom.y===m)}b.push(...c.filter(a=>2<=a.bottom.y-a.top.y));d.push(...e);\nc=[];for(var m of b)2>m.bottom.y-m.top.y||(b=(m.top.startX+m.top.endX+m.bottom.startX+m.bottom.endX)/4,e=(m.top.y+m.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[m.top.endX-m.top.startX,m.bottom.endX-m.bottom.startX,m.bottom.y-m.top.y+1],f=x(f)/f.length,g=O({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((a,b)=>a.score-b.score);m=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var l of c)l!==e&&f.push(Object.assign(Object.assign({},\nl),{score:l.score+Math.pow(l.size-e.size,2)/e.size}));f.sort((a,b)=>a.score-b.score);m.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}m.sort((a,b)=>a.score-b.score);let {topRight:p,topLeft:q,bottomLeft:v}=ia(...m[0].points);m=P(a,d,p,q,v);l=[];m&&l.push({alignmentPattern:{x:m.alignmentPattern.x,y:m.alignmentPattern.y},bottomLeft:{x:v.x,y:v.y},dimension:m.dimension,topLeft:{x:q.x,y:q.y},topRight:{x:p.x,y:p.y}});m=H(a,p);b=H(a,q);c=H(a,v);(a=P(a,d,m,b,c))&&l.push({alignmentPattern:{x:a.alignmentPattern.x,\ny:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:m.x,y:m.y},dimension:a.dimension});return 0===l.length?null:l}function P(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ja(d,c,e,a))}catch(m){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(y(d,e)+y(d,c))/2/g;e=1-3/c;let n={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(b=>{const c=(b.top.startX+b.top.endX+b.bottom.startX+b.bottom.endX)/4;b=(b.top.y+b.bottom.y+1)/2;if(a.get(Math.floor(c),Math.floor(b))){var d=O({x:Math.floor(c),\ny:Math.floor(b)},[1,1,1],a)+y({x:c,y:b},n);return{x:c,y:b,score:d}}}).filter(a=>!!a).sort((a,b)=>a.score-b.score);return{alignmentPattern:15<=c&&b.length?b[0]:n,dimension:f}}function Q(a){var b=ka(a);if(!b)return null;for(let e of b){b=ha(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let a=d+1;a<c.height;a++)c.get(d,a)!==c.get(a,d)&&(c.set(d,a,!c.get(d,a)),c.set(a,d,!c.get(a,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,\nlocation:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,e.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}function R(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}function I(a,b,c,d={}){let e=Object.create(null);R(e,la);R(e,d);\nd="onlyInvert"===e.inversionAttempts||"invertFirst"===e.inversionAttempts;var f="attemptBoth"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error("Malformed data passed to binarizer.");var n=0;if(h){var m=new Uint8ClampedArray(a.buffer,n,k);n+=k}m=new S(b,c,m);if(g.useIntegerApproximation)for(var l=0;l<c;l++)for(var p=0;p<b;p++){var q=4*(l*b+p);m.set(p,l,g.red*a[q]+g.green*a[q+1]+g.blue*a[q+2]+128>>8)}else for(l=0;l<c;l++)for(p=0;p<b;p++)q=4*\n(l*b+p),m.set(p,l,g.red*a[q]+g.green*a[q+1]+g.blue*a[q+2]);g=Math.ceil(b/8);l=Math.ceil(c/8);p=g*l;if(h){var v=new Uint8ClampedArray(a.buffer,n,p);n+=p}v=new S(g,l,v);for(p=0;p<l;p++)for(q=0;q<g;q++){var u=Infinity,r=0;for(var t=0;8>t;t++)for(let a=0;8>a;a++){let b=m.get(8*q+a,8*p+t);u=Math.min(u,b);r=Math.max(r,b)}t=(u+r)/2;t=Math.min(255,1.11*t);24>=r-u&&(t=u/2,0<p&&0<q&&(r=(v.get(q,p-1)+2*v.get(q-1,p)+v.get(q-1,p-1))/4,u<r&&(t=r)));v.set(q,p,t)}h?(p=new Uint8ClampedArray(a.buffer,n,k),n+=k,p=new A(p,\nb)):p=A.createEmpty(b,c);q=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,n,k),q=new A(a,b)):q=A.createEmpty(b,c));for(b=0;b<l;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=l-3;h=2>b?2:b>h?h:b;k=0;for(n=-2;2>=n;n++)for(u=-2;2>=u;u++)k+=v.get(c+n,h+u);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)n=8*a+h,u=8*b+k,r=m.get(n,u),p.set(n,u,r<=c),f&&q.set(n,u,!(r<=c))}f=f?{binarized:p,inverted:q}:{binarized:p};let {binarized:w,inverted:x}=f;(f=Q(d?x:w))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||\n(f=Q(d?w:x));return f}class A{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new A(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let b=a;b<a+c;b++)this.set(b,f,!!e)}}class S{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,\nb){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}class V{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,\na-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var r;(function(a){a.Numeric="numeric";a.Alphanumeric="alphanumeric";a.Byte="byte";a.Kanji="kanji";a.ECI="eci";a.StructuredAppend="structuredappend"})(r||(r={}));var t;(function(a){a[a.Terminator=0]="Terminator";a[a.Numeric=1]="Numeric";a[a.Alphanumeric=2]="Alphanumeric";a[a.Byte=4]="Byte";a[a.Kanji=8]="Kanji";a[a.ECI=7]="ECI";a[a.StructuredAppend=\n3]="StructuredAppend"})(t||(t={}));let B="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");class w{constructor(a,b){if(0===b.length)throw Error("No coefficients.");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===\nthis.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;if(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new w(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);\nfor(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new w(this.field,c)}multiplyPoly(a){if(this.isZero()||a.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let h=0;h<c;h++){let c=b[h];for(let b=0;b<d;b++){var f=h+b,g=this.field.multiply(c,a[b]);e[f]=e[h+b]^g}}return new w(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error("Invalid degree less than 0");if(0===b)return this.field.zero;\nlet c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new w(this.field,a)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(a=>{b^=a}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=J(this.field.multiply(a,b),this.coefficients[d]);return b}}class Y{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);\nthis.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new w(this,Uint8ClampedArray.from([0]));this.one=new w(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===a)throw Error("Can\'t invert 0");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,\nb){if(0>a)throw Error("Invalid monomial degree less than 0");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new w(this,a)}log(a){if(0===a)throw Error("Can\'t take log(0)");return this.logTable[a]}exp(a){return this.expTable[a]}}let K=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,\necBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},\n{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,\ndataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,\necBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},\n{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},\n{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},\n{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,\ndataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,\ndataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},\n{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},\n{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},\n{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},\n{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,\necBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,\ndataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,\ndataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,\necBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,\necBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,\ndataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,\n32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},\n{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},\n{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,\ndataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},\n{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,\necBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},\n{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,\n30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},\n{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,\ndataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},\n{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,\ndataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},\n{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,\ndataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}],da=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,\ndataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,\nformatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,\ndataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,\ndataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],aa=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2],y=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2)),la={inversionAttempts:"attemptBoth",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},\ncanOverwriteImage:!0};I.default=I;let G="dontInvert",D={red:77,green:150,blue:29,useIntegerApproximation:!0};self.onmessage=a=>{let b=a.data.data;switch(a.data.type){case "decode":a=I(b.data,b.width,b.height,{inversionAttempts:G,greyScaleWeights:D});self.postMessage({type:"qrResult",data:a?a.data:null});break;case "grayscaleWeights":D.red=b.red;D.green=b.green;D.blue=b.blue;D.useIntegerApproximation=b.useIntegerApproximation;break;case "inversionMode":switch(b){case "original":G="dontInvert";break;\ncase "invert":G="onlyInvert";break;case "both":G="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}})()\n\n']))},gW=function(e,t,r,n,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,i,a,s],l=0;(c=new Error(t.replace(/%s/g,(function(){return u[l++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}},vW=Pj(),yW=function(){function e(t){var r=this,n=t.container,o=t.lang,i=void 0===o?"en":o,a=t.assetRoot,s=void 0===a?"https://unpkg.com/@tsocial/tvweb-sdk@beta/assets":a,c=t.resourceRoot,u=t.customUrls,l=void 0===u?{}:u,d=t.enableAntiDebug,f=void 0===d||d,p=t.warmupMessage,h=t.baseComponent,m=t.component,g=void 0===m?{}:m,v=t.country,y=void 0===v?"vn":v,b=t.idCardContext,w=t.exifKey,C=void 0===w?"":w;fL(this,e),mL(this,"initNativeCamera",(function(e){var t=document.createElement("div");document.body.appendChild(t);var n=xw.createRef(),o=r.component.NativeCamera;return aL.render(xw.createElement(o,gL({},e,{ref:n})),t),{openCamera:function(){n.current.click()}}})),mL(this,"runWarmUpReadIDCard",dL(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.commonSettings.customUrls,e.abrupt("return",r.component.warmUpReadIdCard(t));case 2:case"end":return e.stop()}}),e)})))),mL(this,"runPreloadEKYCResources",dL(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=r.commonSettings.customUrls,r.component.preloadEKYCResources(t);case 2:case"end":return e.stop()}}),e)})))),mL(this,"destroyView",(function(){aL.unmountComponentAtNode(r.container)})),gW(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var k=pj({resourceRoot:c,initCustomUrls:l,country:y});this.commonSettings=yL({lang:i,assetRoot:s,customUrls:k,enableAntiDebug:f,debug:!1,warmupMessage:p,country:y,exifKey:C},b),this.component=yL(yL({},h),g)}return hL(e,[{key:"checkCamera",value:function(){return(0,this.component.checkCamera)()}},{key:"getListCamera",value:function(){return(0,this.component.getListCamera)()}},{key:"readIDCardWithApiCall",value:function(e){var t=this.component.ReadIDCardWithApiCall;aL.render(xw.createElement(mj,{value:this.commonSettings},xw.createElement(t,gL({onClose:this.destroyView},e))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var t=this.component.ReadIDCardUIOnly;aL.render(xw.createElement(mj,{value:this.commonSettings},xw.createElement(t,gL({onClose:this.destroyView},e))),this.container)}},{key:"livenessDetection",value:function(e){var t=this.component.LivenessDetection;aL.render(xw.createElement(mj,{value:this.commonSettings},xw.createElement(t,gL({onClose:this.destroyView},e))),this.container)}},{key:"compareFaces",value:function(e){var t=e.accessKey,r=e.secretKey,n=e.apiUrl,o=e.image1,i=e.image2,a=e.onSuccess,s=e.onError;dq(new wj(t,r,n,{httpHeaders:vW})).compareFaces({image1:{id:o},image2:{id:i}}).then((function(e){a(e)})).catch((function(e){s(e)}))}}]),e}();function bW(e){return(bW="function"==typeof Symbol&&"symbol"==By(Symbol.iterator)?function(e){return By(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":By(e)})(e)}function wW(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function CW(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){wW(i,n,o,a,s,"next",e)}function s(e){wW(i,n,o,a,s,"throw",e)}a(void 0)}))}}function kW(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function SW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EW(){return(EW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function BW(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?BW(Object(r),!0).forEach((function(t){SW(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BW(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xW(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function TW(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function AW(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}}(e,t)||PW(e,t)||function(){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 IW(e){return function(e){if(Array.isArray(e))return RW(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||PW(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PW(e,t){if(e){if("string"==typeof e)return RW(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?RW(e,t):void 0}}function RW(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var DW="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function OW(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function NW(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var LW,MW=NW((function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(e,t,r){e.exports={BROWSER_TYPES:{CHROME:"Chrome",FIREFOX:"Firefox",OPERA:"Opera",YANDEX:"Yandex",SAFARI:"Safari",INTERNET_EXPLORER:"Internet Explorer",EDGE:"Edge",CHROMIUM:"Chromium",IE:"IE",MOBILE_SAFARI:"Mobile Safari",EDGE_CHROMIUM:"Edge Chromium"},DEVICE_TYPES:{MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0},OS_TYPES:{IOS:"iOS",ANDROID:"Android",WINDOWS_PHONE:"Windows Phone",WINDOWS:"Windows",MAC_OS:"Mac OS"},defaultData:{isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1}}},function(e,t,r){var n,o=r(2),i=r(0),a=i.BROWSER_TYPES,s=i.OS_TYPES,c=i.DEVICE_TYPES,u=r(4),l=u.checkType,d=u.broPayload,f=u.mobilePayload,p=u.wearPayload,h=u.consolePayload,m=u.stvPayload,g=u.getNavigatorInstance,v=u.isIOS13Check,y=new o,b=y.getBrowser(),w=y.getDevice(),C=y.getEngine(),k=y.getOS(),S=y.getUA(),E=a.CHROME,B=a.CHROMIUM,_=a.IE,x=a.INTERNET_EXPLORER,T=a.OPERA,A=a.FIREFOX,I=a.SAFARI,P=a.EDGE,R=a.YANDEX,D=a.MOBILE_SAFARI,O=c.MOBILE,N=c.TABLET,L=c.SMART_TV,M=c.BROWSER,F=c.WEARABLE,U=c.CONSOLE,j=s.ANDROID,V=s.WINDOWS_PHONE,z=s.IOS,q=s.WINDOWS,H=s.MAC_OS,W=function(){return k.name===s.WINDOWS&&"10"===k.version&&"string"==typeof S&&-1!==S.indexOf("Edg/")},K=function(){return b.name===P},Q=function(){return v("iPad")},G=w.type===L,X=w.type===U,Y=w.type===F,$=b.name===D||Q(),Z=b.name===B,J=function(){switch(w.type){case O:case N:return!0;default:return!1}}()||Q(),ee=w.type===O,te=w.type===N||Q(),re=w.type===M,ne=k.name===j,oe=k.name===V,ie=k.name===z||Q(),ae=b.name===E,se=b.name===A,ce=b.name===I||b.name===D,ue=b.name===T,le=b.name===x||b.name===_,de=k.version?k.version:"none",fe=k.name?k.name:"none",pe=b.major,he=b.version,me=b.name,ge=w.vendor?w.vendor:"none",ve=w.model?w.model:"none",ye=C.name,be=C.version,we=S,Ce=K()||W(),ke=b.name===R,Se=w.type,Ee=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Be=Q(),_e=v("iPhone"),xe=v("iPod"),Te=function(){var e=g(),t=e&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)}(),Ae=W(),Ie=K(),Pe=k.name===q,Re=k.name===H,De=l(w.type);e.exports={deviceDetect:function(){var e=De.isBrowser,t=De.isMobile,r=De.isTablet,n=De.isSmartTV,o=De.isConsole,i=De.isWearable;return e?d(e,b,C,k,S):n?m(n,C,k,S):o?h(o,C,k,S):t||r?f(De,w,k,S):i?p(i,C,k,S):void 0},isSmartTV:G,isConsole:X,isWearable:Y,isMobileSafari:$,isChromium:Z,isMobile:J,isMobileOnly:ee,isTablet:te,isBrowser:re,isAndroid:ne,isWinPhone:oe,isIOS:ie,isChrome:ae,isFirefox:se,isSafari:ce,isOpera:ue,isIE:le,osVersion:de,osName:fe,fullBrowserVersion:pe,browserVersion:he,browserName:me,mobileVendor:ge,mobileModel:ve,engineName:ye,engineVersion:be,getUA:we,isEdge:Ce,isYandex:ke,deviceType:Se,isIOS13:Ee,isIPad13:Be,isIPhone13:_e,isIPod13:xe,isElectron:Te,isEdgeChromium:Ae,isLegacyEdge:Ie,isWindows:Pe,isMacOs:Re}},function(e,t,r){var n;
61
61
  /*!
62
62
  * UAParser.js v0.7.18
63
63
  * Lightweight JavaScript-based User-Agent string parser
@@ -81,4 +81,4 @@ var KH={};void 0!==KH.asn1&&KH.asn1||(KH.asn1={}),KH.asn1.ASN1Util=new function(
81
81
  *
82
82
  * Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
83
83
  * Dual licensed under GPLv2 or MIT
84
- */!function(o,i){var a="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",m="console",g="mobile",v="tablet",y="smarttv",b="wearable",w={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:i},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},C={rgx:function(e,t){for(var r,n,o,s,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(o=0;o<p.length;o++)l=u[++n],typeof(s=p[o])===c&&s.length>0?2==s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):i:this[s[0]]=l?s[1].call(this,l,s[2]):i:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):i):this[s]=l||i;d+=2}},str:function(e,t){for(var r in t)if(typeof t[r]===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(w.has(t[r][n],e))return"?"===r?i:r}else if(w.has(t[r],e))return"?"===r?i:r;return e}},k={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},S={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,p],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],p],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[l,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[l,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[l,p],[/(QQ)\/([\d\.]+)/i],[l,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[l,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,p],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[l,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,l],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[p,C.str,k.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],p],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,w.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",w.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,w.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,f,[d,v]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[d,v]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[f,u,[d,v]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[u,[f,"Amazon"],[d,v]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[u,C.str,k.device.amazon.model],[f,"Amazon"],[d,g]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[d,g]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[d,g]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[f,u,[d,g]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[d,g]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[u,[f,"Asus"],[d,v]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[d,v]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[u,[f,"Sony"],[d,g]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[d,m]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[d,m]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[d,m]],[/(sprint\s(\w+))/i],[[f,C.str,k.device.sprint.vendor],[u,C.str,k.device.sprint.model],[d,g]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[f,u,[d,v]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[d,g]],[/(nexus\s9)/i],[u,[f,"HTC"],[d,v]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[u,[f,"Huawei"],[d,g]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[d,g]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[d,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[d,g]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[u,[f,"Motorola"],[d,g]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[d,v]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,w.trim],[u,w.trim],[d,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[d,y]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[d,y]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[f,"Samsung"],u,[d,v]],[/smart-tv.+(samsung)/i],[f,[d,y],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[d,g]],[/sie-(\w*)/i],[u,[f,"Siemens"],[d,g]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[d,g]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[u,[f,"Acer"],[d,v]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[d,v]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[d,v]],[/(lg) netcast\.tv/i],[f,u,[d,y]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[d,g]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[d,v]],[/linux;.+((jolla));/i],[f,u,[d,g]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[d,b]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[d,g]],[/crkey/i],[[u,"Chromecast"],[f,"Google"]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[d,b]],[/android.+;\s(pixel c)\s/i],[u,[f,"Google"],[d,v]],[/android.+;\s(pixel xl|pixel)\s/i],[u,[f,"Google"],[d,g]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,g]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,v]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[d,v]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[u,[f,"OnePlus"],[d,g]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[d,v]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[d,v]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[d,v]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[d,v]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[d,v]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[d,v]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[d,g]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[d,v]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[d,v]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[d,v]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[d,v]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[d,v]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[d,g]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[d,g]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[d,v]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[u,[f,"MachSpeed"],[d,v]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[d,v]],[/android.+(KS(.+))\s+build/i],[u,[f,"Amazon"],[d,v]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[d,v]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[d,w.lowerize],f,u],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,p],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[p,C.str,k.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,C.str,k.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],p],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[l,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],p],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],p],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[l,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,p],[/(haiku)\s(\w+)/i],[l,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[l,p]]},E=function(e,t){if("object"==typeof e&&(t=e,e=i),!(this instanceof E))return new E(e,t).getResult();var r=e||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),n=t?w.extend(S,t):S;return this.getBrowser=function(){var e={name:i,version:i};return C.rgx.call(e,r,n.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:i};return C.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:i,model:i,type:i};return C.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:i,version:i};return C.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:i,version:i};return C.rgx.call(e,r,n.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=e,this},this};E.VERSION="0.7.18",E.BROWSER={NAME:l,MAJOR:"major",VERSION:p},E.CPU={ARCHITECTURE:h},E.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:m,MOBILE:g,SMARTTV:y,TABLET:v,WEARABLE:b,EMBEDDED:"embedded"},E.ENGINE={NAME:l,VERSION:p},E.OS={NAME:l,VERSION:p},typeof t!==s?(typeof e!==s&&e.exports&&(t=e.exports=E),t.UAParser=E):r(3)?(n=function(){return E}.call(t,r,t,e))===i||(e.exports=n):o&&(o.UAParser=E);var B=o&&(o.jQuery||o.Zepto);if(typeof B!==s){var _=new E;B.ua=_.getResult(),B.ua.get=function(){return _.getUA()},B.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),i=o.DEVICE_TYPES,a=o.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case i.MOBILE:return{isMobile:!0};case i.TABLET:return{isTablet:!0};case i.SMART_TV:return{isSmartTV:!0};case i.CONSOLE:return{isConsole:!0};case i.WEARABLE:return{isWearable:!0};case i.BROWSER:return{isBrowser:!0};default:return a}},broPayload:function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:o}},mobilePayload:function(e,t,r,o){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:o})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])})),w1="Expected a function",C1=NaN,k1="[object Symbol]",S1=/^\s+|\s+$/g,E1=/^[-+]0x[0-9a-f]+$/i,B1=/^0b[01]+$/i,_1=/^0o[0-7]+$/i,x1=parseInt,T1="object"==typeof r&&r&&r.Object===Object&&r,A1="object"==typeof self&&self&&self.Object===Object&&self,I1=T1||A1||Function("return this")(),P1=Object.prototype,R1=P1.toString,D1=Math.max,O1=Math.min,N1=function(){return I1.Date.now()};function L1(e,t,r){var n,o,i,a,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(w1);function p(t){var r=n,i=o;return n=o=void 0,u=t,a=e.apply(i,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):a}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=i}function g(){var e=N1();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?O1(r,i-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,a)}function y(){var e=N1(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),a}return t=j1(t)||0,M1(r)&&(l=!!r.leading,i=(d="maxWait"in r)?D1(j1(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?a:v(N1())},y}function M1(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function F1(e){return!!e&&"object"==typeof e}function U1(e){return"symbol"==typeof e||F1(e)&&R1.call(e)==k1}function j1(e){if("number"==typeof e)return e;if(U1(e))return C1;if(M1(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=M1(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(S1,"");var r=B1.test(e);return r||_1.test(e)?x1(e.slice(2),r?2:8):E1.test(e)?C1:+e}var V1=L1;function z1(e,t,r){class n extends xw.Component{constructor(){super(...arguments),this.updateDebounced=V1(this.forceUpdate,t,r)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return xw.createElement(e,Object.assign({},this.props))}}return n.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,KS(n,e)}function q1(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(r,n){e.call(navigator,t,r,n)}))}}:null}function H1(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===By(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,t){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(t){e(t.filter((function(e){return"video"===e.kind.toLowerCase()||"videoinput"===e.kind.toLowerCase()})).map((function(e){return{deviceId:null!=e.deviceId?e.deviceId:"",groupId:e.groupId,kind:"videoinput",label:e.label,toJSON:function(){return this}}})))}))}catch(e){return t(e)}}))}var W1,K1,Q1,G1,X1,Y1=["camtwist","obs virtual","logi capture","iglasses","virtual","cyberlink youcam","splitcam","splitcam virtual","splitcam video","snap camera","manycam virtual","chromacam","elgato virtual camera","sparkocam virtual webcam","webcammax capture","xsplit vcam","xpression"],$1=function(e){if(!e)return{isVirtual:!1};var t=e.getTracks();if(!t||!t.length)return{isVirtual:!1};var r=t[0].label,n=r&&Y1.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},Z1=function(e,t){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0&&!t)},J1=function(){var e,t;return{updateTime:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start";"start"===n?e=r:"end"===n&&(t=r)},getStart:function(){return e},getEnd:function(){return t}}},e5={closeButton:{top:"10px",right:"10px",left:"auto",bottom:"auto",display:"block",src:"",width:"20px",height:"auto"},popup:{backgroundColor:"#fff",padding:"5px",border:"1px solid #d7d7d7",borderRadius:"10px",overlay:{backgroundColor:"rgba(0, 0, 0, 0.5)"}}},t5=function(e,t,r){return y1(e,t,y1(r,t,""))},r5=function(e,t,r){var n=Jj.useAsset(r);return y1(e,t,n)},n5=q1(),o5={width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}},i5=function(e,t){var r=xw.useRef(null);xw.useEffect((function(){var n=e.current,o=function(){b1.isIOS&&"visible"===document.visibilityState&&setTimeout((function(){var e,o=null==n||null===(e=n.srcObject)||void 0===e?void 0:e.getVideoTracks();if(Array.isArray(o)&&o.length>0&&o.some((function(e){return e.muted}))){var i,a,s=null===(i=o[0])||void 0===i?void 0:i.getConstraints(),c=(null===(a=o[0])||void 0===a?void 0:a.getSettings()).deviceId;if(Object.keys(s).length>0)return void n5.getUserMedia({video:s,audio:!1}).then((function(e){r.current=e}));n5.getUserMedia({video:Oy({deviceId:c},null!=t?t:o5),audio:!1}).then((function(e){r.current=e,n.srcObject=e}))}}),1500)};return document.addEventListener("visibilitychange",o),function(){document.removeEventListener("visibilitychange",o)}}),[e,t]),xw.useEffect((function(){return function(){r.current&&(r.current.getTracks().forEach((function(e){return e.stop()})),r.current=null)}}),[])},a5=uL.Errors,s5=1e3,c5=dB.div(W1||(W1=Wy(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: #000;\n display: flex;\n justify-content: center;\n z-index: ",";\n ","\n"])),s5,(function(e){return e.checkCameraMode&&"opacity: 0;"})),u5=dB.video(K1||(K1=Wy(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),l5=dB.div(Q1||(Q1=Wy(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),d5=dB(l5)(G1||(G1=Wy(["\n z-index: ",";\n position: fixed;\n cursor: pointer;\n ","\n"])),s5+1e3,(function(e){var t=e.theme;return YE(["top:",";right:",";left:",";bottom:",";display:",";width:",";height:",";"],t5(t,"closeButton.top",e5),t5(t,"closeButton.right",e5),t5(t,"closeButton.left",e5),t5(t,"closeButton.bottom",e5),t5(t,"closeButton.display",e5),t5(t,"closeButton.width",e5),t5(t,"closeButton.height",e5))})),f5=dB.div(X1||(X1=Wy(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),s5+20),p5=xw.createRef(),h5=q1();function m5(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,i=e.onVideoPlayed,a=e.flipHorizontal,s=e.videoSettings,c=e.refVideo,u=e.onError,l=e.closeButton,d=e.videoClassName,f=e.scale,p=e.defaultCameraId,h=e.onWarning,m=xw.useRef(),g=yj.useSDKSettings().lang,v=mB(),y=Yj.useSDKTracking().sendEvent,b=r5(v,"closeButton.src","ic_close.png"),w=Ky(xw.useState(""),2),C=w[0],k=w[1],S=xw.useRef(!1),E=xw.useRef(!1),B=xw.useRef(!1),_=xw.useRef(),x=xw.useRef([]),T=xw.useRef(""),A=xw.useCallback((function(e){u&&u(e)}),[u]),I=xw.useCallback((function(){try{var e;clearInterval(m.current),(null==c||null===(e=c.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(c.current.srcObject.getTracks().forEach((function(e){return e.stop()})),c.current.srcObject=null)}catch(e){}clearTimeout(_)}),[c]);function P(){return R.apply(this,arguments)}function R(){return(R=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,H1();case 3:t=e.sent,x.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),lW.addExifData("device_info.camera_list",JSON.stringify(x.current.map((function(e){return e.label})))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}m.current||(m.current=setInterval((function(){document.getElementById("tv-camera-".concat(m.current))||I()}),1e3)),xw.useEffect((function(){return function(){B.current=!0}}),[]);var D=xw.useCallback((function(){_.current||(_.current=setTimeout((function(){S.current||(k(a5.camera_timeout.msg[g]),A(a5.camera_timeout))}),2e4))}),[g,A]),O=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,o,i,a,c,u,l,d,f,p,m=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=m.length>1&&void 0!==m[1]&&m[1],o={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return h&&h("too_many_request_to_camera"),e.abrupt("return",new Promise((function(e){return e(null)})));case 5:return window.tv_last_req_camera_complete=!1,o=b1.isMobile?b1.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},i=J1(),a=i.updateTime,c=i.getStart,u=i.getEnd,e.prev=8,l=s||o,a(performance.now(),"start"),Z1(b1.isMobile,b1.isIOS)&&r&&(l={}),n&&(l={}),lW.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),d={audio:!1,video:Oy(Oy({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)},e.next=17,h5.getUserMedia(d);case 17:return f=e.sent,e.next=20,P();case 20:if(D(),f){e.next=25;break}return k(a5.not_supported.msg[g]),A(a5.not_supported),e.abrupt("return",null);case 25:a(performance.now(),"end"),window.tv_last_req_camera_complete=!0,u()-c()<1600?y({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):y({tag:"cam_permission",event:"user_activity.allow",log:{}});try{p=f.getVideoTracks()[0].getSettings(),lW.addExifData("device_info.camera_label_dimension.got","".concat(p.width,"x").concat(p.height))}catch(e){}return e.abrupt("return",f);case 32:e.prev=32,e.t0=e.catch(8),a(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k(a5.no_permission.msg[g]),A(a5.no_permission),E.current=!0,y({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):E.current&&("NotReadableError"===e.t0.name?(A(a5.not_readable),k(a5.not_readable.msg[g])):(k(e.t0.message),A({code:e.t0.name||e.t0.code,message:e.t0.message})));case 36:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 38:case"end":return e.stop()}}),e,null,[[8,32]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,A,h,D,y]),N=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,s,u,l,d,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>0&&void 0!==h[0]?h[0]:p,o=h.length>1&&void 0!==h[1]&&h[1],!(null!=(a=c.current)&&null!==(t=a.srcObject)&&void 0!==t&&t.id&&null!=a&&null!==(r=a.srcObject)&&void 0!==r&&r.active&&S.current)){e.next=5;break}return e.abrupt("return");case 5:return a.oncanplaythrough=function(e){var t,r;a.play();var n=e.target.srcObject;lW.addExifData("device_info.camera_label",null==n||null===(t=n.getVideoTracks())||void 0===t||null===(r=t[0])||void 0===r?void 0:r.label),S.current=!0,k("");var o=window.innerWidth,s=window.innerHeight,c=xV.analyzeVideoAndWindowSizes(a),u=c.lostX,l=void 0===u?0:u,d=c.lostY,f=void 0===d?0:d,p=Math.min(o,Math.floor(o-2*l)),h=Math.min(s,Math.floor(s-2*f));i&&i({clientWidth:o,clientHeight:s,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,O(n,o);case 8:s=e.sent,u=$1(s),l=u.deviceLabel,(d=u.isVirtual)&&(T.current+="".concat(l,", "),(f=x.current.filter((function(e){return!T.current.includes(e.label)})))[0]&&f[0].deviceId&&N(f[0].deviceId)),s||E.current||(lW.addExifData("device_info.camera_label_retry","yes"),E.current=!0,N(n,!0)),s&&B.current&&(c.current.srcObject=s,I()),!s||B.current||d||(a.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,O,i,p,I]);xw.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N();case 2:return e.next=4,H1();case 4:t=e.sent,(r=t.filter((function(e){return"videoinput"===e.kind&&e.label.includes("back")&&e.label.includes("0")}))).length>0&&(n=r[0].deviceId,I(),N(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return S.current?function(){}:(!h5||b1.browserName&&["facebook"].includes(b1.browserName.toLowerCase())||b1.getUA.includes("Zalo iOS")?(k(a5.not_supported.msg[g]),A(a5.not_supported)):t&&(b1.isAndroid&&!1===r?function(){e.apply(this,arguments)}():N()),function(){B.current&&I()})}),[c,g,r,N,I,A]);var L=xw.useCallback((function(){I(),n&&n(),y({tag:"result",event:"user_activity.cancel",log:{}})}),[n,I,y]);i5(c,s);return xw.createElement(c5,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!C)return null;var e=a5.no_permission.msg[g];return C===e&&b1.isIOS?xw.createElement(f5,null,C," ",xw.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):xw.createElement(f5,null,C)}(),xw.createElement(u5,{ref:c,playsInline:!0,muted:!0,flipHorizontal:a,className:d,scale:f}),o,l?xw.cloneElement(l,{onClick:L,"data-testid":"close-camera"}):xw.createElement(d5,{onClick:L,"data-testid":"close-camera"},xw.createElement("img",{src:b,alt:""})))}m5.propTypes={checkCameraMode:xC.bool,frontCamera:xC.bool,onClose:xC.func,onError:xC.func,onVideoPlayed:xC.func,children:xC.node,flipHorizontal:xC.bool,videoSettings:xC.object,refVideo:xC.object,closeButton:xC.node,videoClassName:xC.string,scale:xC.number,defaultCameraId:xC.string,onWarning:xC.func},m5.defaultProps={checkCameraMode:!1,frontCamera:!0,onClose:null,onError:null,onVideoPlayed:null,children:null,flipHorizontal:!1,videoSettings:null,refVideo:null,closeButton:null,videoClassName:"",scale:1,defaultCameraId:void 0,onWarning:null};var g5,v5,y5,b5=z1(m5,250),w5=xw.forwardRef((function(e,t){return xw.createElement(m5,Ry({},e,{refVideo:t||p5}))})),C5=xw.forwardRef((function(e,t){return xw.createElement(b5,Ry({},e,{refVideo:t||p5}))})),k5=dB.table(g5||(g5=Wy(["\n width: 100%;\n height: 100%;\n td {\n text-align: center;\n vertical-align: middle;\n padding: 0;\n border: 0;\n }\n border-spacing: 0;\n table-layout: auto;\n border-collapse: collapse;\n"]))),S5=dB.div(v5||(v5=Wy(["\n position: relative;\n"]))),E5=Array.from(Array(3).keys()),B5=Array.from(Array(3).keys());function _5(e){var t=e.children,r=e.x,n=e.y,o=e.width,i=e.height,a=e.className,s=e.surroundStyle;return xw.createElement(k5,{className:a},xw.createElement("tbody",null,E5.map((function(e,a){return xw.createElement("tr",{key:e,style:{height:0===a?n:"auto"},"data-testid":"row"},B5.map((function(e,n){var c=1===a&&1===n,u="auto";return c?u=o:0===n&&(u=r),xw.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:Oy({width:u,height:c?i:"auto"},c?{}:s)},c?xw.createElement(S5,{style:{width:u,height:i}},t):null)})))}))))}_5.propTypes={children:xC.node,x:xC.string,y:xC.string,width:xC.string,height:xC.string,className:xC.string,surroundStyle:xC.object},_5.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var x5=dB(_5)(y5||(y5=Wy(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: ",";\n"])),s5+10);function T5(e){var t=e.className;return xw.createElement("svg",{className:t,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},xw.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),xw.createElement("desc",null,"Created with sketchtool."),xw.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},xw.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},xw.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},xw.createElement("g",{id:"Group-2"},xw.createElement("g",{id:"camera"},xw.createElement("path",{d:"M21,3 L17,3 L15,0 L9,0 L7,3 L3,3 C1.34314575,3 0,4.34314575 0,6 L0,18 C0,19.6568542 1.34314575,21 3,21 L21,21 C22.6568542,21 24,19.6568542 24,18 L24,6 C24,4.34314575 22.6568542,3 21,3 Z M12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.7614237,7 17,9.23857625 17,12 C17,14.7614237 14.7614237,17 12,17 L12,17 Z",id:"Shape"})))))))}T5.propTypes={className:xC.string},T5.defaultProps={className:""};var A5=function(){return j3.Date.now()},I5=A5,P5=/\s/;function R5(e){for(var t=e.length;t--&&P5.test(e.charAt(t)););return t}var D5=R5,O5=/^\s+/;function N5(e){return e?e.slice(0,D5(e)+1).replace(O5,""):e}var L5=N5,M5=NaN,F5=/^[-+]0x[0-9a-f]+$/i,U5=/^0b[01]+$/i,j5=/^0o[0-7]+$/i,V5=parseInt;function z5(e){if("number"==typeof e)return e;if(c0(e))return M5;if(h0(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h0(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=L5(e);var r=U5.test(e);return r||j5.test(e)?V5(e.slice(2),r?2:8):F5.test(e)?M5:+e}var q5=z5,H5="Expected a function",W5=Math.max,K5=Math.min;function Q5(e,t,r){var n,o,i,a,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(H5);function p(t){var r=n,i=o;return n=o=void 0,u=t,a=e.apply(i,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):a}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=i}function g(){var e=I5();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?K5(r,i-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,a)}function y(){var e=I5(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return clearTimeout(s),s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),a}return t=q5(t)||0,h0(r)&&(l=!!r.leading,i=(d="maxWait"in r)?W5(q5(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?a:v(I5())},y}var G5=Q5,X5="Expected a function";function Y5(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError(X5);return h0(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),G5(e,t,{leading:n,maxWait:t,trailing:o})}var $5=Y5,Z5=function(){try{var e=z0(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),J5=Z5;function e4(e,t,r){"__proto__"==t&&J5?J5(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var t4=e4,r4=Object.prototype,n4=r4.hasOwnProperty;function o4(e,t,r){var n=e[t];n4.call(e,t)&&f2(n,r)&&(void 0!==r||t in e)||t4(e,t,r)}var i4=o4;function a4(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var s=t[i],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?t4(r,s,c):i4(r,s,c)}return r}var s4=a4;function c4(e){return e}var u4=c4;function l4(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var d4=l4,f4=Math.max;function p4(e,t,r){return t=f4(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=f4(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),d4(e,this,s)}}var h4=p4;function m4(e){return function(){return e}}var g4=m4,v4=J5?function(e,t){return J5(e,"toString",{configurable:!0,enumerable:!1,value:g4(t),writable:!0})}:u4,y4=v4,b4=800,w4=16,C4=Date.now;function k4(e){var t=0,r=0;return function(){var n=C4(),o=w4-(n-r);if(r=n,o>0){if(++t>=b4)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var S4=k4,E4=S4(y4),B4=E4;function _4(e,t){return B4(h4(e,t,u4),e+"")}var x4=_4,T4=9007199254740991;function A4(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=T4}var I4=A4;function P4(e){return null!=e&&I4(e.length)&&!w0(e)}var R4=P4,D4=9007199254740991,O4=/^(?:0|[1-9]\d*)$/;function N4(e,t){var r=typeof e;return!!(t=null==t?D4:t)&&("number"==r||"symbol"!=r&&O4.test(e))&&e>-1&&e%1==0&&e<t}var L4=N4;function M4(e,t,r){if(!h0(r))return!1;var n=typeof t;return!!("number"==n?R4(r)&&L4(t,r.length):"string"==n&&t in r)&&f2(r[t],e)}var F4=M4;function U4(e){return x4((function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&F4(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t}))}var j4=U4;function V4(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var z4=V4,q4="[object Arguments]";function H4(e){return i0(e)&&n0(e)==q4}var W4=H4,K4=Object.prototype,Q4=K4.hasOwnProperty,G4=K4.propertyIsEnumerable,X4=W4(function(){return arguments}())?W4:function(e){return i0(e)&&Q4.call(e,"callee")&&!G4.call(e,"callee")},Y4=X4;function $4(){return!1}var Z4=$4,J4=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?j3.Buffer:void 0,i=(o?o.isBuffer:void 0)||Z4;e.exports=i})),e8="[object Arguments]",t8="[object Array]",r8="[object Boolean]",n8="[object Date]",o8="[object Error]",i8="[object Function]",a8="[object Map]",s8="[object Number]",c8="[object Object]",u8="[object RegExp]",l8="[object Set]",d8="[object String]",f8="[object WeakMap]",p8="[object ArrayBuffer]",h8="[object DataView]",m8="[object Float32Array]",g8="[object Float64Array]",v8="[object Int8Array]",y8="[object Int16Array]",b8="[object Int32Array]",w8="[object Uint8Array]",C8="[object Uint8ClampedArray]",k8="[object Uint16Array]",S8="[object Uint32Array]",E8={};function B8(e){return i0(e)&&I4(e.length)&&!!E8[n0(e)]}E8[m8]=E8[g8]=E8[v8]=E8[y8]=E8[b8]=E8[w8]=E8[C8]=E8[k8]=E8[S8]=!0,E8[e8]=E8[t8]=E8[p8]=E8[r8]=E8[h8]=E8[n8]=E8[o8]=E8[i8]=E8[a8]=E8[s8]=E8[c8]=E8[u8]=E8[l8]=E8[d8]=E8[f8]=!1;var _8=B8;function x8(e){return function(t){return e(t)}}var T8=x8,A8=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&M3.process,i=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i})),I8=A8&&A8.isTypedArray,P8=I8?T8(I8):_8,R8=P8,D8=Object.prototype,O8=D8.hasOwnProperty;function N8(e,t){var r=N3(e),n=!r&&Y4(e),o=!r&&!n&&J4(e),i=!r&&!n&&!o&&R8(e),a=r||n||o||i,s=a?z4(e.length,String):[],c=s.length;for(var u in e)!t&&!O8.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||L4(u,c))||s.push(u);return s}var L8=N8,M8=Object.prototype;function F8(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||M8)}var U8=F8;function j8(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}var V8=j8,z8=Object.prototype,q8=z8.hasOwnProperty;function H8(e){if(!h0(e))return V8(e);var t=U8(e),r=[];for(var n in e)("constructor"!=n||!t&&q8.call(e,n))&&r.push(n);return r}var W8=H8;function K8(e){return R4(e)?L8(e,!0):W8(e)}var Q8=K8,G8=j4((function(e,t,r,n){s4(t,Q8(t),e,n)})),X8=G8;function Y8(e,t){return function(r){return e(t(r))}}var $8=Y8,Z8=$8(Object.getPrototypeOf,Object),J8=Z8,e6="[object Object]",t6=Function.prototype,r6=Object.prototype,n6=t6.toString,o6=r6.hasOwnProperty,i6=n6.call(Object);function a6(e){if(!i0(e)||n0(e)!=e6)return!1;var t=J8(e);if(null===t)return!0;var r=o6.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&n6.call(r)==i6}var s6=a6,c6="[object DOMException]",u6="[object Error]";function l6(e){if(!i0(e))return!1;var t=n0(e);return t==u6||t==c6||"string"==typeof e.message&&"string"==typeof e.name&&!s6(e)}var d6=l6,f6=x4((function(e,t){try{return d4(e,void 0,t)}catch(e){return d6(e)?e:new Error(e)}})),p6=f6;function h6(e,t){return r1(t,(function(t){return e[t]}))}var m6=h6,g6=Object.prototype,v6=g6.hasOwnProperty;function y6(e,t,r,n){return void 0===e||f2(e,g6[r])&&!v6.call(n,r)?t:e}var b6=y6,w6={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function C6(e){return"\\"+w6[e]}var k6=C6,S6=$8(Object.keys,Object),E6=S6,B6=Object.prototype,_6=B6.hasOwnProperty;function x6(e){if(!U8(e))return E6(e);var t=[];for(var r in Object(e))_6.call(e,r)&&"constructor"!=r&&t.push(r);return t}var T6=x6;function A6(e){return R4(e)?L8(e):T6(e)}var I6=A6,P6=/<%=([\s\S]+?)%>/g,R6=P6;function D6(e){return function(t){return null==e?void 0:e[t]}}var O6=D6,N6={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},L6=O6(N6),M6=L6,F6=/[&<>"']/g,U6=RegExp(F6.source);function j6(e){return(e=u1(e))&&U6.test(e)?e.replace(F6,M6):e}var V6=j6,z6=/<%-([\s\S]+?)%>/g,q6=z6,H6=/<%([\s\S]+?)%>/g,W6=H6,K6={escape:q6,evaluate:W6,interpolate:R6,variable:"",imports:{_:{escape:V6}}},Q6=K6,G6="Invalid `variable` option passed into `_.template`",X6=/\b__p \+= '';/g,Y6=/\b(__p \+=) '' \+/g,$6=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z6=/[()=,{}\[\]\/\s]/,J6=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,e9=/($^)/,t9=/['\n\r\u2028\u2029\\]/g,r9=Object.prototype,n9=r9.hasOwnProperty;function o9(e,t,r){var n=Q6.imports._.templateSettings||Q6;r&&F4(e,t,r)&&(t=void 0),e=u1(e),t=X8({},t,n,b6);var o,i,a=X8({},t.imports,n.imports,b6),s=I6(a),c=m6(a,s),u=0,l=t.interpolate||e9,d="__p += '",f=RegExp((t.escape||e9).source+"|"+l.source+"|"+(l===R6?J6:e9).source+"|"+(t.evaluate||e9).source+"|$","g"),p=n9.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,a,s,c){return n||(n=a),d+=e.slice(u,c).replace(t9,k6),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var h=n9.call(t,"variable")&&t.variable;if(h){if(Z6.test(h))throw new Error(G6)}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(X6,""):d).replace(Y6,"$1").replace($6,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=p6((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(m.source=d,d6(m))throw m;return m}var i9=o9,a9=uL.Errors;function s9(e){var t=e.livenessSettings,r=e.apiClient,n=e.apiCheck,o=e.onError,i=e.mode,a=void 0===i?uL.LivenessDetection.Mode.ACTIVE:i,s=Ky(xw.useState({face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,take_one_picture_time_ms:3e3,limit_time_liveness_check:{enable:!1,limit_time_second:45},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5},exif_data_settings:{enable:!0},record_video:{enable:!1},auto_capture:{enable:!0,show_capture_button:!0,show_countdown:!0,wait_for_best_image_time_ms_web:3e3},manual_capture:{show_countdown:!0,wait_for_best_image_time_ms_web:3e3},blur_check:{enable:!0,web_blurry_threshold:.4},web_is_required_frontal_face:!0}),2),c=s[0],u=s[1];return xw.useEffect((function(){t&&Object.keys(t).length>0?u((function(e){return Oy(Oy({},e),t)})):n&&r.clientSettings().then((function(e){if(e&&e.data){var t=y1(e,"data.settings.sdk_settings.active_liveness_settings",{}),r=y1(e,"data.settings.sdk_settings.passive_liveness_settings",{}),n=y1(e,"data.settings.sdk_settings.liveness_settings",{}),i={};a===uL.Mode.ACTIVE&&(i=Oy(Oy({},r),t)),a===uL.Mode.PASSIVE&&(i=Oy(Oy({},t),r));var s,c=y1(t,"save_encoded_frames",{});c.enable&&(s={enable:!0,framesIntervalTime:c.frames_interval_ms,framesBatchLength:c.frames_batch_len});var l=y1(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});u(Oy(Oy(Oy({},i),n),{},{captureFrameSettings:s,exif_data_settings:l}))}e&&e.errors&&o(a9.server_error)})).catch((function(e){o(e)}))}),[t,r,o,n,a]),c}var c9={Selfie:{backgroundColor:"rgba(0, 0, 0, 0.6)",captureIcon:{src:"",width:"50px"},countdown:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px",padding:"5px 10px"},error:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px",padding:"5px 10px"},progressCircle:{radius:160,strokeWidth:3,progress:0,showErrorRing:!0,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:1,insideRingStrokeDash:"2",errorRingColor:"#df0000",errorRingWidth:1,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!1,showDashedRing:!1,showInsideRing:!0},Active:{instruction:{color:"#fff",fontSize:"20px",fontWeight:"normal",textShadow:"2px 2px 4px #000000",backgroundColor:"unset",border:"unset",borderRadius:"unset"},directionIcon:{frontal:"",left:"",right:"",up:"",width:"70px"},imageHolder:{width:"40px",height:"40px",borderRadius:"50%",border:"2px solid #fff",fontSize:"16px",color:"#fff",fontWeight:"700",frontal:"",left:"",right:"",up:""}}}},u9=function(e){var t=e.curStep,r=e.faceDirection,n=y1(t,"stepTimeConstraints.delayTime");return!!n&&(null===t.firstFrameSpottedAt?(t.name===r&&(t.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-t.firstFrameSpottedAt<n)},l9=function(e,t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,C,k,S,E;return{radius:null!==(r=e.radius)&&void 0!==r?r:t5(t,"Selfie.progressCircle.radius",c9),strokeWidth:null!==(n=e.strokeWidth)&&void 0!==n?n:t5(t,"Selfie.progressCircle.strokeWidth",c9),progress:null!==(o=e.progress)&&void 0!==o?o:t5(t,"Selfie.progressCircle.progress",c9),showErrorRing:null!==(i=e.showErrorRing)&&void 0!==i?i:t5(t,"Selfie.progressCircle.showErrorRing",c9),activeColor:null!==(a=e.activeColor)&&void 0!==a?a:t5(t,"Selfie.progressCircle.activeColor",c9),innerPadding:null!==(s=e.innerPadding)&&void 0!==s?s:t5(t,"Selfie.progressCircle.innerPadding",c9),outsideRingColor:null!==(c=e.outsideRingColor)&&void 0!==c?c:t5(t,"Selfie.progressCircle.outsideRingColor",c9),outsideRingOpacity:null!==(u=e.outsideRingOpacity)&&void 0!==u?u:t5(t,"Selfie.progressCircle.outsideRingOpacity",c9),insideRingColor:null!==(l=e.insideRingColor)&&void 0!==l?l:t5(t,"Selfie.progressCircle.insideRingColor",c9),insideRingWidth:null!==(d=e.insideRingWidth)&&void 0!==d?d:t5(t,"Selfie.progressCircle.insideRingWidth",c9),insideRingStrokeDash:null!==(f=e.insideRingStrokeDash)&&void 0!==f?f:t5(t,"Selfie.progressCircle.insideRingStrokeDash",c9),errorRingWidth:null!==(p=e.errorRingWidth)&&void 0!==p?p:t5(t,"Selfie.progressCircle.errorRingWidth",c9),errorRingColor:null!==(h=e.errorRingColor)&&void 0!==h?h:t5(t,"Selfie.progressCircle.errorRingColor",c9),dashedRingColor:null!==(m=e.dashedRingColor)&&void 0!==m?m:t5(t,"Selfie.progressCircle.dashedRingColor",c9),dashedRingOpacity:null!==(g=e.dashedRingOpacity)&&void 0!==g?g:t5(t,"Selfie.progressCircle.dashedRingOpacity",c9),dashedRingWidth:null!==(v=e.dashedRingWidth)&&void 0!==v?v:t5(t,"Selfie.progressCircle.dashedRingWidth",c9),dashedRingLineThick:null!==(y=e.dashedRingLineThick)&&void 0!==y?y:t5(t,"Selfie.progressCircle.dashedRingLineThick",c9),dashedRingLineSpacing:null!==(b=e.dashedRingLineSpacing)&&void 0!==b?b:t5(t,"Selfie.progressCircle.dashedRingLineSpacing",c9),dashedInsideRingColor:null!==(w=e.dashedInsideRingColor)&&void 0!==w?w:t5(t,"Selfie.progressCircle.dashedInsideRingColor",c9),dashedInsideRingWidth:null!==(C=e.dashedInsideRingWidth)&&void 0!==C?C:t5(t,"Selfie.progressCircle.dashedInsideRingWidth",c9),showOutsideRing:null!==(k=e.showOutsideRing)&&void 0!==k?k:t5(t,"Selfie.progressCircle.showOutsideRing",c9),showInsideRing:null!==(S=e.showInsideRing)&&void 0!==S?S:t5(t,"Selfie.progressCircle.showInsideRing",c9),showDashedRing:null!==(E=e.showDashedRing)&&void 0!==E?E:t5(t,"Selfie.progressCircle.showDashedRing",c9)}},d9=function(e){var t=e.incomingFrame,r=e.currentBestFrame;return null==t||!t.isEyeClosed||null!=r&&r.isEyeClosed?null!=t&&t.isEyeClosed||null==r||!r.isEyeClosed?(null==t?void 0:t.blurScore)>(null==r?void 0:r.blurScore)?t:r:t:r};function f9(e){return new Promise((function(t){var r=new Image;r.onload=t,r.onerror=t,r.src=e}))}var p9=1/0,h9=17976931348623157e292;function m9(e){return e?(e=q5(e))===p9||e===-p9?(e<0?-1:1)*h9:e==e?e:0:0===e?e:0}var g9=m9;function v9(e){var t=g9(e),r=t%1;return t==t?r?t-r:t:0}var y9=v9,b9="Expected a function";function w9(e,t){var r;if("function"!=typeof t)throw new TypeError(b9);return e=y9(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var C9=w9;function k9(e){return C9(2,e)}var S9=k9,E9=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.closeEyesModelUrl,n=void 0===r?dW:r,e.next=3,Vq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function B9(){return _9.apply(this,arguments)}function _9(){return(_9=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.blazefaceModelUrl,n=t.tfScriptUrls,o=t.closeEyesModelUrl,i=new fW(o),e.next=4,Vq.loadTensorFlow(n);case 4:return e.next=6,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return a=[Vq.loadBlazefaceModel({modelUrl:r}),i.load()],e.next=9,Promise.all(a);case 9:return s=e.sent,c=Ky(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:i});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x9,T9=S9(B9),A9=[],I9=function(){A9=[]},P9=function(e,t,r){r&&I9(),A9.push({id:null});var n=A9.length-1;t.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?A9[n].id=e.data.file_id:A9[n].id=-1}))},R9=function(){return new Promise((function(e){var t=setInterval((function(){A9.every((function(e){return e.id}))&&(e(),clearInterval(t))}),200)}))},D9=function(e){return e.enable?A9.some((function(e){return-1===e.id}))?null:A9:[]},O9=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.steps,n=t.apiClient,o=t.FaceDirection,i=t.outputEncryptionSettings,a=t.video,s=[],r.forEach((function(e){var t=e.name,r=e.image,a=e.frontalFaceImage;if(t!==o.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:r.leftRightScore,gesture:t})};i&&i.key?s.push(n.httpClient.post("/v1/images",Oy({base64:r.encrypted.hex},c),{"X-TV-Key":i.key})):s.push(n.uploadImage(Oy({file:r.blob},c)))}else s.push(Promise.resolve({data:{image_id:null}}));if(a.blob){var u={label:"portrait",metadata:JSON.stringify({gesture_score:a.leftRightScore,gesture:o.FRONTAL})};i&&i.key?s.push(n.httpClient.post("/v1/images",Oy({base64:a.encrypted.hex},u),{"X-TV-Key":i.key})):s.push(n.uploadImage(Oy({file:a.blob},u)))}else s.push(Promise.resolve({data:{image_id:null}}))})),c=a?n.uploadFile({file:a,label:"video"}):Promise.resolve({data:{file_id:null}}),e.next=6,Promise.all([c].concat(s));case 6:return u=e.sent,l=Qy(u),d=l[0],f=l.slice(1),r.forEach((function(e,t){e.image.imageId=f[2*t].data.image_id,e.frontalFaceImage.imageId=f[2*t+1].data.image_id})),e.abrupt("return",d);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),N9=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.faceVerificationFlowData,o=t.onLivenessDetectionDone,i=t.captureFrameSettings,a=t.FaceDirection,s=t.onError,c=t.outputEncryptionSettings,u=t.video,e.prev=1,l=n.current.steps,e.next=5,O9({steps:l,apiClient:r,FaceDirection:a,outputEncryptionSettings:c,video:u});case 5:if(0!==(d=l.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=10;break}o({error:"wrong_face_movement"}),e.next=27;break;case 10:return e.next=12,R9();case 12:if(f=D9(i)){e.next=17;break}o({error:"network_error"}),e.next=27;break;case 17:return p=r.verifyFaceLiveness({images:d.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:l.filter((function(e){return e.image.imageId&&e.name!==a.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:f}),h=r.requestVerifyPortrait({image:{id:d[d.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([p,h]);case 21:m=e.sent,g=Ky(m,2),v=g[0],y=g[1],b=!0===v.data.is_live,o({apiCheckPassed:b,verifyFaceLivenessResult:v.data,verifyFacePortraitResult:y.data,frontalFaces:d.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:l.filter((function(e){return e.image.imageId&&e.name!==a.FRONTAL})).map((function(e){var t=e.name,r=e.image;return{name:t,blob:r.blob,id:r.imageId}}))});case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(1),s({error:e.t0});case 32:case"end":return e.stop()}}),e,null,[[1,29]])})));return function(t){return e.apply(this,arguments)}}(),L9=[],M9=null,F9=!1,U9=function(){return L9},j9=function(){F9=!0,L9=[];try{M9 instanceof MediaStream&&(M9.getTracks().forEach((function(e){return e.stop()})),M9=null)}catch(e){}};function V9(e,t,r){if(e.data.size>0){var n=new Blob([e.data],{type:"video/mp4"});L9.push(n),t()}else console.error("No video have recored!"),r()}function z9(e,t,r,n){if(e&&n){var o=n.cropX,i=n.cropY,a=n.cropWidth,s=n.cropHeight;e.drawImage(t,o,i,a,s,0,0,r,r),F9||requestAnimationFrame((function(){return z9(e,t,r,n)}))}}function q9(e){return H9.apply(this,arguments)}function H9(){return(H9=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.outputImagesSize,n=t.videoEl,o=t.resultAnalyzeVideoAndWindowSizes,j9(),(a=document.createElement("canvas")).width=r,a.height=r,s=a.getContext("2d"),e.prev=6,c={width:{min:360,ideal:400},height:{min:360,ideal:400}},u={mimeType:"video/webm"},e.prev=9,M9=null==n||null===(l=n.captureStream())||void 0===l?void 0:l.clone(),d=M9.getVideoTracks()[0],e.next=14,d.applyConstraints(c);case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(9);case 18:MediaRecorder.isTypeSupported("video/mp4")&&(F9=!1,z9(s,n,r,o),M9=a.captureStream(25),u={mimeType:"video/mp4",videoBitsPerSecond:25e5}),i=new MediaRecorder(M9,u),f=function(){return new Promise((function(e,t){i.ondataavailable=function(r){return V9(r,e,t)},"inactive"!==i.state&&i.stop()}))},p=function(){var e=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f();case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),h=function(){"inactive"!==i.state&&i.stop()},i.stopVideoRecording=p,i.discardRecording=h,e.next=29;break;case 27:e.prev=27,e.t1=e.catch(6);case 29:return e.abrupt("return",{mediaRecorder:i});case 30:case"end":return e.stop()}}),e,null,[[6,27],[9,16]])})))).apply(this,arguments)}var W9,K9,Q9,G9,X9,Y9,$9,Z9,J9=KV.faceTracker(),e7=new Kq,t7=uL.Mode,r7=uL.FaceDirection,n7=uL.Errors,o7=uL.Messages,i7=uL.TrackLivenessEvents,a7=-1,s7=3,c7=1,u7={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(x9={},Py(x9,uL.FaceDirection.UP,{delayTime:0}),Py(x9,uL.FaceDirection.LEFT,{delayTime:0}),Py(x9,uL.FaceDirection.RIGHT,{delayTime:0}),Py(x9,uL.FaceDirection.FRONTAL,{delayTime:2e3}),x9),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}};function l7(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,r=e.mode,n=e.bgCameraMask,o=e.bgCameraMaskRed,i=e.surroundStyle,a=e.cropAreaDimension,s=e.customInstructions,c=e.customIcon,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=void 0===l?u7.customStepTimeConstraints:l,f=e.onLivenessDetectionDone,p=e.onError,h=e.frontalMinSize,m=e.waitingTimeToGetBetterFrames,g=void 0===m?500:m,v=e.captureFrameSettings,y=void 0===v?u7.captureFrameSettings:v,b=e.livenessSettings,w=e.setRemainingTime,C=void 0===w?u7.setRemainingTime:w,k=e.onProcessing,S=void 0===k?u7.onProcessing:k,E=e.customErrors,B=e.customMessages,_=e.apiCredentials,x=void 0===_?{}:_,T=e.onFramesCaptured,A=void 0===T?u7.onFramesCaptured:T,I=e.initFirstGestureTimeout,P=void 0===I?2e3:I,R=e.outputEncryptionSettings,D=e.cameraScale,O=void 0===D?1:D,N=e.passiveModeAuto,L=void 0!==N&&N,M=e.sendCustomEvent,F=e.onReset,U=xw.useState(!1),j=Ky(U,2),V=j[0],z=j[1],q=xw.useState(!1),H=Ky(q,2),W=H[0],K=H[1],Q=xw.useState(!1),G=Ky(Q,2),X=G[0],Y=G[1],$=xw.useState(!1),Z=Ky($,2),J=Z[0],ee=Z[1],te=xw.useRef(null),re=yj.useSDKSettings(),ne=re.lang,oe=re.assetRoot,ie=re.customUrls,ae=re.exifKey,se=fq.useApiClient({apiCredentials:x}),ce=se.apiClient,ue=r===t7.ACTIVE,le=xw.useReducer((function(e){return e+1}),0),de=Ky(le,2),fe=(de[0],de[1]),pe=xw.useRef(null),he=xw.useRef(!1),me=xw.useState(!1),ge=Ky(me,2),ve=ge[0],ye=ge[1],be=xw.useRef({}),we=Yj.useSDKTracking(),Ce=we.sendEvent,ke=hW(),Se=ke.startMotion,Ee=ke.stopMotion,Be=ke.motionData,_e=ke.orientationData,xe=xw.useState(s7),Te=Ky(xe,2),Ae=Te[0],Ie=Te[1],Pe=xw.useState(!1),Re=Ky(Pe,2),De=Re[0],Oe=Re[1],Ne=xw.useRef(!1),Le=xw.useCallback((function(e){Oe(e),Ne.current=e}),[]),Me=xw.useRef(null),Fe=xw.useRef([]),Ue=xw.useRef(null),je=xw.useRef(),Ve=xw.useRef(null);null===Ve.current&&(Ve.current=KV.initFaceVerificationData({assetRoot:oe,customInstructions:s,customIcon:c,customDirectionIcon:u,customStepTimeConstraints:d}));var ze=xw.useState(),qe=Ky(ze,2),He=qe[0],We=qe[1],Ke=xw.useCallback((function(e){We(e)}),[]),Qe=xw.useMemo((function(){return $5(Ke,500)}),[Ke]),Ge=xw.useRef([]),Xe=xw.useRef(),Ye=s9({livenessSettings:b,apiClient:ce,apiCheck:t,onError:p,mode:r}),$e=Ye.face_tracking_setting,Ze=Ye.flow_interval_time_ms,Je=Ye.limit_time_liveness_check,et=Ye.terminate_if_no_face,tt=Ye.close_eye_detector,rt=void 0===tt?{}:tt,nt=Ye.captureFrameSettings,ot=void 0===nt?y:nt,it=Ye.exif_data_settings,at=Ye.record_video,st=Ye.take_one_picture_time_ms,ct=Ye.auto_capture,ut=Ye.blur_check,lt=Ye.web_is_required_frontal_face,dt=null==ct?void 0:ct.wait_for_best_image_time_ms_web,ft=ue?st:dt,pt=null==at?void 0:at.enable,ht=xw.useRef(""),mt=xw.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==i7?void 0:i7.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===ht.current)return;ht.current=r}Ce(e),M&&M(e)}}),[M,Ce]),gt=xw.useMemo((function(){return $5((function(e){mt(e)}),2e3)}),[mt]),vt=xw.useRef(0),yt=xw.useRef(),bt=xw.useRef();xw.useEffect((function(){mt({tag:"selfie",event:null==i7?void 0:i7.start_camera,log:{}})}),[mt]),xw.useEffect((function(){return e7.start(),lW.initExifData(),function(){e7.stop()}}),[]),xw.useEffect((function(){var e=!1;function t(){return(t=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ve){t.next=13;break}return Xe.current=performance.now(),t.next=4,T9(ie);case 4:return be.current=t.sent,t.next=7,Vq.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){t.next=9;break}return t.abrupt("return");case 9:ye(!0),mt({tag:"selfie",event:null==i7?void 0:i7.show_warmup,log:{}}),mt({tag:"selfie",event:null==i7?void 0:i7.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Xe.current}}),Xe.current=null;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[ve,ie,mt]);var wt=xw.useRef(!1),Ct=xw.useCallback((function(){var e;C(""),Ve.current.curStepIndex=Ve.current.steps.length,wt.current=!0,Y(!1),e7.stop(),null===(e=bt.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;Ve.current=KV.initFaceVerificationData({assetRoot:oe,customInstructions:s,customIcon:c,customDirectionIcon:u}),e7.start(),vt.current=0,yt.current=null,Ge.current=[],ee(!1),I9(),null===(e=bt.current)||void 0===e||e.start(),wt.current=!1,clearInterval(Me.current),Le(!1),Ie(s7),Ue.current=null,Fe.current=[],je.current=null,"function"==typeof F&&F(),fe()}),Ze)}),[C,Ze,oe,s,c,u,Le,F]),kt=xw.useMemo((function(){return Oy(Oy({},n7),E)}),[E]),St=xw.useMemo((function(){return Oy(Oy({},o7),B)}),[B]),Et=400;xw.useEffect((function(){if(W&&Je.enable&&J){var e=Je.limit_time_second+1,t=Je.remain_time_show||10,r=Je.format||"s";e7.start("limit",(function(n){var o=e-n;if(Ve.current.curStepIndex<Ve.current.steps.length){if(o<=t&&o>=1){var i=i9(St.REMAIN_TIME[ne]),a=o;switch(r){case"mm:ss":a=o.toString().padStart(5,"00:00");break;case"ss":a=o.toString().padStart(2,"0")}C(i({x:a}))}if(0===o){var s,c={};Object.keys(null===(s=kt.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=i9(null===(t=kt.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:Je.limit_time_second})})),We(Oy(Oy({},kt.liveness_terminated_time_out),{},{msg:c,duration:Ze})),mt({tag:"selfie",event:null==i7?void 0:i7.show_alert,log:{alert:"liveness_terminated_time_out,"}}),Ct()}}}))}}),[Ct,C,W,ne,Ze,Je.enable,Je.limit_time_second,J,kt.liveness_terminated_time_out,St.REMAIN_TIME,Je.format,Je.remain_time_show,mt]);var Bt=xw.useCallback((function(e){var t,r,o=e.clientWidth,s=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;b1.isMobile?r=t=c:t=r=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=n;pe.current={x:f,y:p,width:t,height:r,image:h,surroundStyle:i},"object"===By(a)?pe.current=Oy(Oy({},pe.current),a):"function"==typeof a&&(pe.current=Oy(Oy({},pe.current),a({clientWidth:o,clientHeight:s,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:b1.isMobile,width:t,height:r}))),fe(),K(!0)}),[n,i,a]),_t=xw.useCallback((function(){Ie(s7),clearInterval(Me.current),Le(!0);var e=function(){var e=xy(regeneratorRuntime.mark((function e(r){var n,o,i,a,s,c,u,l,d,h,m,g,v,y,b,w,C,k,E,B,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r-1!=0){e.next=52;break}return clearInterval(Me.current),S(),e.next=5,null===(n=bt.current)||void 0===n?void 0:n.stopVideoRecording();case 5:return z(!0),Ee(),lW.preWriteExif({mode:lW.MODE.SELFIE,motionData:Be,orientationData:_e,startTime:Date.now()-1e3*e7.duration("from_1st_frame"),endTime:Date.now(),exifKey:ae}),o=ct.enable?[Ue.current]:Fe.current,i=o.map((function(e){return Jz.resizeBlobImg(e.blob,Et,Et)})),e.next=12,Promise.all(i);case 12:return a=e.sent,s=a.map((function(e,t){return lW.writeExif({mode:lW.MODE.SELFIE,imageData:Oy(Oy({},o[t]),{},{blob:e,gesture:"frontal"}),enableExifData:it.enable})})),e.next=16,Promise.all(s);case 16:if(c=e.sent,u={},!R||!R.key){e.next=25;break}return l=R.key,d=c.map((function(e){return Wq.encrypt({blob:e,key:l})})),e.next=23,Promise.all(d);case 23:h=e.sent,u={frontalFacesEncrypted:h};case 25:if(t){e.next=30;break}f(Oy(Oy({frontalFaces:c},u),{},{capturedFrames:Ge.current,video:U9()})),j9(),e.next=52;break;case 30:return m=Gy(Ge.current),g=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:r7.FRONTAL})}},v=o.map((function(e,t){return ce.uploadImage(Oy({file:c[t]},g(e.leftRightScore)))})),R&&R.key&&(v=o.map((function(e,t){return ce.httpClient.post("/v1/images",Oy({base64:u.frontalFacesEncrypted[t].hex},g(e.leftRightScore)),{"X-TV-Key":R.key})}))),e.prev=34,e.next=37,Promise.all(v);case 37:return w=e.sent,C=ce.verifyFaceLiveness({images:w.map((function(e){return{id:e.data.image_id}})),videos:[{frames:m}]}),k=ce.requestVerifyPortrait({image:{id:null==w||null===(y=w[w.length-1])||void 0===y||null===(b=y.data)||void 0===b?void 0:b.image_id}}),e.next=42,Promise.all([C,k]);case 42:E=e.sent,B=Ky(E,2),_=B[0],x=B[1],f({apiCheckPassed:_.data.is_live,verifyFaceLivenessResult:_.data,verifyFacePortraitResult:x.data,frontalFaces:w.map((function(e,t){var r,n,i;return{id:null==e||null===(r=e.data)||void 0===r?void 0:r.image_id,blob:null===(n=o)||void 0===n||null===(i=n[t])||void 0===i?void 0:i.blob}}))}),e.next=52;break;case 49:e.prev=49,e.t0=e.catch(34),p({error:e.t0});case 52:case"end":return e.stop()}}),e,null,[[34,49]])})));return function(t){return e.apply(this,arguments)}}();Me.current=setInterval((function(){Ie((function(t){return e(t),t-1}))}),ft/s7)}),[null==ct?void 0:ct.enable,ft,Le,t,f,ce,p,S,R,Ee,Be,_e,it.enable,ae]),xt=xw.useRef({});xw.useEffect((function(){xt.current.isFirstValidFrameFoundRef=J}),[J]),xw.useEffect((function(){var e,i=te.current,a=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Ve.current.steps,r=[],t.map((function(e){return r.push({name:e.name,blob:e.image.blob,captureTime:e.image.captureTime,gesture:e.name}),e.frontalFaceImage.blob&&r.push({name:e.name,blob:e.frontalFaceImage.blob,captureTime:e.frontalFaceImage.captureTime,gesture:r7.FRONTAL}),0})),n=r.map((function(e){return Jz.resizeBlobImg(e.blob,Et,Et)})),e.next=6,Promise.all(n);case 6:return o=e.sent,i="0",y.framesBatchLength>0&&(a="".concat(Math.floor(Ge.current.length/y.framesBatchLength),"x").concat(y.framesBatchLength),s=Ge.current.length%y.framesBatchLength>0?"+".concat(Ge.current.length%y.framesBatchLength):"",i="".concat(Ge.current.length,":").concat(a).concat(s)),c=o.map((function(e,t){return lW.writeExif({mode:lW.MODE.SELFIE,imageData:Oy(Oy({},r[t]),{},{blob:e,frames:i}),enableExifData:it.enable})})),e.next=12,Promise.all(c);case 12:return u=e.sent,l=r.map((function(e,t){return{name:e.name,blob:u[t]}})),e.next=16,Promise.all(t.map(function(){var e=xy(regeneratorRuntime.mark((function e(r,n){var o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=l.filter((function(e){return e.name===r.name})),t[n].image.blob=o[0].blob,r.frontalFaceImage.blob&&(t[n].frontalFaceImage.blob=o[1].blob),!R||!R.key){e.next=12;break}return i=R.key,e.next=7,Wq.encrypt({blob:o[0].blob,key:i});case 7:if(t[n].image.encrypted=e.sent,!r.frontalFaceImage.blob){e.next=12;break}return e.next=11,Wq.encrypt({blob:o[1].blob,key:i});case 11:t[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=function(){var e=xy(regeneratorRuntime.mark((function e(){var r,n,o,i,s,c,u,l,d,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Ve.current.steps,o=n[Ve.current.curStepIndex],Py(r={},uL.FaceDirection.UP,null==i7?void 0:i7.capture_up_face),Py(r,uL.FaceDirection.LEFT,null==i7?void 0:i7.capture_left_face),Py(r,uL.FaceDirection.RIGHT,null==i7?void 0:i7.capture_right_face),Py(r,uL.FaceDirection.FRONTAL,null==i7?void 0:i7.capture_frontal_face),mt({tag:"selfie",event:r[o.name],log:{time_capture_in_seconds:((performance.now()-Xe.current)/1e3).toFixed(1)}}),Ve.current.curStepIndex++,Xe.current=performance.now(),$e.enable&&"each_gesture"===$e.limit_for&&(vt.current=0),Ve.current.curStepIndex!==n.length){e.next=44;break}if(Je.enable&&C(""),!f){e.next=44;break}return ot.enable&&ot.framesBatchLength>0&&Ge.current.length%ot.framesBatchLength>0&&(A(Ge.current.slice(Ge.current.length%ot.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&P9(Ge.current.slice(Ge.current.length%ot.framesBatchLength*-1),ce)),mt({tag:"selfie",event:null==i7?void 0:i7.finish_capture,log:{time_capture_in_seconds:e7.duration("from_1st_frame")}}),S(),e.next=15,null===(i=bt.current)||void 0===i?void 0:i.stopVideoRecording();case 15:return z(!0),Ee(),lW.preWriteExif({mode:lW.MODE.SELFIE,motionData:Be,orientationData:_e,startTime:Date.now()-1e3*e7.duration("from_1st_frame"),endTime:Date.now(),exifKey:ae}),e.next=20,a();case 20:if(t){e.next=41;break}if(d=n.filter((function(e){return e.name!==r7.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),m=n.filter((function(e){return e.name!==r7.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),g=n.filter((function(e){return e.name!==r7.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),v=null===(s=n.find((function(e){return e.name===r7.FRONTAL})))||void 0===s||null===(c=s.image)||void 0===c?void 0:c.blob,y=null===(u=n.find((function(e){return e.name===r7.FRONTAL})))||void 0===u||null===(l=u.image)||void 0===l?void 0:l.encrypted,!v||!h){e.next=32;break}return e.next=29,Jz.scaleImage(v,{minSize:h});case 29:e.t0=e.sent,e.next=33;break;case 32:e.t0=null;case 33:b=e.t0,v&&m.push(v),y&&g.push(y),mt({tag:"result",event:null==i7?void 0:i7.liveness_detection_done,log:{result_object:{steps:d,frontalFaces:m,frontalScaledImage:b}}}),f({steps:d,frontalFaces:m,frontalFacesEncrypted:g,frontalScaledImage:b,capturedFrames:Ge.current,video:U9().length?U9()[0]:null}),j9(),e.next=43;break;case 41:return e.next=43,N9({apiClient:ce,faceVerificationFlowData:Ve,onLivenessDetectionDone:f,captureFrameSettings:ot,FaceDirection:r7,onError:p,outputEncryptionSettings:R,video:U9().length?U9()[0]:null});case 43:z(!1);case 44:fe();case 45:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),c=G5((function(){var e=Ve.current,t=e.curStepIndex,r=e.steps,n=r[t],o=null!==(null==n?void 0:n.image.blob),i=null!==(null==n?void 0:n.frontalFaceImage.blob),a=r.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(i||![1].includes(t)||a>=1)?(he.current=!1,s(),c=!0):he.current=!(!o||i),Y(!1),c}),g);function u(e){return l.apply(this,arguments)}function l(){return(l=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.blurScore,i=t.leftRightScore,a=t.isEyeClose,u=Ve.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!u9({faceDirection:r,curStep:f})){e.next=6;break}return e.abrupt("return");case 6:if(!a){e.next=8;break}return e.abrupt("return");case 8:if(r!==r7.FRONTAL||null!==f.frontalFaceImage.blurScore&&!BV.hasBetterBlurScore(o,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=o,e.next=12,xV.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=i,f.frontalFaceImage.captureTime=Date.now(),he.current&&(he.current=!1,s());case 17:if(f.name!==r||null!==f.image.blurScore&&!BV.hasBetterBlurScore(o,f.image.blurScore)){e.next=29;break}return Y(!0),f.image.blurScore=o,e.next=22,xV.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=i,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(h),c();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e){return v.apply(this,arguments)}function v(){return(v=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.leftRightScore,i=t.blurScore,a=t.isEyeClosed,!0!==Ne.current||(!lt||r!==r7.FRONTAL)&&lt){e.next=6;break}return e.next=4,xV.takePicture({canvas:n});case 4:s=e.sent,null!=ct&&ct.enable&&Date.now()-je.current<(null==ct?void 0:ct.wait_for_best_image_time_ms_web)?(Ue.current||(Ue.current={blob:s,blurScore:i,isEyeClosed:a,captureTime:Date.now()}),null!=ut&&ut.enable&&(Ue.current=d9({incomingFrame:{blob:s,blurScore:i,isEyeClosed:a,captureTime:Date.now()},currentBestFrame:Ue.current}))):Fe.current.length<c7&&Fe.current.push({blob:s,leftRightScore:o,captureTime:Date.now(),blurScore:i});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e,r,n,o){if(Ge.current.length&&Date.now()-Ge.current[Ge.current.length-1].time<ot.framesIntervalTime)return null;if(ot.enable&&!o){var i=e.topLeft,a=e.bottomRight,s=[].concat(Gy(i),Gy(a)),c=J9(e,0===Ge.current.length),u=c.score,l=c.time,d=r.toDataURL("image/jpeg",.8);return Ge.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:Ge.current.length,bbox:s,original_bbox:s}),ot.framesBatchLength>0&&Ge.current.length%ot.framesBatchLength==0&&A&&(A(Ge.current.slice(-ot.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&P9(Ge.current.slice(-ot.framesBatchLength),ce,Ge.current.length===ot.framesBatchLength)),u}return null}function w(e){var t=e.trackingScore,r=e.isFirstValidFrameFoundRef;if(!$e.enable||null===t||!r)return!0;var n=$e.web_warning_threshold,o=$e.web_terminate_threshold,i=$e.max_warning_time;return t<n||(t<o&&vt.current<i?(vt.current++,vt.current===i?(We(Oy(Oy({},kt.liveness_terminated_face_tracking),{},{duration:Ze})),mt({tag:"selfie",event:null==i7?void 0:i7.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):We(Oy(Oy({},kt.liveness_too_fast),{},{duration:1500})),!0):(We(Oy(Oy({},kt.liveness_terminated),{},{duration:Ze})),mt({tag:"selfie",event:null==i7?void 0:i7.show_alert,log:{alert:"liveness_terminated"}}),Ct(),!1))}function k(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(et.enable&&r){var n=et.max_time_ms;yt.current&&t||(yt.current={time:Date.now(),frame:0}),t&&yt.current.frame++;var o=yt.current.time;t&&Date.now()-o>=n&&(We(Oy(Oy({},kt.liveness_terminated_no_face),{},{duration:Ze})),mt({tag:"selfie",event:null==i7?void 0:i7.show_alert,log:{alert:"liveness_terminated_no_face"}}),Ct())}}function E(e,t){return B.apply(this,arguments)}function B(){return(B=xy(regeneratorRuntime.mark((function t(a,s){var c,l,f,p,h,g,v,y,C,S,B,_,x,T,A,I,P,R,D,N,L,M,F,U,j,V,z,q,H,W,K,Q,G,X,Y,$,Z,J,te,re;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==s?void 0:s.width)&&0!==(null==s?void 0:s.height)){t.next=2;break}return t.abrupt("return");case 2:return p=xt.current.isFirstValidFrameFoundRef,h=a.cropX,g=a.cropY,v=a.cropWidth,y=a.cropHeight,s.getContext("2d").drawImage(i,h,g,v,y,-(Et*O-Et)/2/O,-(Et*O-Et)/2/O,Et,Et),C=be.current,S=C.blazefaceModel,B=C.closeEyesModel,t.next=9,Promise.all([BV.calculateBlurScore(s),GV.getModelPredictions({model:S,sCanvas:s})]);case 9:return _=t.sent,x=Ky(_,2),T=x[0],A=x[1],t.next=15,KV.validatePredictions({predictions:A,width:GV.SIZE,height:GV.SIZE});case 15:if(P=t.sent,R=P.error,D=P.fullFace,N=P.faceRatio,L=P.faceNotFrontalMinThreshold,I=R,pe.current.image=n,F=null,U=null,j=null,V=null,z=Ve.current,q=z.curStepIndex,H=z.steps,!D){t.next=44;break}return W=H[q],K=W&&W.name===r7.FRONTAL||r===uL.Mode.PASSIVE,j=D.landmarks,t.next=33,KV.calculateFaceDirection({landmarks:j,getPerfectFrontal:K});case 33:if((Q=t.sent)&&(F=Q.gesture,U=Q.leftRightScore),G=(null==rt?void 0:rt.web_timeout)+d[uL.FaceDirection.FRONTAL].delayTime/1e3,!(K&&null!=rt&&rt.enable&&(-1===e7.duration("limit_close_eye")||e7.duration("limit_close_eye")<G))){t.next=44;break}return-1===e7.duration("limit_close_eye")&&e7.start("limit_close_eye"),t.next=40,B.predict(s,j,null==rt?void 0:rt.web_threshold);case 40:X=t.sent,Y=X.isEyeClose,(V=Y)&&!I&&(I=n7.close_eye);case 44:if($="no_face"===(null===(c=I)||void 0===c?void 0:c.code)||"partial_face"===(null===(l=I)||void 0===l?void 0:l.code),Z=q<H.length,k({noFace:$&&Z,isFirstValidFrameFoundRef:p}),null!==(f=I)&&void 0!==f&&f.code&&gt({tag:"selfie",event:null==i7?void 0:i7.show_alert,log:{alert:I.code}}),I&&!("face_too_small"===I.code&&F!==r7.FRONTAL&&N>=L)){t.next=75;break}if(ue||b(A[0],s,j),!ue){t.next=58;break}if(p||(ee(!0),Xe.current=performance.now(),e7.start("from_1st_frame")),!w({trackingScore:b(A[0],s,j,q>=H.length),isFirstValidFrameFoundRef:p})){t.next=56;break}return t.next=56,u({faceDirection:F,canvas:s,blurScore:T,leftRightScore:U,isEyeClose:V});case 56:t.next=73;break;case 58:if(F===r7.FRONTAL||!lt){t.next=63;break}M=kt.not_frontal_face,pe.current.image=o,t.next=73;break;case 63:if(I){t.next=73;break}return p||(ee(!0),e7.start("from_1st_frame")),J=(null==ct?void 0:ct.enable)&&!Ne.current&&0===Fe.current.length,null!=ut&&ut.enable?null!==T&&T>(null==ut?void 0:ut.web_blurry_threshold)?(M=null,J&&(je.current=Date.now(),_t())):Ne.current||(M=kt.liveness_blurry):J&&(je.current=Date.now(),_t()),t.next=69,B.predict(s,j,null==rt?void 0:rt.web_threshold);case 69:return te=t.sent,re=te.isEyeClose,t.next=73,m(Oy({faceDirection:F,canvas:s,leftRightScore:U,blurScore:T},null!==re?{isEyeClosed:re}:{}));case 73:t.next=76;break;case 75:q<H.length&&(M=kt[I.code],pe.current.image=o);case 76:Qe(M),e!==a7&&(e=requestAnimationFrame((function(){return E(a,s)})));case 78:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _(){return(_=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=xV.analyzeVideoAndWindowSizes(i,pe.current),(r=document.createElement("canvas")).width=Et,r.height=Et,(n=r.getContext("2d")).translate(Et,0),n.scale(-1*O,1*O),!pt||!i){e.next=13;break}return e.next=10,q9({outputImagesSize:Et,videoEl:i,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:o=e.t0,a=o.mediaRecorder,bt.current=a,bt.current&&bt.current.start(),E(t,r);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return W&&ve&&setTimeout((function(){!function(){_.apply(this,arguments)}()}),P),function(){cancelAnimationFrame(e),e=a7}}),[lt,null==ut?void 0:ut.enable,null==ut?void 0:ut.web_blurry_threshold,r,null==ct?void 0:ct.enable,null==ct?void 0:ct.wait_for_best_image_time_ms_web,P,W,ne,ue,ce,t,n,o,f,p,h,g,ot,S,$e,Je.enable,C,Qe,d,Ze,Ct,et,kt,ve,mt,A,R,O,_t,L,null==rt?void 0:rt.enable,null==rt?void 0:rt.web_threshold,null==rt?void 0:rt.web_timeout,Be,_e,Ee,it.enable,ae,gt,y.framesBatchLength,pt]),xw.useEffect((function(){He&&((null==He?void 0:He.code)!==(null==kt?void 0:kt.liveness_terminated_time_out)&&(null==He?void 0:He.code)!==(null==kt?void 0:kt.liveness_terminated_no_face)&&null!=ct&&ct.enable&&Ne.current||(clearInterval(Me.current),Le(!1),Ue.current=null,Fe.current=[],je.current=null)),Se()}),[null==ct?void 0:ct.enable,He,Le,Se,kt]);var Tt=Ve.current,At=Tt.curStepIndex,It=Tt.steps,Pt=xw.useMemo((function(){return It.find((function(e){return e.name===uL.FaceDirection.FRONTAL}))}),[It]),Rt=he.current?Pt:It[At],Dt=Rt&&J?Rt.instructions[ne]:null,Ot=Rt&&J?Rt.directionIcon:"",Nt=Rt?Rt.directionIconAnimation:"",Lt=J&&!He&&!L&&(null==ct||!ct.enable||(null==ct?void 0:ct.show_capture_button)),Mt=De&&!wt.current&&((null==ct?void 0:ct.enable)&&(null==ct?void 0:ct.show_countdown)||!(null!=ct&&ct.enable));return{countdownToTakePicture:Ae,cropArea:pe,curStepIndex:At,directionIcon:Ot,directionIconAnimation:Nt,faceDetectionError:He,handleTriggerPassiveMode:_t,handleVideoPlayed:Bt,instructions:Dt,isActiveMode:ue,refVideo:te,refIsReseting:wt,showCountdown:De,steps:It,videoPlayed:W,activeCapturing:X,isFirstValidFrameFound:J,warmupDone:ve,motionData:Be,orientationData:_e,showLoading:V,showCaptureButton:Lt,shouldShowCountdown:Mt}}var d7=(Py(W9={},uL.FaceDirection.LEFT,90),Py(W9,uL.FaceDirection.RIGHT,270),Py(W9,uL.FaceDirection.UP,180),Py(W9,uL.FaceDirection.DOWN,0),W9),f7=hB(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),p7=dB.div(K9||(K9=Wy(["\n width: 200px;\n height: 200px;\n position: relative;\n transform: scale(0.48);\n\n .top,\n .right,\n .bottom,\n .left {\n position: absolute;\n }\n\n .top {\n top: 0;\n left: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .right {\n right: 0;\n top: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .bottom {\n bottom: 0;\n left: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n\n .left {\n left: 0;\n top: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n"])),d7[uL.FaceDirection.DOWN],d7[uL.FaceDirection.LEFT],d7[uL.FaceDirection.UP],d7[uL.FaceDirection.RIGHT]),h7=dB.div(Q9||(Q9=Wy(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var t,r=e.direction;return null!==(t=d7[r])&&void 0!==t?t:0})),m7=dB.span(G9||(G9=Wy(["\n display: flex;\n margin: 4px 0;\n width: 100%;\n height: 15px;\n animation: "," 1s infinite;\n animation-direction: alternate;\n\n &::before,\n &::after {\n content: '';\n height: 100%;\n width: 50%;\n background: rgba(255, 255, 255, 0.8);\n }\n\n &::before {\n transform: skewY(32deg);\n }\n\n &::after {\n width: 50%;\n transform: skewY(-32deg);\n }\n"])),f7),g7=dB(m7)(X9||(X9=Wy(["\n animation-delay: 0s;\n"]))),v7=dB(m7)(Y9||(Y9=Wy(["\n animation-delay: 0.5s;\n"]))),y7=dB(m7)($9||($9=Wy(["\n animation-delay: 1s;\n"]))),b7=dB.img(Z9||(Z9=Wy(["\n width: ",";\n"])),(function(e){var t=e.theme;return t5(t,"Selfie.Active.directionIcon.width",c9)}));function w7(e){var t=e.type,r=mB(),n=y1(r,"Selfie.Active.directionIcon.".concat(t));return null===n?xw.createElement(xw.Fragment,null):n&&null!==n?xw.createElement(b7,{src:y1(r,"Selfie.Active.directionIcon.".concat(t)),alt:""}):t!==uL.FaceDirection.FRONTAL?xw.createElement(h7,{direction:t},xw.createElement(g7,null),xw.createElement(v7,null),xw.createElement(y7,null)):xw.createElement(p7,null,xw.createElement(h7,{className:"top"},xw.createElement(g7,null),xw.createElement(v7,null),xw.createElement(y7,null)),xw.createElement(h7,{className:"right"},xw.createElement(g7,null),xw.createElement(v7,null),xw.createElement(y7,null)),xw.createElement(h7,{className:"bottom"},xw.createElement(g7,null),xw.createElement(v7,null),xw.createElement(y7,null)),xw.createElement(h7,{className:"left"},xw.createElement(g7,null),xw.createElement(v7,null),xw.createElement(y7,null)))}w7.propTypes={type:xC.oneOf([uL.FaceDirection.LEFT,uL.FaceDirection.RIGHT,uL.FaceDirection.UP,uL.FaceDirection.FRONTAL])},w7.defaultProps={type:uL.FaceDirection.LEFT};var C7,k7=uL.ErrorDuration;function S7(e){var t=e.children,r=e.errorMsg,n=e.className;return xw.isValidElement(t)?r?xw.createElement("div",{className:n},xw.cloneElement(t,{errorMsg:r})):null:r?xw.createElement("div",{className:n},r):null}function E7(e){var t=e.children,r=e.className,n=e.error,o=xw.useRef(0),i=xw.useRef(""),a=yj.useSDKSettings().lang,s=xw.useRef(k7.SHORT),c=n||{},u=c.msg,l=c.duration,d=void 0===l?k7.SHORT:l,f=null==u?void 0:u[a];return Date.now()-o.current>=s.current?(o.current=Date.now(),s.current=d,i.current=f,S7({children:t,errorMsg:f,className:r})):S7({children:t,errorMsg:i.current,className:r})}E7.propTypes={children:xC.node,className:xC.string},E7.defaultProps={className:""};var B7=dB.circle(C7||(C7=Wy(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function _7(e){var t=e.className,r=e.style,n=e.radius,o=e.strokeWidth,i=e.progress,a=e.showErrorRing,s=e.activeColor,c=e.innerPadding,u=e.outsideRingColor,l=e.outsideRingOpacity,d=e.insideRingColor,f=e.insideRingWidth,p=e.insideRingStrokeDash,h=e.errorRingWidth,m=e.errorRingColor,g=e.dashedRingColor,v=e.dashedRingOpacity,y=e.dashedRingWidth,b=e.dashedRingLineThick,w=e.dashedRingLineSpacing,C=e.dashedInsideRingColor,k=e.dashedInsideRingWidth,S=e.showOutsideRing,E=e.showInsideRing,B=e.showDashedRing,_=2*n,x=2*n,T=n-2*o,A=2*Math.PI*T,I=A-i/100*A,P=T-y/2-o/2-c,R=2*Math.PI*P,D=R-i/100*R,O=P-k/2-y/2,N=2*Math.PI*O,L=N-i/100*N,M=O-f/2-k/2,F=O-h/2-k/2;return xw.createElement("svg",{className:t,style:r,width:_,height:x,viewBox:"0 0 ".concat(_," ").concat(x),fill:"none",xmlns:"http://www.w3.org/2000/svg"},S?xw.createElement(xw.Fragment,null,xw.createElement("circle",{"data-testid":"outsideRing",opacity:l,cx:n,cy:n,r:T,stroke:u}),xw.createElement(B7,{"data-testid":"outsideAnimateRing",cx:n,cy:n,r:T,stroke:s,strokeWidth:o,strokeLinecap:"round",strokeDasharray:"".concat(A," ").concat(A),style:{strokeDashoffset:I}})):null,B?xw.createElement(xw.Fragment,null,xw.createElement("circle",{"data-testid":"dashedRing",opacity:v,cx:n,cy:n,r:P,stroke:g,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)}),xw.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},xw.createElement("circle",{cx:n,cy:n,r:P,stroke:s,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)})),xw.createElement("g",{mask:"url(#mask0)"},xw.createElement(B7,{"data-testid":"dashedAnimateRing",cx:n,cy:n,r:P,stroke:s,strokeWidth:y,strokeDasharray:"".concat(R," ").concat(R),style:{strokeDashoffset:D}})),xw.createElement("circle",{"data-testid":"dashedInsideRing",opacity:v,cx:n,cy:n,r:O,stroke:C,strokeWidth:k}),xw.createElement(B7,{"data-testid":"dashedInsideAnimateRing",cx:n,cy:n,r:O,stroke:s,strokeWidth:k,strokeLinecap:"round",strokeDasharray:"".concat(N," ").concat(N),style:{strokeDashoffset:L}})):null,E?xw.createElement("circle",{"data-testid":"insideRing",strokeDasharray:p,cx:n,cy:n,r:M,stroke:d,strokeWidth:f}):null,a?xw.createElement("circle",{"data-testid":"errorRing",strokeDasharray:p,cx:n,cy:n,r:F,stroke:m,strokeWidth:h}):null)}function x7(e){var t=e.className;return xw.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xw.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}function T7(){return(T7=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}_7.propTypes={className:xC.string,style:xC.shape({}),radius:xC.number,strokeWidth:xC.number,progress:xC.number,showErrorRing:xC.bool,activeColor:xC.string,innerPadding:xC.number,outsideRingColor:xC.string,outsideRingOpacity:xC.number,insideRingColor:xC.string,insideRingWidth:xC.number,insideRingStrokeDash:xC.string,errorRingColor:xC.string,errorRingWidth:xC.number,dashedRingColor:xC.string,dashedRingOpacity:xC.number,dashedRingWidth:xC.number,dashedRingLineThick:xC.number,dashedRingLineSpacing:xC.number,dashedInsideRingColor:xC.string,dashedInsideRingWidth:xC.number,showOutsideRing:xC.bool,showDashedRing:xC.bool,showInsideRing:xC.bool},_7.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,showErrorRing:!1,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:3,insideRingStrokeDash:"0",errorRingColor:"#df0000",errorRingWidth:3,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!0,showDashedRing:!0,showInsideRing:!0},x7.propTypes={className:xC.string},x7.defaultProps={className:""};var A7,I7,P7=function(e,t){void 0===t&&(t=!0),xw.useEffect((function(){if(t){var r=function(t){"Escape"===t.key&&e(t)};return document.addEventListener("keyup",r),function(){t&&document.removeEventListener("keyup",r)}}}),[e,t])},R7=function(e,t){void 0===t&&(t=!0),xw.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])},D7=function(e,t,r){void 0===r&&(r=!0),xw.useEffect((function(){if(r){var n=function(r){var n=Array.isArray(e)?e:[e],o=!1;n.forEach((function(e){e.current&&!e.current.contains(r.target)||(o=!0)})),r.stopPropagation(),o||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){r&&(document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n))}}}),[e,t,r])},O7=function(e,t){void 0===t&&(t=!0),xw.useEffect((function(){if(t){var r=function(t){if(9===t.keyCode){var r,n=null==e||null===(r=e.current)||void 0===r?void 0:r.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),o=Array.prototype.slice.call(n);if(1===o.length)return void t.preventDefault();var i=o[0],a=o[o.length-1];t.shiftKey&&document.activeElement===i?(t.preventDefault(),a.focus()):document.activeElement===a&&(t.preventDefault(),i.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])},N7="undefined"!=typeof window?xw.useLayoutEffect:xw.useEffect,L7={popupContent:{tooltip:{position:"absolute",zIndex:999},modal:{position:"relative",margin:"auto"}},popupArrow:{height:"8px",width:"16px",position:"absolute",background:"transparent",color:"#FFF",zIndex:-1},overlay:{tooltip:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",zIndex:999},modal:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",display:"flex",zIndex:999}}},M7=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],F7=function(e,t,r,n,o){var i=o.offsetX,a=o.offsetY,s=n?8:0,c=r.split(" "),u=e.top+e.height/2,l=e.left+e.width/2,d=t.height,f=t.width,p=u-d/2,h=l-f/2,m="",g="0%",v="0%";switch(c[0]){case"top":p-=d/2+e.height/2+s,m="rotate(180deg) translateX(50%)",g="100%",v="50%";break;case"bottom":p+=d/2+e.height/2+s,m="rotate(0deg) translateY(-100%) translateX(-50%)",v="50%";break;case"left":h-=f/2+e.width/2+s,m=" rotate(90deg) translateY(50%) translateX(-25%)",v="100%",g="50%";break;case"right":h+=f/2+e.width/2+s,m="rotate(-90deg) translateY(-150%) translateX(25%)",g="50%"}switch(c[1]){case"top":p=e.top,g=e.height/2+"px";break;case"bottom":p=e.top-d+e.height,g=d-e.height/2+"px";break;case"left":h=e.left,v=e.width/2+"px";break;case"right":h=e.left-f+e.width,v=f-e.width/2+"px"}return{top:p="top"===c[0]?p-a:p+a,left:h="left"===c[0]?h-i:h+i,transform:m,arrowLeft:v,arrowTop:g}},U7=function(e){var t={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var r=document.querySelector(e);null!==r&&(t=r.getBoundingClientRect())}return t},j7=function(e,t,r,n,o,i){var a=o.offsetX,s=o.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=U7(i),d=Array.isArray(r)?r:[r];for((i||Array.isArray(r))&&(d=[].concat(d,M7));u<d.length;){var f={top:(c=F7(e,t,d[u],n,{offsetX:a,offsetY:s})).top,left:c.left,width:t.width,height:t.height};if(!(f.top<=l.top||f.left<=l.left||f.top+f.height>=l.top+l.height||f.left+f.width>=l.left+l.width))break;u++}return c},V7=0,z7=function(){var e=document.getElementById("popup-root");return null===e&&((e=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(e)),e},q7=xw.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,o=e.onOpen,i=void 0===o?function(){}:o,a=e.onClose,s=void 0===a?function(){}:a,c=e.defaultOpen,u=void 0!==c&&c,l=e.open,d=void 0===l?void 0:l,f=e.disabled,p=void 0!==f&&f,h=e.nested,m=void 0!==h&&h,g=e.closeOnDocumentClick,v=void 0===g||g,y=e.repositionOnResize,b=void 0===y||y,w=e.closeOnEscape,C=void 0===w||w,k=e.on,S=void 0===k?["click"]:k,E=e.contentStyle,B=void 0===E?{}:E,_=e.arrowStyle,x=void 0===_?{}:_,T=e.overlayStyle,A=void 0===T?{}:T,I=e.className,P=void 0===I?"":I,R=e.position,D=void 0===R?"bottom center":R,O=e.modal,N=void 0!==O&&O,L=e.lockScroll,M=void 0!==L&&L,F=e.arrow,U=void 0===F||F,j=e.offsetX,V=void 0===j?0:j,z=e.offsetY,q=void 0===z?0:z,H=e.mouseEnterDelay,W=void 0===H?100:H,K=e.mouseLeaveDelay,Q=void 0===K?100:K,G=e.keepTooltipInside,X=void 0!==G&&G,Y=e.children,$=xw.useState(d||u),Z=$[0],J=$[1],ee=xw.useRef(null),te=xw.useRef(null),re=xw.useRef(null),ne=xw.useRef(null),oe=xw.useRef("popup-"+ ++V7),ie=!!N||!n,ae=xw.useRef(0);N7((function(){return Z?(ne.current=document.activeElement,ge(),me(),pe()):he(),function(){clearTimeout(ae.current)}}),[Z]),xw.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return i(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ie&&(null===(t=ne.current)||void 0===t||t.focus()),setTimeout((function(){return s(e)}),0))},ue=function(e){null==e||e.stopPropagation(),Z?ce(e):se(e)},le=function(e){clearTimeout(ae.current),ae.current=setTimeout((function(){return se(e)}),W)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(ae.current),ae.current=setTimeout((function(){return ce(e)}),Q)},pe=function(){ie&&M&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ie&&M&&(document.getElementsByTagName("body")[0].style.overflow="auto")},me=function(){var e,t=null==te||null===(e=te.current)||void 0===e?void 0:e.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),r=Array.prototype.slice.call(t)[0];null==r||r.focus()};xw.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var ge=function(){if(!ie&&Z&&(null==ee?void 0:ee.current)&&(null==ee?void 0:ee.current)&&(null==te?void 0:te.current)){var e,t,r=ee.current.getBoundingClientRect(),n=te.current.getBoundingClientRect(),o=j7(r,n,D,U,{offsetX:V,offsetY:q},X);if(te.current.style.top=o.top+window.scrollY+"px",te.current.style.left=o.left+window.scrollX+"px",U&&re.current)re.current.style.transform=o.transform,re.current.style.setProperty("-ms-transform",o.transform),re.current.style.setProperty("-webkit-transform",o.transform),re.current.style.top=(null===(e=x.top)||void 0===e?void 0:e.toString())||o.arrowTop,re.current.style.left=(null===(t=x.left)||void 0===t?void 0:t.toString())||o.arrowLeft}};P7(ce,C),O7(te,Z&&ie),R7(ge,b),D7(n?[te,ee]:[te],ce,v&&!m);var ve=function(){return xw.createElement("div",Object.assign({},(e=ie?L7.popupContent.modal:L7.popupContent.tooltip,t={className:"popup-content "+(""!==P?P.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:T7({},e,B,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!N&&S.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ie?"dialog":"tooltip",id:oe.current}),U&&!ie&&xw.createElement("div",{ref:re,style:L7.popupArrow},xw.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==P?P.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:T7({position:"absolute"},x)},xw.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},ye=!(S.indexOf("hover")>=0),be=ie?L7.overlay.modal:L7.overlay.tooltip,we=[ye&&xw.createElement("div",{key:"O","data-testid":"overlay","data-popup":ie?"modal":"tooltip",className:"popup-overlay "+(""!==P?P.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:T7({},be,A,{pointerEvents:v&&m||ie?"auto":"none"}),onClick:v&&m?ce:void 0,tabIndex:-1},ie&&ve()),!ie&&ve()];return xw.createElement(xw.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":oe.current},t=Array.isArray(S)?S:[S],r=0,o=t.length;r<o;r++)switch(t[r]){case"click":e.onClick=ue;break;case"right-click":e.onContextMenu=de;break;case"hover":e.onMouseEnter=le,e.onMouseLeave=fe;break;case"focus":e.onFocus=le,e.onBlur=fe}if("function"==typeof n){var i=n(Z);return!!n&&xw.cloneElement(i,e)}return!!n&&xw.cloneElement(n,e)}(),Z&&aL.createPortal(we,z7()))})),H7=pB(A7||(A7=Wy(["\n .popup-content {\n margin: auto;\n width: 100%;\n max-width: 568px;\n ",";\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n ",";\n }\n\n .popup-overlay {\n padding: 10px;\n ",";\n }\n\n [data-popup=tooltip].popup-overlay {\n background: transparent\n }\n\n .popup-arrow {\n -webkit-filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n color: #fff;\n stroke-width: 2px;\n stroke: #d7d7d7;\n stroke-dasharray: 30px;\n stroke-dashoffset: -54px;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0\n }\n"])),(function(e){var t=e.theme;return YE(["background-color:",";padding:",";border:",";border-radius:",";"],t5(t,"popup.backgroundColor",e5),t5(t,"popup.padding",e5),t5(t,"popup.border",e5),t5(t,"popup.borderRadius",e5))}),(function(e){var t=e.theme;return YE(["background-color:",";padding:",";border:",";border-radius:",";"],t5(t,"popup.backgroundColor",e5),t5(t,"popup.padding",e5),t5(t,"popup.border",e5),t5(t,"popup.borderRadius",e5))}),(function(e){var t=e.theme;return YE(["background:",";"],t5(t,"popup.overlay.backgroundColor",e5))})),W7=["open","children","overlayStyle"],K7=s5+1e3,Q7=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=Vy(e,W7);return xw.createElement(xw.Fragment,null,t&&xw.createElement(xw.Fragment,null,xw.createElement(q7,Ry({overlayStyle:Oy(Oy({},n),{},{zIndex:K7}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),xw.createElement(H7,null)))};Q7.propTypes={open:xC.bool,children:xC.node,overlayStyle:xC.shape({})},Q7.defaultProps={open:!1,children:null,overlayStyle:{}};var G7={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},X7=dB.div(I7||(I7=Wy(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),Y7=function(e){var t=e.contentStyle,r=yj.useSDKSettings(),n=r.lang,o=r.warmupMessage,i=o?o[n]:G7.WARMUP_INTRO[n];return xw.createElement(Q7,{open:!0,contentStyle:t},xw.createElement(X7,{className:"warmup-message"},i))};Y7.propTypes={contentStyle:xC.shape({})},Y7.defaultProps={contentStyle:{}};var $7=500,Z7=hB(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),J7=hB(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),eee=YE([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],Z7,$7,J7,$7),tee=Object.freeze({__proto__:null,animationDuration:$7,default:eee}),ree=20,nee=hB(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],ree,ree),oee=hB(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],ree,ree),iee=YE([".slide-horizontal{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}.slide-vertical{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],nee,oee),aee=Object.freeze({__proto__:null,default:iee}),see=hB(["from,to{opacity:1;}50%{opacity:0;}"]),cee=YE([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],see),uee=Object.freeze({__proto__:null,default:cee});function lee(){return(lee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function dee(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function fee(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function pee(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function hee(e,t){e.classList?e.classList.add(t):pee(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function mee(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function gee(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=mee(e.className,t):e.setAttribute("class",mee(e.className&&e.className.baseVal||"",t))}var vee={disabled:!1},yee=xw.createContext(null),bee="unmounted",wee="exited",Cee="entering",kee="entered",See="exiting",Eee=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var o,i=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?i?(o=wee,n.appearStatus=Cee):o=kee:o=t.unmountOnExit||t.mountOnEnter?bee:wee,n.state={status:o},n.nextCallback=null,n}fee(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===bee?{status:wee}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==Cee&&r!==kee&&(t=Cee):r!==Cee&&r!==kee||(t=See)}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},r.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===Cee?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===wee&&this.setState({status:bee})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,o=this.props.nodeRef?[n]:[aL.findDOMNode(this),n],i=o[0],a=o[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!r||vee.disabled?this.safeSetState({status:kee},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:Cee},(function(){t.props.onEntering(i,a),t.onTransitionEnd(c,(function(){t.safeSetState({status:kee},(function(){t.props.onEntered(i,a)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:aL.findDOMNode(this);t&&!vee.disabled?(this.props.onExit(n),this.safeSetState({status:See},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:wee},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:wee},(function(){e.props.onExited(n)}))},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:aL.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===bee)return null;var t=this.props,r=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,dee(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return xw.createElement(yee.Provider,{value:null},"function"==typeof r?r(e,n):xw.cloneElement(xw.Children.only(r),n))},t}(xw.Component);function Bee(){}Eee.contextType=yee,Eee.propTypes={},Eee.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Bee,onEntering:Bee,onEntered:Bee,onExit:Bee,onExiting:Bee,onExited:Bee},Eee.UNMOUNTED=bee,Eee.EXITED=wee,Eee.ENTERING=Cee,Eee.ENTERED=kee,Eee.EXITING=See;var _ee,xee,Tee=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return hee(e,t)}))},Aee=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return gee(e,t)}))},Iee=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),o=n[0],i=n[1];t.removeClasses(o,"exit"),t.addClass(o,i?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),o=n[0],i=n[1]?"appear":"enter";t.addClass(o,i,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),o=n[0],i=n[1]?"appear":"enter";t.removeClasses(o,i),t.addClass(o,i,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,o=n?""+(n&&r?r+"-":"")+e:r[e];return{baseClassName:o,activeClassName:n?o+"-active":r[e+"Active"],doneClassName:n?o+"-done":r[e+"Done"]}},t}fee(t,e);var r=t.prototype;return r.addClass=function(e,t,r){var n=this.getClassNames(t)[r+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&o&&(n+=" "+o),"active"===r&&e&&e.scrollTop,n&&(this.appliedClasses[t][r]=n,Tee(e,n))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,o=r.active,i=r.done;this.appliedClasses[t]={},n&&Aee(e,n),o&&Aee(e,o),i&&Aee(e,i)},r.render=function(){var e=this.props,t=(e.classNames,dee(e,["classNames"]));return xw.createElement(Eee,lee({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(xw.Component);function Pee(e,t){return e!==t&&(!xw.isValidElement(e)||!xw.isValidElement(t)||null==e.key||e.key!==t.key)}Iee.defaultProps={classNames:""},Iee.propTypes={};var Ree,Dee,Oee={out:"out-in",in:"in-out"},Nee=function(e,t,r){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),r()}},Lee=((_ee={})[Oee.out]=function(e){var t=e.current,r=e.changeState;return xw.cloneElement(t,{in:!1,onExited:Nee(t,"onExited",(function(){r(Cee,null)}))})},_ee[Oee.in]=function(e){var t=e.current,r=e.changeState,n=e.children;return[t,xw.cloneElement(n,{in:!0,onEntered:Nee(n,"onEntered",(function(){r(Cee)}))})]},_ee),Mee=((xee={})[Oee.out]=function(e){var t=e.children,r=e.changeState;return xw.cloneElement(t,{in:!0,onEntered:Nee(t,"onEntered",(function(){r(kee,xw.cloneElement(t,{in:!0}))}))})},xee[Oee.in]=function(e){var t=e.current,r=e.children,n=e.changeState;return[xw.cloneElement(t,{in:!1,onExited:Nee(t,"onExited",(function(){n(kee,xw.cloneElement(r,{in:!0}))}))}),xw.cloneElement(r,{in:!0})]},xee),Fee=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).state={status:kee,current:null},t.appeared=!1,t.changeState=function(e,r){void 0===r&&(r=t.state.current),t.setState({status:e,current:r})},t}fee(t,e);var r=t.prototype;return r.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===Cee&&e.mode===Oee.in?{status:Cee}:t.current&&Pee(t.current,e.children)?{status:See}:{current:xw.cloneElement(e.children,{in:!0})}},r.render=function(){var e,t=this.props,r=t.children,n=t.mode,o=this.state,i=o.status,a=o.current,s={children:r,current:a,changeState:this.changeState,status:i};switch(i){case Cee:e=Mee[n](s);break;case See:e=Lee[n](s);break;case kee:e=a}return xw.createElement(yee.Provider,{value:{isMounting:!this.appeared}},e)},t}(xw.Component);Fee.propTypes={},Fee.defaultProps={mode:Oee.out};var Uee,jee,Vee,zee,qee,Hee,Wee,Kee,Qee,Gee,Xee,Yee,$ee,Zee,Jee,ete,tte,rte,nte,ote,ite,ate,ste,cte,ute,lte,dte,fte,pte,hte,mte,gte,vte=300,yte=dB.div(Ree||(Ree=Wy(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ","; // must be higher than BASE_Z_INDEX and lower than other layers\n"])),s5+1),bte=hB(["from{background:#000;}to{}"]),wte=YE([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],bte,vte),Cte=dB.div(Dee||(Dee=Wy(["\n ","\n"])),wte),kte=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return xw.createElement(Cte,null,xw.createElement(Fee,null,xw.createElement(Iee,{key:r,timeout:{enter:vte,exit:0},classNames:"splash",unmountOnExit:!1},xw.createElement(yte,null))))},Ste=Object.freeze({__proto__:null,default:kte}),Ete=hB(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),Bte=YE([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],Ete),_te=Object.freeze({__proto__:null,default:Bte}),xte=uee,Tte=aee,Ate=function(e){var t=e.className,r=e.onClick,n=Jj.useAsset("ic_close.png");return xw.createElement(d5,{className:t,onClick:r},xw.createElement("img",{src:n,alt:""}))},Ite=YE(["z-index:",";color:#ffffff;"],s5+20),Pte=dB.div(Uee||(Uee=Wy(["\n ","\n"])),Ite),Rte=YE([""," "," "," "," font-size:",";font-weight:",";background:",";color:",";padding:",";border-radius:",";position:absolute;white-space:pre-wrap;text-align:center;max-width:80%;"],Ite,(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),(function(e){return e.centerY&&YE(["top:50%;transform:translateY(-50%);"])}),(function(e){var t=e.theme;return t5(t,"Selfie.error.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.padding",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.borderRadius",c9)})),Dte=dB(E7)(jee||(jee=Wy(["\n ","\n"])),Rte),Ote=dB.div(Vee||(Vee=Wy(["\n ","\n"])),Rte),Nte=dB(Pte)(zee||(zee=Wy(["\n ","\n font-size: ",";\n font-weight: ",";\n background: ",";\n color: ",";\n padding: ",";\n border-radius: ",";\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.padding",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.borderRadius",c9)})),Lte=dB(Pte)(qee||(qee=Wy(["\n position: absolute;\n ","\n ","\n color: ",";\n font-size: ",";\n font-weight: ",";\n text-shadow: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.textShadow",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.border",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.borderRadius",c9)})),Mte=dB.div(Hee||(Hee=Wy(["\n height: ",";\n position: absolute;\n ","\n ","\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),(function(){return b1.isMobile?"50px":"70px"}),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),s5+20),Fte=dB.div(Wee||(Wee=Wy(["\n width: ",";\n height: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n border: ",";\n font-size: ",";\n color: ",";\n font-weight: ",";\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: ",";\n }\n"])),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.width",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.height",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.borderRadius",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.border",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.fontWeight",c9)}),(function(e){return!e.active&&YE(["opacity:0.6;"])}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.borderRadius",c9)})),Ute=dB.div(Kee||(Kee=Wy(["\n color: #ffffff;\n height: 70px;\n position: absolute;\n bottom: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),s5+20),jte=dB.div(Qee||(Qee=Wy(["\n ","\n text-align: center;\n\n img {\n width: ",";\n }\n"])),(function(e){return YE(e.disabled?["pointer-events:none;"]:["cursor:pointer;"])}),(function(e){var t=e.theme;return t5(t,"Selfie.captureIcon.width",c9)})),Vte=dB.div(Gee||(Gee=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #ffffff;\n font-size: 140px;\n opacity: 0.6;\n"]))),zte=dB.div(Xee||(Xee=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n ",";\n ",";\n"])),Tte.default,xte.default),qte=dB(_7)(Yee||(Yee=Wy(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),Hte=dB(x7)($ee||($ee=Wy(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.theme;return t5(t,"Selfie.backgroundColor",c9)})),Wte=dB.div(Zee||(Zee=Wy(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),Kte=hB(["from{opacity:1;}to{opacity:0;}"]),Qte=dB.div(Jee||(Jee=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n border-radius: 50%;\n"])),Kte),Gte=Object.freeze({__proto__:null,CloseCameraButton:Ate,Text:Pte,FaceDetectionError:Dte,SimpleFaceDetectionError:Ote,CountdownTime:Nte,FaceVerificationInstructions:Lte,FaceVerificationStepsWrapper:Mte,StepItem:Fte,BottomButtonsOverlay:Ute,Button:jte,CountDownOverlay:Vte,InstructionsOverlay:zte,OverlayProgressCircle:qte,StyledCameraMark:Hte,ErrorOverlay:Wte,CapturingOverlay:Qte}),Xte=uee,Yte=aee,$te=YE(["z-index:",";color:#ffffff;"],s5+20),Zte=dB.div(ete||(ete=Wy(["\n ","\n"])),$te),Jte=YE([""," "," "," "," font-size:",";font-weight:",";background:",";color:",";padding:",";border-radius:",";position:absolute;white-space:pre-wrap;text-align:center;max-width:80%;"],$te,(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),(function(e){return e.centerY&&YE(["top:50%;transform:translateY(-50%);"])}),(function(e){var t=e.theme;return t5(t,"Selfie.error.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.padding",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.borderRadius",c9)})),ere=dB(E7)(tte||(tte=Wy(["\n ","\n"])),Jte),tre=dB.div(rte||(rte=Wy(["\n ","\n"])),Jte),rre=dB(Zte)(nte||(nte=Wy(["\n ","\n font-size: ",";\n font-weight: ",";\n background: ",";\n color: ",";\n padding: ",";\n border-radius: ",";\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.padding",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.borderRadius",c9)})),nre=dB(Zte)(ote||(ote=Wy(["\n position: absolute;\n ","\n ","\n color: ",";\n font-size: ",";\n font-weight: ",";\n text-shadow: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.textShadow",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.border",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.borderRadius",c9)})),ore=dB.div(ite||(ite=Wy(["\n height: ",";\n position: absolute;\n ","\n ","\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),(function(){return b1.isMobile?"50px":"70px"}),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),s5+20),ire=dB.div(ate||(ate=Wy(["\n width: ",";\n height: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n border: ",";\n font-size: ",";\n color: ",";\n font-weight: ",";\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: ",";\n }\n"])),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.width",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.height",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.borderRadius",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.border",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.fontWeight",c9)}),(function(e){return!e.active&&YE(["opacity:0.6;"])}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.borderRadius",c9)})),are=dB.div(ste||(ste=Wy(["\n color: #ffffff;\n height: 70px;\n position: absolute;\n bottom: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),s5+20),sre=dB.div(cte||(cte=Wy(["\n ","\n text-align: center;\n\n img {\n width: ",";\n }\n"])),(function(e){return YE(e.disabled?["pointer-events:none;"]:["cursor:pointer;"])}),(function(e){var t=e.theme;return t5(t,"Selfie.captureIcon.width",c9)})),cre=dB.div(ute||(ute=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #ffffff;\n font-size: 140px;\n opacity: 0.6;\n"]))),ure=dB.div(lte||(lte=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n ",";\n ",";\n"])),Yte.default,Xte.default),lre=dB(_7)(dte||(dte=Wy(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),dre=dB(x7)(fte||(fte=Wy(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.theme;return t5(t,"Selfie.backgroundColor",c9)})),fre=dB.div(pte||(pte=Wy(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),pre=hB(["from{opacity:1;}to{opacity:0;}"]),hre=dB.div(hte||(hte=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n border-radius: 50%;\n"])),pre),mre=function(e){var t=e.stepNumber,r=e.type,n=e.theme,o=y1(n,"Selfie.Active.imageHolder.".concat(r));return null===o?xw.createElement(xw.Fragment,null):o&&null!==o?xw.createElement("img",{src:o,alt:""}):xw.createElement("span",null,t)},gre=b1.isMobile?{width:{ideal:640}}:null;function vre(e){return new Promise((function(t){var r=new Image;r.onload=t,r.onerror=t,r.src=e}))}function yre(e,t){return e?"string"==typeof e?xw.createElement("img",{className:t,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}function bre(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,i=e.onError,a=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=e.onProcessing,f=e.customErrors,p=e.livenessSettings,h=e.apiCredentials,m=e.outputEncryptionSettings,g=e.cameraScale,v=e.defaultCameraId,y=e.passiveModeAuto,b=e.offsetFaceY,w=e.styledComponent,C=e.onReset,k=Jj.useAsset("bg_camera_mask.png"),S=Jj.useAsset("bg_camera_mask_red.png"),E=Ky(xw.useState({}),2),B=E[0],_=E[1],x=B.yFaceDetectionError,T=B.yFaceVerificationStepsWrapper,A=Ky(xw.useState(""),2),I=A[0],P=A[1],R=mB(),D=xw.useMemo((function(){return{backgroundColor:t5(R,"Selfie.backgroundColor",c9)}}),[R]),O=xw.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,o=t+25,a=o+30;_({yFaceDetectionError:o,yFaceVerificationStepsWrapper:a+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(a);return 0!==b&&(u+b<s||u+b+r>c)?i({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=b,{y:u}}),[b,i]),N=l7({apiCheck:t,mode:r,bgCameraMask:k,bgCameraMaskRed:S,surroundStyle:D,onLivenessDetectionDone:n,onError:i,cropAreaDimension:O,customDirectionIcon:u,captureFrameSettings:a,onFramesCaptured:s,livenessSettings:p,setRemainingTime:P,customStepTimeConstraints:l,onProcessing:d,customErrors:f,apiCredentials:h,outputEncryptionSettings:m,cameraScale:g,passiveModeAuto:y,onReset:C}),L=N.countdownToTakePicture,M=N.cropArea,F=N.curStepIndex,U=N.directionIcon,j=N.directionIconAnimation,V=N.faceDetectionError,z=N.handleTriggerPassiveMode,q=N.handleVideoPlayed,H=N.instructions,W=N.isActiveMode,K=N.refVideo,Q=N.showCountdown,G=N.steps,X=N.videoPlayed,Y=N.activeCapturing,$=N.warmupDone,Z=N.showCaptureButton,J=N.shouldShowCountdown;xw.useEffect((function(){var e;"string"==typeof(null===(e=G[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(G.map((function(e){return vre(e.directionIcon)})))}),[G]);var ee=w.CloseCameraButton,te=l9(e,R),re=yj.useSDKSettings().lang,ne=xw.useRef(0),oe=xw.useRef({}),ie=xw.useRef(uL.ErrorDuration.SHORT),ae=xw.useMemo((function(){var e=V||{},t=e.msg,r=e.duration,n=void 0===r?uL.ErrorDuration.SHORT:r,o=null==t?void 0:t[re];return Date.now()-ne.current>=ie.current&&(ne.current=Date.now(),ie.current=n,oe.current=o),oe.current}),[V,F]);return xw.createElement(C5,{frontCamera:c,onVideoPlayed:q,onClose:o,flipHorizontal:c,ref:K,videoSettings:gre,onError:i,scale:g,defaultCameraId:v,closeButton:ee||null},!$&&xw.createElement(Y7,null),X?xw.createElement(xw.Fragment,null,"string"==typeof ae?xw.createElement(tre,{top:x-15,className:"face-detection-error"},ae):null,M.current?xw.createElement(x5,{x:"".concat(M.current.x,"px"),y:"".concat(M.current.y,"px"),width:"".concat(M.current.width,"px"),height:"".concat(M.current.height,"px"),surroundStyle:M.current.surroundStyle},xw.createElement(dre,null),xw.createElement(lre,Ry({progress:F/G.length*100},te,{showErrorRing:!!V&&t5(R,"Selfie.progressCircle.showErrorRing",c9)})),J?xw.createElement(cre,null,L):null,W?xw.createElement(xw.Fragment,null,xw.createElement(ure,null,yre(U,j)),Y&&xw.createElement(hre,null)):null,V&&xw.createElement(fre,null)):null,I&&xw.createElement(rre,{top:T-30},I),W?xw.createElement(xw.Fragment,null,H?xw.createElement(xw.Fragment,null,xw.createElement(nre,{top:T+5,className:"instructions"},H),xw.createElement(ore,{top:T+35},G.map((function(e,t){var r=e.name,n=e.image.objUrl;return xw.createElement(ire,{key:r,active:F>=t,className:"step-item"},n?xw.createElement("img",{src:n,alt:""}):xw.createElement(mre,{stepNumber:t+1,type:r,theme:R}))})))):null):xw.createElement(xw.Fragment,null,Z?xw.createElement(are,null,xw.createElement(sre,{onClick:z,disabled:Q},y1(R,"Selfie.captureIcon.src")?xw.createElement("img",{src:y1(R,"Selfie.captureIcon.src"),alt:""}):xw.createElement(T5,null))):null)):null)}bre.propTypes={apiCheck:xC.bool,mode:xC.string,onLivenessDetectionDone:xC.func,onClose:xC.func,onError:xC.func,captureFrameSettings:xC.shape({}),onFramesCaptured:xC.func,frontCamera:xC.bool,customDirectionIcon:xC.shape({}),customStepTimeConstraints:xC.shape({}),onProcessing:xC.func,customErrors:xC.shape({}),livenessSettings:xC.shape({}),apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),outputEncryptionSettings:xC.shape({}),cameraScale:xC.number,defaultCameraId:xC.string,passiveModeAuto:xC.bool,offsetFaceY:xC.number,styledComponent:xC.shape({CloseCameraButton:xC.node}),onReset:xC.func},bre.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(mte={},Py(mte,uL.FaceDirection.LEFT,xw.createElement(w7,{type:uL.FaceDirection.LEFT})),Py(mte,uL.FaceDirection.RIGHT,xw.createElement(w7,{type:uL.FaceDirection.RIGHT})),Py(mte,uL.FaceDirection.UP,xw.createElement(w7,{type:uL.FaceDirection.UP})),Py(mte,uL.FaceDirection.FRONTAL,xw.createElement(w7,{type:uL.FaceDirection.FRONTAL})),mte),customStepTimeConstraints:(gte={},Py(gte,uL.FaceDirection.UP,{delayTime:0}),Py(gte,uL.FaceDirection.LEFT,{delayTime:0}),Py(gte,uL.FaceDirection.RIGHT,{delayTime:0}),Py(gte,uL.FaceDirection.FRONTAL,{delayTime:2e3}),gte),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null},onReset:function(){}};var wre,Cre,kre,Sre,Ere,Bre=Object.freeze({__proto__:null,Text:Zte,FaceDetectionError:ere,CountdownTime:rre,FaceVerificationInstructions:nre,FaceVerificationStepsWrapper:ore,StepItem:ire,BottomButtonsOverlay:are,Button:sre,CountDownOverlay:cre,InstructionsOverlay:ure,LivenessStyledComponent:Gte,default:bre,useLivenessDetection:l7}),_re={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},xre=50,Tre={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},Are={IDCapturing:{backgroundColor:"rgba(0, 0, 0, 0.6)",title:{color:"#fff",fontSize:"20px",fontWeight:"normal",backgroundColor:"unset"},instruction:{color:"#fff",fontSize:"16px",fontWeight:"normal",backgroundColor:"unset",border:"unset",borderRadius:"unset"},error:{padding:"5px 10px",color:"#fff",fontSize:"16px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px"},countdown:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px"},cardIcon:{src:"",width:"auto",height:"38px"},captureIcon:{src:"",width:"60px",height:"60px"},loadingIcon:{src:"",width:"100px",height:"100px"},timeoutPopup:{padding:"10px",text:{color:"#000",fontSize:"1rem",fontWeight:"normal",textAlign:"center",border:"unset",borderRadius:"unset"},button:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:Tre.tsBlue,border:"none",borderRadius:"0.25rem",outline:"none",height:"50px"}},rectangleMask:{width:600,height:400,strokeWidth:2,strokeStyles:{},radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"},default:{fill:"none",stroke:"#fff",strokeWidth:2,strokeDasharray:"7, 4",opacity:.6},error:{fill:"rgba(234,50,35, 0.1)",strokeWidth:2,stroke:"#ea3223"}}},IDConfirmPopup:{confirmButton:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:Tre.tsBlue,border:"0",borderRadius:"0.25rem",outline:"none"},retryButton:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:Tre.tsBlue,border:"none",borderRadius:"0.25rem",outline:"none"},image:{borderRadius:"5px"}},QRStep:{guidelinePopup:{image:{src:"",borderRadius:"5px",backgroundColor:"#e7e6e6"},guideText:{color:Tre.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",lineHeight:"20px"},countdownText:{color:Tre.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",lineHeight:"20px"},startButton:{color:"#fff",fontSize:"1rem",fontWeight:"normal",backgroundColor:Tre.tsBlue,border:"none",borderRadius:"3px",outline:"none",height:"66px"}},scanTooltip:{backgroundColor:"#00ce78",borderRadius:"8px",color:"#fff",padding:"10px",textAlign:"center"},scanCountdown:{textAlign:"center",color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"none",borderRadius:"3px",padding:"5px 10px"},invalidPopup:{padding:"10px",title:{color:Tre.tsSecondary,fontSize:"16px",fontWeight:"bold",margin:"25px 0 0 0",padding:"0 0 0 0"},description:{color:Tre.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",margin:"30px 0 0 0",padding:"0 0 0 0"},retryButton:{color:"#fff",fontSize:"1rem",fontWeight:"normal",backgroundColor:Tre.tsBlue,border:"none",borderRadius:"3px",outline:"none",height:"66px",margin:"30px 0 0 0"},skipButton:{color:Tre.tsBlue,fontSize:"1rem",fontWeight:"normal",backgroundColor:"unset",border:"none",borderRadius:"unset",outline:"none",height:"unset",margin:"20px 0"}},resultText:{success:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#34ce60"},error:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#ff9532"}}}},Ire={SUCCESS:"SUCCESS",WARNING:"WARNING"},Pre=(Py(wre={},Ire.SUCCESS,"✓"),Py(wre,Ire.WARNING,"!"),wre),Rre=dB.div(Cre||(Cre=Wy(["\n font-weight: normal;\n"]))),Dre=dB.div(kre||(kre=Wy(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){var t=e.theme,r=e.type,n=t5(t,"QRStep.resultText.".concat(r===Ire.SUCCESS?"success":"error",".mainColor"),Are);return YE(["linear-gradient(to right,","00,","ff,","00)"],n,n,n)})),Ore=dB.div(Sre||(Sre=Wy(["\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n margin-right: 8px;\n font-weight: bold;\n"])),(function(e){var t=e.type,r=e.theme;return YE(["",""],t5(r,"QRStep.resultText.".concat(t===Ire.SUCCESS?"success":"error",".mainColor"),Are))})),Nre=dB.div(Ere||(Ere=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n ",";\n"])),(function(e){var t=e.type,r=e.theme,n=t===Ire.SUCCESS?"success":"error";return YE(["color:",";font-size:",";font-weight:",";"],t5(r,"QRStep.resultText.".concat(n,".textColor"),Are),t5(r,"QRStep.resultText.".concat(n,".fontSize"),Are),t5(r,"QRStep.resultText.".concat(n,".fontWeight"),Are))})),Lre=function(e){var t=e.children,r=e.type,n=e.className;return xw.createElement(Rre,{className:n},xw.createElement(Dre,{type:r}),xw.createElement(Nre,{type:r},xw.createElement(Ore,{type:r},Pre[r]),t),xw.createElement(Dre,{type:r}))};Lre.propTypes={children:xC.node,type:xC.string,className:xC.string},Lre.defaultProps={children:null,type:Ire.SUCCESS,className:""};var Mre,Fre,Ure=["children","ratio","padding"],jre=dB.div(Mre||(Mre=Wy(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),Vre=dB.div(Fre||(Fre=Wy(["\n position: absolute;\n top: ",";\n left: ",";\n right: ",";\n bottom: ",";\n"])),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding})),zre=function(e){var t=e.children,r=e.ratio,n=e.padding,o=Vy(e,Ure);return xw.createElement(jre,Ry({ratio:r},o),xw.createElement(Vre,{padding:n},t))};zre.propTypes={children:xC.node,ratio:xC.number,padding:xC.string},zre.defaultProps={children:null,ratio:4/3,padding:"0"};var qre,Hre,Wre,Kre,Qre,Gre,Xre,Yre=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,i=e.mr,a=e.mx,s=e.my,c=e.pt,u=e.pb,l=e.pl,d=e.pr,f=e.px,p=e.py,h=t.props.style||{},m={};return null!==a&&(m.marginLeft=a,m.marginRight=a),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==i&&(m.marginRight=i),null!==f&&(m.paddingLeft=f,m.paddingRight=f),null!==p&&(m.paddingTop=p,m.paddingBottom=p),null!==c&&(m.paddingTop=c),null!==u&&(m.paddingBottom=u),null!==l&&(m.paddingLeft=l),null!==d&&(m.paddingRight=d),xw.cloneElement(t,{style:Oy(Oy({},h),m)})};Yre.propTypes={mt:xC.string,ml:xC.string,mr:xC.string,mb:xC.string,mx:xC.string,my:xC.string,pt:xC.string,pl:xC.string,pr:xC.string,pb:xC.string,px:xC.string,py:xC.string},Yre.defaultProps={mt:null,ml:null,mr:null,mb:null,mx:null,my:null,pt:null,pl:null,pr:null,pb:null,px:null,py:null};var $re=dB.div(qre||(qre=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Zre=dB.div(Hre||(Hre=Wy(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),Jre=dB.button(Wre||(Wre=Wy(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n cursor: pointer;\n"]))),ene=dB(Jre)(Kre||(Kre=Wy(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.border",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.outline",Are)})),tne=dB(Jre)(Qre||(Qre=Wy(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.border",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.outline",Are)})),rne=dB.img(Gre||(Gre=Wy(["\n width: 100%;\n height: auto;\n object-fit: contain;\n border-radius: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.image.borderRadius",Are)})),nne=dB.div(Xre||(Xre=Wy(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),one=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,i=e.hasValidQR,a=e.frontSide,s=Ky(xw.useState(null),2),c=s[0],u=s[1],l=yj.useSDKSettings().lang,d=Yj.useSDKTracking().sendEvent;return xw.useEffect((function(){d({tag:a?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[a,d]),xw.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),xw.createElement($re,null,null!==i&&xw.createElement(Yre,{mb:"20px"},xw.createElement("div",null,xw.createElement(Lre,{type:i?Ire.SUCCESS:Ire.WARNING},i?_re.CONFIRM_POPUP_VALID_QR[l]:_re.CONFIRM_POPUP_INVALID_QR[l]))),xw.createElement(zre,{ratio:1.5},xw.createElement(rne,{src:c})),o&&xw.createElement(Zre,{className:"confirm-popup-error-message"},o.msg[l]),xw.createElement(nne,null,xw.createElement(tne,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},_re.BTN_TRY_AGAIN[l]),xw.createElement(ene,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},_re.BTN_USE_THIS_PICTURE[l])))};one.propTypes={imageTaken:xC.shape({}),error:xC.shape({msg:xC.shape({})}),onConfirm:xC.func,onTryAgain:xC.func,hasValidQR:xC.bool,frontSide:xC.bool},one.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var ine,ane=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.frontCamera,r=void 0===t||t,n=document.createElement("div");document.body.appendChild(n);var o=function(){aL.unmountComponentAtNode(n)};return new Promise((function(e){aL.render(xw.createElement(yj.SDKSettingsProvider,{value:{lang:"en"}},xw.createElement(C5,{checkCameraMode:!0,frontCamera:r,onVideoPlayed:function(){o(),e(null)},onClose:o,onError:function(t){o(),e(t)}})),n)}))},sne=dB.input(ine||(ine=Wy(["\n display: none;\n"]))),cne=xw.forwardRef((function(e,t){var r=e.useFileBrowse,n=e.accept,o=e.frontCamera,i=e.onCaptureDone,a=e.outputEncryptionSettings,s=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.target.files,!i){e.next=8;break}if(n=r[0],!a||!a.key){e.next=7;break}return e.next=6,Wq.encrypt({blob:n,key:a.key});case 6:o=e.sent;case 7:i({file:n,encrypted:o});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[i,a]);return xw.createElement(sne,Ry({ref:t,type:"file",accept:n,onChange:s},r?{}:{capture:o?"user":"environment"}))}));cne.propTypes={useFileBrowse:xC.bool,accept:xC.string,frontCamera:xC.bool,onCaptureDone:xC.func,outputEncryptionSettings:xC.shape({key:xC.string})},cne.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var une,lne={LANDSCAPE:"landscape",PORTRAIT:"portrait",DESKTOP:"desktop"},dne=function(){var e=xw.useRef(window.matchMedia("(orientation: portrait)")),t=xw.useRef(e.current.matches?lne.PORTRAIT:lne.LANDSCAPE),r=Ky(xw.useState(t.current),2),n=r[0],o=r[1];return xw.useEffect((function(){function t(e){e.matches?o(lne.PORTRAIT):o(lne.LANDSCAPE)}return e.current.addEventListener("change",t),function(){e.current.removeEventListener("change",t)}}),[]),b1.isMobile?{curOrientation:n,initOrientation:t.current}:{curOrientation:lne.DESKTOP}},fne=uL.Errors,pne=dB.div(une||(une=Wy(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function hne(e){var t=e.children,r=yj.useSDKSettings().lang,n=fne.wrong_orientation.msg[r],o=dne().curOrientation;return xw.createElement(xw.Fragment,null,o===lne.LANDSCAPE&&xw.createElement(Q7,{open:!0},xw.createElement(pne,null,n)),(o===lne.PORTRAIT||o===lne.DESKTOP)&&xw.createElement(xw.Fragment,null,t))}var mne={LOADING:0,FAR_FACE:1,CLOSE_FACE:2,START_FLASHING:3,STOP_DECTECTING:4},gne={FAR_FACE:"far",CLOSE_FACE:"close",FLASHING:"flashing"},vne=200,yne=b1.isMobile?200:400,bne=0,wne=1,Cne={timeout:"timeout",no_face:"no_face"};function kne(){return Sne.apply(this,arguments)}function Sne(){return(Sne=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.tfScriptUrls,n=t.closeEyesModelUrl,o=t.blazefaceModelUrl,i=new fW(n),e.next=4,Vq.loadTensorFlow(r);case 4:return e.next=6,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return a=[Vq.loadBlazefaceModel({modelUrl:o}),i.load()],e.next=9,Promise.all(a);case 9:return s=e.sent,c=Ky(s,1),u=c[0].blazefaceModel,e.abrupt("return",{closeEyesModel:i,blazefaceModel:u});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ene=S9(kne),Bne=function(e,t){var r=Ky(xw.useState({}),2),n=r[0],o=r[1],i=Object.keys(n).length>0;return xw.useEffect((function(){var r=!1;return function(){var n=xy(regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Ene(e);case 3:if(i=n.sent,!r){n.next=6;break}return n.abrupt("return");case 6:o(i),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(0),t({error:n.t0}),console.error(n.t0);case 13:case"end":return n.stop()}}),n,null,[[0,9]])})));return function(){return n.apply(this,arguments)}}()(),function(){r=!0}}),[i,e,t]),[n,i]},_ne=function(e){var t=e.width,r=e.height,n=e.cameraScale,o=document.createElement("canvas");o.width=t,o.height=r;var i=o.getContext("2d");return i.translate(t,0),i.scale(-1*n,1*n),o},xne=function(e){var t=e.width,r=e.height,n=e.cameraScale,o=void 0===n?1:n,i=e.debug,a=void 0!==i&&i,s=Ky(xw.useState(null),2),c=s[0],u=s[1];return xw.useEffect((function(){var e=_ne({width:t,height:r,cameraScale:o});return a&&(document.body.appendChild(e),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.zIndex="9999"),u(e),function(){a&&document.body.removeChild(e)}}),[o,a,r,t]),c},Tne=function(e){var t=e.videoRef,r=e.cropArea;return xw.useMemo((function(){return t.current?0===Object.keys(r).length?{}:xV.analyzeVideoAndWindowSizes(t.current,r):{}}),[t,r])},Ane=function(e){switch(e){case"partial_face":return"please_move_face_into_center_frame";case"no_face":case"face_out_of_box":return"face_not_found";case"face_too_small":return"please_move_face_closer";case"face_too_large":return"please_move_face_farther";case"eye_close":return"please_open_your_eyes";case"face_not_frontal":return"please_look_straight_at_the_camera";case"multiple_faces":return"please_only_one_face";case"face_too_high":return"please_move_face_down";case"blurry_face":return"please_hold_still";default:return""}},Ine=function(e){var t=e.width,r=e.height,n=e.debug,o=xw.useRef(null),i=xw.useMemo((function(){var e=document.createElement("canvas");return e.width=t,e.height=r,e.style.position="fixed",e.style.bottom="0",e.style.left="0",e.style.zIndex="99999",o.current=e,n&&document.body.appendChild(e),e}),[r,t,n]);return xw.useEffect((function(){return function(){n&&document.body.removeChild(o.current)}}),[n]),i},Pne=function(e,t){var r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.beginPath(),r.lineWidth="1",r.strokeStyle="red",r.rect(0,0,e.width,e.height),r.stroke(),r.closePath(),Object.entries(t).forEach((function(e,t){var n=Ky(e,2),o=n[0],i=n[1];r.beginPath(),r.fillStyle="red",r.font="16px",r.fillText("".concat(o,": ").concat(i),10,20+20*t),r.closePath()}))},Rne=xw.createContext(!1),Dne=function(e){var t=e.children,r=e.debug;return xw.createElement(Rne.Provider,{value:r},t)};Dne.defaultProps={debug:!1,children:null},Dne.propTypes={debug:xC.bool,children:xC.node};var One=function(e,t,r){var n=e.getContext("2d");n.strokeStyle=r,n.lineWidth=1,n.beginPath(),n.rect(t.x,t.y,t.width,t.height),n.stroke(),n.closePath()},Nne=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.getContext("2d"),o=e.width;n.strokeStyle="blue",n.fillStyle="blue",n.lineWidth=1,t.forEach((function(e){e.landmarks.forEach((function(e){n.beginPath(),n.arc(r?o-e[0]:e[0],e[1],2,0,2*Math.PI),n.fill(),n.closePath()})),n.beginPath();var t={x:r?o-e.bottomRight[0]:e.bottomRight[0],y:e.topLeft[1],width:e.bottomRight[0]-e.topLeft[0],height:e.bottomRight[1]-e.topLeft[1]};n.rect(t.x,t.y,t.width,t.height),n.stroke(),n.closePath()}))},Lne=0,Mne=function(e){var t=e.cropArea,r=e.maskBoundingRect,n=e.baseCanvasSize;return xw.useMemo((function(){var e,o,i,a,s=t.width,c=t.height,u=t.x,l=t.y,d=Math.min(s,c)/n,f=s/d,p=c/d,h=null!==(e=null==r?void 0:r.left)&&void 0!==e?e:0,m=null!==(o=null==r?void 0:r.top)&&void 0!==o?o:0,g=null!==(i=null==r?void 0:r.right)&&void 0!==i?i:s,v=null!==(a=null==r?void 0:r.bottom)&&void 0!==a?a:c;return{left:Math.max((h-u)/d,Lne),right:Math.min((g-u)/d,f-Lne),top:Math.max((m-l)/d,Lne),bottom:Math.min((v-l)/d,p-Lne)}}),[t,null==r?void 0:r.bottom,null==r?void 0:r.left,null==r?void 0:r.right,null==r?void 0:r.top,n])},Fne=function(e){var t=e.timeout,r=xw.useRef(null),n=xw.useCallback((function(){r.current=performance.now()}),[]),o=xw.useCallback((function(){return null===r.current?(n(),!1):performance.now()-r.current>t}),[n,t]);return{markTime:n,checkIfEllapsed:o}},Une=function(e,t){return{topLeft:[e.topLeft[0]*t,e.topLeft[1]*t],bottomRight:[e.bottomRight[0]*t,e.bottomRight[1]*t],probability:e.probability,landmarks:e.landmarks.map((function(e){return[e[0]*t,e[1]*t]}))}},jne=function(e){var t=e.size,r=e.scale,n=void 0===r?1:r,o=e.video,i=e.baseSize,a=void 0===i?vne:i,s=t.width,c=t.height,u=null!=o?o:{},l=u.videoWidth,d=void 0===l?Number.MAX_SAFE_INTEGER:l,f=u.videoHeight,p=void 0===f?Number.MAX_SAFE_INTEGER:f,h=Math.min(s,c)/a,m=Math.round(s/h*n),g=Math.round(c/h*n);return m>d||g>p?{width:s,height:c}:{width:m,height:g}},Vne=function(e){var t=document.createElement("canvas"),r=t.getContext("2d"),n=e.width,o=e.height,i=Math.max(n,o);return t.width=i,t.height=i,r.fillStyle="#000",r.fillRect(0,0,i,i),r.drawImage(e,0,0,e.width,e.height),t};function zne(e){var t=e.cameraScale,r=void 0===t?1:t,n=e.isVideoPlaying,o=e.step,i=e.cropArea,a=e.videoRef,s=e.onFarFaceDetected,c=e.onFarFullFaceDetected,u=e.onCloseFaceDetected,l=e.onCloseFullFaceDetected,d=e.onFlashingFramesCaptured,f=e.frameInterval,p=void 0===f?180:f,h=e.useFaceDetectorWhenFlashing,m=e.onFaceError,g=e.onError,v=e.faceSettings,y=e.maskBoundingRect,b=e.shouldPauseFaceDetection,w=e.closeEyesSettings,C=e.maskSettings,k=e.captureFrameSettings,S=e.blurSettings,E=e.shouldContinueOnError,B=S.blurCheckFarSettings,_=S.blurCheckCloseSettings,x=C.chinToMaskBottomPadding,T=k.frameScale,A=w.enable,I=w.timeout,P=xw.useContext(Rne),R=Tne({videoRef:a,cropArea:i}),D=xw.useMemo((function(){return jne({size:{width:R.cropWidth,height:R.cropHeight},scale:T,video:a.current})}),[T,R.cropHeight,R.cropWidth,a]),O=Mne({cropArea:i,maskBoundingRect:y,baseCanvasSize:Math.min(D.width,D.height)}),N=v.minFarFaceRatio,L=v.maxFarFaceRatio,M=v.closeFaceRatio,F=xne({width:D.width,height:D.height,cameraScale:r}),U=D.height/D.width,j=xne({width:yne,height:yne*U,cameraScale:r,debug:P}),V=Ine({width:160,height:150,debug:P}),z=yj.useSDKSettings().customUrls,q=Ky(Bne(z,g),2),H=q[0],W=q[1],K=xw.useRef(null),Q=Fne({timeout:1e3*I}),G=Q.markTime,X=Q.checkIfEllapsed,Y=W&&n,$=Ky(xw.useState(""),2),Z=$[0],J=$[1],ee=H.closeEyesModel,te=H.blazefaceModel,re=xw.useMemo((function(){return $5(J,1e3)}),[]),ne=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t,r){var n,i,f,p,v,y,w,C,k,S,T,I,R,D,F,U,z,q,H,W,K,Q,Y,$,Z,J,ne,oe,ie,ae,se,ce,ue,le,de;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(null==r?void 0:r.width)&&0!==(null==r?void 0:r.height)){e.next=3;break}return e.abrupt("return");case 3:if(null!==a.current){e.next=5;break}return e.abrupt("return");case 5:if(!b){e.next=7;break}return e.abrupt("return");case 7:if(o!==mne.STOP_DECTECTING){e.next=9;break}return e.abrupt("return");case 9:if(n=t.cropX,i=t.cropY,f=t.cropWidth,p=t.cropHeight,v=r.width,y=r.height,r.getContext("2d").drawImage(a.current,n,i,f,p,0,0,v,y),w=Vne(r),C=yne/v,P&&j.getContext("2d").drawImage(a.current,n,i,f,p,0,0,v*C,y*C),h||o!==mne.START_FLASHING){e.next=22;break}if("function"!=typeof d){e.next=21;break}return e.next=21,d({prediction:null,canvas:r,landmarks:null});case 21:return e.abrupt("return");case 22:return e.next=24,GV.getModelPredictions({model:te,sCanvas:w});case 24:return k=e.sent,e.next=27,KV.validatePredictions({predictions:k,width:v,height:y});case 27:return S=e.sent,T=S.fullFace,I=S.ratio,R=[[O.left,O.top],[O.right,O.bottom]],e.next=33,KV.validatePredictions({predictions:k,cropAreaCoordinates:R});case 33:if(D=e.sent,F=D.error,U=D.fullFace,z=D.faceRatio,P&&(q={left:O.left*C,top:O.top*C,right:O.right*C,bottom:O.bottom*C},One(j,{x:q.left,y:q.top,width:q.right-q.left,height:q.bottom-q.top},"red"),H=k.map((function(e){return Une(e,C)})),Nne(j,H,!0)),W=uL.FaceDirection.FRONTAL,!U){e.next=44;break}return e.next=42,KV.calculateFaceDirection({landmarks:U.landmarks,upDownBound:{lower:.35,upper:.7}});case 42:Q=e.sent,W=null!==(K=null==Q?void 0:Q.gesture)&&void 0!==K?K:"";case 44:if(!T||o!==mne.FAR_FACE){e.next=48;break}if("function"!=typeof s){e.next=48;break}return e.next=48,s({prediction:k[0],canvas:r,landmarks:T.landmarks});case 48:if(!T||o!==mne.CLOSE_FACE){e.next=52;break}if("function"!=typeof u){e.next=52;break}return e.next=52,u({prediction:k[0],canvas:r,landmarks:T.landmarks});case 52:if(Y=null==F?void 0:F.code,e.prev=53,Y!==uL.Errors.no_face.code){e.next=56;break}throw new Error("no_face");case 56:if(Y!==uL.Errors.multiple_faces.code){e.next=61;break}if($=KV.calculateFaceArea(k[0]),Z=KV.calculateFaceArea(k[1]),!($<=2*Z)){e.next=61;break}throw new Error("multiple_faces");case 61:if(W===uL.FaceDirection.FRONTAL){e.next=63;break}throw new Error("face_not_frontal");case 63:if(Y!==uL.Errors.partial_face.code){e.next=68;break}if(J=KV.cropFaceInsideBox([k[0].topLeft,k[0].bottomRight],R),!(FV.rectEdgeRatio(J,R)>.95)){e.next=68;break}throw new Error("face_too_large");case 68:if(o!==mne.FAR_FACE){e.next=73;break}if(!(z>L)){e.next=71;break}throw new Error("face_too_large");case 71:if(!(z<N)){e.next=73;break}throw new Error("face_too_small");case 73:if(o!==mne.CLOSE_FACE){e.next=76;break}if(!(z<M)){e.next=76;break}throw new Error("face_too_small");case 76:if(!(Array.isArray(k)&&k.length>0&&O.bottom-k[0].bottomRight[1]>x)){e.next=78;break}throw new Error("face_too_high");case 78:if(Y!==uL.Errors.face_out_of_box.code){e.next=85;break}if(o!==mne.FAR_FACE){e.next=82;break}if(!(z>=N&&z<=L)){e.next=82;break}throw new Error("");case 82:if(o!==mne.CLOSE_FACE){e.next=85;break}if(!(z>=M)){e.next=85;break}throw new Error("");case 85:e.next=90;break;case 87:e.prev=87,e.t0=e.catch(53),Y=e.t0.message;case 90:if(ne=null,!A){e.next=102;break}if(Y){e.next=101;break}return e.next=95,ee.predict(r,T.landmarks);case 95:oe=e.sent,ie=X(),ne=oe.isEyeClose,oe.isEyeClose&&!ie&&(Y="eye_close"),e.next=102;break;case 101:G();case 102:if(ae=0,!(se={enable:o===mne.FAR_FACE?B.enable:_.enable,threshold:o===mne.FAR_FACE?B.threshold:_.threshold}).enable){e.next=109;break}return e.next=107,BV.calculateBlurScore(r);case 107:ae=e.sent,""!==Y||BV.hasBetterBlurScore(ae,se.threshold)||(Y="blurry_face");case 109:if(P&&Pne(V,{ratio:null!==(ce=null==I?void 0:I.toFixed(3))&&void 0!==ce?ce:"undefined",error:Y,ovalFaceRatio:null!==(ue=null==z?void 0:z.toFixed(3))&&void 0!==ue?ue:"undefined",ovalError:null!==(le=null==F?void 0:F.code)&&void 0!==le?le:"undefined",step:o===mne.FAR_FACE?"far":"close",blurScore:ae.toFixed(3)}),de=Ane(Y),re(de),!de){e.next=118;break}if("function"!=typeof m){e.next=116;break}return e.next=116,m({error:Y,currentStep:o});case 116:if(E){e.next=118;break}return e.abrupt("return");case 118:if(!(o===mne.FAR_FACE&&T&&N<=z&&z<=L)){e.next=123;break}if("function"!=typeof c){e.next=123;break}return e.next=122,c({prediction:k[0],canvas:r,landmarks:T.landmarks,frame:{faceRatio:z,isEyeClosed:ne,blurScore:ae}});case 122:return e.abrupt("return");case 123:if(!(T&&o===mne.CLOSE_FACE&&z>=M)){e.next=128;break}if("function"!=typeof l){e.next=128;break}return e.next=127,l({prediction:k[0],canvas:r,landmarks:T.landmarks,frame:{faceRatio:z,isEyeClosed:ne,blurScore:ae}});case 127:return e.abrupt("return");case 128:if(!(h&&T&&o===mne.START_FLASHING&&z>=M)){e.next=133;break}if("function"!=typeof d){e.next=133;break}return e.next=132,d({prediction:k[0],canvas:r,landmarks:T.landmarks});case 132:return e.abrupt("return");case 133:e.next=139;break;case 135:e.prev=135,e.t1=e.catch(0),console.error(e.t1),g({error:e.t1});case 139:case"end":return e.stop()}}),e,null,[[0,135],[53,87]])})));return function(t,r){return e.apply(this,arguments)}}(),[a,b,o,P,h,te,O.left,O.top,O.right,O.bottom,A,B.enable,B.threshold,_.enable,_.threshold,re,N,L,M,j,d,s,u,x,ee,X,G,V,m,E,c,l,g]);return xw.useEffect((function(){var e=null,t=!1;return Y&&function r(){e=requestAnimationFrame(function(){var e=xy(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=2;break}return e.abrupt("return");case 2:if(null!==a.current){e.next=4;break}return e.abrupt("return");case 4:if(null===K.current&&(K.current=n),!(n-K.current<p)){e.next=9;break}return r(),e.abrupt("return");case 9:return K.current=n,e.next=12,ne(R,F);case 12:r();case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}(),function(){t=!0,cancelAnimationFrame(e)}}),[F,R,ne,Y,a,p]),{warmupDone:W,faceError:Z}}var qne={" ":"rgba(0,0,0,0.6)",default:"rgba(0,0,0,0.6)"},Hne=null,Wne=function(e){var t=e.colors,r=e.onFlashDone,n=e.framesPerColor,o=e.flashColor,i=Ky(xw.useState(Hne),2),a=i[0],s=i[1],c=xw.useRef(a),u=xw.useMemo((function(){return t.split("").reduce((function(e,t){return e+t.repeat(n)}),"")}),[t,n]),l=" "===u[a]?qne.default:o,d=xw.useCallback((function(){s((function(e){return e+1})),c.current+=1}),[]),f=xw.useCallback((function(){s(0),c.current=0}),[]);return xw.useEffect((function(){a>u.length-1&&(s(Hne),c.current=Hne,"function"==typeof r&&r())}),[a,u.length,r]),{flashingColors:u,colorIndex:a,currentColor:l,goToNextColor:d,startFlashing:f,colorIndexRef:c}},Kne=function(e){var t,r,n=e.videoAreaWidth,o=e.videoAreaHeight,i=e.lostX,a=e.lostY;return b1.isMobile?(t=n,r=o):(t=Math.min(n,o),r=Math.min(n,o)),{width:t,height:r,x:Math.max(Math.round((n-t)/2+i),0),y:Math.max(Math.round((o-r)/2+a),0)}},Qne=function(e){var t=e.onVideoPlayed,r=Ky(xw.useState(!1),2),n=r[0],o=r[1],i=Ky(xw.useState({}),2),a=i[0],s=i[1];return{onVideoPlayed:xw.useCallback((function(e){var r=Kne(e);s(r),o(!0),"function"==typeof t&&t(e)}),[t]),cropArea:a,isPlaying:n}},Gne=function(e){var t=e.prediction,r=e.canvas,n=e.landmarks,o=e.index,i=e.quality,a=void 0===i?.8:i,s=r.toDataURL("image/jpeg",a);return t?{label:"portrait",base64:s.split(",")[1],landmarks:n,index:o}:{label:"portrait",base64:s.split(",")[1],index:o}},Xne=function(){return 60},Yne=function(){var e=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",30);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$ne=20,Zne=function(e){var t=Ky(xw.useState(e),2),r=t[0],n=t[1];return xw.useEffect((function(){(function(){var t=xy(regeneratorRuntime.mark((function t(){var r,o,i,a,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Promise.all([Xne(),Yne()]);case 3:r=t.sent,o=Ky(r,2),i=o[0],a=o[1],s=Math.max(1e3/i,1e3/a,e),n(s),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(0),console.error(t.t0),n($ne);case 15:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(){return t.apply(this,arguments)}})()()}),[e]),r},Jne=function(e){var t=e.className,r=e.iconColor;return xw.createElement("svg",{className:t,width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xw.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",fill:r}),xw.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 36.1124C30.6895 36.1124 36.1124 30.6895 36.1124 24C36.1124 17.3105 30.6895 11.8876 24 11.8876C17.3105 11.8876 11.8876 17.3105 11.8876 24C11.8876 30.6895 17.3105 36.1124 24 36.1124ZM24 38C31.732 38 38 31.732 38 24C38 16.268 31.732 10 24 10C16.268 10 10 16.268 10 24C10 31.732 16.268 38 24 38Z",fill:"white"}),xw.createElement("path",{d:"M18.1465 20.169C18.1465 19.6236 18.5886 19.1815 19.134 19.1815C19.6793 19.1815 20.1214 19.6236 20.1214 20.169V22.1439C20.1214 22.6893 19.6793 23.1314 19.134 23.1314C18.5886 23.1314 18.1465 22.6893 18.1465 22.1439V20.169Z",fill:"white"}),xw.createElement("path",{d:"M28.0213 20.169C28.0213 19.6236 28.4634 19.1815 29.0087 19.1815C29.5541 19.1815 29.9962 19.6236 29.9962 20.169V22.1439C29.9962 22.6893 29.5541 23.1314 29.0087 23.1314C28.4634 23.1314 28.0213 22.6893 28.0213 22.1439V20.169Z",fill:"white"}),xw.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0714 19.1135C24.654 19.1135 25.1262 19.5858 25.1262 20.1683V24.6119C25.1262 25.7398 24.2119 26.6542 23.084 26.6542H22.5902C22.0077 26.6542 21.5354 26.1819 21.5354 25.5994C21.5354 25.0168 22.0077 24.5446 22.5902 24.5446H23.0166V20.1683C23.0166 19.5858 23.4889 19.1135 24.0714 19.1135Z",fill:"white"}),xw.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.8537 27.4214C29.2114 27.8813 29.1285 28.544 28.6687 28.9016C26.6697 30.4564 24.6954 30.8255 23.0184 30.5817C21.3833 30.344 20.0946 29.5339 19.3755 28.8149C18.9636 28.403 18.9636 27.7351 19.3755 27.3232C19.7875 26.9113 20.4553 26.9113 20.8672 27.3232C21.3002 27.7562 22.184 28.3286 23.322 28.4941C24.4181 28.6534 25.8176 28.4466 27.3735 27.2364C27.8334 26.8788 28.4961 26.9616 28.8537 27.4214Z",fill:"white"}),xw.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",stroke:"#DAEAFB"}))};Jne.defaultProps={className:"",iconColor:"#0276F1"},Jne.propTypes={className:xC.string,iconColor:xC.string};var eoe,toe,roe,noe={FlashLiveness:{maskFill:"#fff",title:{hidden:!1,height:"64px",color:"#000",fontSize:"24px",fontWeight:"normal"},guideline:{text:{normal:{color:"#1d1d1d",fontSize:"16px",fontWeight:"bold",background:"#fafafa",border:"1px solid rgba(29, 29, 29, 0.04)",borderRadius:"100px",padding:"12px 16px"},flashing:{color:"#fff",fontSize:"24px",fontWeight:"bold",background:"#E54D2E",border:"1px solid rgba(29, 29, 29, 0.04)",borderRadius:"100px",padding:"12px 16px"}},icon:{color:"#0276F1"}},instruction:{color:"#1d1d1d",fontSize:"16px",fontWeight:"bold",background:"rgba(255, 255, 255, 0.8)",border:"none",borderRadius:"12px"},timeoutText:{color:"red",fontSize:"16px",fontWeight:"normal",padding:"0"},errorOverlay:{backgroundColor:"red",opacity:.2},progressBar:{mainColor:"#0276F1",secondaryColor:"#daeafb",fontSize:"16px",fontWeight:"normal"}}},ooe=dB.div(eoe||(eoe=Wy(["\n & .indicator {\n color: ",";\n }\n\n & .gauge {\n background-color: ",";\n transition: width 0.2s ease;\n }\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.mainColor",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.mainColor",noe)})),ioe=dB.div(toe||(toe=Wy(["\n height: 10px;\n position: relative;\n background: ",";\n border-radius: 100px;\n margin-block-end: 8px;\n\n & > span {\n display: block;\n height: 100%;\n border-radius: 100px;\n width: 0;\n overflow: hidden;\n }\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.secondaryColor",noe)})),aoe=function(e){var t=e.value,r=e.className;return xw.createElement(ooe,{className:r},xw.createElement(ioe,null,xw.createElement("span",{className:"gauge",style:{width:"".concat(t,"%")}})),xw.createElement("div",null,xw.createElement("span",{className:"indicator"},"• ",t,"%")))};aoe.defaultProps={value:0,className:""},aoe.propTypes={value:xC.number,className:xC.string};var soe,coe=dB.span(roe||(roe=Wy(["\n padding: 8px 12px;\n display: flex;\n align-items: center;\n flex-direction: row;\n"]))),uoe=function(e){var t=e.children,r=e.className;return xw.createElement(coe,{className:r},t)};uoe.defaultProps={children:null,className:""},uoe.propTypes={children:xC.node,className:xC.string};var loe,doe=dB.span(soe||(soe=Wy(["\n ","\n padding: 12px 16px;\n max-width: 200px;\n text-align: center;\n display: inline-block;\n"])),(function(e){var t=e.theme;return YE(["font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";"],t5(t,"FlashLiveness.instruction.fontSize",noe),t5(t,"FlashLiveness.instruction.color",noe),t5(t,"FlashLiveness.instruction.fontWeight",noe),t5(t,"FlashLiveness.instruction.background",noe),t5(t,"FlashLiveness.instruction.borderRadius",noe),t5(t,"FlashLiveness.instruction.border",noe))})),foe=function(e){var t=e.children,r=e.className;return xw.createElement(doe,{className:r},t)};foe.defaultProps={children:null,className:""},foe.propTypes={children:xC.node,className:xC.string};var poe,hoe,moe=dB.div(loe||(loe=Wy(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1001;\n\n background-color: ",";\n"])),(function(e){return e.$overlay?"white":"transparent"})),goe=function(e){var t=e.children,r=e.overlay,n=e.loadingComponent;return xw.createElement(moe,{$overlay:r},r&&n,xw.createElement("div",{style:{visibility:r?"hidden":"visible"}},t))};goe.defaultProps={children:null,overlay:!1,loadingComponent:xw.createElement(Y7,null)},goe.propTypes={children:xC.node,overlay:xC.bool,loadingComponent:xC.node};var voe={width:210,height:300},yoe={width:b1.isMobile?window.innerWidth:window.innerHeight,height:window.innerHeight},boe=dB.ellipse(poe||(poe=Wy(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),woe=dB.rect(hoe||(hoe=Wy(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n"]))),Coe=xw.forwardRef((function(e,t){var r=e.className,n=e.scale,o=e.debug,i=e.width,a=e.height,s=e.padding,c=e.verticalOffset,u=e.ovalMaskFillColor,l=(i-voe.width)/2,d=(a-voe.height)/2+c,f=(i+voe.width)/2,p=(a+voe.height)/2+c,h=l-(f-l)*(n-1)/2,m=d-(p-d)*(n-1)/2,g=(f-l)*n,v=(p-d)*n;return xw.createElement("svg",{className:r,viewBox:"0 0 ".concat(i," ").concat(a),width:i,height:a},xw.createElement("mask",{id:"OVAL_MASK"},xw.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),xw.createElement(boe,{cx:i/2,cy:a/2+c,rx:voe.width/2,ry:voe.height/2,$scale:n})),xw.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:u,mask:"url(#OVAL_MASK)"}),xw.createElement("rect",{x:"0",y:"0",width:i,height:a,stroke:"red",fill:"none",style:{visibility:o?"visible":"hidden"}}),xw.createElement(woe,{ref:t,x:h-s.left,y:m-s.top,width:g+s.left+s.right,height:v+s.top+s.bottom,fill:"none",stroke:"red",strokeWidth:.5,style:{visibility:o?"visible":"hidden"}}))}));Coe.propTypes={className:xC.string,scale:xC.oneOfType([xC.number,xC.string]),debug:xC.bool,width:xC.number,height:xC.number,padding:xC.oneOfType([xC.number,xC.shape({top:xC.number,right:xC.number,bottom:xC.number,left:xC.number})]),verticalOffset:xC.number,ovalMaskFillColor:xC.string},Coe.defaultProps={className:"",scale:1,debug:!1,width:yoe.width,height:yoe.height,padding:0,verticalOffset:0,ovalMaskFillColor:"#fff"};var koe=function(e,t,r){var n=e.smallScale,o=e.largeScale,i=e.ovalPadding,a=t.width/t.height,s=n/o,c=n*r.height,u=o*r.height,l=i.top+i.bottom,d=i.left+i.right,f=c-l,p=u-l;if(parseFloat((p*a).toFixed(2))+d>r.width){var h=((r.width-d)/t.width).toFixed(2);return{smallScale:(h*s).toFixed(2),largeScale:h}}return{smallScale:(f/t.height).toFixed(2),largeScale:(p/t.height).toFixed(2)}},Soe=function(e){var t=e.offset,r=e.ovalPadding,n=e.largeScale,o=e.ovalHeight,i=e.maskHeight,a=o/2+r.bottom;return(a+t)*n>i/2?i/2/n-a:t},Eoe=function(e){xw.useEffect((function(){return function(){var t;e&&(null===(t=e.srcObject)||void 0===t||t.getTracks().forEach((function(e){e.stop()})))}}),[e])},Boe=function(){var e,t=Ky(xw.useState(null),2),r=t[0],n=t[1],o=Ky(xw.useState(!1),2),i=o[0],a=o[1],s=xw.useRef(null);return xw.useEffect((function(){if(!s.current)return function(){};var e=s.current,t=function(){n(e.getBoundingClientRect()),a(!1)},r=function(){a(!0)};return e.addEventListener("transitionstart",r),e.addEventListener("transitionend",t),function(){e.removeEventListener("transitionstart",r),e.removeEventListener("transitionend",t)}}),[]),[s,null!=r?r:null===(e=s.current)||void 0===e?void 0:e.getBoundingClientRect(),i,a]},_oe=function(e){var t=e.mode,r=e.enableWriteExif,n=xw.useRef(Date.now()),o=yj.useSDKSettings().exifKey,i=xw.useCallback((function(){if(r){var e=Date.now();lW.preWriteExif({mode:t,startTime:n.current,endTime:e,exifKey:o})}}),[t,r,o]),a=xw.useCallback((function(e,t){r&&lW.addExifData(e,t)}),[r]),s=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.imageData){e.next=3;break}return e.abrupt("return",null);case 3:if(r){e.next=5;break}return e.abrupt("return",o.blob);case 5:return e.next=7,lW.writeExif({mode:t,imageData:o,enableExifData:!0});case 7:return i=e.sent,e.abrupt("return",i);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[t,r]);return xw.useEffect((function(){r&&lW.initExifData()}),[r]),{prepareExifData:i,writeExifData:s,addExifData:a}},xoe="Face authentication",Toe="Hold still",Aoe="Uploading",Ioe="Start",Poe="Retry",Roe="Fit your face into the oval",Doe="No face detected",Ooe="Processing result",Noe="Please fit your face in the oval",Loe="Please move your face a bit closer",Moe="Please move your face a bit further",Foe="Please open your eyes",Uoe="Please hold your device at eye level",joe="Multiple faces detected",Voe="Please move your face down a little",zoe="Image's blurry. Please hold your phone still",qoe="Move your face closer",Hoe={face_authentication:xoe,hold_still:Toe,uploading:Aoe,start:Ioe,continue:"Continue",retry:Poe,"face_authentication.successful":"Successful face authentication","face_authentication.unsuccessful":"Unsuccessful face authentication",move_face_into_frame:Roe,face_not_found:Doe,processing_result:Ooe,please_move_face_into_center_frame:Noe,please_move_face_closer:Loe,please_move_face_farther:Moe,please_open_your_eyes:Foe,please_look_straight_at_the_camera:Uoe,please_only_one_face:joe,please_move_face_down:Voe,please_hold_still:zoe,"timeout.remaining":"Remaining time: <%= remain %> seconds","timeout.expired":"You need to complete within <%= timeout %> seconds. Please try again.",move_face_closer:qoe},Woe="Xác thực khuôn mặt",Koe="Giữ yên",Qoe="Đang tải lên",Goe="Bắt đầu",Xoe="Thử lại",Yoe="Đưa mặt vào khung",$oe="Không tìm thấy khuôn mặt",Zoe="Đang xử lý kết quả",Joe="Đưa khuôn mặt vào giữa hình oval",eie="Đưa khuôn mặt lại gần một chút",tie="Đưa khuôn mặt ra xa một chút",rie="Vui lòng mở to mắt",nie="Vui lòng đưa thiết bị ngang tầm mắt",oie="Có nhiều mặt trong khung hình",iie="Đưa khuôn mặt xuống một chút",aie="Ảnh bị mờ, vui lòng giữ yên điện thoại",sie="Đưa mặt lại gần",cie={face_authentication:Woe,hold_still:Koe,uploading:Qoe,start:Goe,continue:"Tiếp tục",retry:Xoe,"face_authentication.successful":"Xác thực khuôn mặt thành công","face_authentication.unsuccessful":"Xác thực khuôn mặt không thành công",move_face_into_frame:Yoe,face_not_found:$oe,processing_result:Zoe,please_move_face_into_center_frame:Joe,please_move_face_closer:eie,please_move_face_farther:tie,please_open_your_eyes:rie,please_look_straight_at_the_camera:nie,please_only_one_face:oie,please_move_face_down:iie,please_hold_still:aie,"timeout.remaining":"Thời gian còn lại: <%= remain %> giây","timeout.expired":"Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại.",move_face_closer:sie},uie={en:Hoe,vi:cie},lie=xw.createContext({}),die=function(e){var t,r=e.children,n=yj.useSDKSettings().lang;return xw.createElement(lie.Provider,{value:null!==(t=uie[n])&&void 0!==t?t:uie.vi},r)};die.propTypes={children:xC.node.isRequired};var fie,pie=function(){var e=xw.useContext(lie);return xw.useCallback((function(t,r){var n,o;return r?i9(null!==(n=e[t])&&void 0!==n?n:t)(r):null!==(o=e[t])&&void 0!==o?o:t}),[e])},hie=function(){var e=xw.useRef(),t=Yj.useSDKTracking().sendEvent;return xw.useCallback((function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=performance.now(),a={};"object"===By(o)&&(a=Oy({},o),e.current&&(a.interval_vs_previous_in_ms=i-e.current)),"function"==typeof o&&(a=o({lastTimeLog:e.current})),e.current=i,t({tag:r,event:n,log:a})}),[t])},mie=function(e,t){var r=xw.useRef(e);xw.useEffect((function(){r.current=e}),[e]),xw.useEffect((function(){t&&"function"==typeof r.current&&r.current()}),[t])},gie=Object.freeze({READY:"READY",RUNNING:"RUNNING",STOPPED:"STOPPED"}),vie=function(e){var t=e.startTime,r=void 0===t?3:t,n=e.onCountDownDone,o=Ky(xw.useState(r),2),i=o[0],a=o[1],s=Ky(xw.useState(gie.READY),2),c=s[0],u=s[1],l=xw.useRef(),d=xw.useCallback((function(){u(gie.RUNNING),l.current=setInterval((function(){a((function(e){return e-1}))}),1e3)}),[]),f=xw.useCallback((function(){u(gie.READY),a(r),clearInterval(l.current)}),[r]);return xw.useEffect((function(){0===i&&(u(gie.STOPPED),clearInterval(l.current),"function"==typeof n&&n())}),[i,n,f,d]),{state:c,countdown:i,startCountDown:d,stopCountDown:f}},yie=dB.span(fie||(fie=Wy(["\n display: inline-block;\n margin-block: 10px;\n text-align: center;\n max-width: 350px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.timeoutText.color",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.timeoutText.fontSize",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.timeoutText.fontWeight",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.timeoutText.padding",noe)})),bie=3e3,wie=function(e){var t=e.onTimeout,r=e.timeout,n=e.shouldStart,o=e.shouldStop,i=e.onWarningMessageTimeout,a=e.timeLeftThreshold,s=pie(),c=Ky(xw.useState(!1),2),u=c[0],l=c[1],d=xw.useCallback((function(){l(!0),setTimeout((function(){l(!1),"function"==typeof i&&i()}),bie),"function"==typeof t&&t()}),[t,i]),f=vie({startTime:r,onCountDownDone:d}),p=f.countdown,h=f.startCountDown,m=f.stopCountDown;return mie(h,n),mie(m,o),xw.createElement(xw.Fragment,null,!u&&p>0&&p<a&&xw.createElement(yie,null,s("timeout.remaining",{remain:p})),u&&xw.createElement(yie,null,s("timeout.expired",{timeout:r})))};wie.propTypes={onTimeout:xC.func.isRequired,timeout:xC.number.isRequired,shouldStart:xC.bool.isRequired,shouldStop:xC.bool.isRequired,onWarningMessageTimeout:xC.func,timeLeftThreshold:xC.number},wie.defaultProps={onWarningMessageTimeout:null,timeLeftThreshold:10};var Cie={8:[" r rrr"," r rr"," r r rr "," r rrr "," r r r "," rr r rr"," rr r "," rr rrr"," rr r"," rrr r"," r rrr "," r r r "," r r rr"," r r r "," r rrr r"," r r "," rrr r "," r rr r"," rrr rrr"," r r "," rr r "," r rrr "," r rr "," r r rr"," r r r"," r r r"," r rr r"," r r r "," r rr r"," r rr rr"," rr rr "," rr rr"," r rrr"," r r"," r rrr"," r rr "," r rr r "," rr r "," rr r r "," r r "," rr r "," rr r "," r r r"," rr rr"," rr "," r rr "," rrr r r"," r r r"," rrr rr"," r rr"," rrr "," rr rrr"," r r "," rrr "," r r "," r r r"," r rr "," rr rr "," rrr r"," rr r r"," r r r r"," rr rrr "," rrr rr "," rrr r"," rrr rr"," r rr "," rrr r "," rr rr"," rr rr r"," r rr "," rr r"," r r rr"," r r r"," r r rrr"," rr r r"," rrr r "," rr r r"," r r "," rr r "," rr rr "," r r "],9:[" r r r "," r r r"," rrr r r "," r rrr "," r r rr"," rr r "," r r r "," r rrr "," rr rr "," rr r r "," r r rrr"," r r r r"," r rr r"," rr r r"," r rr "," rrr r "," r rr r"," rr rr "," rr r r"," rr r rr"," rr rrr "," r r r"," r r r "," rr rr r"," r rr r"," rrr rrr "," rr r r"," r r r "," rrr "," r r rr"," r r rrr"," r r r rr"," r r r "," rrr rr"," r rrr r "," rrr r "," rrr r "," rrr r "," r rr r r"," rr r r "," rr r r"," r r r"," rr rr r"," rr r r r"," r r r "," r r rr "," rr r r "," r rr r "," rr rr "," rr r "," rr r"," r r r"," rrr r"," r rr "," r r "," r r "," rrr r "," r rr "," r rr r "," r rr rr"," rr r "," r r rr "," rrr rr"," r rrr "," rrr rrr"," r rr "," r r rrr"," r rrr r"," r r rr r"," rr rr r "," r rrr "," r r rr"," rr r "," r r r "," r r r r "," r r "," r rr rr "," r rrr "," r rr "," rr rrr "," r r "," r r r r"," rr rr r"," r rr rr"," r r r "," rr rr"," r r rrr "," r r r "," rr rr rr"," r rr rrr"," rr rr "," rr r rr"," rrr rr "," rrr rr "," rr rrr "," r rrr"," rr r r"," rrr rr "," rrr rr"," rrr r r"," rr rr"," r rrr r"," r rr "," rr rrr"," rr r r"," r rr r"," r r rr "," r rr rr"," r rrr rr"," rrr r r"," r rr"," r r rr "," r r r"," rrr rrr"," rr r "," rr rr "," r r rr"," rr rrr r"," rrr r rr"," r rr r "," r r r"," r rr r"," rrr r r"," rr r rr"," rr r rrr"," r r "," r rrr"," rrr r "," r r r r"," rr rrr"," r r "," rr r "," rr r rr "," r rrr r"," rr r "," rrr r"," r rr r "," r rr r"," r rr "," r r rr"," r r r "," rr rrr"," rr rr "," r rrr "," rrr rr r"," r r rr"," rr r r "," r r r r"," r r r"],10:[" r rr r"," rrr rrr "," rr r rr "," r r rrr"," r rr r"," r r rr "," r rrr rr"," r r rr "," rr r r"," r r rr "," rr rrr "," r rr r r"," rr r rr "," r r r r "," r rrr "," r rr rr "," rr rr r"," rr r r "," r rrr r"," r r r "," r r r"," rrr r "," r r r"," rr r rrr"," r r r rr"," r rr rr"," r rr r "," rrr r r "," rr rr r"," r r rr"," r r r r"," rrr r rrr"," r r r r "," r r rrr "," r rrr rr "," rrr r"," r rrr "," r r r "," r rrr r "," r rr rrr"," r rrr rrr"," rr r r "," rr r r "," rrr r rr"," rr rrr "," rrr r "," rrr rr r"," rrr r "," r rrr r "," r r rrr r"," r r r r "," rrr r r "," rrr rrr "," rr r rr "," r r r rr"," rr r r r"," rr rr "," r rr rr "," rr rrr r"," rr rr "," r rr r "," r rrr r"," r r r r"," rr rrr "," r r "," rr r r "," rrr rr r"," rr r rr"," r rr r"," r r r"," rr r rr r"," r r rr r"," rrr rrr "," r r r r "," r r rrr "," rr r "," rrr r r "," r r rr "," r r r r "," r rrr r"," rr rrr "," r rrr rr"," rr r rr"," r r r "," r r rr r"," r r r r"," rr rr "," rrr rr "," r r r"," rr rr "," rr rrr"," r rr r"," r r rrr"," rr rr "," r rrr rr"," rr r "," r rr r "," rr r "," rr rr r "," rr rr r r"," r rrr r "," r rrr "," r rrr "," r rr rr"," rr rr rr"," rr rrr "," r r rr "," rr r r"," rr r "," rr r rr"," r rr rrr "," rr rrr r"," rr r r "," rr r rr "," r rrr "," r rr r r"," r r r "," rr rr r "," r r rr "," r rr r "," r rr r "," r rr r r"," rrr rrr"," rr r r rr"," rrr rr "," r rr rr r"," rr r r r"," r rr r"," r rr rr "," r r r "," r r rr r "," rrr r rr"," r r "," r rrr r "," r r rr r"," r r r r"," r rrr r r"," rr r rrr "," rrr rr "," r r rrr"," r r r "," rr r rr"," r rr r"," r r "," rrr r r "," rr rrr r"," rrr rr "," rr r r "," r r r r"," rrr r "," r rr rrr"," r rr r "," rrr r r"," rr r r"," r r r "," r r rrr"," rr r "," rr rr r"," r r r r"," r rr "," r rr rr "," rr r r "," rr r rrr"," rr rr r"," rrr rrr"," r r rrr"," r r r"," r r r "," rrr r r"," r rr r "," r rr rr"," rr rrr r "," r r r r"," rr r r r "," r rr r "," rr r r "," r rr "," r rr rr"," r rr rrr"," rrr r rr "," r r rrr "," r r r rr"," r r r "," r rrr r"," rr r "," rr rr"," r rr r "," rr r rr"," rr r rrr"," r rr r rr"," r r r "," r r r rr "," rr r r r"," r r r rr"," rr rr rr "," rrr r r"," r rr r r"," rr rr r "," rr r r"," r rr "," rrr rr r"," r r r "," r r rr "," rr rr r"," rrr rr rr"," r rrr "," rr rr rr"," rrr r r"," rrr r rr"," r r r "," rr rrr"," rrr rr "," rr rrr rr"," r r r"," r rrr "," r r rr"," r rr "," rr rr "," rrr r r r"," r rrr"," r r r rrr"," rrr rr"," r r rr "," r rrr r"," rr r r"," rrr r r"," rr rr rrr"," r r r r"," rrr r "," r r r r"," r r rr"," r rr rr"," rrr rr r "," r r r r r"," r r r "," r r r "," r rr r "," r r rr rr"," rrr r "," rr rr r "," r rr r r "," rr r r r"," rr rr r"," rr rrr "," rrr rrr r"," r r rrr "," r r rr"," rr r r"," rr r rr"," r r rr"," r r rr "," rrr r "," r rrr r"," r rr "," r r r "," r r r r"," rr r r "," rr rr "," rrr r r"," r rr "," rr r r"," rrr rr "," r r rr"," r r rr"," r r rr r"," r r r "," rrr rrr"," rrr rr"," r rr rr"," r r rr "," rr r r "," r rr r"," r r rrr"," rr rr rr"],11:[" rrr rrr "," r r r r r"," r r rrr"," r rr rr "," r rr rrr"," r r r r r"," rr r rrr"," rrr rrr r"," rr r r "," rr rrr rrr"," r rrr rrr"," r r r "," rr rrr r"," r rrr "," rr r rrr "," r rr rr"," rrr rr r"," rr r r "," r rrr rr"," r r rrr r"," rr r r r"," rrr r r"," r r rrr "," r rr rr r"," rr rrr r"," rrr r rrr"," rr rr r"," r rrr r "," r rr rrr "," r r rr"," rr r r "," r r r r "," r rr rr"," r rr r"," rrr rr "," rrr rr r "," rr r r r"," rr rrr rr"," rrr rr "," r rrr "," r rr r "," rrr rrr"," r rr rr rr"," r r r rr "," rr r rr rr"," r rr r "," r r r "," r rrr r "," rrr r r r"," rrr r rr "," r r r "," rr r rrr "," rrr r r"," rr rr r "," rr r r "," r rr r rrr"," r r r r"," rr r rrr "," r rr r"," r r rr"," rr r r "," rr r r"," r r r rr"," rrr r rr "," r r r r"," r rr r rr "," r r rr "," r r rr r"," r rrr rr "," r r r "," r rr r "," rr r r r"," rr r r r"," r rrr rr "," rr rrr "," rrr r r "," rrr r rr "," rr r rr"," rr rrr r"," r r rrr "," r r rr r "," r rr rr r "," rr r r r "," r r r "," rr r r "," r r r rrr "," rrr rr r"," r rr r "," rr rr r "," rr rr rr "," rrr r r "," rrr rr r r"," r r rrr "," r rr r rr"," rr rrr rr"," rr rr rr r"," r r r"," r rrr r"," rr r r r"," r r rrr "," r rr r rr"," rrr r r "," r rr r "," r rr rr "," r rr rr "," rr rrr rr "," rr rr rr "," rr r rr "," r r r r r"," rr rr rrr"," r r rr r "," r r r "," r r r r"," rr r rrr"," r rr r "," r r rr"," rrr r r"," rr rr r "," rrr r rr"," r r rr r"," rr rr r r"," r r r r "," r r rrr rr"," r rr "," r r r r "," rrr r rrr"," rrr r r r"," rr r rrr r"," rr rr r r"," rrr r r "," r rr r r "," rrr rr "," rr r rr"," r r rrr"," r r r r r "," r rrr r r"," r r rr r"," r r rrr "," r r rrr r "," r r r rr"," r rr rr "," rr rr rr "," r rrr r "," r rr rrr"," r r r r"," rrr r "," rr rr "," rr rrr "," rrr r r"," r rr r r "," r r rr "," r r rr "," r rr rr "," r r rr "," rr rr rr"," r rr "," rr r rr "," r rr r r "," r r r r"," r r r "," r rr rr "," rrr r r "," rr r r "," r r rr "," rr r rr r "," rr rrr"," rr rr rrr "," rr rr r"," r r r r "," rr r rrr"," rr rrr "," rr r r "," r rr r "," rr r r "," rr rrr r r"," rr r "," r r r rr "," rr rr rr "," rrr r "," r r rr r"," rr r r r "," rr r r r "," rrr r r"," rrr r rr"," r r r r "," rr rr r "," rrr rr "," r rr rrr"," r rr rr"," r rrr r r"," r rrr "," r rrr r"," rrr rrr r"," r r r "," r r rr "," r r rrr"," rr rr r"," r r rrr"," rrr rrr r "," rr r r r"," rrr rrr"," r r rrr r"," rr r r rr"," r r r "," rr rrr r "," rr rr r "," r r r "," r rrr "," r r r r "," r rrr r"," r r rr r "," r rr rrr "," rr r rrr"," rrr rr"," rrr r r r"," rrr rr r"," r rr r "," rr rr r r"," r r rrr "," r r r rr"," r r rrr "," rrr rr r "," rr rrr r"," rrr r rr"," r r rr rr"," rr rr "," r rr r"," r rr "," rrr r r "," r r rr "," r rrr r"," r rr r"," r r rr r"," r rr r r"," rr r rr"," rrr r rr"," r r rr"," r rrr rrr"," r rrr rr "," r r r r "," rrr r rr"," r r r r "," rrr rr rr"," r r rr rrr"," r r r r"," r rrr "," rr r r r"," rr rrr "," rr r r r"," rr r rrr "," rr r r"," r r r r"," rr rrr r"," rrr r r "," r r r "," r rr r r r"," r rr rrr r"," r r r r"," r r r rr r"," rrr r r r"," r r rrr"," rr rrr "," r r r r"," r r r"," r r rr rr"," rrr rr r"," r r rr "," r r r rr"," r rr r r "," r r r rr"," r rrr rr"," r r r"," r r rr"," r rrr r "," rr rr r "," rrr r "," rr rr r "," r r r r "," r r rr "," rrr r rr"," r rr r "," rr r r r r"," r r r r "," rr r r "," rrr rr "," rr rr rrr"," rr r rr"," r rrr rrr"," r rr r "," rr rr rr"," rr r r "," r rr rr "," r r r r "," r r r "," rr r rr "," r r rr "," r r r rr"," rr r r r "," r r rr "," r r r rr"," r r rrr"," rr rr r r"," r rrr rr r"," r rr rr"," r r rr "," r rr r r"," rr rr r "," r r rrr r"," r rrr rr "," rr rrr "," rrr r r "," rrr r r"," rrr rr "," rr r "," r rrr r rr"," r rrr r"," r rr r r "," rr r rr "," r r rr r r"," r rr r r"," rr r r "," r r r rr"," rrr rrr r"," rrr r r"," r rr r rr"," rr r r r "," rr r r "," rrr rrr "," r r rr"," r r rrr"," r r r r"," rr rr "," r r r r"," rrr rr rr"," rrr r "," r r r r r"," rrr r rrr"," rr rr "," rrr rrr "," r rrr r r "," rr r rr "," rr rr r"," rr r r"," rr r rr r"," r r r r "," r r rr r"," rrr rrr "," rr rrr r "," r rr rrr "," r rrr r"," rr r r"," r rrr "," r rr r "," rrr rrr "," rr r rr r"," rr rrr r "," rr rr rr"," rr r r"," r rr rr r"," r rrr rr"," rr r r "," r r r r "," rr r rr"," r r r r"," r rrr rr"," rr r rrr"," r r r rr "," rrr r rr r"," rrr r "," r rr r r"," r rr rrr"," rr rr rr"," r r rr rr"," r rr rr "," rr r rr"," r rr rr r"," r rrr r "," r rrr r "," rr r rrr"," r r rr "," r r r rr"," r r rrr "," r r r "," rr r r rr"," rr rr rr"," r rrr r "," rr rr "," r rr r r"," rr r r rrr"," rrr r "," r rr rr "," r rr r "," r r r rrr"," r r r rr"," rrr rr rr"," r rr rrr "," r rr rr r"," rrr r r rr"," r r r r"," r rr rrr"," r r rrr r"," r rr r r"," r rrr r r"," r r rr r"," rr rrr "," r rr r "," rr rrr r "," r r r r"," rr rr "," r rr rr"," r rr r "," r r rr r"," rr r rr"," rrr rr r "," rr rr rr"," r rr r "," r r r r rr"," rrr r r "," r r rrr "," rrr r rrr "," r r "," r r r "," r r r r"," r rr r"," r rrr r "," r r rr rr"," rrr rr r"," r rr r rr"," r rrr rr"," rr rrr r"," rr r r r"," rr rr r r "," r r rr r"," r rrr r "," r r r rr "," rrr rr r "," r rr r "," r r r r "," rrr rrr rr"," rrr r r "," r r r "," rr rr rrr"," r r r "," rr r rr "," rr r rr r"," rr rr r"," r rrr rrr "," r rr r r"," r rrr r r"," rrr r rr "," rr r r r"," r r r "," rrr rr rrr"," rr r rr "," rrr rr "," rr r rr "," rr r r rr"," rr r r "," r rr r r"," r rr r r"," r r rr r "," r r rr "," r r rr rr "," rr r r"," rrr rr r"," rr r r rr"," r rrr r"," rr r rr r"," r r r r r"," rr r r "," rr rr r"," r r r "," rr r "," r rr r"," r r r rrr"," rr r rr "," rr rr r "," r r rr "," r rr rrr"," r rrr rr"," r rr r r"," r r rrr "," r rr rr "," r rr rr"," rr rrr rr"," r r r "," rr rr r "," r r r r "," rrr r r r "," rr r rr "," rrr rr rr "," r r rr "," r r r rrr"," r r r rr "," rrr rrr "," rr rr r"," r r rr r"," r r r rrr"," r r rr r "," r r r r"," rr rr r rr"," rr r r rr "," r rrr r "," r rr rr"],12:[" rr rr rr r"," r r r rr"," r rr r r "," rr r r rr "," r rr r r"," rrr r r "," r r rr "," rrr rr r "," rr r rr "," rr rr r "," r r r r "," rr r rr r "," r r r rr"," rr rr r rr "," rr r rr "," rrr rr "," r rr r rr"," rrr rr rrr"," r rrr rr "," rr rr r "," r rr r r"," rrr rr rr "," rr r r r "," rrr r r "," r r rr "," r rr rr rr"," r rrr r "," rr rr r"," rr r r r "," rr rr r rr"," rr r r r"," r rr rr"," r r r r"," r rrr rr "," rr r rr "," rrr r r "," r rr rrr"," r rrr rrr "," r rrr rrr "," rr r r rrr"," r rr r r r"," r r r r rr"," r rrr "," r r rr rrr"," rrr r rr r"," r rrr r "," r rr r"," r rrr r "," rr rr r"," r rr r "," rrr r rr"," rr rr "," rrr r rr "," r rr rr r"," r rrr r r "," r r rr rr"," r rr rr r"," rr r r r "," rr r rrr r"," rr r r r"," r r rr rrr"," r rrr rr r"," rr rr r "," r rr r r "," r r r r"," rr rr r r"," rr r rrr"," rr r rr r"," r r r rr "," r rr r "," r rrr r r"," rrr r rr r"," r rrr rr rr"," r rr r r r"," r rr r rr"," rrr r r "," rr rrr rr "," rrr rr "," rrr rrr r"," rrr rr rr"," rrr rr rr"," r r rr rr"," rr r rr "," rr r r "," r rrr r r"," rr rr r "," rr rr rr "," rr r r "," rr r r "," rr rrr r "," rr rr rrr"," rrr r rr "," r r rr rr "," rr r r r "," rrr rr "," r rr r rr"," r r r r r"," r rr r r"," r r rr rr"," r rrr r r "," r rrr r r r"," r r rrr r"," rr r rr r"," r rr r rr "," rrr r r"," rrr r r "," rrr rrr r "," r r r rr "," rr r rr "," r rr rrr"," r rr r "," r r rr "," r r r r"," r r r r r "," r r rrr r"," rr r rr r"," r rr r rr "," r rr rr "," r r r r"," r r r r"," r r r r "," rr r r "," r r r r "," r rr rr "," rr rr r "," rr r rr rr "," rrr rr r "," r r rr r "," rr r rrr "," r rrr rrr"," rr rrr r "," r rr rrr rr"," rr r r"," rr r rr rr"," rr r r"," rrr r r "," r r rrr r "," r rr r rr r"," rrr rr r "," rr rrr r r"," r rrr r r"," rrr rrr rr "," rr rrr rr "," rr r r r"," r rrr r r"," rr r rr"," rr r r r rr"," rr rr r r"," rr rrr rr"," rr r r r"," rrr r rrr "," r r rrr r "," rrr rr r "," rr r r rrr"," r rr rr rrr"," rr r r "," r r rr r "," r rr rrr"," r r r rr rr"," r r rrr "," r r rrr "," rr rrr rrr"," r r rrr "," rr r rr r r"," rr rr rrr"," rrr r rr "," rr rr rr"," r r r r rr"," rr r rrr"," r rr r r r"," rr r r rr "," rrr rrr r"," rrr rr rr "," r r r r "," rr r rrr "," r rrr r r"," r rr r "," rr r r "," r r r rr"," r rrr rr "," r r r r r r"," r r rrr "," rr r rr"," rr r r r "," rr rrr r "," rr rrr r"," r r r "," rrr r rr"," rr rr r"," r rr r "," r rr r "," rr rr rr"," r rr rrr "," r rrr r r"," rr rr r r"," rrr rrr "," r rrr rrr"," rr r rrr r"," rr rr r r"," r rr r r"," r r rrr r"," r r r r"," rr rrr rrr "," r rr r r "," rr rr "," rr r rr "," r rr rrr r"," rr r r r "," rr r r r "," r rr r rr"," r rrr rr r"," rr r r r"," r rr r rrr"," rr r r r r"," rrr rrr r"," r rr rrr "," r r rrr r"," r r rr rr "," r r r r"," rr rr rr "," r rr r r "," r rr rr r"," rrr rrr rr"," rr rrr r r"," r rr r r"," r rr r rrr"," r r rr r"," r r r r r "," r r r r r "," r r r rr"," r r rr r "," r r rr rr"," r r r rrr r"," rr r rr rr"," r r rr r"," r r rr rr"," r r r r"," r r rrr r"," r rrr r rrr"," r r rr rr"," r r r rr"," r rr r "," r rr rrr "," r r r "," rrr r r rr"," r rrr r "," r r r r "," r rr r r"," r r rr r"," r r r rr "," rrr r r"," rr r r "," rrr r r r "," rr r r "," rr rr r "," r rr r r "," r r r rrr"," r rr rr r"," r r r r "," r r r "," r r rrr r r"," r rr r rr"," r rr r "," rrr r r "," r rr rr rr"," r rr r rr"," rr rrr "," rr rrr rr "," rrr r rr "," rrr r rr r"," r r rr rrr "," r r r r r"," rrr r rrr r"," rr r r rr "," rrr r r"," r rr r r"," rr rr r "," rr rr rrr "," r r r rrr"," rr rr rr "," rrr r rrr"," r rr rr r "," r rrr r "," r r rr "," rr r r r "," r r rr "," r r r r "," r rrr r"," rr rrr r "," rr rrr rr "," rr r r r"," rrr rr r"," r r r r rr"," r r rr r"," rrr rr r "," rr rrr rrr"," r rr rr "," rr rr "," r r rrr "," r r rr r"," r r rr r "," r r rr r r "," r r rr rrr"," r rrr rrr"," rrr r r "," r r r r r"," rr rr r rr"," rr r rrr "," rr r r r "," r r r rr"," rrr rr rrr"," r r r rrr"," r r rr r"," r r rr r "," r rrr rr"," r r rrr rr"," r r rr r r"," rr rr r r "," r rrr r"," rrr rr r r"," r rrr rr"," r rrr rr "," r rr r "," rrr r r r"," r r r r r"," r r r r"," r r r r r"," rr r r r"," r r r rr "," rrr rr r "," r rr rr r"," r rrr rr "," r rrr r rr "," rrr r r rr "," rrr rr "," rr r rr r"," r r r "," r rr r "," r rrr r"," rrr r rr r"," rr r rr"," r r rr r r"," r rrr r "," rr r r r"," rr r r "," r r rrr r"," rr rr r r r"," rrr rrr "," rr r r rrr"," rrr rr r"," r rr rrr "," rr r r "," rrr r r "," rr rrr r "," rr r r "," r rrr rrr"," r r rr "," rr rr rrr "," rrr rrr "," rrr r r r "," rrr r r r "," r r r rr"," r r rr r "," r rrr r "," r rr r r"," r r rr "," rr r rrr "," rr rr rr r "," r r r rrr"," r rr rr rr"," r rrr r rr"," rr r r rr"," r r r r"," rr rr rrr "," r rrr r r"," r rr r r r "," r r rr "," r rr r r "," rr rr r "," r rr r "," r rrr rr r"," r r rrr rr"," r r r "," r r r rr"," r r r rrr"," rr r r "," r r rrr "," r r r "," r r r r "," rr rr rr"," r rrr rr"," rr r rrr"," r rr rr r"," r r rr r"," rrr rr r"," r r r r rrr"," r rr rr "," r rr rrr "," rrr rrr r "," rr r r rr"," r r r r "," r r r "," rr rrr r"," r r r r "," rr r r "," r r rr r"," rrr r r r "," rr rr r r "," rrr r r r"," r r r r "," r rr r r"," rrr r "," rr r rr"," r rr rr "," rr rrr "," r r rr r"," rr rr rr"," rrr r rr"," rr r rr "," rrr rr rr"," rrr rr rrr "," r r rr r "," r r r rr "," r rrr r "," r r rrr "," rrr r rr "," rr r rr rr"," r r rr r"," r rr r r r"," r r rr r "," rr rr rrr"," rrr rr rr r"," r rr r "," r r r rr"," rrr rr r"," rr r rrr "," r rr rr r"," r r r rr r"," r rr r "," r r r r r "," rr r rr r "," r r rr r"," rr r r rr"," r r rrr"," r r r rr "," r r r rrr"," rr r rrr"," rrr r r "," r rrr r "," rr rrr rr"," r rr rr "," rr r rrr"," rr r rr "," r r r r r"," rr rr rr "," rr rrr rr"," rr r r "," r r r r "," rr r rr "," rrr r rr "," r rrr r r "," rr r r r r"," r rr r rr"," r rrr rr "," rr rr rr r"," r r r r"," rr rr r "," r r r r "," rr r rr r"," rr r rr r "," r r rr r "," rr rr rr "," rrr r r "," rr r r rr"," r r r "," rr r rrr"," rr r rrr "," r rrr r"," rrr r rrr"," rrr r r r"," rrr r r r"," r r r r"," r rr r rr "," rr r r r "," rr r r r"," r rrr rrr"," rr rr r rrr"," rr r r r "," rr rrr rr r"," rr r r r "," r r rrr r "," rr rrr rrr"," r r r r r "," r rrr rr"," rrr rr r "," r rr r r rr"," rrr r r r "," r rrr "," r rrr r "," r r rrr r"," r rrr r r"," rrr rr r"," rr r r rr r"," rr rr rrr"," r r r r r"," r r rrr "," rr r r r r"," r rr r r "," rr rr rrr r"," r rr rr "," rr rr r "," r r r r "," r rr r r "," rr rr r rr"," r r r "," rrr rrr r "," rr r rrr "," r rr r rr"," rrr rr rr "," rr rr rrr "," rr rr r r"," rr r r r "," r r r r"," rrr r "," r r r"," r rrr r"," r r r r"," r r rr r "," r r rr "," r r r "," rr r r "," r rr rrr"," r r r r "," r r rrr rr"," r r r r r"," r rrr rr"," rr r r r"," r rr rr "," r r rrr rr "," rrr r r r"," r rr r r "," r r rrr "," r rr r"," rr r r rr"," r r r rrr "," r r r r "," rrr r r r"," rr rrr r r"," rrr r rrr"," r rr rrr"," r rr r rrr"," rr rr r "," r rrr r r "," r rr rr"," r rr "," rrr r r rr"," rr rr r "," rr r rr "," r r r rr"," rrr r r "," rrr r r "," r r r r "," r r rrr r"," r r rr r"," r rr r r"," rr rrr r"," r r rr rrr"," r rr r r "," r rrr rrr "," rr rr r rr"," rrr rr r r "," r r r rr r"," rr rrr "," r rrr rrr"," rr rrr r "," rr r r r r"," rrr r rr rr"," r rrr rr"," r rrr r"," rr rr rrr"," r rr rrr "," r r rrr "," r rr rr "," rr rrr r"," r r r rr "," r r r rr "," rr rr rr "," rr r rr rr"," rrr rrr r r"," r rr rr"," r rr r rr "," rrr rr rr"," r r r rrr "," rr rr r r"," r r r rrr "," rrr rr rrr"," r r r r "," rr rr rr "," rr rrr r"," rr r r r "," rrr r rrr"," r rrr r "," rrr r r r"," rrr rr r r"," rrr rr r"," rr rrr r "," rr r r rr"," r r r "," rrr rrr r"," rr r r r"," r r rr "," r r r r rr"," r rrr rr r "," rr rr rr r"," r r rr "," r r r rr r"," r r rr r r"," r rr rr "," r rrr rr "," r r rr rr r"," r r rrr rrr"," rr rrr r "," r r r r r "," r r rr "," r rr r r"," r r rr r"," r r r r"," r rr r "," r r rrr rr"," rrr r rr r "," rrr r rrr"," r rrr rr "," r r rr r "," r rr rrr r"," r rr r r "," rr rr r r "," rr rr r "," r r r r r"," rr r rrr r "," r r rrr "," rr rrr rr"," r r r r"," rrr r r r"," r r r "," r rr rrr"," rr rrr rr"," rr rrr "," r r rr r rr"," r r r r r"," r r r rr "," r r rrr "," r rr rrr r"," rr rr r "," r r r "," r rr rr "," r r r "," r rr rr "," r r r r r"," r r r r "," r r rrr"," r r rr "," r r rr rr "," r rr rr rr "," r r r r"," r r r r"," r rr r "," rr r rr r "," rr rr r"," rr rrr r rr"," rrr rr rr"," r rrr r "," rrr rr r "," r r rrr"," r rr r "," rr rr r"," rrr r rr "," rr r rr r"," r r rrr r "," rr rr r r "," r rr r r"," r rr rr r"," r rr r rr "," rrr r rr"," r r r rrr"," rr r rr r"," rrr rr r"," rr r rrr r"," r rr r r"," rr r rr "," rr rr rr"," r r r r rr "," rr rr rr rr"," rr rrr r"," r rrr rr "," r r rr r"," r r r rrr"," r r rr r "," r r r rr "," r r r rr r "," r rrr r rr"," rrr rr rr "," rrr rrr rr"," r r rr rr"," r r rr "," r rr r r"," rr r r rr "," rr r r rr"," rr rr rr r"," rr r rr"," rr r r r "," r rrr rr "," rr r rr "," rr r rrr"," r rr r r"," rr r rr "," r rrr rrr "," rr r rr r"," rrr rrr "," r r rrr r"," rrr rr r r"," rr r r"," rr rrr rr"," rr r r r"," rr rrr "," rr r rrr rr"," rr r rr "," r rr rrr "," r r rr r r"," rr r r "," r r r "," r r rrr"," r r rr "," r r rrr"," rr r rr r "," rr rr r"," rr rrr r "," r r r "," r r r r"," rr rr r r"," r r r r "," r rr rr r "," rr rr rr "," rrr r rr"," r r rrr "," rrr rrr"," r r r r "," r r r r "," r rr rrr "," r rr rrr r"," rr r r rrr"," r r rrr "," rr r r r"," r r rr"," r rr rr r "," rrr r rr "," rrr r rrr "," rr r rrr "," rr r rrr "," r r r r r"," rrr rrr r"," r r rrr "," r rr r r "," rrr r r r r"," rr r r rrr "," rrr r "," rrr rr "," rrr rrr r "," rr r r r r"," r rr rr rr"," rr rrr r "," r r rr "," r r r r r"," rr rr r "," r r r r "," rr r r r"," rrr rrr "," r r rr r"," r rrr rr"," r r r r "," r r r r "," r r r r "," r rrr r "," r r r rrr"," r rrr r r"," r r rrr r "," r rrr "," r r r rr "," r rr rr "," r r r rr r"," r rr r rrr "," r rrr r r"," r rr rr "," r r r r "," r r rrr r"," rrr r r"," r r r rr"," r r r rrr "," r r r rr"," rr r r rr "," rr r r rr"," r rr rr"," rrr r r rr"," rrr r r "," rrr r rr "," rr rr rrr"," rr rrr r"," r r r rr"," rr r rr "," r r r rr"," r rr rr r r"," r rr r r "," r rr r rr"," r r rr rr"," r r rr rr "," rrr r rrr "," r r rrr "," rr r r r"," rr rrr r r "," rrr rr r rr"," r rr rrr "," r rr r rr"," r r r rrr "," rr r r "," rrr r rrr "," rrr r r r"," rrr r r r"," r r r rr "," r r r r rr"," r rr r r"," rrr r r rr"," rr rr r "," rrr rrr r"," rrr r rr"," r rr rr r"," r rr rr r "," r rr rrr r "," r rr rr"," rr rrr r r"," rr r rr rrr"," rr r r "," r rr r"," r rr r r "," rrr rr r "," r r rr rr "," r rr r "," rr r r rr"," rr r rrr "," rrr r r "," r rrr rrr r"," r r rr r"," r rr rrr "," rrr r rr"," r r r rr "," r rr rr"," rr r rr "," rrr rr r r"," rr r r "," r rrr r "," r r rr rr"," rrr r r"," rr r rr r"," rr r r rr"," r r r rr "," r r rr"," rrr rrr rr"," r r r r r"," rrr rrr "," r r r rr"," rrr r r "," rrr rrr "," rr rr rr"," rrr rr r "," r r r r "," r rrr r "," rrr r r rrr"," r rrr r "," rrr r rr "," r r r r "," rr r "," rr rr rr "," r rr r r "," r r r rr "," r r r r r"," rrr rrr rrr"," r r rr r r"," r r rr rr"," r r r r "," rr rr r r"," r rr rr r"," rrr rr "," rrr r r"," r rr rrr"," r r rr "," rr rr rr "," r r rr r "," r r rr r "," r rr r "," r r rrr"," r r r rr r"," r rrr r rr"," rr rr r r"," rr r rrr r"," rr r rr r"," r rr rr "," rrr r rrr"," r r r rr"," r r rr"," rr r r r"," rr rr r r "," rr rr r r"," rrr rr rr"," r rr rr "," r rrr rr r"," r r rr "," r rrr r r "," r rr r r r"," r r r rrr"," rr r r r r "," rr rr rr"," rr rrr "," r rrr r rr"," r r rr r "," r rr r rrr"," r r rr "," r rr r "," r rr rr r "," rr r rr"]},kie=function(e){return xw.useMemo((function(){var t=Cie[e];return t[Math.floor(Math.random()*t.length)]}),[e])},Sie=function(e){return xw.createElement("svg",Ry({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xw.createElement("path",{d:"M17.2434 6.06389L17.2438 6.06352C17.4385 5.86879 17.7519 5.86879 17.9467 6.06352C18.1314 6.24826 18.1314 6.57168 17.9467 6.75642L13.0567 11.6464L12.7031 12L13.0567 12.3535L17.9467 17.2435C18.1414 17.4383 18.1414 17.7517 17.9467 17.9464C17.7519 18.1412 17.4385 18.1412 17.2438 17.9464L12.3538 13.0564L12.0002 12.7029L11.6467 13.0564L6.75666 17.9464C6.56192 18.1412 6.24851 18.1412 6.05377 17.9464C5.85903 17.7517 5.85903 17.4383 6.05377 17.2435L10.9438 12.3535L11.2973 12L10.9438 11.6464L6.05377 6.75642C5.85903 6.56168 5.85903 6.24826 6.05377 6.05352C6.24851 5.85879 6.56192 5.85879 6.75666 6.05352L11.6467 10.9435L11.9999 11.2967L12.3534 10.9439L17.2434 6.06389Z",fill:"#5E5E5E",stroke:"#1D1D1D"}))},Eie=function(e){var t,r=(Py(t={},gne.FAR_FACE,0),Py(t,gne.CLOSE_FACE,0),Py(t,gne.FLASHING,0),t);return e.forEach((function(e){var t;null!=e&&null!==(t=e.metadata)&&void 0!==t&&t.type&&(r[e.metadata.type]+=1)})),r},Bie=xw.createContext({}),_ie=function(e){var t=e.apiCredentials,r=e.children,n=fq.useApiClient({apiCredentials:t}).apiClient;return xw.createElement(Bie.Provider,{value:n},r)};_ie.propTypes={apiCredentials:xC.shape({accessKey:xC.string.isRequired,secretKey:xC.string.isRequired,apiUrl:xC.string.isRequired}),children:xC.node.isRequired},_ie.defaultProps={apiCredentials:{}};var xie=function(){return xw.useContext(Bie)},Tie=function(){var e=[];return{uploadFrameBatch:function(t,r){e.push(r.httpClient.post("/v1/files",{frames:t,metadata:JSON.stringify({type:"selfie"})}))},getAllUploadedBatches:function(){var t=xy(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e);case 2:return r=t.sent,t.abrupt("return",r.map((function(e){var t,r;return{id:null!==(t=null==e||null===(r=e.data)||void 0===r?void 0:r.file_id)&&void 0!==t?t:-1}})));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),resetUploadBatches:function(){e.length=0}}},Aie=Tie();function Iie(){this.__data__=new _2,this.size=0}var Pie=Iie;function Rie(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Die=Rie;function Oie(e){return this.__data__.get(e)}var Nie=Oie;function Lie(e){return this.__data__.has(e)}var Mie=Lie,Fie=200;function Uie(e,t){var r=this.__data__;if(r instanceof _2){var n=r.__data__;if(!T2||n.length<Fie-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new H2(n)}return r.set(e,t),this.size=r.size,this}var jie=Uie;function Vie(e){var t=this.__data__=new _2(e);this.size=t.size}Vie.prototype.clear=Pie,Vie.prototype.delete=Die,Vie.prototype.get=Nie,Vie.prototype.has=Mie,Vie.prototype.set=jie;var zie=Vie;function qie(e,t,r){(void 0!==r&&!f2(e[t],r)||void 0===r&&!(t in e))&&t4(e,t,r)}var Hie=qie;function Wie(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===r(i[c],c,i))break}return t}}var Kie=Wie,Qie=Kie(),Gie=Qie,Xie=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?j3.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}})),Yie=j3.Uint8Array,$ie=Yie;function Zie(e){var t=new e.constructor(e.byteLength);return new $ie(t).set(new $ie(e)),t}var Jie=Zie;function eae(e,t){var r=t?Jie(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var tae=eae;function rae(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var nae=rae,oae=Object.create,iae=function(){function e(){}return function(t){if(!h0(t))return{};if(oae)return oae(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),aae=iae;function sae(e){return"function"!=typeof e.constructor||U8(e)?{}:aae(J8(e))}var cae=sae;function uae(e){return i0(e)&&R4(e)}var lae=uae;function dae(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var fae=dae;function pae(e){return s4(e,Q8(e))}var hae=pae;function mae(e,t,r,n,o,i,a){var s=fae(e,r),c=fae(t,r),u=a.get(c);if(u)Hie(e,r,u);else{var l=i?i(s,c,r+"",e,t,a):void 0,d=void 0===l;if(d){var f=N3(c),p=!f&&J4(c),h=!f&&!p&&R8(c);l=c,f||p||h?N3(s)?l=s:lae(s)?l=nae(s):p?(d=!1,l=Xie(c,!0)):h?(d=!1,l=tae(c,!0)):l=[]:s6(c)||Y4(c)?(l=s,Y4(s)?l=hae(s):h0(s)&&!w0(s)||(l=cae(c))):d=!1}d&&(a.set(c,l),o(l,c,n,i,a),a.delete(c)),Hie(e,r,l)}}var gae=mae;function vae(e,t,r,n,o){e!==t&&Gie(t,(function(i,a){if(o||(o=new zie),h0(i))gae(e,t,a,r,vae,n,o);else{var s=n?n(fae(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),Hie(e,a,s)}}),Q8)}var yae=vae,bae=j4((function(e,t,r){yae(e,t,r)})),wae=bae,Cae=xw.createContext({}),kae={},Sae=function(e){var t=e.children,r=e.clientSettings,n=e.apiCheck,o=Ky(xw.useState({}),2),i=o[0],a=o[1],s=xie();xw.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"function"==typeof s.clientSettings){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,s.clientSettings();case 5:t=e.sent,a(t),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),console.error(e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[s]);var c=kae;return Object.keys(r).length>0?c=r:n&&(c=i),xw.createElement(Cae.Provider,{value:c},t)};Sae.propTypes={children:xC.node.isRequired,clientSettings:xC.shape({}),apiCheck:xC.bool},Sae.defaultProps={clientSettings:{},apiCheck:!1};var Eae=function(){return xw.useContext(Cae)},Bae={data:{settings:{sdk_settings:{flash_liveness_settings:{capture_frame_settings:{enable:!1,frames_batch_length:10,frames_interval_time:0,frame_quality:.8,frame_scale:1},close_eyes_settings:{enable:!1,timeout:5},face_settings:{close_face_ratio:.82,max_far_face_ratio:.9,min_far_face_ratio:.8,mobile:{close_face_ratio:.95,max_far_face_ratio:.9,min_far_face_ratio:.85}},flash_settings:{colors_length:10,flash_color:"rgb(255, 0, 0)",delay_between_colors:120,flash_intensity:1,frames_per_color:4,use_face_detector_when_flashing:!1},liveness_settings:{enable_far_step:!0},timeout_settings:{enable:!0,total:30,countdown:10},exif_data_settings:{enable:!0},mask_settings:{chin_to_mask_bottom_padding:20,large_scale:.85,mobile:{chin_to_mask_bottom_padding:20,large_scale:.9,oval_padding:{bottom:20,left:20,right:20,top:0},oval_vertical_offset:60,small_scale:.65},oval_padding:{bottom:20,left:30,right:30,top:0},oval_vertical_offset:0,small_scale:.6},image_settings:{valid_face_ratio:.6,image_quality:1,crop_center_far:!0,crop_center_close:!1},blur_far_settings:{enable:!0,blurry_threshold:.4,duration_ms:1e3},blur_close_settings:{enable:!0,blurry_threshold:.4,duration_ms:1e3}}}}}},_ae=function(){var e=Eae();return xw.useMemo((function(){var t=wae({},Bae,e);return{captureFrameSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.enable"),framesIntervalTime:y1(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frames_interval_time"),framesBatchLength:y1(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frames_batch_length"),frameScale:y1(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_scale"),frameQuality:y1(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_quality")},livenessSettings:{enableFarStep:y1(t,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.enable_far_step")},flashSettings:{flashColor:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_color"),colorsLength:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.colors_length"),delayBetweenColors:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.delay_between_colors"),framesPerColor:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.frames_per_color"),flashIntensity:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_intensity"),useFaceDetectorWhenFlashing:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.use_face_detector_when_flashing")},maskSettings:{smallScale:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.small_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.small_scale"),largeScale:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.large_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.large_scale"),ovalPadding:{left:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.left":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.left"),right:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.right":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.right"),top:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.top":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.top"),bottom:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.bottom":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.bottom")},ovalVerticalOffset:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_vertical_offset":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_vertical_offset"),chinToMaskBottomPadding:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.chin_to_mask_bottom_padding":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.chin_to_mask_bottom_padding")},faceSettings:{minFarFaceRatio:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.min_far_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.min_far_face_ratio"),maxFarFaceRatio:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.max_far_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.max_far_face_ratio"),closeFaceRatio:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.close_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.close_face_ratio")},closeEyesSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.enable"),timeout:y1(t,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.timeout")},exifSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.exif_data_settings.enable")},imageSettings:{imageQuality:y1(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_quality"),validFaceRatio:y1(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.valid_face_ratio"),enableCropCenterFar:y1(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.crop_center_far"),enableCropCenterClose:y1(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.crop_center_close")},timeoutSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.timeout_settings.enable"),total:y1(t,"data.settings.sdk_settings.flash_liveness_settings.timeout_settings.total"),countdown:y1(t,"data.settings.sdk_settings.flash_liveness_settings.timeout_settings.countdown")},blurCheckFarSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_far_settings.enable"),threshold:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_far_settings.blurry_threshold"),duration:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_far_settings.duration_ms")},blurCheckCloseSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_close_settings.enable"),threshold:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_close_settings.blurry_threshold"),duration:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_close_settings.duration_ms")}}}),[e])},xae=function(e){return Array.isArray(e)?e.map((function(e){return{base64:e.base64,label:e.label,index:e.index,metadata:e.metadata}})):e},Tae=function(e){var t=e.maskBoundingBox,r=e.faceRatio,n=e.validFaceRatio,o=e.video,i=e.shouldCropCenterSquare,a=void 0===i||i,s=e.cropArea,c=e.frame,u=t.width*r/n,l=u/t.width,d=t.height*l,f={x:t.x-(u-t.width)/2,y:t.y-(d-t.height)/2,width:u,height:d};f.x+f.width>s.x+s.width&&(f.width=s.width,f.x=s.x),f.y+f.height>s.y+s.height&&(f.height=s.height,f.y=s.y);var p=null;if(a){var h=Math.min(f.width,f.height),m={x:f.x+f.width/2,y:f.y+f.height/2},g={x:m.x-h/2,y:m.y-h/2,width:h,height:h};p=xV.analyzeVideoAndWindowSizes(o,g)}else p=xV.analyzeVideoAndWindowSizes(o,f);var v=jne({size:{width:p.cropWidth,height:p.cropHeight},baseSize:400,video:o}),y=_ne({width:v.width,height:v.height,cameraScale:1}),b=y.width,w=y.height;return y.getContext("2d").drawImage(c,p.cropX,p.cropY,p.cropWidth,p.cropHeight,0,0,b,w),y},Aae=function e(t){if("object"!==By(t)||null===t||Array.isArray(t))return t;var r={};return Object.keys(t).forEach((function(n){var o=n.replace(/([A-Z]+)/g,"_$1").toLowerCase(),i=t[n];"object"===By(t[n])&&(i=e(t[n])),r[o]=i})),r},Iae=xw.createContext({enable:!1,key:""}),Pae=function(e){var t=e.children,r=e.settings,n=xw.useMemo((function(){var e,t=null!==(e=null==r?void 0:r.key)&&void 0!==e?e:"";return{enable:!!t,key:t}}),[null==r?void 0:r.key]);return xw.createElement(Iae.Provider,{value:n},t)};Pae.propTypes={children:xC.node.isRequired,settings:xC.shape({key:xC.string})},Pae.defaultProps={settings:{key:""}};var Rae,Dae,Oae,Nae,Lae,Mae,Fae,Uae,jae,Vae,zae,qae,Hae,Wae,Kae=function(){return xw.useContext(Iae)},Qae=function(e,t){var r=null,n=null,o=function(){return null!==n&&performance.now()-n>t};return{checkIsTimeUp:o,compareAndStoreResult:function(t){(null===r&&(r=t,n=performance.now()),o())||e(r,t)&&(r=t)},getBestResult:function(){return r},reset:function(){r=null,n=null}}},Gae=function(e){var t=e.compareFn,r=e.duration,n=xw.useRef(null),o=xw.useMemo((function(){return Qae(t,r)}),[t,r]),i=o.compareAndStoreResult,a=o.getBestResult,s=o.reset,c=xw.useCallback((function(){return null!==n.current}),[]),u=xw.useCallback((function(e){var t=e.onTimeout,o=e.initialFrame;i(o),n.current=setTimeout((function(){var e=a();t(e),s(),n.current=null}),r)}),[i,r,a,s]);return xw.useEffect((function(){return function(){clearTimeout(n.current)}}),[]),xw.useMemo((function(){return{compareAndStoreResult:i,getBestResult:a,isAutoCapturing:c,startCapturing:u}}),[i,a,c,u])},Xae=function(e){var t=document.createElement("canvas");return t.setAttribute("width",e.videoWidth),t.setAttribute("height",e.videoHeight),t.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),t},Yae=(dB.div(Rae||(Rae=Wy(["\n color: #ffffff;\n"]))),dB.div(Dae||(Dae=Wy(["\n ","\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.title.hidden",noe)?YE(["display:none;"]):YE(["display:flex;justify-content:center;align-items:center;width:100%;height:","};color:",";font-size:",";font-weight:",";"],t5(t,"FlashLiveness.title.height",noe),t5(t,"FlashLiveness.title.color",noe),t5(t,"FlashLiveness.title.fontSize",noe),t5(t,"FlashLiveness.title.fontWeight",noe))}))),$ae=dB(Coe)(Oae||(Oae=Wy(["\n z-index: 2010;\n width: 100%;\n height: 100%;\n opacity: 1;\n margin: 0;\n"]))),Zae=dB(uoe)(Nae||(Nae=Wy(["\n margin-block-start: 12px;\n z-index: ",";\n width: fit-content;\n\n & svg {\n margin-inline-end: 8px;\n width: 24px;\n height: 24px;\n }\n\n ","\n"])),s5+2,(function(e){var t=e.theme;return e.$flashing?YE(["transform:translateY(45vh);font-size:",";color:",";font-weight:",";background:rgba(0,0,0,0.35);border-radius:",";border:",";padding:",";"],t5(t,"FlashLiveness.guideline.text.flashing.fontSize",noe),t5(t,"FlashLiveness.guideline.text.flashing.color",noe),t5(t,"FlashLiveness.guideline.text.flashing.fontWeight",noe),t5(t,"FlashLiveness.guideline.text.flashing.borderRadius",noe),t5(t,"FlashLiveness.guideline.text.flashing.border",noe),t5(t,"FlashLiveness.guideline.text.flashing.padding",noe)):YE(["font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";padding:",";"],t5(t,"FlashLiveness.guideline.text.normal.fontSize",noe),t5(t,"FlashLiveness.guideline.text.normal.color",noe),t5(t,"FlashLiveness.guideline.text.normal.fontWeight",noe),t5(t,"FlashLiveness.guideline.text.normal.background",noe),t5(t,"FlashLiveness.guideline.text.normal.borderRadius",noe),t5(t,"FlashLiveness.guideline.text.normal.border",noe),t5(t,"FlashLiveness.guideline.text.normal.padding",noe))})),Jae=dB(Sie)(Lae||(Lae=Wy(["\n ","\n"])),(function(e){var t=e.theme;return YE(["z-index:1001;cursor:pointer;position:fixed;top:",";right:",";left:",";bottom:",";display:",";"],t5(t,"closeButton.top",e5),t5(t,"closeButton.right",e5),t5(t,"closeButton.left",e5),t5(t,"closeButton.bottom",e5),t5(t,"closeButton.display",e5))})),ese=dB.div(Mae||(Mae=Wy(["\n width: 100vw;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n background-color: ",";\n opacity: ",";\n z-index: ",";\n"])),(function(e){return e.$backgroundColor}),(function(e){return e.$intensity}),s5+1),tse=dB.div(Fae||(Fae=Wy(["\n background-color: ",";\n opacity: ",";\n width: 100vw;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.errorOverlay.backgroundColor",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.errorOverlay.opacity",noe)})),rse=dB(aoe)(Uae||(Uae=Wy(["\n margin-block-start: 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n width: 300px;\n z-index: 1002;\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.mainColor",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.fontSize",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.fontWeight",noe)})),nse=dB.div(jae||(jae=Wy(["\n position: fixed;\n z-index: ",";\n top: 0;\n left: 50%;\n transform: translate(-50%);\n min-width: 250px;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n"])),s5+2),ose=dB.div(Vae||(Vae=Wy(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),ise=dB.div(zae||(zae=Wy(["\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n"]))),ase=b1.isMobile?{width:{ideal:640},whiteBalanceMode:"none"}:{width:{ideal:9999},whiteBalanceMode:"none"},sse=function(e,t){return!(!e.isEyeClosed||t.isEyeClosed)||!(!e.isEyeClosed&&t.isEyeClosed)&&BV.hasBetterBlurScore(t.blurScore,e.blurScore)};function cse(e){var t=e.onReset,r=e.onFlashDone,n=e.apiCheck,o=e.onClose,i=e.onError,a=e.frontCamera,s=e.styledComponent,c=e.onFramesCaptured,u=_ae(),l=u.maskSettings,d=u.flashSettings,f=u.faceSettings,p=u.closeEyesSettings,h=u.livenessSettings,m=u.captureFrameSettings,g=u.exifSettings,v=u.imageSettings,y=u.timeoutSettings,b=u.blurCheckFarSettings,w=u.blurCheckCloseSettings;if(l.smallScale>l.largeScale)throw new Error("smallScale must be smaller than largeScale");var C=xie(),k=m.framesIntervalTime,S=xw.useRef(),E=hie(),B=pie(),_=xw.useContext(Rne),x=d.colorsLength,T=d.framesPerColor,A=d.delayBetweenColors,I=d.useFaceDetectorWhenFlashing,P=d.flashIntensity,R=d.flashColor,D=kie(x),O=mB(),N=Zne(k),L=xw.useRef(null),M=Ky(Boe(),4),F=M[0],U=M[1],j=M[2],V=M[3],z=Ky(xw.useState(0),2),q=z[0],H=z[1],W=Ky(xw.useState(mne.LOADING),2),K=W[0],Q=W[1],G=Ky(xw.useState(""),2),X=G[0],Y=G[1],$=Ky(xw.useState(!1),2),Z=$[0],J=$[1],ee=xw.useRef({frames:[],images:[],total:Py({},gne.FAR_FACE,0)}),te=xw.useRef(!1),re=Kae(),ne=Gae({compareFn:sse,duration:b.duration}),oe=Gae({compareFn:sse,duration:w.duration}),ie=Ky(xw.useState(!1),2),ae=ie[0],se=ie[1],ce=_oe({mode:lW.MODE.SELFIE,enableWriteExif:g.enable}),ue=ce.prepareExifData,le=ce.writeExifData,de=ce.addExifData,fe=Ky(xw.useState(!1),2),pe=fe[0],he=fe[1],me=xw.useCallback((function(){Y(B("move_face_into_frame"))}),[B]),ge=Qne({onVideoPlayed:me}),ve=ge.onVideoPlayed,ye=ge.cropArea,be=ge.isPlaying,we=koe(l,voe,{width:ye.width,height:ye.height}),Ce=we.smallScale,ke=we.largeScale,Se=xw.useMemo((function(){return G5((function(e){var r=e.reason;ee.current.frames=[],ee.current.images=[],ee.current.total[gne.FAR_FACE]=0,Aie.resetUploadBatches(),h.enableFarStep&&(H(Ce),Q(mne.FAR_FACE)),Y(B("move_face_into_frame")),J(!1),te.current=!1,t({reason:r})}),200,{leading:!0})}),[H,Ce,B,h.enableFarStep,t]),Ee=xw.useCallback((function(){he(!0)}),[]),Be=xw.useCallback((function(){he(!1),Se({reason:Cne.timeout})}),[Se]),_e=Soe({offset:l.ovalVerticalOffset,ovalPadding:l.ovalPadding,largeScale:ke,maskHeight:ye.height,ovalHeight:voe.height}),xe=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t,o,a,s,u,d,p,g,v,y,b,w,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Q(mne.STOP_DECTECTING),Y(""),E("selfie_flash","user_activity.finish_flash"),E("selfie_flash","user_activity",(function(e){return{flash_liveness_in_ms:e.lastTimeLog-S.current}})),t=ee.current.frames,m.enable&&m.framesBatchLength>0&&0!==(o=t.length%m.framesBatchLength)&&(a=t.slice(-1*o),"function"==typeof c&&c(a),n&&Aie.uploadFrameBatch(xae(a),C)),s=Eie(t),!h.enableFarStep){e.next=12;break}return ee.current.images[wne].frames=ee.current.total[gne.FAR_FACE],e.next=11,ee.current.images[wne].blob;case 11:ee.current.images[wne].blob=e.sent;case 12:return ee.current.images[bne].frames=s[gne.CLOSE_FACE],e.next=15,ee.current.images[bne].blob;case 15:return ee.current.images[bne].blob=e.sent,ue(),de("selfie_type",uL.Mode.FLASH),de("flash_liveness_in_ms",performance.now()-S.current),de("far_batches",ee.current.total[gne.FAR_FACE]),de("close_batches",s[gne.CLOSE_FACE]),de("flash_batches",s[gne.FLASHING]),de("colors",D),de("flash_color",R),de("frames_per_color",T),de("frame_interval",k),de("delay_between_colors",A),de("use_face_detector_when_flashing",I),de("face_settings",Aae(f)),de("mask_settings",Aae(l)),e.next=32,Promise.all([le({imageData:ee.current.images[wne]}),le({imageData:ee.current.images[bne]})]);case 32:if(u=e.sent,d=Ky(u,2),p=d[0],g=d[1],h.enableFarStep&&(ee.current.images[wne].blob=p),ee.current.images[bne].blob=g,!re.enable){e.next=54;break}if(!h.enableFarStep){e.next=50;break}return e.next=42,Promise.all([Wq.encrypt({blob:ee.current.images[wne].blob,key:re.key}),Wq.encrypt({blob:ee.current.images[bne].blob,key:re.key})]);case 42:v=e.sent,y=Ky(v,2),b=y[0],w=y[1],ee.current.images[wne].encrypted=b,ee.current.images[bne].encrypted=w,e.next=54;break;case 50:return e.next=52,Wq.encrypt({blob:ee.current.images[bne].blob,key:re.key});case 52:B=e.sent,ee.current.images[bne].encrypted=B;case 54:if(ee.current.images=ee.current.images.filter((function(e){return!!e})),e.prev=55,"function"!=typeof r){e.next=59;break}return e.next=59,r({images:ee.current.images,frames:ee.current.frames},{colors:D,flashColor:R});case 59:e.next=64;break;case 61:e.prev=61,e.t0=e.catch(55),i({error:e.t0});case 64:case"end":return e.stop()}}),e,null,[[55,61]])}))),[E,m.enable,m.framesBatchLength,h.enableFarStep,ue,de,D,R,T,k,A,I,f,l,le,re.enable,re.key,c,n,C,r,i]),Te=Wne({colors:D,onFlashDone:xe,framesPerColor:T,flashColor:R}),Ae=Te.flashingColors,Ie=Te.currentColor,Pe=Te.colorIndex,Re=Te.startFlashing,De=Te.goToNextColor,Oe=Te.colorIndexRef,Ne=xw.useCallback((function(){h.enableFarStep&&0===ee.current.total[gne.FAR_FACE]&&(te.current=!0,J(!0)),ee.current.total[gne.FAR_FACE]+=1}),[h.enableFarStep]),Le=xw.useMemo((function(){return{x:Math.max(null==U?void 0:U.left,0),y:Math.max(null==U?void 0:U.top,0),width:Math.min((null==U?void 0:U.right)-(null==U?void 0:U.left),ye.width),height:Math.min((null==U?void 0:U.bottom)-(null==U?void 0:U.top),ye.height)}}),[ye.height,ye.width,null==U?void 0:U.bottom,null==U?void 0:U.left,null==U?void 0:U.right,null==U?void 0:U.top]),Me=xw.useCallback((function(e){var t=e.frame;if(!ee.current.images[wne]){var r=function(e){var t=Tae({maskBoundingBox:Le,faceRatio:e.faceRatio,validFaceRatio:v.validFaceRatio,video:L.current,shouldCropCenterSquare:v.enableCropCenterFar,cropArea:ye,frame:e.snapshot});ee.current.images[wne]={blob:xV.takePicture({canvas:t,quality:v.imageQuality}),gesture:"frontal",capture_time:e.captureTime,step:gne.FAR_FACE,blurScore:e.blurScore},H(ke),V(!0),Q(mne.CLOSE_FACE),Y(B("move_face_closer"))},n={blurScore:t.blurScore,isEyeClosed:t.isEyeClosed,faceRatio:t.faceRatio,snapshot:Xae(L.current),captureTime:Date.now()};if(b.enable)return ne.isAutoCapturing()?void ne.compareAndStoreResult(n):(se(!0),void ne.startCapturing({onTimeout:function(e){se(!1),r(e)},initialFrame:n}));r(n)}}),[b.enable,ne,Le,v.validFaceRatio,v.enableCropCenterFar,v.imageQuality,ye,ke,V,B]),Fe=xw.useCallback((function(e){var t=e.frame;if(!ee.current.images[bne]){var r=function(e){var t=Tae({maskBoundingBox:Le,faceRatio:e.faceRatio,validFaceRatio:v.validFaceRatio,video:L.current,shouldCropCenterSquare:v.enableCropCenterClose,cropArea:ye,frame:e.snapshot});ee.current.images[bne]={blob:xV.takePicture({canvas:t,quality:v.imageQuality}),gesture:"frontal",capture_time:e.captureTime,step:gne.CLOSE_FACE,blurScore:e.blurScore},J(!1),Q(mne.START_FLASHING),Re()},n={blurScore:t.blurScore,isEyeClosed:t.isEyeClosed,faceRatio:t.faceRatio,snapshot:Xae(L.current),captureTime:Date.now()};if(w.enable)return oe.isAutoCapturing()?void oe.compareAndStoreResult(n):(se(!0),void oe.startCapturing({onTimeout:function(e){se(!1),r(e)},initialFrame:n}));r(n)}}),[w.enable,oe,Le,v.validFaceRatio,v.enableCropCenterClose,v.imageQuality,ye,Re]),Ue=Pe!==Hne&&K===mne.START_FLASHING,je=xw.useCallback((function(e){var t=e.prediction,r=e.canvas,o=e.landmarks;if(Ue){var i=ee.current.frames,a=Gne({prediction:t,canvas:r,landmarks:o,index:i.length,quality:m.frameQuality});if(a.metadata=JSON.stringify({color:Ie,type:gne.FLASHING,time:Math.round(performance.now()),colorIndex:Oe.current}),i.push(a),m.enable&&m.framesBatchLength>0&&i.length%m.framesBatchLength==0){var s=i.slice(-1*m.framesBatchLength);"function"==typeof c&&c(s),n&&Aie.uploadFrameBatch(xae(s),C)}De()}}),[n,C,m.enable,m.frameQuality,m.framesBatchLength,Ie,De,Ue,c,Oe]),Ve=xw.useCallback((function(e){var t=e.error;"no_face"!==t&&"multiple_faces"!==t||"no_face"===t&&te.current&&Se({reason:Cne.no_face})}),[Se]),ze=xw.useCallback((function(e){var t=e.prediction,r=e.canvas,o=e.landmarks,i=ee.current.frames;h.enableFarStep||0!==i.length||(te.current=!0,J(!0));var a=Gne({prediction:t,canvas:r,landmarks:o,index:i.length,quality:m.frameQuality});if(a.metadata=JSON.stringify({color:"",type:gne.CLOSE_FACE,time:Math.round(performance.now()),colorIndex:Oe.current}),i.push(a),m.enable&&m.framesBatchLength>0&&i.length%m.framesBatchLength==0){var s=i.slice(-1*m.framesBatchLength);"function"==typeof c&&c(s),n&&Aie.uploadFrameBatch(xae(s),C)}}),[n,C,m.enable,m.frameQuality,m.framesBatchLength,h.enableFarStep,c,Oe]),qe=xw.useMemo((function(){return Pe===Hne?N:Pe%T==0?Ae[Pe-1]===Ae[Pe]?N:Math.max(A,N):N}),[Pe,A,Ae,N,T]),He=zne({onError:i,isVideoPlaying:be,step:K,cropArea:ye,videoRef:L,onFarFaceDetected:Ne,onFarFullFaceDetected:Me,onCloseFaceDetected:ze,onCloseFullFaceDetected:Fe,onFlashingFramesCaptured:je,frameInterval:qe,useFaceDetectorWhenFlashing:I,onFaceError:Ve,faceSettings:f,maskBoundingRect:U,shouldPauseFaceDetection:j||pe,maskSettings:l,closeEyesSettings:p,captureFrameSettings:m,blurSettings:{blurCheckFarSettings:b,blurCheckCloseSettings:w},shouldContinueOnError:ae}),We=He.faceError,Ke=He.warmupDone;Eoe(L.current);mie((function(){h.enableFarStep?(Q(mne.FAR_FACE),H(Ce)):(Q(mne.CLOSE_FACE),H(ke)),S.current||(S.current=performance.now())}),Ke&&be),mie((function(){return E("selfie_flash","user_activity.start")}),!0),mie((function(){return E("selfie_flash","user_activity.start_far")}),K===mne.FAR_FACE),mie((function(){return E("selfie_flash","user_activity.start_close")}),K===mne.CLOSE_FACE),mie((function(){return E("selfie_flash","user_activity.start_flash")}),K===mne.START_FLASHING);var Qe=Pe===Hne?0:Math.min(Math.round((Pe+1)/(D.length*T)*100),100),Ge=s.CloseCameraButton,Xe=s.Loading;return xw.createElement(xw.Fragment,null,xw.createElement(w5,{frontCamera:a,onVideoPlayed:ve,onClose:o,flipHorizontal:a,ref:L,onError:i,videoSettings:ase,closeButton:null!=Ge?Ge:xw.createElement(Jae,null)},xw.createElement(goe,{overlay:!Ke||!be,loadingComponent:Xe},""!==We&&xw.createElement(tse,null),xw.createElement(x5,{x:"".concat(Math.round(ye.x),"px"),y:"".concat(Math.round(ye.y),"px"),width:"".concat(ye.width,"px"),height:"".concat(ye.height,"px"),surroundStyle:{background:t5(O,"FlashLiveness.maskFill",noe)}},xw.createElement($ae,{ref:F,scale:q,debug:_,width:ye.width,height:ye.height,padding:l.ovalPadding,verticalOffset:_e,ovalMaskFillColor:t5(O,"FlashLiveness.maskFill",noe)}),xw.createElement(ise,null,""!==We&&K!==mne.FLASHING&&xw.createElement(foe,null,B(We)))))),xw.createElement(nse,null,xw.createElement(ose,null,Ke&&be&&K!==mne.START_FLASHING&&xw.createElement(Yae,null,B("face_authentication")),K!==mne.LOADING&&X&&xw.createElement(Zae,{$flashing:K===mne.START_FLASHING},K===mne.START_FLASHING?B("hold_still"):xw.createElement(xw.Fragment,null,xw.createElement(Jne,{iconColor:t5(O,"FlashLiveness.guideline.icon.color",noe)})," ",X)),K===mne.START_FLASHING&&xw.createElement(rse,{value:Qe,max:100})),xw.createElement(wie,{onTimeout:Ee,onWarningMessageTimeout:Be,timeout:y.total,shouldStart:y.enable&&Z,shouldStop:y.enable&&!Z,timeLeftThreshold:y.countdown})),K===mne.START_FLASHING&&xw.createElement(ese,{$backgroundColor:Ie,$intensity:P}))}var use=dB.div(qae||(qae=Wy(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n\n z-index: 1001;\n"]))),lse=dB.div(Hae||(Hae=Wy(["\n & > img {\n width: 100%;\n }\n\n ","\n"])),Bte),dse=dB.p(Wae||(Wae=Wy(["\n color: #1d1d1d;\n font-size: 20px;\n"]))),fse=function(e){var t=e.loading,r=Jj.useAsset("loader.jpg"),n=pie();return t?xw.createElement(use,null,xw.createElement(lse,null,xw.createElement("img",{src:r,className:"spin",alt:"loading-icon"})),xw.createElement(dse,null,n("processing_result"))):null};function pse(e){var t=e.outputEncryptionSettings,r=xie();return{verifyFlashLiveness:xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var o,i,a,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.videos,i=n.images,a=n.enableFarStep,s=n.metadata,e.prev=1,e.next=4,Promise.all(i.map((function(e){var n;return t.enable?r.httpClient.post("/v1/images",{label:"portrait",base64:null===(n=e.encrypted)||void 0===n?void 0:n.hex},{"X-TV-Key":t.key}):r.uploadImage({label:"portrait",file:e.blob})})));case 4:return c=e.sent,u=[r.verifyFaceLiveness({images:c.map((function(e){var t;return{id:null==e||null===(t=e.data)||void 0===t?void 0:t.image_id,label:"portrait"}})),videos:o,metadata:s,selfie_type:uL.Mode.FLASH})],a&&u.push(r.requestVerifyPortrait({image:{id:null===(l=c[wne])||void 0===l||null===(d=l.data)||void 0===d?void 0:d.image_id},selfie_type:uL.Mode.FLASH})),e.next=9,Promise.all(u);case 9:return f=e.sent,p=Ky(f,2),h=p[0],m=p[1],e.abrupt("return",{uploadedImages:c,faceLivenessResult:h,portraitResult:m});case 16:return e.prev=16,e.t0=e.catch(1),console.error(e.t0),e.abrupt("return",{});case 20:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),[r,t.enable,t.key])}}fse.propTypes={loading:xC.bool},fse.defaultProps={loading:!1};var hse=["apiCheck","onLivenessDetectionDone","frontalMinSize"],mse=function(e){var t=e.apiCheck,r=e.onLivenessDetectionDone,n=e.frontalMinSize,o=Vy(e,hse),i=Ky(xw.useState(!1),2),a=i[0],s=i[1],c=pse({outputEncryptionSettings:Kae()}).verifyFlashLiveness,u=_ae(),l=u.captureFrameSettings,d=u.flashSettings,f=u.livenessSettings,p=l.framesIntervalTime,h=f.enableFarStep,m=e.onError,g=function(){var e=xy(regeneratorRuntime.mark((function e(o,i){var a,u,f,g,v,y,b,w,C,k,S,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a={flash_color:i.flashColor,colors:i.colors,frames_per_color:d.framesPerColor,frame_interval:p,delay_between_colors:d.delayBetweenColors,use_face_detector_when_flashing:d.useFaceDetectorWhenFlashing},u=o.images.filter((function(e){return"frontal"===e.gesture})),f=u.map((function(e){return e.blob})),g=u.map((function(e){return e.encrypted})),!(v=f[wne])||"number"!=typeof n){e.next=11;break}return e.next=8,Jz.scaleImage(v,{minsize:n});case 8:e.t0=e.sent,e.next=12;break;case 11:e.t0=null;case 12:if(y=e.t0,t){e.next=17;break}return e.next=16,r({capturedFrames:o.frames,frontalFaces:f,frontalFacesEncrypted:g,frontalScaledImage:y,steps:[],metadata:a});case 16:return e.abrupt("return");case 17:if(e.prev=17,s(!0),w=null,!l.enable){e.next=26;break}return e.next=23,Aie.getAllUploadedBatches();case 23:w=e.sent,e.next=27;break;case 26:w=[{frames:xae(o.frames)}];case 27:return e.next=29,c({videos:w,images:o.images,enableFarStep:h,metadata:a});case 29:if(C=e.sent,k=C.uploadedImages,S=C.faceLivenessResult,E=C.portraitResult,Aie.resetUploadBatches(),s(!1),!S.errors){e.next=37;break}throw S.errors;case 37:if(null==E||!E.errors){e.next=39;break}throw E.errors;case 39:return e.next=41,r({capturedFrames:o.frames,steps:[],frontalFaces:f.map((function(e,t){var r,n;return{blob:e,id:null===(r=k[t])||void 0===r||null===(n=r.data)||void 0===n?void 0:n.image_id}})),frontalFacesEncrypted:g,frontalScaledImage:y,apiCheckPassed:S.data.is_live,verifyFaceLivenessResult:S.data,verifyPortraitResult:null!==(b=null==E?void 0:E.data)&&void 0!==b?b:null});case 41:e.next=48;break;case 43:e.prev=43,e.t1=e.catch(17),console.error(e.t1),s(!1),m({error:e.t1});case 48:case"end":return e.stop()}}),e,null,[[17,43]])})));return function(t,r){return e.apply(this,arguments)}}();return xw.createElement(xw.Fragment,null,xw.createElement(cse,Ry({},o,{apiCheck:t,onFlashDone:g})),t&&xw.createElement(fse,{loading:a}))},gse=function(e){var t=e.value,r=e.children,n=Eae(),o=y1(n,"data.settings.sdk_settings.server_log_settings.enable"),i=null!=o?o:null==t?void 0:t.enable;return xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy(Oy({},t),{},{enable:i})}},r)};gse.propTypes={value:xC.shape({enable:xC.bool,accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}).isRequired,children:xC.node.isRequired};var vse,yse=function(e){var t=e.apiCheck,r=e.debug,n=e.clientSettings,o=e.apiCredentials,i=e.logCredentials,a=e.customTheme,s=e.outputEncryptionSettings;return xw.createElement(Dne,{debug:r},xw.createElement(_ie,{apiCredentials:o},xw.createElement(Sae,{apiCheck:t,clientSettings:n},xw.createElement(hne,null,xw.createElement(cB,{theme:a},xw.createElement(die,null,xw.createElement(gse,{value:Oy({enable:!0},i)},xw.createElement(Pae,{settings:s},xw.createElement(mse,e)))))))))};yse.propTypes={apiCheck:xC.bool,apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),onReset:xC.func,onLivenessDetectionDone:xC.func,onClose:xC.func,onError:xC.func,onFramesCaptured:xC.func,frontCamera:xC.bool,styledComponent:xC.shape({CloseCameraButton:xC.node}),clientSettings:xC.shape({}),logCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string,userId:xC.string,logSignature:xC.shape({logUrl:xC.string,timestamp:xC.string,signature:xC.string})}),debug:xC.bool,customTheme:xC.shape({}),outputEncryptionSettings:xC.shape({key:xC.string}),frontalMinSize:xC.number},yse.defaultProps={apiCheck:!1,apiCredentials:{},onReset:function(){},onLivenessDetectionDone:function(){},onClose:function(){},onError:function(){},onFramesCaptured:function(){},frontCamera:!0,styledComponent:{CloseCameraButton:null},clientSettings:{},logCredentials:{},debug:!1,customTheme:{},outputEncryptionSettings:{key:""},frontalMinSize:null};var bse,wse,Cse=KV.faceTracker(),kse=new Kq,Sse=uL.FaceDirection,Ese=uL.Errors,Bse=uL.Messages,_se=uL.TrackLivenessEvents,xse=-1,Tse=3,Ase=1,Ise={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(vse={},Py(vse,uL.FaceDirection.UP,{delayTime:0}),Py(vse,uL.FaceDirection.LEFT,{delayTime:0}),Py(vse,uL.FaceDirection.RIGHT,{delayTime:0}),Py(vse,uL.FaceDirection.FRONTAL,{delayTime:2e3}),vse),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}};function Pse(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,r=e.bgCameraMask,n=e.bgCameraMaskRed,o=e.surroundStyle,i=e.cropAreaDimension,a=e.customInstructions,s=e.customIcon,c=e.customDirectionIcon,u=e.customStepTimeConstraints,l=void 0===u?Ise.customStepTimeConstraints:u,d=e.onLivenessDetectionDone,f=e.onError,p=e.frontalMinSize,h=e.waitingTimeToGetBetterFrames,m=void 0===h?500:h,g=e.captureFrameSettings,v=void 0===g?Ise.captureFrameSettings:g,y=e.livenessSettings,b=e.setRemainingTime,w=void 0===b?Ise.setRemainingTime:b,C=e.onProcessing,k=void 0===C?Ise.onProcessing:C,S=e.customErrors,E=e.customMessages,B=e.apiCredentials,_=void 0===B?{}:B,x=e.onFramesCaptured,T=void 0===x?Ise.onFramesCaptured:x,A=e.initFirstGestureTimeout,I=void 0===A?2e3:A,P=e.outputEncryptionSettings,R=e.cameraScale,D=void 0===R?1:R,O=e.passiveModeAuto,N=void 0!==O&&O,L=e.sendCustomEvent,M=xw.useState(!1),F=Ky(M,2),U=F[0],j=F[1],V=xw.useState(!1),z=Ky(V,2),q=z[0],H=z[1],W=xw.useState(!1),K=Ky(W,2),Q=K[0],G=K[1],X=xw.useState(!1),Y=Ky(X,2),$=Y[0],Z=Y[1],J=xw.useRef(null),ee=yj.useSDKSettings(),te=ee.lang,re=ee.assetRoot,ne=ee.customUrls,oe=ee.exifKey,ie=fq.useApiClient({apiCredentials:_}),ae=ie.apiClient,se=xw.useReducer((function(e){return e+1}),0),ce=Ky(se,2),ue=(ce[0],ce[1]),le=xw.useRef(null),de=xw.useState(!1),fe=Ky(de,2),pe=fe[0],he=fe[1],me=xw.useRef({}),ge=Yj.useSDKTracking(),ve=ge.sendEvent,ye=hW(),be=ye.startMotion,we=ye.stopMotion,Ce=ye.motionData,ke=ye.orientationData,Se=xw.useState(Tse),Ee=Ky(Se,2),Be=Ee[0],_e=Ee[1],xe=xw.useState(!1),Te=Ky(xe,2),Ae=Te[0],Ie=Te[1],Pe=xw.useRef(!1),Re=xw.useCallback((function(e){Ie(e),Pe.current=e}),[]),De=xw.useRef(null),Oe=xw.useRef([]),Ne=xw.useRef(null),Le=xw.useRef(),Me=xw.useRef(null);null===Me.current&&(Me.current=KV.initFaceVerificationData({assetRoot:re,customInstructions:a,customIcon:s,customDirectionIcon:c,customStepTimeConstraints:l}));var Fe=xw.useState(),Ue=Ky(Fe,2),je=Ue[0],Ve=Ue[1],ze=xw.useCallback((function(e){Ve(e)}),[]),qe=xw.useMemo((function(){return $5(ze,500)}),[ze]),He=xw.useRef([]),We=xw.useRef(),Ke=s9({livenessSettings:y,apiClient:ae,apiCheck:t,onError:f,mode:uL.Mode.PASSIVE}),Qe=Ke.face_tracking_setting,Ge=Ke.flow_interval_time_ms,Xe=Ke.limit_time_liveness_check,Ye=Ke.terminate_if_no_face,$e=Ke.close_eye_detector,Ze=void 0===$e?{}:$e,Je=Ke.captureFrameSettings,et=void 0===Je?v:Je,tt=Ke.exif_data_settings,rt=Ke.record_video,nt=Ke.auto_capture,ot=Ke.manual_capture,it=Ke.blur_check,at=Ke.web_is_required_frontal_face,st=null!=nt&&nt.enable?null==nt?void 0:nt.wait_for_best_image_time_ms_web:null==ot?void 0:ot.wait_for_best_image_time_ms_web,ct=null==rt?void 0:rt.enable,ut=xw.useRef(""),lt=xw.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==_se?void 0:_se.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===ut.current)return;ut.current=r}ve(e),L&&L(e)}}),[L,ve]),dt=xw.useMemo((function(){return $5((function(e){lt(e)}),2e3)}),[lt]),ft=xw.useRef(0),pt=xw.useRef(),ht=xw.useRef();xw.useEffect((function(){lt({tag:"selfie",event:null==_se?void 0:_se.start_camera,log:{}})}),[lt]),xw.useEffect((function(){return kse.start(),lW.initExifData(),function(){kse.stop()}}),[]),xw.useEffect((function(){var e=!1;function t(){return(t=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pe){t.next=13;break}return We.current=performance.now(),t.next=4,T9(ne);case 4:return me.current=t.sent,t.next=7,Vq.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){t.next=9;break}return t.abrupt("return");case 9:he(!0),lt({tag:"selfie",event:null==_se?void 0:_se.show_warmup,log:{}}),lt({tag:"selfie",event:null==_se?void 0:_se.finish_load_model,log:{status:"success",time_in_ms:performance.now()-We.current}}),We.current=null;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[pe,ne,lt]);var mt=xw.useRef(!1),gt=xw.useCallback((function(){var e;w(""),Me.current.curStepIndex=Me.current.steps.length,mt.current=!0,G(!1),kse.stop(),null===(e=ht.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;Me.current=KV.initFaceVerificationData({assetRoot:re,customInstructions:a,customIcon:s,customDirectionIcon:c}),kse.start(),ft.current=0,pt.current=null,He.current=[],Z(!1),I9(),null===(e=ht.current)||void 0===e||e.start(),mt.current=!1,clearInterval(De.current),Re(!1),_e(Tse),Ne.current=null,Oe.current=[],Le.current=null,ue()}),Ge)}),[w,Ge,re,a,s,c,Re]),vt=xw.useMemo((function(){return Oy(Oy({},Ese),S)}),[S]),yt=xw.useMemo((function(){return Oy(Oy({},Bse),E)}),[E]),bt=400;xw.useEffect((function(){if(q&&Xe.enable&&$){var e=Xe.limit_time_second+1,t=Xe.remain_time_show||10,r=Xe.format||"s";kse.start("limit",(function(n){var o=e-n;if(Me.current.curStepIndex<Me.current.steps.length){if(o<=t&&o>=1){var i=i9(yt.REMAIN_TIME[te]),a=o;switch(r){case"mm:ss":a=o.toString().padStart(5,"00:00");break;case"ss":a=o.toString().padStart(2,"0")}w(i({x:a}))}if(0===o){var s,c={};Object.keys(null===(s=vt.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=i9(null===(t=vt.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:Xe.limit_time_second})})),Ve(Oy(Oy({},vt.liveness_terminated_time_out),{},{msg:c,duration:Ge})),lt({tag:"selfie",event:null==_se?void 0:_se.show_alert,log:{alert:"liveness_terminated_time_out,"}}),gt()}}}))}}),[gt,w,q,te,Ge,Xe.enable,Xe.limit_time_second,$,vt.liveness_terminated_time_out,yt.REMAIN_TIME,Xe.format,Xe.remain_time_show,lt]);var wt=xw.useCallback((function(e){var t,n,a=e.clientWidth,s=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;b1.isMobile?n=t=c:t=n=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=r;le.current={x:f,y:p,width:t,height:n,image:h,surroundStyle:o},"object"===By(i)?le.current=Oy(Oy({},le.current),i):"function"==typeof i&&(le.current=Oy(Oy({},le.current),i({clientWidth:a,clientHeight:s,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:b1.isMobile,width:t,height:n}))),ue(),H(!0)}),[r,o,i]),Ct=xw.useCallback((function(){_e(Tse),clearInterval(De.current),Re(!0);var e=function(){var e=xy(regeneratorRuntime.mark((function e(r){var n,o,i,a,s,c,u,l,p,h,m,g,v,y,b,w,C,S,E,B,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r-1!=0){e.next=52;break}return clearInterval(De.current),k(),e.next=5,null===(n=ht.current)||void 0===n?void 0:n.stopVideoRecording();case 5:return j(!0),we(),lW.preWriteExif({mode:lW.MODE.SELFIE,motionData:Ce,orientationData:ke,startTime:Date.now()-1e3*kse.duration("from_1st_frame"),endTime:Date.now(),exifKey:oe}),o=nt.enable?[Ne.current]:Oe.current,i=o.map((function(e){return Jz.resizeBlobImg(e.blob,bt,bt)})),e.next=12,Promise.all(i);case 12:return a=e.sent,s=a.map((function(e,t){return lW.writeExif({mode:lW.MODE.SELFIE,imageData:Oy(Oy({},o[t]),{},{blob:e,gesture:"frontal"}),enableExifData:tt.enable})})),e.next=16,Promise.all(s);case 16:if(c=e.sent,u={},!P||!P.key){e.next=25;break}return l=P.key,p=c.map((function(e){return Wq.encrypt({blob:e,key:l})})),e.next=23,Promise.all(p);case 23:h=e.sent,u={frontalFacesEncrypted:h};case 25:if(t){e.next=30;break}d(Oy(Oy({frontalFaces:c},u),{},{capturedFrames:He.current,video:U9()})),j9(),e.next=52;break;case 30:return m=Gy(He.current),g=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:Sse.FRONTAL})}},v=o.map((function(e,t){return ae.uploadImage(Oy({file:c[t]},g(e.leftRightScore)))})),P&&P.key&&(v=o.map((function(e,t){return ae.httpClient.post("/v1/images",Oy({base64:u.frontalFacesEncrypted[t].hex},g(e.leftRightScore)),{"X-TV-Key":P.key})}))),e.prev=34,e.next=37,Promise.all(v);case 37:return w=e.sent,C=ae.verifyFaceLiveness({images:w.map((function(e){return{id:e.data.image_id}})),videos:[{frames:m}]}),S=ae.requestVerifyPortrait({image:{id:null==w||null===(y=w[w.length-1])||void 0===y||null===(b=y.data)||void 0===b?void 0:b.image_id}}),e.next=42,Promise.all([C,S]);case 42:E=e.sent,B=Ky(E,2),_=B[0],x=B[1],d({apiCheckPassed:_.data.is_live,verifyFaceLivenessResult:_.data,verifyFacePortraitResult:x.data,frontalFaces:w.map((function(e,t){var r,n,i;return{id:null==e||null===(r=e.data)||void 0===r?void 0:r.image_id,blob:null===(n=o)||void 0===n||null===(i=n[t])||void 0===i?void 0:i.blob}}))}),e.next=52;break;case 49:e.prev=49,e.t0=e.catch(34),f({error:e.t0});case 52:case"end":return e.stop()}}),e,null,[[34,49]])})));return function(t){return e.apply(this,arguments)}}();De.current=setInterval((function(){_e((function(t){return e(t),t-1}))}),st/Tse)}),[null==nt?void 0:nt.enable,st,Re,t,d,ae,f,k,P,we,Ce,ke,tt.enable,oe]),kt=xw.useRef({});xw.useEffect((function(){kt.current.isFirstValidFrameFoundRef=$}),[$]),xw.useEffect((function(){var e,o=J.current;function i(e){return a.apply(this,arguments)}function a(){return(a=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.leftRightScore,i=t.blurScore,a=t.isEyeClosed,!0!==Pe.current||(!at||r!==Sse.FRONTAL)&&at){e.next=6;break}return e.next=4,xV.takePicture({canvas:n});case 4:s=e.sent,null!=nt&&nt.enable&&Date.now()-Le.current<(null==nt?void 0:nt.wait_for_best_image_time_ms_web)?(Ne.current||(Ne.current={blob:s,blurScore:i,isEyeClosed:a,captureTime:Date.now()}),null!=it&&it.enable&&(Ne.current=d9({incomingFrame:{blob:s,blurScore:i,isEyeClosed:a,captureTime:Date.now()},currentBestFrame:Ne.current}))):Oe.current.length<Ase&&Oe.current.push({blob:s,leftRightScore:o,captureTime:Date.now(),blurScore:i});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function s(e,r,n,o){if(He.current.length&&Date.now()-He.current[He.current.length-1].time<et.framesIntervalTime)return null;if(et.enable&&!o){var i=e.topLeft,a=e.bottomRight,s=[].concat(Gy(i),Gy(a)),c=Cse(e,0===He.current.length),u=c.score,l=c.time,d=r.toDataURL("image/jpeg",.8);return He.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:He.current.length,bbox:s,original_bbox:s}),et.framesBatchLength>0&&He.current.length%et.framesBatchLength==0&&T&&(T(He.current.slice(-et.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&P9(He.current.slice(-et.framesBatchLength),ae,He.current.length===et.framesBatchLength)),u}return null}function c(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(Ye.enable&&r){var n=Ye.max_time_ms;pt.current&&t||(pt.current={time:Date.now(),frame:0}),t&&pt.current.frame++;var o=pt.current.time;t&&Date.now()-o>=n&&(Ve(Oy(Oy({},vt.liveness_terminated_no_face),{},{duration:Ge})),lt({tag:"selfie",event:null==_se?void 0:_se.show_alert,log:{alert:"liveness_terminated_no_face"}}),gt())}}function u(e,t){return d.apply(this,arguments)}function d(){return(d=xy(regeneratorRuntime.mark((function t(a,d){var f,p,h,m,g,v,y,b,w,C,k,S,E,B,_,x,T,A,I,P,R,O,N,L,M,F,U,j,V,z,q,H,W,K,Q,G,X,Y;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==d?void 0:d.width)&&0!==(null==d?void 0:d.height)){t.next=2;break}return t.abrupt("return");case 2:return m=kt.current.isFirstValidFrameFoundRef,g=a.cropX,v=a.cropY,y=a.cropWidth,b=a.cropHeight,d.getContext("2d").drawImage(o,g,v,y,b,-(bt*D-bt)/2/D,-(bt*D-bt)/2/D,bt,bt),w=me.current,C=w.blazefaceModel,k=w.closeEyesModel,t.next=9,Promise.all([BV.calculateBlurScore(d),GV.getModelPredictions({model:C,sCanvas:d})]);case 9:return S=t.sent,E=Ky(S,2),B=E[0],_=E[1],t.next=15,KV.validatePredictions({predictions:_,width:GV.SIZE,height:GV.SIZE});case 15:if(T=t.sent,A=T.error,I=T.fullFace,P=T.faceRatio,R=T.faceNotFrontalMinThreshold,x=A,le.current.image=r,N=null,L=null,M=null,null,F=Me.current,U=F.curStepIndex,j=F.steps,!I){t.next=43;break}return V=!0,M=I.landmarks,t.next=32,KV.calculateFaceDirection({landmarks:M,getPerfectFrontal:V});case 32:if((z=t.sent)&&(N=z.gesture,L=z.leftRightScore),q=(null==Ze?void 0:Ze.web_timeout)+l[uL.FaceDirection.FRONTAL].delayTime/1e3,!(V&&null!=Ze&&Ze.enable&&(-1===kse.duration("limit_close_eye")||kse.duration("limit_close_eye")<q))){t.next=43;break}return-1===kse.duration("limit_close_eye")&&kse.start("limit_close_eye"),t.next=39,k.predict(d,M,null==Ze?void 0:Ze.web_threshold);case 39:H=t.sent,W=H.isEyeClose,W&&!x&&(x=Ese.close_eye);case 43:if(K="no_face"===(null===(f=x)||void 0===f?void 0:f.code)||"partial_face"===(null===(p=x)||void 0===p?void 0:p.code),Q=U<j.length,c({noFace:K&&Q,isFirstValidFrameFoundRef:m}),null!==(h=x)&&void 0!==h&&h.code&&dt({tag:"selfie",event:null==_se?void 0:_se.show_alert,log:{alert:x.code}}),x&&!("face_too_small"===x.code&&N!==Sse.FRONTAL&&P>=R)){t.next=66;break}if(s(_[0],d,M),N===Sse.FRONTAL||!at){t.next=54;break}O=vt.not_frontal_face,le.current.image=n,t.next=64;break;case 54:if(x){t.next=64;break}return m||(Z(!0),kse.start("from_1st_frame")),G=(null==nt?void 0:nt.enable)&&!Pe.current&&0===Oe.current.length,null!=it&&it.enable?null!==B&&B>(null==it?void 0:it.web_blurry_threshold)?(O=null,G&&(Le.current=Date.now(),Ct())):Pe.current||(O=vt.liveness_blurry):G&&(Le.current=Date.now(),Ct()),t.next=60,k.predict(d,M,null==Ze?void 0:Ze.web_threshold);case 60:return X=t.sent,Y=X.isEyeClose,t.next=64,i(Oy({faceDirection:N,canvas:d,leftRightScore:L,blurScore:B},null!==Y?{isEyeClosed:Y}:{}));case 64:t.next=67;break;case 66:U<j.length&&(O=vt[x.code],le.current.image=n);case 67:qe(O),e!==xse&&(e=requestAnimationFrame((function(){return u(a,d)})));case 69:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function f(){return(f=xy(regeneratorRuntime.mark((function e(){var t,r,n,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=xV.analyzeVideoAndWindowSizes(o,le.current),(r=document.createElement("canvas")).width=bt,r.height=bt,(n=r.getContext("2d")).translate(bt,0),n.scale(-1*D,1*D),!ct||!o){e.next=13;break}return e.next=10,q9({outputImagesSize:bt,videoEl:o,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:i=e.t0,a=i.mediaRecorder,ht.current=a,ht.current&&ht.current.start(),u(t,r);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return q&&pe&&setTimeout((function(){!function(){f.apply(this,arguments)}()}),I),function(){cancelAnimationFrame(e),e=xse}}),[at,null==it?void 0:it.enable,null==it?void 0:it.web_blurry_threshold,null==nt?void 0:nt.enable,null==nt?void 0:nt.wait_for_best_image_time_ms_web,I,q,te,ae,t,r,n,d,f,p,m,et,k,Qe,Xe.enable,w,qe,l,Ge,gt,Ye,vt,pe,lt,T,P,D,Ct,N,null==Ze?void 0:Ze.enable,null==Ze?void 0:Ze.web_threshold,null==Ze?void 0:Ze.web_timeout,Ce,ke,we,tt.enable,oe,dt,v.framesBatchLength,ct]),xw.useEffect((function(){je&&((null==je?void 0:je.code)!==(null==vt?void 0:vt.liveness_terminated_time_out)&&(null==je?void 0:je.code)!==(null==vt?void 0:vt.liveness_terminated_no_face)&&null!=nt&&nt.enable&&Pe.current||(clearInterval(De.current),Re(!1),Ne.current=null,Oe.current=[],Le.current=null)),be()}),[null==nt?void 0:nt.enable,je,Re,be,vt]);var St=Me.current,Et=St.curStepIndex,Bt=St.steps,_t=$&&!je&&!N&&(null==nt||!nt.enable||(null==nt?void 0:nt.show_capture_button)),xt=Ae&&!mt.current&&(null!=nt&&nt.enable?null==nt?void 0:nt.show_countdown:null==ot?void 0:ot.show_countdown);return{countdownToTakePicture:Be,cropArea:le,curStepIndex:Et,faceDetectionError:je,handleTriggerPassiveMode:Ct,handleVideoPlayed:wt,refVideo:J,refIsReseting:mt,showCountdown:Ae,steps:Bt,videoPlayed:q,activeCapturing:Q,isFirstValidFrameFound:$,warmupDone:pe,motionData:Ce,orientationData:ke,showLoading:U,showCaptureButton:_t,shouldShowCountdown:xt}}var Rse,Dse=b1.isMobile?{width:{ideal:640}}:null;function Ose(e){var t=e.apiCheck,r=e.onLivenessDetectionDone,n=e.onClose,o=e.onError,i=e.captureFrameSettings,a=e.onFramesCaptured,s=e.frontCamera,c=e.customDirectionIcon,u=e.customStepTimeConstraints,l=e.onProcessing,d=e.customErrors,f=e.livenessSettings,p=e.apiCredentials,h=e.outputEncryptionSettings,m=e.cameraScale,g=e.defaultCameraId,v=e.passiveModeAuto,y=e.offsetFaceY,b=e.styledComponent,w=Jj.useAsset("bg_camera_mask.png"),C=Jj.useAsset("bg_camera_mask_red.png"),k=Ky(xw.useState({}),2),S=k[0],E=k[1],B=S.yFaceDetectionError,_=S.yFaceVerificationStepsWrapper,x=Ky(xw.useState(""),2),T=x[0],A=x[1],I=mB(),P=xw.useMemo((function(){return{backgroundColor:t5(I,"Selfie.backgroundColor",c9)}}),[I]),R=xw.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,i=t+25,a=i+30;E({yFaceDetectionError:i,yFaceVerificationStepsWrapper:a+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(a);return 0!==y&&(u+y<s||u+y+r>c)?o({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=y,{y:u}}),[y,o]),D=Pse({apiCheck:t,bgCameraMask:w,bgCameraMaskRed:C,surroundStyle:P,onLivenessDetectionDone:r,onError:o,cropAreaDimension:R,customDirectionIcon:c,captureFrameSettings:i,onFramesCaptured:a,livenessSettings:f,setRemainingTime:A,customStepTimeConstraints:u,onProcessing:l,customErrors:d,apiCredentials:p,outputEncryptionSettings:h,cameraScale:m,passiveModeAuto:v}),O=D.countdownToTakePicture,N=D.cropArea,L=D.curStepIndex,M=D.faceDetectionError,F=D.handleTriggerPassiveMode,U=D.handleVideoPlayed,j=D.refVideo,V=D.showCountdown,z=D.steps,q=D.videoPlayed,H=D.warmupDone,W=D.showCaptureButton,K=D.shouldShowCountdown;xw.useEffect((function(){var e;"string"==typeof(null===(e=z[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(z.map((function(e){return f9(e.directionIcon)})))}),[z]);var Q=b.CloseCameraButton,G=l9(e,I),X=yj.useSDKSettings().lang,Y=xw.useRef(0),$=xw.useRef({}),Z=xw.useRef(uL.ErrorDuration.SHORT),J=xw.useMemo((function(){var e=M||{},t=e.msg,r=e.duration,n=void 0===r?uL.ErrorDuration.SHORT:r,o=null==t?void 0:t[X];return Date.now()-Y.current>=Z.current&&(Y.current=Date.now(),Z.current=n,$.current=o),$.current}),[M,L]);return xw.createElement(C5,{frontCamera:s,onVideoPlayed:U,onClose:n,flipHorizontal:s,ref:j,videoSettings:Dse,onError:o,scale:m,defaultCameraId:g,closeButton:Q||null},!H&&xw.createElement(Y7,null),q?xw.createElement(xw.Fragment,null,"string"==typeof J?xw.createElement(Ote,{top:B-15,className:"face-detection-error"},J):null,N.current?xw.createElement(x5,{x:"".concat(N.current.x,"px"),y:"".concat(N.current.y,"px"),width:"".concat(N.current.width,"px"),height:"".concat(N.current.height,"px"),surroundStyle:N.current.surroundStyle},xw.createElement(Hte,null),xw.createElement(qte,Ry({progress:L/z.length*100},G,{showErrorRing:!!M&&t5(I,"Selfie.progressCircle.showErrorRing",c9)})),K?xw.createElement(Vte,null,O):null,M&&xw.createElement(Wte,null)):null,T&&xw.createElement(Nte,{top:_-30},T),W?xw.createElement(Ute,null,xw.createElement(jte,{onClick:F,disabled:V},y1(I,"Selfie.captureIcon.src")?xw.createElement("img",{src:y1(I,"Selfie.captureIcon.src"),alt:""}):xw.createElement(T5,null))):null):null)}Ose.propTypes={apiCheck:xC.bool,mode:xC.string,onLivenessDetectionDone:xC.func,onClose:xC.func,onError:xC.func,captureFrameSettings:xC.shape({}),onFramesCaptured:xC.func,frontCamera:xC.bool,customDirectionIcon:xC.shape({}),customStepTimeConstraints:xC.shape({}),onProcessing:xC.func,customErrors:xC.shape({}),livenessSettings:xC.shape({}),apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),outputEncryptionSettings:xC.shape({}),cameraScale:xC.number,defaultCameraId:xC.string,passiveModeAuto:xC.bool,offsetFaceY:xC.number,styledComponent:xC.shape({CloseCameraButton:xC.node})},Ose.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(bse={},Py(bse,uL.FaceDirection.LEFT,xw.createElement(w7,{type:uL.FaceDirection.LEFT})),Py(bse,uL.FaceDirection.RIGHT,xw.createElement(w7,{type:uL.FaceDirection.RIGHT})),Py(bse,uL.FaceDirection.UP,xw.createElement(w7,{type:uL.FaceDirection.UP})),Py(bse,uL.FaceDirection.FRONTAL,xw.createElement(w7,{type:uL.FaceDirection.FRONTAL})),bse),customStepTimeConstraints:(wse={},Py(wse,uL.FaceDirection.UP,{delayTime:0}),Py(wse,uL.FaceDirection.LEFT,{delayTime:0}),Py(wse,uL.FaceDirection.RIGHT,{delayTime:0}),Py(wse,uL.FaceDirection.FRONTAL,{delayTime:2e3}),wse),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null}};var Nse,Lse,Mse=KV.faceTracker(),Fse=new Kq,Use=uL.FaceDirection,jse=uL.Errors,Vse=uL.Messages,zse=uL.TrackLivenessEvents,qse=-1,Hse={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(Rse={},Py(Rse,uL.FaceDirection.UP,{delayTime:0}),Py(Rse,uL.FaceDirection.LEFT,{delayTime:0}),Py(Rse,uL.FaceDirection.RIGHT,{delayTime:0}),Py(Rse,uL.FaceDirection.FRONTAL,{delayTime:2e3}),Rse),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}};function Wse(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,r=e.mode,n=e.bgCameraMask,o=e.bgCameraMaskRed,i=e.surroundStyle,a=e.cropAreaDimension,s=e.customInstructions,c=e.customIcon,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=void 0===l?Hse.customStepTimeConstraints:l,f=e.onLivenessDetectionDone,p=e.onError,h=e.frontalMinSize,m=e.waitingTimeToGetBetterFrames,g=void 0===m?500:m,v=e.captureFrameSettings,y=void 0===v?Hse.captureFrameSettings:v,b=e.livenessSettings,w=e.setRemainingTime,C=void 0===w?Hse.setRemainingTime:w,k=e.onProcessing,S=void 0===k?Hse.onProcessing:k,E=e.customErrors,B=e.customMessages,_=e.apiCredentials,x=void 0===_?{}:_,T=e.onFramesCaptured,A=void 0===T?Hse.onFramesCaptured:T,I=e.initFirstGestureTimeout,P=void 0===I?2e3:I,R=e.outputEncryptionSettings,D=e.cameraScale,O=void 0===D?1:D,N=e.sendCustomEvent,L=xw.useState(!1),M=Ky(L,2),F=M[0],U=M[1],j=xw.useState(!1),V=Ky(j,2),z=V[0],q=V[1],H=xw.useState(!1),W=Ky(H,2),K=W[0],Q=W[1],G=xw.useState(!1),X=Ky(G,2),Y=X[0],$=X[1],Z=xw.useRef(null),J=yj.useSDKSettings(),ee=J.lang,te=J.assetRoot,re=J.customUrls,ne=J.exifKey,oe=fq.useApiClient({apiCredentials:x}),ie=oe.apiClient,ae=xw.useReducer((function(e){return e+1}),0),se=Ky(ae,2),ce=(se[0],se[1]),ue=xw.useRef(null),le=xw.useRef(!1),de=xw.useState(!1),fe=Ky(de,2),pe=fe[0],he=fe[1],me=xw.useRef({}),ge=Yj.useSDKTracking(),ve=ge.sendEvent,ye=hW(),be=ye.stopMotion,we=ye.motionData,Ce=ye.orientationData,ke=xw.useRef(null);null===ke.current&&(ke.current=KV.initFaceVerificationData({assetRoot:te,customInstructions:s,customIcon:c,customDirectionIcon:u,customStepTimeConstraints:d}));var Se=xw.useState(),Ee=Ky(Se,2),Be=Ee[0],_e=Ee[1],xe=xw.useCallback((function(e){_e(e)}),[]),Te=xw.useMemo((function(){return $5(xe,500)}),[xe]),Ae=xw.useRef([]),Ie=xw.useRef(),Pe=s9({livenessSettings:b,apiClient:ie,apiCheck:t,onError:p,mode:r}),Re=Pe.face_tracking_setting,De=Pe.flow_interval_time_ms,Oe=Pe.limit_time_liveness_check,Ne=Pe.terminate_if_no_face,Le=Pe.close_eye_detector,Me=void 0===Le?{}:Le,Fe=Pe.captureFrameSettings,Ue=void 0===Fe?y:Fe,je=Pe.exif_data_settings,Ve=Pe.record_video,ze=Pe.web_is_required_frontal_face,qe=null==Ve?void 0:Ve.enable,He=xw.useRef(""),We=xw.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==zse?void 0:zse.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===He.current)return;He.current=r}ve(e),N&&N(e)}}),[N,ve]),Ke=xw.useMemo((function(){return $5((function(e){We(e)}),2e3)}),[We]),Qe=xw.useRef(0),Ge=xw.useRef(),Xe=xw.useRef();xw.useEffect((function(){We({tag:"selfie",event:null==zse?void 0:zse.start_camera,log:{}})}),[We]),xw.useEffect((function(){return Fse.start(),lW.initExifData(),function(){Fse.stop()}}),[]),xw.useEffect((function(){var e=!1;function t(){return(t=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pe){t.next=13;break}return Ie.current=performance.now(),t.next=4,T9(re);case 4:return me.current=t.sent,t.next=7,Vq.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){t.next=9;break}return t.abrupt("return");case 9:he(!0),We({tag:"selfie",event:null==zse?void 0:zse.show_warmup,log:{}}),We({tag:"selfie",event:null==zse?void 0:zse.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Ie.current}}),Ie.current=null;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[pe,re,We]);var Ye=xw.useRef(!1),$e=xw.useCallback((function(){var e;C(""),ke.current.curStepIndex=ke.current.steps.length,Ye.current=!0,Q(!1),Fse.stop(),null===(e=Xe.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;ke.current=KV.initFaceVerificationData({assetRoot:te,customInstructions:s,customIcon:c,customDirectionIcon:u}),Fse.start(),Qe.current=0,Ge.current=null,Ae.current=[],$(!1),I9(),null===(e=Xe.current)||void 0===e||e.start(),Ye.current=!1,ce()}),De)}),[C,De,te,s,c,u]),Ze=xw.useMemo((function(){return Oy(Oy({},jse),E)}),[E]),Je=xw.useMemo((function(){return Oy(Oy({},Vse),B)}),[B]),et=400;xw.useEffect((function(){if(z&&Oe.enable&&Y){var e=Oe.limit_time_second+1,t=Oe.remain_time_show||10,r=Oe.format||"s";Fse.start("limit",(function(n){var o=e-n;if(ke.current.curStepIndex<ke.current.steps.length){if(o<=t&&o>=1){var i=i9(Je.REMAIN_TIME[ee]),a=o;switch(r){case"mm:ss":a=o.toString().padStart(5,"00:00");break;case"ss":a=o.toString().padStart(2,"0")}C(i({x:a}))}if(0===o){var s,c={};Object.keys(null===(s=Ze.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=i9(null===(t=Ze.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:Oe.limit_time_second})})),_e(Oy(Oy({},Ze.liveness_terminated_time_out),{},{msg:c,duration:De})),We({tag:"selfie",event:null==zse?void 0:zse.show_alert,log:{alert:"liveness_terminated_time_out,"}}),$e()}}}))}}),[$e,C,z,ee,De,Oe.enable,Oe.limit_time_second,Y,Ze.liveness_terminated_time_out,Je.REMAIN_TIME,Oe.format,Oe.remain_time_show,We]);var tt=xw.useCallback((function(e){var t,r,o=e.clientWidth,s=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;b1.isMobile?r=t=c:t=r=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=n;ue.current={x:f,y:p,width:t,height:r,image:h,surroundStyle:i},"object"===By(a)?ue.current=Oy(Oy({},ue.current),a):"function"==typeof a&&(ue.current=Oy(Oy({},ue.current),a({clientWidth:o,clientHeight:s,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:b1.isMobile,width:t,height:r}))),ce(),q(!0)}),[n,i,a]),rt=xw.useRef({});xw.useEffect((function(){rt.current.isFirstValidFrameFoundRef=Y}),[Y]),xw.useEffect((function(){var e,r=Z.current,i=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ke.current.steps,r=[],t.map((function(e){return r.push({name:e.name,blob:e.image.blob,captureTime:e.image.captureTime,gesture:e.name}),e.frontalFaceImage.blob&&r.push({name:e.name,blob:e.frontalFaceImage.blob,captureTime:e.frontalFaceImage.captureTime,gesture:Use.FRONTAL}),0})),n=r.map((function(e){return Jz.resizeBlobImg(e.blob,et,et)})),e.next=6,Promise.all(n);case 6:return o=e.sent,i="0",y.framesBatchLength>0&&(a="".concat(Math.floor(Ae.current.length/y.framesBatchLength),"x").concat(y.framesBatchLength),s=Ae.current.length%y.framesBatchLength>0?"+".concat(Ae.current.length%y.framesBatchLength):"",i="".concat(Ae.current.length,":").concat(a).concat(s)),c=o.map((function(e,t){return lW.writeExif({mode:lW.MODE.SELFIE,imageData:Oy(Oy({},r[t]),{},{blob:e,frames:i}),enableExifData:je.enable})})),e.next=12,Promise.all(c);case 12:return u=e.sent,l=r.map((function(e,t){return{name:e.name,blob:u[t]}})),e.next=16,Promise.all(t.map(function(){var e=xy(regeneratorRuntime.mark((function e(r,n){var o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=l.filter((function(e){return e.name===r.name})),t[n].image.blob=o[0].blob,r.frontalFaceImage.blob&&(t[n].frontalFaceImage.blob=o[1].blob),!R||!R.key){e.next=12;break}return i=R.key,e.next=7,Wq.encrypt({blob:o[0].blob,key:i});case 7:if(t[n].image.encrypted=e.sent,!r.frontalFaceImage.blob){e.next=12;break}return e.next=11,Wq.encrypt({blob:o[1].blob,key:i});case 11:t[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=xy(regeneratorRuntime.mark((function e(){var r,n,o,a,s,c,u,l,d,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ke.current.steps,o=n[ke.current.curStepIndex],Py(r={},uL.FaceDirection.UP,null==zse?void 0:zse.capture_up_face),Py(r,uL.FaceDirection.LEFT,null==zse?void 0:zse.capture_left_face),Py(r,uL.FaceDirection.RIGHT,null==zse?void 0:zse.capture_right_face),Py(r,uL.FaceDirection.FRONTAL,null==zse?void 0:zse.capture_frontal_face),We({tag:"selfie",event:r[o.name],log:{time_capture_in_seconds:((performance.now()-Ie.current)/1e3).toFixed(1)}}),ke.current.curStepIndex++,Ie.current=performance.now(),Re.enable&&"each_gesture"===Re.limit_for&&(Qe.current=0),ke.current.curStepIndex!==n.length){e.next=44;break}if(Oe.enable&&C(""),!f){e.next=44;break}return Ue.enable&&Ue.framesBatchLength>0&&Ae.current.length%Ue.framesBatchLength>0&&(A(Ae.current.slice(Ae.current.length%Ue.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&P9(Ae.current.slice(Ae.current.length%Ue.framesBatchLength*-1),ie)),We({tag:"selfie",event:null==zse?void 0:zse.finish_capture,log:{time_capture_in_seconds:Fse.duration("from_1st_frame")}}),S(),e.next=15,null===(a=Xe.current)||void 0===a?void 0:a.stopVideoRecording();case 15:return U(!0),be(),lW.preWriteExif({mode:lW.MODE.SELFIE,motionData:we,orientationData:Ce,startTime:Date.now()-1e3*Fse.duration("from_1st_frame"),endTime:Date.now(),exifKey:ne}),e.next=20,i();case 20:if(t){e.next=41;break}if(d=n.filter((function(e){return e.name!==Use.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),m=n.filter((function(e){return e.name!==Use.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),g=n.filter((function(e){return e.name!==Use.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),v=null===(s=n.find((function(e){return e.name===Use.FRONTAL})))||void 0===s||null===(c=s.image)||void 0===c?void 0:c.blob,y=null===(u=n.find((function(e){return e.name===Use.FRONTAL})))||void 0===u||null===(l=u.image)||void 0===l?void 0:l.encrypted,!v||!h){e.next=32;break}return e.next=29,Jz.scaleImage(v,{minSize:h});case 29:e.t0=e.sent,e.next=33;break;case 32:e.t0=null;case 33:b=e.t0,v&&m.push(v),y&&g.push(y),We({tag:"result",event:null==zse?void 0:zse.liveness_detection_done,log:{result_object:{steps:d,frontalFaces:m,frontalScaledImage:b}}}),f({steps:d,frontalFaces:m,frontalFacesEncrypted:g,frontalScaledImage:b,capturedFrames:Ae.current,video:U9().length?U9()[0]:null}),j9(),e.next=43;break;case 41:return e.next=43,N9({apiClient:ie,faceVerificationFlowData:ke,onLivenessDetectionDone:f,captureFrameSettings:Ue,FaceDirection:Use,onError:p,outputEncryptionSettings:R,video:U9().length?U9()[0]:null});case 43:U(!1);case 44:ce();case 45:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=G5((function(){var e=ke.current,t=e.curStepIndex,r=e.steps,n=r[t],o=null!==(null==n?void 0:n.image.blob),i=null!==(null==n?void 0:n.frontalFaceImage.blob),s=r.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(i||![1].includes(t)||s>=1)?(le.current=!1,a(),c=!0):le.current=!(!o||i),Q(!1),c}),g);function c(e){return u.apply(this,arguments)}function u(){return(u=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.blurScore,i=t.leftRightScore,c=t.isEyeClose,u=ke.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!u9({faceDirection:r,curStep:f})){e.next=6;break}return e.abrupt("return");case 6:if(!c){e.next=8;break}return e.abrupt("return");case 8:if(r!==Use.FRONTAL||null!==f.frontalFaceImage.blurScore&&!BV.hasBetterBlurScore(o,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=o,e.next=12,xV.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=i,f.frontalFaceImage.captureTime=Date.now(),le.current&&(le.current=!1,a());case 17:if(f.name!==r||null!==f.image.blurScore&&!BV.hasBetterBlurScore(o,f.image.blurScore)){e.next=29;break}return Q(!0),f.image.blurScore=o,e.next=22,xV.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=i,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(h),s();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,r,n,o){if(Ae.current.length&&Date.now()-Ae.current[Ae.current.length-1].time<Ue.framesIntervalTime)return null;if(Ue.enable&&!o){var i=e.topLeft,a=e.bottomRight,s=[].concat(Gy(i),Gy(a)),c=Mse(e,0===Ae.current.length),u=c.score,l=c.time,d=r.toDataURL("image/jpeg",.8);return Ae.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:Ae.current.length,bbox:s,original_bbox:s}),Ue.framesBatchLength>0&&Ae.current.length%Ue.framesBatchLength==0&&A&&(A(Ae.current.slice(-Ue.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&P9(Ae.current.slice(-Ue.framesBatchLength),ie,Ae.current.length===Ue.framesBatchLength)),u}return null}function m(e){var t=e.trackingScore,r=e.isFirstValidFrameFoundRef;if(!Re.enable||null===t||!r)return!0;var n=Re.web_warning_threshold,o=Re.web_terminate_threshold,i=Re.max_warning_time;return t<n||(t<o&&Qe.current<i?(Qe.current++,Qe.current===i?(_e(Oy(Oy({},Ze.liveness_terminated_face_tracking),{},{duration:De})),We({tag:"selfie",event:null==zse?void 0:zse.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):_e(Oy(Oy({},Ze.liveness_too_fast),{},{duration:1500})),!0):(_e(Oy(Oy({},Ze.liveness_terminated),{},{duration:De})),We({tag:"selfie",event:null==zse?void 0:zse.show_alert,log:{alert:"liveness_terminated"}}),$e(),!1))}function v(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(Ne.enable&&r){var n=Ne.max_time_ms;Ge.current&&t||(Ge.current={time:Date.now(),frame:0}),t&&Ge.current.frame++;var o=Ge.current.time;t&&Date.now()-o>=n&&(_e(Oy(Oy({},Ze.liveness_terminated_no_face),{},{duration:De})),We({tag:"selfie",event:null==zse?void 0:zse.show_alert,log:{alert:"liveness_terminated_no_face"}}),$e())}}function b(e,t){return w.apply(this,arguments)}function w(){return(w=xy(regeneratorRuntime.mark((function t(i,a){var s,u,f,p,h,g,y,w,C,k,S,E,B,_,x,T,A,I,P,R,D,N,L,M,F,U,j,V,z,q,H,W,K,Q,G,X,Y;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==a?void 0:a.width)&&0!==(null==a?void 0:a.height)){t.next=2;break}return t.abrupt("return");case 2:return p=rt.current.isFirstValidFrameFoundRef,h=i.cropX,g=i.cropY,y=i.cropWidth,w=i.cropHeight,a.getContext("2d").drawImage(r,h,g,y,w,-(et*O-et)/2/O,-(et*O-et)/2/O,et,et),C=me.current,k=C.blazefaceModel,S=C.closeEyesModel,t.next=9,Promise.all([BV.calculateBlurScore(a),GV.getModelPredictions({model:k,sCanvas:a})]);case 9:return E=t.sent,B=Ky(E,2),_=B[0],x=B[1],t.next=15,KV.validatePredictions({predictions:x,width:GV.SIZE,height:GV.SIZE});case 15:if(A=t.sent,I=A.error,P=A.fullFace,R=A.faceRatio,D=A.faceNotFrontalMinThreshold,T=I,ue.current.image=n,L=null,M=null,F=null,U=null,j=ke.current,V=j.curStepIndex,z=j.steps,!P){t.next=44;break}return q=z[V],H=q&&q.name===Use.FRONTAL,F=P.landmarks,t.next=33,KV.calculateFaceDirection({landmarks:F,getPerfectFrontal:H});case 33:if((W=t.sent)&&(L=W.gesture,M=W.leftRightScore),K=(null==Me?void 0:Me.web_timeout)+d[uL.FaceDirection.FRONTAL].delayTime/1e3,!(H&&null!=Me&&Me.enable&&(-1===Fse.duration("limit_close_eye")||Fse.duration("limit_close_eye")<K))){t.next=44;break}return-1===Fse.duration("limit_close_eye")&&Fse.start("limit_close_eye"),t.next=40,S.predict(a,F,null==Me?void 0:Me.web_threshold);case 40:Q=t.sent,G=Q.isEyeClose,(U=G)&&!T&&(T=jse.close_eye);case 44:if(X="no_face"===(null===(s=T)||void 0===s?void 0:s.code)||"partial_face"===(null===(u=T)||void 0===u?void 0:u.code),Y=V<z.length,v({noFace:X&&Y,isFirstValidFrameFoundRef:p}),null!==(f=T)&&void 0!==f&&f.code&&Ke({tag:"selfie",event:null==zse?void 0:zse.show_alert,log:{alert:T.code}}),T&&!("face_too_small"===T.code&&L!==Use.FRONTAL&&R>=D)){t.next=56;break}if(p||($(!0),Ie.current=performance.now(),Fse.start("from_1st_frame")),!m({trackingScore:l(x[0],a,F,V>=z.length),isFirstValidFrameFoundRef:p})){t.next=54;break}return t.next=54,c({faceDirection:L,canvas:a,blurScore:_,leftRightScore:M,isEyeClose:U});case 54:t.next=57;break;case 56:V<z.length&&(N=Ze[T.code],ue.current.image=o);case 57:Te(N),e!==qse&&(e=requestAnimationFrame((function(){return b(i,a)})));case 59:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(){return(k=xy(regeneratorRuntime.mark((function e(){var t,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=xV.analyzeVideoAndWindowSizes(r,ue.current),(n=document.createElement("canvas")).width=et,n.height=et,(o=n.getContext("2d")).translate(et,0),o.scale(-1*O,1*O),!qe||!r){e.next=13;break}return e.next=10,q9({outputImagesSize:et,videoEl:r,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:i=e.t0,a=i.mediaRecorder,Xe.current=a,Xe.current&&Xe.current.start(),b(t,n);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return z&&pe&&setTimeout((function(){!function(){k.apply(this,arguments)}()}),P),function(){cancelAnimationFrame(e),e=qse}}),[ze,r,P,z,ee,ie,t,n,o,f,p,h,g,Ue,S,Re,Oe.enable,C,Te,d,De,$e,Ne,Ze,pe,We,A,R,O,null==Me?void 0:Me.enable,null==Me?void 0:Me.web_threshold,null==Me?void 0:Me.web_timeout,we,Ce,be,je.enable,ne,Ke,y.framesBatchLength,qe]);var nt=ke.current,ot=nt.curStepIndex,it=nt.steps,at=xw.useMemo((function(){return it.find((function(e){return e.name===uL.FaceDirection.FRONTAL}))}),[it]),st=le.current?at:it[ot],ct=st&&Y?st.instructions[ee]:null,ut=st&&Y?st.directionIcon:"",lt=st?st.directionIconAnimation:"";return{cropArea:ue,curStepIndex:ot,directionIcon:ut,directionIconAnimation:lt,faceDetectionError:Be,handleVideoPlayed:tt,instructions:ct,refVideo:Z,refIsReseting:Ye,steps:it,videoPlayed:z,activeCapturing:K,isFirstValidFrameFound:Y,warmupDone:pe,motionData:we,orientationData:Ce,showLoading:F}}var Kse=b1.isMobile?{width:{ideal:640}}:null,Qse=function(e){var t=e.stepNumber,r=e.type,n=e.theme,o=y1(n,"Selfie.Active.imageHolder.".concat(r));return null===o?xw.createElement(xw.Fragment,null):o&&null!==o?xw.createElement("img",{src:o,alt:""}):xw.createElement("span",null,t)};function Gse(e,t){return e?"string"==typeof e?xw.createElement("img",{className:t,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}function Xse(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,i=e.onError,a=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=e.onProcessing,f=e.customErrors,p=e.livenessSettings,h=e.apiCredentials,m=e.outputEncryptionSettings,g=e.cameraScale,v=e.defaultCameraId,y=e.offsetFaceY,b=e.styledComponent,w=Jj.useAsset("bg_camera_mask.png"),C=Jj.useAsset("bg_camera_mask_red.png"),k=Ky(xw.useState({}),2),S=k[0],E=k[1],B=S.yFaceDetectionError,_=S.yFaceVerificationStepsWrapper,x=Ky(xw.useState(""),2),T=x[0],A=x[1],I=mB(),P=xw.useMemo((function(){return{backgroundColor:t5(I,"Selfie.backgroundColor",c9)}}),[I]),R=xw.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,o=t+25,a=o+30;E({yFaceDetectionError:o,yFaceVerificationStepsWrapper:a+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(a);return 0!==y&&(u+y<s||u+y+r>c)?i({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=y,{y:u}}),[y,i]),D=Wse({apiCheck:t,mode:r,bgCameraMask:w,bgCameraMaskRed:C,surroundStyle:P,onLivenessDetectionDone:n,onError:i,cropAreaDimension:R,customDirectionIcon:u,captureFrameSettings:a,onFramesCaptured:s,livenessSettings:p,setRemainingTime:A,customStepTimeConstraints:l,onProcessing:d,customErrors:f,apiCredentials:h,outputEncryptionSettings:m,cameraScale:g}),O=D.cropArea,N=D.curStepIndex,L=D.directionIcon,M=D.directionIconAnimation,F=D.faceDetectionError,U=D.handleVideoPlayed,j=D.instructions,V=D.refVideo,z=D.steps,q=D.videoPlayed,H=D.activeCapturing,W=D.warmupDone;xw.useEffect((function(){var e;"string"==typeof(null===(e=z[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(z.map((function(e){return f9(e.directionIcon)})))}),[z]);var K=b.CloseCameraButton,Q=l9(e,I),G=yj.useSDKSettings().lang,X=xw.useRef(0),Y=xw.useRef({}),$=xw.useRef(uL.ErrorDuration.SHORT),Z=xw.useMemo((function(){var e=F||{},t=e.msg,r=e.duration,n=void 0===r?uL.ErrorDuration.SHORT:r,o=null==t?void 0:t[G];return Date.now()-X.current>=$.current&&(X.current=Date.now(),$.current=n,Y.current=o),Y.current}),[F,N]);return xw.createElement(C5,{frontCamera:c,onVideoPlayed:U,onClose:o,flipHorizontal:c,ref:V,videoSettings:Kse,onError:i,scale:g,defaultCameraId:v,closeButton:K||null},!W&&xw.createElement(Y7,null),q?xw.createElement(xw.Fragment,null,"string"==typeof Z?xw.createElement(Ote,{top:B-15,className:"face-detection-error"},Z):null,O.current?xw.createElement(x5,{x:"".concat(O.current.x,"px"),y:"".concat(O.current.y,"px"),width:"".concat(O.current.width,"px"),height:"".concat(O.current.height,"px"),surroundStyle:O.current.surroundStyle},xw.createElement(Hte,null),xw.createElement(qte,Ry({progress:N/z.length*100},Q,{showErrorRing:!!F&&t5(I,"Selfie.progressCircle.showErrorRing",c9)})),xw.createElement(zte,null,Gse(L,M)),H&&xw.createElement(Qte,null),F&&xw.createElement(Wte,null)):null,T&&xw.createElement(Nte,{top:_-30},T),j?xw.createElement(xw.Fragment,null,xw.createElement(Lte,{top:_+5,className:"instructions"},j),xw.createElement(Mte,{top:_+35},z.map((function(e,t){var r=e.name,n=e.image.objUrl;return xw.createElement(Fte,{key:r,active:N>=t,className:"step-item"},n?xw.createElement("img",{src:n,alt:""}):xw.createElement(Qse,{stepNumber:t+1,type:r,theme:I}))})))):null):null)}Xse.propTypes={apiCheck:xC.bool,mode:xC.string,onLivenessDetectionDone:xC.func,onClose:xC.func,onError:xC.func,captureFrameSettings:xC.shape({}),onFramesCaptured:xC.func,frontCamera:xC.bool,customDirectionIcon:xC.shape({}),customStepTimeConstraints:xC.shape({}),onProcessing:xC.func,customErrors:xC.shape({}),livenessSettings:xC.shape({}),apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),outputEncryptionSettings:xC.shape({}),cameraScale:xC.number,defaultCameraId:xC.string,offsetFaceY:xC.number,styledComponent:xC.shape({CloseCameraButton:xC.node})},Xse.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(Nse={},Py(Nse,uL.FaceDirection.LEFT,xw.createElement(w7,{type:uL.FaceDirection.LEFT})),Py(Nse,uL.FaceDirection.RIGHT,xw.createElement(w7,{type:uL.FaceDirection.RIGHT})),Py(Nse,uL.FaceDirection.UP,xw.createElement(w7,{type:uL.FaceDirection.UP})),Py(Nse,uL.FaceDirection.FRONTAL,xw.createElement(w7,{type:uL.FaceDirection.FRONTAL})),Nse),customStepTimeConstraints:(Lse={},Py(Lse,uL.FaceDirection.UP,{delayTime:0}),Py(Lse,uL.FaceDirection.LEFT,{delayTime:0}),Py(Lse,uL.FaceDirection.RIGHT,{delayTime:0}),Py(Lse,uL.FaceDirection.FRONTAL,{delayTime:2e3}),Lse),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,offsetFaceY:0,styledComponent:{CloseCameraButton:null}};var Yse=["logCredentials","clientSettings","livenessSettings","livenessComponent","customTheme"];function $se(e){var t=e.logCredentials,r=void 0===t?{enable:!0}:t,n=e.clientSettings,o=e.livenessSettings,i=e.livenessComponent,a=e.customTheme,s=void 0===a?{}:a,c=Vy(e,Yse),u=c.mode;if(u===uL.Mode.FLASH)return xw.createElement(yse,Ry({},c,{customTheme:s,clientSettings:n,logCredentials:r}));var l=y1(n,"data.settings.sdk_settings",{}),d={};return u===uL.Mode.ACTIVE&&(d=Oy(Oy({},null==l?void 0:l.passive_liveness_settings),null==l?void 0:l.active_liveness_settings)),u===uL.Mode.PASSIVE&&(d=Oy(Oy({},null==l?void 0:l.active_liveness_settings),null==l?void 0:l.passive_liveness_settings)),i?xw.createElement(hne,null,xw.createElement(cB,{theme:s},xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy({},r)}},xw.createElement(i,Ry({},c,{livenessSettings:Oy(Oy({},o),d)}))))):u===uL.Mode.ACTIVE?xw.createElement(hne,null,xw.createElement(cB,{theme:s},xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy({},r)}},xw.createElement(Xse,Ry({},c,{livenessSettings:Oy(Oy({},o),d)}))))):u===uL.Mode.PASSIVE?xw.createElement(hne,null,xw.createElement(cB,{theme:s},xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy({},r)}},xw.createElement(Ose,Ry({},c,{livenessSettings:Oy(Oy({},o),d)}))))):xw.createElement(hne,null,xw.createElement(cB,{theme:s},xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy({},r)}},xw.createElement(bre,Ry({},c,{livenessSettings:Oy(Oy({},o),d)})))))}var Zse={DEFAULT:"default",ERROR:"error"};function Jse(e){var t=e.className,r=e.width,n=e.height,o=e.type,i=e.strokeStyles,a=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=e.defaultRectStyles,l=e.errorRectStyles,d=s+.8*a,f=xw.useMemo((function(){var e;return Oy((Py(e={},Zse.DEFAULT,u),Py(e,Zse.ERROR,l),e),i)}),[u,l,i])[o];return xw.createElement("svg",{width:r,height:n,className:t},xw.createElement("rect",{x:a/2,y:a/2,rx:s,ry:s,width:r-a,height:n-a,style:f}),xw.createElement("path",{d:"M0,".concat(d," Q0,0 ").concat(d,",0 L0,0 Z"),style:c}),xw.createElement("path",{d:"M0,".concat(n-d," Q0,").concat(n," ").concat(d,",").concat(n," L0,").concat(n," Z"),style:c}),xw.createElement("path",{d:"M".concat(r-d,",").concat(n," Q").concat(r,",").concat(n," ").concat(r,",").concat(n-d," L").concat(r,",").concat(n," Z"),style:c}),xw.createElement("path",{d:"M".concat(r-d,",0 Q").concat(r,",0 ").concat(r,",").concat(d," L").concat(r,",0 Z"),style:c}))}Jse.propTypes={className:xC.string,width:xC.number,height:xC.number,strokeWidth:xC.number,strokeStyles:xC.shape({}),type:xC.oneOf([Zse.DEFAULT,Zse.ERROR]),radius:xC.number,paddingStyle:xC.shape({}),defaultRectStyles:xC.shape({}),errorRectStyles:xC.shape({})},Jse.defaultProps={className:"",width:Are.IDCapturing.rectangleMask.width,height:Are.IDCapturing.rectangleMask.height,strokeWidth:Are.IDCapturing.rectangleMask.strokeWidth,strokeStyles:Are.IDCapturing.rectangleMask.strokeStyles,type:Zse.DEFAULT,radius:Are.IDCapturing.rectangleMask.radius,paddingStyle:Are.IDCapturing.rectangleMask.paddingStyle,defaultRectStyles:Are.IDCapturing.rectangleMask.default,errorRectStyles:Are.IDCapturing.rectangleMask.error};var ece=uL.Errors,tce=function(e,t){var r,n,o,i,a,s,c;return{width:null!==(r=e.width)&&void 0!==r?r:t5(t,"IDCapturing.rectangleMask.width",Are),height:null!==(n=e.height)&&void 0!==n?n:t5(t,"IDCapturing.rectangleMask.height",Are),strokeWidth:null!==(o=e.strokeWidth)&&void 0!==o?o:t5(t,"IDCapturing.rectangleMask.strokeWidth",Are),radius:null!==(i=e.radius)&&void 0!==i?i:t5(t,"IDCapturing.rectangleMask.radius",Are),paddingStyle:null!==(a=e.paddingStyle)&&void 0!==a?a:t5(t,"IDCapturing.rectangleMask.paddingStyle",Are),defaultRectStyles:null!==(s=e.default)&&void 0!==s?s:t5(t,"IDCapturing.rectangleMask.default",Are),errorRectStyles:null!==(c=e.error)&&void 0!==c?c:t5(t,"IDCapturing.rectangleMask.error",Are)}};function rce(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function nce(e,t){return Math.sqrt(rce(e,t))}function oce(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=window,o=n.cv,i=t.width,a=t.height,s=r;s<1&&(s=parseInt(.5*(a+i)*s,10));var c=o.imread(t),u=new o.Mat;return o.copyMakeBorder(c,u,s,s,s,s,o.BORDER_CONSTANT,new o.Scalar(0,0,0,255)),c.delete(),{mat:u,margin:s}}function ice(e,t){var r=window.cv,n=Ky(t.map((function(e){return e.location})),4),o=n[0],i=n[1],a=n[2],s=n[3],c=nce(a,s),u=nce(i,o),l=Math.max(c,u),d=nce(i,a),f=nce(o,s),p=Math.max(d,f),h=[o.x,o.y,i.x,i.y,a.x,a.y,s.x,s.y],m=[0,0,l-1,0,l-1,p-1,0,p-1],g=r.imread(e),v=new r.Mat,y=new r.Size(l,p),b=r.matFromArray(4,1,r.CV_32FC2,h),w=r.matFromArray(4,1,r.CV_32FC2,m),C=r.getPerspectiveTransform(b,w);r.warpPerspective(g,v,C,y,r.INTER_LINEAR,r.BORDER_CONSTANT,new r.Scalar);var k=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),w.delete(),k}function ace(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},o={x:r.x-e.x,y:r.y-e.y},i=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),a=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(i*a))/Math.PI}function sce(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;t.forEach((function(e){var t=e.location,r=t.x,n=t.y;o=Math.min(o,r),i=Math.min(i,n),a=Math.max(a,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&i/n>=c&&(n-s)/n>=c&&(r-a)/r>=c}function cce(){return uce.apply(this,arguments)}function uce(){return(uce=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=t.canvas,n=t.paddingPercent,o=void 0===n?.04:n,i=r.width,a=r.height,s=Math.floor(i*o),c=Math.floor(a*o),u=i-2*s,l=a-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(r,s,c,u,l,0,0,u,l),e.abrupt("return",nq.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lce(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,i=ace(e[r].location,e[n].location,e[o].location);if(i<70||i>110)return!1}return!0}function dce(e){return fce.apply(this,arguments)}function fce(){return(fce=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.blazefaceModel,n=t.predictedIdCardCanvas,o=t.frontSide,i=n.width,a=n.height,s=Math.floor(i/3),c=Math.floor(4*a/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(a/5),s,c,0,0,s,c),e.next=12,GV.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=Ky(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4)&&!(FV.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[GV.SIZE,GV.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",ece.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",ece.id_detector_error_front_side_multiple_faces);case 20:e.next=24;break;case 22:if(!(p>0)){e.next=24;break}return e.abrupt("return",ece.id_detector_error_back_side_has_faces);case 24:return e.abrupt("return",null);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pce,hce,mce,gce,vce,yce,bce,wce,Cce,kce,Sce,Ece,Bce,_ce,xce,Tce,Ace,Ice,Pce=function(e){var t=y1(e,"card.corners");if(t&&Array.isArray(t)&&t.length>0){var r=y1(t,"[0].location"),n=r.x,o=r.y;return"".concat(n,":").concat(o)}return"-1:-1"},Rce=function(e){var t,r,n,o,i,a,s=e.canvas,c=e.cardPosition,u=e.quality,l=void 0===u?1:u;if(!c||!c.corners||!Array.isArray(c.corners))return null;var d=Ky(c.corners,3),f=d[0],p=d[1],h=d[2],m=(null==p||null===(t=p.location)||void 0===t?void 0:t.x)-(null==f||null===(r=f.location)||void 0===r?void 0:r.x)-2*xre,g=(null==h||null===(n=h.location)||void 0===n?void 0:n.y)-(null==p||null===(o=p.location)||void 0===o?void 0:o.y)-2*xre,v=document.createElement("canvas");v.width=m,v.height=g,v.getContext("2d").drawImage(s,(null==f||null===(i=f.location)||void 0===i?void 0:i.x)+xre,(null==f||null===(a=f.location)||void 0===a?void 0:a.y)+xre,m,g,0,0,m,g);var y=v.toDataURL("image/jpeg",l);return zj.base64ToMD5({base64:y}).toString()},Dce=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.cardPosition,o=t.quality,i=t.count,a=void 0===i?3:i,n&&n.corners&&Array.isArray(n.corners)){e.next=3;break}return e.abrupt("return",[]);case 3:s=[];case 4:if(!(s.length<a)){e.next=12;break}if(c=performance.now(),u=Rce({canvas:r,cardPosition:n,quality:o}),s.push(u),!(s.length<a)){e.next=10;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=Math.floor(performance.now()-c),t=180-c>0?180-c:0,e.next=4,new Promise((function(e){return setTimeout(e,t)}));case 4:case"end":return e.stop()}}),e)}))(),"t0",10);case 10:e.next=4;break;case 12:return e.abrupt("return",s);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Oce=function(e,t){var r;if(0===t.length||t.includes("vn.national_id"))return!0;if("cmnd_new.back"===e&&t.includes("vn.cccd")||"cccd.back"===e&&t.includes("vn.cmnd_new"))return!0;var n=t.map((function(e){return e.replace("vn.","")})),o=null===(r=e.split("."))||void 0===r?void 0:r.filter((function(e){return"front"!==e&&"back"!==e&&"vn"!==e}));return n.some((function(e){return o.some((function(t){return e===t}))}))},Nce=["width","height","type"],Lce=dB(Jse)(pce||(pce=Wy([""]))),Mce=dB.img(hce||(hce=Wy(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),Fce=$7,Uce=kte,jce=dB.div(mce||(mce=Wy(["\n ","\n ","\n"])),eee,Bte),Vce=dB.img(gce||(gce=Wy(["\n border-radius: 5px;\n opacity: 0.7;\n width: ",";\n height: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.cardIcon.width",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.cardIcon.height",Are)})),zce=10,qce=60,Hce=dB.div(vce||(vce=Wy(["\n cursor: pointer;\n text-align: center;\n width: ",";\n height: ",";\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.captureIcon.width",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.captureIcon.height",Are)}),s5+20,b1.isMobile?YE(["top:",";"],(function(e){return e.y})):YE(["bottom:","px;"],zce)),Wce=dB.div(yce||(yce=Wy(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ",";\n height: ",";\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.loadingIcon.width",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.loadingIcon.height",Are)}),s5+20),Kce=dB.div(bce||(bce=Wy(["\n color: #fff;\n text-align: center;\n"]))),Qce=dB.div(wce||(wce=Wy(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),s5+20),Gce=dB.div(Cce||(Cce=Wy(["\n display: flex;\n align-items: center;\n"]))),Xce=dB(Kce)(kce||(kce=Wy(["\n margin-left: 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.title.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.title.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.title.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.title.backgroundColor",Are)})),Yce=dB(Kce)(Sce||(Sce=Wy(["\n font-size: 20px;\n margin-left: 10px;\n color: green;\n position: absolute;\n left: 0;\n top: 10px;\n background: white;\n z-index: ",";\n"])),s5+30),$ce=dB(Kce)(Ece||(Ece=Wy(["\n position: absolute;\n text-align: center;\n top: ",";\n z-index: ",";\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){return e.y}),s5+20,(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.border",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.borderRadius",Are)})),Zce=dB($ce)(Bce||(Bce=Wy(["\n padding: ",";\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.padding",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.border",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.borderRadius",Are)})),Jce=dB(Kce)(_ce||(_ce=Wy(["\n position: absolute;\n text-align: center;\n padding: 5px 10px;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){return e.y}),s5+20,(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.border",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.borderRadius",Are)})),eue=(dB.div(xce||(xce=Wy(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),function(e){var t=e.width,r=e.height,n=e.type,o=Vy(e,Nce),i=mB(),a=Jj.useAsset("id_card_frame.png"),s=Jj.useAsset("id_card_frame_error.png"),c=tce(e,i);return xw.createElement(jce,{width:t,height:r},xw.createElement(Mce,{src:n===Zse.ERROR?s:a,width:t,height:r}),xw.createElement(Lce,Ry({type:n},o,c)))}),tue=uL.IDCardMessage,rue=dB.div(Tce||(Tce=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n ","\n"])),(function(e){var t=e.theme;return YE(["border-radius:",";padding:",";"],t5(t,"popup.borderRadius",e5),t5(t,"IDCapturing.timeoutPopup.padding",Are))})),nue=dB.div(Ace||(Ace=Wy(["\n ","\n"])),(function(e){var t=e.theme;return YE(["color:",";font-size:",";font-weight:",";text-align:",";border:",";border-radius:",";"],t5(t,"IDCapturing.timeoutPopup.text.color",Are),t5(t,"IDCapturing.timeoutPopup.text.fontSize",Are),t5(t,"IDCapturing.timeoutPopup.text.fontWeight",Are),t5(t,"IDCapturing.timeoutPopup.text.textAlign",Are),t5(t,"IDCapturing.timeoutPopup.text.border",Are),t5(t,"IDCapturing.timeoutPopup.text.borderRadius",Are))})),oue=dB.button(Ice||(Ice=Wy(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: ",";\n cursor: pointer;\n ","\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.timeoutPopup.button.height",Are)}),(function(e){var t=e.theme;return YE(["color:",";font-size:",";font-weight:",";background-color:",";border:",";border-radius:",";outline:",";"],t5(t,"IDCapturing.timeoutPopup.button.color",Are),t5(t,"IDCapturing.timeoutPopup.button.fontSize",Are),t5(t,"IDCapturing.timeoutPopup.button.fontWeight",Are),t5(t,"IDCapturing.timeoutPopup.button.backgroundColor",Are),t5(t,"IDCapturing.timeoutPopup.button.border",Are),t5(t,"IDCapturing.timeoutPopup.button.borderRadius",Are),t5(t,"IDCapturing.timeoutPopup.button.outline",Are))})),iue=function(e){var t=e.onOk,r=e.maxSessionTime,n=yj.useSDKSettings().lang;return xw.createElement(rue,null,xw.createElement(nue,{className:"popup-message"},i9(tue.TIMEOUT_INSTRUCTION[n])({x:r})),xw.createElement(oue,{className:"popup-button",onClick:t},_re.BTN_OK[n]))};iue.propTypes={onOk:xC.func,maxSessionTime:xC.number},iue.defaultProps={onOk:function(){},maxSessionTime:30};var aue=function(){var e=Ky(xw.useState(!1),2),t=e[0],r=e[1],n=Ky(xw.useState(null),2),o=n[0],i=n[1],a=Ky(xw.useState({}),2),s=a[0],c=a[1];return{showPopup:xw.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),i(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},sue={SESSION_TIMEOUT:"SESSION_TIMEOUT",CONFIRM:"CONFIRM",QR_INVALID:"QR_INVALID",QR_INSTRUCTIONS:"QR_INSTRUCTIONS"};function cue(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}var uue=cue;function lue(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=q5(r))==r?r:0),void 0!==t&&(t=(t=q5(t))==t?t:0),uue(q5(e),t,r)}var due=lue,fue="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function pue(){return hue.apply(this,arguments)}function hue(){return(hue=xy(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.url,n=void 0===r?fue:r,e.abrupt("return",new Promise((function(e,t){var r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("type","text/javascript"),r.setAttribute("id","opencvjs"),r.addEventListener("load",xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!window.cv||!window.cv.getBuildInformation){t.next=4;break}e(),t.next=12;break;case 4:if(!(window.cv instanceof Promise)){t.next=11;break}return t.next=7,window.cv;case 7:window.cv=t.sent,e(),t.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return t.stop()}}),t)})))),r.addEventListener("error",(function(){t()})),r.src=n;var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(r,o)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var mue=S9(pue),gue={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},vue={vn:.4,ph:.5},yue={0:"top-left",1:"top-right",2:"bottom-right",3:"bottom-left",4:"cccd.front",5:"passport",6:"cmnd_old.front",7:"cmnd_old.back",8:"cmnd_new.front",9:"cmnd_new.back",10:"cccd_new.front",11:"cccd_new.back",12:"aadhaar_front",13:"aadhaar_back",14:"voter_front",15:"voter_back",16:"pan",17:"dl",18:"india_spassport",19:"aadhaar_letter",20:"pan_back",21:"passport_back",22:"unseen",23:"other",24:"BUREAU OF INTERNAL REVENUE",25:"COMMISSION ON ELECTIONS",26:"COVID VACCINATION CARD",27:"DRIVERS LICENSE",28:"HEALTH INSURANCE PHILHEALTH",29:"PAG-IBIG LOYALTY CARD",30:"PASSPORT",31:"PHILIPPINE IDENTIFICATION CARD",32:"POSTAL IDENTITY CARD",33:"PROFESSIONAL IDENTIFICATION CARD",34:"RESIDENT IDENTIFICATION CARD",35:"SOCIAL SECURITY SYSTEM",36:"UNIFIED MULTI PURPOSE ID",37:"VN_biz_license",38:"new_voter_front"};function bue(e){var t,r,n,o,i,a=e.card,s=e.corners,c=a.box,u={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},l=c[2]-c[0],d=c[1]-c[3],f=nb(s);try{for(f.s();!(i=f.n()).done;){var p=i.value;switch(p.label){case"top-left":t||(t=p.location);break;case"top-right":r||(r=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":o||(o=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![t,r,n,o].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(t.x+n.x)/2,y:(t.y+n.y)/2},m={x:(r.x+o.x)/2,y:(r.y+o.y)/2},g=rce(u,h),v=rce(u,m);return Math.sqrt(g)>(l+d)/8||Math.sqrt(v)>(l+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var wue=function(){function e(t){Ty(this,e),this.country=t||"vn",this.defaultModelUrl=gue[this.country]||gue.vn}var t,r,n,o,i,a,s;return Iy(e,[{key:"load",value:(s=xy(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.opencvUrl,n=t.modelUrl,e.next=3,Promise.all([mue({url:r}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"predictDummyInput",value:(a=xy(regeneratorRuntime.mark((function e(){var t,r,n,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,n=r.tidy((function(){var e=r.zeros(o.inputShape,"float32");return o.model.predict(e)})),e.abrupt("return",Promise.all([n[this.out_score_name].data()]));case 3:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"loadModel",value:(i=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,Vq.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,i=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),a=Ky(i,3),this.out_score_name=a[0],this.out_class_name=a[1],this.out_box_name=a[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadResource",value:(o=xy(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,Vq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"dispose",value:(n=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.model&&this.model.dispose();case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"predict",value:(r=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,C,k,S,E,B,_,x,T,A,I,P,R=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=R.length>1&&void 0!==R[1]?R[1]:{},n=r.imgMargin,o=r.detectThreshold,i=void 0===o?.3:o,a=r.maxNumReturns,s=void 0===a?100:a,c=window,u=c.cv,l={},d=t.width,f=t.height,l.originalWidth=d,l.originalHeight=f,p=oce({canvas:t,imgMargin:"number"==typeof n?n:vue[this.country]}),h=p.margin,m=p.mat,g=this.inputShape.slice(1,3),v=Ky(g,2),y=v[0],b=v[1],w=new u.Mat,u.resize(m,w,new u.Size(y,b),0,0,u.INTER_AREA),C=m.cols/y,k=m.rows/b,(S=document.createElement("canvas")).width=y,S.height=b,S.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(w.data),w.cols,w.rows),0,0),m.delete(),w.delete(),l.canvas=S,l.margin=h,E=performance.now(),e.next=25,this.detect(S,{detectThreshold:i,maxNumReturns:s});case 25:if(B=e.sent,_=Math.floor(performance.now()-E),x={inputImage:l,card:null,exeTime:_},T=[[],[],[],[]],A=[],I=[],B.forEach((function(e){var t=Ky(e.box,4),r=t[0],n=t[1],o=t[2],i=t[3];e.clazz<=3?T[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:due(Math.floor((i+n)/2*C-h),0,d),y:due(Math.floor((r+o)/2*k-h),0,f)},scaledLocation:{x:due(Math.floor((i+n)/2),0,S.width),y:due(Math.floor((r+o)/2),0,S.height)}}):I.push({label:e.label,score:e.score,box:[due(Math.floor(r*k-h),0,f),due(Math.floor(n*C-h),0,d),due(Math.floor(o*k-h),0,f),due(Math.floor(i*C-h),0,d)]})})),T.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),A.push(e[0]))})),!(I.length>0&&4===A.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),A.sort((function(e,t){return e.clazz-t.clazz})),P=I[0],e.prev=37,bue({card:P,corners:A})){e.next=41;break}return console.debug("Not qualified.",P,A),e.abrupt("return",x);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",x);case 46:return P.corners=A,x.card=P,e.abrupt("return",x);case 49:return e.abrupt("return",x);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return r.apply(this,arguments)})},{key:"detect",value:(t=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,C,k,S,E,B=this,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.length>1&&void 0!==_[1]?_[1]:{},n=r.detectThreshold,o=r.maxNumReturns,i=window,a=i.tf,s=t.width,c=t.height,u=a.tidy((function(){var e=a.expandDims(a.cast(a.image.resizeBilinear(a.browser.fromPixels(t),B.inputShape.slice(1,3)),"float32"));return B.model.predict(e)})),e.next=7,Promise.all([u[this.out_score_name].data(),u[this.out_class_name].data(),u[this.out_box_name].array()]);case 7:l=e.sent,d=Ky(l,3),f=d[0],p=d[1],h=Ky(d[2],1),m=h[0],g=Math.min(f.length,o),v=[];try{for(y=0;y<g;y++)b=f[y],w=p[y],b>n&&(k=null!==(C=yue[Math.round(w)])&&void 0!==C?C:"NA",S=m[y],E=[S[0]*c,S[3]*s,S[2]*c,S[1]*s],v.push({score:b,clazz:w,box:E,label:k}))}catch(e){console.log(e)}return e.abrupt("return",v.length>=5?v:[]);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();class Cue{static hasCamera(){return Cue.listCameras(!1).then((e=>!!e.length)).catch((()=>!1))}static listCameras(e=!1){if(!navigator.mediaDevices)return Promise.resolve([]);let t=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((e=>t=e)).catch((()=>{})):Promise.resolve()).then((()=>navigator.mediaDevices.enumerateDevices())).then((e=>e.filter((e=>"videoinput"===e.kind)).map(((e,t)=>({id:e.deviceId,label:e.label||(0===t?"Default Camera":`Camera ${t+1}`)}))))).finally((()=>{if(t)for(const e of t.getTracks())e.stop(),t.removeTrack(e)}))}constructor(e,t,r=this._onDecodeError,n=this._calculateScanRegion,o="environment"){this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=t,this._legacyCanvasSize=Cue.DEFAULT_CANVAS_SIZE,this._preferredCamera=o,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof r?(this._legacyCanvasSize=r,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=r,"number"==typeof n?(this._legacyCanvasSize=n,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=n,this._scanRegion=this._calculateScanRegion(e),this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let i=!1;e.hidden&&(e.hidden=!1,i=!0),document.body.contains(e)||(document.body.appendChild(e),i=!0),requestAnimationFrame((()=>{const t=window.getComputedStyle(e);"none"===t.display&&(e.style.setProperty("display","block","important"),i=!0),"visible"!==t.visibility&&(e.style.setProperty("visibility","visible","important"),i=!0),i&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity=0,e.style.width=0,e.style.height=0)})),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),this._qrEnginePromise=Cue.createQrEngine()}hasFlash(){let e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((({stream:t})=>(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=t,t.getVideoTracks()[0])))).then((e=>"torch"in e.getSettings())).catch((()=>!1)).finally((()=>{if(e)for(const t of e.getTracks())t.stop(),e.removeTrack(t)}))}isFlashOn(){return this._flashOn}toggleFlash(){return this._flashOn?this.turnFlashOff():this.turnFlashOn()}turnFlashOn(){return this._flashOn?Promise.resolve():(this._flashOn=!0,!this._active||this._paused?Promise.resolve():this.hasFlash().then((e=>e?this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]}):Promise.reject("No flash available"))).catch((()=>{throw this._flashOn=!1,e})))}turnFlashOff(){if(this._flashOn)return this._flashOn=!1,this._restartVideoStream()}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.stop(),Cue._postWorkerMessage(this._qrEnginePromise,"close")}start(){return this._active&&!this._paused?Promise.resolve():("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,document.hidden?Promise.resolve():(this._paused=!1,this.$video.srcObject?(this.$video.play(),Promise.resolve()):this._getCameraStream().then((({stream:e,facingMode:t})=>{this.$video.srcObject=e,this.$video.play(),this._setVideoMirror(t),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch((()=>{})))})).catch((e=>{throw this._active=!1,e}))))}stop(){this.pause(),this._active=!1}pause(e=!1){if(this._paused=!0,!this._active)return Promise.resolve(!0);this.$video.pause();const t=()=>{const e=this.$video.srcObject?this.$video.srcObject.getTracks():[];for(const t of e)t.stop(),this.$video.srcObject.removeTrack(t);this.$video.srcObject=null};return e?(t(),Promise.resolve(!0)):new Promise((e=>setTimeout(e,300))).then((()=>!!this._paused&&(t(),!0)))}setCamera(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}static scanImage(e,t=null,r=null,n=null,o=!1,i=!1){const a=r instanceof Worker;let s=Promise.all([r||Cue.createQrEngine(),Cue._loadImage(e)]).then((([e,i])=>{let s;return r=e,[n,s]=this._drawToCanvas(i,t,n,o),r instanceof Worker?(a||r.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,t)=>{let o,i,a;i=n=>{"qrResult"===n.data.type&&(r.removeEventListener("message",i),r.removeEventListener("error",a),clearTimeout(o),null!==n.data.data?e(n.data.data):t(Cue.NO_QR_CODE_FOUND))},a=e=>{r.removeEventListener("message",i),r.removeEventListener("error",a),clearTimeout(o);const n=e?e.message||e:"Unknown Error";t("Scanner error: "+n)},r.addEventListener("message",i),r.addEventListener("error",a),o=setTimeout((()=>a("timeout")),1e4);const c=s.getImageData(0,0,n.width,n.height);r.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise(((e,t)=>{const o=setTimeout((()=>t("Scanner error: timeout")),1e4);r.detect(n).then((r=>{r.length?e(r[0].rawValue):t(Cue.NO_QR_CODE_FOUND)})).catch((e=>t("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(o)))}))}));return t&&i&&(s=s.catch((()=>Cue.scanImage(e,null,r,n,o)))),s=s.finally((()=>{a||Cue._postWorkerMessage(r,"close")})),s}setGrayscaleWeights(e,t,r,n=!0){Cue._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:t,blue:r,useIntegerApproximation:n})}setInversionMode(e){Cue._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=Cue.WORKER_PATH){return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((t=>-1!==t.indexOf("qr_code")?new BarcodeDetector({formats:["qr_code"]}):new Worker(e)))}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video)}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){const t=Math.min(e.videoWidth,e.videoHeight),r=Math.round(2/3*t);return{x:Math.round((e.videoWidth-r)/2),y:Math.round((e.videoHeight-r)/2),width:r,height:r,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_scanFrame(){if(!this._active||this.$video.paused||this.$video.ended)return!1;requestAnimationFrame((()=>{this.$video.readyState<=1?this._scanFrame():this._qrEnginePromise.then((e=>Cue.scanImage(this.$video,this._scanRegion,e,this.$canvas))).then(this._onDecode,(e=>{if(!this._active)return;-1!==(e.message||e).indexOf("service unavailable")&&(this._qrEnginePromise=Cue.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==Cue.NO_QR_CODE_FOUND&&console.log(e)}_getCameraStream(){if(!navigator.mediaDevices)return Promise.reject("Camera not found.");const e="environment"===this._preferredCamera||"user"===this._preferredCamera?"facingMode":"deviceId",t=[{width:{min:1024}},{width:{min:768}},{}];return[...t.map((t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}}))),...t].reduceRight(((e,t)=>()=>navigator.mediaDevices.getUserMedia({video:t,audio:!1}).then((e=>({stream:e,facingMode:this._getFacingMode(e)||(t.facingMode?this._preferredCamera:"environment"===this._preferredCamera?"user":"environment")}))).catch(e)),(()=>Promise.reject("Camera not found.")))()}_restartVideoStream(){const e=this._paused;return this.pause(!0).then((t=>{if(t&&!e&&this._active)return this.start()}))}_setVideoMirror(e){const t="user"===e?-1:1;this.$video.style.transform="scaleX("+t+")"}_getFacingMode(e){const t=e.getVideoTracks()[0];return t?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}static _drawToCanvas(e,t=null,r=null,n=!1){r=r||document.createElement("canvas");const o=t&&t.x?t.x:0,i=t&&t.y?t.y:0,a=t&&t.width?t.width:e.width||e.videoWidth,s=t&&t.height?t.height:e.height||e.videoHeight;if(!n){const e=t&&t.downScaledWidth?t.downScaledWidth:a,n=t&&t.downScaledHeight?t.downScaledHeight:s;r.width!==e&&(r.width=e),r.height!==n&&(r.height=n)}const c=r.getContext("2d",{alpha:!1});return c.imageSmoothingEnabled=!1,c.drawImage(e,o,i,a,s,0,0,r.width,r.height),[r,c]}static _loadImage(e){if(e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||window.ImageBitmap&&e instanceof window.ImageBitmap||window.OffscreenCanvas&&e instanceof window.OffscreenCanvas)return Promise.resolve(e);if(e instanceof Image)return Cue._awaitImageLoad(e).then((()=>e));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){const t=new Image;return e instanceof File||e instanceof Blob?t.src=URL.createObjectURL(e):t.src=e,Cue._awaitImageLoad(t).then((()=>((e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(t.src),t)))}return Promise.reject("Unsupported image type.")}static _awaitImageLoad(e){return new Promise(((t,r)=>{if(e.complete&&0!==e.naturalWidth)t();else{let n,o;n=()=>{e.removeEventListener("load",n),e.removeEventListener("error",o),t()},o=()=>{e.removeEventListener("load",n),e.removeEventListener("error",o),r("Image load error")},e.addEventListener("load",n),e.addEventListener("error",o)}}))}static _postWorkerMessage(e,t,r){return Promise.resolve(e).then((e=>{e instanceof Worker&&e.postMessage({type:t,data:r})}))}}function kue(){return Sue.apply(this,arguments)}function Sue(){return(Sue=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Cue.WORKER_PATH=mW(),e.next=3,Cue.createQrEngine(Cue.WORKER_PATH);case 3:return t=e.sent,e.abrupt("return",{qrEngine:t});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Eue(){return Bue.apply(this,arguments)}function Bue(){return(Bue=xy(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([kue()]);case 2:return t=e.sent,r=Ky(t,1),n=r[0].qrEngine,e.abrupt("return",{qrScannerResources:{engine:n,canvas:document.createElement("canvas")},noModel:!0});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}Cue.DEFAULT_CANVAS_SIZE=400,Cue.NO_QR_CODE_FOUND="No QR code found",Cue.WORKER_PATH="qr-scanner-worker.min.js";var _ue="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function xue(){return Tue.apply(this,arguments)}function Tue(){return(Tue=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=xy(regeneratorRuntime.mark((function e(){var t,r,n,a,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="detect.prototxt",r="detect.caffemodel",n="sr.prototxt",a="sr.caffemodel",o){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return u=[i(t),i(r),i(n),i(a)],e.next=11,Promise.all(u);case 11:l=e.sent,d=Ky(l,4),f=d[0],p=d[1],h=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",p,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",h,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),o=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},a=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?_ue:r,i=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(t));case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:return o=e.sent,e.abrupt("return",new Uint8Array(o));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,a();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",Eue());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var Aue=S9(xue),Iue=900;function Pue(e){return Rue.apply(this,arguments)}function Rue(){return(Rue=xy(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,e.abrupt("return",new Promise((function(e,t){setTimeout(t,Iue),r.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Due(e){return Oue.apply(this,arguments)}function Oue(){return(Oue=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,n=!0,e.prev=2,o=performance.now(),e.next=6,Pue({idCardModel:r});case 6:(i=performance.now())-o+.6*(i-o)>Iue&&(n=!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n=!1;case 13:return e.abrupt("return",{fastEnough:n});case 14:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function Nue(){return Lue.apply(this,arguments)}function Lue(){return(Lue=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,i=t.tfScriptUrls,a=t.wechatQRModelsUrl,s=h.length>1?h[1]:void 0,e.next=4,T9({blazefaceModelUrl:o,tfScriptUrls:i});case 4:return c=e.sent,u=c.blazefaceModel,l=!0,d=new wue(s),e.prev=8,e.next=11,d.load({opencvUrl:r,modelUrl:n});case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(8),e.abrupt("return",{ableToUseModel:!1});case 16:return e.next=18,Aue({modelUrl:a});case 18:return e.prev=18,e.next=21,Due({idCardModel:d});case 21:f=e.sent,p=f.fastEnough,l=p,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),l=!1;case 29:return e.abrupt("return",{ableToUseModel:l,idCardModel:d,blazefaceModel:u});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var Mue=S9(Nue),Fue=uL.Errors,Uue=function(){return{imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}},jue=function(){return{imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}};function Vue(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.allowedCardTypes,a=e.onError,s=e.frontSide,c=e.onAutoCaptureSuccess,u=e.quality,l=xw.useRef(null);null===l.current&&(l.current=document.createElement("canvas"));var d=xw.useRef([]),f=xw.useRef({}),p=xw.useRef(!1),h=xw.useRef([]),m=xw.useRef(!1),g=xw.useRef(null),v=Ky(xw.useState(!1),2),y=v[0],b=v[1],w=xw.useRef(Uue()),C=xw.useRef(jue()),k=xw.useRef(!1),S=xw.useRef(!1),E=xw.useRef(null),B=xw.useRef(!1),_=xw.useRef({}),x=yj.useSDKSettings(),T=x.customUrls,A=x.country,I=xw.useMemo((function(){return Array.isArray(i)&&i.length>0?i:null==o?void 0:o.allowedCardTypesFromSettings}),[i,null==o?void 0:o.allowedCardTypesFromSettings]);xw.useEffect((function(){var e=!1;function t(){return(t=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||y){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,Mue(T,A);case 4:return _.current=t.sent,t.next=7,Vq.initTensorFlow();case 7:E.current=o.enableBlurCheck&&_.current.ableToUseModel,t.next=11;break;case 10:E.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:b(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[y,o,T,A]);var P=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dce({canvas:l.current,cardPosition:t,quality:u});case 2:d.current=e.sent;case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u]),R=xw.useCallback((function(){!0===m.current&&(m.current=!1)}),[]),D=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,i,a,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,i=o.blurThreshold,a=w.current,s=C.current,p.current=!1,!(r<i&&BV.hasBetterCardBlurScore(r,a.blurScore))){e.next=20;break}if(!B.current){e.next=10;break}a.imageBlob=s.imageBlob,e.next=16;break;case 10:return c=l.current,a.hash=Rce({canvas:c,cardPosition:n,quality:u}),e.next=14,xV.takePicture({canvas:c,quality:u});case 14:a.imageBlob=e.sent,a.captureTime=Date.now();case 16:a.takenAt=(new Date).getTime(),a.blurScore=r,a.detectedCard=n,a.captureType="auto";case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,u]),O=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,S.current=!0,o=C.current,!BV.hasBetterCardBlurScore(r,o.blurScore)){e.next=16;break}return i=l.current,o.hash=Rce({canvas:i,cardPosition:n,quality:u}),e.next=8,xV.takePicture({canvas:i,quality:u});case 8:o.imageBlob=e.sent,o.captureDuration+=Date.now()-o.captureTime,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,o.captureCount++,o.captureType="manual",B.current=!0;case 16:S.current=!1;case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u]),N=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.waitForBestImageTimeMs,r=o.enableVirtualCamHashes,null===(n=w.current).imageBlob){e.next=12;break}if(!((new Date).getTime()-n.takenAt>t)){e.next=12;break}if(!r){e.next=9;break}p.current=!0,e.next=12;break;case 9:return e.next=11,c(n);case 11:R();case 12:case"end":return e.stop()}}),e)}))),[o,c,R]),L=xw.useCallback((function(){k.current=!0}),[]),M=xw.useCallback((function(){return new Promise((function(e){k.current=!1;var t=setInterval((function(){S.current||(clearInterval(t),e())}),150)}))}),[]),F=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t=o.blurThreshold,r=o.enableVirtualCamHashes,n=C.current;if(n.captureTime=Date.now(),E.current)L(),setTimeout((function(){M().then(xy(regeneratorRuntime.mark((function o(){var i,a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(BV.hasBetterCardBlurScore(n.blurScore,t)||(n.error=Fue.id_detector_error_blur),i=l.current,null!==n.imageBlob){o.next=7;break}a=Rce({canvas:i,cardPosition:n.detectedCard}),xV.takePicture({canvas:i,quality:u}).then(function(){var t=xy(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),n.hash=a,!r){t.next=6;break}return t.next=6,P(n.detectedCard);case 6:e(n);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.next=11;break;case 7:if(!r){o.next=10;break}return o.next=10,P(n.detectedCard);case 10:e(n);case 11:case"end":return o.stop()}}),o)}))))}),2e3);else{var i=Rce({canvas:l.current,cardPosition:f.current,quality:u});xV.takePicture({canvas:l.current,quality:u}).then(function(){var t=xy(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),n.hash=i,!r){t.next=6;break}return t.next=6,P(n.detectedCard);case 6:e(n);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}})));case 1:case"end":return e.stop()}}),e)}))),[o,L,M,u,P]),U=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,i,u,f,v,b,S,E,x,T,L,M,F,U,j,V,z,q,H,W,K;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&y&&!m.current){e.next=2;break}return e.abrupt("return");case 2:w.current=Uue(),C.current=jue(),r=o.enableAutoCapture,n=o.enableBlurCheck,i=o.enableIdDetection,u=o.enableVirtualCamHashes,f=o.country,v=_.current,b=v.idCardModel,S=v.blazefaceModel,E=v.ableToUseModel,x=g.current,T=t.current,m.current=!0,L=x.cropX,M=x.cropY,F=x.cropWidth,U=x.cropHeight,j=x.cropWidthWithoutPadding,V=x.cropHeightWithoutPadding,(z=l.current).width=F,z.height=U,q=z.getContext("2d"),H=document.createElement("canvas"),W=H.getContext("2d"),K=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,l,g,v,y,_,x,Q;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(q.drawImage(T,L,M,F,U,0,0,F,U),t=performance.now(),B.current=!1,!i||!E){e.next=63;break}return l=null,e.next=7,b.predict(z,{detectThreshold:.3});case 7:if(g=e.sent,null==o||!o.trackCardCoordinates||C.current.imageBlob||w.current.imageBlob||h.current.push(Pce(g)),!g.card){e.next=59;break}if(!p.current&&!C.current.imageBlob&&d.current.length>0&&(d.current=[],p.current=!1),p.current&&setTimeout(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=3;break}return e.next=3,P(w.current.detectedCard);case 3:return e.next=5,c(w.current);case 5:R(),p.current=!1;case 7:case"end":return e.stop()}}),e)}))),0),!sce({corners:g.card.corners,width:F,height:U})){e.next=56;break}if(!lce(g.card.corners)){e.next=53;break}if(v=ice(z,g.card.corners),y=FV.rectAreaRatio({small:{area:v.width*v.height},big:{area:j*V}}),y1(o,"enableCardTypeCheck")&&I.length>0&&"vn"===f&&(_=y1(g,"card.label",""),Oce(_,I)||(l=Fue.not_allowed_card_types)),l){e.next=51;break}if(!(y<.5)){e.next=24;break}l=Fue.id_detector_card_too_small,e.next=51;break;case 24:if(!(y>.95)){e.next=28;break}l=Fue.id_detector_error_incomplete,e.next=51;break;case 28:return H.width=v.width,H.height=v.height,W.putImageData(v,0,0),e.next=33,cce({canvas:H});case 33:if(!e.sent){e.next=38;break}l=Fue.glare_detected,e.next=51;break;case 38:if("ph"===A){e.next=42;break}return e.next=41,dce({blazefaceModel:S,predictedIdCardCanvas:H,frontSide:s});case 41:l=e.sent;case 42:if(l){e.next=51;break}if(!n){e.next=51;break}if(x=BV.calculateIdCardBlurScore({canvas:H}),!k.current){e.next=48;break}return e.next=48,O({blurScore:x,detectedCard:g.card});case 48:if(!r){e.next=51;break}return e.next=51,D({blurScore:x,detectedCard:g.card});case 51:e.next=54;break;case 53:l=Fue.id_detector_validate_angle_error;case 54:e.next=57;break;case 56:l=Fue.id_detector_error_incomplete;case 57:e.next=60;break;case 59:l=Fue.id_detector_no_cards;case 60:return a(l),e.next=63,N();case 63:return t=Math.floor(performance.now()-t),Q=180-t>0?180-t:0,e.next=67,new Promise((function(e){return setTimeout(e,Q)}));case 67:m.current&&window.requestAnimationFrame(K);case 68:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(K);case 19:case"end":return e.stop()}}),e)}))),[o,y,t,a,N,c,R,A,P,s,O,D,I]);xw.useEffect((function(){var e=t.current;function o(){return(o=xy(regeneratorRuntime.mark((function t(){var r,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(g.current=xV.analyzeVideoAndWindowSizes(e,n,.05),r=g.current,o=r.cropWidth,i=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(i)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,U();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&y&&function(){o.apply(this,arguments)}()}),[r,n,t,R,U,y]);var j=xw.useCallback((function(){R()}),[R]);return xw.useEffect((function(){return j}),[j]),{refWorkingCanvas:l,stopCheckFrame:R,checkFrame:U,warmupDone:y,takePictureManually:F,refAbleToRunBurstMode:E,refVirtualFrames:d,refCardCoordinates:h}}var zue=function(){return{id:null,frames:[]}},que=180;function Hue(){return[zue()]}function Wue(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=xw.useRef(null);null===i.current&&(i.current=document.createElement("canvas"));var a=xw.useRef(!1),s=xw.useRef(Jz.createResizer({width:960,height:640})),c=xw.useRef(null),u=xw.useRef(Hue()),l=xw.useCallback((function(){!0===a.current&&(a.current=!1)}),[]),d=xw.useCallback((function(){u.current=Hue()}),[]),f=xw.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push(zue())}),[]),p=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,i,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,i=u.current,a=n.resize({srcCanvas:r}),c=a.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],i[i.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,s,u,l,d,f,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:if(r=o.frameCaptureIntervalMs,n=void 0===r?que:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:s=c.current,u=t.current,a.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=i.current).width=f,m.height=h,g=m.getContext("2d");case 13:return v=performance.now(),g.drawImage(u,l,d,f,h,0,0,f,h),e.next=18,p({workingCanvas:m});case 18:if(v=Math.floor(performance.now()-v),a.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,tV.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return xw.useEffect((function(){var e=t.current;function o(){return(o=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=xV.analyzeVideoAndWindowSizes(e,n),t.next=3,h();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return r&&n&&function(){o.apply(this,arguments)}(),function(){l()}}),[r,n,t,l,f,h]),{refWorkingCanvas:i,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var Kue=function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,i=e.onChange;xw.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,a=n.current,s=t[t.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==a?void 0:a.width,"canvas.height":null==a?void 0:a.height};i&&i(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[i,t,r,n,o])},Que=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,i=e.settings,a=e.shouldStartTimers,s=e.sessionTime,c=xw.useRef(),u=Ky(xw.useState(0),2),l=u[0],d=u[1],f=xw.useCallback((function(){clearInterval(c.current)}),[]),p=xw.useCallback((function(){d((function(e){return e+1}))}),[]);return xw.useEffect((function(){if(a){var e=i.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var i=s-(t+=1);i<=u&&r&&r({curTimeLeft:i}),t>0&&t%e==0&&o&&o(),0===i&&(f(),n&&n())}),1e3)}return function(){f()}}),[a,t,r,f,n,o,l,i,s]),{stopTimers:f,startTimers:p}};lW.initExifData();var Gue=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onModelErrorChange,a=e.frontSide,s=e.allowedCardTypes,c=e.onDebugInfoChange,u=e.onAboutToTimeout,l=e.onSessionTimeout,d=e.onCaptureDone,f=e.outputEncryptionSettings,p=e.quality,h=xw.useRef(!1),m=Ky(xw.useState(!1),2),g=m[0],v=m[1],y=xw.useRef((function(){})),b=Yj.useSDKTracking().sendEvent,w=xw.useRef(),C=xw.useRef(),k=xw.useRef(),S=yj.useSDKSettings(),E=S.debug,B=S.lang,_=S.enableAntiDebug,x=S.exifKey,T=hW(),A=T.startMotion,I=T.stopMotion,P=T.motionData,R=T.orientationData;xw.useEffect((function(){_&&zq.enableAntiDebug()}),[_]);var D=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b({tag:a?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,y.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[b,a]),O=xw.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.apply(void 0,t);var n=y1(t,"0.code");n&&n!==w.current&&(b({tag:a?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),w.current=n)}),[i,a,b]),N=Vue({refVideo:r,shouldStart:t,cropArea:n,allowedCardTypes:s,settings:o,onError:O,frontSide:a,onAutoCaptureSuccess:D,quality:p}),L=N.refWorkingCanvas,M=N.stopCheckFrame,F=N.checkFrame,U=N.warmupDone,j=N.takePictureManually,V=N.refAbleToRunBurstMode,z=N.refVirtualFrames,q=N.refCardCoordinates,H=Wue({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),W=H.stopCheckFrame,K=H.splitVideos,Q=H.resetRecordedVideos,G=H.checkFrame,X=H.refRecordedVideos;Kue({debug:E,refRecordedVideos:X,refWorkingCanvas:L,refVideo:r,onChange:c});var Y=xw.useCallback((function(){W(),M(),Q(),l()}),[Q,W,M,l]),$=xw.useCallback((function(){K()}),[K]),Z=Que({lang:B,onAboutToTimeout:u,onSessionTimeout:Y,onVideoTimeLimitReached:$,settings:o,shouldStartTimers:U&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),J=Z.stopTimers,ee=Z.startTimers,te=xw.useCallback((function(){h.current=!1}),[]),re=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return te(),ee(),e.next=4,Promise.all([G(),F()]);case 4:case"end":return e.stop()}}),e)}))),[te,ee,G,F]),ne=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,l,p,m,g,y,w,S,E,B,_,T=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=T.length>0&&void 0!==T[0]?T[0]:{},r=t.imageBlob,n=t.error,i=t.detectedCard,s=t.captureTime,c=t.captureCount,u=t.captureDuration,l=t.captureType,p=t.hash,!h.current){e.next=3;break}return e.abrupt("return");case 3:return h.current=!0,v(!0),W(),M(),J(),O(null),m=null==o?void 0:o.enableVirtualCamHashes,g={},m&&null!==p&&(y=[p].concat(Gy(z.current))).length>0&&(g=y.reduce((function(e,t,r){return e["hash".concat(r+1)]=t,e}),{})),w=null==o?void 0:o.trackCardCoordinates,S="[".concat(q.current.slice(-(null==o?void 0:o.trackCardCoordinatesMaxLength)).toString(),"]"),I(),lW.preWriteExif({mode:lW.MODE.ID_CARD,motionData:P,orientationData:R,startTime:C.current,endTime:Date.now(),exifKey:x}),e.next=18,lW.writeExif({mode:lW.MODE.ID_CARD,imageData:Oy(Oy({detectedCard:i,captureTime:s,blob:r},m?{vCam:g}:{}),{},{captureCount:c,captureDuration:u,captureType:l},w?{cardTracking:S}:{}),enableExifData:null==o?void 0:o.enableExifData});case 18:if(E=e.sent,!f||!f.key){e.next=24;break}return _=f.key,e.next=23,Wq.encrypt({blob:E,key:_});case 23:B=e.sent;case 24:d({image:{blob:E,encrypted:B,detectedCard:i},error:n,recordedVideos:[]}),v(!1),b({tag:a?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-k.current)/1e3}});case 27:case"end":return e.stop()}}),e)}))),[W,M,J,O,d,a,b,f,P,R,I,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,x,null==o?void 0:o.trackCardCoordinates,null==o?void 0:o.trackCardCoordinatesMaxLength,z,q]);y.current=ne;var oe=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),J(),W(),V.current||M(),e.next=6,j();case 6:return t=e.sent,e.next=9,ne(t);case 9:v(!1),b({tag:a?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[j,ne,J,V,W,M,b,a]);return xw.useEffect((function(){t&&(b({tag:a?"id_front":"id_back",event:"user_activity.start",log:{}}),C.current=Date.now(),A())}),[b,a,t,A]),xw.useEffect((function(){U&&(b({tag:a?"id_front":"id_back",event:"user_activity.show",log:{}}),b({tag:a?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-C.current}}),k.current=performance.now())}),[b,a,U]),{warmupDone:U,isProcessing:g,takePictureManually:oe,restartSession:re,resetIsProcessingImageBlobTaken:te}},Xue=uL.IDCardMessage,Yue=xw.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,i=e.refVideo,a=e.frontSide,s=e.allowedCardTypes,c=e.settings,u=e.onCaptureDone,l=e.onUISpacingChange,d=e.outputEncryptionSettings,f=mB(),p=Ky(xw.useState({}),2),h=p[0],m=p[1],g=h.yDescription,v=h.yMessage,y=h.yCaptureButton,b=r5(f,"IDCapturing.captureIcon.src","ic_camera.svg"),w=r5(f,"IDCapturing.loadingIcon.src","ic_loading.png"),C=Ky(xw.useState(""),2),k=C[0],S=C[1],E=yj.useSDKSettings(),B=E.debug,_=E.lang,x=Ky(xw.useState(null),2),T=x[0],A=x[1],I=Ky(xw.useState(""),2),P=I[0],R=I[1],D=Ky(xw.useState(null),2),O=D[0],N=D[1],L=aue(),M=L.showPopup,F=L.popupShown,U=L.popupType,j=xw.useCallback((function(e){R(null===e?"":i9(e.msg[_])({side:a?_re.FRONT[_]:_re.BACK[_]}))}),[_,a]),V=xw.useCallback((function(){A(""),M({popupType:sue.SESSION_TIMEOUT})}),[M]),z=xw.useCallback((function(){A(""),u.apply(void 0,arguments)}),[u]),q=xw.useCallback((function(e){var t=e.curTimeLeft;A(i9(Xue.REMAINING_TIME[_])({x:t}))}),[_]),H=Gue({shouldStart:!0,refVideo:i,cropArea:O,settings:c,onModelErrorChange:j,frontSide:a,allowedCardTypes:s,onDebugInfoChange:S,onSessionTimeout:V,onCaptureDone:z,onAboutToTimeout:q,outputEncryptionSettings:d}),W=H.warmupDone,K=H.isProcessing,Q=H.takePictureManually,G=H.restartSession,X=H.resetIsProcessingImageBlobTaken,Y=xw.useCallback((function(){M({popupType:null}),X()}),[M,X]),$=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Y(),e.next=3,G();case 3:case"end":return e.stop()}}),e)}))),[G,Y]),Z=xw.useMemo((function(){return{backgroundColor:t5(f,"IDCapturing.backgroundColor",Are)}}),[f]);xw.useEffect((function(){if(o){var e,t,r,i,a,s,c,u=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,p=o.lostY,h=o.clientHeight;n?(a=.7*(s=d-165),r=(c=(e=p+10)+45)+20,i=(t=c+s+10)+60):(a=b1.isMobile?u-6:Math.floor(.7*u),r=(c=(e=p+10)+50)+20,i=(t=c+(s=Math.floor(Math.min(a/1.5,h-2*p-(qce+2*zce)-100)))+10)+60);var g=Math.floor((u-a)/2)+f;N({x:g,y:c,width:a,height:s,surroundStyle:Z});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:i};m(v),l(v)}}),[o,n,l,Z]);var J=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(""),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q]);return xw.useImperativeHandle(t,(function(){return{restartSession:$}}),[$]),xw.createElement(xw.Fragment,null,!W&&xw.createElement(Y7,null),B&&xw.createElement(Yce,null,k),K&&xw.createElement(Wce,null,xw.createElement("img",{src:w,alt:"",className:"spin"})),O&&xw.createElement(x5,{x:"".concat(O.x,"px"),y:"".concat(O.y,"px"),width:"".concat(O.width,"px"),height:"".concat(O.height,"px"),surroundStyle:O.surroundStyle},xw.createElement(eue,{width:O.width,height:O.height,type:P?Zse.ERROR:Zse.DEFAULT})),!P&&xw.createElement($ce,{y:"".concat(g,"px"),className:"description"},r),P&&xw.createElement(Zce,{y:"".concat(g,"px")},P),!K&&(!(null!=c&&c.disableCaptureButtonIfAlert)||!P)&&xw.createElement(Hce,{onClick:J,y:"".concat(y,"px")},xw.createElement("img",{src:b,alt:""})),T&&xw.createElement(Jce,{key:T,className:"message",y:"".concat(v,"px")},T),xw.createElement(Q7,{open:F},U===sue.SESSION_TIMEOUT&&xw.createElement(iue,{onOk:$,maxSessionTime:null==c?void 0:c.idCardSessionTime})))}));Yue.propTypes={usePortraitMask:xC.bool,description:xC.string,windowAndVideoInfo:xC.shape({}),refVideo:xC.shape({}),frontSide:xC.bool,allowedCardTypes:xC.arrayOf(xC.string),settings:xC.shape({}),onCaptureDone:xC.func,onUISpacingChange:xC.func,outputEncryptionSettings:xC.shape({})},Yue.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,allowedCardTypes:[],settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var $ue,Zue,Jue,ele,tle,rle,nle,ole,ile,ale,sle,cle,ule,lle={QR_INSTRUCTIONS_TEXT:{en:xw.createElement("span",null,"Please follow the instructions below to scan QR code:",xw.createElement("br",null),xw.createElement("br",null)," Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),vi:xw.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",xw.createElement("br",null),xw.createElement("br",null)," Đưa camera vào vị trí mã QR trên CCCD. Canh vừa mã QR vào 4 góc khung hình để quét mã")},QR_INSTRUCTIONS_START_BUTTON:{en:"Scan QR code",vi:"Tiến hành quét mã QR"},QR_INSTRUCTIONS_COUNTDOWN:{en:"Start in <%= x %> s",vi:"Bắt đầu trong <%= x %> giây"},QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR"},REMAINING_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"},SESSION_TIMEOUT_POPUP_DESCRIPTION:{en:xw.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",xw.createElement("br",null),xw.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",xw.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn."),vi:xw.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",xw.createElement("br",null),xw.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",xw.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn.")},SESSION_TIMEOUT_POPUP_RETRY_BUTTON:{en:"Retry",vi:"Thực hiện lại"},SESSION_TIMEOUT_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"}},dle=dB.button($ue||($ue=Wy(["\n width: 100%;\n max-width: 294px;\n height: 66px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 3px;\n color: #fff;\n font-weight: normal;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),fle=(dB.a(Zue||(Zue=Wy(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),dB.div(Jue||(Jue=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"])))),ple=dB.div(ele||(ele=Wy(["\n background: #e7e6e6;\n width: 100%;\n border-radius: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.image.borderRadius",Are)})),hle=dB.img(tle||(tle=Wy(["\n width: 100%;\n height: auto;\n object-fit: contain;\n"]))),mle=dB.div(rle||(rle=Wy(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n text-align: ",";\n line-height: ",";\n"])),(function(e){var t=e.theme,r=e.$type;return t5(t,"QRStep.guidelinePopup.".concat(r,".color"),Are)}),(function(e){var t=e.theme,r=e.$type;return t5(t,"QRStep.guidelinePopup.".concat(r,".fontSize"),Are)}),(function(e){var t=e.theme,r=e.$type;return t5(t,"QRStep.guidelinePopup.".concat(r,".fontWeight"),Are)}),(function(e){var t=e.theme,r=e.$type;return t5(t,"QRStep.guidelinePopup.".concat(r,".textAlign"),Are)}),(function(e){var t=e.theme,r=e.$type;return t5(t,"QRStep.guidelinePopup.".concat(r,".lineHeight"),Are)})),gle=dB(mle)(nle||(nle=Wy(["\n white-space: nowrap;\n"]))),vle=dB(dle)(ole||(ole=Wy(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.border",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.outline",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.height",Are)})),yle=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=yj.useSDKSettings().lang,i=mB(),a=r5(i,"QRStep.guidelinePopup.image.src","qr_code_banner.png"),s=xw.useRef(n),c=Ky(xw.useState((function(){return i9(lle.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),u=c[0],l=c[1],d=Yj.useSDKTracking().sendEvent,f=xw.useRef(!1);xw.useEffect((function(){d({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[d]),xw.useEffect((function(){var e=i9(lle.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){s.current--,l(e({x:s.current})),s.current<=0&&(clearInterval(t),f.current||d({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),r&&r())}),1e3);return function(){clearInterval(t)}}),[o,r]);return xw.createElement(fle,null,xw.createElement(ple,null,xw.createElement(zre,{ratio:1.6},xw.createElement(hle,{src:a}))),xw.createElement(Yre,{mt:"30px"},xw.createElement(mle,{$type:"guideText"},lle.QR_INSTRUCTIONS_TEXT[o])),xw.createElement(Yre,{mt:"30px"},xw.createElement(vle,{onClick:function(){d({tag:"id_qr",event:"user_activity.click_start",log:{}}),f.current=!0,t()}},lle.QR_INSTRUCTIONS_START_BUTTON[o])),xw.createElement(Yre,{my:"20px"},xw.createElement(gle,{$type:"countdownText"},u)))};yle.propTypes={onClickStart:xC.func,onTimeout:xC.func,timeout:xC.number},yle.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var ble,wle,Cle,kle=dB.div(ile||(ile=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.padding",Are)})),Sle=dB.div(ale||(ale=Wy(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n margin: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.title.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.title.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.title.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.title.margin",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.title.padding",Are)})),Ele=dB.div(sle||(sle=Wy(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n text-align: ",";\n margin: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.textAlign",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.margin",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.padding",Are)})),Ble=dB(dle)(cle||(cle=Wy(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n margin: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.border",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.outline",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.height",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.margin",Are)})),_le=dB(dle)(ule||(ule=Wy(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n margin: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.border",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.outline",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.height",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.margin",Are)})),xle=function(e){var t=e.onRetry,r=e.onSkip,n=yj.useSDKSettings().lang;return xw.createElement(kle,null,xw.createElement(Sle,null,lle.QR_INVALID_POPUP_TITLE[n]),xw.createElement(Ele,null,lle.QR_INVALID_POPUP_DESCRIPTION[n]),xw.createElement(Ble,{onClick:t},lle.QR_INVALID_POPUP_RETRY_BUTTON[n]),xw.createElement(_le,{onClick:r},lle.QR_INVALID_POPUP_SKIP_BUTTON[n]))};xle.propTypes={onRetry:xC.func,onSkip:xC.func},xle.defaultProps={onRetry:function(){},onSkip:function(){}};var Tle=10,Ale=dB.div(ble||(ble=Wy(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: ",";\n top: ",";\n position: absolute;\n z-index: ",";\n color: ",";\n padding: ",";\n margin: 0 10px;\n max-width: 275px;\n text-align: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.scanTooltip.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanTooltip.borderRadius",Are)}),(function(e){return e.y}),s5+20,(function(e){var t=e.theme;return t5(t,"QRStep.scanTooltip.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanTooltip.padding",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanTooltip.textAlign",Are)})),Ile=dB.div(wle||(wle=Wy(["\n width: 0;\n height: 0;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n border-bottom: ",";\n position: absolute;\n left: 50%;\n top: ",";\n transform: translateX(-50%);\n"])),(function(e){var t=e.arrowSize,r=e.theme;return"".concat(t,"px solid ").concat(t5(r,"QRStep.scanTooltip.backgroundColor",Are))}),(function(e){return"".concat(e.top,"px")})),Ple=function(e){var t=e.children,r=e.y;return xw.createElement(Ale,{y:r},xw.createElement(Ile,{arrowSize:Tle,top:-Tle}),t)},Rle=dB.div(Cle||(Cle=Wy(["\n text-align: ",";\n position: absolute;\n font-size: ",";\n font-weight: ",";\n border-radius: ",";\n padding: ",";\n background: ",";\n color: ",";\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.textAlign",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.padding",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.color",Are)}),(function(e){return e.y}),s5+20),Dle=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g,Ole=function(e){var t=e.match(Dle);return{valid:Boolean(t)}};function Nle(e){var t=e.canvas,r=e.qrModel,n=window.cv,o=n.imread(t,n.IMREAD_GRAYSCALE);return r.detectAndDecode(o).get(0)}var Lle=function(){var e=xy(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Aue();case 2:if(n=e.sent,o=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return i=document.createElement("canvas"),a=i.getContext("2d"),e.next=11,new Promise((function(e){var r=URL.createObjectURL(t),n=new Image;n.onload=function(){var t=n.width,o=n.height;i.width=t/2,i.height=o/2,a.drawImage(n,t/2,0,i.width,i.height,0,0,i.width,i.height),URL.revokeObjectURL(r),e()},n.src=r}));case 11:return e.next=13,Nle({canvas:i,qrModel:o});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,lW.writeExif({mode:"",imageData:{blob:t,result:s,type:"qr_from_front_image"},enableExifData:!0});case 18:if(c=e.sent,!r||!r.key){e.next=24;break}return l=r.key,e.next=23,Wq.encrypt({imageBlobWithExif:c,key:l});case 23:u=e.sent;case 24:return e.abrupt("return",{result:s,validateResult:{valid:!0},image:{blob:c,encrypted:u}});case 25:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Mle=o((function(e,t){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height||!this.data[t*this.width+e])},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,o){for(var i=t;i<t+n;i++)for(var a=e;a<e+r;a++)this.set(a,i,!!o)},e}();t.BitMatrix=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.addOrSubtractGF=function(e,t){return e^t};var o=function(){function e(e,t,r){this.primitive=e,this.size=t,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var o=1,i=0;i<this.size;i++)this.expTable[i]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(i=0;i<this.size-1;i++)this.logTable[this.expTable[i]]=i;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,t){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===t)return this.zero;var r=new Uint8ClampedArray(e+1);return r[0]=t,new n.default(this,r)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=function(){function e(e,t){if(0===t.length)throw new Error("No coefficients.");this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;if(n===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-n);for(var o=0;o<this.coefficients.length;o++)this.coefficients[o]=t[n+o]}}else this.coefficients=t}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(t){var r;if(this.isZero())return t;if(t.isZero())return this;var o=this.coefficients,i=t.coefficients;o.length>i.length&&(o=(r=[i,o])[0],i=r[1]);for(var a=new Uint8ClampedArray(i.length),s=i.length-o.length,c=0;c<s;c++)a[c]=i[c];for(c=s;c<i.length;c++)a[c]=n.addOrSubtractGF(o[c-s],i[c]);return new e(this.field,a)},e.prototype.multiply=function(t){if(0===t)return this.field.zero;if(1===t)return this;for(var r=this.coefficients.length,n=new Uint8ClampedArray(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,n)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var r=this.coefficients,o=r.length,i=t.coefficients,a=i.length,s=new Uint8ClampedArray(o+a-1),c=0;c<o;c++)for(var u=r[c],l=0;l<a;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,i[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new Error("Invalid degree less than 0");if(0===r)return this.field.zero;for(var n=this.coefficients.length,o=new Uint8ClampedArray(n+t),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],r);return new e(this.field,o)},e.prototype.evaluateAt=function(e){var t=0;if(0===e)return this.getCoefficient(0);var r=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){t=n.addOrSubtractGF(t,e)})),t;t=this.coefficients[0];for(var o=1;o<r;o++)t=n.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[o]);return t},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(5),i=r(11),a=r(12);function s(e){var t=a.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=i.extract(e,s),u=o.decode(c.matrix);if(u)return{binaryData:u.bytes,data:u.text,chunks:u.chunks,version:u.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:"attemptBoth"};function u(e,t,r,o){void 0===o&&(o={});var i=c;Object.keys(i||{}).forEach((function(e){i[e]=o[e]||i[e]}));var a="attemptBoth"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,u="onlyInvert"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,l=n.binarize(e,t,r,a),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==i.inversionAttempts&&"invertFirst"!==i.inversionAttempts||(p=s(u?d:f)),p}u.default=u,t.default=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r){return e<t?t:e>r?r:e}var i=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,a){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new i(t,r),c=0;c<t;c++)for(var u=0;u<r;u++){var l=e[4*(u*t+c)+0],d=e[4*(u*t+c)+1],f=e[4*(u*t+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(t/8),h=Math.ceil(r/8),m=new i(p,h),g=0;g<h;g++)for(var v=0;v<p;v++){var y=0,b=1/0,w=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var C=s.get(8*v+c,8*g+u);y+=C,b=Math.min(b,C),w=Math.max(w,C)}var k=y/Math.pow(8,2);if(w-b<=24&&(k=b/2,g>0&&v>0)){var S=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<S&&(k=S)}m.set(v,g,k)}var E=n.BitMatrix.createEmpty(t,r),B=null;for(a&&(B=n.BitMatrix.createEmpty(t,r)),g=0;g<h;g++)for(v=0;v<p;v++){for(var _=o(v,2,p-3),x=o(g,2,h-3),T=(y=0,-2);T<=2;T++)for(var A=-2;A<=2;A++)y+=m.get(_+T,x+A);var I=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var P=s.get(c,u);E.set(c,u,P<=I),a&&B.set(c,u,!(P<=I))}}return a?{binarized:E,inverted:B}:{binarized:E}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),i=r(9),a=r(10);function s(e,t){for(var r=e^t,n=0;r;)n++,r&=r-1;return n}function c(e,t){return t<<1|e}var u=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],l=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e,t,r){for(var o=l[r.dataMask],i=e.height,a=function(e){var t=17+4*e.versionNumber,r=n.BitMatrix.createEmpty(t,t);r.setRegion(0,0,9,9,!0),r.setRegion(t-8,0,8,9,!0),r.setRegion(0,t-8,9,8,!0);for(var o=0,i=e.alignmentPatternCenters;o<i.length;o++)for(var a=i[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===a&&6===u||6===a&&u===t-7||a===t-7&&6===u||r.setRegion(a-2,u-2,5,5,!0)}return r.setRegion(6,9,1,t-17,!0),r.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),s=[],u=0,d=0,f=!0,p=i-1;p>0;p-=2){6===p&&p--;for(var h=0;h<i;h++)for(var m=f?i-1-h:h,g=0;g<2;g++){var v=p-g;if(!a.get(v,m)){d++;var y=e.get(v,m);o({y:m,x:v})&&(y=!y),u=c(y,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var t=function(e){var t=e.height,r=Math.floor((t-17)/4);if(r<=6)return a.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var i=t-9;i>=t-11;i--)n=c(e.get(i,o),n);var u=0;for(i=5;i>=0;i--)for(o=t-9;o>=t-11;o--)u=c(e.get(i,o),u);for(var l,d=1/0,f=0,p=a.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var m=s(n,h.infoBits);m<d&&(l=h,d=m),(m=s(u,h.infoBits))<d&&(l=h,d=m)}return d<=3?l:void 0}(e);if(!t)return null;var r=function(e){for(var t=0,r=0;r<=8;r++)6!==r&&(t=c(e.get(r,8),t));for(var n=7;n>=0;n--)6!==n&&(t=c(e.get(8,n),t));var o=e.height,i=0;for(n=o-1;n>=o-7;n--)i=c(e.get(8,n),i);for(r=o-8;r<o;r++)i=c(e.get(r,8),i);for(var a=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,m=p.formatInfo;if(h===t||h===i)return m;var g=s(t,h);g<a&&(l=m,a=g),t!==i&&(g=s(i,h))<a&&(l=m,a=g)}return a<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],i=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),i+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<i)return null;e=e.slice(0,i);for(var a=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<a;s++)for(var c=0,u=o;c<u.length;c++)u[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var l=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)o[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=o;f<p.length;f++)p[f].codewords.push(e.shift());return o}(d(e,t,r),t,r.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,t){return e+t.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,m=n;h<m.length;h++){var g=m[h],v=i.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[p++]=v[y]}try{return o.decode(f,t.versionNumber)}catch(e){return null}}t.decode=function(e){if(null==e)return null;var t=f(e);if(t)return t;for(var r=0;r<e.width;r++)for(var n=r+1;n<e.height;n++)e.get(r,n)!==e.get(n,r)&&(e.set(r,n,!e.get(r,n)),e.set(n,r,!e.get(n,r)));return f(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o,i=r(7),a=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],i=e.readBits(o);i>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var a=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+a,48+s,48+c),n+=a.toString()+s.toString()+c.toString(),i-=3}if(2===i){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");a=Math.floor(u/10),s=u%10,r.push(48+a,48+s),n+=a.toString()+s.toString()}else if(1===i){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+u),n+=u.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(o||(o={}));var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(e,t){for(var r=[],n="",o=[9,11,13][t],i=e.readBits(o);i>=2;){var a=e.readBits(11),s=Math.floor(a/45),u=a%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],i-=2}return 1===i&&(s=e.readBits(6),r.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:r,text:n}}function l(e,t){for(var r=[],n="",o=[8,16,16][t],i=e.readBits(o),a=0;a<i;a++){var s=e.readBits(8);r.push(s)}try{n+=decodeURIComponent(r.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:r,text:n}}function d(e,t){for(var r=[],n="",o=[8,10,12][t],i=e.readBits(o),s=0;s<i;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,r.push(u>>8,255&u),n+=String.fromCharCode(a.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,a,c,f,p=new i.BitStream(e),h=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};p.available()>=4;){var g=p.readBits(4);if(g===o.Terminator)return m;if(g===o.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===o.Numeric){var v=s(p,h);m.text+=v.text,(r=m.bytes).push.apply(r,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===o.Alphanumeric){var y=u(p,h);m.text+=y.text,(a=m.bytes).push.apply(a,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===o.Byte){var b=l(p,h);m.text+=b.text,(c=m.bytes).push.apply(c,b.bytes),m.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(g===o.Kanji){var w=d(p,h);m.text+=w.text,(f=m.bytes).push.apply(f,w.bytes),m.chunks.push({type:n.Kanji,bytes:w.bytes,text:w.text})}}if(0===p.available()||0===p.readBits(p.available()))return m}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e<r?e:r,o=255>>8-n<<(i=r-n);t=(this.bytes[this.byteOffset]&o)>>i,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var i;if(e>0)o=255>>(i=8-e)<<i,t=t<<e|(this.bytes[this.byteOffset]&o)>>i,this.bitOffset+=e}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var i=new n.default(285,256,0),a=new o.default(i,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=a.evaluateAt(i.exp(u+i.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(i,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var i=t,a=r,s=e.zero,c=e.one;a.degree()>=n/2;){var u=i,l=s;if(s=c,(i=a).isZero())return null;a=u;for(var d=e.zero,f=i.getCoefficient(i.degree()),p=e.inverse(f);a.degree()>=i.degree()&&!a.isZero();){var h=a.degree()-i.degree(),m=e.multiply(a.getCoefficient(a.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),a=a.addOrSubtract(i.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),a.degree()>=i.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),a.multiply(v)]}(i,i.buildMonomial(t,1),d,t);if(null===f)return null;var p=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),o=0,i=1;i<e.size&&o<r;i++)0===t.evaluateAt(i)&&(n[o]=e.inverse(i),o++);return o!==r?null:n}(i,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,i=new Array(o),a=0;a<o;a++){for(var s=e.inverse(r[a]),c=1,u=0;u<o;u++)a!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));i[a]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(i[a]=e.multiply(i[a],s))}return i}(i,f[1],p),m=0;m<p.length;m++){var g=r.length-1-i.log(p[m]);if(g<0)return null;r[g]=n.addOrSubtractGF(r[g],h[m])}return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r,n){var o=e.x-t.x+r.x-n.x,i=e.y-t.y+r.y-n.y;if(0===o&&0===i)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:r.x-t.x,a22:r.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var a=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=a*u-s*c,d=(o*u-s*i)/l,f=(a*i-o*c)/l;return{a11:t.x-e.x+d*t.x,a12:t.y-e.y+d*t.y,a13:d,a21:n.x-e.x+f*n.x,a22:n.y-e.y+f*n.y,a23:f,a31:e.x,a32:e.y,a33:1}}t.extract=function(e,t){for(var r=function(e,t,r,n){var i=o(e,t,r,n);return{a11:i.a22*i.a33-i.a23*i.a32,a12:i.a13*i.a32-i.a12*i.a33,a13:i.a12*i.a23-i.a13*i.a22,a21:i.a23*i.a31-i.a21*i.a33,a22:i.a11*i.a33-i.a13*i.a31,a23:i.a13*i.a21-i.a11*i.a23,a31:i.a21*i.a32-i.a22*i.a31,a32:i.a12*i.a31-i.a11*i.a32,a33:i.a11*i.a22-i.a12*i.a21}}({x:3.5,y:3.5},{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),i=function(e,t){return{a11:e.a11*t.a11+e.a21*t.a12+e.a31*t.a13,a12:e.a12*t.a11+e.a22*t.a12+e.a32*t.a13,a13:e.a13*t.a11+e.a23*t.a12+e.a33*t.a13,a21:e.a11*t.a21+e.a21*t.a22+e.a31*t.a23,a22:e.a12*t.a21+e.a22*t.a22+e.a32*t.a23,a23:e.a13*t.a21+e.a23*t.a22+e.a33*t.a23,a31:e.a11*t.a31+e.a21*t.a32+e.a31*t.a33,a32:e.a12*t.a31+e.a22*t.a32+e.a32*t.a33,a33:e.a13*t.a31+e.a23*t.a32+e.a33*t.a33}}(o(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft),r),a=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=i.a13*e+i.a23*t+i.a33;return{x:(i.a11*e+i.a21*t+i.a31)/r,y:(i.a12*e+i.a22*t+i.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);a.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:a,mappingFunction:s}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function o(e){return e.reduce((function(e,t){return e+t}))}function i(e,t,r,o){var i,a,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(t.y-e.y)>Math.abs(t.x-e.x);l?(i=Math.floor(e.y),a=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(i=Math.floor(e.x),a=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-i),f=Math.abs(c-a),p=Math.floor(-d/2),h=i<s?1:-1,m=a<c?1:-1,g=!0,v=i,y=a;v!==s+h;v+=h){var b=l?y:v,w=l?v:y;if(r.get(b,w)!==g&&(g=!g,u.push({x:b,y:w}),u.length===o+1))break;if((p+=f)>0){if(y===c)break;y+=m,p-=d}}for(var C=[],k=0;k<o;k++)u[k]&&u[k+1]?C.push(n(u[k],u[k+1])):C.push(0);return C}function a(e,t,r,n){var o,a=t.y-e.y,s=t.x-e.x,c=i(e,t,r,Math.ceil(n/2)),u=i(e,{x:e.x-s,y:e.y-a},r,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(o=u.concat(l)).concat.apply(o,c)}function s(e,t){var r=o(e)/o(t),n=0;return t.forEach((function(t,o){n+=Math.pow(e[o]-t*r,2)})),{averageSize:r,error:n}}function c(e,t,r){try{var n=a(e,{x:-1,y:e.y},r,t.length),o=a(e,{x:e.x,y:-1},r,t.length),i=a(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=a(e,{x:Math.min(r.width,e.x+e.y)+1,y:Math.min(r.height,e.y+e.x)+1},r,t.length),u=s(n,t),l=s(o,t),d=s(i,t),f=s(c,t),p=Math.sqrt(u.error*u.error+l.error*l.error+d.error*d.error+f.error*f.error),h=(u.averageSize+l.averageSize+d.averageSize+f.averageSize)/4;return p+(Math.pow(u.averageSize-h,2)+Math.pow(l.averageSize-h,2)+Math.pow(d.averageSize-h,2)+Math.pow(f.averageSize-h,2))/h}catch(e){return 1/0}}function u(e,t){for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r--;for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n++;for(var o=(r+n)/2,i=Math.round(t.y);e.get(Math.round(o),i);)i--;for(var a=Math.round(t.y);e.get(Math.round(o),a);)a++;return{x:o,y:(i+a)/2}}function l(e,t,r,i,s){var u,l,d;try{u=function(e,t,r,i){var s=(o(a(e,r,i,5))/7+o(a(e,t,i,5))/7+o(a(r,e,i,5))/7+o(a(t,e,i,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,t)/s),u=Math.round(n(e,r)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(i,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-i.x+s.x,p=r.y-i.y+s.y,h=(n(i,s)+n(i,r))/2/d,m=1-3/h,g={x:i.x+m*(f-i.x),y:i.y+m*(p-i.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,i=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(i))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1];return o(a),{x:r,y:i,score:c({x:Math.floor(r),y:Math.floor(i)},[1,1,1],e)+n({x:r,y:i},g)}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));return{alignmentPattern:h>=15&&v.length?v[0]:g,dimension:l}}t.locate=function(e){for(var t=[],r=[],i=[],a=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var i=e.get(t,n);if(i===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=i;var l=o(u)/7,d=Math.abs(u[0]-l)<l&&Math.abs(u[1]-l)<l&&Math.abs(u[2]-3*l)<3*l&&Math.abs(u[3]-l)<l&&Math.abs(u[4]-l)<l&&!i,f=o(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&i;if(d){var h=t-u[3]-u[4],m=h-u[2],g={startX:m,endX:h,y:n};(v=r.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||h>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&h>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:r.push({top:g,bottom:g})}if(p){var v,y=t-u[4],b=y-u[3];g={startX:b,y:n,endX:y},(v=a.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||y>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&y>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:a.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)l(d);t.push.apply(t,r.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),r=r.filter((function(e){return e.bottom.y===n})),i.push.apply(i,a.filter((function(e){return e.bottom.y!==n}))),a=a.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);t.push.apply(t,r.filter((function(e){return e.bottom.y-e.top.y>=2}))),i.push.apply(i,a);var f=t.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],a=o(i)/i.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:a}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score})).map((function(e,t,r){if(t>4)return null;var n=r.filter((function(e,r){return t!==r})).map((function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}})).sort((function(e,t){return e.score-t.score}));if(n.length<2)return null;var o=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:o}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));if(0===f.length)return null;var p=function(e,t,r){var o,i,a,s,c,u,l,d=n(e,t),f=n(t,r),p=n(e,r);return f>=d&&f>=p?(c=(o=[t,e,r])[0],u=o[1],l=o[2]):p>=f&&p>=d?(c=(i=[e,t,r])[0],u=i[1],l=i[2]):(c=(a=[e,r,t])[0],u=a[1],l=a[2]),(l.x-u.x)*(c.y-u.y)-(l.y-u.y)*(c.x-u.x)<0&&(c=(s=[l,c])[0],l=s[1]),{bottomLeft:c,topLeft:u,topRight:l}}(f[0].points[0],f[0].points[1],f[0].points[2]),h=p.topRight,m=p.topLeft,g=p.bottomLeft,v=l(e,i,h,m,g),y=[];v&&y.push({alignmentPattern:{x:v.alignmentPattern.x,y:v.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:v.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),w=u(e,m),C=u(e,g),k=l(e,i,b,w,C);return k&&y.push({alignmentPattern:{x:k.alignmentPattern.x,y:k.alignmentPattern.y},bottomLeft:{x:C.x,y:C.y},topLeft:{x:w.x,y:w.y},topRight:{x:b.x,y:b.y},dimension:k.dimension}),0===y.length?null:y}}]).default},e.exports=r()})),Fle=n(Mle);function Ule(e){return jle.apply(this,arguments)}function jle(){return(jle=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(i=n.getContext("2d"),o=i.getImageData(0,0,n.width,n.height)),!(a=Fle(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",a.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vle(e){return zle.apply(this,arguments)}function zle(){return(zle=xy(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.canvas,n=t.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),Cue.scanImage(r,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var qle=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,i=r,!n){e.next=6;break}return e.next=5,Jz.blobToCanvas({blob:n});case 5:i=e.sent;case 6:return a=i.getContext("2d"),e.next=9,Ule({imageData:a.getImageData(0,0,i.width,i.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,Vle({canvas:i,qrScannerResources:o});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Hle(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.onResult,a=e.outputEncryptionSettings,s=xw.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=xw.useRef(!1),u=xw.useRef(null),l=xw.useRef(),d=Ky(xw.useState(!1),2),f=d[0],p=d[1],h=xw.useRef({}),m=yj.useSDKSettings(),g=m.customUrls,v=m.qrSettings,y=m.country,b=m.exifKey,w=hW(),C=w.motionData,k=w.orientationData;xw.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f){e.next=5;break}return e.next=3,Aue({modelUrl:null==g?void 0:g.wechatQRModelsUrl});case 3:h.current=e.sent,p(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[f,g]);var S=xw.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),E=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,d,p,m,g,w,E,B,_,x,T,A;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f&&o&&!c.current){e.next=2;break}return e.abrupt("return");case 2:r=h.current,n=r.qrModel,d=r.qrScannerResources,p=r.noModel,m=u.current,g=t.current,c.current=!0,w=m.cropX,E=m.cropY,B=m.cropWidth,_=m.cropHeight,(x=s.current).width=B,x.height=_,T=x.getContext("2d"),A=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,o,u,f,h,m,I;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T.drawImage(g,w,E,B,_,0,0,B,_),t=performance.now(),p){e.next=8;break}return e.next=5,Nle({canvas:x,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,qle({canvas:x,qrScannerResources:d});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=28;break}return S(),o="vn"===y?Ole(r):{valid:!0},e.next=17,xV.takePicture({canvas:s.current});case 17:return u=e.sent,lW.preWriteExif({mode:lW.MODE.ID_CARD,motionData:C,orientationData:k,startTime:l.current,endTime:Date.now(),exifKey:b}),e.next=21,lW.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:"boolean"!=typeof(null==v?void 0:v.enableExif)||(null==v?void 0:v.enableExif)});case 21:if(f=e.sent,!a||!a.key){e.next=27;break}return m=a.key,e.next=26,Wq.encrypt({blob:f,key:m});case 26:h=e.sent;case 27:i({result:r,validateResult:o,image:{blob:f,encrypted:h}});case 28:return I=180-t>0?180-t:0,e.next=31,new Promise((function(e){return setTimeout(e,I)}));case 31:c.current&&window.requestAnimationFrame(A);case 32:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(A);case 13:case"end":return e.stop()}}),e)}))),[f,o,t,S,y,C,k,b,null==v?void 0:v.enableExif,a,i]),B=xw.useCallback((function(){S()}),[S]);return xw.useEffect((function(){var e=t.current;r||B(),f&&r&&n&&e&&e.videoWidth>0&&(l.current=Date.now(),u.current=xV.analyzeVideoAndWindowSizes(e,n,0),E())}),[r,n,t,S,E,f,B]),xw.useEffect((function(){return B}),[B]),{refWorkingCanvas:s,stopCheckFrame:S,checkFrame:E,warmupDone:f}}var Wle,Kle=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onSessionTimeout,a=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=Ky(xw.useState(!1),2),l=u[0],d=u[1],f=xw.useRef((function(){})),p=xw.useRef((function(){})),h=yj.useSDKSettings().lang,m=xw.useCallback((function(){f.current.apply(f,arguments)}),[]),g=Hle({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:m,outputEncryptionSettings:c}),v=g.stopCheckFrame,y=g.checkFrame,b=g.warmupDone,w=Wue({refVideo:r,shouldStart:t&&b,cropArea:n,settings:o}),C=w.stopCheckFrame,k=w.refRecordedVideos,S=w.splitVideos,E=w.resetRecordedVideos,B=w.checkFrame;f.current=xw.useCallback((function(e){d(!0),C(),v(),p.current(),a(Oy(Oy({},e),null!=o&&o.enableRecording?{recordedVideos:k.current}:{})),d(!1)}),[C,a,k,v,null==o?void 0:o.enableRecording]);var _=xw.useCallback((function(){C(),v();var e=Gy(k.current),t=null!=o&&o.enableRecording?{recordedVideos:e}:null;i(t),E()}),[E,C,v,i,k,o]),x=xw.useCallback((function(){S()}),[S]),T=Que({lang:h,onAboutToTimeout:s,onSessionTimeout:_,onVideoTimeLimitReached:x,settings:o,shouldStartTimers:t&&b,sessionTime:null==o?void 0:o.scanQrLimitTimeSecond}),A=T.stopTimers,I=T.startTimers;return p.current=A,{isProcessing:l,restartSession:xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(),e.next=3,Promise.all([B(),y()]);case 3:case"end":return e.stop()}}),e)}))),[B,y,I]),refRecordedVideos:k,warmupDone:b}},Qle=145;function Gle(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,i=e.onCaptureDone,a=e.outputEncryptionSettings,s=Ky(xw.useState(null),2),c=s[0],u=s[1],l=Jj.useAsset("qr_capture_cursor.png"),d=Ky(xw.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=yj.useSDKSettings().lang,v=Yj.useSDKTracking().sendEvent,y=aue(),b=y.showPopup,w=y.popupShown,C=y.popupType,k=Ky(xw.useState(!1),2),S=k[0],E=k[1],B=Ky(xw.useState(null),2),_=B[0],x=B[1],T=Jj.useAsset("ic_loading.png"),A=xw.useRef();xw.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),xw.useEffect((function(){b({popupType:sue.QR_INSTRUCTIONS})}),[b]),xw.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,i=b1.isMobile?Math.min(e-6,Qle):Qle,a=i,s=o+10,c=s+90,l=c+40,d=l+a+20,f=Math.floor((e-i)/2)+n;u({x:f,y:l,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var I=xw.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),i(e)}),[i,v]),P=xw.useCallback((function(e){var t=e.validateResult.valid;x("");var r=performance.now();t?(v({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-A.current)/1e3}}),i(e)):(b({popupType:sue.QR_INVALID}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,i,v]),R=xw.useCallback((function(e){var t=e.curTimeLeft;x(i9(lle.REMAINING_TIME[g])({x:t}))}),[g]),D=Kle({shouldStart:S,refVideo:n,cropArea:c,settings:o,onSessionTimeout:I,onCaptureDone:P,onAboutToTimeout:R,outputEncryptionSettings:a}),O=D.isProcessing,N=D.restartSession,L=D.warmupDone,M=xw.useCallback((function(){b({popupType:null})}),[b]),F=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(),A.current=performance.now(),v({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,N();case 5:case"end":return e.stop()}}),e)}))),[N,M,v]),U=xw.useCallback((function(){M(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),i()}),[M,i,v]),j=xw.useCallback((function(){M(),setTimeout((function(){E(!0)}),200)}),[M]);return xw.createElement(xw.Fragment,null,!L&&xw.createElement(Y7,{contentStyle:{maxWidth:"300px"}}),c&&xw.createElement(x5,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},xw.createElement("div",null,xw.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),xw.createElement(Ple,{y:"".concat(h,"px")},lle.QR_TOOLTIP[g]),_&&xw.createElement(Rle,{key:_,className:"message",y:"".concat(m,"px")},_),O&&xw.createElement(Wce,null,xw.createElement("img",{src:T,alt:"",className:"spin"})),xw.createElement(Q7,{contentStyle:{maxWidth:"332px"},open:w},C===sue.QR_INVALID&&xw.createElement(xle,{onRetry:F,onSkip:U}),C===sue.QR_INSTRUCTIONS&&xw.createElement(yle,{onClickStart:j,onTimeout:j})))}Gle.propTypes={windowAndVideoInfo:xC.shape({}),onUISpacingChange:xC.func,refVideo:xC.shape({}),settings:xC.shape({}),onCaptureDone:xC.func,outputEncryptionSettings:xC.shape({})},Gle.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var Xle=pB(Wle||(Wle=Wy(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),Yle=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons","allowedCardTypes"];function $le(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,i=e.defaultCameraId,a=e.globalStyle,s=e.styledComponent,c=e.frontCamera,u=e.scannerTypeCons,l=e.allowedCardTypes,d=Vy(e,Yle),f=d.numberOfCaptures,p=d.stepNumber,h=d.frontSide,m=d.titleIcon,g=d.title,v=d.description,y=d.scannerType,b=d.usePortraitMask,w=d.shouldShowSpinner,C=d.handleQRCaptureDone,k=d.handleIDCardCaptureDone,S=d.handleRestartSession,E=d.refIDCardReader,B=d.handleClickConfirm,_=d.popupType,x=d.popupShown,T=d.popupProps,A=mB(),I=xw.useRef(null),P=Ky(xw.useState(null),2),R=P[0],D=P[1],O=Ky(xw.useState(!1),2),N=O[0],L=O[1],M=r5(A,"IDCapturing.loadingIcon.src","ic_loading.png"),F=Ky(xw.useState({}),2),U=F[0],j=F[1],V=U.yTitle,z=xw.useCallback((function(e){D(e),L(!0)}),[]);xw.useEffect((function(){L(!1)}),[c]);var q=r5(A,"IDCapturing.cardIcon.src",m),H=s.CloseCameraButton;return xw.createElement(cB,{theme:Tre},xw.createElement(jce,null,xw.createElement(C5,{key:c,frontCamera:c,onVideoPlayed:z,onClose:t,flipHorizontal:c,ref:I,onError:r,defaultCameraId:i,closeButton:H||null},N&&xw.createElement(xw.Fragment,null,y===u.ID_CARD&&xw.createElement(Yue,{key:p,ref:E,windowAndVideoInfo:R,refVideo:I,settings:n,onCaptureDone:k,onUISpacingChange:j,frontSide:h,allowedCardTypes:l,description:v,usePortraitMask:b,outputEncryptionSettings:o}),y===u.QR_CODE&&xw.createElement(Gle,{key:p,refVideo:I,windowAndVideoInfo:R,settings:n,onCaptureDone:C,onUISpacingChange:j,outputEncryptionSettings:o})),xw.createElement(Uce,{keyForTransition:f}),xw.createElement(Qce,{y:"".concat(V,"px")},xw.createElement(Fee,null,xw.createElement(Iee,{key:g,timeout:{enter:Fce,exit:Fce},classNames:"flipY",unmountOnExit:!0},xw.createElement(Gce,null,m&&xw.createElement(Vce,{src:q,alt:""}),xw.createElement(Xce,{className:"title"},g))))),w&&xw.createElement(Wce,null,xw.createElement("img",{src:M,alt:"",className:"spin"}))),xw.createElement(Q7,{open:x},_===sue.CONFIRM&&xw.createElement(one,Ry({},T,{onConfirm:B,onTryAgain:S,frontSide:h})))),xw.createElement(a,null))}var Zle={allowedCardTypes:xC.arrayOf(xC.string),settings:xC.shape({}),onClose:xC.func,onError:xC.func,outputEncryptionSettings:xC.shape({}),defaultCameraId:xC.string,globalStyle:xC.shape({}),styledComponent:xC.shape({CloseCameraButton:xC.node}),frontCamera:xC.bool,scannerTypeCons:xC.shape({}).isRequired},Jle={allowedCardTypes:[],settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:Xle,styledComponent:{CloseCameraButton:null},frontCamera:!1};$le.propTypes=Zle,$le.defaultProps=Jle;var ede=uL.IDCardSide,tde=uL.IDCardType,rde=uL.Errors,nde={ID_CARD:"id_card",QR_CODE:"qr_code"},ode=[{scannerType:nde.ID_CARD,title:"Mặt trước CMND/CCCD",description:"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:uL.IDCardSide.FRONT,cardType:tde.VN,enableConfirmPopup:!0},{scannerType:nde.ID_CARD,title:"Mặt sau CMND/CCCD",description:"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:uL.IDCardSide.BACK,cardType:tde.VN,enableConfirmPopup:!0}],ide={scannerType:nde.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},ade=function(){return Promise.resolve({card_label:""})},sde=function(e){var t=e.settings,r=e.onError,n=e.detectIdCard,o=void 0===n?ade:n,i=e.outputEncryptionSettings,a=e.steps,s=void 0===a?ode:a,c=e.onStepDone,u=Ky(xw.useState(0),2),l=u[0],d=u[1],f=Ky(xw.useState(s[l]),2),p=f[0],h=f[1],m=Ky(xw.useState(0),2),g=m[0],v=m[1],y=Ky(xw.useState(!1),2),b=y[0],w=y[1],C=xw.useRef({}),k=xw.useRef([]),S=xw.useRef(null),E=xw.useRef(),B=aue(),_=B.showPopup,x=B.popupShown,T=B.popupType,A=B.props,I=p.scannerType,P=p.title,R=p.titleIcon,D=p.cardSide,O=p.description,N=p.usePortraitMask,L=p.cardType,M=p.enableConfirmPopup,F=xw.useCallback((function(e){e>=s.length||setTimeout((function(){d(e),h(s[e])}),200)}),[s]),U=xw.useCallback((function(){F(l+1)}),[F,l]),j=xw.useCallback((function(){setTimeout((function(){h((function(e){return Oy(Oy({},e),ide)}))}),200)}),[]),V=xw.useCallback((function(){_({popupType:null})}),[_]),z=xw.useCallback((function(){V(),S.current=null,I===nde.QR_CODE?F(l):I===nde.ID_CARD&&E.current.restartSession()}),[F,l,V,I]),q=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Oy({stepNumber:l,cardSide:D,cardType:L,image:C.current},null!=t&&t.enableRecording?{recordedVideos:k.current}:{}),(I===nde.QR_CODE&&S.current||null!==(r=S.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=S.current),w(!0),e.next=5,c(n);case 5:w(!1),S.current=null,U();case 8:case"end":return e.stop()}}),e)}))),[t,l,c,U,I,w,D,L]),H=xw.useCallback((function(e){var t;if(S.current=e,e&&Array.isArray(e.recordedVideos)){var r,n=e.recordedVideos;(r=k.current).push.apply(r,Gy(n))}v((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);M?_({popupType:sue.CONFIRM,props:{hasValidQR:o,imageTaken:C.current}}):q()}),[_,M,q]),W=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var a,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.image,s=n.error,c=n.recordedVideos,C.current=a,k.current=c,v((function(e){return e+1})),D!==uL.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!b1.isMobile){e.next=28;break}if(l=null==a||null===(u=a.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return w(!0),e.prev=9,e.next=12,o({image:a,cardType:L,cardSide:D});case 12:d=e.sent,l=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(rde.detect_id_card_error);case 19:w(!1);case 20:if(!l||!"vn.cccd_new.front".includes(l)){e.next=28;break}return w(!0),e.next=24,Lle(C.current.blob,i);case 24:return(f=e.sent)?H(f):j(),w(!1),e.abrupt("return");case 28:M?_({popupType:sue.CONFIRM,props:{imageTaken:C.current,error:s}}):q();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[M,_,D,t,L,o,q,j,r,H,i,w]),K=xw.useCallback((function(){V(),q()}),[q,V]);return{numberOfCaptures:g,stepNumber:l,titleIcon:R,title:P,description:O,frontSide:D===ede.FRONT,scannerType:I,usePortraitMask:N,shouldShowSpinner:b,handleQRCaptureDone:H,handleIDCardCaptureDone:W,handleRestartSession:z,refIDCardReader:E,handleClickConfirm:K,showPopup:_,popupType:T,popupShown:x,popupProps:A}},cde={data:{country:"vn",settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},card_type_check:{enable:!1},track_card_coordinates:{enable:!1,max_length:150},blur_check:{enable:!0,threshold_web:.82},disable_capture_button_if_alert:!1,exif_data_settings:{enable:!0},id_detection:{enable:!0},limit_time_settings:{enable:!0,limit_time_second:30,video_partial_length_seconds:15},save_frame_settings:{enable:!1,frames_interval_ms:190,quality_web:80},scan_qr_settings:{enable:!0,limit_time_second:20},virtual_cam_hashes:{web:!0,mobile:!1}}}}}};function ude(e){var t=e.clientSettings,r=Ky(xw.useState(null),2),n=r[0],o=r[1];return xw.useEffect((function(){var e=wae(cde,t),r=y1(e,"data.settings.sdk_settings.id_detection_settings.card_type_check.enable"),n=y1(e,"data.country"),i=y1(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),a=y1(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.enable"),s=y1(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.max_length"),c=y1(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),u=y1(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),l=y1(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),d=y1(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),f=y1(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),p=y1(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),h=y1(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),m=y1(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),g=y1(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),v=y1(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),y=y1(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),b=y1(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),w=y1(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),C=y1(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),k=y1(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(b1.isMobile?"mobile":"web")),S=y1(e,"data.card_types",[]).map((function(e){return null==e?void 0:e.code}));o({country:n,enableRecording:i,enableCardTypeCheck:r,trackCardCoordinates:a,trackCardCoordinatesMaxLength:s,frameCaptureIntervalMs:c,idCardSessionTime:d,maxRecordingTimePerVideo:f,saveFrameQuality:u,enableTimers:l,enableAutoCapture:p,waitForBestImageTimeMs:h,enableBlurCheck:m,blurThreshold:g,disableCaptureButtonIfAlert:v,enableIdDetection:y,enableScanQr:b,scanQrLimitTimeSecond:w,enableExifData:C,enableVirtualCamHashes:k,allowedCardTypesFromSettings:S})}),[t]),{settings:n}}function lde(e){var t=e.logCredentials,r=e.clientSettings,n=e.uiOnlyComponent,o=e.onError,i=e.detectIdCard,a=e.outputEncryptionSettings,s=e.steps,c=e.onStepDone,u=e.customTheme,l=ude({clientSettings:r}).settings,d=Ry({},sde({settings:l,onError:o,detectIdCard:i,outputEncryptionSettings:a,steps:s,onStepDone:c}));return xw.createElement(hne,null,xw.createElement(cB,{theme:u},xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy({},t)}},xw.createElement(n,Ry({},e,{settings:l,scannerTypeCons:nde},d)))))}var dde={logCredentials:xC.shape({}),clientSettings:xC.shape({}),uiOnlyComponent:xC.func,customTheme:xC.shape({}),onError:xC.func,onStepDone:xC.func,steps:xC.arrayOf(xC.shape({})),detectIdCard:xC.func,outputEncryptionSettings:xC.shape({})};lde.propTypes=dde,lde.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:$le,customTheme:{},onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var fde=uL.IDCardSide,pde=uL.Errors;function hde(e){return mde.apply(this,arguments)}function mde(){return(mde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.cardType,o=t.cardSide,i=t.apiClient,a=t.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(o)},!a||!a.key){e.next=4;break}return e.abrupt("return",i.httpClient.post("/v1/images",Oy({base64:r.encrypted.hex},s),{"X-TV-Key":a.key}));case 4:return e.abrupt("return",i.uploadImage(Oy({file:r.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gde(e){return vde.apply(this,arguments)}function vde(){return(vde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.apiClient,o=t.rawString,i=t.outputEncryptionSettings,a={label:"qr_code",metadata:JSON.stringify({raw:o})},!i||!i.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",Oy({base64:r.encrypted.hex},a),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",n.uploadImage(Oy({file:r.blob},a)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yde(e){return bde.apply(this,arguments)}function bde(){return(bde=xy(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.imageId,n=t.cardType,o=t.apiClient,e.abrupt("return",o.requestVerifyIDCard({card_type:n,image1:{id:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wde(e){return Cde.apply(this,arguments)}function Cde(){return(Cde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.cardType,o=t.frontCardId,i=t.isCapturingFrontSide,a=t.backCardId,s=t.recordedVideos,c=void 0===s?[]:s,u=t.qrImageId,l=c.filter((function(e){return null!==e.id})),d=c.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=5,Promise.all(d.map((function(e){return r.fileService.request({frames:e.frames})})));case 5:return f=e.sent,p={card_type:n,image:{id:o},image2:i?void 0:{id:a},videos:[].concat(Gy(l.map((function(e){return{id:e.id}}))),Gy(f.map((function(e){return{id:e.data.file_id}}))))},u&&(p.qr1_images=[{id:u}]),e.abrupt("return",r.detectIDTampering(p));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kde(e){return Sde.apply(this,arguments)}function Sde(){return(Sde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,n=t.apiClient,o=t.frontCardId,i=t.backCardId,a=t.isCapturingFrontSide,s=t.qrImageId,c={card_type:r,image1:a?{id:o}:{id:i}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ede(e){return Bde.apply(this,arguments)}function Bde(){return(Bde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,C,k,S,E,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,o=t.frontCardId,i=t.qrImageId,a=t.onError,s=t.recordedVideos,c=t.apiClient,u=t.cardType,l=t.cardSide,d=t.qrScannedResult,f=t.outputEncryptionSettings,l!==fde.BACK||o){e.next=4;break}return a(pde.missing_front_id_card),e.abrupt("return");case 4:return p=[hde({image:n,cardType:u,cardSide:l,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&p.push(gde({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(p);case 8:if(h=e.sent,m=Ky(h,2),g=m[0],v=m[1],!g.errors){e.next=15;break}return a(Oy(Oy({},pde.upload_error),{},{details:g.errors})),e.abrupt("return");case 15:return y=g.data.image_id,b=(null==v||null===(r=v.data)||void 0===r?void 0:r.image_id)||i,(k=l===fde.FRONT)?w=y:(w=o,C=y),e.next=21,yde({imageId:y,cardType:u,apiClient:c});case 21:if(!(S=e.sent).errors){e.next=25;break}return a(Oy(Oy({},pde.sanity_check_error),{},{details:S.errors})),e.abrupt("return");case 25:return e.next=27,kde({cardType:u,apiClient:c,frontCardId:w,backCardId:C,isCapturingFrontSide:k,qrImageId:b});case 27:if(!(E=e.sent).errors){e.next=31;break}return a(Oy(Oy({},pde.read_id_card_error),{},{details:E.errors})),e.abrupt("return");case 31:return e.next=33,wde({apiClient:c,cardType:u,frontCardId:w,isCapturingFrontSide:k,backCardId:C,recordedVideos:s,qrImageId:b});case 33:if(!(B=e.sent).errors){e.next=37;break}return a(Oy(Oy({},pde.detect_id_tampering_error),{},{details:B.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:S.data,tamperingInfo:B.data,cardInfo:E.data,qrImageId:b});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _de=["readIDCardUIOnlyComponent"],xde=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],Tde=uL.Errors,Ade=function(e){var t=e.readIDCardUIOnlyComponent,r=Vy(e,_de),n=r.onError,o=r.onStepDone,i=r.apiCredentials,a=r.logCredentials,s=r.outputEncryptionSettings,c=Vy(r,xde),u=Ky(xw.useState(null),2),l=u[0],d=u[1],f=fq.useApiClient({apiCredentials:i,logCredentials:a}).apiClient,p=xw.useRef(""),h=xw.useRef("");xw.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.clientSettings();case 2:t=e.sent,d(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[f]);var m=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,i,a,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,i=t.cardSide,a=t.recordedVideos,c=t.qrScannedResult,u=t.image,l=null,e.prev=2,e.next=5,Ede({image:u,cardSide:i,frontCardId:p.current,qrImageId:h.current,onError:n,apiClient:f,cardType:r,recordedVideos:a,qrScannedResult:c,outputEncryptionSettings:s});case 5:l=e.sent,i===uL.IDCardSide.FRONT&&(p.current=l.cardInfo.image1.id),h.current=l.qrImageId,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n(Oy(Oy({},Tde.api_call_error),{},{details:e.t0}));case 13:l&&o(Oy(Oy({},t),{},{apiResult:l}));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),[f,n,o,s]);return l&&xw.createElement(t,Ry({logCredentials:a,onError:n,onStepDone:m,outputEncryptionSettings:s},c,{clientSettings:l}))};function Ide(){return Pde.apply(this,arguments)}function Pde(){return(Pde=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.tfScriptUrls,i=t.blazefaceModelUrl,a=t.closeEyesModelUrl,s=new wue,e.prev=2,Vq.loadTensorFlow(o).then((function(){Vq.loadBlazefaceModel({modelUrl:i})})),e.next=6,Promise.all([E9({closeEyesModelUrl:a}),s.loadResource({modelUrl:n}),mue({url:r})]);case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}Ade.propTypes={onError:xC.func,onStepDone:xC.func,apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),logCredentials:xC.shape({}),outputEncryptionSettings:xC.shape({}),readIDCardUIOnlyComponent:xC.func},Ade.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:lde};var Rde,Dde,Ode,Nde,Lde,Mde,Fde,Ude,jde=S9(Ide),Vde=function(){return{checkCamera:ane,LivenessDetection:$se,NativeCamera:cne,ReadIDCardUIOnly:lde,ReadIDCardWithApiCall:Ade,warmUpReadIdCard:Mue,preloadEKYCResources:jde,getListCamera:H1,FlashLiveness:yse}},zde=l7,qde=Vy(Bre,["useLivenessDetection"]);function Hde(e){var t=e.className;return xw.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xw.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}Hde.propTypes={className:xC.string},Hde.defaultProps={className:""};var Wde,Kde,Qde,Gde,Xde,Yde,$de,Zde,Jde,efe,tfe=T5,rfe=uee,nfe=aee,ofe=Ste,ife=ofe.default,afe=qde.FaceDetectionError,sfe=qde.FaceVerificationInstructions,cfe=qde.FaceVerificationStepsWrapper,ufe=qde.StepItem,lfe=qde.BottomButtonsOverlay,dfe=qde.Button,ffe=qde.CountDownOverlay,pfe=qde.InstructionsOverlay,hfe=qde.CountdownTime,mfe=dB(_7)(Rde||(Rde=Wy(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),gfe=dB(Hde)(Dde||(Dde=Wy(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.color;return null!=t?t:"rgba(0, 0, 0, 0.6)"})),vfe=dB.div(Ode||(Ode=Wy(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),yfe=dB(sfe)(Nde||(Nde=Wy(["\n font-size: 20px;\n"]))),bfe=dB(pfe)(Lde||(Lde=Wy(["\n ",";\n ",";\n"])),nfe.default,rfe.default),wfe=dB(hfe)(Mde||(Mde=Wy(["\n background-color: unset;\n color: #ffffff;\n font-size: 20px;\n"]))),Cfe=b1.isMobile?{width:640}:null,kfe={background:"#000000",opacity:.6};function Sfe(e){return new Promise((function(t){var r=new Image;r.onload=t,r.onerror=t,r.src=e}))}function Efe(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,i=e.onError,a=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customStepTimeConstraints,l=e.onProcessing,d=e.customErrors,f=e.customMessages,p=e.livenessSettings,h=e.customInstructions,m=e.apiCredentials,g=Jj.useAsset("bg_camera_mask.png"),v=Jj.useAsset("bg_camera_mask_red.png"),y=Ky(xw.useState({}),2),b=y[0],w=y[1],C=b.yFaceVerificationStepsWrapper,k=Ky(xw.useState(""),2),S=k[0],E=k[1],B=Ky(xw.useState(!1),2),_=B[0],x=B[1],T=xw.useCallback((function(e){var t=e.lostY,r=e.height,n=t+25,o=n+30;return w({yFaceDetectionError:n,yFaceVerificationStepsWrapper:o+r+20}),{y:Math.floor(o)}}),[]),A=zde({apiCheck:t,mode:r,bgCameraMask:g,bgCameraMaskRed:v,surroundStyle:kfe,onLivenessDetectionDone:n,onError:i,cropAreaDimension:T,captureFrameSettings:a,onFramesCaptured:s,livenessSettings:p,setRemainingTime:E,customStepTimeConstraints:u,onProcessing:l,customErrors:d,customMessages:f,customInstructions:h,apiCredentials:m}),I=A.countdownToTakePicture,P=A.cropArea,R=A.curStepIndex,D=A.directionIcon,O=A.faceDetectionError,N=A.handleTriggerPassiveMode,L=A.handleVideoPlayed,M=A.instructions,F=A.isActiveMode,U=A.refVideo,j=A.showCountdown,V=A.steps,z=A.videoPlayed,q=A.directionIconAnimation,H=A.isFirstValidFrameFound,W=A.warmupDone;xw.useEffect((function(){Promise.all(V.map((function(e){return Sfe(e.directionIcon)}))).then((function(){return x(!0)}))}),[V]);var K=xw.useRef(!1);return xw.useEffect((function(){H||(K.current=!1)}),[H]),O&&"liveness_terminated_time_out"===O.code&&(K.current=!0),xw.createElement(C5,{frontCamera:c,onVideoPlayed:L,onClose:o,flipHorizontal:c,ref:U,videoSettings:Cfe,onError:i},!W&&xw.createElement(Y7,null),z&&_?xw.createElement(xw.Fragment,null,xw.createElement(ife,{keyForTransition:R}),xw.createElement(afe,{top:C,className:"face-detection-error",error:O}),S&&xw.createElement(wfe,{top:P.current.y-20},S),P.current?xw.createElement(x5,{x:"".concat(P.current.x,"px"),y:"".concat(P.current.y,"px"),width:"".concat(P.current.width,"px"),height:"".concat(P.current.height,"px"),surroundStyle:P.current.surroundStyle},xw.createElement(gfe,null),xw.createElement(mfe,{progress:R/V.length*100,showErrorRing:!!O,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:2,insideRingStrokeDash:"none"}),j?xw.createElement(ffe,null,I):null,F?xw.createElement(bfe,null,D?xw.createElement("img",{className:q,src:D,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):null):null,O&&xw.createElement(vfe,null)):null,F?xw.createElement(xw.Fragment,null,M?xw.createElement(yfe,{top:C-30,className:"instructions"},M):null,H&&!K.current&&xw.createElement(cfe,{top:C+35},V.map((function(e,t){var r=e.name,n=e.image.objUrl;return xw.createElement(ufe,{key:r,active:R>=t,className:"step-item"},n?xw.createElement("img",{src:n,alt:""}):xw.createElement("span",null,t+1))})))):xw.createElement(xw.Fragment,null,O?null:xw.createElement(lfe,null,xw.createElement(dfe,{onClick:N},xw.createElement(tfe,null))))):null)}function Bfe(e){return xw.createElement($se,Ry({},e,{livenessComponent:Efe}))}Efe.propTypes={apiCheck:xC.bool,mode:xC.string,onLivenessDetectionDone:xC.func,onClose:xC.func,onError:xC.func,captureFrameSettings:xC.shape({}),onFramesCaptured:xC.func,frontCamera:xC.bool,customStepTimeConstraints:xC.shape({}),onProcessing:xC.func,customErrors:xC.shape({}),customMessages:xC.shape({}),livenessSettings:xC.shape({}),customInstructions:xC.shape({}),apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string})},Efe.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customStepTimeConstraints:(Fde={},Py(Fde,uL.FaceDirection.UP,{delayTime:0}),Py(Fde,uL.FaceDirection.LEFT,{delayTime:0}),Py(Fde,uL.FaceDirection.RIGHT,{delayTime:0}),Py(Fde,uL.FaceDirection.FRONTAL,{delayTime:2e3}),Fde),onProcessing:function(){},customErrors:{no_face:{code:"no_face",msg:{en:"Face is not detected.",vi:"Không nhận diện được khuôn mặt."}},multiple_faces:{code:"multiple_faces",msg:{en:"There are more than one face in the frame",vi:"Nhiều khuôn mặt xuất hiện trong khung hình"}},face_too_small:{code:"face_too_small",msg:{en:"The face is too small",vi:"Khuôn mặt quá nhỏ"}},face_too_large:{code:"face_too_large",msg:{en:"The face is too big",vi:"Khuôn mặt quá lớn"}},face_out_of_box:{code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt nằm ngoài khung ảnh"}},liveness_terminated_time_out:{code:"liveness_terminated_time_out",msg:{en:"The face verification need to be completed in <%= x %> seconds.\nPlease try again.",vi:"Xác thực khuôn mặt cần thực hiện trong <%= x %> giây.\nVui lòng thử lại."}}},customMessages:{REMAIN_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Kết thúc sau <%= x %>"}},customInstructions:(Ude={},Py(Ude,uL.FaceDirection.LEFT,{en:"Please turn to the left",vi:"Vui lòng quay trái"}),Py(Ude,uL.FaceDirection.RIGHT,{en:"Please turn to the right",vi:"Vui lòng quay phải"}),Py(Ude,uL.FaceDirection.UP,{en:"Please look up",vi:"Vui lòng nhìn lên"}),Py(Ude,uL.FaceDirection.FRONTAL,{en:"Please look straight to camera",vi:"Vui lòng nhìn thẳng vào camera"}),Ude),livenessSettings:{face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,limit_time_liveness_check:{enable:!0,limit_time_second:45,remain_time_show:15,format:"mm:ss"},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3}},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""}};var _fe,xfe=tee,Tfe=_te,Afe=Ste,Ife=xfe.animationDuration,Pfe=Afe.default,Rfe=dB.div(Wde||(Wde=Wy(["\n ","\n ","\n"])),xfe.default,Tfe.default),Dfe=dB.img(Kde||(Kde=Wy(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),Ofe=10,Nfe=60,Lfe=dB.div(Qde||(Qde=Wy(["\n cursor: pointer;\n text-align: center;\n width: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),Nfe,s5+20,b1.isMobile?YE(["top:",";"],(function(e){return e.y})):YE(["bottom:","px;"],Ofe)),Mfe=function(){return xw.createElement("div",{className:"box_loader",id:"vib-v2018-loading"},xw.createElement("div",{className:"loader"},xw.createElement("div",{className:"inner one"}),xw.createElement("div",{className:"inner two"}),xw.createElement("div",{className:"inner three"})))},Ffe=dB.div(Gde||(Gde=Wy(["\n color: #fff;\n text-align: center;\n"]))),Ufe=dB.div(Xde||(Xde=Wy(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),s5+20),jfe=dB.div(Yde||(Yde=Wy(["\n display: flex;\n align-items: center;\n"]))),Vfe=dB(Ffe)($de||($de=Wy(["\n font-size: 16px;\n margin-left: 10px;\n color: #fff;\n"]))),zfe=dB.div(Zde||(Zde=Wy(["\n margin: 0 auto;\n padding: 0 5px;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),s5+20),qfe=dB(Ffe)(Jde||(Jde=Wy(["\n text-align: center;\n background: ",";\n padding: 5px 10px;\n font-size: 18px;\n"])),(function(e){return e.theme.dangerColor})),Hfe=function(e){var t=e.children,r=e.y;return xw.createElement(zfe,{y:r},xw.createElement(qfe,null,t))},Wfe=dB(Jse)(efe||(efe=Wy(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),Kfe=uL.Errors,Qfe={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},Gfe=Oy(Oy({},Kfe),{},{id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Take a photo of your ID card's <%= side %> side. Make sure the image of the card fits in the frame, (minimum 50% of frame).",vi:"Mặt <%= side %> CCCD cần nằm gọn trong khung hình, chiếm tối thiểu 50%."}},id_detector_validate_angle_error:{code:"id_detector_validate_angle_error",msg:{en:"Please put your ID card straight, not be oblique",vi:"Vui lòng đặt giấy tờ thẳng góc, không bị xô lệch khi chụp"}},id_detector_card_too_small:{code:"id_detector_card_too_small",msg:{en:"Please hold your ID card closer",vi:"Vui lòng đưa CCCD lại gần hơn"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please hold your ID card further",vi:"Vui lòng đưa CCCD ra xa hơn"}},id_detector_error_front_side_no_faces:{code:"id_detector_error_front_side_no_faces",msg:{en:"Take a photo of your ID card's front side",vi:"Vui lòng chụp ảnh mặt trước của CCCD"}},id_detector_error_front_side_multiple_faces:{code:"id_detector_error_front_side_multiple_faces",msg:{en:"Please remove other items out of the frame",vi:"Vui lòng không để lẫn vật thể khác trong khung chụp hình"}},glare_detected:{code:"glare_detected",msg:{en:"Your photo ID is glare. Please adjust the shooting angle.",vi:"Ảnh chụp bị lóa sáng. Vui lòng chụp lại"}},not_allowed_card_types:{code:"not_allowed_card_types",msg:{en:"Please use Citizen Identity card to register",vi:"Vui lòng sử dụng loại giấy tờ là CCCD"}}}),Xfe=xw.forwardRef((function(e,t){var r,n=e.usePortraitMask,o=e.windowAndVideoInfo,i=e.refVideo,a=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=e.allowedCardTypes,f=Ky(xw.useState({}),2),p=f[0],h=f[1],m=p.yErrorMessage,g=p.yCaptureButton,v=Jj.useAsset("ic_camera.svg"),y=yj.useSDKSettings().lang,b=Ky(xw.useState(""),2),w=b[0],C=b[1],k=Ky(xw.useState(null),2),S=k[0],E=k[1],B=qq.useThemeContext().dangerColor,_=xw.useRef((function(){})),x=xw.useCallback((function(e){C(null===e?"":i9(Gfe[e.code].msg[y])({side:a?Qfe.FRONT[y]:Qfe.BACK[y]}))}),[y,a]),T=xw.useCallback((function(){_.current()}),[]),A=Gue({shouldStart:!0,refVideo:i,cropArea:S,settings:s,onModelErrorChange:x,frontSide:a,onSessionTimeout:T,onCaptureDone:c,outputEncryptionSettings:l,allowedCardTypes:d}),I=A.warmupDone,P=A.isProcessing,R=A.takePictureManually,D=A.restartSession,O=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D();case 2:case"end":return e.stop()}}),e)}))),[D]);_.current=O,xw.useEffect((function(){if(o){var e,t,r,i,a,s,c=o.videoAreaWidth,l=o.videoAreaHeight,d=o.lostX,f=o.lostY,p=o.clientHeight;n?(i=.7*(a=l-165),r=(s=(e=f+10)+45)+a+70):(i=b1.isMobile?c-6:Math.floor(.7*c),a=Math.floor(Math.min(i/1.5,p-2*f-(Nfe+2*Ofe)-135)),r=(t=(s=(e=f+10)+(b1.isMobile?90:50))+a+10)+88);var m=Math.floor((c-i)/2)+d;E({x:m,y:s,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var g={yTitle:e,yErrorMessage:t,yCaptureButton:r};h(g),u(g)}}),[o,n,u]);var N=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R();case 2:case"end":return e.stop()}}),e)}))),[R]);return xw.useImperativeHandle(t,(function(){return{restartSession:O}}),[O]),xw.createElement(xw.Fragment,null,!I&&xw.createElement(Y7,null),P&&xw.createElement(Mfe,null),S&&xw.createElement(x5,{x:"".concat(S.x,"px"),y:"".concat(S.y,"px"),width:"".concat(S.width,"px"),height:"".concat(S.height,"px"),surroundStyle:S.surroundStyle},xw.createElement(Wfe,{strokeStyles:(r={},Py(r,Zse.DEFAULT,{fill:"none",strokeWidth:1,stroke:"#fff"}),Py(r,Zse.ERROR,{fill:"rgba(255, 0, 0, 0.1)",strokeWidth:3,stroke:B}),r),strokeWidth:3,errorColor:B,width:S.width,height:S.height,type:w?Zse.ERROR:Zse.DEFAULT})),w&&xw.createElement(Hfe,{y:"".concat(m,"px")},w),!P&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!w)&&xw.createElement(Lfe,{onClick:N,y:"".concat(g,"px")},xw.createElement("img",{src:v,alt:""})))}));Xfe.propTypes={usePortraitMask:xC.bool,windowAndVideoInfo:xC.shape({}),refVideo:xC.shape({}),frontSide:xC.bool,settings:xC.shape({}),onCaptureDone:xC.func,onUISpacingChange:xC.func,outputEncryptionSettings:xC.shape({}),allowedCardTypes:xC.arrayOf(xC.string)},Xfe.defaultProps={usePortraitMask:!1,windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null,allowedCardTypes:[]};var Yfe,$fe,Zfe,Jfe,epe,tpe,rpe=dB.div(_fe||(_fe=Wy(["\n z-index: ",";\n padding: 10px;\n margin: 0 10px;\n color: #fff;\n position: absolute;\n top: ",";\n font-size: 16px;\n text-align: center;\n max-width: 400px;\n"])),s5+20,(function(e){return e.y})),npe={QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR."}},ope=dB.button(Yfe||(Yfe=Wy(["\n background: ",";\n height: 45px;\n border-radius: 5px;\n border: 0;\n padding: 0 20px;\n color: #000;\n cursor: pointer;\n font-size: 16px;\n font-weight: 600;\n"])),(function(e){return e.theme.primaryColor})),ipe=dB.a($fe||($fe=Wy(["\n text-decoration: underline;\n font-size: 16px;\n color: #000;\n cursor: pointer;\n"]))),ape=dB.div(Zfe||(Zfe=Wy(["\n padding: 20px;\n"]))),spe=dB.div(Jfe||(Jfe=Wy(["\n color: #000;\n font-size: 20px;\n"]))),cpe=dB.div(epe||(epe=Wy(["\n color: #000;\n font-size: 16px;\n"]))),upe=dB.div(tpe||(tpe=Wy(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n"]))),lpe=function(e){var t=e.onRetry,r=e.onSkip,n=yj.useSDKSettings().lang;return xw.createElement(ape,null,xw.createElement(Yre,{mt:"15px"},xw.createElement(spe,null,npe.QR_INVALID_POPUP_TITLE[n])),xw.createElement(Yre,{mt:"20px"},xw.createElement(cpe,null,npe.QR_INVALID_POPUP_DESCRIPTION[n])),xw.createElement(Yre,{mt:"30px"},xw.createElement(upe,null,xw.createElement(Yre,{mr:"30px"},xw.createElement(ipe,{onClick:r},npe.QR_INVALID_POPUP_SKIP_BUTTON[n])),xw.createElement(ope,{onClick:t},npe.QR_INVALID_POPUP_RETRY_BUTTON[n]))))};lpe.propTypes={onRetry:xC.func,onSkip:xC.func},lpe.defaultProps={onRetry:function(){},onSkip:function(){}};var dpe,fpe={SESSION_TIMEOUT:"SESSION_TIMEOUT",CONFIRM:"CONFIRM",QR_INVALID:"QR_INVALID"},ppe=["children","onClose"],hpe=dB.button(dpe||(dpe=Wy(["\n position: absolute;\n top: 20px;\n right: 20px;\n border: 0;\n padding: 0;\n background: none;\n cursor: pointer;\n\n img {\n width: 16px;\n height: 16px;\n }\n"]))),mpe=b1.isMobile?{contentStyle:{maxWidth:"100%",height:"100%",borderRadius:0},overlayStyle:{padding:0}}:{},gpe=function(e){var t=e.children,r=e.onClose,n=Vy(e,ppe),o=Jj.useAsset("ic_close_black.png");return xw.createElement(Q7,Ry({},mpe,n),t,xw.createElement(hpe,{onClick:r},xw.createElement("img",{src:o,alt:""})))};gpe.propTypes={children:xC.node,onClose:xC.func},gpe.defaultProps={children:null,onClose:function(){}};var vpe,ype,bpe,wpe,Cpe=145;function kpe(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,i=e.onCaptureDone,a=Ky(xw.useState(null),2),s=a[0],c=a[1],u=Jj.useAsset("qr_capture_cursor.png"),l=Ky(xw.useState({}),2),d=l[0],f=l[1],p=d.yTooltip,h=yj.useSDKSettings().lang,m=Yj.useSDKTracking().sendEvent,g=aue(),v=g.showPopup,y=g.popupShown,b=g.popupType,w=xw.useRef();xw.useEffect((function(){m({tag:"id_qr",event:"user_activity.start",log:{}}),w.current=performance.now()}),[m]),xw.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,i=b1.isMobile?Math.min(e-6,Cpe):Cpe,a=i,s=o+140,u=s+a+20,l=Math.floor((e-i)/2)+n;c({x:l,y:s,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var d={yTooltip:u};f(d),r(d)}}),[t,r]);var C=xw.useCallback((function(){m({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),i()}),[i,m]),k=xw.useCallback((function(e){var t=e.validateResult.valid,r=performance.now();t?(m({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-w.current)/1e3}}),i(e)):(v({popupType:fpe.QR_INVALID}),m({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[v,i,m]),S=Kle({shouldStart:!0,refVideo:n,cropArea:s,settings:o,onSessionTimeout:C,onCaptureDone:k}),E=S.isProcessing,B=S.restartSession,_=S.warmupDone,x=xw.useCallback((function(){v({popupType:null})}),[v]),T=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(),w.current=performance.now(),m({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,B();case 5:case"end":return e.stop()}}),e)}))),[B,x,m]),A=xw.useCallback((function(){x(),m({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),i()}),[x,i,m]);return xw.createElement(xw.Fragment,null,!_&&xw.createElement(Y7,null),s&&xw.createElement(x5,{x:"".concat(s.x,"px"),y:"".concat(s.y,"px"),width:"".concat(s.width,"px"),height:"".concat(s.height,"px"),surroundStyle:s.surroundStyle},xw.createElement("div",null,xw.createElement("img",{src:u,width:s.width,height:s.height,alt:""}))),xw.createElement(rpe,{y:"".concat(p,"px")},npe.QR_TOOLTIP[h]),E&&xw.createElement(Mfe,null),xw.createElement(gpe,{open:y,onClose:A},b===fpe.QR_INVALID&&xw.createElement(lpe,{onRetry:T,onSkip:A})))}kpe.propTypes={windowAndVideoInfo:xC.shape({}),onUISpacingChange:xC.func,refVideo:xC.shape({}),settings:xC.shape({}),onCaptureDone:xC.func},kpe.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){}};var Spe=dB.div(vpe||(vpe=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Epe=dB.div(ype||(ype=Wy(["\n text-align: center;\n font-size: 1rem;\n color: ",";\n margin-top: 10px;\n"])),(function(e){return e.theme.dangerColor})),Bpe=dB.img(bpe||(bpe=Wy(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),_pe=dB.div(wpe||(wpe=Wy(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n gap: 10px;\n"]))),xpe=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,i=e.hasValidQR,a=Ky(xw.useState(null),2),s=a[0],c=a[1],u=yj.useSDKSettings().lang;return xw.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),c(e)),function(){URL.revokeObjectURL(e)}}),[t]),xw.createElement(Spe,null,null!==i&&xw.createElement(Yre,{mb:"20px"},xw.createElement("div",null,xw.createElement(Lre,{type:i?Ire.SUCCESS:Ire.WARNING},i?Qfe.CONFIRM_POPUP_VALID_QR[u]:Qfe.CONFIRM_POPUP_INVALID_QR[u]))),xw.createElement(zre,{ratio:1.5},xw.createElement(Bpe,{src:s})),o&&xw.createElement(Epe,{className:"confirm-popup-error-message"},o.msg[u]),xw.createElement(_pe,null,xw.createElement(ipe,{onClick:n},Qfe.BTN_TRY_AGAIN[u]),xw.createElement(ope,{onClick:r},Qfe.BTN_USE_THIS_PICTURE[u])))};xpe.propTypes={imageTaken:xC.shape({}),error:xC.shape({msg:xC.shape({})}),onConfirm:xC.func,onTryAgain:xC.func,hasValidQR:xC.bool},xpe.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null};var Tpe,Ape={primaryColor:"#FDB913",dangerColor:"#FF0000"},Ipe=pB(Tpe||(Tpe=Wy(['\n ///////////////// Loading Icon (provided by VIB) //////////////////////\n .loader {\n position: fixed;\n top: calc(50% - 32px);\n left: calc(50% - 32px);\n width: 64px;\n height: 64px;\n border-radius: 50%;\n perspective: 800px;\n z-index: 999999\n }\n\n .box_loader::before {\n /* background-color:rgba(0,0,0,.8); */\n width: 100%;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n content: "";\n display: block;\n z-index: 999995;\n }\n\n .inner {\n position: absolute;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border-radius: 50%\n }\n\n .inner.one {\n left: 0;\n top: 0;\n animation: rotate-one 1s linear infinite;\n border-bottom: 3px solid #fdb913\n }\n\n .inner.two {\n right: 0;\n top: 0;\n animation: rotate-two 1s linear infinite;\n border-right: 3px solid #f47920\n }\n\n .inner.three {\n right: 0;\n bottom: 0;\n animation: rotate-three 1s linear infinite;\n border-top: 3px solid #f7941d\n }\n\n @keyframes rotate-one {\n 0% {\n transform: rotateX(35deg) rotateY(-45deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg)\n }\n }\n\n @keyframes rotate-two {\n 0% {\n transform: rotateX(50deg) rotateY(10deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg)\n }\n }\n\n @keyframes rotate-three {\n 0% {\n transform: rotateX(35deg) rotateY(55deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg)\n }\n }\n ///////////////////////////////////////////////////////////\n']))),Ppe=uL.IDCardSide,Rpe=uL.IDCardType,Dpe=uL.Errors,Ope={ID_CARD:"id_card",QR_CODE:"qr_code"},Npe=[{scannerType:Ope.ID_CARD,title:"Chụp mặt trước CCCD",titleIcon:"id_card_front.svg",cardSide:uL.IDCardSide.FRONT,cardType:Rpe.VN,frontCamera:!1,enableConfirmPopup:!1},{scannerType:Ope.ID_CARD,title:"Chụp mặt sau CCCD",titleIcon:"id_card_back.svg",cardSide:uL.IDCardSide.BACK,cardType:Rpe.VN,frontCamera:!1,enableConfirmPopup:!1}],Lpe={scannerType:Ope.QR_CODE,frontCamera:!1,cardSide:uL.IDCardSide.FRONT,cardType:Rpe.VN};function Mpe(e){var t=e.onClose,r=e.onError,n=e.clientSettings,o=e.detectIdCard,i=e.onStepDone,a=e.steps,s=e.outputEncryptionSettings,c=e.allowedCardTypes,u=Ky(xw.useState(0),2),l=u[0],d=u[1],f=Ky(xw.useState(a[l]),2),p=f[0],h=f[1],m=xw.useRef(null),g=Ky(xw.useState(null),2),v=g[0],y=g[1],b=Ky(xw.useState(!1),2),w=b[0],C=b[1],k=Ky(xw.useState(0),2),S=k[0],E=k[1],B=xw.useRef(),_=p.scannerType,x=p.frontCamera,T=p.title,A=p.titleIcon,I=p.cardSide,P=p.usePortraitMask,R=p.cardType,D=p.enableConfirmPopup,O=I===Ppe.FRONT,N=Jj.useAsset(A),L=aue(),M=L.showPopup,F=L.popupShown,U=L.popupType,j=L.props,V=Ky(xw.useState(!1),2),z=V[0],q=V[1],H=xw.useRef(null),W=xw.useRef(null),K=xw.useRef([]),Q=ude({clientSettings:n}).settings,G=Ky(xw.useState({}),2),X=G[0],Y=G[1],$=X.yTitle,Z=Yj.useSDKTracking().sendEvent,J=xw.useCallback((function(e){y(e),C(!0)}),[]);xw.useEffect((function(){C(!1)}),[x]);var ee=xw.useCallback((function(){M({popupType:null})}),[M]),te=xw.useCallback((function(e){e>=a.length||setTimeout((function(){d(e),h(a[e])}),200)}),[a]),re=xw.useCallback((function(){te(l+1)}),[te,l]),ne=xw.useCallback((function(){setTimeout((function(){h((function(e){return Oy(Oy({},Lpe),{},{enableConfirmPopup:e.enableConfirmPopup})}))}),200)}),[]),oe=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={stepNumber:l,cardSide:I,cardType:R,image:H.current,recordedVideos:null!=Q&&Q.enableRecording?K.current:[]},(_===Ope.QR_CODE||null!==(t=W.current)&&void 0!==t&&t.result)&&(r.qrScannedResult=W.current),q(!0),e.next=5,i(r);case 5:Z({tag:"result",event:"sdk_mode.read_id_card_one_side",log:{result_object:r}}),q(!1),W.current=null,re();case 9:case"end":return e.stop()}}),e)}))),[Q,l,i,re,_,Z,I,R]),ie=xw.useCallback((function(){ee(),W.current=null,_===Ope.QR_CODE?te(l):_===Ope.ID_CARD&&(Z({tag:O?"id_front":"id_back",event:"user_activity.retry",log:{}}),B.current.restartSession())}),[te,l,ee,_,O,Z]),ae=xw.useCallback((function(){ee(),Z({tag:O?"id_front":"id_back",event:"user_activity.submit",log:{}}),oe()}),[oe,ee,Z,O]),se=xw.useCallback((function(e){var t;if(W.current=e,e&&Array.isArray(e.recordedVideos)){var r,n=e.recordedVideos;(r=K.current).push.apply(r,Gy(n))}E((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);D?M({popupType:fpe.CONFIRM,props:{hasValidQR:o,imageTaken:H.current}}):oe()}),[M,D,oe]),ce=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,i,a,c,u,l,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,i=t.error,a=t.recordedVideos,H.current=n,K.current=a,E((function(e){return e+1})),I!==uL.IDCardSide.FRONT){e.next=28;break}if(!Q.enableScanQr||!b1.isMobile){e.next=28;break}if(u=null==n||null===(c=n.detectedCard)||void 0===c?void 0:c.label){e.next=20;break}return q(!0),e.prev=9,e.next=12,o({image:n,cardType:R,cardSide:I});case 12:l=e.sent,u=l.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(Dpe.detect_id_card_error);case 19:q(!1);case 20:if(!u||!"vn.cccd_new.front".includes(u)){e.next=28;break}return q(!0),e.next=24,Lle(H.current.blob,s);case 24:return(d=e.sent)?se(d):ne(),q(!1),e.abrupt("return");case 28:D?M({popupType:fpe.CONFIRM,props:{imageTaken:H.current,error:i}}):oe();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[D,M,I,Q,R,o,oe,ne,r,se,s]);return xw.createElement(cB,{theme:Ape},xw.createElement(Rfe,null,xw.createElement(C5,{key:x,frontCamera:x,onVideoPlayed:J,onClose:t,flipHorizontal:x,ref:m,onError:r},w&&xw.createElement(xw.Fragment,null,_===Ope.ID_CARD&&xw.createElement(Xfe,{key:l,ref:B,windowAndVideoInfo:v,refVideo:m,settings:Q,onCaptureDone:ce,onUISpacingChange:Y,frontSide:O,usePortraitMask:P,outputEncryptionSettings:s,allowedCardTypes:c}),_===Ope.QR_CODE&&xw.createElement(kpe,{key:l,refVideo:m,windowAndVideoInfo:v,settings:Q,onCaptureDone:se,onUISpacingChange:Y})),xw.createElement(Pfe,{keyForTransition:S}),xw.createElement(Ufe,{y:"".concat($,"px")},xw.createElement(Fee,null,xw.createElement(Iee,{key:T,timeout:{enter:Ife,exit:Ife},classNames:"flipY",unmountOnExit:!0},xw.createElement(jfe,null,A&&xw.createElement(Dfe,{src:N,alt:""}),xw.createElement(Vfe,{className:"title"},T))))),z&&xw.createElement(Mfe,null)),xw.createElement(Q7,{open:F},U===fpe.CONFIRM&&xw.createElement(xpe,Ry({},j,{onConfirm:ae,onTryAgain:ie})))),xw.createElement(Ipe,null))}Mpe.propTypes={onClose:xC.func,onError:xC.func,clientSettings:xC.shape({}),detectIdCard:xC.func,onStepDone:xC.func,steps:xC.arrayOf(xC.shape({})),outputEncryptionSettings:xC.shape({}),allowedCardTypes:xC.arrayOf(xC.string)},Mpe.defaultProps={onClose:function(){},onError:function(){},clientSettings:{},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:Npe,outputEncryptionSettings:null,allowedCardTypes:[]};var Fpe=["tracking","clientSettings"];function Upe(e){var t=e.tracking,r=e.clientSettings,n=Vy(e,Fpe),o=xw.useMemo((function(){return y1(r,"data.settings.sdk_settings.server_log_settings.enable",null==t?void 0:t.enable)}),[r,t]);return xw.createElement(hne,null,xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy(Oy({},t),{},{enable:o})}},xw.createElement(Mpe,Ry({},n,{clientSettings:r}))))}Upe.propTypes={tracking:xC.shape({}),clientSettings:xC.shape({})},Upe.defaultProps={tracking:void 0,clientSettings:void 0};var jpe=uL.Errors,Vpe=function(e){var t=e.onClose,r=e.onError,n=e.detectIdCard,o=e.steps,i=e.onStepDone,a=e.apiCredentials,s=e.tracking,c=e.allowedCardTypes,u=Ky(xw.useState(null),2),l=u[0],d=u[1],f=fq.useApiClient({apiCredentials:a,tracking:s}).apiClient,p=xw.useRef(""),h=xw.useRef("");xw.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.clientSettings();case 2:t=e.sent,d(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[f]);var m=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,a,s,c,u,l,d,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.stepNumber,a=t.recordedVideos,s=t.qrScannedResult,c=t.image,u=o[n],l=u.cardType,d=u.cardSide,m=null,e.prev=3,e.next=6,Ede({image:c,cardSide:d,frontCardId:p.current,qrImageId:h.current,onError:r,apiClient:f,cardType:l,recordedVideos:a,qrScannedResult:s});case 6:m=e.sent,d===uL.IDCardSide.FRONT&&(p.current=m.cardInfo.image1.id),h.current=m.qrImageId,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),r(Oy(Oy({},jpe.api_call_error),{},{details:e.t0}));case 14:m&&i(Oy(Oy({},t),{},{apiResult:m}));case 15:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t){return e.apply(this,arguments)}}(),[f,r,o,i]);return l&&xw.createElement(Upe,{tracking:s,onClose:t,onError:r,clientSettings:l,detectIdCard:n,onStepDone:m,steps:o,allowedCardTypes:c})};Vpe.propTypes={onClose:xC.func,onError:xC.func,detectIdCard:xC.func,onStepDone:xC.func,steps:xC.arrayOf(xC.shape({})),apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),tracking:xC.shape({}),allowedCardTypes:xC.arrayOf(xC.string)},Vpe.defaultProps={onClose:function(){},onError:function(){},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:Npe,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},tracking:void 0,allowedCardTypes:[]};var zpe=function(e){Ny(r,e);var t=Hy(r);function r(e){return Ty(this,r),t.call(this,Oy(Oy({},e),{},{baseComponent:Vde(),component:{LivenessDetection:Bfe,ReadIDCardUIOnly:Upe,ReadIDCardWithApiCall:Vpe}}))}return r}(yW);t.APIUtils=fq,t.AntiDebugUtils=zq,t.AssetUtils=Jj,t.AsyncUtils=tV,t.BaseTVWebSDK=yW,t.BlurUtils=BV,t.CameraUtils=xV,t.CloseEyesDetector=fW,t.CommonUtils=AV,t.Constants=uL,t.CoordinateUtils=FV,t.CryptoUtils=Wq,t.DEFAULT_CLOSE_EYE_MODEL=dW,t.ExifUtils=lW,t.FaceUtils=KV,t.GlareUtils=nq,t.HashUtils=zj,t.ImageUtils=Jz,t.LoadResourceUtils=Cq,t.LocalStorageUtils=Fj,t.ModelUtils=Vq,t.PredictionUtils=GV,t.SDK=zpe,t.SDKTimer=Kq,t.ScannerType=c3,t.SettingsContext=yj,t.ThemeUtils=qq,t.TimeUtils=Nj,t.TrackingContext=Yj,t.UserAgentUtils=Rj,t.defaultClientSettings=D3,t.defaultReadIDCardSteps=u3,t.getCustomUrlsBySettings=pj,t.getQrScannerWorkerPath=mW,t.getSDKVersion=Ij,t.requestMotionPermission=pW,t.useDeviceMotion=hW,Object.defineProperty(t,"__esModule",{value:!0})}));
84
+ */!function(o,i){var a="function",s="undefined",c="object",u="model",l="name",d="type",f="vendor",p="version",h="architecture",m="console",g="mobile",v="tablet",y="smarttv",b="wearable",w={extend:function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:i},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},C={rgx:function(e,t){for(var r,n,o,s,u,l,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(r=n=0;r<f.length&&!u;)if(u=f[r++].exec(e))for(o=0;o<p.length;o++)l=u[++n],typeof(s=p[o])===c&&s.length>0?2==s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3==s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):i:this[s[0]]=l?s[1].call(this,l,s[2]):i:4==s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):i):this[s]=l||i;d+=2}},str:function(e,t){for(var r in t)if(typeof t[r]===c&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(w.has(t[r][n],e))return"?"===r?i:r}else if(w.has(t[r],e))return"?"===r?i:r;return e}},k={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},S={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[l,p],[/(opios)[\/\s]+([\w\.]+)/i],[[l,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[l,"Opera"],p],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[l,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[l,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[l,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[l,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[l,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[l,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[l,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[l,p],[/(QQ)\/([\d\.]+)/i],[l,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[l,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[l,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[l],[/(LBBROWSER)/i],[l],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[l,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[l,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[l,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[l,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[l,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[l,p],[/(dolfin)\/([\w\.]+)/i],[[l,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[l,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[l,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[l,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,l],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[l,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[l,[p,C.str,k.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[l,"Netscape"],p],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[l,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,w.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[h,/ower/,"",w.lowerize]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[h,w.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,f,[d,v]],[/applecoremedia\/[\w\.]+ \((ipad)/],[u,[f,"Apple"],[d,v]],[/(apple\s{0,1}tv)/i],[[u,"Apple TV"],[f,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[f,u,[d,v]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[u,[f,"Amazon"],[d,v]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[u,C.str,k.device.amazon.model],[f,"Amazon"],[d,g]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[u,f,[d,g]],[/\((ip[honed|\s\w*]+);/i],[u,[f,"Apple"],[d,g]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[f,u,[d,g]],[/\(bb10;\s(\w+)/i],[u,[f,"BlackBerry"],[d,g]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[u,[f,"Asus"],[d,v]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[f,"Sony"],[u,"Xperia Tablet"],[d,v]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[u,[f,"Sony"],[d,g]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[f,u,[d,m]],[/android.+;\s(shield)\sbuild/i],[u,[f,"Nvidia"],[d,m]],[/(playstation\s[34portablevi]+)/i],[u,[f,"Sony"],[d,m]],[/(sprint\s(\w+))/i],[[f,C.str,k.device.sprint.vendor],[u,C.str,k.device.sprint.model],[d,g]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[f,u,[d,v]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[f,[u,/_/g," "],[d,g]],[/(nexus\s9)/i],[u,[f,"HTC"],[d,v]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[u,[f,"Huawei"],[d,g]],[/(microsoft);\s(lumia[\s\w]+)/i],[f,u,[d,g]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[u,[f,"Microsoft"],[d,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,"Microsoft"],[d,g]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[u,[f,"Motorola"],[d,g]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[u,[f,"Motorola"],[d,v]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[f,w.trim],[u,w.trim],[d,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,"Samsung"],[d,y]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[d,y]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[f,"Samsung"],u,[d,v]],[/smart-tv.+(samsung)/i],[f,[d,y],u],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[f,"Samsung"],u,[d,g]],[/sie-(\w*)/i],[u,[f,"Siemens"],[d,g]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[f,"Nokia"],u,[d,g]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[u,[f,"Acer"],[d,v]],[/android.+([vl]k\-?\d{3})\s+build/i],[u,[f,"LG"],[d,v]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[f,"LG"],u,[d,v]],[/(lg) netcast\.tv/i],[f,u,[d,y]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[u,[f,"LG"],[d,g]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[u,[f,"Lenovo"],[d,v]],[/linux;.+((jolla));/i],[f,u,[d,g]],[/((pebble))app\/[\d\.]+\s/i],[f,u,[d,b]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[f,u,[d,g]],[/crkey/i],[[u,"Chromecast"],[f,"Google"]],[/android.+;\s(glass)\s\d/i],[u,[f,"Google"],[d,b]],[/android.+;\s(pixel c)\s/i],[u,[f,"Google"],[d,v]],[/android.+;\s(pixel xl|pixel)\s/i],[u,[f,"Google"],[d,g]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,g]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[u,/_/g," "],[f,"Xiaomi"],[d,v]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[u,[f,"Meizu"],[d,v]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[u,[f,"OnePlus"],[d,g]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[u,[f,"RCA"],[d,v]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[u,[f,"Dell"],[d,v]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[u,[f,"Verizon"],[d,v]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[f,"Barnes & Noble"],u,[d,v]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[u,[f,"NuVision"],[d,v]],[/android.+;\s(k88)\sbuild/i],[u,[f,"ZTE"],[d,v]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[u,[f,"Swiss"],[d,g]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[u,[f,"Swiss"],[d,v]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[u,[f,"Zeki"],[d,v]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[f,"Dragon Touch"],u,[d,v]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[u,[f,"Insignia"],[d,v]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[u,[f,"NextBook"],[d,v]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[f,"Voice"],u,[d,g]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[f,"LvTel"],u,[d,g]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[u,[f,"Envizen"],[d,v]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[u,[f,"MachSpeed"],[d,v]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[f,u,[d,v]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[u,[f,"Rotor"],[d,v]],[/android.+(KS(.+))\s+build/i],[u,[f,"Amazon"],[d,v]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[f,u,[d,v]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[d,w.lowerize],f,u],[/(android[\w\.\s\-]{0,9});.+build/i],[u,[f,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[l,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,l]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[l,p],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[l,[p,C.str,k.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[l,"Windows"],[p,C.str,k.os.windows.version]],[/\((bb)(10);/i],[[l,"BlackBerry"],p],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[l,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[l,"Symbian"],p],[/\((series40);/i],[l],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[l,"Firefox OS"],p],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[l,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[l,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[l,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[l,p],[/(haiku)\s(\w+)/i],[l,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[l,"Mac OS"],[p,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[l,p]]},E=function(e,t){if("object"==typeof e&&(t=e,e=i),!(this instanceof E))return new E(e,t).getResult();var r=e||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),n=t?w.extend(S,t):S;return this.getBrowser=function(){var e={name:i,version:i};return C.rgx.call(e,r,n.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:i};return C.rgx.call(e,r,n.cpu),e},this.getDevice=function(){var e={vendor:i,model:i,type:i};return C.rgx.call(e,r,n.device),e},this.getEngine=function(){var e={name:i,version:i};return C.rgx.call(e,r,n.engine),e},this.getOS=function(){var e={name:i,version:i};return C.rgx.call(e,r,n.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=e,this},this};E.VERSION="0.7.18",E.BROWSER={NAME:l,MAJOR:"major",VERSION:p},E.CPU={ARCHITECTURE:h},E.DEVICE={MODEL:u,VENDOR:f,TYPE:d,CONSOLE:m,MOBILE:g,SMARTTV:y,TABLET:v,WEARABLE:b,EMBEDDED:"embedded"},E.ENGINE={NAME:l,VERSION:p},E.OS={NAME:l,VERSION:p},typeof t!==s?(typeof e!==s&&e.exports&&(t=e.exports=E),t.UAParser=E):r(3)?(n=function(){return E}.call(t,r,t,e))===i||(e.exports=n):o&&(o.UAParser=E);var B=o&&(o.jQuery||o.Zepto);if(typeof B!==s){var _=new E;B.ua=_.getResult(),B.ua.get=function(){return _.getUA()},B.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var r in t)B.ua[r]=t[r]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),i=o.DEVICE_TYPES,a=o.defaultData,s=t.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=t.isIOS13Check=function(e){var t=s();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case i.MOBILE:return{isMobile:!0};case i.TABLET:return{isTablet:!0};case i.SMART_TV:return{isSmartTV:!0};case i.CONSOLE:return{isConsole:!0};case i.WEARABLE:return{isWearable:!0};case i.BROWSER:return{isBrowser:!0};default:return a}},broPayload:function(e,t,r,n,o){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:r.name||!1,engineVersion:r.version,osName:n.name,osVersion:n.version,userAgent:o}},mobilePayload:function(e,t,r,o){return n({},e,{vendor:t.vendor,model:t.model,os:r.name,osVersion:r.version,ua:o})},stvPayload:function(e,t,r,n){return{isSmartTV:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},consolePayload:function(e,t,r,n){return{isConsole:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},wearPayload:function(e,t,r,n){return{isWearable:e,engineName:t.name,engineVersion:t.version,osName:r.name,osVersion:r.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])})),w1="Expected a function",C1=NaN,k1="[object Symbol]",S1=/^\s+|\s+$/g,E1=/^[-+]0x[0-9a-f]+$/i,B1=/^0b[01]+$/i,_1=/^0o[0-7]+$/i,x1=parseInt,T1="object"==typeof r&&r&&r.Object===Object&&r,A1="object"==typeof self&&self&&self.Object===Object&&self,I1=T1||A1||Function("return this")(),P1=Object.prototype,R1=P1.toString,D1=Math.max,O1=Math.min,N1=function(){return I1.Date.now()};function L1(e,t,r){var n,o,i,a,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(w1);function p(t){var r=n,i=o;return n=o=void 0,u=t,a=e.apply(i,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):a}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=i}function g(){var e=N1();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?O1(r,i-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,a)}function y(){var e=N1(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),a}return t=j1(t)||0,M1(r)&&(l=!!r.leading,i=(d="maxWait"in r)?D1(j1(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?a:v(N1())},y}function M1(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function F1(e){return!!e&&"object"==typeof e}function U1(e){return"symbol"==typeof e||F1(e)&&R1.call(e)==k1}function j1(e){if("number"==typeof e)return e;if(U1(e))return C1;if(M1(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=M1(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(S1,"");var r=B1.test(e);return r||_1.test(e)?x1(e.slice(2),r?2:8):E1.test(e)?C1:+e}var V1=L1;function z1(e,t,r){class n extends xw.Component{constructor(){super(...arguments),this.updateDebounced=V1(this.forceUpdate,t,r)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return xw.createElement(e,Object.assign({},this.props))}}return n.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,KS(n,e)}function q1(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(r,n){e.call(navigator,t,r,n)}))}}:null}function H1(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===By(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,t){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(t){e(t.filter((function(e){return"video"===e.kind.toLowerCase()||"videoinput"===e.kind.toLowerCase()})).map((function(e){return{deviceId:null!=e.deviceId?e.deviceId:"",groupId:e.groupId,kind:"videoinput",label:e.label,toJSON:function(){return this}}})))}))}catch(e){return t(e)}}))}var W1,K1,Q1,G1,X1,Y1=["camtwist","obs virtual","logi capture","iglasses","virtual","cyberlink youcam","splitcam","splitcam virtual","splitcam video","snap camera","manycam virtual","chromacam","elgato virtual camera","sparkocam virtual webcam","webcammax capture","xsplit vcam","xpression"],$1=function(e){if(!e)return{isVirtual:!1};var t=e.getTracks();if(!t||!t.length)return{isVirtual:!1};var r=t[0].label,n=r&&Y1.some((function(e){return r.toLowerCase().includes(e)}));return{deviceLabel:r,isVirtual:n}},Z1=function(e,t){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0&&!t)},J1=function(){var e,t;return{updateTime:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start";"start"===n?e=r:"end"===n&&(t=r)},getStart:function(){return e},getEnd:function(){return t}}},e5={closeButton:{top:"10px",right:"10px",left:"auto",bottom:"auto",display:"block",src:"",width:"20px",height:"auto"},popup:{backgroundColor:"#fff",padding:"5px",border:"1px solid #d7d7d7",borderRadius:"10px",overlay:{backgroundColor:"rgba(0, 0, 0, 0.5)"}}},t5=function(e,t,r){return y1(e,t,y1(r,t,""))},r5=function(e,t,r){var n=Jj.useAsset(r);return y1(e,t,n)},n5=q1(),o5={width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}},i5=function(e,t){var r=xw.useRef(null);xw.useEffect((function(){var n=e.current,o=function(){b1.isIOS&&"visible"===document.visibilityState&&setTimeout((function(){var e,o=null==n||null===(e=n.srcObject)||void 0===e?void 0:e.getVideoTracks();if(Array.isArray(o)&&o.length>0&&o.some((function(e){return e.muted}))){var i,a,s=null===(i=o[0])||void 0===i?void 0:i.getConstraints(),c=(null===(a=o[0])||void 0===a?void 0:a.getSettings()).deviceId;if(Object.keys(s).length>0)return void n5.getUserMedia({video:s,audio:!1}).then((function(e){r.current=e}));n5.getUserMedia({video:Oy({deviceId:c},null!=t?t:o5),audio:!1}).then((function(e){r.current=e,n.srcObject=e}))}}),1500)};return document.addEventListener("visibilitychange",o),function(){document.removeEventListener("visibilitychange",o)}}),[e,t]),xw.useEffect((function(){return function(){r.current&&(r.current.getTracks().forEach((function(e){return e.stop()})),r.current=null)}}),[])},a5=uL.Errors,s5=1e3,c5=dB.div(W1||(W1=Wy(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background: #000;\n display: flex;\n justify-content: center;\n z-index: ",";\n ","\n"])),s5,(function(e){return e.checkCameraMode&&"opacity: 0;"})),u5=dB.video(K1||(K1=Wy(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),l5=dB.div(Q1||(Q1=Wy(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),d5=dB(l5)(G1||(G1=Wy(["\n z-index: ",";\n position: fixed;\n cursor: pointer;\n ","\n"])),s5+1e3,(function(e){var t=e.theme;return YE(["top:",";right:",";left:",";bottom:",";display:",";width:",";height:",";"],t5(t,"closeButton.top",e5),t5(t,"closeButton.right",e5),t5(t,"closeButton.left",e5),t5(t,"closeButton.bottom",e5),t5(t,"closeButton.display",e5),t5(t,"closeButton.width",e5),t5(t,"closeButton.height",e5))})),f5=dB.div(X1||(X1=Wy(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),s5+20),p5=xw.createRef(),h5=q1();function m5(e){var t=e.checkCameraMode,r=e.frontCamera,n=e.onClose,o=e.children,i=e.onVideoPlayed,a=e.flipHorizontal,s=e.videoSettings,c=e.refVideo,u=e.onError,l=e.closeButton,d=e.videoClassName,f=e.scale,p=e.defaultCameraId,h=e.onWarning,m=xw.useRef(),g=yj.useSDKSettings().lang,v=mB(),y=Yj.useSDKTracking().sendEvent,b=r5(v,"closeButton.src","ic_close.png"),w=Ky(xw.useState(""),2),C=w[0],k=w[1],S=xw.useRef(!1),E=xw.useRef(!1),B=xw.useRef(!1),_=xw.useRef(),x=xw.useRef([]),T=xw.useRef(""),A=xw.useCallback((function(e){u&&u(e)}),[u]),I=xw.useCallback((function(){try{var e;clearInterval(m.current),(null==c||null===(e=c.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(c.current.srcObject.getTracks().forEach((function(e){return e.stop()})),c.current.srcObject=null)}catch(e){}clearTimeout(_)}),[c]);function P(){return R.apply(this,arguments)}function R(){return(R=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,H1();case 3:t=e.sent,x.current=t.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),lW.addExifData("device_info.camera_list",JSON.stringify(x.current.map((function(e){return e.label})))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))).apply(this,arguments)}m.current||(m.current=setInterval((function(){document.getElementById("tv-camera-".concat(m.current))||I()}),1e3)),xw.useEffect((function(){return function(){B.current=!0}}),[]);var D=xw.useCallback((function(){_.current||(_.current=setTimeout((function(){S.current||(k(a5.camera_timeout.msg[g]),A(a5.camera_timeout))}),2e4))}),[g,A]),O=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,o,i,a,c,u,l,d,f,p,m=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=m.length>1&&void 0!==m[1]&&m[1],o={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return h&&h("too_many_request_to_camera"),e.abrupt("return",new Promise((function(e){return e(null)})));case 5:return window.tv_last_req_camera_complete=!1,o=b1.isMobile?b1.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},i=J1(),a=i.updateTime,c=i.getStart,u=i.getEnd,e.prev=8,l=s||o,a(performance.now(),"start"),Z1(b1.isMobile,b1.isIOS)&&r&&(l={}),n&&(l={}),lW.addExifData("device_info.camera_label_dimension.req",JSON.stringify(l)),d={audio:!1,video:Oy(Oy({},t?{deviceId:t}:{facingMode:r?"user":"environment"}),l)},e.next=17,h5.getUserMedia(d);case 17:return f=e.sent,e.next=20,P();case 20:if(D(),f){e.next=25;break}return k(a5.not_supported.msg[g]),A(a5.not_supported),e.abrupt("return",null);case 25:a(performance.now(),"end"),window.tv_last_req_camera_complete=!0,u()-c()<1600?y({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):y({tag:"cam_permission",event:"user_activity.allow",log:{}});try{p=f.getVideoTracks()[0].getSettings(),lW.addExifData("device_info.camera_label_dimension.got","".concat(p.width,"x").concat(p.height))}catch(e){}return e.abrupt("return",f);case 32:e.prev=32,e.t0=e.catch(8),a(performance.now(),"end"),"NotAllowedError"===e.t0.name?(k(a5.no_permission.msg[g]),A(a5.no_permission),E.current=!0,y({tag:"cam_permission",event:"user_activity.cam",log:u()-c()<1600?{already_block:!0}:{click_block_on_popup:!0}})):E.current&&("NotReadableError"===e.t0.name?(A(a5.not_readable),k(a5.not_readable.msg[g])):(k(e.t0.message),A({code:e.t0.name||e.t0.code,message:e.t0.message})));case 36:return window.tv_last_req_camera_complete=!0,e.abrupt("return",null);case 38:case"end":return e.stop()}}),e,null,[[8,32]])})));return function(t){return e.apply(this,arguments)}}(),[r,s,g,A,h,D,y]),N=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a,s,u,l,d,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>0&&void 0!==h[0]?h[0]:p,o=h.length>1&&void 0!==h[1]&&h[1],!(null!=(a=c.current)&&null!==(t=a.srcObject)&&void 0!==t&&t.id&&null!=a&&null!==(r=a.srcObject)&&void 0!==r&&r.active&&S.current)){e.next=5;break}return e.abrupt("return");case 5:return a.oncanplaythrough=function(e){var t,r;a.play();var n=e.target.srcObject;lW.addExifData("device_info.camera_label",null==n||null===(t=n.getVideoTracks())||void 0===t||null===(r=t[0])||void 0===r?void 0:r.label),S.current=!0,k("");var o=window.innerWidth,s=window.innerHeight,c=xV.analyzeVideoAndWindowSizes(a),u=c.lostX,l=void 0===u?0:u,d=c.lostY,f=void 0===d?0:d,p=Math.min(o,Math.floor(o-2*l)),h=Math.min(s,Math.floor(s-2*f));i&&i({clientWidth:o,clientHeight:s,videoAreaWidth:p,videoAreaHeight:h,lostX:l,lostY:f})},e.next=8,O(n,o);case 8:s=e.sent,u=$1(s),l=u.deviceLabel,(d=u.isVirtual)&&(T.current+="".concat(l,", "),(f=x.current.filter((function(e){return!T.current.includes(e.label)})))[0]&&f[0].deviceId&&N(f[0].deviceId)),s||E.current||(lW.addExifData("device_info.camera_label_retry","yes"),E.current=!0,N(n,!0)),s&&B.current&&(c.current.srcObject=s,I()),!s||B.current||d||(a.srcObject=s);case 14:case"end":return e.stop()}}),e)}))),[c,O,i,p,I]);xw.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,N();case 2:return e.next=4,H1();case 4:t=e.sent,(r=t.filter((function(e){return"videoinput"===e.kind&&e.label.includes("back")&&e.label.includes("0")}))).length>0&&(n=r[0].deviceId,I(),N(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var t=c.current;return S.current?function(){}:(!h5||b1.browserName&&["facebook"].includes(b1.browserName.toLowerCase())||b1.getUA.includes("Zalo iOS")?(k(a5.not_supported.msg[g]),A(a5.not_supported)):t&&(b1.isAndroid&&!1===r?function(){e.apply(this,arguments)}():N()),function(){B.current&&I()})}),[c,g,r,N,I,A]);var L=xw.useCallback((function(){I(),n&&n(),y({tag:"result",event:"user_activity.cancel",log:{}})}),[n,I,y]);i5(c,s);return xw.createElement(c5,{id:"tv-camera-".concat(m.current),checkCameraMode:t},function(){if(!C)return null;var e=a5.no_permission.msg[g];return C===e&&b1.isIOS?xw.createElement(f5,null,C," ",xw.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[g])):xw.createElement(f5,null,C)}(),xw.createElement(u5,{ref:c,playsInline:!0,muted:!0,flipHorizontal:a,className:d,scale:f}),o,l?xw.cloneElement(l,{onClick:L,"data-testid":"close-camera"}):xw.createElement(d5,{onClick:L,"data-testid":"close-camera"},xw.createElement("img",{src:b,alt:""})))}m5.propTypes={checkCameraMode:xC.bool,frontCamera:xC.bool,onClose:xC.func,onError:xC.func,onVideoPlayed:xC.func,children:xC.node,flipHorizontal:xC.bool,videoSettings:xC.object,refVideo:xC.object,closeButton:xC.node,videoClassName:xC.string,scale:xC.number,defaultCameraId:xC.string,onWarning:xC.func},m5.defaultProps={checkCameraMode:!1,frontCamera:!0,onClose:null,onError:null,onVideoPlayed:null,children:null,flipHorizontal:!1,videoSettings:null,refVideo:null,closeButton:null,videoClassName:"",scale:1,defaultCameraId:void 0,onWarning:null};var g5,v5,y5,b5=z1(m5,250),w5=xw.forwardRef((function(e,t){return xw.createElement(m5,Ry({},e,{refVideo:t||p5}))})),C5=xw.forwardRef((function(e,t){return xw.createElement(b5,Ry({},e,{refVideo:t||p5}))})),k5=dB.table(g5||(g5=Wy(["\n width: 100%;\n height: 100%;\n td {\n text-align: center;\n vertical-align: middle;\n padding: 0;\n border: 0;\n }\n border-spacing: 0;\n table-layout: auto;\n border-collapse: collapse;\n"]))),S5=dB.div(v5||(v5=Wy(["\n position: relative;\n"]))),E5=Array.from(Array(3).keys()),B5=Array.from(Array(3).keys());function _5(e){var t=e.children,r=e.x,n=e.y,o=e.width,i=e.height,a=e.className,s=e.surroundStyle;return xw.createElement(k5,{className:a},xw.createElement("tbody",null,E5.map((function(e,a){return xw.createElement("tr",{key:e,style:{height:0===a?n:"auto"},"data-testid":"row"},B5.map((function(e,n){var c=1===a&&1===n,u="auto";return c?u=o:0===n&&(u=r),xw.createElement("td",{"data-testid":c?"centeredCell":"cell",key:e,style:Oy({width:u,height:c?i:"auto"},c?{}:s)},c?xw.createElement(S5,{style:{width:u,height:i}},t):null)})))}))))}_5.propTypes={children:xC.node,x:xC.string,y:xC.string,width:xC.string,height:xC.string,className:xC.string,surroundStyle:xC.object},_5.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var x5=dB(_5)(y5||(y5=Wy(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: ",";\n"])),s5+10);function T5(e){var t=e.className;return xw.createElement("svg",{className:t,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},xw.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),xw.createElement("desc",null,"Created with sketchtool."),xw.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},xw.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},xw.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},xw.createElement("g",{id:"Group-2"},xw.createElement("g",{id:"camera"},xw.createElement("path",{d:"M21,3 L17,3 L15,0 L9,0 L7,3 L3,3 C1.34314575,3 0,4.34314575 0,6 L0,18 C0,19.6568542 1.34314575,21 3,21 L21,21 C22.6568542,21 24,19.6568542 24,18 L24,6 C24,4.34314575 22.6568542,3 21,3 Z M12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.7614237,7 17,9.23857625 17,12 C17,14.7614237 14.7614237,17 12,17 L12,17 Z",id:"Shape"})))))))}T5.propTypes={className:xC.string},T5.defaultProps={className:""};var A5=function(){return j3.Date.now()},I5=A5,P5=/\s/;function R5(e){for(var t=e.length;t--&&P5.test(e.charAt(t)););return t}var D5=R5,O5=/^\s+/;function N5(e){return e?e.slice(0,D5(e)+1).replace(O5,""):e}var L5=N5,M5=NaN,F5=/^[-+]0x[0-9a-f]+$/i,U5=/^0b[01]+$/i,j5=/^0o[0-7]+$/i,V5=parseInt;function z5(e){if("number"==typeof e)return e;if(c0(e))return M5;if(h0(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h0(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=L5(e);var r=U5.test(e);return r||j5.test(e)?V5(e.slice(2),r?2:8):F5.test(e)?M5:+e}var q5=z5,H5="Expected a function",W5=Math.max,K5=Math.min;function Q5(e,t,r){var n,o,i,a,s,c,u=0,l=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(H5);function p(t){var r=n,i=o;return n=o=void 0,u=t,a=e.apply(i,r)}function h(e){return u=e,s=setTimeout(g,t),l?p(e):a}function m(e){var r=e-c;return void 0===c||r>=t||r<0||d&&e-u>=i}function g(){var e=I5();if(m(e))return v(e);s=setTimeout(g,function(e){var r=t-(e-c);return d?K5(r,i-(e-u)):r}(e))}function v(e){return s=void 0,f&&n?p(e):(n=o=void 0,a)}function y(){var e=I5(),r=m(e);if(n=arguments,o=this,c=e,r){if(void 0===s)return h(c);if(d)return clearTimeout(s),s=setTimeout(g,t),p(c)}return void 0===s&&(s=setTimeout(g,t)),a}return t=q5(t)||0,h0(r)&&(l=!!r.leading,i=(d="maxWait"in r)?W5(q5(r.maxWait)||0,t):i,f="trailing"in r?!!r.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=c=o=s=void 0},y.flush=function(){return void 0===s?a:v(I5())},y}var G5=Q5,X5="Expected a function";function Y5(e,t,r){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError(X5);return h0(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),G5(e,t,{leading:n,maxWait:t,trailing:o})}var $5=Y5,Z5=function(){try{var e=z0(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),J5=Z5;function e4(e,t,r){"__proto__"==t&&J5?J5(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var t4=e4,r4=Object.prototype,n4=r4.hasOwnProperty;function o4(e,t,r){var n=e[t];n4.call(e,t)&&f2(n,r)&&(void 0!==r||t in e)||t4(e,t,r)}var i4=o4;function a4(e,t,r,n){var o=!r;r||(r={});for(var i=-1,a=t.length;++i<a;){var s=t[i],c=n?n(r[s],e[s],s,r,e):void 0;void 0===c&&(c=e[s]),o?t4(r,s,c):i4(r,s,c)}return r}var s4=a4;function c4(e){return e}var u4=c4;function l4(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var d4=l4,f4=Math.max;function p4(e,t,r){return t=f4(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=f4(n.length-t,0),a=Array(i);++o<i;)a[o]=n[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=n[o];return s[t]=r(a),d4(e,this,s)}}var h4=p4;function m4(e){return function(){return e}}var g4=m4,v4=J5?function(e,t){return J5(e,"toString",{configurable:!0,enumerable:!1,value:g4(t),writable:!0})}:u4,y4=v4,b4=800,w4=16,C4=Date.now;function k4(e){var t=0,r=0;return function(){var n=C4(),o=w4-(n-r);if(r=n,o>0){if(++t>=b4)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var S4=k4,E4=S4(y4),B4=E4;function _4(e,t){return B4(h4(e,t,u4),e+"")}var x4=_4,T4=9007199254740991;function A4(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=T4}var I4=A4;function P4(e){return null!=e&&I4(e.length)&&!w0(e)}var R4=P4,D4=9007199254740991,O4=/^(?:0|[1-9]\d*)$/;function N4(e,t){var r=typeof e;return!!(t=null==t?D4:t)&&("number"==r||"symbol"!=r&&O4.test(e))&&e>-1&&e%1==0&&e<t}var L4=N4;function M4(e,t,r){if(!h0(r))return!1;var n=typeof t;return!!("number"==n?R4(r)&&L4(t,r.length):"string"==n&&t in r)&&f2(r[t],e)}var F4=M4;function U4(e){return x4((function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,a=o>2?r[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&F4(r[0],r[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var s=r[n];s&&e(t,s,n,i)}return t}))}var j4=U4;function V4(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var z4=V4,q4="[object Arguments]";function H4(e){return i0(e)&&n0(e)==q4}var W4=H4,K4=Object.prototype,Q4=K4.hasOwnProperty,G4=K4.propertyIsEnumerable,X4=W4(function(){return arguments}())?W4:function(e){return i0(e)&&Q4.call(e,"callee")&&!G4.call(e,"callee")},Y4=X4;function $4(){return!1}var Z4=$4,J4=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?j3.Buffer:void 0,i=(o?o.isBuffer:void 0)||Z4;e.exports=i})),e8="[object Arguments]",t8="[object Array]",r8="[object Boolean]",n8="[object Date]",o8="[object Error]",i8="[object Function]",a8="[object Map]",s8="[object Number]",c8="[object Object]",u8="[object RegExp]",l8="[object Set]",d8="[object String]",f8="[object WeakMap]",p8="[object ArrayBuffer]",h8="[object DataView]",m8="[object Float32Array]",g8="[object Float64Array]",v8="[object Int8Array]",y8="[object Int16Array]",b8="[object Int32Array]",w8="[object Uint8Array]",C8="[object Uint8ClampedArray]",k8="[object Uint16Array]",S8="[object Uint32Array]",E8={};function B8(e){return i0(e)&&I4(e.length)&&!!E8[n0(e)]}E8[m8]=E8[g8]=E8[v8]=E8[y8]=E8[b8]=E8[w8]=E8[C8]=E8[k8]=E8[S8]=!0,E8[e8]=E8[t8]=E8[p8]=E8[r8]=E8[h8]=E8[n8]=E8[o8]=E8[i8]=E8[a8]=E8[s8]=E8[c8]=E8[u8]=E8[l8]=E8[d8]=E8[f8]=!1;var _8=B8;function x8(e){return function(t){return e(t)}}var T8=x8,A8=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&M3.process,i=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i})),I8=A8&&A8.isTypedArray,P8=I8?T8(I8):_8,R8=P8,D8=Object.prototype,O8=D8.hasOwnProperty;function N8(e,t){var r=N3(e),n=!r&&Y4(e),o=!r&&!n&&J4(e),i=!r&&!n&&!o&&R8(e),a=r||n||o||i,s=a?z4(e.length,String):[],c=s.length;for(var u in e)!t&&!O8.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||L4(u,c))||s.push(u);return s}var L8=N8,M8=Object.prototype;function F8(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||M8)}var U8=F8;function j8(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}var V8=j8,z8=Object.prototype,q8=z8.hasOwnProperty;function H8(e){if(!h0(e))return V8(e);var t=U8(e),r=[];for(var n in e)("constructor"!=n||!t&&q8.call(e,n))&&r.push(n);return r}var W8=H8;function K8(e){return R4(e)?L8(e,!0):W8(e)}var Q8=K8,G8=j4((function(e,t,r,n){s4(t,Q8(t),e,n)})),X8=G8;function Y8(e,t){return function(r){return e(t(r))}}var $8=Y8,Z8=$8(Object.getPrototypeOf,Object),J8=Z8,e6="[object Object]",t6=Function.prototype,r6=Object.prototype,n6=t6.toString,o6=r6.hasOwnProperty,i6=n6.call(Object);function a6(e){if(!i0(e)||n0(e)!=e6)return!1;var t=J8(e);if(null===t)return!0;var r=o6.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&n6.call(r)==i6}var s6=a6,c6="[object DOMException]",u6="[object Error]";function l6(e){if(!i0(e))return!1;var t=n0(e);return t==u6||t==c6||"string"==typeof e.message&&"string"==typeof e.name&&!s6(e)}var d6=l6,f6=x4((function(e,t){try{return d4(e,void 0,t)}catch(e){return d6(e)?e:new Error(e)}})),p6=f6;function h6(e,t){return r1(t,(function(t){return e[t]}))}var m6=h6,g6=Object.prototype,v6=g6.hasOwnProperty;function y6(e,t,r,n){return void 0===e||f2(e,g6[r])&&!v6.call(n,r)?t:e}var b6=y6,w6={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function C6(e){return"\\"+w6[e]}var k6=C6,S6=$8(Object.keys,Object),E6=S6,B6=Object.prototype,_6=B6.hasOwnProperty;function x6(e){if(!U8(e))return E6(e);var t=[];for(var r in Object(e))_6.call(e,r)&&"constructor"!=r&&t.push(r);return t}var T6=x6;function A6(e){return R4(e)?L8(e):T6(e)}var I6=A6,P6=/<%=([\s\S]+?)%>/g,R6=P6;function D6(e){return function(t){return null==e?void 0:e[t]}}var O6=D6,N6={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},L6=O6(N6),M6=L6,F6=/[&<>"']/g,U6=RegExp(F6.source);function j6(e){return(e=u1(e))&&U6.test(e)?e.replace(F6,M6):e}var V6=j6,z6=/<%-([\s\S]+?)%>/g,q6=z6,H6=/<%([\s\S]+?)%>/g,W6=H6,K6={escape:q6,evaluate:W6,interpolate:R6,variable:"",imports:{_:{escape:V6}}},Q6=K6,G6="Invalid `variable` option passed into `_.template`",X6=/\b__p \+= '';/g,Y6=/\b(__p \+=) '' \+/g,$6=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z6=/[()=,{}\[\]\/\s]/,J6=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,e9=/($^)/,t9=/['\n\r\u2028\u2029\\]/g,r9=Object.prototype,n9=r9.hasOwnProperty;function o9(e,t,r){var n=Q6.imports._.templateSettings||Q6;r&&F4(e,t,r)&&(t=void 0),e=u1(e),t=X8({},t,n,b6);var o,i,a=X8({},t.imports,n.imports,b6),s=I6(a),c=m6(a,s),u=0,l=t.interpolate||e9,d="__p += '",f=RegExp((t.escape||e9).source+"|"+l.source+"|"+(l===R6?J6:e9).source+"|"+(t.evaluate||e9).source+"|$","g"),p=n9.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(t,r,n,a,s,c){return n||(n=a),d+=e.slice(u,c).replace(t9,k6),r&&(o=!0,d+="' +\n__e("+r+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),d+="';\n";var h=n9.call(t,"variable")&&t.variable;if(h){if(Z6.test(h))throw new Error(G6)}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(X6,""):d).replace(Y6,"$1").replace($6,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=p6((function(){return Function(s,p+"return "+d).apply(void 0,c)}));if(m.source=d,d6(m))throw m;return m}var i9=o9,a9=uL.Errors;function s9(e){var t=e.livenessSettings,r=e.apiClient,n=e.apiCheck,o=e.onError,i=e.mode,a=void 0===i?uL.LivenessDetection.Mode.ACTIVE:i,s=Ky(xw.useState({face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,take_one_picture_time_ms:3e3,limit_time_liveness_check:{enable:!1,limit_time_second:45},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5},exif_data_settings:{enable:!0},record_video:{enable:!1},auto_capture:{enable:!0,show_capture_button:!0,show_countdown:!0,wait_for_best_image_time_ms_web:3e3},manual_capture:{show_countdown:!0,wait_for_best_image_time_ms_web:3e3},blur_check:{enable:!0,web_blurry_threshold:.4},web_is_required_frontal_face:!0}),2),c=s[0],u=s[1];return xw.useEffect((function(){t&&Object.keys(t).length>0?u((function(e){return Oy(Oy({},e),t)})):n&&r.clientSettings().then((function(e){if(e&&e.data){var t=y1(e,"data.settings.sdk_settings.active_liveness_settings",{}),r=y1(e,"data.settings.sdk_settings.passive_liveness_settings",{}),n=y1(e,"data.settings.sdk_settings.liveness_settings",{}),i={};a===uL.Mode.ACTIVE&&(i=Oy(Oy({},r),t)),a===uL.Mode.PASSIVE&&(i=Oy(Oy({},t),r));var s,c=y1(t,"save_encoded_frames",{});c.enable&&(s={enable:!0,framesIntervalTime:c.frames_interval_ms,framesBatchLength:c.frames_batch_len});var l=y1(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});u(Oy(Oy(Oy({},i),n),{},{captureFrameSettings:s,exif_data_settings:l}))}e&&e.errors&&o(a9.server_error)})).catch((function(e){o(e)}))}),[t,r,o,n,a]),c}var c9={Selfie:{backgroundColor:"rgba(0, 0, 0, 0.6)",captureIcon:{src:"",width:"50px"},countdown:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px",padding:"5px 10px"},error:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px",padding:"5px 10px"},progressCircle:{radius:160,strokeWidth:3,progress:0,showErrorRing:!0,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:1,insideRingStrokeDash:"2",errorRingColor:"#df0000",errorRingWidth:1,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!1,showDashedRing:!1,showInsideRing:!0},Active:{instruction:{color:"#fff",fontSize:"20px",fontWeight:"normal",textShadow:"2px 2px 4px #000000",backgroundColor:"unset",border:"unset",borderRadius:"unset"},directionIcon:{frontal:"",left:"",right:"",up:"",width:"70px"},imageHolder:{width:"40px",height:"40px",borderRadius:"50%",border:"2px solid #fff",fontSize:"16px",color:"#fff",fontWeight:"700",frontal:"",left:"",right:"",up:""}}}},u9=function(e){var t=e.curStep,r=e.faceDirection,n=y1(t,"stepTimeConstraints.delayTime");return!!n&&(null===t.firstFrameSpottedAt?(t.name===r&&(t.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-t.firstFrameSpottedAt<n)},l9=function(e,t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,C,k,S,E;return{radius:null!==(r=e.radius)&&void 0!==r?r:t5(t,"Selfie.progressCircle.radius",c9),strokeWidth:null!==(n=e.strokeWidth)&&void 0!==n?n:t5(t,"Selfie.progressCircle.strokeWidth",c9),progress:null!==(o=e.progress)&&void 0!==o?o:t5(t,"Selfie.progressCircle.progress",c9),showErrorRing:null!==(i=e.showErrorRing)&&void 0!==i?i:t5(t,"Selfie.progressCircle.showErrorRing",c9),activeColor:null!==(a=e.activeColor)&&void 0!==a?a:t5(t,"Selfie.progressCircle.activeColor",c9),innerPadding:null!==(s=e.innerPadding)&&void 0!==s?s:t5(t,"Selfie.progressCircle.innerPadding",c9),outsideRingColor:null!==(c=e.outsideRingColor)&&void 0!==c?c:t5(t,"Selfie.progressCircle.outsideRingColor",c9),outsideRingOpacity:null!==(u=e.outsideRingOpacity)&&void 0!==u?u:t5(t,"Selfie.progressCircle.outsideRingOpacity",c9),insideRingColor:null!==(l=e.insideRingColor)&&void 0!==l?l:t5(t,"Selfie.progressCircle.insideRingColor",c9),insideRingWidth:null!==(d=e.insideRingWidth)&&void 0!==d?d:t5(t,"Selfie.progressCircle.insideRingWidth",c9),insideRingStrokeDash:null!==(f=e.insideRingStrokeDash)&&void 0!==f?f:t5(t,"Selfie.progressCircle.insideRingStrokeDash",c9),errorRingWidth:null!==(p=e.errorRingWidth)&&void 0!==p?p:t5(t,"Selfie.progressCircle.errorRingWidth",c9),errorRingColor:null!==(h=e.errorRingColor)&&void 0!==h?h:t5(t,"Selfie.progressCircle.errorRingColor",c9),dashedRingColor:null!==(m=e.dashedRingColor)&&void 0!==m?m:t5(t,"Selfie.progressCircle.dashedRingColor",c9),dashedRingOpacity:null!==(g=e.dashedRingOpacity)&&void 0!==g?g:t5(t,"Selfie.progressCircle.dashedRingOpacity",c9),dashedRingWidth:null!==(v=e.dashedRingWidth)&&void 0!==v?v:t5(t,"Selfie.progressCircle.dashedRingWidth",c9),dashedRingLineThick:null!==(y=e.dashedRingLineThick)&&void 0!==y?y:t5(t,"Selfie.progressCircle.dashedRingLineThick",c9),dashedRingLineSpacing:null!==(b=e.dashedRingLineSpacing)&&void 0!==b?b:t5(t,"Selfie.progressCircle.dashedRingLineSpacing",c9),dashedInsideRingColor:null!==(w=e.dashedInsideRingColor)&&void 0!==w?w:t5(t,"Selfie.progressCircle.dashedInsideRingColor",c9),dashedInsideRingWidth:null!==(C=e.dashedInsideRingWidth)&&void 0!==C?C:t5(t,"Selfie.progressCircle.dashedInsideRingWidth",c9),showOutsideRing:null!==(k=e.showOutsideRing)&&void 0!==k?k:t5(t,"Selfie.progressCircle.showOutsideRing",c9),showInsideRing:null!==(S=e.showInsideRing)&&void 0!==S?S:t5(t,"Selfie.progressCircle.showInsideRing",c9),showDashedRing:null!==(E=e.showDashedRing)&&void 0!==E?E:t5(t,"Selfie.progressCircle.showDashedRing",c9)}},d9=function(e){var t=e.incomingFrame,r=e.currentBestFrame;return null==t||!t.isEyeClosed||null!=r&&r.isEyeClosed?null!=t&&t.isEyeClosed||null==r||!r.isEyeClosed?(null==t?void 0:t.blurScore)>(null==r?void 0:r.blurScore)?t:r:t:r};function f9(e){return new Promise((function(t){var r=new Image;r.onload=t,r.onerror=t,r.src=e}))}var p9=1/0,h9=17976931348623157e292;function m9(e){return e?(e=q5(e))===p9||e===-p9?(e<0?-1:1)*h9:e==e?e:0:0===e?e:0}var g9=m9;function v9(e){var t=g9(e),r=t%1;return t==t?r?t-r:t:0}var y9=v9,b9="Expected a function";function w9(e,t){var r;if("function"!=typeof t)throw new TypeError(b9);return e=y9(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var C9=w9;function k9(e){return C9(2,e)}var S9=k9,E9=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.closeEyesModelUrl,n=void 0===r?dW:r,e.next=3,Vq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function B9(){return _9.apply(this,arguments)}function _9(){return(_9=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.blazefaceModelUrl,n=t.tfScriptUrls,o=t.closeEyesModelUrl,i=new fW(o),e.next=4,Vq.loadTensorFlow(n);case 4:return e.next=6,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return a=[Vq.loadBlazefaceModel({modelUrl:r}),i.load()],e.next=9,Promise.all(a);case 9:return s=e.sent,c=Ky(s,1),u=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:u,closeEyesModel:i});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var x9,T9=S9(B9),A9=[],I9=function(){A9=[]},P9=function(e,t,r){r&&I9(),A9.push({id:null});var n=A9.length-1;t.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?A9[n].id=e.data.file_id:A9[n].id=-1}))},R9=function(){return new Promise((function(e){var t=setInterval((function(){A9.every((function(e){return e.id}))&&(e(),clearInterval(t))}),200)}))},D9=function(e){return e.enable?A9.some((function(e){return-1===e.id}))?null:A9:[]},O9=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.steps,n=t.apiClient,o=t.FaceDirection,i=t.outputEncryptionSettings,a=t.video,s=[],r.forEach((function(e){var t=e.name,r=e.image,a=e.frontalFaceImage;if(t!==o.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:r.leftRightScore,gesture:t})};i&&i.key?s.push(n.httpClient.post("/v1/images",Oy({base64:r.encrypted.hex},c),{"X-TV-Key":i.key})):s.push(n.uploadImage(Oy({file:r.blob},c)))}else s.push(Promise.resolve({data:{image_id:null}}));if(a.blob){var u={label:"portrait",metadata:JSON.stringify({gesture_score:a.leftRightScore,gesture:o.FRONTAL})};i&&i.key?s.push(n.httpClient.post("/v1/images",Oy({base64:a.encrypted.hex},u),{"X-TV-Key":i.key})):s.push(n.uploadImage(Oy({file:a.blob},u)))}else s.push(Promise.resolve({data:{image_id:null}}))})),c=a?n.uploadFile({file:a,label:"video"}):Promise.resolve({data:{file_id:null}}),e.next=6,Promise.all([c].concat(s));case 6:return u=e.sent,l=Qy(u),d=l[0],f=l.slice(1),r.forEach((function(e,t){e.image.imageId=f[2*t].data.image_id,e.frontalFaceImage.imageId=f[2*t+1].data.image_id})),e.abrupt("return",d);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),N9=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.faceVerificationFlowData,o=t.onLivenessDetectionDone,i=t.captureFrameSettings,a=t.FaceDirection,s=t.onError,c=t.outputEncryptionSettings,u=t.video,e.prev=1,l=n.current.steps,e.next=5,O9({steps:l,apiClient:r,FaceDirection:a,outputEncryptionSettings:c,video:u});case 5:if(0!==(d=l.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=10;break}o({error:"wrong_face_movement"}),e.next=27;break;case 10:return e.next=12,R9();case 12:if(f=D9(i)){e.next=17;break}o({error:"network_error"}),e.next=27;break;case 17:return p=r.verifyFaceLiveness({images:d.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:l.filter((function(e){return e.image.imageId&&e.name!==a.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:f}),h=r.requestVerifyPortrait({image:{id:d[d.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([p,h]);case 21:m=e.sent,g=Ky(m,2),v=g[0],y=g[1],b=!0===v.data.is_live,o({apiCheckPassed:b,verifyFaceLivenessResult:v.data,verifyFacePortraitResult:y.data,frontalFaces:d.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:l.filter((function(e){return e.image.imageId&&e.name!==a.FRONTAL})).map((function(e){var t=e.name,r=e.image;return{name:t,blob:r.blob,id:r.imageId}}))});case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(1),s({error:e.t0});case 32:case"end":return e.stop()}}),e,null,[[1,29]])})));return function(t){return e.apply(this,arguments)}}(),L9=[],M9=null,F9=!1,U9=function(){return L9},j9=function(){F9=!0,L9=[];try{M9 instanceof MediaStream&&(M9.getTracks().forEach((function(e){return e.stop()})),M9=null)}catch(e){}};function V9(e,t,r){if(e.data.size>0){var n=new Blob([e.data],{type:"video/mp4"});L9.push(n),t()}else console.error("No video have recored!"),r()}function z9(e,t,r,n){if(e&&n){var o=n.cropX,i=n.cropY,a=n.cropWidth,s=n.cropHeight;e.drawImage(t,o,i,a,s,0,0,r,r),F9||requestAnimationFrame((function(){return z9(e,t,r,n)}))}}function q9(e){return H9.apply(this,arguments)}function H9(){return(H9=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.outputImagesSize,n=t.videoEl,o=t.resultAnalyzeVideoAndWindowSizes,j9(),(a=document.createElement("canvas")).width=r,a.height=r,s=a.getContext("2d"),e.prev=6,c={width:{min:360,ideal:400},height:{min:360,ideal:400}},u={mimeType:"video/webm"},e.prev=9,M9=null==n||null===(l=n.captureStream())||void 0===l?void 0:l.clone(),d=M9.getVideoTracks()[0],e.next=14,d.applyConstraints(c);case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(9);case 18:MediaRecorder.isTypeSupported("video/mp4")&&(F9=!1,z9(s,n,r,o),M9=a.captureStream(25),u={mimeType:"video/mp4",videoBitsPerSecond:25e5}),i=new MediaRecorder(M9,u),f=function(){return new Promise((function(e,t){i.ondataavailable=function(r){return V9(r,e,t)},"inactive"!==i.state&&i.stop()}))},p=function(){var e=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f();case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),h=function(){"inactive"!==i.state&&i.stop()},i.stopVideoRecording=p,i.discardRecording=h,e.next=29;break;case 27:e.prev=27,e.t1=e.catch(6);case 29:return e.abrupt("return",{mediaRecorder:i});case 30:case"end":return e.stop()}}),e,null,[[6,27],[9,16]])})))).apply(this,arguments)}var W9,K9,Q9,G9,X9,Y9,$9,Z9,J9=KV.faceTracker(),e7=new Kq,t7=uL.Mode,r7=uL.FaceDirection,n7=uL.Errors,o7=uL.Messages,i7=uL.TrackLivenessEvents,a7=-1,s7=3,c7=1,u7={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(x9={},Py(x9,uL.FaceDirection.UP,{delayTime:0}),Py(x9,uL.FaceDirection.LEFT,{delayTime:0}),Py(x9,uL.FaceDirection.RIGHT,{delayTime:0}),Py(x9,uL.FaceDirection.FRONTAL,{delayTime:2e3}),x9),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}};function l7(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,r=e.mode,n=e.bgCameraMask,o=e.bgCameraMaskRed,i=e.surroundStyle,a=e.cropAreaDimension,s=e.customInstructions,c=e.customIcon,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=void 0===l?u7.customStepTimeConstraints:l,f=e.onLivenessDetectionDone,p=e.onError,h=e.frontalMinSize,m=e.waitingTimeToGetBetterFrames,g=void 0===m?500:m,v=e.captureFrameSettings,y=void 0===v?u7.captureFrameSettings:v,b=e.livenessSettings,w=e.setRemainingTime,C=void 0===w?u7.setRemainingTime:w,k=e.onProcessing,S=void 0===k?u7.onProcessing:k,E=e.customErrors,B=e.customMessages,_=e.apiCredentials,x=void 0===_?{}:_,T=e.onFramesCaptured,A=void 0===T?u7.onFramesCaptured:T,I=e.initFirstGestureTimeout,P=void 0===I?2e3:I,R=e.outputEncryptionSettings,D=e.cameraScale,O=void 0===D?1:D,N=e.passiveModeAuto,L=void 0!==N&&N,M=e.sendCustomEvent,F=e.onReset,U=xw.useState(!1),j=Ky(U,2),V=j[0],z=j[1],q=xw.useState(!1),H=Ky(q,2),W=H[0],K=H[1],Q=xw.useState(!1),G=Ky(Q,2),X=G[0],Y=G[1],$=xw.useState(!1),Z=Ky($,2),J=Z[0],ee=Z[1],te=xw.useRef(null),re=yj.useSDKSettings(),ne=re.lang,oe=re.assetRoot,ie=re.customUrls,ae=re.exifKey,se=fq.useApiClient({apiCredentials:x}),ce=se.apiClient,ue=r===t7.ACTIVE,le=xw.useReducer((function(e){return e+1}),0),de=Ky(le,2),fe=(de[0],de[1]),pe=xw.useRef(null),he=xw.useRef(!1),me=xw.useState(!1),ge=Ky(me,2),ve=ge[0],ye=ge[1],be=xw.useRef({}),we=Yj.useSDKTracking(),Ce=we.sendEvent,ke=hW(),Se=ke.startMotion,Ee=ke.stopMotion,Be=ke.motionData,_e=ke.orientationData,xe=xw.useState(s7),Te=Ky(xe,2),Ae=Te[0],Ie=Te[1],Pe=xw.useState(!1),Re=Ky(Pe,2),De=Re[0],Oe=Re[1],Ne=xw.useRef(!1),Le=xw.useCallback((function(e){Oe(e),Ne.current=e}),[]),Me=xw.useRef(null),Fe=xw.useRef([]),Ue=xw.useRef(null),je=xw.useRef(),Ve=xw.useRef(null);null===Ve.current&&(Ve.current=KV.initFaceVerificationData({assetRoot:oe,customInstructions:s,customIcon:c,customDirectionIcon:u,customStepTimeConstraints:d}));var ze=xw.useState(),qe=Ky(ze,2),He=qe[0],We=qe[1],Ke=xw.useCallback((function(e){We(e)}),[]),Qe=xw.useMemo((function(){return $5(Ke,500)}),[Ke]),Ge=xw.useRef([]),Xe=xw.useRef(),Ye=s9({livenessSettings:b,apiClient:ce,apiCheck:t,onError:p,mode:r}),$e=Ye.face_tracking_setting,Ze=Ye.flow_interval_time_ms,Je=Ye.limit_time_liveness_check,et=Ye.terminate_if_no_face,tt=Ye.close_eye_detector,rt=void 0===tt?{}:tt,nt=Ye.captureFrameSettings,ot=void 0===nt?y:nt,it=Ye.exif_data_settings,at=Ye.record_video,st=Ye.take_one_picture_time_ms,ct=Ye.auto_capture,ut=Ye.blur_check,lt=Ye.web_is_required_frontal_face,dt=null==ct?void 0:ct.wait_for_best_image_time_ms_web,ft=ue?st:dt,pt=null==at?void 0:at.enable,ht=xw.useRef(""),mt=xw.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==i7?void 0:i7.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===ht.current)return;ht.current=r}Ce(e),M&&M(e)}}),[M,Ce]),gt=xw.useMemo((function(){return $5((function(e){mt(e)}),2e3)}),[mt]),vt=xw.useRef(0),yt=xw.useRef(),bt=xw.useRef();xw.useEffect((function(){mt({tag:"selfie",event:null==i7?void 0:i7.start_camera,log:{}})}),[mt]),xw.useEffect((function(){return e7.start(),lW.initExifData(),function(){e7.stop()}}),[]),xw.useEffect((function(){var e=!1;function t(){return(t=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ve){t.next=13;break}return Xe.current=performance.now(),t.next=4,T9(ie);case 4:return be.current=t.sent,t.next=7,Vq.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){t.next=9;break}return t.abrupt("return");case 9:ye(!0),mt({tag:"selfie",event:null==i7?void 0:i7.show_warmup,log:{}}),mt({tag:"selfie",event:null==i7?void 0:i7.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Xe.current}}),Xe.current=null;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[ve,ie,mt]);var wt=xw.useRef(!1),Ct=xw.useCallback((function(){var e;C(""),Ve.current.curStepIndex=Ve.current.steps.length,wt.current=!0,Y(!1),e7.stop(),null===(e=bt.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;Ve.current=KV.initFaceVerificationData({assetRoot:oe,customInstructions:s,customIcon:c,customDirectionIcon:u}),e7.start(),vt.current=0,yt.current=null,Ge.current=[],ee(!1),I9(),null===(e=bt.current)||void 0===e||e.start(),wt.current=!1,clearInterval(Me.current),Le(!1),Ie(s7),Ue.current=null,Fe.current=[],je.current=null,"function"==typeof F&&F(),fe()}),Ze)}),[C,Ze,oe,s,c,u,Le,F]),kt=xw.useMemo((function(){return Oy(Oy({},n7),E)}),[E]),St=xw.useMemo((function(){return Oy(Oy({},o7),B)}),[B]),Et=400;xw.useEffect((function(){if(W&&Je.enable&&J){var e=Je.limit_time_second+1,t=Je.remain_time_show||10,r=Je.format||"s";e7.start("limit",(function(n){var o=e-n;if(Ve.current.curStepIndex<Ve.current.steps.length){if(o<=t&&o>=1){var i=i9(St.REMAIN_TIME[ne]),a=o;switch(r){case"mm:ss":a=o.toString().padStart(5,"00:00");break;case"ss":a=o.toString().padStart(2,"0")}C(i({x:a}))}if(0===o){var s,c={};Object.keys(null===(s=kt.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=i9(null===(t=kt.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:Je.limit_time_second})})),We(Oy(Oy({},kt.liveness_terminated_time_out),{},{msg:c,duration:Ze})),mt({tag:"selfie",event:null==i7?void 0:i7.show_alert,log:{alert:"liveness_terminated_time_out,"}}),Ct()}}}))}}),[Ct,C,W,ne,Ze,Je.enable,Je.limit_time_second,J,kt.liveness_terminated_time_out,St.REMAIN_TIME,Je.format,Je.remain_time_show,mt]);var Bt=xw.useCallback((function(e){var t,r,o=e.clientWidth,s=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;b1.isMobile?r=t=c:t=r=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=n;pe.current={x:f,y:p,width:t,height:r,image:h,surroundStyle:i},"object"===By(a)?pe.current=Oy(Oy({},pe.current),a):"function"==typeof a&&(pe.current=Oy(Oy({},pe.current),a({clientWidth:o,clientHeight:s,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:b1.isMobile,width:t,height:r}))),fe(),K(!0)}),[n,i,a]),_t=xw.useCallback((function(){Ie(s7),clearInterval(Me.current),Le(!0);var e=function(){var e=xy(regeneratorRuntime.mark((function e(r){var n,o,i,a,s,c,u,l,d,h,m,g,v,y,b,w,C,k,E,B,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r-1!=0){e.next=52;break}return clearInterval(Me.current),S(),e.next=5,null===(n=bt.current)||void 0===n?void 0:n.stopVideoRecording();case 5:return z(!0),Ee(),lW.preWriteExif({mode:lW.MODE.SELFIE,motionData:Be,orientationData:_e,startTime:Date.now()-1e3*e7.duration("from_1st_frame"),endTime:Date.now(),exifKey:ae}),o=ct.enable?[Ue.current]:Fe.current,i=o.map((function(e){return Jz.resizeBlobImg(e.blob,Et,Et)})),e.next=12,Promise.all(i);case 12:return a=e.sent,s=a.map((function(e,t){return lW.writeExif({mode:lW.MODE.SELFIE,imageData:Oy(Oy({},o[t]),{},{blob:e,gesture:"frontal"}),enableExifData:it.enable})})),e.next=16,Promise.all(s);case 16:if(c=e.sent,u={},!R||!R.key){e.next=25;break}return l=R.key,d=c.map((function(e){return Wq.encrypt({blob:e,key:l})})),e.next=23,Promise.all(d);case 23:h=e.sent,u={frontalFacesEncrypted:h};case 25:if(t){e.next=30;break}f(Oy(Oy({frontalFaces:c},u),{},{capturedFrames:Ge.current,video:U9()})),j9(),e.next=52;break;case 30:return m=Gy(Ge.current),g=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:r7.FRONTAL})}},v=o.map((function(e,t){return ce.uploadImage(Oy({file:c[t]},g(e.leftRightScore)))})),R&&R.key&&(v=o.map((function(e,t){return ce.httpClient.post("/v1/images",Oy({base64:u.frontalFacesEncrypted[t].hex},g(e.leftRightScore)),{"X-TV-Key":R.key})}))),e.prev=34,e.next=37,Promise.all(v);case 37:return w=e.sent,C=ce.verifyFaceLiveness({images:w.map((function(e){return{id:e.data.image_id}})),videos:[{frames:m}]}),k=ce.requestVerifyPortrait({image:{id:null==w||null===(y=w[w.length-1])||void 0===y||null===(b=y.data)||void 0===b?void 0:b.image_id}}),e.next=42,Promise.all([C,k]);case 42:E=e.sent,B=Ky(E,2),_=B[0],x=B[1],f({apiCheckPassed:_.data.is_live,verifyFaceLivenessResult:_.data,verifyFacePortraitResult:x.data,frontalFaces:w.map((function(e,t){var r,n,i;return{id:null==e||null===(r=e.data)||void 0===r?void 0:r.image_id,blob:null===(n=o)||void 0===n||null===(i=n[t])||void 0===i?void 0:i.blob}}))}),e.next=52;break;case 49:e.prev=49,e.t0=e.catch(34),p({error:e.t0});case 52:case"end":return e.stop()}}),e,null,[[34,49]])})));return function(t){return e.apply(this,arguments)}}();Me.current=setInterval((function(){Ie((function(t){return e(t),t-1}))}),ft/s7)}),[null==ct?void 0:ct.enable,ft,Le,t,f,ce,p,S,R,Ee,Be,_e,it.enable,ae]),xt=xw.useRef({});xw.useEffect((function(){xt.current.isFirstValidFrameFoundRef=J}),[J]),xw.useEffect((function(){var e,i=te.current,a=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Ve.current.steps,r=[],t.map((function(e){return r.push({name:e.name,blob:e.image.blob,captureTime:e.image.captureTime,gesture:e.name}),e.frontalFaceImage.blob&&r.push({name:e.name,blob:e.frontalFaceImage.blob,captureTime:e.frontalFaceImage.captureTime,gesture:r7.FRONTAL}),0})),n=r.map((function(e){return Jz.resizeBlobImg(e.blob,Et,Et)})),e.next=6,Promise.all(n);case 6:return o=e.sent,i="0",y.framesBatchLength>0&&(a="".concat(Math.floor(Ge.current.length/y.framesBatchLength),"x").concat(y.framesBatchLength),s=Ge.current.length%y.framesBatchLength>0?"+".concat(Ge.current.length%y.framesBatchLength):"",i="".concat(Ge.current.length,":").concat(a).concat(s)),c=o.map((function(e,t){return lW.writeExif({mode:lW.MODE.SELFIE,imageData:Oy(Oy({},r[t]),{},{blob:e,frames:i}),enableExifData:it.enable})})),e.next=12,Promise.all(c);case 12:return u=e.sent,l=r.map((function(e,t){return{name:e.name,blob:u[t]}})),e.next=16,Promise.all(t.map(function(){var e=xy(regeneratorRuntime.mark((function e(r,n){var o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=l.filter((function(e){return e.name===r.name})),t[n].image.blob=o[0].blob,r.frontalFaceImage.blob&&(t[n].frontalFaceImage.blob=o[1].blob),!R||!R.key){e.next=12;break}return i=R.key,e.next=7,Wq.encrypt({blob:o[0].blob,key:i});case 7:if(t[n].image.encrypted=e.sent,!r.frontalFaceImage.blob){e.next=12;break}return e.next=11,Wq.encrypt({blob:o[1].blob,key:i});case 11:t[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=function(){var e=xy(regeneratorRuntime.mark((function e(){var r,n,o,i,s,c,u,l,d,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Ve.current.steps,o=n[Ve.current.curStepIndex],Py(r={},uL.FaceDirection.UP,null==i7?void 0:i7.capture_up_face),Py(r,uL.FaceDirection.LEFT,null==i7?void 0:i7.capture_left_face),Py(r,uL.FaceDirection.RIGHT,null==i7?void 0:i7.capture_right_face),Py(r,uL.FaceDirection.FRONTAL,null==i7?void 0:i7.capture_frontal_face),mt({tag:"selfie",event:r[o.name],log:{time_capture_in_seconds:((performance.now()-Xe.current)/1e3).toFixed(1)}}),Ve.current.curStepIndex++,Xe.current=performance.now(),$e.enable&&"each_gesture"===$e.limit_for&&(vt.current=0),Ve.current.curStepIndex!==n.length){e.next=44;break}if(Je.enable&&C(""),!f){e.next=44;break}return ot.enable&&ot.framesBatchLength>0&&Ge.current.length%ot.framesBatchLength>0&&(A(Ge.current.slice(Ge.current.length%ot.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&P9(Ge.current.slice(Ge.current.length%ot.framesBatchLength*-1),ce)),mt({tag:"selfie",event:null==i7?void 0:i7.finish_capture,log:{time_capture_in_seconds:e7.duration("from_1st_frame")}}),S(),e.next=15,null===(i=bt.current)||void 0===i?void 0:i.stopVideoRecording();case 15:return z(!0),Ee(),lW.preWriteExif({mode:lW.MODE.SELFIE,motionData:Be,orientationData:_e,startTime:Date.now()-1e3*e7.duration("from_1st_frame"),endTime:Date.now(),exifKey:ae}),e.next=20,a();case 20:if(t){e.next=41;break}if(d=n.filter((function(e){return e.name!==r7.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),m=n.filter((function(e){return e.name!==r7.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),g=n.filter((function(e){return e.name!==r7.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),v=null===(s=n.find((function(e){return e.name===r7.FRONTAL})))||void 0===s||null===(c=s.image)||void 0===c?void 0:c.blob,y=null===(u=n.find((function(e){return e.name===r7.FRONTAL})))||void 0===u||null===(l=u.image)||void 0===l?void 0:l.encrypted,!v||!h){e.next=32;break}return e.next=29,Jz.scaleImage(v,{minSize:h});case 29:e.t0=e.sent,e.next=33;break;case 32:e.t0=null;case 33:b=e.t0,v&&m.push(v),y&&g.push(y),mt({tag:"result",event:null==i7?void 0:i7.liveness_detection_done,log:{result_object:{steps:d,frontalFaces:m,frontalScaledImage:b}}}),f({steps:d,frontalFaces:m,frontalFacesEncrypted:g,frontalScaledImage:b,capturedFrames:Ge.current,video:U9().length?U9()[0]:null}),j9(),e.next=43;break;case 41:return e.next=43,N9({apiClient:ce,faceVerificationFlowData:Ve,onLivenessDetectionDone:f,captureFrameSettings:ot,FaceDirection:r7,onError:p,outputEncryptionSettings:R,video:U9().length?U9()[0]:null});case 43:z(!1);case 44:fe();case 45:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),c=G5((function(){var e=Ve.current,t=e.curStepIndex,r=e.steps,n=r[t],o=null!==(null==n?void 0:n.image.blob),i=null!==(null==n?void 0:n.frontalFaceImage.blob),a=r.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(i||![1].includes(t)||a>=1)?(he.current=!1,s(),c=!0):he.current=!(!o||i),Y(!1),c}),g);function u(e){return l.apply(this,arguments)}function l(){return(l=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.blurScore,i=t.leftRightScore,a=t.isEyeClose,u=Ve.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!u9({faceDirection:r,curStep:f})){e.next=6;break}return e.abrupt("return");case 6:if(!a){e.next=8;break}return e.abrupt("return");case 8:if(r!==r7.FRONTAL||null!==f.frontalFaceImage.blurScore&&!BV.hasBetterBlurScore(o,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=o,e.next=12,xV.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=i,f.frontalFaceImage.captureTime=Date.now(),he.current&&(he.current=!1,s());case 17:if(f.name!==r||null!==f.image.blurScore&&!BV.hasBetterBlurScore(o,f.image.blurScore)){e.next=29;break}return Y(!0),f.image.blurScore=o,e.next=22,xV.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=i,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(h),c();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e){return v.apply(this,arguments)}function v(){return(v=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.leftRightScore,i=t.blurScore,a=t.isEyeClosed,!0!==Ne.current||(!lt||r!==r7.FRONTAL)&&lt){e.next=6;break}return e.next=4,xV.takePicture({canvas:n});case 4:s=e.sent,null!=ct&&ct.enable&&Date.now()-je.current<(null==ct?void 0:ct.wait_for_best_image_time_ms_web)?(Ue.current||(Ue.current={blob:s,blurScore:i,isEyeClosed:a,captureTime:Date.now()}),null!=ut&&ut.enable&&(Ue.current=d9({incomingFrame:{blob:s,blurScore:i,isEyeClosed:a,captureTime:Date.now()},currentBestFrame:Ue.current}))):Fe.current.length<c7&&Fe.current.push({blob:s,leftRightScore:o,captureTime:Date.now(),blurScore:i});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e,r,n,o){if(Ge.current.length&&Date.now()-Ge.current[Ge.current.length-1].time<ot.framesIntervalTime)return null;if(ot.enable&&!o){var i=e.topLeft,a=e.bottomRight,s=[].concat(Gy(i),Gy(a)),c=J9(e,0===Ge.current.length),u=c.score,l=c.time,d=r.toDataURL("image/jpeg",.8);return Ge.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:Ge.current.length,bbox:s,original_bbox:s}),ot.framesBatchLength>0&&Ge.current.length%ot.framesBatchLength==0&&A&&(A(Ge.current.slice(-ot.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&P9(Ge.current.slice(-ot.framesBatchLength),ce,Ge.current.length===ot.framesBatchLength)),u}return null}function w(e){var t=e.trackingScore,r=e.isFirstValidFrameFoundRef;if(!$e.enable||null===t||!r)return!0;var n=$e.web_warning_threshold,o=$e.web_terminate_threshold,i=$e.max_warning_time;return t<n||(t<o&&vt.current<i?(vt.current++,vt.current===i?(We(Oy(Oy({},kt.liveness_terminated_face_tracking),{},{duration:Ze})),mt({tag:"selfie",event:null==i7?void 0:i7.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):We(Oy(Oy({},kt.liveness_too_fast),{},{duration:1500})),!0):(We(Oy(Oy({},kt.liveness_terminated),{},{duration:Ze})),mt({tag:"selfie",event:null==i7?void 0:i7.show_alert,log:{alert:"liveness_terminated"}}),Ct(),!1))}function k(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(et.enable&&r){var n=et.max_time_ms;yt.current&&t||(yt.current={time:Date.now(),frame:0}),t&&yt.current.frame++;var o=yt.current.time;t&&Date.now()-o>=n&&(We(Oy(Oy({},kt.liveness_terminated_no_face),{},{duration:Ze})),mt({tag:"selfie",event:null==i7?void 0:i7.show_alert,log:{alert:"liveness_terminated_no_face"}}),Ct())}}function E(e,t){return B.apply(this,arguments)}function B(){return(B=xy(regeneratorRuntime.mark((function t(a,s){var c,l,f,p,h,g,v,y,C,S,B,_,x,T,A,I,P,R,D,N,L,M,F,U,j,V,z,q,H,W,K,Q,G,X,Y,$,Z,J,te,re;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==s?void 0:s.width)&&0!==(null==s?void 0:s.height)){t.next=2;break}return t.abrupt("return");case 2:return p=xt.current.isFirstValidFrameFoundRef,h=a.cropX,g=a.cropY,v=a.cropWidth,y=a.cropHeight,s.getContext("2d").drawImage(i,h,g,v,y,-(Et*O-Et)/2/O,-(Et*O-Et)/2/O,Et,Et),C=be.current,S=C.blazefaceModel,B=C.closeEyesModel,t.next=9,Promise.all([BV.calculateBlurScore(s),GV.getModelPredictions({model:S,sCanvas:s})]);case 9:return _=t.sent,x=Ky(_,2),T=x[0],A=x[1],t.next=15,KV.validatePredictions({predictions:A,width:GV.SIZE,height:GV.SIZE});case 15:if(P=t.sent,R=P.error,D=P.fullFace,N=P.faceRatio,L=P.faceNotFrontalMinThreshold,I=R,pe.current.image=n,F=null,U=null,j=null,V=null,z=Ve.current,q=z.curStepIndex,H=z.steps,!D){t.next=44;break}return W=H[q],K=W&&W.name===r7.FRONTAL||r===uL.Mode.PASSIVE,j=D.landmarks,t.next=33,KV.calculateFaceDirection({landmarks:j,getPerfectFrontal:K});case 33:if((Q=t.sent)&&(F=Q.gesture,U=Q.leftRightScore),G=(null==rt?void 0:rt.web_timeout)+d[uL.FaceDirection.FRONTAL].delayTime/1e3,!(K&&null!=rt&&rt.enable&&(-1===e7.duration("limit_close_eye")||e7.duration("limit_close_eye")<G))){t.next=44;break}return-1===e7.duration("limit_close_eye")&&e7.start("limit_close_eye"),t.next=40,B.predict(s,j,null==rt?void 0:rt.web_threshold);case 40:X=t.sent,Y=X.isEyeClose,(V=Y)&&!I&&(I=n7.close_eye);case 44:if($="no_face"===(null===(c=I)||void 0===c?void 0:c.code)||"partial_face"===(null===(l=I)||void 0===l?void 0:l.code),Z=q<H.length,k({noFace:$&&Z,isFirstValidFrameFoundRef:p}),null!==(f=I)&&void 0!==f&&f.code&&gt({tag:"selfie",event:null==i7?void 0:i7.show_alert,log:{alert:I.code}}),I&&!("face_too_small"===I.code&&F!==r7.FRONTAL&&N>=L)){t.next=75;break}if(ue||b(A[0],s,j),!ue){t.next=58;break}if(p||(ee(!0),Xe.current=performance.now(),e7.start("from_1st_frame")),!w({trackingScore:b(A[0],s,j,q>=H.length),isFirstValidFrameFoundRef:p})){t.next=56;break}return t.next=56,u({faceDirection:F,canvas:s,blurScore:T,leftRightScore:U,isEyeClose:V});case 56:t.next=73;break;case 58:if(F===r7.FRONTAL||!lt){t.next=63;break}M=kt.not_frontal_face,pe.current.image=o,t.next=73;break;case 63:if(I){t.next=73;break}return p||(ee(!0),e7.start("from_1st_frame")),J=(null==ct?void 0:ct.enable)&&!Ne.current&&0===Fe.current.length,null!=ut&&ut.enable?null!==T&&T>(null==ut?void 0:ut.web_blurry_threshold)?(M=null,J&&(je.current=Date.now(),_t())):Ne.current||(M=kt.liveness_blurry):J&&(je.current=Date.now(),_t()),t.next=69,B.predict(s,j,null==rt?void 0:rt.web_threshold);case 69:return te=t.sent,re=te.isEyeClose,t.next=73,m(Oy({faceDirection:F,canvas:s,leftRightScore:U,blurScore:T},null!==re?{isEyeClosed:re}:{}));case 73:t.next=76;break;case 75:q<H.length&&(M=kt[I.code],pe.current.image=o);case 76:Qe(M),e!==a7&&(e=requestAnimationFrame((function(){return E(a,s)})));case 78:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _(){return(_=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=xV.analyzeVideoAndWindowSizes(i,pe.current),(r=document.createElement("canvas")).width=Et,r.height=Et,(n=r.getContext("2d")).translate(Et,0),n.scale(-1*O,1*O),!pt||!i){e.next=13;break}return e.next=10,q9({outputImagesSize:Et,videoEl:i,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:o=e.t0,a=o.mediaRecorder,bt.current=a,bt.current&&bt.current.start(),E(t,r);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return W&&ve&&setTimeout((function(){!function(){_.apply(this,arguments)}()}),P),function(){cancelAnimationFrame(e),e=a7}}),[lt,null==ut?void 0:ut.enable,null==ut?void 0:ut.web_blurry_threshold,r,null==ct?void 0:ct.enable,null==ct?void 0:ct.wait_for_best_image_time_ms_web,P,W,ne,ue,ce,t,n,o,f,p,h,g,ot,S,$e,Je.enable,C,Qe,d,Ze,Ct,et,kt,ve,mt,A,R,O,_t,L,null==rt?void 0:rt.enable,null==rt?void 0:rt.web_threshold,null==rt?void 0:rt.web_timeout,Be,_e,Ee,it.enable,ae,gt,y.framesBatchLength,pt]),xw.useEffect((function(){He&&((null==He?void 0:He.code)!==(null==kt?void 0:kt.liveness_terminated_time_out)&&(null==He?void 0:He.code)!==(null==kt?void 0:kt.liveness_terminated_no_face)&&null!=ct&&ct.enable&&Ne.current||(clearInterval(Me.current),Le(!1),Ue.current=null,Fe.current=[],je.current=null)),Se()}),[null==ct?void 0:ct.enable,He,Le,Se,kt]);var Tt=Ve.current,At=Tt.curStepIndex,It=Tt.steps,Pt=xw.useMemo((function(){return It.find((function(e){return e.name===uL.FaceDirection.FRONTAL}))}),[It]),Rt=he.current?Pt:It[At],Dt=Rt&&J?Rt.instructions[ne]:null,Ot=Rt&&J?Rt.directionIcon:"",Nt=Rt?Rt.directionIconAnimation:"",Lt=J&&!He&&!L&&(null==ct||!ct.enable||(null==ct?void 0:ct.show_capture_button)),Mt=De&&!wt.current&&((null==ct?void 0:ct.enable)&&(null==ct?void 0:ct.show_countdown)||!(null!=ct&&ct.enable));return{countdownToTakePicture:Ae,cropArea:pe,curStepIndex:At,directionIcon:Ot,directionIconAnimation:Nt,faceDetectionError:He,handleTriggerPassiveMode:_t,handleVideoPlayed:Bt,instructions:Dt,isActiveMode:ue,refVideo:te,refIsReseting:wt,showCountdown:De,steps:It,videoPlayed:W,activeCapturing:X,isFirstValidFrameFound:J,warmupDone:ve,motionData:Be,orientationData:_e,showLoading:V,showCaptureButton:Lt,shouldShowCountdown:Mt}}var d7=(Py(W9={},uL.FaceDirection.LEFT,90),Py(W9,uL.FaceDirection.RIGHT,270),Py(W9,uL.FaceDirection.UP,180),Py(W9,uL.FaceDirection.DOWN,0),W9),f7=hB(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),p7=dB.div(K9||(K9=Wy(["\n width: 200px;\n height: 200px;\n position: relative;\n transform: scale(0.48);\n\n .top,\n .right,\n .bottom,\n .left {\n position: absolute;\n }\n\n .top {\n top: 0;\n left: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .right {\n right: 0;\n top: 50%;\n transform: rotate(","deg) translateX(-50%);\n }\n\n .bottom {\n bottom: 0;\n left: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n\n .left {\n left: 0;\n top: 50%;\n transform: rotate(","deg) translateX(50%);\n }\n"])),d7[uL.FaceDirection.DOWN],d7[uL.FaceDirection.LEFT],d7[uL.FaceDirection.UP],d7[uL.FaceDirection.RIGHT]),h7=dB.div(Q9||(Q9=Wy(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var t,r=e.direction;return null!==(t=d7[r])&&void 0!==t?t:0})),m7=dB.span(G9||(G9=Wy(["\n display: flex;\n margin: 4px 0;\n width: 100%;\n height: 15px;\n animation: "," 1s infinite;\n animation-direction: alternate;\n\n &::before,\n &::after {\n content: '';\n height: 100%;\n width: 50%;\n background: rgba(255, 255, 255, 0.8);\n }\n\n &::before {\n transform: skewY(32deg);\n }\n\n &::after {\n width: 50%;\n transform: skewY(-32deg);\n }\n"])),f7),g7=dB(m7)(X9||(X9=Wy(["\n animation-delay: 0s;\n"]))),v7=dB(m7)(Y9||(Y9=Wy(["\n animation-delay: 0.5s;\n"]))),y7=dB(m7)($9||($9=Wy(["\n animation-delay: 1s;\n"]))),b7=dB.img(Z9||(Z9=Wy(["\n width: ",";\n"])),(function(e){var t=e.theme;return t5(t,"Selfie.Active.directionIcon.width",c9)}));function w7(e){var t=e.type,r=mB(),n=y1(r,"Selfie.Active.directionIcon.".concat(t));return null===n?xw.createElement(xw.Fragment,null):n&&null!==n?xw.createElement(b7,{src:y1(r,"Selfie.Active.directionIcon.".concat(t)),alt:""}):t!==uL.FaceDirection.FRONTAL?xw.createElement(h7,{direction:t},xw.createElement(g7,null),xw.createElement(v7,null),xw.createElement(y7,null)):xw.createElement(p7,null,xw.createElement(h7,{className:"top"},xw.createElement(g7,null),xw.createElement(v7,null),xw.createElement(y7,null)),xw.createElement(h7,{className:"right"},xw.createElement(g7,null),xw.createElement(v7,null),xw.createElement(y7,null)),xw.createElement(h7,{className:"bottom"},xw.createElement(g7,null),xw.createElement(v7,null),xw.createElement(y7,null)),xw.createElement(h7,{className:"left"},xw.createElement(g7,null),xw.createElement(v7,null),xw.createElement(y7,null)))}w7.propTypes={type:xC.oneOf([uL.FaceDirection.LEFT,uL.FaceDirection.RIGHT,uL.FaceDirection.UP,uL.FaceDirection.FRONTAL])},w7.defaultProps={type:uL.FaceDirection.LEFT};var C7,k7=uL.ErrorDuration;function S7(e){var t=e.children,r=e.errorMsg,n=e.className;return xw.isValidElement(t)?r?xw.createElement("div",{className:n},xw.cloneElement(t,{errorMsg:r})):null:r?xw.createElement("div",{className:n},r):null}function E7(e){var t=e.children,r=e.className,n=e.error,o=xw.useRef(0),i=xw.useRef(""),a=yj.useSDKSettings().lang,s=xw.useRef(k7.SHORT),c=n||{},u=c.msg,l=c.duration,d=void 0===l?k7.SHORT:l,f=null==u?void 0:u[a];return Date.now()-o.current>=s.current?(o.current=Date.now(),s.current=d,i.current=f,S7({children:t,errorMsg:f,className:r})):S7({children:t,errorMsg:i.current,className:r})}E7.propTypes={children:xC.node,className:xC.string},E7.defaultProps={className:""};var B7=dB.circle(C7||(C7=Wy(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function _7(e){var t=e.className,r=e.style,n=e.radius,o=e.strokeWidth,i=e.progress,a=e.showErrorRing,s=e.activeColor,c=e.innerPadding,u=e.outsideRingColor,l=e.outsideRingOpacity,d=e.insideRingColor,f=e.insideRingWidth,p=e.insideRingStrokeDash,h=e.errorRingWidth,m=e.errorRingColor,g=e.dashedRingColor,v=e.dashedRingOpacity,y=e.dashedRingWidth,b=e.dashedRingLineThick,w=e.dashedRingLineSpacing,C=e.dashedInsideRingColor,k=e.dashedInsideRingWidth,S=e.showOutsideRing,E=e.showInsideRing,B=e.showDashedRing,_=2*n,x=2*n,T=n-2*o,A=2*Math.PI*T,I=A-i/100*A,P=T-y/2-o/2-c,R=2*Math.PI*P,D=R-i/100*R,O=P-k/2-y/2,N=2*Math.PI*O,L=N-i/100*N,M=O-f/2-k/2,F=O-h/2-k/2;return xw.createElement("svg",{className:t,style:r,width:_,height:x,viewBox:"0 0 ".concat(_," ").concat(x),fill:"none",xmlns:"http://www.w3.org/2000/svg"},S?xw.createElement(xw.Fragment,null,xw.createElement("circle",{"data-testid":"outsideRing",opacity:l,cx:n,cy:n,r:T,stroke:u}),xw.createElement(B7,{"data-testid":"outsideAnimateRing",cx:n,cy:n,r:T,stroke:s,strokeWidth:o,strokeLinecap:"round",strokeDasharray:"".concat(A," ").concat(A),style:{strokeDashoffset:I}})):null,B?xw.createElement(xw.Fragment,null,xw.createElement("circle",{"data-testid":"dashedRing",opacity:v,cx:n,cy:n,r:P,stroke:g,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)}),xw.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},xw.createElement("circle",{cx:n,cy:n,r:P,stroke:s,strokeWidth:y,strokeDasharray:"".concat(b," ").concat(w)})),xw.createElement("g",{mask:"url(#mask0)"},xw.createElement(B7,{"data-testid":"dashedAnimateRing",cx:n,cy:n,r:P,stroke:s,strokeWidth:y,strokeDasharray:"".concat(R," ").concat(R),style:{strokeDashoffset:D}})),xw.createElement("circle",{"data-testid":"dashedInsideRing",opacity:v,cx:n,cy:n,r:O,stroke:C,strokeWidth:k}),xw.createElement(B7,{"data-testid":"dashedInsideAnimateRing",cx:n,cy:n,r:O,stroke:s,strokeWidth:k,strokeLinecap:"round",strokeDasharray:"".concat(N," ").concat(N),style:{strokeDashoffset:L}})):null,E?xw.createElement("circle",{"data-testid":"insideRing",strokeDasharray:p,cx:n,cy:n,r:M,stroke:d,strokeWidth:f}):null,a?xw.createElement("circle",{"data-testid":"errorRing",strokeDasharray:p,cx:n,cy:n,r:F,stroke:m,strokeWidth:h}):null)}function x7(e){var t=e.className;return xw.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xw.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}function T7(){return(T7=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}_7.propTypes={className:xC.string,style:xC.shape({}),radius:xC.number,strokeWidth:xC.number,progress:xC.number,showErrorRing:xC.bool,activeColor:xC.string,innerPadding:xC.number,outsideRingColor:xC.string,outsideRingOpacity:xC.number,insideRingColor:xC.string,insideRingWidth:xC.number,insideRingStrokeDash:xC.string,errorRingColor:xC.string,errorRingWidth:xC.number,dashedRingColor:xC.string,dashedRingOpacity:xC.number,dashedRingWidth:xC.number,dashedRingLineThick:xC.number,dashedRingLineSpacing:xC.number,dashedInsideRingColor:xC.string,dashedInsideRingWidth:xC.number,showOutsideRing:xC.bool,showDashedRing:xC.bool,showInsideRing:xC.bool},_7.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,showErrorRing:!1,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:3,insideRingStrokeDash:"0",errorRingColor:"#df0000",errorRingWidth:3,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!0,showDashedRing:!0,showInsideRing:!0},x7.propTypes={className:xC.string},x7.defaultProps={className:""};var A7,I7,P7=function(e,t){void 0===t&&(t=!0),xw.useEffect((function(){if(t){var r=function(t){"Escape"===t.key&&e(t)};return document.addEventListener("keyup",r),function(){t&&document.removeEventListener("keyup",r)}}}),[e,t])},R7=function(e,t){void 0===t&&(t=!0),xw.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])},D7=function(e,t,r){void 0===r&&(r=!0),xw.useEffect((function(){if(r){var n=function(r){var n=Array.isArray(e)?e:[e],o=!1;n.forEach((function(e){e.current&&!e.current.contains(r.target)||(o=!0)})),r.stopPropagation(),o||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),function(){r&&(document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n))}}}),[e,t,r])},O7=function(e,t){void 0===t&&(t=!0),xw.useEffect((function(){if(t){var r=function(t){if(9===t.keyCode){var r,n=null==e||null===(r=e.current)||void 0===r?void 0:r.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),o=Array.prototype.slice.call(n);if(1===o.length)return void t.preventDefault();var i=o[0],a=o[o.length-1];t.shiftKey&&document.activeElement===i?(t.preventDefault(),a.focus()):document.activeElement===a&&(t.preventDefault(),i.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])},N7="undefined"!=typeof window?xw.useLayoutEffect:xw.useEffect,L7={popupContent:{tooltip:{position:"absolute",zIndex:999},modal:{position:"relative",margin:"auto"}},popupArrow:{height:"8px",width:"16px",position:"absolute",background:"transparent",color:"#FFF",zIndex:-1},overlay:{tooltip:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",zIndex:999},modal:{position:"fixed",top:"0",bottom:"0",left:"0",right:"0",display:"flex",zIndex:999}}},M7=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],F7=function(e,t,r,n,o){var i=o.offsetX,a=o.offsetY,s=n?8:0,c=r.split(" "),u=e.top+e.height/2,l=e.left+e.width/2,d=t.height,f=t.width,p=u-d/2,h=l-f/2,m="",g="0%",v="0%";switch(c[0]){case"top":p-=d/2+e.height/2+s,m="rotate(180deg) translateX(50%)",g="100%",v="50%";break;case"bottom":p+=d/2+e.height/2+s,m="rotate(0deg) translateY(-100%) translateX(-50%)",v="50%";break;case"left":h-=f/2+e.width/2+s,m=" rotate(90deg) translateY(50%) translateX(-25%)",v="100%",g="50%";break;case"right":h+=f/2+e.width/2+s,m="rotate(-90deg) translateY(-150%) translateX(25%)",g="50%"}switch(c[1]){case"top":p=e.top,g=e.height/2+"px";break;case"bottom":p=e.top-d+e.height,g=d-e.height/2+"px";break;case"left":h=e.left,v=e.width/2+"px";break;case"right":h=e.left-f+e.width,v=f-e.width/2+"px"}return{top:p="top"===c[0]?p-a:p+a,left:h="left"===c[0]?h-i:h+i,transform:m,arrowLeft:v,arrowTop:g}},U7=function(e){var t={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var r=document.querySelector(e);null!==r&&(t=r.getBoundingClientRect())}return t},j7=function(e,t,r,n,o,i){var a=o.offsetX,s=o.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},u=0,l=U7(i),d=Array.isArray(r)?r:[r];for((i||Array.isArray(r))&&(d=[].concat(d,M7));u<d.length;){var f={top:(c=F7(e,t,d[u],n,{offsetX:a,offsetY:s})).top,left:c.left,width:t.width,height:t.height};if(!(f.top<=l.top||f.left<=l.left||f.top+f.height>=l.top+l.height||f.left+f.width>=l.left+l.width))break;u++}return c},V7=0,z7=function(){var e=document.getElementById("popup-root");return null===e&&((e=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(e)),e},q7=xw.forwardRef((function(e,t){var r=e.trigger,n=void 0===r?null:r,o=e.onOpen,i=void 0===o?function(){}:o,a=e.onClose,s=void 0===a?function(){}:a,c=e.defaultOpen,u=void 0!==c&&c,l=e.open,d=void 0===l?void 0:l,f=e.disabled,p=void 0!==f&&f,h=e.nested,m=void 0!==h&&h,g=e.closeOnDocumentClick,v=void 0===g||g,y=e.repositionOnResize,b=void 0===y||y,w=e.closeOnEscape,C=void 0===w||w,k=e.on,S=void 0===k?["click"]:k,E=e.contentStyle,B=void 0===E?{}:E,_=e.arrowStyle,x=void 0===_?{}:_,T=e.overlayStyle,A=void 0===T?{}:T,I=e.className,P=void 0===I?"":I,R=e.position,D=void 0===R?"bottom center":R,O=e.modal,N=void 0!==O&&O,L=e.lockScroll,M=void 0!==L&&L,F=e.arrow,U=void 0===F||F,j=e.offsetX,V=void 0===j?0:j,z=e.offsetY,q=void 0===z?0:z,H=e.mouseEnterDelay,W=void 0===H?100:H,K=e.mouseLeaveDelay,Q=void 0===K?100:K,G=e.keepTooltipInside,X=void 0!==G&&G,Y=e.children,$=xw.useState(d||u),Z=$[0],J=$[1],ee=xw.useRef(null),te=xw.useRef(null),re=xw.useRef(null),ne=xw.useRef(null),oe=xw.useRef("popup-"+ ++V7),ie=!!N||!n,ae=xw.useRef(0);N7((function(){return Z?(ne.current=document.activeElement,ge(),me(),pe()):he(),function(){clearTimeout(ae.current)}}),[Z]),xw.useEffect((function(){"boolean"==typeof d&&(d?se():ce())}),[d,p]);var se=function(e){Z||p||(J(!0),setTimeout((function(){return i(e)}),0))},ce=function(e){var t;Z&&!p&&(J(!1),ie&&(null===(t=ne.current)||void 0===t||t.focus()),setTimeout((function(){return s(e)}),0))},ue=function(e){null==e||e.stopPropagation(),Z?ce(e):se(e)},le=function(e){clearTimeout(ae.current),ae.current=setTimeout((function(){return se(e)}),W)},de=function(e){null==e||e.preventDefault(),ue()},fe=function(e){clearTimeout(ae.current),ae.current=setTimeout((function(){return ce(e)}),Q)},pe=function(){ie&&M&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},he=function(){ie&&M&&(document.getElementsByTagName("body")[0].style.overflow="auto")},me=function(){var e,t=null==te||null===(e=te.current)||void 0===e?void 0:e.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),r=Array.prototype.slice.call(t)[0];null==r||r.focus()};xw.useImperativeHandle(t,(function(){return{open:function(){se()},close:function(){ce()},toggle:function(){ue()}}}));var ge=function(){if(!ie&&Z&&(null==ee?void 0:ee.current)&&(null==ee?void 0:ee.current)&&(null==te?void 0:te.current)){var e,t,r=ee.current.getBoundingClientRect(),n=te.current.getBoundingClientRect(),o=j7(r,n,D,U,{offsetX:V,offsetY:q},X);if(te.current.style.top=o.top+window.scrollY+"px",te.current.style.left=o.left+window.scrollX+"px",U&&re.current)re.current.style.transform=o.transform,re.current.style.setProperty("-ms-transform",o.transform),re.current.style.setProperty("-webkit-transform",o.transform),re.current.style.top=(null===(e=x.top)||void 0===e?void 0:e.toString())||o.arrowTop,re.current.style.left=(null===(t=x.left)||void 0===t?void 0:t.toString())||o.arrowLeft}};P7(ce,C),O7(te,Z&&ie),R7(ge,b),D7(n?[te,ee]:[te],ce,v&&!m);var ve=function(){return xw.createElement("div",Object.assign({},(e=ie?L7.popupContent.modal:L7.popupContent.tooltip,t={className:"popup-content "+(""!==P?P.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:T7({},e,B,{pointerEvents:"auto"}),ref:te,onClick:function(e){e.stopPropagation()}},!N&&S.indexOf("hover")>=0&&(t.onMouseEnter=le,t.onMouseLeave=fe),t),{key:"C",role:ie?"dialog":"tooltip",id:oe.current}),U&&!ie&&xw.createElement("div",{ref:re,style:L7.popupArrow},xw.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==P?P.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:T7({position:"absolute"},x)},xw.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),Y&&"function"==typeof Y?Y(ce,Z):Y);var e,t},ye=!(S.indexOf("hover")>=0),be=ie?L7.overlay.modal:L7.overlay.tooltip,we=[ye&&xw.createElement("div",{key:"O","data-testid":"overlay","data-popup":ie?"modal":"tooltip",className:"popup-overlay "+(""!==P?P.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:T7({},be,A,{pointerEvents:v&&m||ie?"auto":"none"}),onClick:v&&m?ce:void 0,tabIndex:-1},ie&&ve()),!ie&&ve()];return xw.createElement(xw.Fragment,null,function(){for(var e={key:"T",ref:ee,"aria-describedby":oe.current},t=Array.isArray(S)?S:[S],r=0,o=t.length;r<o;r++)switch(t[r]){case"click":e.onClick=ue;break;case"right-click":e.onContextMenu=de;break;case"hover":e.onMouseEnter=le,e.onMouseLeave=fe;break;case"focus":e.onFocus=le,e.onBlur=fe}if("function"==typeof n){var i=n(Z);return!!n&&xw.cloneElement(i,e)}return!!n&&xw.cloneElement(n,e)}(),Z&&aL.createPortal(we,z7()))})),H7=pB(A7||(A7=Wy(["\n .popup-content {\n margin: auto;\n width: 100%;\n max-width: 568px;\n ",";\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n ",";\n }\n\n .popup-overlay {\n padding: 10px;\n ",";\n }\n\n [data-popup=tooltip].popup-overlay {\n background: transparent\n }\n\n .popup-arrow {\n -webkit-filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));\n color: #fff;\n stroke-width: 2px;\n stroke: #d7d7d7;\n stroke-dasharray: 30px;\n stroke-dashoffset: -54px;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0\n }\n"])),(function(e){var t=e.theme;return YE(["background-color:",";padding:",";border:",";border-radius:",";"],t5(t,"popup.backgroundColor",e5),t5(t,"popup.padding",e5),t5(t,"popup.border",e5),t5(t,"popup.borderRadius",e5))}),(function(e){var t=e.theme;return YE(["background-color:",";padding:",";border:",";border-radius:",";"],t5(t,"popup.backgroundColor",e5),t5(t,"popup.padding",e5),t5(t,"popup.border",e5),t5(t,"popup.borderRadius",e5))}),(function(e){var t=e.theme;return YE(["background:",";"],t5(t,"popup.overlay.backgroundColor",e5))})),W7=["open","children","overlayStyle"],K7=s5+1e3,Q7=function(e){var t=e.open,r=e.children,n=e.overlayStyle,o=Vy(e,W7);return xw.createElement(xw.Fragment,null,t&&xw.createElement(xw.Fragment,null,xw.createElement(q7,Ry({overlayStyle:Oy(Oy({},n),{},{zIndex:K7}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:t},o),r),xw.createElement(H7,null)))};Q7.propTypes={open:xC.bool,children:xC.node,overlayStyle:xC.shape({})},Q7.defaultProps={open:!1,children:null,overlayStyle:{}};var G7={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},X7=dB.div(I7||(I7=Wy(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),Y7=function(e){var t=e.contentStyle,r=yj.useSDKSettings(),n=r.lang,o=r.warmupMessage,i=o?o[n]:G7.WARMUP_INTRO[n];return xw.createElement(Q7,{open:!0,contentStyle:t},xw.createElement(X7,{className:"warmup-message"},i))};Y7.propTypes={contentStyle:xC.shape({})},Y7.defaultProps={contentStyle:{}};var $7=500,Z7=hB(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),J7=hB(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),eee=YE([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],Z7,$7,J7,$7),tee=Object.freeze({__proto__:null,animationDuration:$7,default:eee}),ree=20,nee=hB(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],ree,ree),oee=hB(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],ree,ree),iee=YE([".slide-horizontal{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}.slide-vertical{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],nee,oee),aee=Object.freeze({__proto__:null,default:iee}),see=hB(["from,to{opacity:1;}50%{opacity:0;}"]),cee=YE([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],see),uee=Object.freeze({__proto__:null,default:cee});function lee(){return(lee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function dee(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}function fee(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function pee(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}function hee(e,t){e.classList?e.classList.add(t):pee(e,t)||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function mee(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function gee(e,t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=mee(e.className,t):e.setAttribute("class",mee(e.className&&e.className.baseVal||"",t))}var vee={disabled:!1},yee=xw.createContext(null),bee="unmounted",wee="exited",Cee="entering",kee="entered",See="exiting",Eee=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var o,i=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?i?(o=wee,n.appearStatus=Cee):o=kee:o=t.unmountOnExit||t.mountOnEnter?bee:wee,n.state={status:o},n.nextCallback=null,n}fee(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===bee?{status:wee}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==Cee&&r!==kee&&(t=Cee):r!==Cee&&r!==kee||(t=See)}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},r.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===Cee?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===wee&&this.setState({status:bee})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,o=this.props.nodeRef?[n]:[aL.findDOMNode(this),n],i=o[0],a=o[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!r||vee.disabled?this.safeSetState({status:kee},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,a),this.safeSetState({status:Cee},(function(){t.props.onEntering(i,a),t.onTransitionEnd(c,(function(){t.safeSetState({status:kee},(function(){t.props.onEntered(i,a)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:aL.findDOMNode(this);t&&!vee.disabled?(this.props.onExit(n),this.safeSetState({status:See},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:wee},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:wee},(function(){e.props.onExited(n)}))},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:aL.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],i=o[0],a=o[1];this.props.addEndListener(i,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===bee)return null;var t=this.props,r=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,dee(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return xw.createElement(yee.Provider,{value:null},"function"==typeof r?r(e,n):xw.cloneElement(xw.Children.only(r),n))},t}(xw.Component);function Bee(){}Eee.contextType=yee,Eee.propTypes={},Eee.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Bee,onEntering:Bee,onEntered:Bee,onExit:Bee,onExiting:Bee,onExited:Bee},Eee.UNMOUNTED=bee,Eee.EXITED=wee,Eee.ENTERING=Cee,Eee.ENTERED=kee,Eee.EXITING=See;var _ee,xee,Tee=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return hee(e,t)}))},Aee=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return gee(e,t)}))},Iee=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),o=n[0],i=n[1];t.removeClasses(o,"exit"),t.addClass(o,i?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),o=n[0],i=n[1]?"appear":"enter";t.addClass(o,i,"active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),o=n[0],i=n[1]?"appear":"enter";t.removeClasses(o,i),t.addClass(o,i,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,o=n?""+(n&&r?r+"-":"")+e:r[e];return{baseClassName:o,activeClassName:n?o+"-active":r[e+"Active"],doneClassName:n?o+"-done":r[e+"Done"]}},t}fee(t,e);var r=t.prototype;return r.addClass=function(e,t,r){var n=this.getClassNames(t)[r+"ClassName"],o=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&o&&(n+=" "+o),"active"===r&&e&&e.scrollTop,n&&(this.appliedClasses[t][r]=n,Tee(e,n))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,o=r.active,i=r.done;this.appliedClasses[t]={},n&&Aee(e,n),o&&Aee(e,o),i&&Aee(e,i)},r.render=function(){var e=this.props,t=(e.classNames,dee(e,["classNames"]));return xw.createElement(Eee,lee({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(xw.Component);function Pee(e,t){return e!==t&&(!xw.isValidElement(e)||!xw.isValidElement(t)||null==e.key||e.key!==t.key)}Iee.defaultProps={classNames:""},Iee.propTypes={};var Ree,Dee,Oee={out:"out-in",in:"in-out"},Nee=function(e,t,r){return function(){var n;e.props[t]&&(n=e.props)[t].apply(n,arguments),r()}},Lee=((_ee={})[Oee.out]=function(e){var t=e.current,r=e.changeState;return xw.cloneElement(t,{in:!1,onExited:Nee(t,"onExited",(function(){r(Cee,null)}))})},_ee[Oee.in]=function(e){var t=e.current,r=e.changeState,n=e.children;return[t,xw.cloneElement(n,{in:!0,onEntered:Nee(n,"onEntered",(function(){r(Cee)}))})]},_ee),Mee=((xee={})[Oee.out]=function(e){var t=e.children,r=e.changeState;return xw.cloneElement(t,{in:!0,onEntered:Nee(t,"onEntered",(function(){r(kee,xw.cloneElement(t,{in:!0}))}))})},xee[Oee.in]=function(e){var t=e.current,r=e.children,n=e.changeState;return[xw.cloneElement(t,{in:!1,onExited:Nee(t,"onExited",(function(){n(kee,xw.cloneElement(r,{in:!0}))}))}),xw.cloneElement(r,{in:!0})]},xee),Fee=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this).state={status:kee,current:null},t.appeared=!1,t.changeState=function(e,r){void 0===r&&(r=t.state.current),t.setState({status:e,current:r})},t}fee(t,e);var r=t.prototype;return r.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){return null==e.children?{current:null}:t.status===Cee&&e.mode===Oee.in?{status:Cee}:t.current&&Pee(t.current,e.children)?{status:See}:{current:xw.cloneElement(e.children,{in:!0})}},r.render=function(){var e,t=this.props,r=t.children,n=t.mode,o=this.state,i=o.status,a=o.current,s={children:r,current:a,changeState:this.changeState,status:i};switch(i){case Cee:e=Mee[n](s);break;case See:e=Lee[n](s);break;case kee:e=a}return xw.createElement(yee.Provider,{value:{isMounting:!this.appeared}},e)},t}(xw.Component);Fee.propTypes={},Fee.defaultProps={mode:Oee.out};var Uee,jee,Vee,zee,qee,Hee,Wee,Kee,Qee,Gee,Xee,Yee,$ee,Zee,Jee,ete,tte,rte,nte,ote,ite,ate,ste,cte,ute,lte,dte,fte,pte,hte,mte,gte,vte=300,yte=dB.div(Ree||(Ree=Wy(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ","; // must be higher than BASE_Z_INDEX and lower than other layers\n"])),s5+1),bte=hB(["from{background:#000;}to{}"]),wte=YE([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],bte,vte),Cte=dB.div(Dee||(Dee=Wy(["\n ","\n"])),wte),kte=function(e){var t=e.keyForTransition,r=void 0===t?0:t;return xw.createElement(Cte,null,xw.createElement(Fee,null,xw.createElement(Iee,{key:r,timeout:{enter:vte,exit:0},classNames:"splash",unmountOnExit:!1},xw.createElement(yte,null))))},Ste=Object.freeze({__proto__:null,default:kte}),Ete=hB(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),Bte=YE([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],Ete),_te=Object.freeze({__proto__:null,default:Bte}),xte=uee,Tte=aee,Ate=function(e){var t=e.className,r=e.onClick,n=Jj.useAsset("ic_close.png");return xw.createElement(d5,{className:t,onClick:r},xw.createElement("img",{src:n,alt:""}))},Ite=YE(["z-index:",";color:#ffffff;"],s5+20),Pte=dB.div(Uee||(Uee=Wy(["\n ","\n"])),Ite),Rte=YE([""," "," "," "," font-size:",";font-weight:",";background:",";color:",";padding:",";border-radius:",";position:absolute;white-space:pre-wrap;text-align:center;max-width:80%;"],Ite,(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),(function(e){return e.centerY&&YE(["top:50%;transform:translateY(-50%);"])}),(function(e){var t=e.theme;return t5(t,"Selfie.error.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.padding",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.borderRadius",c9)})),Dte=dB(E7)(jee||(jee=Wy(["\n ","\n"])),Rte),Ote=dB.div(Vee||(Vee=Wy(["\n ","\n"])),Rte),Nte=dB(Pte)(zee||(zee=Wy(["\n ","\n font-size: ",";\n font-weight: ",";\n background: ",";\n color: ",";\n padding: ",";\n border-radius: ",";\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.padding",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.borderRadius",c9)})),Lte=dB(Pte)(qee||(qee=Wy(["\n position: absolute;\n ","\n ","\n color: ",";\n font-size: ",";\n font-weight: ",";\n text-shadow: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.textShadow",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.border",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.borderRadius",c9)})),Mte=dB.div(Hee||(Hee=Wy(["\n height: ",";\n position: absolute;\n ","\n ","\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),(function(){return b1.isMobile?"50px":"70px"}),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),s5+20),Fte=dB.div(Wee||(Wee=Wy(["\n width: ",";\n height: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n border: ",";\n font-size: ",";\n color: ",";\n font-weight: ",";\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: ",";\n }\n"])),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.width",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.height",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.borderRadius",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.border",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.fontWeight",c9)}),(function(e){return!e.active&&YE(["opacity:0.6;"])}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.borderRadius",c9)})),Ute=dB.div(Kee||(Kee=Wy(["\n color: #ffffff;\n height: 70px;\n position: absolute;\n bottom: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),s5+20),jte=dB.div(Qee||(Qee=Wy(["\n ","\n text-align: center;\n\n img {\n width: ",";\n }\n"])),(function(e){return YE(e.disabled?["pointer-events:none;"]:["cursor:pointer;"])}),(function(e){var t=e.theme;return t5(t,"Selfie.captureIcon.width",c9)})),Vte=dB.div(Gee||(Gee=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #ffffff;\n font-size: 140px;\n opacity: 0.6;\n"]))),zte=dB.div(Xee||(Xee=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n ",";\n ",";\n"])),Tte.default,xte.default),qte=dB(_7)(Yee||(Yee=Wy(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),Hte=dB(x7)($ee||($ee=Wy(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.theme;return t5(t,"Selfie.backgroundColor",c9)})),Wte=dB.div(Zee||(Zee=Wy(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),Kte=hB(["from{opacity:1;}to{opacity:0;}"]),Qte=dB.div(Jee||(Jee=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n border-radius: 50%;\n"])),Kte),Gte=Object.freeze({__proto__:null,CloseCameraButton:Ate,Text:Pte,FaceDetectionError:Dte,SimpleFaceDetectionError:Ote,CountdownTime:Nte,FaceVerificationInstructions:Lte,FaceVerificationStepsWrapper:Mte,StepItem:Fte,BottomButtonsOverlay:Ute,Button:jte,CountDownOverlay:Vte,InstructionsOverlay:zte,OverlayProgressCircle:qte,StyledCameraMark:Hte,ErrorOverlay:Wte,CapturingOverlay:Qte}),Xte=uee,Yte=aee,$te=YE(["z-index:",";color:#ffffff;"],s5+20),Zte=dB.div(ete||(ete=Wy(["\n ","\n"])),$te),Jte=YE([""," "," "," "," font-size:",";font-weight:",";background:",";color:",";padding:",";border-radius:",";position:absolute;white-space:pre-wrap;text-align:center;max-width:80%;"],$te,(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),(function(e){return e.centerY&&YE(["top:50%;transform:translateY(-50%);"])}),(function(e){var t=e.theme;return t5(t,"Selfie.error.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.padding",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.error.borderRadius",c9)})),ere=dB(E7)(tte||(tte=Wy(["\n ","\n"])),Jte),tre=dB.div(rte||(rte=Wy(["\n ","\n"])),Jte),rre=dB(Zte)(nte||(nte=Wy(["\n ","\n font-size: ",";\n font-weight: ",";\n background: ",";\n color: ",";\n padding: ",";\n border-radius: ",";\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.padding",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.countdown.borderRadius",c9)})),nre=dB(Zte)(ote||(ote=Wy(["\n position: absolute;\n ","\n ","\n color: ",";\n font-size: ",";\n font-weight: ",";\n text-shadow: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.fontWeight",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.textShadow",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.backgroundColor",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.border",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.instruction.borderRadius",c9)})),ore=dB.div(ite||(ite=Wy(["\n height: ",";\n position: absolute;\n ","\n ","\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),(function(){return b1.isMobile?"50px":"70px"}),(function(e){var t=e.top;return t&&YE(["top:","px;"],t)}),(function(e){var t=e.bottom;return t&&YE(["bottom:","px;"],t)}),s5+20),ire=dB.div(ate||(ate=Wy(["\n width: ",";\n height: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n border: ",";\n font-size: ",";\n color: ",";\n font-weight: ",";\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: ",";\n }\n"])),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.width",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.height",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.borderRadius",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.border",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.fontSize",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.color",c9)}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.fontWeight",c9)}),(function(e){return!e.active&&YE(["opacity:0.6;"])}),(function(e){var t=e.theme;return t5(t,"Selfie.Active.imageHolder.borderRadius",c9)})),are=dB.div(ste||(ste=Wy(["\n color: #ffffff;\n height: 70px;\n position: absolute;\n bottom: 0;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: ",";\n"])),s5+20),sre=dB.div(cte||(cte=Wy(["\n ","\n text-align: center;\n\n img {\n width: ",";\n }\n"])),(function(e){return YE(e.disabled?["pointer-events:none;"]:["cursor:pointer;"])}),(function(e){var t=e.theme;return t5(t,"Selfie.captureIcon.width",c9)})),cre=dB.div(ute||(ute=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #ffffff;\n font-size: 140px;\n opacity: 0.6;\n"]))),ure=dB.div(lte||(lte=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n ",";\n ",";\n"])),Yte.default,Xte.default),lre=dB(_7)(dte||(dte=Wy(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),dre=dB(x7)(fte||(fte=Wy(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.theme;return t5(t,"Selfie.backgroundColor",c9)})),fre=dB.div(pte||(pte=Wy(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),pre=hB(["from{opacity:1;}to{opacity:0;}"]),hre=dB.div(hte||(hte=Wy(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n border-radius: 50%;\n"])),pre),mre=function(e){var t=e.stepNumber,r=e.type,n=e.theme,o=y1(n,"Selfie.Active.imageHolder.".concat(r));return null===o?xw.createElement(xw.Fragment,null):o&&null!==o?xw.createElement("img",{src:o,alt:""}):xw.createElement("span",null,t)},gre=b1.isMobile?{width:{ideal:640}}:null;function vre(e){return new Promise((function(t){var r=new Image;r.onload=t,r.onerror=t,r.src=e}))}function yre(e,t){return e?"string"==typeof e?xw.createElement("img",{className:t,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}function bre(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,i=e.onError,a=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=e.onProcessing,f=e.customErrors,p=e.livenessSettings,h=e.apiCredentials,m=e.outputEncryptionSettings,g=e.cameraScale,v=e.defaultCameraId,y=e.passiveModeAuto,b=e.offsetFaceY,w=e.styledComponent,C=e.onReset,k=Jj.useAsset("bg_camera_mask.png"),S=Jj.useAsset("bg_camera_mask_red.png"),E=Ky(xw.useState({}),2),B=E[0],_=E[1],x=B.yFaceDetectionError,T=B.yFaceVerificationStepsWrapper,A=Ky(xw.useState(""),2),I=A[0],P=A[1],R=mB(),D=xw.useMemo((function(){return{backgroundColor:t5(R,"Selfie.backgroundColor",c9)}}),[R]),O=xw.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,o=t+25,a=o+30;_({yFaceDetectionError:o,yFaceVerificationStepsWrapper:a+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(a);return 0!==b&&(u+b<s||u+b+r>c)?i({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=b,{y:u}}),[b,i]),N=l7({apiCheck:t,mode:r,bgCameraMask:k,bgCameraMaskRed:S,surroundStyle:D,onLivenessDetectionDone:n,onError:i,cropAreaDimension:O,customDirectionIcon:u,captureFrameSettings:a,onFramesCaptured:s,livenessSettings:p,setRemainingTime:P,customStepTimeConstraints:l,onProcessing:d,customErrors:f,apiCredentials:h,outputEncryptionSettings:m,cameraScale:g,passiveModeAuto:y,onReset:C}),L=N.countdownToTakePicture,M=N.cropArea,F=N.curStepIndex,U=N.directionIcon,j=N.directionIconAnimation,V=N.faceDetectionError,z=N.handleTriggerPassiveMode,q=N.handleVideoPlayed,H=N.instructions,W=N.isActiveMode,K=N.refVideo,Q=N.showCountdown,G=N.steps,X=N.videoPlayed,Y=N.activeCapturing,$=N.warmupDone,Z=N.showCaptureButton,J=N.shouldShowCountdown;xw.useEffect((function(){var e;"string"==typeof(null===(e=G[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(G.map((function(e){return vre(e.directionIcon)})))}),[G]);var ee=w.CloseCameraButton,te=l9(e,R),re=yj.useSDKSettings().lang,ne=xw.useRef(0),oe=xw.useRef({}),ie=xw.useRef(uL.ErrorDuration.SHORT),ae=xw.useMemo((function(){var e=V||{},t=e.msg,r=e.duration,n=void 0===r?uL.ErrorDuration.SHORT:r,o=null==t?void 0:t[re];return Date.now()-ne.current>=ie.current&&(ne.current=Date.now(),ie.current=n,oe.current=o),oe.current}),[V,F]);return xw.createElement(C5,{frontCamera:c,onVideoPlayed:q,onClose:o,flipHorizontal:c,ref:K,videoSettings:gre,onError:i,scale:g,defaultCameraId:v,closeButton:ee||null},!$&&xw.createElement(Y7,null),X?xw.createElement(xw.Fragment,null,"string"==typeof ae?xw.createElement(tre,{top:x-15,className:"face-detection-error"},ae):null,M.current?xw.createElement(x5,{x:"".concat(M.current.x,"px"),y:"".concat(M.current.y,"px"),width:"".concat(M.current.width,"px"),height:"".concat(M.current.height,"px"),surroundStyle:M.current.surroundStyle},xw.createElement(dre,null),xw.createElement(lre,Ry({progress:F/G.length*100},te,{showErrorRing:!!V&&t5(R,"Selfie.progressCircle.showErrorRing",c9)})),J?xw.createElement(cre,null,L):null,W?xw.createElement(xw.Fragment,null,xw.createElement(ure,null,yre(U,j)),Y&&xw.createElement(hre,null)):null,V&&xw.createElement(fre,null)):null,I&&xw.createElement(rre,{top:T-30},I),W?xw.createElement(xw.Fragment,null,H?xw.createElement(xw.Fragment,null,xw.createElement(nre,{top:T+5,className:"instructions"},H),xw.createElement(ore,{top:T+35},G.map((function(e,t){var r=e.name,n=e.image.objUrl;return xw.createElement(ire,{key:r,active:F>=t,className:"step-item"},n?xw.createElement("img",{src:n,alt:""}):xw.createElement(mre,{stepNumber:t+1,type:r,theme:R}))})))):null):xw.createElement(xw.Fragment,null,Z?xw.createElement(are,null,xw.createElement(sre,{onClick:z,disabled:Q},y1(R,"Selfie.captureIcon.src")?xw.createElement("img",{src:y1(R,"Selfie.captureIcon.src"),alt:""}):xw.createElement(T5,null))):null)):null)}bre.propTypes={apiCheck:xC.bool,mode:xC.string,onLivenessDetectionDone:xC.func,onClose:xC.func,onError:xC.func,captureFrameSettings:xC.shape({}),onFramesCaptured:xC.func,frontCamera:xC.bool,customDirectionIcon:xC.shape({}),customStepTimeConstraints:xC.shape({}),onProcessing:xC.func,customErrors:xC.shape({}),livenessSettings:xC.shape({}),apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),outputEncryptionSettings:xC.shape({}),cameraScale:xC.number,defaultCameraId:xC.string,passiveModeAuto:xC.bool,offsetFaceY:xC.number,styledComponent:xC.shape({CloseCameraButton:xC.node}),onReset:xC.func},bre.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(mte={},Py(mte,uL.FaceDirection.LEFT,xw.createElement(w7,{type:uL.FaceDirection.LEFT})),Py(mte,uL.FaceDirection.RIGHT,xw.createElement(w7,{type:uL.FaceDirection.RIGHT})),Py(mte,uL.FaceDirection.UP,xw.createElement(w7,{type:uL.FaceDirection.UP})),Py(mte,uL.FaceDirection.FRONTAL,xw.createElement(w7,{type:uL.FaceDirection.FRONTAL})),mte),customStepTimeConstraints:(gte={},Py(gte,uL.FaceDirection.UP,{delayTime:0}),Py(gte,uL.FaceDirection.LEFT,{delayTime:0}),Py(gte,uL.FaceDirection.RIGHT,{delayTime:0}),Py(gte,uL.FaceDirection.FRONTAL,{delayTime:2e3}),gte),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null},onReset:function(){}};var wre,Cre,kre,Sre,Ere,Bre=Object.freeze({__proto__:null,Text:Zte,FaceDetectionError:ere,CountdownTime:rre,FaceVerificationInstructions:nre,FaceVerificationStepsWrapper:ore,StepItem:ire,BottomButtonsOverlay:are,Button:sre,CountDownOverlay:cre,InstructionsOverlay:ure,LivenessStyledComponent:Gte,default:bre,useLivenessDetection:l7}),_re={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},xre=50,Tre={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},Are={IDCapturing:{backgroundColor:"rgba(0, 0, 0, 0.6)",title:{color:"#fff",fontSize:"20px",fontWeight:"normal",backgroundColor:"unset"},instruction:{color:"#fff",fontSize:"16px",fontWeight:"normal",backgroundColor:"unset",border:"unset",borderRadius:"unset"},error:{padding:"5px 10px",color:"#fff",fontSize:"16px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px"},countdown:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px"},cardIcon:{src:"",width:"auto",height:"38px"},captureIcon:{src:"",width:"60px",height:"60px"},loadingIcon:{src:"",width:"100px",height:"100px"},timeoutPopup:{padding:"10px",text:{color:"#000",fontSize:"1rem",fontWeight:"normal",textAlign:"center",border:"unset",borderRadius:"unset"},button:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:Tre.tsBlue,border:"none",borderRadius:"0.25rem",outline:"none",height:"50px"}},rectangleMask:{width:600,height:400,strokeWidth:2,strokeStyles:{},radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"},default:{fill:"none",stroke:"#fff",strokeWidth:2,strokeDasharray:"7, 4",opacity:.6},error:{fill:"rgba(234,50,35, 0.1)",strokeWidth:2,stroke:"#ea3223"}}},IDConfirmPopup:{confirmButton:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:Tre.tsBlue,border:"0",borderRadius:"0.25rem",outline:"none"},retryButton:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:Tre.tsBlue,border:"none",borderRadius:"0.25rem",outline:"none"},image:{borderRadius:"5px"}},QRStep:{guidelinePopup:{image:{src:"",borderRadius:"5px",backgroundColor:"#e7e6e6"},guideText:{color:Tre.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",lineHeight:"20px"},countdownText:{color:Tre.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",lineHeight:"20px"},startButton:{color:"#fff",fontSize:"1rem",fontWeight:"normal",backgroundColor:Tre.tsBlue,border:"none",borderRadius:"3px",outline:"none",height:"66px"}},scanTooltip:{backgroundColor:"#00ce78",borderRadius:"8px",color:"#fff",padding:"10px",textAlign:"center"},scanCountdown:{textAlign:"center",color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"none",borderRadius:"3px",padding:"5px 10px"},invalidPopup:{padding:"10px",title:{color:Tre.tsSecondary,fontSize:"16px",fontWeight:"bold",margin:"25px 0 0 0",padding:"0 0 0 0"},description:{color:Tre.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",margin:"30px 0 0 0",padding:"0 0 0 0"},retryButton:{color:"#fff",fontSize:"1rem",fontWeight:"normal",backgroundColor:Tre.tsBlue,border:"none",borderRadius:"3px",outline:"none",height:"66px",margin:"30px 0 0 0"},skipButton:{color:Tre.tsBlue,fontSize:"1rem",fontWeight:"normal",backgroundColor:"unset",border:"none",borderRadius:"unset",outline:"none",height:"unset",margin:"20px 0"}},resultText:{success:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#34ce60"},error:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#ff9532"}}}},Ire={SUCCESS:"SUCCESS",WARNING:"WARNING"},Pre=(Py(wre={},Ire.SUCCESS,"✓"),Py(wre,Ire.WARNING,"!"),wre),Rre=dB.div(Cre||(Cre=Wy(["\n font-weight: normal;\n"]))),Dre=dB.div(kre||(kre=Wy(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){var t=e.theme,r=e.type,n=t5(t,"QRStep.resultText.".concat(r===Ire.SUCCESS?"success":"error",".mainColor"),Are);return YE(["linear-gradient(to right,","00,","ff,","00)"],n,n,n)})),Ore=dB.div(Sre||(Sre=Wy(["\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n margin-right: 8px;\n font-weight: bold;\n"])),(function(e){var t=e.type,r=e.theme;return YE(["",""],t5(r,"QRStep.resultText.".concat(t===Ire.SUCCESS?"success":"error",".mainColor"),Are))})),Nre=dB.div(Ere||(Ere=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n ",";\n"])),(function(e){var t=e.type,r=e.theme,n=t===Ire.SUCCESS?"success":"error";return YE(["color:",";font-size:",";font-weight:",";"],t5(r,"QRStep.resultText.".concat(n,".textColor"),Are),t5(r,"QRStep.resultText.".concat(n,".fontSize"),Are),t5(r,"QRStep.resultText.".concat(n,".fontWeight"),Are))})),Lre=function(e){var t=e.children,r=e.type,n=e.className;return xw.createElement(Rre,{className:n},xw.createElement(Dre,{type:r}),xw.createElement(Nre,{type:r},xw.createElement(Ore,{type:r},Pre[r]),t),xw.createElement(Dre,{type:r}))};Lre.propTypes={children:xC.node,type:xC.string,className:xC.string},Lre.defaultProps={children:null,type:Ire.SUCCESS,className:""};var Mre,Fre,Ure=["children","ratio","padding"],jre=dB.div(Mre||(Mre=Wy(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),Vre=dB.div(Fre||(Fre=Wy(["\n position: absolute;\n top: ",";\n left: ",";\n right: ",";\n bottom: ",";\n"])),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding}),(function(e){return e.padding})),zre=function(e){var t=e.children,r=e.ratio,n=e.padding,o=Vy(e,Ure);return xw.createElement(jre,Ry({ratio:r},o),xw.createElement(Vre,{padding:n},t))};zre.propTypes={children:xC.node,ratio:xC.number,padding:xC.string},zre.defaultProps={children:null,ratio:4/3,padding:"0"};var qre,Hre,Wre,Kre,Qre,Gre,Xre,Yre=function(e){var t=e.children,r=e.mt,n=e.mb,o=e.ml,i=e.mr,a=e.mx,s=e.my,c=e.pt,u=e.pb,l=e.pl,d=e.pr,f=e.px,p=e.py,h=t.props.style||{},m={};return null!==a&&(m.marginLeft=a,m.marginRight=a),null!==s&&(m.marginTop=s,m.marginBottom=s),null!==r&&(m.marginTop=r),null!==n&&(m.marginBottom=n),null!==o&&(m.marginLeft=o),null!==i&&(m.marginRight=i),null!==f&&(m.paddingLeft=f,m.paddingRight=f),null!==p&&(m.paddingTop=p,m.paddingBottom=p),null!==c&&(m.paddingTop=c),null!==u&&(m.paddingBottom=u),null!==l&&(m.paddingLeft=l),null!==d&&(m.paddingRight=d),xw.cloneElement(t,{style:Oy(Oy({},h),m)})};Yre.propTypes={mt:xC.string,ml:xC.string,mr:xC.string,mb:xC.string,mx:xC.string,my:xC.string,pt:xC.string,pl:xC.string,pr:xC.string,pb:xC.string,px:xC.string,py:xC.string},Yre.defaultProps={mt:null,ml:null,mr:null,mb:null,mx:null,my:null,pt:null,pl:null,pr:null,pb:null,px:null,py:null};var $re=dB.div(qre||(qre=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Zre=dB.div(Hre||(Hre=Wy(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),Jre=dB.button(Wre||(Wre=Wy(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n cursor: pointer;\n"]))),ene=dB(Jre)(Kre||(Kre=Wy(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.border",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.confirmButton.outline",Are)})),tne=dB(Jre)(Qre||(Qre=Wy(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.border",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.retryButton.outline",Are)})),rne=dB.img(Gre||(Gre=Wy(["\n width: 100%;\n height: auto;\n object-fit: contain;\n border-radius: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDConfirmPopup.image.borderRadius",Are)})),nne=dB.div(Xre||(Xre=Wy(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),one=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,i=e.hasValidQR,a=e.frontSide,s=Ky(xw.useState(null),2),c=s[0],u=s[1],l=yj.useSDKSettings().lang,d=Yj.useSDKTracking().sendEvent;return xw.useEffect((function(){d({tag:a?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[a,d]),xw.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),u(e)),function(){URL.revokeObjectURL(e)}}),[t]),xw.createElement($re,null,null!==i&&xw.createElement(Yre,{mb:"20px"},xw.createElement("div",null,xw.createElement(Lre,{type:i?Ire.SUCCESS:Ire.WARNING},i?_re.CONFIRM_POPUP_VALID_QR[l]:_re.CONFIRM_POPUP_INVALID_QR[l]))),xw.createElement(zre,{ratio:1.5},xw.createElement(rne,{src:c})),o&&xw.createElement(Zre,{className:"confirm-popup-error-message"},o.msg[l]),xw.createElement(nne,null,xw.createElement(tne,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.retry",log:{}}),n()}},_re.BTN_TRY_AGAIN[l]),xw.createElement(ene,{onClick:function(){d({tag:a?"id_front":"id_back",event:"user_activity.submit",log:{}}),r()}},_re.BTN_USE_THIS_PICTURE[l])))};one.propTypes={imageTaken:xC.shape({}),error:xC.shape({msg:xC.shape({})}),onConfirm:xC.func,onTryAgain:xC.func,hasValidQR:xC.bool,frontSide:xC.bool},one.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var ine,ane=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.frontCamera,r=void 0===t||t,n=document.createElement("div");document.body.appendChild(n);var o=function(){aL.unmountComponentAtNode(n)};return new Promise((function(e){aL.render(xw.createElement(yj.SDKSettingsProvider,{value:{lang:"en"}},xw.createElement(C5,{checkCameraMode:!0,frontCamera:r,onVideoPlayed:function(){o(),e(null)},onClose:o,onError:function(t){o(),e(t)}})),n)}))},sne=dB.input(ine||(ine=Wy(["\n display: none;\n"]))),cne=xw.forwardRef((function(e,t){var r=e.useFileBrowse,n=e.accept,o=e.frontCamera,i=e.onCaptureDone,a=e.outputEncryptionSettings,s=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.target.files,!i){e.next=8;break}if(n=r[0],!a||!a.key){e.next=7;break}return e.next=6,Wq.encrypt({blob:n,key:a.key});case 6:o=e.sent;case 7:i({file:n,encrypted:o});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[i,a]);return xw.createElement(sne,Ry({ref:t,type:"file",accept:n,onChange:s},r?{}:{capture:o?"user":"environment"}))}));cne.propTypes={useFileBrowse:xC.bool,accept:xC.string,frontCamera:xC.bool,onCaptureDone:xC.func,outputEncryptionSettings:xC.shape({key:xC.string})},cne.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var une,lne={LANDSCAPE:"landscape",PORTRAIT:"portrait",DESKTOP:"desktop"},dne=function(){var e=xw.useRef(window.matchMedia("(orientation: portrait)")),t=xw.useRef(e.current.matches?lne.PORTRAIT:lne.LANDSCAPE),r=Ky(xw.useState(t.current),2),n=r[0],o=r[1];return xw.useEffect((function(){function t(e){e.matches?o(lne.PORTRAIT):o(lne.LANDSCAPE)}return e.current.addEventListener("change",t),function(){e.current.removeEventListener("change",t)}}),[]),b1.isMobile?{curOrientation:n,initOrientation:t.current}:{curOrientation:lne.DESKTOP}},fne=uL.Errors,pne=dB.div(une||(une=Wy(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function hne(e){var t=e.children,r=yj.useSDKSettings().lang,n=fne.wrong_orientation.msg[r],o=dne().curOrientation;return xw.createElement(xw.Fragment,null,o===lne.LANDSCAPE&&xw.createElement(Q7,{open:!0},xw.createElement(pne,null,n)),(o===lne.PORTRAIT||o===lne.DESKTOP)&&xw.createElement(xw.Fragment,null,t))}var mne={LOADING:0,FAR_FACE:1,CLOSE_FACE:2,START_FLASHING:3,STOP_DECTECTING:4},gne={FAR_FACE:"far",CLOSE_FACE:"close",FLASHING:"flashing"},vne=200,yne=b1.isMobile?200:400,bne=0,wne=1,Cne={timeout:"timeout",no_face:"no_face"};function kne(){return Sne.apply(this,arguments)}function Sne(){return(Sne=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},r=t.tfScriptUrls,n=t.closeEyesModelUrl,o=t.blazefaceModelUrl,i=new fW(n),e.next=4,Vq.loadTensorFlow(r);case 4:return e.next=6,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return a=[Vq.loadBlazefaceModel({modelUrl:o}),i.load()],e.next=9,Promise.all(a);case 9:return s=e.sent,c=Ky(s,1),u=c[0].blazefaceModel,e.abrupt("return",{closeEyesModel:i,blazefaceModel:u});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ene=S9(kne),Bne=function(e,t){var r=Ky(xw.useState({}),2),n=r[0],o=r[1],i=Object.keys(n).length>0;return xw.useEffect((function(){var r=!1;return function(){var n=xy(regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Ene(e);case 3:if(i=n.sent,!r){n.next=6;break}return n.abrupt("return");case 6:o(i),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(0),t({error:n.t0}),console.error(n.t0);case 13:case"end":return n.stop()}}),n,null,[[0,9]])})));return function(){return n.apply(this,arguments)}}()(),function(){r=!0}}),[i,e,t]),[n,i]},_ne=function(e){var t=e.width,r=e.height,n=e.cameraScale,o=document.createElement("canvas");o.width=t,o.height=r;var i=o.getContext("2d");return i.translate(t,0),i.scale(-1*n,1*n),o},xne=function(e){var t=e.width,r=e.height,n=e.cameraScale,o=void 0===n?1:n,i=e.debug,a=void 0!==i&&i,s=Ky(xw.useState(null),2),c=s[0],u=s[1];return xw.useEffect((function(){var e=_ne({width:t,height:r,cameraScale:o});return a&&(document.body.appendChild(e),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.zIndex="9999"),u(e),function(){a&&document.body.removeChild(e)}}),[o,a,r,t]),c},Tne=function(e){var t=e.videoRef,r=e.cropArea;return xw.useMemo((function(){return t.current?0===Object.keys(r).length?{}:xV.analyzeVideoAndWindowSizes(t.current,r):{}}),[t,r])},Ane=function(e){switch(e){case"partial_face":return"please_move_face_into_center_frame";case"no_face":case"face_out_of_box":return"face_not_found";case"face_too_small":return"please_move_face_closer";case"face_too_large":return"please_move_face_farther";case"eye_close":return"please_open_your_eyes";case"face_not_frontal":return"please_look_straight_at_the_camera";case"multiple_faces":return"please_only_one_face";case"face_too_high":return"please_move_face_down";case"blurry_face":return"please_hold_still";default:return""}},Ine=function(e){var t=e.width,r=e.height,n=e.debug,o=xw.useRef(null),i=xw.useMemo((function(){var e=document.createElement("canvas");return e.width=t,e.height=r,e.style.position="fixed",e.style.bottom="0",e.style.left="0",e.style.zIndex="99999",o.current=e,n&&document.body.appendChild(e),e}),[r,t,n]);return xw.useEffect((function(){return function(){n&&document.body.removeChild(o.current)}}),[n]),i},Pne=function(e,t){var r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.beginPath(),r.lineWidth="1",r.strokeStyle="red",r.rect(0,0,e.width,e.height),r.stroke(),r.closePath(),Object.entries(t).forEach((function(e,t){var n=Ky(e,2),o=n[0],i=n[1];r.beginPath(),r.fillStyle="red",r.font="16px",r.fillText("".concat(o,": ").concat(i),10,20+20*t),r.closePath()}))},Rne=xw.createContext(!1),Dne=function(e){var t=e.children,r=e.debug;return xw.createElement(Rne.Provider,{value:r},t)};Dne.defaultProps={debug:!1,children:null},Dne.propTypes={debug:xC.bool,children:xC.node};var One=function(e,t,r){var n=e.getContext("2d");n.strokeStyle=r,n.lineWidth=1,n.beginPath(),n.rect(t.x,t.y,t.width,t.height),n.stroke(),n.closePath()},Nne=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.getContext("2d"),o=e.width;n.strokeStyle="blue",n.fillStyle="blue",n.lineWidth=1,t.forEach((function(e){e.landmarks.forEach((function(e){n.beginPath(),n.arc(r?o-e[0]:e[0],e[1],2,0,2*Math.PI),n.fill(),n.closePath()})),n.beginPath();var t={x:r?o-e.bottomRight[0]:e.bottomRight[0],y:e.topLeft[1],width:e.bottomRight[0]-e.topLeft[0],height:e.bottomRight[1]-e.topLeft[1]};n.rect(t.x,t.y,t.width,t.height),n.stroke(),n.closePath()}))},Lne=0,Mne=function(e){var t=e.cropArea,r=e.maskBoundingRect,n=e.baseCanvasSize;return xw.useMemo((function(){var e,o,i,a,s=t.width,c=t.height,u=t.x,l=t.y,d=Math.min(s,c)/n,f=s/d,p=c/d,h=null!==(e=null==r?void 0:r.left)&&void 0!==e?e:0,m=null!==(o=null==r?void 0:r.top)&&void 0!==o?o:0,g=null!==(i=null==r?void 0:r.right)&&void 0!==i?i:s,v=null!==(a=null==r?void 0:r.bottom)&&void 0!==a?a:c;return{left:Math.max((h-u)/d,Lne),right:Math.min((g-u)/d,f-Lne),top:Math.max((m-l)/d,Lne),bottom:Math.min((v-l)/d,p-Lne)}}),[t,null==r?void 0:r.bottom,null==r?void 0:r.left,null==r?void 0:r.right,null==r?void 0:r.top,n])},Fne=function(e){var t=e.timeout,r=xw.useRef(null),n=xw.useCallback((function(){r.current=performance.now()}),[]),o=xw.useCallback((function(){return null===r.current?(n(),!1):performance.now()-r.current>t}),[n,t]);return{markTime:n,checkIfEllapsed:o}},Une=function(e,t){return{topLeft:[e.topLeft[0]*t,e.topLeft[1]*t],bottomRight:[e.bottomRight[0]*t,e.bottomRight[1]*t],probability:e.probability,landmarks:e.landmarks.map((function(e){return[e[0]*t,e[1]*t]}))}},jne=function(e){var t=e.size,r=e.scale,n=void 0===r?1:r,o=e.video,i=e.baseSize,a=void 0===i?vne:i,s=t.width,c=t.height,u=null!=o?o:{},l=u.videoWidth,d=void 0===l?Number.MAX_SAFE_INTEGER:l,f=u.videoHeight,p=void 0===f?Number.MAX_SAFE_INTEGER:f,h=Math.min(s,c)/a,m=Math.round(s/h*n),g=Math.round(c/h*n);return m>d||g>p?{width:s,height:c}:{width:m,height:g}},Vne=function(e){var t=document.createElement("canvas"),r=t.getContext("2d"),n=e.width,o=e.height,i=Math.max(n,o);return t.width=i,t.height=i,r.fillStyle="#000",r.fillRect(0,0,i,i),r.drawImage(e,0,0,e.width,e.height),t};function zne(e){var t=e.cameraScale,r=void 0===t?1:t,n=e.isVideoPlaying,o=e.step,i=e.cropArea,a=e.videoRef,s=e.onFarFaceDetected,c=e.onFarFullFaceDetected,u=e.onCloseFaceDetected,l=e.onCloseFullFaceDetected,d=e.onFlashingFramesCaptured,f=e.frameInterval,p=void 0===f?180:f,h=e.useFaceDetectorWhenFlashing,m=e.onFaceError,g=e.onError,v=e.faceSettings,y=e.maskBoundingRect,b=e.shouldPauseFaceDetection,w=e.closeEyesSettings,C=e.maskSettings,k=e.captureFrameSettings,S=e.blurSettings,E=e.shouldContinueOnError,B=S.blurCheckFarSettings,_=S.blurCheckCloseSettings,x=C.chinToMaskBottomPadding,T=k.frameScale,A=w.enable,I=w.timeout,P=xw.useContext(Rne),R=Tne({videoRef:a,cropArea:i}),D=xw.useMemo((function(){return jne({size:{width:R.cropWidth,height:R.cropHeight},scale:T,video:a.current})}),[T,R.cropHeight,R.cropWidth,a]),O=Mne({cropArea:i,maskBoundingRect:y,baseCanvasSize:Math.min(D.width,D.height)}),N=v.minFarFaceRatio,L=v.maxFarFaceRatio,M=v.closeFaceRatio,F=xne({width:D.width,height:D.height,cameraScale:r}),U=D.height/D.width,j=xne({width:yne,height:yne*U,cameraScale:r,debug:P}),V=Ine({width:160,height:150,debug:P}),z=yj.useSDKSettings().customUrls,q=Ky(Bne(z,g),2),H=q[0],W=q[1],K=xw.useRef(null),Q=Fne({timeout:1e3*I}),G=Q.markTime,X=Q.checkIfEllapsed,Y=W&&n,$=Ky(xw.useState(""),2),Z=$[0],J=$[1],ee=H.closeEyesModel,te=H.blazefaceModel,re=xw.useMemo((function(){return $5(J,1e3)}),[]),ne=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t,r){var n,i,f,p,v,y,w,C,k,S,T,I,R,D,F,U,z,q,H,W,K,Q,Y,$,Z,J,ne,oe,ie,ae,se,ce,ue,le,de;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(null==r?void 0:r.width)&&0!==(null==r?void 0:r.height)){e.next=3;break}return e.abrupt("return");case 3:if(null!==a.current){e.next=5;break}return e.abrupt("return");case 5:if(!b){e.next=7;break}return e.abrupt("return");case 7:if(o!==mne.STOP_DECTECTING){e.next=9;break}return e.abrupt("return");case 9:if(n=t.cropX,i=t.cropY,f=t.cropWidth,p=t.cropHeight,v=r.width,y=r.height,r.getContext("2d").drawImage(a.current,n,i,f,p,0,0,v,y),w=Vne(r),C=yne/v,P&&j.getContext("2d").drawImage(a.current,n,i,f,p,0,0,v*C,y*C),h||o!==mne.START_FLASHING){e.next=22;break}if("function"!=typeof d){e.next=21;break}return e.next=21,d({prediction:null,canvas:r,landmarks:null});case 21:return e.abrupt("return");case 22:return e.next=24,GV.getModelPredictions({model:te,sCanvas:w});case 24:return k=e.sent,e.next=27,KV.validatePredictions({predictions:k,width:v,height:y});case 27:return S=e.sent,T=S.fullFace,I=S.ratio,R=[[O.left,O.top],[O.right,O.bottom]],e.next=33,KV.validatePredictions({predictions:k,cropAreaCoordinates:R});case 33:if(D=e.sent,F=D.error,U=D.fullFace,z=D.faceRatio,P&&(q={left:O.left*C,top:O.top*C,right:O.right*C,bottom:O.bottom*C},One(j,{x:q.left,y:q.top,width:q.right-q.left,height:q.bottom-q.top},"red"),H=k.map((function(e){return Une(e,C)})),Nne(j,H,!0)),W=uL.FaceDirection.FRONTAL,!U){e.next=44;break}return e.next=42,KV.calculateFaceDirection({landmarks:U.landmarks,upDownBound:{lower:.35,upper:.7}});case 42:Q=e.sent,W=null!==(K=null==Q?void 0:Q.gesture)&&void 0!==K?K:"";case 44:if(!T||o!==mne.FAR_FACE){e.next=48;break}if("function"!=typeof s){e.next=48;break}return e.next=48,s({prediction:k[0],canvas:r,landmarks:T.landmarks});case 48:if(!T||o!==mne.CLOSE_FACE){e.next=52;break}if("function"!=typeof u){e.next=52;break}return e.next=52,u({prediction:k[0],canvas:r,landmarks:T.landmarks});case 52:if(Y=null==F?void 0:F.code,e.prev=53,Y!==uL.Errors.no_face.code){e.next=56;break}throw new Error("no_face");case 56:if(Y!==uL.Errors.multiple_faces.code){e.next=61;break}if($=KV.calculateFaceArea(k[0]),Z=KV.calculateFaceArea(k[1]),!($<=2*Z)){e.next=61;break}throw new Error("multiple_faces");case 61:if(W===uL.FaceDirection.FRONTAL){e.next=63;break}throw new Error("face_not_frontal");case 63:if(Y!==uL.Errors.partial_face.code){e.next=68;break}if(J=KV.cropFaceInsideBox([k[0].topLeft,k[0].bottomRight],R),!(FV.rectEdgeRatio(J,R)>.95)){e.next=68;break}throw new Error("face_too_large");case 68:if(o!==mne.FAR_FACE){e.next=73;break}if(!(z>L)){e.next=71;break}throw new Error("face_too_large");case 71:if(!(z<N)){e.next=73;break}throw new Error("face_too_small");case 73:if(o!==mne.CLOSE_FACE){e.next=76;break}if(!(z<M)){e.next=76;break}throw new Error("face_too_small");case 76:if(!(Array.isArray(k)&&k.length>0&&O.bottom-k[0].bottomRight[1]>x)){e.next=78;break}throw new Error("face_too_high");case 78:if(Y!==uL.Errors.face_out_of_box.code){e.next=85;break}if(o!==mne.FAR_FACE){e.next=82;break}if(!(z>=N&&z<=L)){e.next=82;break}throw new Error("");case 82:if(o!==mne.CLOSE_FACE){e.next=85;break}if(!(z>=M)){e.next=85;break}throw new Error("");case 85:e.next=90;break;case 87:e.prev=87,e.t0=e.catch(53),Y=e.t0.message;case 90:if(ne=null,!A){e.next=102;break}if(Y){e.next=101;break}return e.next=95,ee.predict(r,T.landmarks);case 95:oe=e.sent,ie=X(),ne=oe.isEyeClose,oe.isEyeClose&&!ie&&(Y="eye_close"),e.next=102;break;case 101:G();case 102:if(ae=0,!(se={enable:o===mne.FAR_FACE?B.enable:_.enable,threshold:o===mne.FAR_FACE?B.threshold:_.threshold}).enable){e.next=109;break}return e.next=107,BV.calculateBlurScore(r);case 107:ae=e.sent,""!==Y||BV.hasBetterBlurScore(ae,se.threshold)||(Y="blurry_face");case 109:if(P&&Pne(V,{ratio:null!==(ce=null==I?void 0:I.toFixed(3))&&void 0!==ce?ce:"undefined",error:Y,ovalFaceRatio:null!==(ue=null==z?void 0:z.toFixed(3))&&void 0!==ue?ue:"undefined",ovalError:null!==(le=null==F?void 0:F.code)&&void 0!==le?le:"undefined",step:o===mne.FAR_FACE?"far":"close",blurScore:ae.toFixed(3)}),de=Ane(Y),re(de),!de){e.next=118;break}if("function"!=typeof m){e.next=116;break}return e.next=116,m({error:Y,currentStep:o});case 116:if(E){e.next=118;break}return e.abrupt("return");case 118:if(!(o===mne.FAR_FACE&&T&&N<=z&&z<=L)){e.next=123;break}if("function"!=typeof c){e.next=123;break}return e.next=122,c({prediction:k[0],canvas:r,landmarks:T.landmarks,frame:{faceRatio:z,isEyeClosed:ne,blurScore:ae}});case 122:return e.abrupt("return");case 123:if(!(T&&o===mne.CLOSE_FACE&&z>=M)){e.next=128;break}if("function"!=typeof l){e.next=128;break}return e.next=127,l({prediction:k[0],canvas:r,landmarks:T.landmarks,frame:{faceRatio:z,isEyeClosed:ne,blurScore:ae}});case 127:return e.abrupt("return");case 128:if(!(h&&T&&o===mne.START_FLASHING&&z>=M)){e.next=133;break}if("function"!=typeof d){e.next=133;break}return e.next=132,d({prediction:k[0],canvas:r,landmarks:T.landmarks});case 132:return e.abrupt("return");case 133:e.next=139;break;case 135:e.prev=135,e.t1=e.catch(0),console.error(e.t1),g({error:e.t1});case 139:case"end":return e.stop()}}),e,null,[[0,135],[53,87]])})));return function(t,r){return e.apply(this,arguments)}}(),[a,b,o,P,h,te,O.left,O.top,O.right,O.bottom,A,B.enable,B.threshold,_.enable,_.threshold,re,N,L,M,j,d,s,u,x,ee,X,G,V,m,E,c,l,g]);return xw.useEffect((function(){var e=null,t=!1;return Y&&function r(){e=requestAnimationFrame(function(){var e=xy(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=2;break}return e.abrupt("return");case 2:if(null!==a.current){e.next=4;break}return e.abrupt("return");case 4:if(null===K.current&&(K.current=n),!(n-K.current<p)){e.next=9;break}return r(),e.abrupt("return");case 9:return K.current=n,e.next=12,ne(R,F);case 12:r();case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}(),function(){t=!0,cancelAnimationFrame(e)}}),[F,R,ne,Y,a,p]),{warmupDone:W,faceError:Z}}var qne={" ":"rgba(0,0,0,0.6)",default:"rgba(0,0,0,0.6)"},Hne=null,Wne=function(e){var t=e.colors,r=e.onFlashDone,n=e.framesPerColor,o=e.flashColor,i=Ky(xw.useState(Hne),2),a=i[0],s=i[1],c=xw.useRef(a),u=xw.useMemo((function(){return t.split("").reduce((function(e,t){return e+t.repeat(n)}),"")}),[t,n]),l=" "===u[a]?qne.default:o,d=xw.useCallback((function(){s((function(e){return e+1})),c.current+=1}),[]),f=xw.useCallback((function(){s(0),c.current=0}),[]);return xw.useEffect((function(){a>u.length-1&&(s(Hne),c.current=Hne,"function"==typeof r&&r())}),[a,u.length,r]),{flashingColors:u,colorIndex:a,currentColor:l,goToNextColor:d,startFlashing:f,colorIndexRef:c}},Kne=function(e){var t,r,n=e.videoAreaWidth,o=e.videoAreaHeight,i=e.lostX,a=e.lostY;return b1.isMobile?(t=n,r=o):(t=Math.min(n,o),r=Math.min(n,o)),{width:t,height:r,x:Math.max(Math.round((n-t)/2+i),0),y:Math.max(Math.round((o-r)/2+a),0)}},Qne=function(e){var t=e.onVideoPlayed,r=Ky(xw.useState(!1),2),n=r[0],o=r[1],i=Ky(xw.useState({}),2),a=i[0],s=i[1];return{onVideoPlayed:xw.useCallback((function(e){var r=Kne(e);s(r),o(!0),"function"==typeof t&&t(e)}),[t]),cropArea:a,isPlaying:n}},Gne=function(e){var t=e.prediction,r=e.canvas,n=e.landmarks,o=e.index,i=e.quality,a=void 0===i?.8:i,s=r.toDataURL("image/jpeg",a);return t?{label:"portrait",base64:s.split(",")[1],landmarks:n,index:o}:{label:"portrait",base64:s.split(",")[1],index:o}},Xne=function(){return 60},Yne=function(){var e=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",30);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$ne=20,Zne=function(e){var t=Ky(xw.useState(e),2),r=t[0],n=t[1];return xw.useEffect((function(){(function(){var t=xy(regeneratorRuntime.mark((function t(){var r,o,i,a,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Promise.all([Xne(),Yne()]);case 3:r=t.sent,o=Ky(r,2),i=o[0],a=o[1],s=Math.max(1e3/i,1e3/a,e),n(s),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(0),console.error(t.t0),n($ne);case 15:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(){return t.apply(this,arguments)}})()()}),[e]),r},Jne=function(e){var t=e.className,r=e.iconColor;return xw.createElement("svg",{className:t,width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xw.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",fill:r}),xw.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 36.1124C30.6895 36.1124 36.1124 30.6895 36.1124 24C36.1124 17.3105 30.6895 11.8876 24 11.8876C17.3105 11.8876 11.8876 17.3105 11.8876 24C11.8876 30.6895 17.3105 36.1124 24 36.1124ZM24 38C31.732 38 38 31.732 38 24C38 16.268 31.732 10 24 10C16.268 10 10 16.268 10 24C10 31.732 16.268 38 24 38Z",fill:"white"}),xw.createElement("path",{d:"M18.1465 20.169C18.1465 19.6236 18.5886 19.1815 19.134 19.1815C19.6793 19.1815 20.1214 19.6236 20.1214 20.169V22.1439C20.1214 22.6893 19.6793 23.1314 19.134 23.1314C18.5886 23.1314 18.1465 22.6893 18.1465 22.1439V20.169Z",fill:"white"}),xw.createElement("path",{d:"M28.0213 20.169C28.0213 19.6236 28.4634 19.1815 29.0087 19.1815C29.5541 19.1815 29.9962 19.6236 29.9962 20.169V22.1439C29.9962 22.6893 29.5541 23.1314 29.0087 23.1314C28.4634 23.1314 28.0213 22.6893 28.0213 22.1439V20.169Z",fill:"white"}),xw.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0714 19.1135C24.654 19.1135 25.1262 19.5858 25.1262 20.1683V24.6119C25.1262 25.7398 24.2119 26.6542 23.084 26.6542H22.5902C22.0077 26.6542 21.5354 26.1819 21.5354 25.5994C21.5354 25.0168 22.0077 24.5446 22.5902 24.5446H23.0166V20.1683C23.0166 19.5858 23.4889 19.1135 24.0714 19.1135Z",fill:"white"}),xw.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.8537 27.4214C29.2114 27.8813 29.1285 28.544 28.6687 28.9016C26.6697 30.4564 24.6954 30.8255 23.0184 30.5817C21.3833 30.344 20.0946 29.5339 19.3755 28.8149C18.9636 28.403 18.9636 27.7351 19.3755 27.3232C19.7875 26.9113 20.4553 26.9113 20.8672 27.3232C21.3002 27.7562 22.184 28.3286 23.322 28.4941C24.4181 28.6534 25.8176 28.4466 27.3735 27.2364C27.8334 26.8788 28.4961 26.9616 28.8537 27.4214Z",fill:"white"}),xw.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",stroke:"#DAEAFB"}))};Jne.defaultProps={className:"",iconColor:"#0276F1"},Jne.propTypes={className:xC.string,iconColor:xC.string};var eoe,toe,roe,noe={FlashLiveness:{maskFill:"#fff",title:{hidden:!1,height:"64px",color:"#000",fontSize:"24px",fontWeight:"normal"},guideline:{text:{normal:{color:"#1d1d1d",fontSize:"16px",fontWeight:"bold",background:"#fafafa",border:"1px solid rgba(29, 29, 29, 0.04)",borderRadius:"100px",padding:"12px 16px"},flashing:{color:"#fff",fontSize:"24px",fontWeight:"bold",background:"#E54D2E",border:"1px solid rgba(29, 29, 29, 0.04)",borderRadius:"100px",padding:"12px 16px"}},icon:{color:"#0276F1"}},instruction:{color:"#1d1d1d",fontSize:"16px",fontWeight:"bold",background:"rgba(255, 255, 255, 0.8)",border:"none",borderRadius:"12px"},timeoutText:{color:"red",fontSize:"16px",fontWeight:"normal",padding:"0"},errorOverlay:{backgroundColor:"red",opacity:.2},progressBar:{mainColor:"#0276F1",secondaryColor:"#daeafb",fontSize:"16px",fontWeight:"normal"}}},ooe=dB.div(eoe||(eoe=Wy(["\n & .indicator {\n color: ",";\n }\n\n & .gauge {\n background-color: ",";\n transition: width 0.3s linear;\n }\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.mainColor",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.mainColor",noe)})),ioe=dB.div(toe||(toe=Wy(["\n height: 10px;\n position: relative;\n background: ",";\n border-radius: 100px;\n margin-block-end: 8px;\n\n & > span {\n display: block;\n height: 100%;\n border-radius: 100px;\n width: 0;\n overflow: hidden;\n }\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.secondaryColor",noe)})),aoe=function(e){var t=e.value,r=e.className;return xw.createElement(ooe,{className:r},xw.createElement(ioe,null,xw.createElement("span",{className:"gauge",style:{width:"".concat(t,"%")}})),xw.createElement("div",null,xw.createElement("span",{className:"indicator"},"• ",t,"%")))};aoe.defaultProps={value:0,className:""},aoe.propTypes={value:xC.number,className:xC.string};var soe,coe=dB.span(roe||(roe=Wy(["\n padding: 8px 12px;\n display: flex;\n align-items: center;\n flex-direction: row;\n"]))),uoe=function(e){var t=e.children,r=e.className;return xw.createElement(coe,{className:r},t)};uoe.defaultProps={children:null,className:""},uoe.propTypes={children:xC.node,className:xC.string};var loe,doe=dB.span(soe||(soe=Wy(["\n ","\n padding: 12px 16px;\n max-width: 200px;\n text-align: center;\n display: inline-block;\n"])),(function(e){var t=e.theme;return YE(["font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";"],t5(t,"FlashLiveness.instruction.fontSize",noe),t5(t,"FlashLiveness.instruction.color",noe),t5(t,"FlashLiveness.instruction.fontWeight",noe),t5(t,"FlashLiveness.instruction.background",noe),t5(t,"FlashLiveness.instruction.borderRadius",noe),t5(t,"FlashLiveness.instruction.border",noe))})),foe=function(e){var t=e.children,r=e.className;return xw.createElement(doe,{className:r},t)};foe.defaultProps={children:null,className:""},foe.propTypes={children:xC.node,className:xC.string};var poe,hoe,moe=dB.div(loe||(loe=Wy(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1001;\n\n background-color: ",";\n"])),(function(e){return e.$overlay?"white":"transparent"})),goe=function(e){var t=e.children,r=e.overlay,n=e.loadingComponent;return xw.createElement(moe,{$overlay:r},r&&n,xw.createElement("div",{style:{visibility:r?"hidden":"visible"}},t))};goe.defaultProps={children:null,overlay:!1,loadingComponent:xw.createElement(Y7,null)},goe.propTypes={children:xC.node,overlay:xC.bool,loadingComponent:xC.node};var voe={width:210,height:300},yoe={width:b1.isMobile?window.innerWidth:window.innerHeight,height:window.innerHeight},boe=dB.ellipse(poe||(poe=Wy(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),woe=dB.rect(hoe||(hoe=Wy(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n"]))),Coe=xw.forwardRef((function(e,t){var r=e.className,n=e.scale,o=e.debug,i=e.width,a=e.height,s=e.padding,c=e.verticalOffset,u=e.ovalMaskFillColor,l=(i-voe.width)/2,d=(a-voe.height)/2+c,f=(i+voe.width)/2,p=(a+voe.height)/2+c,h=l-(f-l)*(n-1)/2,m=d-(p-d)*(n-1)/2,g=(f-l)*n,v=(p-d)*n;return xw.createElement("svg",{className:r,viewBox:"0 0 ".concat(i," ").concat(a),width:i,height:a},xw.createElement("mask",{id:"OVAL_MASK"},xw.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),xw.createElement(boe,{cx:i/2,cy:a/2+c,rx:voe.width/2,ry:voe.height/2,$scale:n})),xw.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:u,mask:"url(#OVAL_MASK)"}),xw.createElement("rect",{x:"0",y:"0",width:i,height:a,stroke:"red",fill:"none",style:{visibility:o?"visible":"hidden"}}),xw.createElement(woe,{ref:t,x:h-s.left,y:m-s.top,width:g+s.left+s.right,height:v+s.top+s.bottom,fill:"none",stroke:"red",strokeWidth:.5,style:{visibility:o?"visible":"hidden"}}))}));Coe.propTypes={className:xC.string,scale:xC.oneOfType([xC.number,xC.string]),debug:xC.bool,width:xC.number,height:xC.number,padding:xC.oneOfType([xC.number,xC.shape({top:xC.number,right:xC.number,bottom:xC.number,left:xC.number})]),verticalOffset:xC.number,ovalMaskFillColor:xC.string},Coe.defaultProps={className:"",scale:1,debug:!1,width:yoe.width,height:yoe.height,padding:0,verticalOffset:0,ovalMaskFillColor:"#fff"};var koe=function(e,t,r){var n=e.smallScale,o=e.largeScale,i=e.ovalPadding,a=t.width/t.height,s=n/o,c=n*r.height,u=o*r.height,l=i.top+i.bottom,d=i.left+i.right,f=c-l,p=u-l;if(parseFloat((p*a).toFixed(2))+d>r.width){var h=((r.width-d)/t.width).toFixed(2);return{smallScale:(h*s).toFixed(2),largeScale:h}}return{smallScale:(f/t.height).toFixed(2),largeScale:(p/t.height).toFixed(2)}},Soe=function(e){var t=e.offset,r=e.ovalPadding,n=e.largeScale,o=e.ovalHeight,i=e.maskHeight,a=o/2+r.bottom;return(a+t)*n>i/2?i/2/n-a:t},Eoe=function(e){xw.useEffect((function(){return function(){var t;e&&(null===(t=e.srcObject)||void 0===t||t.getTracks().forEach((function(e){e.stop()})))}}),[e])},Boe=function(){var e,t=Ky(xw.useState(null),2),r=t[0],n=t[1],o=Ky(xw.useState(!1),2),i=o[0],a=o[1],s=xw.useRef(null);return xw.useEffect((function(){if(!s.current)return function(){};var e=s.current,t=function(){n(e.getBoundingClientRect()),a(!1)},r=function(){a(!0)};return e.addEventListener("transitionstart",r),e.addEventListener("transitionend",t),function(){e.removeEventListener("transitionstart",r),e.removeEventListener("transitionend",t)}}),[]),[s,null!=r?r:null===(e=s.current)||void 0===e?void 0:e.getBoundingClientRect(),i,a]},_oe=function(e){var t=e.mode,r=e.enableWriteExif,n=xw.useRef(Date.now()),o=yj.useSDKSettings().exifKey,i=xw.useCallback((function(){if(r){var e=Date.now();lW.preWriteExif({mode:t,startTime:n.current,endTime:e,exifKey:o})}}),[t,r,o]),a=xw.useCallback((function(e,t){r&&lW.addExifData(e,t)}),[r]),s=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.imageData){e.next=3;break}return e.abrupt("return",null);case 3:if(r){e.next=5;break}return e.abrupt("return",o.blob);case 5:return e.next=7,lW.writeExif({mode:t,imageData:o,enableExifData:!0});case 7:return i=e.sent,e.abrupt("return",i);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[t,r]);return xw.useEffect((function(){r&&lW.initExifData()}),[r]),{prepareExifData:i,writeExifData:s,addExifData:a}},xoe="Face authentication",Toe="Hold still",Aoe="Uploading",Ioe="Start",Poe="Retry",Roe="Fit your face into the oval",Doe="No face detected",Ooe="Processing result",Noe="Please fit your face in the oval",Loe="Please move your face a bit closer",Moe="Please move your face a bit further",Foe="Please open your eyes",Uoe="Please hold your device at eye level",joe="Multiple faces detected",Voe="Please move your face down a little",zoe="Image's blurry. Please hold your phone still",qoe="Move your face closer",Hoe={face_authentication:xoe,hold_still:Toe,uploading:Aoe,start:Ioe,continue:"Continue",retry:Poe,"face_authentication.successful":"Successful face authentication","face_authentication.unsuccessful":"Unsuccessful face authentication",move_face_into_frame:Roe,face_not_found:Doe,processing_result:Ooe,please_move_face_into_center_frame:Noe,please_move_face_closer:Loe,please_move_face_farther:Moe,please_open_your_eyes:Foe,please_look_straight_at_the_camera:Uoe,please_only_one_face:joe,please_move_face_down:Voe,please_hold_still:zoe,"timeout.remaining":"Remaining time: <%= remain %> seconds","timeout.expired":"You need to complete within <%= timeout %> seconds. Please try again.",move_face_closer:qoe},Woe="Xác thực khuôn mặt",Koe="Giữ yên",Qoe="Đang tải lên",Goe="Bắt đầu",Xoe="Thử lại",Yoe="Đưa mặt vào khung",$oe="Không tìm thấy khuôn mặt",Zoe="Đang xử lý kết quả",Joe="Đưa khuôn mặt vào giữa hình oval",eie="Đưa khuôn mặt lại gần một chút",tie="Đưa khuôn mặt ra xa một chút",rie="Vui lòng mở to mắt",nie="Vui lòng đưa thiết bị ngang tầm mắt",oie="Có nhiều mặt trong khung hình",iie="Đưa khuôn mặt xuống một chút",aie="Ảnh bị mờ, vui lòng giữ yên điện thoại",sie="Đưa mặt lại gần",cie={face_authentication:Woe,hold_still:Koe,uploading:Qoe,start:Goe,continue:"Tiếp tục",retry:Xoe,"face_authentication.successful":"Xác thực khuôn mặt thành công","face_authentication.unsuccessful":"Xác thực khuôn mặt không thành công",move_face_into_frame:Yoe,face_not_found:$oe,processing_result:Zoe,please_move_face_into_center_frame:Joe,please_move_face_closer:eie,please_move_face_farther:tie,please_open_your_eyes:rie,please_look_straight_at_the_camera:nie,please_only_one_face:oie,please_move_face_down:iie,please_hold_still:aie,"timeout.remaining":"Thời gian còn lại: <%= remain %> giây","timeout.expired":"Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại.",move_face_closer:sie},uie={en:Hoe,vi:cie},lie=xw.createContext({}),die=function(e){var t,r=e.children,n=yj.useSDKSettings().lang;return xw.createElement(lie.Provider,{value:null!==(t=uie[n])&&void 0!==t?t:uie.vi},r)};die.propTypes={children:xC.node.isRequired};var fie,pie=function(){var e=xw.useContext(lie);return xw.useCallback((function(t,r){var n,o;return r?i9(null!==(n=e[t])&&void 0!==n?n:t)(r):null!==(o=e[t])&&void 0!==o?o:t}),[e])},hie=function(){var e=xw.useRef(),t=Yj.useSDKTracking().sendEvent;return xw.useCallback((function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=performance.now(),a={};"object"===By(o)&&(a=Oy({},o),e.current&&(a.interval_vs_previous_in_ms=Math.round(i-e.current))),"function"==typeof o&&(a=o({lastTimeLog:e.current})),e.current=i,t({tag:r,event:n,log:a})}),[t])},mie=function(e,t){var r=xw.useRef(e);xw.useEffect((function(){r.current=e}),[e]),xw.useEffect((function(){t&&"function"==typeof r.current&&r.current()}),[t])},gie=Object.freeze({READY:"READY",RUNNING:"RUNNING",STOPPED:"STOPPED"}),vie=function(e){var t=e.startTime,r=void 0===t?3:t,n=e.onCountDownDone,o=Ky(xw.useState(r),2),i=o[0],a=o[1],s=Ky(xw.useState(gie.READY),2),c=s[0],u=s[1],l=xw.useRef(),d=xw.useCallback((function(){u(gie.RUNNING),l.current=setInterval((function(){a((function(e){return e-1}))}),1e3)}),[]),f=xw.useCallback((function(){u(gie.READY),a(r),clearInterval(l.current)}),[r]);return xw.useEffect((function(){0===i&&(u(gie.STOPPED),clearInterval(l.current),"function"==typeof n&&n())}),[i,n,f,d]),{state:c,countdown:i,startCountDown:d,stopCountDown:f}},yie=dB.span(fie||(fie=Wy(["\n display: inline-block;\n margin-block: 10px;\n text-align: center;\n max-width: 350px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.timeoutText.color",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.timeoutText.fontSize",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.timeoutText.fontWeight",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.timeoutText.padding",noe)})),bie=3e3,wie=function(e){var t=e.onTimeout,r=e.timeout,n=e.shouldStart,o=e.shouldStop,i=e.onWarningMessageTimeout,a=e.timeLeftThreshold,s=pie(),c=Ky(xw.useState(!1),2),u=c[0],l=c[1],d=xw.useCallback((function(){l(!0),setTimeout((function(){l(!1),"function"==typeof i&&i()}),bie),"function"==typeof t&&t()}),[t,i]),f=vie({startTime:r,onCountDownDone:d}),p=f.countdown,h=f.startCountDown,m=f.stopCountDown;return mie(h,n),mie(m,o),xw.createElement(xw.Fragment,null,!u&&p>0&&p<a&&xw.createElement(yie,null,s("timeout.remaining",{remain:p})),u&&xw.createElement(yie,null,s("timeout.expired",{timeout:r})))};wie.propTypes={onTimeout:xC.func.isRequired,timeout:xC.number.isRequired,shouldStart:xC.bool.isRequired,shouldStop:xC.bool.isRequired,onWarningMessageTimeout:xC.func,timeLeftThreshold:xC.number},wie.defaultProps={onWarningMessageTimeout:null,timeLeftThreshold:10};var Cie={8:[" r rrr"," r rr"," r r rr "," r rrr "," r r r "," rr r rr"," rr r "," rr rrr"," rr r"," rrr r"," r rrr "," r r r "," r r rr"," r r r "," r rrr r"," r r "," rrr r "," r rr r"," rrr rrr"," r r "," rr r "," r rrr "," r rr "," r r rr"," r r r"," r r r"," r rr r"," r r r "," r rr r"," r rr rr"," rr rr "," rr rr"," r rrr"," r r"," r rrr"," r rr "," r rr r "," rr r "," rr r r "," r r "," rr r "," rr r "," r r r"," rr rr"," rr "," r rr "," rrr r r"," r r r"," rrr rr"," r rr"," rrr "," rr rrr"," r r "," rrr "," r r "," r r r"," r rr "," rr rr "," rrr r"," rr r r"," r r r r"," rr rrr "," rrr rr "," rrr r"," rrr rr"," r rr "," rrr r "," rr rr"," rr rr r"," r rr "," rr r"," r r rr"," r r r"," r r rrr"," rr r r"," rrr r "," rr r r"," r r "," rr r "," rr rr "," r r "],9:[" r r r "," r r r"," rrr r r "," r rrr "," r r rr"," rr r "," r r r "," r rrr "," rr rr "," rr r r "," r r rrr"," r r r r"," r rr r"," rr r r"," r rr "," rrr r "," r rr r"," rr rr "," rr r r"," rr r rr"," rr rrr "," r r r"," r r r "," rr rr r"," r rr r"," rrr rrr "," rr r r"," r r r "," rrr "," r r rr"," r r rrr"," r r r rr"," r r r "," rrr rr"," r rrr r "," rrr r "," rrr r "," rrr r "," r rr r r"," rr r r "," rr r r"," r r r"," rr rr r"," rr r r r"," r r r "," r r rr "," rr r r "," r rr r "," rr rr "," rr r "," rr r"," r r r"," rrr r"," r rr "," r r "," r r "," rrr r "," r rr "," r rr r "," r rr rr"," rr r "," r r rr "," rrr rr"," r rrr "," rrr rrr"," r rr "," r r rrr"," r rrr r"," r r rr r"," rr rr r "," r rrr "," r r rr"," rr r "," r r r "," r r r r "," r r "," r rr rr "," r rrr "," r rr "," rr rrr "," r r "," r r r r"," rr rr r"," r rr rr"," r r r "," rr rr"," r r rrr "," r r r "," rr rr rr"," r rr rrr"," rr rr "," rr r rr"," rrr rr "," rrr rr "," rr rrr "," r rrr"," rr r r"," rrr rr "," rrr rr"," rrr r r"," rr rr"," r rrr r"," r rr "," rr rrr"," rr r r"," r rr r"," r r rr "," r rr rr"," r rrr rr"," rrr r r"," r rr"," r r rr "," r r r"," rrr rrr"," rr r "," rr rr "," r r rr"," rr rrr r"," rrr r rr"," r rr r "," r r r"," r rr r"," rrr r r"," rr r rr"," rr r rrr"," r r "," r rrr"," rrr r "," r r r r"," rr rrr"," r r "," rr r "," rr r rr "," r rrr r"," rr r "," rrr r"," r rr r "," r rr r"," r rr "," r r rr"," r r r "," rr rrr"," rr rr "," r rrr "," rrr rr r"," r r rr"," rr r r "," r r r r"," r r r"],10:[" r rr r"," rrr rrr "," rr r rr "," r r rrr"," r rr r"," r r rr "," r rrr rr"," r r rr "," rr r r"," r r rr "," rr rrr "," r rr r r"," rr r rr "," r r r r "," r rrr "," r rr rr "," rr rr r"," rr r r "," r rrr r"," r r r "," r r r"," rrr r "," r r r"," rr r rrr"," r r r rr"," r rr rr"," r rr r "," rrr r r "," rr rr r"," r r rr"," r r r r"," rrr r rrr"," r r r r "," r r rrr "," r rrr rr "," rrr r"," r rrr "," r r r "," r rrr r "," r rr rrr"," r rrr rrr"," rr r r "," rr r r "," rrr r rr"," rr rrr "," rrr r "," rrr rr r"," rrr r "," r rrr r "," r r rrr r"," r r r r "," rrr r r "," rrr rrr "," rr r rr "," r r r rr"," rr r r r"," rr rr "," r rr rr "," rr rrr r"," rr rr "," r rr r "," r rrr r"," r r r r"," rr rrr "," r r "," rr r r "," rrr rr r"," rr r rr"," r rr r"," r r r"," rr r rr r"," r r rr r"," rrr rrr "," r r r r "," r r rrr "," rr r "," rrr r r "," r r rr "," r r r r "," r rrr r"," rr rrr "," r rrr rr"," rr r rr"," r r r "," r r rr r"," r r r r"," rr rr "," rrr rr "," r r r"," rr rr "," rr rrr"," r rr r"," r r rrr"," rr rr "," r rrr rr"," rr r "," r rr r "," rr r "," rr rr r "," rr rr r r"," r rrr r "," r rrr "," r rrr "," r rr rr"," rr rr rr"," rr rrr "," r r rr "," rr r r"," rr r "," rr r rr"," r rr rrr "," rr rrr r"," rr r r "," rr r rr "," r rrr "," r rr r r"," r r r "," rr rr r "," r r rr "," r rr r "," r rr r "," r rr r r"," rrr rrr"," rr r r rr"," rrr rr "," r rr rr r"," rr r r r"," r rr r"," r rr rr "," r r r "," r r rr r "," rrr r rr"," r r "," r rrr r "," r r rr r"," r r r r"," r rrr r r"," rr r rrr "," rrr rr "," r r rrr"," r r r "," rr r rr"," r rr r"," r r "," rrr r r "," rr rrr r"," rrr rr "," rr r r "," r r r r"," rrr r "," r rr rrr"," r rr r "," rrr r r"," rr r r"," r r r "," r r rrr"," rr r "," rr rr r"," r r r r"," r rr "," r rr rr "," rr r r "," rr r rrr"," rr rr r"," rrr rrr"," r r rrr"," r r r"," r r r "," rrr r r"," r rr r "," r rr rr"," rr rrr r "," r r r r"," rr r r r "," r rr r "," rr r r "," r rr "," r rr rr"," r rr rrr"," rrr r rr "," r r rrr "," r r r rr"," r r r "," r rrr r"," rr r "," rr rr"," r rr r "," rr r rr"," rr r rrr"," r rr r rr"," r r r "," r r r rr "," rr r r r"," r r r rr"," rr rr rr "," rrr r r"," r rr r r"," rr rr r "," rr r r"," r rr "," rrr rr r"," r r r "," r r rr "," rr rr r"," rrr rr rr"," r rrr "," rr rr rr"," rrr r r"," rrr r rr"," r r r "," rr rrr"," rrr rr "," rr rrr rr"," r r r"," r rrr "," r r rr"," r rr "," rr rr "," rrr r r r"," r rrr"," r r r rrr"," rrr rr"," r r rr "," r rrr r"," rr r r"," rrr r r"," rr rr rrr"," r r r r"," rrr r "," r r r r"," r r rr"," r rr rr"," rrr rr r "," r r r r r"," r r r "," r r r "," r rr r "," r r rr rr"," rrr r "," rr rr r "," r rr r r "," rr r r r"," rr rr r"," rr rrr "," rrr rrr r"," r r rrr "," r r rr"," rr r r"," rr r rr"," r r rr"," r r rr "," rrr r "," r rrr r"," r rr "," r r r "," r r r r"," rr r r "," rr rr "," rrr r r"," r rr "," rr r r"," rrr rr "," r r rr"," r r rr"," r r rr r"," r r r "," rrr rrr"," rrr rr"," r rr rr"," r r rr "," rr r r "," r rr r"," r r rrr"," rr rr rr"],11:[" rrr rrr "," r r r r r"," r r rrr"," r rr rr "," r rr rrr"," r r r r r"," rr r rrr"," rrr rrr r"," rr r r "," rr rrr rrr"," r rrr rrr"," r r r "," rr rrr r"," r rrr "," rr r rrr "," r rr rr"," rrr rr r"," rr r r "," r rrr rr"," r r rrr r"," rr r r r"," rrr r r"," r r rrr "," r rr rr r"," rr rrr r"," rrr r rrr"," rr rr r"," r rrr r "," r rr rrr "," r r rr"," rr r r "," r r r r "," r rr rr"," r rr r"," rrr rr "," rrr rr r "," rr r r r"," rr rrr rr"," rrr rr "," r rrr "," r rr r "," rrr rrr"," r rr rr rr"," r r r rr "," rr r rr rr"," r rr r "," r r r "," r rrr r "," rrr r r r"," rrr r rr "," r r r "," rr r rrr "," rrr r r"," rr rr r "," rr r r "," r rr r rrr"," r r r r"," rr r rrr "," r rr r"," r r rr"," rr r r "," rr r r"," r r r rr"," rrr r rr "," r r r r"," r rr r rr "," r r rr "," r r rr r"," r rrr rr "," r r r "," r rr r "," rr r r r"," rr r r r"," r rrr rr "," rr rrr "," rrr r r "," rrr r rr "," rr r rr"," rr rrr r"," r r rrr "," r r rr r "," r rr rr r "," rr r r r "," r r r "," rr r r "," r r r rrr "," rrr rr r"," r rr r "," rr rr r "," rr rr rr "," rrr r r "," rrr rr r r"," r r rrr "," r rr r rr"," rr rrr rr"," rr rr rr r"," r r r"," r rrr r"," rr r r r"," r r rrr "," r rr r rr"," rrr r r "," r rr r "," r rr rr "," r rr rr "," rr rrr rr "," rr rr rr "," rr r rr "," r r r r r"," rr rr rrr"," r r rr r "," r r r "," r r r r"," rr r rrr"," r rr r "," r r rr"," rrr r r"," rr rr r "," rrr r rr"," r r rr r"," rr rr r r"," r r r r "," r r rrr rr"," r rr "," r r r r "," rrr r rrr"," rrr r r r"," rr r rrr r"," rr rr r r"," rrr r r "," r rr r r "," rrr rr "," rr r rr"," r r rrr"," r r r r r "," r rrr r r"," r r rr r"," r r rrr "," r r rrr r "," r r r rr"," r rr rr "," rr rr rr "," r rrr r "," r rr rrr"," r r r r"," rrr r "," rr rr "," rr rrr "," rrr r r"," r rr r r "," r r rr "," r r rr "," r rr rr "," r r rr "," rr rr rr"," r rr "," rr r rr "," r rr r r "," r r r r"," r r r "," r rr rr "," rrr r r "," rr r r "," r r rr "," rr r rr r "," rr rrr"," rr rr rrr "," rr rr r"," r r r r "," rr r rrr"," rr rrr "," rr r r "," r rr r "," rr r r "," rr rrr r r"," rr r "," r r r rr "," rr rr rr "," rrr r "," r r rr r"," rr r r r "," rr r r r "," rrr r r"," rrr r rr"," r r r r "," rr rr r "," rrr rr "," r rr rrr"," r rr rr"," r rrr r r"," r rrr "," r rrr r"," rrr rrr r"," r r r "," r r rr "," r r rrr"," rr rr r"," r r rrr"," rrr rrr r "," rr r r r"," rrr rrr"," r r rrr r"," rr r r rr"," r r r "," rr rrr r "," rr rr r "," r r r "," r rrr "," r r r r "," r rrr r"," r r rr r "," r rr rrr "," rr r rrr"," rrr rr"," rrr r r r"," rrr rr r"," r rr r "," rr rr r r"," r r rrr "," r r r rr"," r r rrr "," rrr rr r "," rr rrr r"," rrr r rr"," r r rr rr"," rr rr "," r rr r"," r rr "," rrr r r "," r r rr "," r rrr r"," r rr r"," r r rr r"," r rr r r"," rr r rr"," rrr r rr"," r r rr"," r rrr rrr"," r rrr rr "," r r r r "," rrr r rr"," r r r r "," rrr rr rr"," r r rr rrr"," r r r r"," r rrr "," rr r r r"," rr rrr "," rr r r r"," rr r rrr "," rr r r"," r r r r"," rr rrr r"," rrr r r "," r r r "," r rr r r r"," r rr rrr r"," r r r r"," r r r rr r"," rrr r r r"," r r rrr"," rr rrr "," r r r r"," r r r"," r r rr rr"," rrr rr r"," r r rr "," r r r rr"," r rr r r "," r r r rr"," r rrr rr"," r r r"," r r rr"," r rrr r "," rr rr r "," rrr r "," rr rr r "," r r r r "," r r rr "," rrr r rr"," r rr r "," rr r r r r"," r r r r "," rr r r "," rrr rr "," rr rr rrr"," rr r rr"," r rrr rrr"," r rr r "," rr rr rr"," rr r r "," r rr rr "," r r r r "," r r r "," rr r rr "," r r rr "," r r r rr"," rr r r r "," r r rr "," r r r rr"," r r rrr"," rr rr r r"," r rrr rr r"," r rr rr"," r r rr "," r rr r r"," rr rr r "," r r rrr r"," r rrr rr "," rr rrr "," rrr r r "," rrr r r"," rrr rr "," rr r "," r rrr r rr"," r rrr r"," r rr r r "," rr r rr "," r r rr r r"," r rr r r"," rr r r "," r r r rr"," rrr rrr r"," rrr r r"," r rr r rr"," rr r r r "," rr r r "," rrr rrr "," r r rr"," r r rrr"," r r r r"," rr rr "," r r r r"," rrr rr rr"," rrr r "," r r r r r"," rrr r rrr"," rr rr "," rrr rrr "," r rrr r r "," rr r rr "," rr rr r"," rr r r"," rr r rr r"," r r r r "," r r rr r"," rrr rrr "," rr rrr r "," r rr rrr "," r rrr r"," rr r r"," r rrr "," r rr r "," rrr rrr "," rr r rr r"," rr rrr r "," rr rr rr"," rr r r"," r rr rr r"," r rrr rr"," rr r r "," r r r r "," rr r rr"," r r r r"," r rrr rr"," rr r rrr"," r r r rr "," rrr r rr r"," rrr r "," r rr r r"," r rr rrr"," rr rr rr"," r r rr rr"," r rr rr "," rr r rr"," r rr rr r"," r rrr r "," r rrr r "," rr r rrr"," r r rr "," r r r rr"," r r rrr "," r r r "," rr r r rr"," rr rr rr"," r rrr r "," rr rr "," r rr r r"," rr r r rrr"," rrr r "," r rr rr "," r rr r "," r r r rrr"," r r r rr"," rrr rr rr"," r rr rrr "," r rr rr r"," rrr r r rr"," r r r r"," r rr rrr"," r r rrr r"," r rr r r"," r rrr r r"," r r rr r"," rr rrr "," r rr r "," rr rrr r "," r r r r"," rr rr "," r rr rr"," r rr r "," r r rr r"," rr r rr"," rrr rr r "," rr rr rr"," r rr r "," r r r r rr"," rrr r r "," r r rrr "," rrr r rrr "," r r "," r r r "," r r r r"," r rr r"," r rrr r "," r r rr rr"," rrr rr r"," r rr r rr"," r rrr rr"," rr rrr r"," rr r r r"," rr rr r r "," r r rr r"," r rrr r "," r r r rr "," rrr rr r "," r rr r "," r r r r "," rrr rrr rr"," rrr r r "," r r r "," rr rr rrr"," r r r "," rr r rr "," rr r rr r"," rr rr r"," r rrr rrr "," r rr r r"," r rrr r r"," rrr r rr "," rr r r r"," r r r "," rrr rr rrr"," rr r rr "," rrr rr "," rr r rr "," rr r r rr"," rr r r "," r rr r r"," r rr r r"," r r rr r "," r r rr "," r r rr rr "," rr r r"," rrr rr r"," rr r r rr"," r rrr r"," rr r rr r"," r r r r r"," rr r r "," rr rr r"," r r r "," rr r "," r rr r"," r r r rrr"," rr r rr "," rr rr r "," r r rr "," r rr rrr"," r rrr rr"," r rr r r"," r r rrr "," r rr rr "," r rr rr"," rr rrr rr"," r r r "," rr rr r "," r r r r "," rrr r r r "," rr r rr "," rrr rr rr "," r r rr "," r r r rrr"," r r r rr "," rrr rrr "," rr rr r"," r r rr r"," r r r rrr"," r r rr r "," r r r r"," rr rr r rr"," rr r r rr "," r rrr r "," r rr rr"],12:[" rr rr rr r"," r r r rr"," r rr r r "," rr r r rr "," r rr r r"," rrr r r "," r r rr "," rrr rr r "," rr r rr "," rr rr r "," r r r r "," rr r rr r "," r r r rr"," rr rr r rr "," rr r rr "," rrr rr "," r rr r rr"," rrr rr rrr"," r rrr rr "," rr rr r "," r rr r r"," rrr rr rr "," rr r r r "," rrr r r "," r r rr "," r rr rr rr"," r rrr r "," rr rr r"," rr r r r "," rr rr r rr"," rr r r r"," r rr rr"," r r r r"," r rrr rr "," rr r rr "," rrr r r "," r rr rrr"," r rrr rrr "," r rrr rrr "," rr r r rrr"," r rr r r r"," r r r r rr"," r rrr "," r r rr rrr"," rrr r rr r"," r rrr r "," r rr r"," r rrr r "," rr rr r"," r rr r "," rrr r rr"," rr rr "," rrr r rr "," r rr rr r"," r rrr r r "," r r rr rr"," r rr rr r"," rr r r r "," rr r rrr r"," rr r r r"," r r rr rrr"," r rrr rr r"," rr rr r "," r rr r r "," r r r r"," rr rr r r"," rr r rrr"," rr r rr r"," r r r rr "," r rr r "," r rrr r r"," rrr r rr r"," r rrr rr rr"," r rr r r r"," r rr r rr"," rrr r r "," rr rrr rr "," rrr rr "," rrr rrr r"," rrr rr rr"," rrr rr rr"," r r rr rr"," rr r rr "," rr r r "," r rrr r r"," rr rr r "," rr rr rr "," rr r r "," rr r r "," rr rrr r "," rr rr rrr"," rrr r rr "," r r rr rr "," rr r r r "," rrr rr "," r rr r rr"," r r r r r"," r rr r r"," r r rr rr"," r rrr r r "," r rrr r r r"," r r rrr r"," rr r rr r"," r rr r rr "," rrr r r"," rrr r r "," rrr rrr r "," r r r rr "," rr r rr "," r rr rrr"," r rr r "," r r rr "," r r r r"," r r r r r "," r r rrr r"," rr r rr r"," r rr r rr "," r rr rr "," r r r r"," r r r r"," r r r r "," rr r r "," r r r r "," r rr rr "," rr rr r "," rr r rr rr "," rrr rr r "," r r rr r "," rr r rrr "," r rrr rrr"," rr rrr r "," r rr rrr rr"," rr r r"," rr r rr rr"," rr r r"," rrr r r "," r r rrr r "," r rr r rr r"," rrr rr r "," rr rrr r r"," r rrr r r"," rrr rrr rr "," rr rrr rr "," rr r r r"," r rrr r r"," rr r rr"," rr r r r rr"," rr rr r r"," rr rrr rr"," rr r r r"," rrr r rrr "," r r rrr r "," rrr rr r "," rr r r rrr"," r rr rr rrr"," rr r r "," r r rr r "," r rr rrr"," r r r rr rr"," r r rrr "," r r rrr "," rr rrr rrr"," r r rrr "," rr r rr r r"," rr rr rrr"," rrr r rr "," rr rr rr"," r r r r rr"," rr r rrr"," r rr r r r"," rr r r rr "," rrr rrr r"," rrr rr rr "," r r r r "," rr r rrr "," r rrr r r"," r rr r "," rr r r "," r r r rr"," r rrr rr "," r r r r r r"," r r rrr "," rr r rr"," rr r r r "," rr rrr r "," rr rrr r"," r r r "," rrr r rr"," rr rr r"," r rr r "," r rr r "," rr rr rr"," r rr rrr "," r rrr r r"," rr rr r r"," rrr rrr "," r rrr rrr"," rr r rrr r"," rr rr r r"," r rr r r"," r r rrr r"," r r r r"," rr rrr rrr "," r rr r r "," rr rr "," rr r rr "," r rr rrr r"," rr r r r "," rr r r r "," r rr r rr"," r rrr rr r"," rr r r r"," r rr r rrr"," rr r r r r"," rrr rrr r"," r rr rrr "," r r rrr r"," r r rr rr "," r r r r"," rr rr rr "," r rr r r "," r rr rr r"," rrr rrr rr"," rr rrr r r"," r rr r r"," r rr r rrr"," r r rr r"," r r r r r "," r r r r r "," r r r rr"," r r rr r "," r r rr rr"," r r r rrr r"," rr r rr rr"," r r rr r"," r r rr rr"," r r r r"," r r rrr r"," r rrr r rrr"," r r rr rr"," r r r rr"," r rr r "," r rr rrr "," r r r "," rrr r r rr"," r rrr r "," r r r r "," r rr r r"," r r rr r"," r r r rr "," rrr r r"," rr r r "," rrr r r r "," rr r r "," rr rr r "," r rr r r "," r r r rrr"," r rr rr r"," r r r r "," r r r "," r r rrr r r"," r rr r rr"," r rr r "," rrr r r "," r rr rr rr"," r rr r rr"," rr rrr "," rr rrr rr "," rrr r rr "," rrr r rr r"," r r rr rrr "," r r r r r"," rrr r rrr r"," rr r r rr "," rrr r r"," r rr r r"," rr rr r "," rr rr rrr "," r r r rrr"," rr rr rr "," rrr r rrr"," r rr rr r "," r rrr r "," r r rr "," rr r r r "," r r rr "," r r r r "," r rrr r"," rr rrr r "," rr rrr rr "," rr r r r"," rrr rr r"," r r r r rr"," r r rr r"," rrr rr r "," rr rrr rrr"," r rr rr "," rr rr "," r r rrr "," r r rr r"," r r rr r "," r r rr r r "," r r rr rrr"," r rrr rrr"," rrr r r "," r r r r r"," rr rr r rr"," rr r rrr "," rr r r r "," r r r rr"," rrr rr rrr"," r r r rrr"," r r rr r"," r r rr r "," r rrr rr"," r r rrr rr"," r r rr r r"," rr rr r r "," r rrr r"," rrr rr r r"," r rrr rr"," r rrr rr "," r rr r "," rrr r r r"," r r r r r"," r r r r"," r r r r r"," rr r r r"," r r r rr "," rrr rr r "," r rr rr r"," r rrr rr "," r rrr r rr "," rrr r r rr "," rrr rr "," rr r rr r"," r r r "," r rr r "," r rrr r"," rrr r rr r"," rr r rr"," r r rr r r"," r rrr r "," rr r r r"," rr r r "," r r rrr r"," rr rr r r r"," rrr rrr "," rr r r rrr"," rrr rr r"," r rr rrr "," rr r r "," rrr r r "," rr rrr r "," rr r r "," r rrr rrr"," r r rr "," rr rr rrr "," rrr rrr "," rrr r r r "," rrr r r r "," r r r rr"," r r rr r "," r rrr r "," r rr r r"," r r rr "," rr r rrr "," rr rr rr r "," r r r rrr"," r rr rr rr"," r rrr r rr"," rr r r rr"," r r r r"," rr rr rrr "," r rrr r r"," r rr r r r "," r r rr "," r rr r r "," rr rr r "," r rr r "," r rrr rr r"," r r rrr rr"," r r r "," r r r rr"," r r r rrr"," rr r r "," r r rrr "," r r r "," r r r r "," rr rr rr"," r rrr rr"," rr r rrr"," r rr rr r"," r r rr r"," rrr rr r"," r r r r rrr"," r rr rr "," r rr rrr "," rrr rrr r "," rr r r rr"," r r r r "," r r r "," rr rrr r"," r r r r "," rr r r "," r r rr r"," rrr r r r "," rr rr r r "," rrr r r r"," r r r r "," r rr r r"," rrr r "," rr r rr"," r rr rr "," rr rrr "," r r rr r"," rr rr rr"," rrr r rr"," rr r rr "," rrr rr rr"," rrr rr rrr "," r r rr r "," r r r rr "," r rrr r "," r r rrr "," rrr r rr "," rr r rr rr"," r r rr r"," r rr r r r"," r r rr r "," rr rr rrr"," rrr rr rr r"," r rr r "," r r r rr"," rrr rr r"," rr r rrr "," r rr rr r"," r r r rr r"," r rr r "," r r r r r "," rr r rr r "," r r rr r"," rr r r rr"," r r rrr"," r r r rr "," r r r rrr"," rr r rrr"," rrr r r "," r rrr r "," rr rrr rr"," r rr rr "," rr r rrr"," rr r rr "," r r r r r"," rr rr rr "," rr rrr rr"," rr r r "," r r r r "," rr r rr "," rrr r rr "," r rrr r r "," rr r r r r"," r rr r rr"," r rrr rr "," rr rr rr r"," r r r r"," rr rr r "," r r r r "," rr r rr r"," rr r rr r "," r r rr r "," rr rr rr "," rrr r r "," rr r r rr"," r r r "," rr r rrr"," rr r rrr "," r rrr r"," rrr r rrr"," rrr r r r"," rrr r r r"," r r r r"," r rr r rr "," rr r r r "," rr r r r"," r rrr rrr"," rr rr r rrr"," rr r r r "," rr rrr rr r"," rr r r r "," r r rrr r "," rr rrr rrr"," r r r r r "," r rrr rr"," rrr rr r "," r rr r r rr"," rrr r r r "," r rrr "," r rrr r "," r r rrr r"," r rrr r r"," rrr rr r"," rr r r rr r"," rr rr rrr"," r r r r r"," r r rrr "," rr r r r r"," r rr r r "," rr rr rrr r"," r rr rr "," rr rr r "," r r r r "," r rr r r "," rr rr r rr"," r r r "," rrr rrr r "," rr r rrr "," r rr r rr"," rrr rr rr "," rr rr rrr "," rr rr r r"," rr r r r "," r r r r"," rrr r "," r r r"," r rrr r"," r r r r"," r r rr r "," r r rr "," r r r "," rr r r "," r rr rrr"," r r r r "," r r rrr rr"," r r r r r"," r rrr rr"," rr r r r"," r rr rr "," r r rrr rr "," rrr r r r"," r rr r r "," r r rrr "," r rr r"," rr r r rr"," r r r rrr "," r r r r "," rrr r r r"," rr rrr r r"," rrr r rrr"," r rr rrr"," r rr r rrr"," rr rr r "," r rrr r r "," r rr rr"," r rr "," rrr r r rr"," rr rr r "," rr r rr "," r r r rr"," rrr r r "," rrr r r "," r r r r "," r r rrr r"," r r rr r"," r rr r r"," rr rrr r"," r r rr rrr"," r rr r r "," r rrr rrr "," rr rr r rr"," rrr rr r r "," r r r rr r"," rr rrr "," r rrr rrr"," rr rrr r "," rr r r r r"," rrr r rr rr"," r rrr rr"," r rrr r"," rr rr rrr"," r rr rrr "," r r rrr "," r rr rr "," rr rrr r"," r r r rr "," r r r rr "," rr rr rr "," rr r rr rr"," rrr rrr r r"," r rr rr"," r rr r rr "," rrr rr rr"," r r r rrr "," rr rr r r"," r r r rrr "," rrr rr rrr"," r r r r "," rr rr rr "," rr rrr r"," rr r r r "," rrr r rrr"," r rrr r "," rrr r r r"," rrr rr r r"," rrr rr r"," rr rrr r "," rr r r rr"," r r r "," rrr rrr r"," rr r r r"," r r rr "," r r r r rr"," r rrr rr r "," rr rr rr r"," r r rr "," r r r rr r"," r r rr r r"," r rr rr "," r rrr rr "," r r rr rr r"," r r rrr rrr"," rr rrr r "," r r r r r "," r r rr "," r rr r r"," r r rr r"," r r r r"," r rr r "," r r rrr rr"," rrr r rr r "," rrr r rrr"," r rrr rr "," r r rr r "," r rr rrr r"," r rr r r "," rr rr r r "," rr rr r "," r r r r r"," rr r rrr r "," r r rrr "," rr rrr rr"," r r r r"," rrr r r r"," r r r "," r rr rrr"," rr rrr rr"," rr rrr "," r r rr r rr"," r r r r r"," r r r rr "," r r rrr "," r rr rrr r"," rr rr r "," r r r "," r rr rr "," r r r "," r rr rr "," r r r r r"," r r r r "," r r rrr"," r r rr "," r r rr rr "," r rr rr rr "," r r r r"," r r r r"," r rr r "," rr r rr r "," rr rr r"," rr rrr r rr"," rrr rr rr"," r rrr r "," rrr rr r "," r r rrr"," r rr r "," rr rr r"," rrr r rr "," rr r rr r"," r r rrr r "," rr rr r r "," r rr r r"," r rr rr r"," r rr r rr "," rrr r rr"," r r r rrr"," rr r rr r"," rrr rr r"," rr r rrr r"," r rr r r"," rr r rr "," rr rr rr"," r r r r rr "," rr rr rr rr"," rr rrr r"," r rrr rr "," r r rr r"," r r r rrr"," r r rr r "," r r r rr "," r r r rr r "," r rrr r rr"," rrr rr rr "," rrr rrr rr"," r r rr rr"," r r rr "," r rr r r"," rr r r rr "," rr r r rr"," rr rr rr r"," rr r rr"," rr r r r "," r rrr rr "," rr r rr "," rr r rrr"," r rr r r"," rr r rr "," r rrr rrr "," rr r rr r"," rrr rrr "," r r rrr r"," rrr rr r r"," rr r r"," rr rrr rr"," rr r r r"," rr rrr "," rr r rrr rr"," rr r rr "," r rr rrr "," r r rr r r"," rr r r "," r r r "," r r rrr"," r r rr "," r r rrr"," rr r rr r "," rr rr r"," rr rrr r "," r r r "," r r r r"," rr rr r r"," r r r r "," r rr rr r "," rr rr rr "," rrr r rr"," r r rrr "," rrr rrr"," r r r r "," r r r r "," r rr rrr "," r rr rrr r"," rr r r rrr"," r r rrr "," rr r r r"," r r rr"," r rr rr r "," rrr r rr "," rrr r rrr "," rr r rrr "," rr r rrr "," r r r r r"," rrr rrr r"," r r rrr "," r rr r r "," rrr r r r r"," rr r r rrr "," rrr r "," rrr rr "," rrr rrr r "," rr r r r r"," r rr rr rr"," rr rrr r "," r r rr "," r r r r r"," rr rr r "," r r r r "," rr r r r"," rrr rrr "," r r rr r"," r rrr rr"," r r r r "," r r r r "," r r r r "," r rrr r "," r r r rrr"," r rrr r r"," r r rrr r "," r rrr "," r r r rr "," r rr rr "," r r r rr r"," r rr r rrr "," r rrr r r"," r rr rr "," r r r r "," r r rrr r"," rrr r r"," r r r rr"," r r r rrr "," r r r rr"," rr r r rr "," rr r r rr"," r rr rr"," rrr r r rr"," rrr r r "," rrr r rr "," rr rr rrr"," rr rrr r"," r r r rr"," rr r rr "," r r r rr"," r rr rr r r"," r rr r r "," r rr r rr"," r r rr rr"," r r rr rr "," rrr r rrr "," r r rrr "," rr r r r"," rr rrr r r "," rrr rr r rr"," r rr rrr "," r rr r rr"," r r r rrr "," rr r r "," rrr r rrr "," rrr r r r"," rrr r r r"," r r r rr "," r r r r rr"," r rr r r"," rrr r r rr"," rr rr r "," rrr rrr r"," rrr r rr"," r rr rr r"," r rr rr r "," r rr rrr r "," r rr rr"," rr rrr r r"," rr r rr rrr"," rr r r "," r rr r"," r rr r r "," rrr rr r "," r r rr rr "," r rr r "," rr r r rr"," rr r rrr "," rrr r r "," r rrr rrr r"," r r rr r"," r rr rrr "," rrr r rr"," r r r rr "," r rr rr"," rr r rr "," rrr rr r r"," rr r r "," r rrr r "," r r rr rr"," rrr r r"," rr r rr r"," rr r r rr"," r r r rr "," r r rr"," rrr rrr rr"," r r r r r"," rrr rrr "," r r r rr"," rrr r r "," rrr rrr "," rr rr rr"," rrr rr r "," r r r r "," r rrr r "," rrr r r rrr"," r rrr r "," rrr r rr "," r r r r "," rr r "," rr rr rr "," r rr r r "," r r r rr "," r r r r r"," rrr rrr rrr"," r r rr r r"," r r rr rr"," r r r r "," rr rr r r"," r rr rr r"," rrr rr "," rrr r r"," r rr rrr"," r r rr "," rr rr rr "," r r rr r "," r r rr r "," r rr r "," r r rrr"," r r r rr r"," r rrr r rr"," rr rr r r"," rr r rrr r"," rr r rr r"," r rr rr "," rrr r rrr"," r r r rr"," r r rr"," rr r r r"," rr rr r r "," rr rr r r"," rrr rr rr"," r rr rr "," r rrr rr r"," r r rr "," r rrr r r "," r rr r r r"," r r r rrr"," rr r r r r "," rr rr rr"," rr rrr "," r rrr r rr"," r r rr r "," r rr r rrr"," r r rr "," r rr r "," r rr rr r "," rr r rr"]},kie=function(e){return xw.useMemo((function(){var t=Cie[e];return t[Math.floor(Math.random()*t.length)]}),[e])},Sie=function(e){return xw.createElement("svg",Ry({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),xw.createElement("path",{d:"M17.2434 6.06389L17.2438 6.06352C17.4385 5.86879 17.7519 5.86879 17.9467 6.06352C18.1314 6.24826 18.1314 6.57168 17.9467 6.75642L13.0567 11.6464L12.7031 12L13.0567 12.3535L17.9467 17.2435C18.1414 17.4383 18.1414 17.7517 17.9467 17.9464C17.7519 18.1412 17.4385 18.1412 17.2438 17.9464L12.3538 13.0564L12.0002 12.7029L11.6467 13.0564L6.75666 17.9464C6.56192 18.1412 6.24851 18.1412 6.05377 17.9464C5.85903 17.7517 5.85903 17.4383 6.05377 17.2435L10.9438 12.3535L11.2973 12L10.9438 11.6464L6.05377 6.75642C5.85903 6.56168 5.85903 6.24826 6.05377 6.05352C6.24851 5.85879 6.56192 5.85879 6.75666 6.05352L11.6467 10.9435L11.9999 11.2967L12.3534 10.9439L17.2434 6.06389Z",fill:"#5E5E5E",stroke:"#1D1D1D"}))},Eie=xw.createContext({}),Bie=function(e){var t=e.apiCredentials,r=e.children,n=fq.useApiClient({apiCredentials:t}).apiClient;return xw.createElement(Eie.Provider,{value:n},r)};Bie.propTypes={apiCredentials:xC.shape({accessKey:xC.string.isRequired,secretKey:xC.string.isRequired,apiUrl:xC.string.isRequired}),children:xC.node.isRequired},Bie.defaultProps={apiCredentials:{}};var _ie=function(){return xw.useContext(Eie)},xie=function(){var e=[];return{uploadFrameBatch:function(t,r){e.push(r.httpClient.post("/v1/files",{frames:t,metadata:JSON.stringify({type:"selfie"})}))},getAllUploadedBatches:function(){var t=xy(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e);case 2:return r=t.sent,t.abrupt("return",r.map((function(e){var t,r;return{id:null!==(t=null==e||null===(r=e.data)||void 0===r?void 0:r.file_id)&&void 0!==t?t:-1}})));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),resetUploadBatches:function(){e.length=0}}},Tie=xie();function Aie(){this.__data__=new _2,this.size=0}var Iie=Aie;function Pie(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Rie=Pie;function Die(e){return this.__data__.get(e)}var Oie=Die;function Nie(e){return this.__data__.has(e)}var Lie=Nie,Mie=200;function Fie(e,t){var r=this.__data__;if(r instanceof _2){var n=r.__data__;if(!T2||n.length<Mie-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new H2(n)}return r.set(e,t),this.size=r.size,this}var Uie=Fie;function jie(e){var t=this.__data__=new _2(e);this.size=t.size}jie.prototype.clear=Iie,jie.prototype.delete=Rie,jie.prototype.get=Oie,jie.prototype.has=Lie,jie.prototype.set=Uie;var Vie=jie;function zie(e,t,r){(void 0!==r&&!f2(e[t],r)||void 0===r&&!(t in e))&&t4(e,t,r)}var qie=zie;function Hie(e){return function(t,r,n){for(var o=-1,i=Object(t),a=n(t),s=a.length;s--;){var c=a[e?s:++o];if(!1===r(i[c],c,i))break}return t}}var Wie=Hie,Kie=Wie(),Qie=Kie,Gie=o((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?j3.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=i?i(r):new e.constructor(r);return e.copy(n),n}})),Xie=j3.Uint8Array,Yie=Xie;function $ie(e){var t=new e.constructor(e.byteLength);return new Yie(t).set(new Yie(e)),t}var Zie=$ie;function Jie(e,t){var r=t?Zie(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var eae=Jie;function tae(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var rae=tae,nae=Object.create,oae=function(){function e(){}return function(t){if(!h0(t))return{};if(nae)return nae(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),iae=oae;function aae(e){return"function"!=typeof e.constructor||U8(e)?{}:iae(J8(e))}var sae=aae;function cae(e){return i0(e)&&R4(e)}var uae=cae;function lae(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var dae=lae;function fae(e){return s4(e,Q8(e))}var pae=fae;function hae(e,t,r,n,o,i,a){var s=dae(e,r),c=dae(t,r),u=a.get(c);if(u)qie(e,r,u);else{var l=i?i(s,c,r+"",e,t,a):void 0,d=void 0===l;if(d){var f=N3(c),p=!f&&J4(c),h=!f&&!p&&R8(c);l=c,f||p||h?N3(s)?l=s:uae(s)?l=rae(s):p?(d=!1,l=Gie(c,!0)):h?(d=!1,l=eae(c,!0)):l=[]:s6(c)||Y4(c)?(l=s,Y4(s)?l=pae(s):h0(s)&&!w0(s)||(l=sae(c))):d=!1}d&&(a.set(c,l),o(l,c,n,i,a),a.delete(c)),qie(e,r,l)}}var mae=hae;function gae(e,t,r,n,o){e!==t&&Qie(t,(function(i,a){if(o||(o=new Vie),h0(i))mae(e,t,a,r,gae,n,o);else{var s=n?n(dae(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),qie(e,a,s)}}),Q8)}var vae=gae,yae=j4((function(e,t,r){vae(e,t,r)})),bae=yae,wae=xw.createContext({}),Cae={},kae=function(e){var t=e.children,r=e.clientSettings,n=e.apiCheck,o=Ky(xw.useState({}),2),i=o[0],a=o[1],s=_ie();xw.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"function"==typeof s.clientSettings){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,s.clientSettings();case 5:t=e.sent,a(t),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),console.error(e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}n&&function(){e.apply(this,arguments)}()}),[n,s]);var c=Cae;return Object.keys(r).length>0?c=r:n&&(c=i),xw.createElement(wae.Provider,{value:c},t)};kae.propTypes={children:xC.node.isRequired,clientSettings:xC.shape({}),apiCheck:xC.bool},kae.defaultProps={clientSettings:{},apiCheck:!1};var Sae=function(){return xw.useContext(wae)},Eae={data:{settings:{sdk_settings:{flash_liveness_settings:{capture_frame_settings:{enable:!1,frames_batch_length:10,frames_interval_time:0,frame_quality:.8,frame_scale:1},close_eyes_settings:{enable:!1,timeout:5},face_settings:{close_face_ratio:.82,max_far_face_ratio:.9,min_far_face_ratio:.8,mobile:{close_face_ratio:.95,max_far_face_ratio:.9,min_far_face_ratio:.85}},flash_settings:{colors_length:10,flash_color:"rgb(255, 0, 0)",delay_between_colors:120,flash_intensity:1,frames_per_color:4,use_face_detector_when_flashing:!1},liveness_settings:{enable_far_step:!0},timeout_settings:{enable:!0,total:30,countdown:10},exif_data_settings:{enable:!0},mask_settings:{chin_to_mask_bottom_padding:20,large_scale:.85,mobile:{chin_to_mask_bottom_padding:20,large_scale:.9,oval_padding:{bottom:20,left:20,right:20,top:0},oval_vertical_offset:60,small_scale:.65},oval_padding:{bottom:20,left:30,right:30,top:0},oval_vertical_offset:0,small_scale:.6},image_settings:{valid_face_ratio:.6,image_quality:1,crop_center_far:!0,crop_center_close:!1},blur_far_settings:{enable:!0,blurry_threshold:.4,wait_for_best_image_time_ms:1e3},blur_close_settings:{enable:!0,blurry_threshold:.4,wait_for_best_image_time_ms:1e3}}}}}},Bae=function(){var e=Sae();return xw.useMemo((function(){var t=bae({},Eae,e);return{captureFrameSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.enable"),framesIntervalTime:y1(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frames_interval_time"),framesBatchLength:y1(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frames_batch_length"),frameScale:y1(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_scale"),frameQuality:y1(t,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_quality")},livenessSettings:{enableFarStep:y1(t,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.enable_far_step")},flashSettings:{flashColor:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_color"),colorsLength:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.colors_length"),delayBetweenColors:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.delay_between_colors"),framesPerColor:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.frames_per_color"),flashIntensity:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_intensity"),useFaceDetectorWhenFlashing:y1(t,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.use_face_detector_when_flashing")},maskSettings:{smallScale:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.small_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.small_scale"),largeScale:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.large_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.large_scale"),ovalPadding:{left:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.left":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.left"),right:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.right":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.right"),top:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.top":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.top"),bottom:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_padding.bottom":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_padding.bottom")},ovalVerticalOffset:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.oval_vertical_offset":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.oval_vertical_offset"),chinToMaskBottomPadding:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.chin_to_mask_bottom_padding":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.chin_to_mask_bottom_padding")},faceSettings:{minFarFaceRatio:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.min_far_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.min_far_face_ratio"),maxFarFaceRatio:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.max_far_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.max_far_face_ratio"),closeFaceRatio:y1(t,b1.isMobile?"data.settings.sdk_settings.flash_liveness_settings.face_settings.mobile.close_face_ratio":"data.settings.sdk_settings.flash_liveness_settings.face_settings.close_face_ratio")},closeEyesSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.enable"),timeout:y1(t,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.timeout")},exifSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.exif_data_settings.enable")},imageSettings:{imageQuality:y1(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_quality"),validFaceRatio:y1(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.valid_face_ratio"),enableCropCenterFar:y1(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.crop_center_far"),enableCropCenterClose:y1(t,"data.settings.sdk_settings.flash_liveness_settings.image_settings.crop_center_close")},timeoutSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.timeout_settings.enable"),total:y1(t,"data.settings.sdk_settings.flash_liveness_settings.timeout_settings.total"),countdown:y1(t,"data.settings.sdk_settings.flash_liveness_settings.timeout_settings.countdown")},blurCheckFarSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_far_settings.enable"),threshold:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_far_settings.blurry_threshold"),duration:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_far_settings.wait_for_best_image_time_ms")},blurCheckCloseSettings:{enable:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_close_settings.enable"),threshold:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_close_settings.blurry_threshold"),duration:y1(t,"data.settings.sdk_settings.flash_liveness_settings.blur_close_settings.wait_for_best_image_time_ms")}}}),[e])},_ae=function(e){return Array.isArray(e)?e.map((function(e){return{base64:e.base64,label:e.label,index:e.index,metadata:e.metadata}})):e},xae=function(e){var t=e.maskBoundingBox,r=e.faceRatio,n=e.validFaceRatio,o=e.video,i=e.shouldCropCenterSquare,a=void 0===i||i,s=e.cropArea,c=e.frame,u=t.width*r/n,l=u/t.width,d=t.height*l,f={x:t.x-(u-t.width)/2,y:t.y-(d-t.height)/2,width:u,height:d};f.x+f.width>s.x+s.width&&(f.width=s.width,f.x=s.x),f.y+f.height>s.y+s.height&&(f.height=s.height,f.y=s.y);var p=null;if(a){var h=Math.min(f.width,f.height),m={x:f.x+f.width/2,y:f.y+f.height/2},g={x:m.x-h/2,y:m.y-h/2,width:h,height:h};p=xV.analyzeVideoAndWindowSizes(o,g)}else p=xV.analyzeVideoAndWindowSizes(o,f);var v=jne({size:{width:p.cropWidth,height:p.cropHeight},baseSize:400,video:o}),y=_ne({width:v.width,height:v.height,cameraScale:1}),b=y.width,w=y.height;return y.getContext("2d").drawImage(c,p.cropX,p.cropY,p.cropWidth,p.cropHeight,0,0,b,w),y},Tae=xw.createContext({enable:!1,key:""}),Aae=function(e){var t=e.children,r=e.settings,n=xw.useMemo((function(){var e,t=null!==(e=null==r?void 0:r.key)&&void 0!==e?e:"";return{enable:!!t,key:t}}),[null==r?void 0:r.key]);return xw.createElement(Tae.Provider,{value:n},t)};Aae.propTypes={children:xC.node.isRequired,settings:xC.shape({key:xC.string})},Aae.defaultProps={settings:{key:""}};var Iae,Pae,Rae,Dae,Oae,Nae,Lae,Mae,Fae,Uae,jae,Vae,zae,qae,Hae=function(){return xw.useContext(Tae)},Wae=function(e,t){var r=null,n=null,o=function(){return null!==n&&performance.now()-n>t};return{checkIsTimeUp:o,compareAndStoreResult:function(t){(null===r&&(r=t,n=performance.now()),o())||e(r,t)&&(r=t)},getBestResult:function(){return r},reset:function(){r=null,n=null}}},Kae=function(e){var t=e.compareFn,r=e.duration,n=xw.useRef(null),o=xw.useMemo((function(){return Wae(t,r)}),[t,r]),i=o.compareAndStoreResult,a=o.getBestResult,s=o.reset,c=xw.useCallback((function(){return null!==n.current}),[]),u=xw.useCallback((function(e){var t=e.onTimeout,o=e.initialFrame;i(o),n.current=setTimeout((function(){var e=a();t(e),s(),n.current=null}),r)}),[i,r,a,s]);return xw.useEffect((function(){return function(){clearTimeout(n.current)}}),[]),xw.useMemo((function(){return{compareAndStoreResult:i,getBestResult:a,isAutoCapturing:c,startCapturing:u}}),[i,a,c,u])},Qae=function(e){var t=document.createElement("canvas");return t.setAttribute("width",e.videoWidth),t.setAttribute("height",e.videoHeight),t.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),t},Gae=(dB.div(Iae||(Iae=Wy(["\n color: #ffffff;\n"]))),dB.div(Pae||(Pae=Wy(["\n ","\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.title.hidden",noe)?YE(["display:none;"]):YE(["display:flex;justify-content:center;align-items:center;width:100%;height:","};color:",";font-size:",";font-weight:",";"],t5(t,"FlashLiveness.title.height",noe),t5(t,"FlashLiveness.title.color",noe),t5(t,"FlashLiveness.title.fontSize",noe),t5(t,"FlashLiveness.title.fontWeight",noe))}))),Xae=dB(Coe)(Rae||(Rae=Wy(["\n z-index: 2010;\n width: 100%;\n height: 100%;\n opacity: 1;\n margin: 0;\n"]))),Yae=dB(uoe)(Dae||(Dae=Wy(["\n margin-block-start: 12px;\n z-index: ",";\n width: fit-content;\n\n & svg {\n margin-inline-end: 8px;\n width: 24px;\n height: 24px;\n }\n\n ","\n"])),s5+2,(function(e){var t=e.theme;return e.$flashing?YE(["transform:translateY(45vh);font-size:",";color:",";font-weight:",";background:rgba(0,0,0,0.35);border-radius:",";border:",";padding:",";"],t5(t,"FlashLiveness.guideline.text.flashing.fontSize",noe),t5(t,"FlashLiveness.guideline.text.flashing.color",noe),t5(t,"FlashLiveness.guideline.text.flashing.fontWeight",noe),t5(t,"FlashLiveness.guideline.text.flashing.borderRadius",noe),t5(t,"FlashLiveness.guideline.text.flashing.border",noe),t5(t,"FlashLiveness.guideline.text.flashing.padding",noe)):YE(["font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";padding:",";"],t5(t,"FlashLiveness.guideline.text.normal.fontSize",noe),t5(t,"FlashLiveness.guideline.text.normal.color",noe),t5(t,"FlashLiveness.guideline.text.normal.fontWeight",noe),t5(t,"FlashLiveness.guideline.text.normal.background",noe),t5(t,"FlashLiveness.guideline.text.normal.borderRadius",noe),t5(t,"FlashLiveness.guideline.text.normal.border",noe),t5(t,"FlashLiveness.guideline.text.normal.padding",noe))})),$ae=dB(Sie)(Oae||(Oae=Wy(["\n ","\n"])),(function(e){var t=e.theme;return YE(["z-index:1001;cursor:pointer;position:fixed;top:",";right:",";left:",";bottom:",";display:",";"],t5(t,"closeButton.top",e5),t5(t,"closeButton.right",e5),t5(t,"closeButton.left",e5),t5(t,"closeButton.bottom",e5),t5(t,"closeButton.display",e5))})),Zae=dB.div(Nae||(Nae=Wy(["\n width: 100vw;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n background-color: ",";\n opacity: ",";\n z-index: ",";\n"])),(function(e){return e.$backgroundColor}),(function(e){return e.$intensity}),s5+1),Jae=dB.div(Lae||(Lae=Wy(["\n background-color: ",";\n opacity: ",";\n width: 100vw;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.errorOverlay.backgroundColor",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.errorOverlay.opacity",noe)})),ese=dB(aoe)(Mae||(Mae=Wy(["\n margin-block-start: 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n width: 300px;\n z-index: 1002;\n"])),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.mainColor",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.fontSize",noe)}),(function(e){var t=e.theme;return t5(t,"FlashLiveness.progressBar.fontWeight",noe)})),tse=dB.div(Fae||(Fae=Wy(["\n position: fixed;\n z-index: ",";\n top: 0;\n left: 50%;\n transform: translate(-50%);\n min-width: 250px;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-between;\n"])),s5+2),rse=dB.div(Uae||(Uae=Wy(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),nse=dB.div(jae||(jae=Wy(["\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n"]))),ose=b1.isMobile?{width:{ideal:640},whiteBalanceMode:"none"}:{width:{ideal:9999},whiteBalanceMode:"none"},ise=function(e,t){return!(!e.isEyeClosed||t.isEyeClosed)||!(!e.isEyeClosed&&t.isEyeClosed)&&BV.hasBetterBlurScore(t.blurScore,e.blurScore)};function ase(e){var t,r=e.onReset,n=e.onFlashDone,o=e.apiCheck,i=e.onClose,a=e.onError,s=e.frontCamera,c=e.styledComponent,u=e.onFramesCaptured,l=Bae(),d=l.maskSettings,f=l.flashSettings,p=l.faceSettings,h=l.closeEyesSettings,m=l.livenessSettings,g=l.captureFrameSettings,v=l.exifSettings,y=l.imageSettings,b=l.timeoutSettings,w=l.blurCheckFarSettings,C=l.blurCheckCloseSettings;if(d.smallScale>d.largeScale)throw new Error("smallScale must be smaller than largeScale");var k=_ie(),S=g.framesIntervalTime,E=xw.useRef(),B=hie(),_=pie(),x=xw.useContext(Rne),T=f.colorsLength,A=f.framesPerColor,I=f.delayBetweenColors,P=f.useFaceDetectorWhenFlashing,R=f.flashIntensity,D=f.flashColor,O=kie(T),N=mB(),L=Zne(S),M=xw.useRef(null),F=Ky(Boe(),4),U=F[0],j=F[1],V=F[2],z=F[3],q=Ky(xw.useState(0),2),H=q[0],W=q[1],K=Ky(xw.useState(mne.LOADING),2),Q=K[0],G=K[1],X=Ky(xw.useState(""),2),Y=X[0],$=X[1],Z=Ky(xw.useState(!1),2),J=Z[0],ee=Z[1],te=xw.useRef({frames:[],images:[],total:(t={},Py(t,gne.FAR_FACE,0),Py(t,gne.CLOSE_FACE,0),t)}),re=xw.useRef(!1),ne=Hae(),oe=Kae({compareFn:ise,duration:w.duration}),ie=Kae({compareFn:ise,duration:C.duration}),ae=Ky(xw.useState(!1),2),se=ae[0],ce=ae[1],ue=_oe({mode:lW.MODE.SELFIE,enableWriteExif:v.enable}),le=ue.prepareExifData,de=ue.writeExifData,fe=ue.addExifData,pe=Ky(xw.useState(!1),2),he=pe[0],me=pe[1],ge=xw.useCallback((function(){$(_("move_face_into_frame"))}),[_]),ve=Qne({onVideoPlayed:ge}),ye=ve.onVideoPlayed,be=ve.cropArea,we=ve.isPlaying,Ce=koe(d,voe,{width:be.width,height:be.height}),ke=Ce.smallScale,Se=Ce.largeScale,Ee=xw.useMemo((function(){return G5((function(e){var t=e.reason;te.current.frames=[],te.current.images=[],te.current.total[gne.FAR_FACE]=0,te.current.total[gne.CLOSE_FACE]=0,Tie.resetUploadBatches(),m.enableFarStep&&(W(ke),G(mne.FAR_FACE)),$(_("move_face_into_frame")),ee(!1),re.current=!1,r({reason:t})}),200,{leading:!0})}),[W,ke,_,m.enableFarStep,r]),Be=xw.useCallback((function(){me(!0)}),[]),_e=xw.useCallback((function(){me(!1),Ee({reason:Cne.timeout})}),[Ee]),xe=Soe({offset:d.ovalVerticalOffset,ovalPadding:d.ovalPadding,largeScale:Se,maskHeight:be.height,ovalHeight:voe.height}),Te=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,i,s,c,l,f,h,v,b,w,C;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(G(mne.STOP_DECTECTING),$(""),B("selfie_flash","user_activity.finish_flash"),B("selfie_flash","user_activity",(function(e){return{flash_liveness_in_ms:e.lastTimeLog-E.current}})),t=te.current.frames,g.enable&&g.framesBatchLength>0&&0!==(r=t.length%g.framesBatchLength)&&(i=t.slice(-1*r),"function"==typeof u&&u(i),o&&Tie.uploadFrameBatch(_ae(i),k)),!m.enableFarStep){e.next=10;break}return e.next=9,te.current.images[wne].blob;case 9:te.current.images[wne].blob=e.sent;case 10:return e.next=12,te.current.images[bne].blob;case 12:return te.current.images[bne].blob=e.sent,le(),fe("selfie_type",uL.Mode.FLASH),fe("number_of_frames",{far_frames:te.current.total[gne.FAR_FACE],close_frames:te.current.total[gne.CLOSE_FACE]}),fe("flash_liveness_in_ms",Math.round(performance.now()-E.current)),fe("flash_settings",{delay_between_colors:I,flash_color:D}),fe("face_settings",{close_face_ratio:p.closeFaceRatio,max_far_face_ratio:p.maxFarFaceRatio,min_far_face_ratio:p.minFarFaceRatio}),fe("mask_settings",{oval_vertical_offset:d.ovalVerticalOffset,small_scale:d.smallScale,large_scale:d.largeScale}),fe("image_settings",{valid_face_ratio:y.validFaceRatio}),e.next=23,Promise.all([de({imageData:te.current.images[wne]}),de({imageData:te.current.images[bne]})]);case 23:if(s=e.sent,c=Ky(s,2),l=c[0],f=c[1],m.enableFarStep&&(te.current.images[wne].blob=l),te.current.images[bne].blob=f,!ne.enable){e.next=45;break}if(!m.enableFarStep){e.next=41;break}return e.next=33,Promise.all([Wq.encrypt({blob:te.current.images[wne].blob,key:ne.key}),Wq.encrypt({blob:te.current.images[bne].blob,key:ne.key})]);case 33:h=e.sent,v=Ky(h,2),b=v[0],w=v[1],te.current.images[wne].encrypted=b,te.current.images[bne].encrypted=w,e.next=45;break;case 41:return e.next=43,Wq.encrypt({blob:te.current.images[bne].blob,key:ne.key});case 43:C=e.sent,te.current.images[bne].encrypted=C;case 45:if(te.current.images=te.current.images.filter((function(e){return!!e})),e.prev=46,"function"!=typeof n){e.next=50;break}return e.next=50,n({images:te.current.images,frames:te.current.frames},{colors:O,flashColor:D});case 50:e.next=55;break;case 52:e.prev=52,e.t0=e.catch(46),a({error:e.t0});case 55:case"end":return e.stop()}}),e,null,[[46,52]])}))),[B,g.enable,g.framesBatchLength,m.enableFarStep,le,fe,I,D,p.closeFaceRatio,p.maxFarFaceRatio,p.minFarFaceRatio,d.ovalVerticalOffset,d.smallScale,d.largeScale,y.validFaceRatio,de,ne.enable,ne.key,u,o,k,n,O,a]),Ae=Wne({colors:O,onFlashDone:Te,framesPerColor:A,flashColor:D}),Ie=Ae.flashingColors,Pe=Ae.currentColor,Re=Ae.colorIndex,De=Ae.startFlashing,Oe=Ae.goToNextColor,Ne=Ae.colorIndexRef,Le=xw.useCallback((function(){m.enableFarStep&&0===te.current.total[gne.FAR_FACE]&&(re.current=!0,ee(!0)),te.current.total[gne.FAR_FACE]+=1}),[m.enableFarStep]),Me=xw.useMemo((function(){return{x:Math.max(null==j?void 0:j.left,0),y:Math.max(null==j?void 0:j.top,0),width:Math.min((null==j?void 0:j.right)-(null==j?void 0:j.left),be.width),height:Math.min((null==j?void 0:j.bottom)-(null==j?void 0:j.top),be.height)}}),[be.height,be.width,null==j?void 0:j.bottom,null==j?void 0:j.left,null==j?void 0:j.right,null==j?void 0:j.top]),Fe=xw.useCallback((function(e){var t=e.frame;if(!te.current.images[wne]){var r=function(e){var t=xae({maskBoundingBox:Me,faceRatio:e.faceRatio,validFaceRatio:y.validFaceRatio,video:M.current,shouldCropCenterSquare:y.enableCropCenterFar,cropArea:be,frame:e.snapshot});te.current.images[wne]={blob:xV.takePicture({canvas:t,quality:y.imageQuality}),gesture:"frontal",captureTime:e.captureTime,selfieLabel:gne.FAR_FACE,blurScore:e.blurScore},W(Se),z(!0),G(mne.CLOSE_FACE),$(_("move_face_closer"))},n={blurScore:t.blurScore,isEyeClosed:t.isEyeClosed,faceRatio:t.faceRatio,snapshot:Qae(M.current),captureTime:Date.now()};if(w.enable)return oe.isAutoCapturing()?void oe.compareAndStoreResult(n):(ce(!0),void oe.startCapturing({onTimeout:function(e){ce(!1),r(e)},initialFrame:n}));r(n)}}),[w.enable,oe,Me,y.validFaceRatio,y.enableCropCenterFar,y.imageQuality,be,Se,z,_]),Ue=xw.useCallback((function(e){var t=e.frame;if(!te.current.images[bne]){var r=function(e){var t=xae({maskBoundingBox:Me,faceRatio:e.faceRatio,validFaceRatio:y.validFaceRatio,video:M.current,shouldCropCenterSquare:y.enableCropCenterClose,cropArea:be,frame:e.snapshot});te.current.images[bne]={blob:xV.takePicture({canvas:t,quality:y.imageQuality}),gesture:"frontal",captureTime:e.captureTime,selfieLabel:gne.CLOSE_FACE,blurScore:e.blurScore},ee(!1),G(mne.START_FLASHING),De()},n={blurScore:t.blurScore,isEyeClosed:t.isEyeClosed,faceRatio:t.faceRatio,snapshot:Qae(M.current),captureTime:Date.now()};if(C.enable)return ie.isAutoCapturing()?void ie.compareAndStoreResult(n):(ce(!0),void ie.startCapturing({onTimeout:function(e){ce(!1),r(e)},initialFrame:n}));r(n)}}),[C.enable,ie,Me,y.validFaceRatio,y.enableCropCenterClose,y.imageQuality,be,De]),je=Re!==Hne&&Q===mne.START_FLASHING,Ve=xw.useCallback((function(e){var t=e.prediction,r=e.canvas,n=e.landmarks;if(je){var i=te.current.frames,a=Gne({prediction:t,canvas:r,landmarks:n,index:i.length,quality:g.frameQuality});if(a.metadata=JSON.stringify({color:Pe,type:gne.FLASHING,time:Math.round(performance.now()),colorIndex:Ne.current}),i.push(a),g.enable&&g.framesBatchLength>0&&i.length%g.framesBatchLength==0){var s=i.slice(-1*g.framesBatchLength);"function"==typeof u&&u(s),o&&Tie.uploadFrameBatch(_ae(s),k)}Oe()}}),[o,k,g.enable,g.frameQuality,g.framesBatchLength,Pe,Oe,je,u,Ne]),ze=xw.useCallback((function(e){var t=e.error;"no_face"!==t&&"multiple_faces"!==t||"no_face"===t&&re.current&&Ee({reason:Cne.no_face})}),[Ee]),qe=xw.useCallback((function(e){var t=e.prediction,r=e.canvas,n=e.landmarks,i=te.current.frames;m.enableFarStep||0!==i.length||(re.current=!0,ee(!0));var a=Gne({prediction:t,canvas:r,landmarks:n,index:i.length,quality:g.frameQuality});if(a.metadata=JSON.stringify({color:"",type:gne.CLOSE_FACE,time:Math.round(performance.now()),colorIndex:Ne.current}),i.push(a),te.current.total[gne.CLOSE_FACE]+=1,g.enable&&g.framesBatchLength>0&&i.length%g.framesBatchLength==0){var s=i.slice(-1*g.framesBatchLength);"function"==typeof u&&u(s),o&&Tie.uploadFrameBatch(_ae(s),k)}}),[o,k,g.enable,g.frameQuality,g.framesBatchLength,m.enableFarStep,u,Ne]),He=xw.useMemo((function(){return Re===Hne?L:Re%A==0?Ie[Re-1]===Ie[Re]?L:Math.max(I,L):L}),[Re,I,Ie,L,A]),We=zne({onError:a,isVideoPlaying:we,step:Q,cropArea:be,videoRef:M,onFarFaceDetected:Le,onFarFullFaceDetected:Fe,onCloseFaceDetected:qe,onCloseFullFaceDetected:Ue,onFlashingFramesCaptured:Ve,frameInterval:He,useFaceDetectorWhenFlashing:P,onFaceError:ze,faceSettings:p,maskBoundingRect:j,shouldPauseFaceDetection:V||he,maskSettings:d,closeEyesSettings:h,captureFrameSettings:g,blurSettings:{blurCheckFarSettings:w,blurCheckCloseSettings:C},shouldContinueOnError:se}),Ke=We.faceError,Qe=We.warmupDone;Eoe(M.current);mie((function(){m.enableFarStep?(G(mne.FAR_FACE),W(ke)):(G(mne.CLOSE_FACE),W(Se)),E.current||(E.current=performance.now())}),Qe&&we),mie((function(){return B("selfie_flash","user_activity.start")}),!0),mie((function(){return B("selfie_flash","user_activity.start_far")}),Q===mne.FAR_FACE),mie((function(){return B("selfie_flash","user_activity.start_close")}),Q===mne.CLOSE_FACE),mie((function(){return B("selfie_flash","user_activity.start_flash")}),Q===mne.START_FLASHING);var Ge=Re===Hne?0:Math.min(Math.round((Re+1)/(O.length*A)*100),100),Xe=c.CloseCameraButton,Ye=c.Loading;return xw.createElement(xw.Fragment,null,xw.createElement(w5,{frontCamera:s,onVideoPlayed:ye,onClose:i,flipHorizontal:s,ref:M,onError:a,videoSettings:ose,closeButton:null!=Xe?Xe:xw.createElement($ae,null)},xw.createElement(goe,{overlay:!Qe||!we,loadingComponent:Ye},""!==Ke&&xw.createElement(Jae,null),xw.createElement(x5,{x:"".concat(Math.round(be.x),"px"),y:"".concat(Math.round(be.y),"px"),width:"".concat(be.width,"px"),height:"".concat(be.height,"px"),surroundStyle:{background:t5(N,"FlashLiveness.maskFill",noe)}},xw.createElement(Xae,{ref:U,scale:H,debug:x,width:be.width,height:be.height,padding:d.ovalPadding,verticalOffset:xe,ovalMaskFillColor:t5(N,"FlashLiveness.maskFill",noe)}),xw.createElement(nse,null,""!==Ke&&Q!==mne.FLASHING&&xw.createElement(foe,null,_(Ke)))))),xw.createElement(tse,null,xw.createElement(rse,null,Qe&&we&&Q!==mne.START_FLASHING&&xw.createElement(Gae,null,_("face_authentication")),Q!==mne.LOADING&&Y&&xw.createElement(Yae,{$flashing:Q===mne.START_FLASHING},Q===mne.START_FLASHING?_("hold_still"):xw.createElement(xw.Fragment,null,xw.createElement(Jne,{iconColor:t5(N,"FlashLiveness.guideline.icon.color",noe)})," ",Y)),Q===mne.START_FLASHING&&xw.createElement(ese,{value:Ge,max:100})),xw.createElement(wie,{onTimeout:Be,onWarningMessageTimeout:_e,timeout:b.total,shouldStart:b.enable&&J,shouldStop:b.enable&&!J,timeLeftThreshold:b.countdown})),Q===mne.START_FLASHING&&xw.createElement(Zae,{$backgroundColor:Pe,$intensity:R}))}var sse=dB.div(Vae||(Vae=Wy(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100%;\n\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n\n z-index: 1001;\n"]))),cse=dB.div(zae||(zae=Wy(["\n & > img {\n width: 100%;\n }\n\n ","\n"])),Bte),use=dB.p(qae||(qae=Wy(["\n color: #1d1d1d;\n font-size: 20px;\n"]))),lse=function(e){var t=e.loading,r=Jj.useAsset("loader.jpg"),n=pie();return t?xw.createElement(sse,null,xw.createElement(cse,null,xw.createElement("img",{src:r,className:"spin",alt:"loading-icon"})),xw.createElement(use,null,n("processing_result"))):null};function dse(e){var t=e.outputEncryptionSettings,r=_ie();return{verifyFlashLiveness:xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var o,i,a,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.videos,i=n.images,a=n.enableFarStep,s=n.metadata,e.prev=1,e.next=4,Promise.all(i.map((function(e){var n;return t.enable?r.httpClient.post("/v1/images",{label:"portrait",base64:null===(n=e.encrypted)||void 0===n?void 0:n.hex,metadata:JSON.stringify({label:e.selfieLabel})},{"X-TV-Key":t.key}):r.uploadImage({label:"portrait",file:e.blob,metadata:JSON.stringify({label:e.selfieLabel})})})));case 4:return c=e.sent,u=[r.verifyFaceLiveness({images:c.map((function(e){var t;return{id:null==e||null===(t=e.data)||void 0===t?void 0:t.image_id,label:"portrait"}})),videos:o,metadata:s,selfie_type:uL.Mode.FLASH})],a&&u.push(r.requestVerifyPortrait({image:{id:null===(l=c[wne])||void 0===l||null===(d=l.data)||void 0===d?void 0:d.image_id},selfie_type:uL.Mode.FLASH})),e.next=9,Promise.all(u);case 9:return f=e.sent,p=Ky(f,2),h=p[0],m=p[1],e.abrupt("return",{uploadedImages:c,faceLivenessResult:h,portraitResult:m});case 16:return e.prev=16,e.t0=e.catch(1),console.error(e.t0),e.abrupt("return",{});case 20:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),[r,t.enable,t.key])}}lse.propTypes={loading:xC.bool},lse.defaultProps={loading:!1};var fse=["apiCheck","onLivenessDetectionDone","frontalMinSize"],pse=function(e){var t=e.apiCheck,r=e.onLivenessDetectionDone,n=e.frontalMinSize,o=Vy(e,fse),i=Ky(xw.useState(!1),2),a=i[0],s=i[1],c=dse({outputEncryptionSettings:Hae()}).verifyFlashLiveness,u=Bae(),l=u.captureFrameSettings,d=u.flashSettings,f=u.livenessSettings,p=l.framesIntervalTime,h=f.enableFarStep,m=e.onError,g=function(){var e=xy(regeneratorRuntime.mark((function e(o,i){var a,u,f,g,v,y,b,w,C,k,S,E;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a={flash_color:i.flashColor,colors:i.colors,frames_per_color:d.framesPerColor,frame_interval:p,delay_between_colors:d.delayBetweenColors,use_face_detector_when_flashing:d.useFaceDetectorWhenFlashing},u=o.images.filter((function(e){return"frontal"===e.gesture})),f=u.map((function(e){return e.blob})),g=u.map((function(e){return e.encrypted})),!(v=f[wne])||"number"!=typeof n){e.next=11;break}return e.next=8,Jz.scaleImage(v,{minsize:n});case 8:e.t0=e.sent,e.next=12;break;case 11:e.t0=null;case 12:if(y=e.t0,t){e.next=17;break}return e.next=16,r({capturedFrames:o.frames,frontalFaces:f,frontalFacesEncrypted:g,frontalScaledImage:y,steps:[],metadata:a});case 16:return e.abrupt("return");case 17:if(e.prev=17,s(!0),w=null,!l.enable){e.next=26;break}return e.next=23,Tie.getAllUploadedBatches();case 23:w=e.sent,e.next=27;break;case 26:w=[{frames:_ae(o.frames)}];case 27:return e.next=29,c({videos:w,images:o.images,enableFarStep:h,metadata:a});case 29:if(C=e.sent,k=C.uploadedImages,S=C.faceLivenessResult,E=C.portraitResult,Tie.resetUploadBatches(),s(!1),!S.errors){e.next=37;break}throw S.errors;case 37:if(null==E||!E.errors){e.next=39;break}throw E.errors;case 39:return e.next=41,r({capturedFrames:o.frames,steps:[],frontalFaces:f.map((function(e,t){var r,n;return{blob:e,id:null===(r=k[t])||void 0===r||null===(n=r.data)||void 0===n?void 0:n.image_id}})),frontalFacesEncrypted:g,frontalScaledImage:y,apiCheckPassed:S.data.is_live,verifyFaceLivenessResult:S.data,verifyPortraitResult:null!==(b=null==E?void 0:E.data)&&void 0!==b?b:null});case 41:e.next=48;break;case 43:e.prev=43,e.t1=e.catch(17),console.error(e.t1),s(!1),m({error:e.t1});case 48:case"end":return e.stop()}}),e,null,[[17,43]])})));return function(t,r){return e.apply(this,arguments)}}();return xw.createElement(xw.Fragment,null,xw.createElement(ase,Ry({},o,{apiCheck:t,onFlashDone:g})),t&&xw.createElement(lse,{loading:a}))},hse=function(e){var t=e.value,r=e.children,n=Sae(),o=y1(n,"data.settings.sdk_settings.server_log_settings.enable"),i=null!=o?o:null==t?void 0:t.enable;return xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy(Oy({},t),{},{enable:i})}},r)};hse.propTypes={value:xC.shape({enable:xC.bool,accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}).isRequired,children:xC.node.isRequired};var mse,gse=function(e){var t=e.apiCheck,r=e.debug,n=e.clientSettings,o=e.apiCredentials,i=e.logCredentials,a=e.customTheme,s=e.outputEncryptionSettings;return xw.createElement(Dne,{debug:r},xw.createElement(Bie,{apiCredentials:o},xw.createElement(kae,{apiCheck:t,clientSettings:n},xw.createElement(hne,null,xw.createElement(cB,{theme:a},xw.createElement(die,null,xw.createElement(hse,{value:Oy({enable:!0},i)},xw.createElement(Aae,{settings:s},xw.createElement(pse,e)))))))))};gse.propTypes={apiCheck:xC.bool,apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),onReset:xC.func,onLivenessDetectionDone:xC.func,onClose:xC.func,onError:xC.func,onFramesCaptured:xC.func,frontCamera:xC.bool,styledComponent:xC.shape({CloseCameraButton:xC.node}),clientSettings:xC.shape({}),logCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string,userId:xC.string,logSignature:xC.shape({logUrl:xC.string,timestamp:xC.string,signature:xC.string})}),debug:xC.bool,customTheme:xC.shape({}),outputEncryptionSettings:xC.shape({key:xC.string}),frontalMinSize:xC.number},gse.defaultProps={apiCheck:!1,apiCredentials:{},onReset:function(){},onLivenessDetectionDone:function(){},onClose:function(){},onError:function(){},onFramesCaptured:function(){},frontCamera:!0,styledComponent:{CloseCameraButton:null},clientSettings:{},logCredentials:{},debug:!1,customTheme:{},outputEncryptionSettings:{key:""},frontalMinSize:null};var vse,yse,bse=KV.faceTracker(),wse=new Kq,Cse=uL.FaceDirection,kse=uL.Errors,Sse=uL.Messages,Ese=uL.TrackLivenessEvents,Bse=-1,_se=3,xse=1,Tse={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(mse={},Py(mse,uL.FaceDirection.UP,{delayTime:0}),Py(mse,uL.FaceDirection.LEFT,{delayTime:0}),Py(mse,uL.FaceDirection.RIGHT,{delayTime:0}),Py(mse,uL.FaceDirection.FRONTAL,{delayTime:2e3}),mse),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}};function Ase(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,r=e.bgCameraMask,n=e.bgCameraMaskRed,o=e.surroundStyle,i=e.cropAreaDimension,a=e.customInstructions,s=e.customIcon,c=e.customDirectionIcon,u=e.customStepTimeConstraints,l=void 0===u?Tse.customStepTimeConstraints:u,d=e.onLivenessDetectionDone,f=e.onError,p=e.frontalMinSize,h=e.waitingTimeToGetBetterFrames,m=void 0===h?500:h,g=e.captureFrameSettings,v=void 0===g?Tse.captureFrameSettings:g,y=e.livenessSettings,b=e.setRemainingTime,w=void 0===b?Tse.setRemainingTime:b,C=e.onProcessing,k=void 0===C?Tse.onProcessing:C,S=e.customErrors,E=e.customMessages,B=e.apiCredentials,_=void 0===B?{}:B,x=e.onFramesCaptured,T=void 0===x?Tse.onFramesCaptured:x,A=e.initFirstGestureTimeout,I=void 0===A?2e3:A,P=e.outputEncryptionSettings,R=e.cameraScale,D=void 0===R?1:R,O=e.passiveModeAuto,N=void 0!==O&&O,L=e.sendCustomEvent,M=xw.useState(!1),F=Ky(M,2),U=F[0],j=F[1],V=xw.useState(!1),z=Ky(V,2),q=z[0],H=z[1],W=xw.useState(!1),K=Ky(W,2),Q=K[0],G=K[1],X=xw.useState(!1),Y=Ky(X,2),$=Y[0],Z=Y[1],J=xw.useRef(null),ee=yj.useSDKSettings(),te=ee.lang,re=ee.assetRoot,ne=ee.customUrls,oe=ee.exifKey,ie=fq.useApiClient({apiCredentials:_}),ae=ie.apiClient,se=xw.useReducer((function(e){return e+1}),0),ce=Ky(se,2),ue=(ce[0],ce[1]),le=xw.useRef(null),de=xw.useState(!1),fe=Ky(de,2),pe=fe[0],he=fe[1],me=xw.useRef({}),ge=Yj.useSDKTracking(),ve=ge.sendEvent,ye=hW(),be=ye.startMotion,we=ye.stopMotion,Ce=ye.motionData,ke=ye.orientationData,Se=xw.useState(_se),Ee=Ky(Se,2),Be=Ee[0],_e=Ee[1],xe=xw.useState(!1),Te=Ky(xe,2),Ae=Te[0],Ie=Te[1],Pe=xw.useRef(!1),Re=xw.useCallback((function(e){Ie(e),Pe.current=e}),[]),De=xw.useRef(null),Oe=xw.useRef([]),Ne=xw.useRef(null),Le=xw.useRef(),Me=xw.useRef(null);null===Me.current&&(Me.current=KV.initFaceVerificationData({assetRoot:re,customInstructions:a,customIcon:s,customDirectionIcon:c,customStepTimeConstraints:l}));var Fe=xw.useState(),Ue=Ky(Fe,2),je=Ue[0],Ve=Ue[1],ze=xw.useCallback((function(e){Ve(e)}),[]),qe=xw.useMemo((function(){return $5(ze,500)}),[ze]),He=xw.useRef([]),We=xw.useRef(),Ke=s9({livenessSettings:y,apiClient:ae,apiCheck:t,onError:f,mode:uL.Mode.PASSIVE}),Qe=Ke.face_tracking_setting,Ge=Ke.flow_interval_time_ms,Xe=Ke.limit_time_liveness_check,Ye=Ke.terminate_if_no_face,$e=Ke.close_eye_detector,Ze=void 0===$e?{}:$e,Je=Ke.captureFrameSettings,et=void 0===Je?v:Je,tt=Ke.exif_data_settings,rt=Ke.record_video,nt=Ke.auto_capture,ot=Ke.manual_capture,it=Ke.blur_check,at=Ke.web_is_required_frontal_face,st=null!=nt&&nt.enable?null==nt?void 0:nt.wait_for_best_image_time_ms_web:null==ot?void 0:ot.wait_for_best_image_time_ms_web,ct=null==rt?void 0:rt.enable,ut=xw.useRef(""),lt=xw.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==Ese?void 0:Ese.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===ut.current)return;ut.current=r}ve(e),L&&L(e)}}),[L,ve]),dt=xw.useMemo((function(){return $5((function(e){lt(e)}),2e3)}),[lt]),ft=xw.useRef(0),pt=xw.useRef(),ht=xw.useRef();xw.useEffect((function(){lt({tag:"selfie",event:null==Ese?void 0:Ese.start_camera,log:{}})}),[lt]),xw.useEffect((function(){return wse.start(),lW.initExifData(),function(){wse.stop()}}),[]),xw.useEffect((function(){var e=!1;function t(){return(t=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pe){t.next=13;break}return We.current=performance.now(),t.next=4,T9(ne);case 4:return me.current=t.sent,t.next=7,Vq.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){t.next=9;break}return t.abrupt("return");case 9:he(!0),lt({tag:"selfie",event:null==Ese?void 0:Ese.show_warmup,log:{}}),lt({tag:"selfie",event:null==Ese?void 0:Ese.finish_load_model,log:{status:"success",time_in_ms:performance.now()-We.current}}),We.current=null;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[pe,ne,lt]);var mt=xw.useRef(!1),gt=xw.useCallback((function(){var e;w(""),Me.current.curStepIndex=Me.current.steps.length,mt.current=!0,G(!1),wse.stop(),null===(e=ht.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;Me.current=KV.initFaceVerificationData({assetRoot:re,customInstructions:a,customIcon:s,customDirectionIcon:c}),wse.start(),ft.current=0,pt.current=null,He.current=[],Z(!1),I9(),null===(e=ht.current)||void 0===e||e.start(),mt.current=!1,clearInterval(De.current),Re(!1),_e(_se),Ne.current=null,Oe.current=[],Le.current=null,ue()}),Ge)}),[w,Ge,re,a,s,c,Re]),vt=xw.useMemo((function(){return Oy(Oy({},kse),S)}),[S]),yt=xw.useMemo((function(){return Oy(Oy({},Sse),E)}),[E]),bt=400;xw.useEffect((function(){if(q&&Xe.enable&&$){var e=Xe.limit_time_second+1,t=Xe.remain_time_show||10,r=Xe.format||"s";wse.start("limit",(function(n){var o=e-n;if(Me.current.curStepIndex<Me.current.steps.length){if(o<=t&&o>=1){var i=i9(yt.REMAIN_TIME[te]),a=o;switch(r){case"mm:ss":a=o.toString().padStart(5,"00:00");break;case"ss":a=o.toString().padStart(2,"0")}w(i({x:a}))}if(0===o){var s,c={};Object.keys(null===(s=vt.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=i9(null===(t=vt.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:Xe.limit_time_second})})),Ve(Oy(Oy({},vt.liveness_terminated_time_out),{},{msg:c,duration:Ge})),lt({tag:"selfie",event:null==Ese?void 0:Ese.show_alert,log:{alert:"liveness_terminated_time_out,"}}),gt()}}}))}}),[gt,w,q,te,Ge,Xe.enable,Xe.limit_time_second,$,vt.liveness_terminated_time_out,yt.REMAIN_TIME,Xe.format,Xe.remain_time_show,lt]);var wt=xw.useCallback((function(e){var t,n,a=e.clientWidth,s=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;b1.isMobile?n=t=c:t=n=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=r;le.current={x:f,y:p,width:t,height:n,image:h,surroundStyle:o},"object"===By(i)?le.current=Oy(Oy({},le.current),i):"function"==typeof i&&(le.current=Oy(Oy({},le.current),i({clientWidth:a,clientHeight:s,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:b1.isMobile,width:t,height:n}))),ue(),H(!0)}),[r,o,i]),Ct=xw.useCallback((function(){_e(_se),clearInterval(De.current),Re(!0);var e=function(){var e=xy(regeneratorRuntime.mark((function e(r){var n,o,i,a,s,c,u,l,p,h,m,g,v,y,b,w,C,S,E,B,_,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r-1!=0){e.next=52;break}return clearInterval(De.current),k(),e.next=5,null===(n=ht.current)||void 0===n?void 0:n.stopVideoRecording();case 5:return j(!0),we(),lW.preWriteExif({mode:lW.MODE.SELFIE,motionData:Ce,orientationData:ke,startTime:Date.now()-1e3*wse.duration("from_1st_frame"),endTime:Date.now(),exifKey:oe}),o=nt.enable?[Ne.current]:Oe.current,i=o.map((function(e){return Jz.resizeBlobImg(e.blob,bt,bt)})),e.next=12,Promise.all(i);case 12:return a=e.sent,s=a.map((function(e,t){return lW.writeExif({mode:lW.MODE.SELFIE,imageData:Oy(Oy({},o[t]),{},{blob:e,gesture:"frontal"}),enableExifData:tt.enable})})),e.next=16,Promise.all(s);case 16:if(c=e.sent,u={},!P||!P.key){e.next=25;break}return l=P.key,p=c.map((function(e){return Wq.encrypt({blob:e,key:l})})),e.next=23,Promise.all(p);case 23:h=e.sent,u={frontalFacesEncrypted:h};case 25:if(t){e.next=30;break}d(Oy(Oy({frontalFaces:c},u),{},{capturedFrames:He.current,video:U9()})),j9(),e.next=52;break;case 30:return m=Gy(He.current),g=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:Cse.FRONTAL})}},v=o.map((function(e,t){return ae.uploadImage(Oy({file:c[t]},g(e.leftRightScore)))})),P&&P.key&&(v=o.map((function(e,t){return ae.httpClient.post("/v1/images",Oy({base64:u.frontalFacesEncrypted[t].hex},g(e.leftRightScore)),{"X-TV-Key":P.key})}))),e.prev=34,e.next=37,Promise.all(v);case 37:return w=e.sent,C=ae.verifyFaceLiveness({images:w.map((function(e){return{id:e.data.image_id}})),videos:[{frames:m}]}),S=ae.requestVerifyPortrait({image:{id:null==w||null===(y=w[w.length-1])||void 0===y||null===(b=y.data)||void 0===b?void 0:b.image_id}}),e.next=42,Promise.all([C,S]);case 42:E=e.sent,B=Ky(E,2),_=B[0],x=B[1],d({apiCheckPassed:_.data.is_live,verifyFaceLivenessResult:_.data,verifyFacePortraitResult:x.data,frontalFaces:w.map((function(e,t){var r,n,i;return{id:null==e||null===(r=e.data)||void 0===r?void 0:r.image_id,blob:null===(n=o)||void 0===n||null===(i=n[t])||void 0===i?void 0:i.blob}}))}),e.next=52;break;case 49:e.prev=49,e.t0=e.catch(34),f({error:e.t0});case 52:case"end":return e.stop()}}),e,null,[[34,49]])})));return function(t){return e.apply(this,arguments)}}();De.current=setInterval((function(){_e((function(t){return e(t),t-1}))}),st/_se)}),[null==nt?void 0:nt.enable,st,Re,t,d,ae,f,k,P,we,Ce,ke,tt.enable,oe]),kt=xw.useRef({});xw.useEffect((function(){kt.current.isFirstValidFrameFoundRef=$}),[$]),xw.useEffect((function(){var e,o=J.current;function i(e){return a.apply(this,arguments)}function a(){return(a=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.leftRightScore,i=t.blurScore,a=t.isEyeClosed,!0!==Pe.current||(!at||r!==Cse.FRONTAL)&&at){e.next=6;break}return e.next=4,xV.takePicture({canvas:n});case 4:s=e.sent,null!=nt&&nt.enable&&Date.now()-Le.current<(null==nt?void 0:nt.wait_for_best_image_time_ms_web)?(Ne.current||(Ne.current={blob:s,blurScore:i,isEyeClosed:a,captureTime:Date.now()}),null!=it&&it.enable&&(Ne.current=d9({incomingFrame:{blob:s,blurScore:i,isEyeClosed:a,captureTime:Date.now()},currentBestFrame:Ne.current}))):Oe.current.length<xse&&Oe.current.push({blob:s,leftRightScore:o,captureTime:Date.now(),blurScore:i});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function s(e,r,n,o){if(He.current.length&&Date.now()-He.current[He.current.length-1].time<et.framesIntervalTime)return null;if(et.enable&&!o){var i=e.topLeft,a=e.bottomRight,s=[].concat(Gy(i),Gy(a)),c=bse(e,0===He.current.length),u=c.score,l=c.time,d=r.toDataURL("image/jpeg",.8);return He.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:He.current.length,bbox:s,original_bbox:s}),et.framesBatchLength>0&&He.current.length%et.framesBatchLength==0&&T&&(T(He.current.slice(-et.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&P9(He.current.slice(-et.framesBatchLength),ae,He.current.length===et.framesBatchLength)),u}return null}function c(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(Ye.enable&&r){var n=Ye.max_time_ms;pt.current&&t||(pt.current={time:Date.now(),frame:0}),t&&pt.current.frame++;var o=pt.current.time;t&&Date.now()-o>=n&&(Ve(Oy(Oy({},vt.liveness_terminated_no_face),{},{duration:Ge})),lt({tag:"selfie",event:null==Ese?void 0:Ese.show_alert,log:{alert:"liveness_terminated_no_face"}}),gt())}}function u(e,t){return d.apply(this,arguments)}function d(){return(d=xy(regeneratorRuntime.mark((function t(a,d){var f,p,h,m,g,v,y,b,w,C,k,S,E,B,_,x,T,A,I,P,R,O,N,L,M,F,U,j,V,z,q,H,W,K,Q,G,X,Y;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==d?void 0:d.width)&&0!==(null==d?void 0:d.height)){t.next=2;break}return t.abrupt("return");case 2:return m=kt.current.isFirstValidFrameFoundRef,g=a.cropX,v=a.cropY,y=a.cropWidth,b=a.cropHeight,d.getContext("2d").drawImage(o,g,v,y,b,-(bt*D-bt)/2/D,-(bt*D-bt)/2/D,bt,bt),w=me.current,C=w.blazefaceModel,k=w.closeEyesModel,t.next=9,Promise.all([BV.calculateBlurScore(d),GV.getModelPredictions({model:C,sCanvas:d})]);case 9:return S=t.sent,E=Ky(S,2),B=E[0],_=E[1],t.next=15,KV.validatePredictions({predictions:_,width:GV.SIZE,height:GV.SIZE});case 15:if(T=t.sent,A=T.error,I=T.fullFace,P=T.faceRatio,R=T.faceNotFrontalMinThreshold,x=A,le.current.image=r,N=null,L=null,M=null,null,F=Me.current,U=F.curStepIndex,j=F.steps,!I){t.next=43;break}return V=!0,M=I.landmarks,t.next=32,KV.calculateFaceDirection({landmarks:M,getPerfectFrontal:V});case 32:if((z=t.sent)&&(N=z.gesture,L=z.leftRightScore),q=(null==Ze?void 0:Ze.web_timeout)+l[uL.FaceDirection.FRONTAL].delayTime/1e3,!(V&&null!=Ze&&Ze.enable&&(-1===wse.duration("limit_close_eye")||wse.duration("limit_close_eye")<q))){t.next=43;break}return-1===wse.duration("limit_close_eye")&&wse.start("limit_close_eye"),t.next=39,k.predict(d,M,null==Ze?void 0:Ze.web_threshold);case 39:H=t.sent,W=H.isEyeClose,W&&!x&&(x=kse.close_eye);case 43:if(K="no_face"===(null===(f=x)||void 0===f?void 0:f.code)||"partial_face"===(null===(p=x)||void 0===p?void 0:p.code),Q=U<j.length,c({noFace:K&&Q,isFirstValidFrameFoundRef:m}),null!==(h=x)&&void 0!==h&&h.code&&dt({tag:"selfie",event:null==Ese?void 0:Ese.show_alert,log:{alert:x.code}}),x&&!("face_too_small"===x.code&&N!==Cse.FRONTAL&&P>=R)){t.next=66;break}if(s(_[0],d,M),N===Cse.FRONTAL||!at){t.next=54;break}O=vt.not_frontal_face,le.current.image=n,t.next=64;break;case 54:if(x){t.next=64;break}return m||(Z(!0),wse.start("from_1st_frame")),G=(null==nt?void 0:nt.enable)&&!Pe.current&&0===Oe.current.length,null!=it&&it.enable?null!==B&&B>(null==it?void 0:it.web_blurry_threshold)?(O=null,G&&(Le.current=Date.now(),Ct())):Pe.current||(O=vt.liveness_blurry):G&&(Le.current=Date.now(),Ct()),t.next=60,k.predict(d,M,null==Ze?void 0:Ze.web_threshold);case 60:return X=t.sent,Y=X.isEyeClose,t.next=64,i(Oy({faceDirection:N,canvas:d,leftRightScore:L,blurScore:B},null!==Y?{isEyeClosed:Y}:{}));case 64:t.next=67;break;case 66:U<j.length&&(O=vt[x.code],le.current.image=n);case 67:qe(O),e!==Bse&&(e=requestAnimationFrame((function(){return u(a,d)})));case 69:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function f(){return(f=xy(regeneratorRuntime.mark((function e(){var t,r,n,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=xV.analyzeVideoAndWindowSizes(o,le.current),(r=document.createElement("canvas")).width=bt,r.height=bt,(n=r.getContext("2d")).translate(bt,0),n.scale(-1*D,1*D),!ct||!o){e.next=13;break}return e.next=10,q9({outputImagesSize:bt,videoEl:o,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:i=e.t0,a=i.mediaRecorder,ht.current=a,ht.current&&ht.current.start(),u(t,r);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return q&&pe&&setTimeout((function(){!function(){f.apply(this,arguments)}()}),I),function(){cancelAnimationFrame(e),e=Bse}}),[at,null==it?void 0:it.enable,null==it?void 0:it.web_blurry_threshold,null==nt?void 0:nt.enable,null==nt?void 0:nt.wait_for_best_image_time_ms_web,I,q,te,ae,t,r,n,d,f,p,m,et,k,Qe,Xe.enable,w,qe,l,Ge,gt,Ye,vt,pe,lt,T,P,D,Ct,N,null==Ze?void 0:Ze.enable,null==Ze?void 0:Ze.web_threshold,null==Ze?void 0:Ze.web_timeout,Ce,ke,we,tt.enable,oe,dt,v.framesBatchLength,ct]),xw.useEffect((function(){je&&((null==je?void 0:je.code)!==(null==vt?void 0:vt.liveness_terminated_time_out)&&(null==je?void 0:je.code)!==(null==vt?void 0:vt.liveness_terminated_no_face)&&null!=nt&&nt.enable&&Pe.current||(clearInterval(De.current),Re(!1),Ne.current=null,Oe.current=[],Le.current=null)),be()}),[null==nt?void 0:nt.enable,je,Re,be,vt]);var St=Me.current,Et=St.curStepIndex,Bt=St.steps,_t=$&&!je&&!N&&(null==nt||!nt.enable||(null==nt?void 0:nt.show_capture_button)),xt=Ae&&!mt.current&&(null!=nt&&nt.enable?null==nt?void 0:nt.show_countdown:null==ot?void 0:ot.show_countdown);return{countdownToTakePicture:Be,cropArea:le,curStepIndex:Et,faceDetectionError:je,handleTriggerPassiveMode:Ct,handleVideoPlayed:wt,refVideo:J,refIsReseting:mt,showCountdown:Ae,steps:Bt,videoPlayed:q,activeCapturing:Q,isFirstValidFrameFound:$,warmupDone:pe,motionData:Ce,orientationData:ke,showLoading:U,showCaptureButton:_t,shouldShowCountdown:xt}}var Ise,Pse=b1.isMobile?{width:{ideal:640}}:null;function Rse(e){var t=e.apiCheck,r=e.onLivenessDetectionDone,n=e.onClose,o=e.onError,i=e.captureFrameSettings,a=e.onFramesCaptured,s=e.frontCamera,c=e.customDirectionIcon,u=e.customStepTimeConstraints,l=e.onProcessing,d=e.customErrors,f=e.livenessSettings,p=e.apiCredentials,h=e.outputEncryptionSettings,m=e.cameraScale,g=e.defaultCameraId,v=e.passiveModeAuto,y=e.offsetFaceY,b=e.styledComponent,w=Jj.useAsset("bg_camera_mask.png"),C=Jj.useAsset("bg_camera_mask_red.png"),k=Ky(xw.useState({}),2),S=k[0],E=k[1],B=S.yFaceDetectionError,_=S.yFaceVerificationStepsWrapper,x=Ky(xw.useState(""),2),T=x[0],A=x[1],I=mB(),P=xw.useMemo((function(){return{backgroundColor:t5(I,"Selfie.backgroundColor",c9)}}),[I]),R=xw.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,i=t+25,a=i+30;E({yFaceDetectionError:i,yFaceVerificationStepsWrapper:a+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(a);return 0!==y&&(u+y<s||u+y+r>c)?o({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=y,{y:u}}),[y,o]),D=Ase({apiCheck:t,bgCameraMask:w,bgCameraMaskRed:C,surroundStyle:P,onLivenessDetectionDone:r,onError:o,cropAreaDimension:R,customDirectionIcon:c,captureFrameSettings:i,onFramesCaptured:a,livenessSettings:f,setRemainingTime:A,customStepTimeConstraints:u,onProcessing:l,customErrors:d,apiCredentials:p,outputEncryptionSettings:h,cameraScale:m,passiveModeAuto:v}),O=D.countdownToTakePicture,N=D.cropArea,L=D.curStepIndex,M=D.faceDetectionError,F=D.handleTriggerPassiveMode,U=D.handleVideoPlayed,j=D.refVideo,V=D.showCountdown,z=D.steps,q=D.videoPlayed,H=D.warmupDone,W=D.showCaptureButton,K=D.shouldShowCountdown;xw.useEffect((function(){var e;"string"==typeof(null===(e=z[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(z.map((function(e){return f9(e.directionIcon)})))}),[z]);var Q=b.CloseCameraButton,G=l9(e,I),X=yj.useSDKSettings().lang,Y=xw.useRef(0),$=xw.useRef({}),Z=xw.useRef(uL.ErrorDuration.SHORT),J=xw.useMemo((function(){var e=M||{},t=e.msg,r=e.duration,n=void 0===r?uL.ErrorDuration.SHORT:r,o=null==t?void 0:t[X];return Date.now()-Y.current>=Z.current&&(Y.current=Date.now(),Z.current=n,$.current=o),$.current}),[M,L]);return xw.createElement(C5,{frontCamera:s,onVideoPlayed:U,onClose:n,flipHorizontal:s,ref:j,videoSettings:Pse,onError:o,scale:m,defaultCameraId:g,closeButton:Q||null},!H&&xw.createElement(Y7,null),q?xw.createElement(xw.Fragment,null,"string"==typeof J?xw.createElement(Ote,{top:B-15,className:"face-detection-error"},J):null,N.current?xw.createElement(x5,{x:"".concat(N.current.x,"px"),y:"".concat(N.current.y,"px"),width:"".concat(N.current.width,"px"),height:"".concat(N.current.height,"px"),surroundStyle:N.current.surroundStyle},xw.createElement(Hte,null),xw.createElement(qte,Ry({progress:L/z.length*100},G,{showErrorRing:!!M&&t5(I,"Selfie.progressCircle.showErrorRing",c9)})),K?xw.createElement(Vte,null,O):null,M&&xw.createElement(Wte,null)):null,T&&xw.createElement(Nte,{top:_-30},T),W?xw.createElement(Ute,null,xw.createElement(jte,{onClick:F,disabled:V},y1(I,"Selfie.captureIcon.src")?xw.createElement("img",{src:y1(I,"Selfie.captureIcon.src"),alt:""}):xw.createElement(T5,null))):null):null)}Rse.propTypes={apiCheck:xC.bool,mode:xC.string,onLivenessDetectionDone:xC.func,onClose:xC.func,onError:xC.func,captureFrameSettings:xC.shape({}),onFramesCaptured:xC.func,frontCamera:xC.bool,customDirectionIcon:xC.shape({}),customStepTimeConstraints:xC.shape({}),onProcessing:xC.func,customErrors:xC.shape({}),livenessSettings:xC.shape({}),apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),outputEncryptionSettings:xC.shape({}),cameraScale:xC.number,defaultCameraId:xC.string,passiveModeAuto:xC.bool,offsetFaceY:xC.number,styledComponent:xC.shape({CloseCameraButton:xC.node})},Rse.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(vse={},Py(vse,uL.FaceDirection.LEFT,xw.createElement(w7,{type:uL.FaceDirection.LEFT})),Py(vse,uL.FaceDirection.RIGHT,xw.createElement(w7,{type:uL.FaceDirection.RIGHT})),Py(vse,uL.FaceDirection.UP,xw.createElement(w7,{type:uL.FaceDirection.UP})),Py(vse,uL.FaceDirection.FRONTAL,xw.createElement(w7,{type:uL.FaceDirection.FRONTAL})),vse),customStepTimeConstraints:(yse={},Py(yse,uL.FaceDirection.UP,{delayTime:0}),Py(yse,uL.FaceDirection.LEFT,{delayTime:0}),Py(yse,uL.FaceDirection.RIGHT,{delayTime:0}),Py(yse,uL.FaceDirection.FRONTAL,{delayTime:2e3}),yse),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null}};var Dse,Ose,Nse=KV.faceTracker(),Lse=new Kq,Mse=uL.FaceDirection,Fse=uL.Errors,Use=uL.Messages,jse=uL.TrackLivenessEvents,Vse=-1,zse={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(Ise={},Py(Ise,uL.FaceDirection.UP,{delayTime:0}),Py(Ise,uL.FaceDirection.LEFT,{delayTime:0}),Py(Ise,uL.FaceDirection.RIGHT,{delayTime:0}),Py(Ise,uL.FaceDirection.FRONTAL,{delayTime:2e3}),Ise),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}};function qse(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,r=e.mode,n=e.bgCameraMask,o=e.bgCameraMaskRed,i=e.surroundStyle,a=e.cropAreaDimension,s=e.customInstructions,c=e.customIcon,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=void 0===l?zse.customStepTimeConstraints:l,f=e.onLivenessDetectionDone,p=e.onError,h=e.frontalMinSize,m=e.waitingTimeToGetBetterFrames,g=void 0===m?500:m,v=e.captureFrameSettings,y=void 0===v?zse.captureFrameSettings:v,b=e.livenessSettings,w=e.setRemainingTime,C=void 0===w?zse.setRemainingTime:w,k=e.onProcessing,S=void 0===k?zse.onProcessing:k,E=e.customErrors,B=e.customMessages,_=e.apiCredentials,x=void 0===_?{}:_,T=e.onFramesCaptured,A=void 0===T?zse.onFramesCaptured:T,I=e.initFirstGestureTimeout,P=void 0===I?2e3:I,R=e.outputEncryptionSettings,D=e.cameraScale,O=void 0===D?1:D,N=e.sendCustomEvent,L=xw.useState(!1),M=Ky(L,2),F=M[0],U=M[1],j=xw.useState(!1),V=Ky(j,2),z=V[0],q=V[1],H=xw.useState(!1),W=Ky(H,2),K=W[0],Q=W[1],G=xw.useState(!1),X=Ky(G,2),Y=X[0],$=X[1],Z=xw.useRef(null),J=yj.useSDKSettings(),ee=J.lang,te=J.assetRoot,re=J.customUrls,ne=J.exifKey,oe=fq.useApiClient({apiCredentials:x}),ie=oe.apiClient,ae=xw.useReducer((function(e){return e+1}),0),se=Ky(ae,2),ce=(se[0],se[1]),ue=xw.useRef(null),le=xw.useRef(!1),de=xw.useState(!1),fe=Ky(de,2),pe=fe[0],he=fe[1],me=xw.useRef({}),ge=Yj.useSDKTracking(),ve=ge.sendEvent,ye=hW(),be=ye.stopMotion,we=ye.motionData,Ce=ye.orientationData,ke=xw.useRef(null);null===ke.current&&(ke.current=KV.initFaceVerificationData({assetRoot:te,customInstructions:s,customIcon:c,customDirectionIcon:u,customStepTimeConstraints:d}));var Se=xw.useState(),Ee=Ky(Se,2),Be=Ee[0],_e=Ee[1],xe=xw.useCallback((function(e){_e(e)}),[]),Te=xw.useMemo((function(){return $5(xe,500)}),[xe]),Ae=xw.useRef([]),Ie=xw.useRef(),Pe=s9({livenessSettings:b,apiClient:ie,apiCheck:t,onError:p,mode:r}),Re=Pe.face_tracking_setting,De=Pe.flow_interval_time_ms,Oe=Pe.limit_time_liveness_check,Ne=Pe.terminate_if_no_face,Le=Pe.close_eye_detector,Me=void 0===Le?{}:Le,Fe=Pe.captureFrameSettings,Ue=void 0===Fe?y:Fe,je=Pe.exif_data_settings,Ve=Pe.record_video,ze=Pe.web_is_required_frontal_face,qe=null==Ve?void 0:Ve.enable,He=xw.useRef(""),We=xw.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==jse?void 0:jse.show_alert)){var t,r=null===(t=e.log)||void 0===t?void 0:t.alert;if(r===He.current)return;He.current=r}ve(e),N&&N(e)}}),[N,ve]),Ke=xw.useMemo((function(){return $5((function(e){We(e)}),2e3)}),[We]),Qe=xw.useRef(0),Ge=xw.useRef(),Xe=xw.useRef();xw.useEffect((function(){We({tag:"selfie",event:null==jse?void 0:jse.start_camera,log:{}})}),[We]),xw.useEffect((function(){return Lse.start(),lW.initExifData(),function(){Lse.stop()}}),[]),xw.useEffect((function(){var e=!1;function t(){return(t=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(pe){t.next=13;break}return Ie.current=performance.now(),t.next=4,T9(re);case 4:return me.current=t.sent,t.next=7,Vq.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){t.next=9;break}return t.abrupt("return");case 9:he(!0),We({tag:"selfie",event:null==jse?void 0:jse.show_warmup,log:{}}),We({tag:"selfie",event:null==jse?void 0:jse.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Ie.current}}),Ie.current=null;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[pe,re,We]);var Ye=xw.useRef(!1),$e=xw.useCallback((function(){var e;C(""),ke.current.curStepIndex=ke.current.steps.length,Ye.current=!0,Q(!1),Lse.stop(),null===(e=Xe.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;ke.current=KV.initFaceVerificationData({assetRoot:te,customInstructions:s,customIcon:c,customDirectionIcon:u}),Lse.start(),Qe.current=0,Ge.current=null,Ae.current=[],$(!1),I9(),null===(e=Xe.current)||void 0===e||e.start(),Ye.current=!1,ce()}),De)}),[C,De,te,s,c,u]),Ze=xw.useMemo((function(){return Oy(Oy({},Fse),E)}),[E]),Je=xw.useMemo((function(){return Oy(Oy({},Use),B)}),[B]),et=400;xw.useEffect((function(){if(z&&Oe.enable&&Y){var e=Oe.limit_time_second+1,t=Oe.remain_time_show||10,r=Oe.format||"s";Lse.start("limit",(function(n){var o=e-n;if(ke.current.curStepIndex<ke.current.steps.length){if(o<=t&&o>=1){var i=i9(Je.REMAIN_TIME[ee]),a=o;switch(r){case"mm:ss":a=o.toString().padStart(5,"00:00");break;case"ss":a=o.toString().padStart(2,"0")}C(i({x:a}))}if(0===o){var s,c={};Object.keys(null===(s=Ze.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var t,r=i9(null===(t=Ze.liveness_terminated_time_out)||void 0===t?void 0:t.msg[e]);c[e]=r({x:Oe.limit_time_second})})),_e(Oy(Oy({},Ze.liveness_terminated_time_out),{},{msg:c,duration:De})),We({tag:"selfie",event:null==jse?void 0:jse.show_alert,log:{alert:"liveness_terminated_time_out,"}}),$e()}}}))}}),[$e,C,z,ee,De,Oe.enable,Oe.limit_time_second,Y,Ze.liveness_terminated_time_out,Je.REMAIN_TIME,Oe.format,Oe.remain_time_show,We]);var tt=xw.useCallback((function(e){var t,r,o=e.clientWidth,s=e.clientHeight,c=e.videoAreaWidth,u=e.videoAreaHeight,l=e.lostX,d=e.lostY;b1.isMobile?r=t=c:t=r=u-200;var f=Math.floor((c-t)/2)+l,p=5+d,h=n;ue.current={x:f,y:p,width:t,height:r,image:h,surroundStyle:i},"object"===By(a)?ue.current=Oy(Oy({},ue.current),a):"function"==typeof a&&(ue.current=Oy(Oy({},ue.current),a({clientWidth:o,clientHeight:s,videoAreaWidth:c,videoAreaHeight:u,lostX:l,lostY:d,isMobile:b1.isMobile,width:t,height:r}))),ce(),q(!0)}),[n,i,a]),rt=xw.useRef({});xw.useEffect((function(){rt.current.isFirstValidFrameFoundRef=Y}),[Y]),xw.useEffect((function(){var e,r=Z.current,i=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ke.current.steps,r=[],t.map((function(e){return r.push({name:e.name,blob:e.image.blob,captureTime:e.image.captureTime,gesture:e.name}),e.frontalFaceImage.blob&&r.push({name:e.name,blob:e.frontalFaceImage.blob,captureTime:e.frontalFaceImage.captureTime,gesture:Mse.FRONTAL}),0})),n=r.map((function(e){return Jz.resizeBlobImg(e.blob,et,et)})),e.next=6,Promise.all(n);case 6:return o=e.sent,i="0",y.framesBatchLength>0&&(a="".concat(Math.floor(Ae.current.length/y.framesBatchLength),"x").concat(y.framesBatchLength),s=Ae.current.length%y.framesBatchLength>0?"+".concat(Ae.current.length%y.framesBatchLength):"",i="".concat(Ae.current.length,":").concat(a).concat(s)),c=o.map((function(e,t){return lW.writeExif({mode:lW.MODE.SELFIE,imageData:Oy(Oy({},r[t]),{},{blob:e,frames:i}),enableExifData:je.enable})})),e.next=12,Promise.all(c);case 12:return u=e.sent,l=r.map((function(e,t){return{name:e.name,blob:u[t]}})),e.next=16,Promise.all(t.map(function(){var e=xy(regeneratorRuntime.mark((function e(r,n){var o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=l.filter((function(e){return e.name===r.name})),t[n].image.blob=o[0].blob,r.frontalFaceImage.blob&&(t[n].frontalFaceImage.blob=o[1].blob),!R||!R.key){e.next=12;break}return i=R.key,e.next=7,Wq.encrypt({blob:o[0].blob,key:i});case 7:if(t[n].image.encrypted=e.sent,!r.frontalFaceImage.blob){e.next=12;break}return e.next=11,Wq.encrypt({blob:o[1].blob,key:i});case 11:t[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=xy(regeneratorRuntime.mark((function e(){var r,n,o,a,s,c,u,l,d,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ke.current.steps,o=n[ke.current.curStepIndex],Py(r={},uL.FaceDirection.UP,null==jse?void 0:jse.capture_up_face),Py(r,uL.FaceDirection.LEFT,null==jse?void 0:jse.capture_left_face),Py(r,uL.FaceDirection.RIGHT,null==jse?void 0:jse.capture_right_face),Py(r,uL.FaceDirection.FRONTAL,null==jse?void 0:jse.capture_frontal_face),We({tag:"selfie",event:r[o.name],log:{time_capture_in_seconds:((performance.now()-Ie.current)/1e3).toFixed(1)}}),ke.current.curStepIndex++,Ie.current=performance.now(),Re.enable&&"each_gesture"===Re.limit_for&&(Qe.current=0),ke.current.curStepIndex!==n.length){e.next=44;break}if(Oe.enable&&C(""),!f){e.next=44;break}return Ue.enable&&Ue.framesBatchLength>0&&Ae.current.length%Ue.framesBatchLength>0&&(A(Ae.current.slice(Ae.current.length%Ue.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&P9(Ae.current.slice(Ae.current.length%Ue.framesBatchLength*-1),ie)),We({tag:"selfie",event:null==jse?void 0:jse.finish_capture,log:{time_capture_in_seconds:Lse.duration("from_1st_frame")}}),S(),e.next=15,null===(a=Xe.current)||void 0===a?void 0:a.stopVideoRecording();case 15:return U(!0),be(),lW.preWriteExif({mode:lW.MODE.SELFIE,motionData:we,orientationData:Ce,startTime:Date.now()-1e3*Lse.duration("from_1st_frame"),endTime:Date.now(),exifKey:ne}),e.next=20,i();case 20:if(t){e.next=41;break}if(d=n.filter((function(e){return e.name!==Mse.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),m=n.filter((function(e){return e.name!==Mse.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),g=n.filter((function(e){return e.name!==Mse.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),v=null===(s=n.find((function(e){return e.name===Mse.FRONTAL})))||void 0===s||null===(c=s.image)||void 0===c?void 0:c.blob,y=null===(u=n.find((function(e){return e.name===Mse.FRONTAL})))||void 0===u||null===(l=u.image)||void 0===l?void 0:l.encrypted,!v||!h){e.next=32;break}return e.next=29,Jz.scaleImage(v,{minSize:h});case 29:e.t0=e.sent,e.next=33;break;case 32:e.t0=null;case 33:b=e.t0,v&&m.push(v),y&&g.push(y),We({tag:"result",event:null==jse?void 0:jse.liveness_detection_done,log:{result_object:{steps:d,frontalFaces:m,frontalScaledImage:b}}}),f({steps:d,frontalFaces:m,frontalFacesEncrypted:g,frontalScaledImage:b,capturedFrames:Ae.current,video:U9().length?U9()[0]:null}),j9(),e.next=43;break;case 41:return e.next=43,N9({apiClient:ie,faceVerificationFlowData:ke,onLivenessDetectionDone:f,captureFrameSettings:Ue,FaceDirection:Mse,onError:p,outputEncryptionSettings:R,video:U9().length?U9()[0]:null});case 43:U(!1);case 44:ce();case 45:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=G5((function(){var e=ke.current,t=e.curStepIndex,r=e.steps,n=r[t],o=null!==(null==n?void 0:n.image.blob),i=null!==(null==n?void 0:n.frontalFaceImage.blob),s=r.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return o&&(i||![1].includes(t)||s>=1)?(le.current=!1,a(),c=!0):le.current=!(!o||i),Q(!1),c}),g);function c(e){return u.apply(this,arguments)}function u(){return(u=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,c,u,l,d,f,p,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.faceDirection,n=t.canvas,o=t.blurScore,i=t.leftRightScore,c=t.isEyeClose,u=ke.current,l=u.curStepIndex,d=u.steps,!(l<d.length)){e.next=29;break}if(f=d[l],!u9({faceDirection:r,curStep:f})){e.next=6;break}return e.abrupt("return");case 6:if(!c){e.next=8;break}return e.abrupt("return");case 8:if(r!==Mse.FRONTAL||null!==f.frontalFaceImage.blurScore&&!BV.hasBetterBlurScore(o,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=o,e.next=12,xV.takePicture({canvas:n});case 12:p=e.sent,f.frontalFaceImage.blob=p,f.frontalFaceImage.leftRightScore=i,f.frontalFaceImage.captureTime=Date.now(),le.current&&(le.current=!1,a());case 17:if(f.name!==r||null!==f.image.blurScore&&!BV.hasBetterBlurScore(o,f.image.blurScore)){e.next=29;break}return Q(!0),f.image.blurScore=o,e.next=22,xV.takePicture({canvas:n});case 22:h=e.sent,f.image.blob=h,f.image.leftRightScore=i,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(h),s();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,r,n,o){if(Ae.current.length&&Date.now()-Ae.current[Ae.current.length-1].time<Ue.framesIntervalTime)return null;if(Ue.enable&&!o){var i=e.topLeft,a=e.bottomRight,s=[].concat(Gy(i),Gy(a)),c=Nse(e,0===Ae.current.length),u=c.score,l=c.time,d=r.toDataURL("image/jpeg",.8);return Ae.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:u,time:l,index:Ae.current.length,bbox:s,original_bbox:s}),Ue.framesBatchLength>0&&Ae.current.length%Ue.framesBatchLength==0&&A&&(A(Ae.current.slice(-Ue.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&P9(Ae.current.slice(-Ue.framesBatchLength),ie,Ae.current.length===Ue.framesBatchLength)),u}return null}function m(e){var t=e.trackingScore,r=e.isFirstValidFrameFoundRef;if(!Re.enable||null===t||!r)return!0;var n=Re.web_warning_threshold,o=Re.web_terminate_threshold,i=Re.max_warning_time;return t<n||(t<o&&Qe.current<i?(Qe.current++,Qe.current===i?(_e(Oy(Oy({},Ze.liveness_terminated_face_tracking),{},{duration:De})),We({tag:"selfie",event:null==jse?void 0:jse.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):_e(Oy(Oy({},Ze.liveness_too_fast),{},{duration:1500})),!0):(_e(Oy(Oy({},Ze.liveness_terminated),{},{duration:De})),We({tag:"selfie",event:null==jse?void 0:jse.show_alert,log:{alert:"liveness_terminated"}}),$e(),!1))}function v(e){var t=e.noFace,r=e.isFirstValidFrameFoundRef;if(Ne.enable&&r){var n=Ne.max_time_ms;Ge.current&&t||(Ge.current={time:Date.now(),frame:0}),t&&Ge.current.frame++;var o=Ge.current.time;t&&Date.now()-o>=n&&(_e(Oy(Oy({},Ze.liveness_terminated_no_face),{},{duration:De})),We({tag:"selfie",event:null==jse?void 0:jse.show_alert,log:{alert:"liveness_terminated_no_face"}}),$e())}}function b(e,t){return w.apply(this,arguments)}function w(){return(w=xy(regeneratorRuntime.mark((function t(i,a){var s,u,f,p,h,g,y,w,C,k,S,E,B,_,x,T,A,I,P,R,D,N,L,M,F,U,j,V,z,q,H,W,K,Q,G,X,Y;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==a?void 0:a.width)&&0!==(null==a?void 0:a.height)){t.next=2;break}return t.abrupt("return");case 2:return p=rt.current.isFirstValidFrameFoundRef,h=i.cropX,g=i.cropY,y=i.cropWidth,w=i.cropHeight,a.getContext("2d").drawImage(r,h,g,y,w,-(et*O-et)/2/O,-(et*O-et)/2/O,et,et),C=me.current,k=C.blazefaceModel,S=C.closeEyesModel,t.next=9,Promise.all([BV.calculateBlurScore(a),GV.getModelPredictions({model:k,sCanvas:a})]);case 9:return E=t.sent,B=Ky(E,2),_=B[0],x=B[1],t.next=15,KV.validatePredictions({predictions:x,width:GV.SIZE,height:GV.SIZE});case 15:if(A=t.sent,I=A.error,P=A.fullFace,R=A.faceRatio,D=A.faceNotFrontalMinThreshold,T=I,ue.current.image=n,L=null,M=null,F=null,U=null,j=ke.current,V=j.curStepIndex,z=j.steps,!P){t.next=44;break}return q=z[V],H=q&&q.name===Mse.FRONTAL,F=P.landmarks,t.next=33,KV.calculateFaceDirection({landmarks:F,getPerfectFrontal:H});case 33:if((W=t.sent)&&(L=W.gesture,M=W.leftRightScore),K=(null==Me?void 0:Me.web_timeout)+d[uL.FaceDirection.FRONTAL].delayTime/1e3,!(H&&null!=Me&&Me.enable&&(-1===Lse.duration("limit_close_eye")||Lse.duration("limit_close_eye")<K))){t.next=44;break}return-1===Lse.duration("limit_close_eye")&&Lse.start("limit_close_eye"),t.next=40,S.predict(a,F,null==Me?void 0:Me.web_threshold);case 40:Q=t.sent,G=Q.isEyeClose,(U=G)&&!T&&(T=Fse.close_eye);case 44:if(X="no_face"===(null===(s=T)||void 0===s?void 0:s.code)||"partial_face"===(null===(u=T)||void 0===u?void 0:u.code),Y=V<z.length,v({noFace:X&&Y,isFirstValidFrameFoundRef:p}),null!==(f=T)&&void 0!==f&&f.code&&Ke({tag:"selfie",event:null==jse?void 0:jse.show_alert,log:{alert:T.code}}),T&&!("face_too_small"===T.code&&L!==Mse.FRONTAL&&R>=D)){t.next=56;break}if(p||($(!0),Ie.current=performance.now(),Lse.start("from_1st_frame")),!m({trackingScore:l(x[0],a,F,V>=z.length),isFirstValidFrameFoundRef:p})){t.next=54;break}return t.next=54,c({faceDirection:L,canvas:a,blurScore:_,leftRightScore:M,isEyeClose:U});case 54:t.next=57;break;case 56:V<z.length&&(N=Ze[T.code],ue.current.image=o);case 57:Te(N),e!==Vse&&(e=requestAnimationFrame((function(){return b(i,a)})));case 59:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(){return(k=xy(regeneratorRuntime.mark((function e(){var t,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=xV.analyzeVideoAndWindowSizes(r,ue.current),(n=document.createElement("canvas")).width=et,n.height=et,(o=n.getContext("2d")).translate(et,0),o.scale(-1*O,1*O),!qe||!r){e.next=13;break}return e.next=10,q9({outputImagesSize:et,videoEl:r,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:i=e.t0,a=i.mediaRecorder,Xe.current=a,Xe.current&&Xe.current.start(),b(t,n);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return z&&pe&&setTimeout((function(){!function(){k.apply(this,arguments)}()}),P),function(){cancelAnimationFrame(e),e=Vse}}),[ze,r,P,z,ee,ie,t,n,o,f,p,h,g,Ue,S,Re,Oe.enable,C,Te,d,De,$e,Ne,Ze,pe,We,A,R,O,null==Me?void 0:Me.enable,null==Me?void 0:Me.web_threshold,null==Me?void 0:Me.web_timeout,we,Ce,be,je.enable,ne,Ke,y.framesBatchLength,qe]);var nt=ke.current,ot=nt.curStepIndex,it=nt.steps,at=xw.useMemo((function(){return it.find((function(e){return e.name===uL.FaceDirection.FRONTAL}))}),[it]),st=le.current?at:it[ot],ct=st&&Y?st.instructions[ee]:null,ut=st&&Y?st.directionIcon:"",lt=st?st.directionIconAnimation:"";return{cropArea:ue,curStepIndex:ot,directionIcon:ut,directionIconAnimation:lt,faceDetectionError:Be,handleVideoPlayed:tt,instructions:ct,refVideo:Z,refIsReseting:Ye,steps:it,videoPlayed:z,activeCapturing:K,isFirstValidFrameFound:Y,warmupDone:pe,motionData:we,orientationData:Ce,showLoading:F}}var Hse=b1.isMobile?{width:{ideal:640}}:null,Wse=function(e){var t=e.stepNumber,r=e.type,n=e.theme,o=y1(n,"Selfie.Active.imageHolder.".concat(r));return null===o?xw.createElement(xw.Fragment,null):o&&null!==o?xw.createElement("img",{src:o,alt:""}):xw.createElement("span",null,t)};function Kse(e,t){return e?"string"==typeof e?xw.createElement("img",{className:t,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}function Qse(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,i=e.onError,a=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customDirectionIcon,l=e.customStepTimeConstraints,d=e.onProcessing,f=e.customErrors,p=e.livenessSettings,h=e.apiCredentials,m=e.outputEncryptionSettings,g=e.cameraScale,v=e.defaultCameraId,y=e.offsetFaceY,b=e.styledComponent,w=Jj.useAsset("bg_camera_mask.png"),C=Jj.useAsset("bg_camera_mask_red.png"),k=Ky(xw.useState({}),2),S=k[0],E=k[1],B=S.yFaceDetectionError,_=S.yFaceVerificationStepsWrapper,x=Ky(xw.useState(""),2),T=x[0],A=x[1],I=mB(),P=xw.useMemo((function(){return{backgroundColor:t5(I,"Selfie.backgroundColor",c9)}}),[I]),R=xw.useCallback((function(e){var t=e.lostY,r=e.height,n=e.clientHeight,o=t+25,a=o+30;E({yFaceDetectionError:o,yFaceVerificationStepsWrapper:a+r+20});var s=Math.floor(t),c=Math.floor(n-t),u=Math.floor(a);return 0!==y&&(u+y<s||u+y+r>c)?i({code:"offsetFaceY must be in [-".concat(u-s,", ").concat(c-r-u,"]")}):u+=y,{y:u}}),[y,i]),D=qse({apiCheck:t,mode:r,bgCameraMask:w,bgCameraMaskRed:C,surroundStyle:P,onLivenessDetectionDone:n,onError:i,cropAreaDimension:R,customDirectionIcon:u,captureFrameSettings:a,onFramesCaptured:s,livenessSettings:p,setRemainingTime:A,customStepTimeConstraints:l,onProcessing:d,customErrors:f,apiCredentials:h,outputEncryptionSettings:m,cameraScale:g}),O=D.cropArea,N=D.curStepIndex,L=D.directionIcon,M=D.directionIconAnimation,F=D.faceDetectionError,U=D.handleVideoPlayed,j=D.instructions,V=D.refVideo,z=D.steps,q=D.videoPlayed,H=D.activeCapturing,W=D.warmupDone;xw.useEffect((function(){var e;"string"==typeof(null===(e=z[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(z.map((function(e){return f9(e.directionIcon)})))}),[z]);var K=b.CloseCameraButton,Q=l9(e,I),G=yj.useSDKSettings().lang,X=xw.useRef(0),Y=xw.useRef({}),$=xw.useRef(uL.ErrorDuration.SHORT),Z=xw.useMemo((function(){var e=F||{},t=e.msg,r=e.duration,n=void 0===r?uL.ErrorDuration.SHORT:r,o=null==t?void 0:t[G];return Date.now()-X.current>=$.current&&(X.current=Date.now(),$.current=n,Y.current=o),Y.current}),[F,N]);return xw.createElement(C5,{frontCamera:c,onVideoPlayed:U,onClose:o,flipHorizontal:c,ref:V,videoSettings:Hse,onError:i,scale:g,defaultCameraId:v,closeButton:K||null},!W&&xw.createElement(Y7,null),q?xw.createElement(xw.Fragment,null,"string"==typeof Z?xw.createElement(Ote,{top:B-15,className:"face-detection-error"},Z):null,O.current?xw.createElement(x5,{x:"".concat(O.current.x,"px"),y:"".concat(O.current.y,"px"),width:"".concat(O.current.width,"px"),height:"".concat(O.current.height,"px"),surroundStyle:O.current.surroundStyle},xw.createElement(Hte,null),xw.createElement(qte,Ry({progress:N/z.length*100},Q,{showErrorRing:!!F&&t5(I,"Selfie.progressCircle.showErrorRing",c9)})),xw.createElement(zte,null,Kse(L,M)),H&&xw.createElement(Qte,null),F&&xw.createElement(Wte,null)):null,T&&xw.createElement(Nte,{top:_-30},T),j?xw.createElement(xw.Fragment,null,xw.createElement(Lte,{top:_+5,className:"instructions"},j),xw.createElement(Mte,{top:_+35},z.map((function(e,t){var r=e.name,n=e.image.objUrl;return xw.createElement(Fte,{key:r,active:N>=t,className:"step-item"},n?xw.createElement("img",{src:n,alt:""}):xw.createElement(Wse,{stepNumber:t+1,type:r,theme:I}))})))):null):null)}Qse.propTypes={apiCheck:xC.bool,mode:xC.string,onLivenessDetectionDone:xC.func,onClose:xC.func,onError:xC.func,captureFrameSettings:xC.shape({}),onFramesCaptured:xC.func,frontCamera:xC.bool,customDirectionIcon:xC.shape({}),customStepTimeConstraints:xC.shape({}),onProcessing:xC.func,customErrors:xC.shape({}),livenessSettings:xC.shape({}),apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),outputEncryptionSettings:xC.shape({}),cameraScale:xC.number,defaultCameraId:xC.string,offsetFaceY:xC.number,styledComponent:xC.shape({CloseCameraButton:xC.node})},Qse.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(Dse={},Py(Dse,uL.FaceDirection.LEFT,xw.createElement(w7,{type:uL.FaceDirection.LEFT})),Py(Dse,uL.FaceDirection.RIGHT,xw.createElement(w7,{type:uL.FaceDirection.RIGHT})),Py(Dse,uL.FaceDirection.UP,xw.createElement(w7,{type:uL.FaceDirection.UP})),Py(Dse,uL.FaceDirection.FRONTAL,xw.createElement(w7,{type:uL.FaceDirection.FRONTAL})),Dse),customStepTimeConstraints:(Ose={},Py(Ose,uL.FaceDirection.UP,{delayTime:0}),Py(Ose,uL.FaceDirection.LEFT,{delayTime:0}),Py(Ose,uL.FaceDirection.RIGHT,{delayTime:0}),Py(Ose,uL.FaceDirection.FRONTAL,{delayTime:2e3}),Ose),onProcessing:function(){},customErrors:null,livenessSettings:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,offsetFaceY:0,styledComponent:{CloseCameraButton:null}};var Gse=["logCredentials","clientSettings","livenessSettings","livenessComponent","customTheme"];function Xse(e){var t=e.logCredentials,r=void 0===t?{enable:!0}:t,n=e.clientSettings,o=e.livenessSettings,i=e.livenessComponent,a=e.customTheme,s=void 0===a?{}:a,c=Vy(e,Gse),u=c.mode;if(u===uL.Mode.FLASH)return xw.createElement(gse,Ry({},c,{customTheme:s,clientSettings:n,logCredentials:r}));var l=y1(n,"data.settings.sdk_settings",{}),d={};return u===uL.Mode.ACTIVE&&(d=Oy(Oy({},null==l?void 0:l.passive_liveness_settings),null==l?void 0:l.active_liveness_settings)),u===uL.Mode.PASSIVE&&(d=Oy(Oy({},null==l?void 0:l.active_liveness_settings),null==l?void 0:l.passive_liveness_settings)),i?xw.createElement(hne,null,xw.createElement(cB,{theme:s},xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy({},r)}},xw.createElement(i,Ry({},c,{livenessSettings:Oy(Oy({},o),d)}))))):u===uL.Mode.ACTIVE?xw.createElement(hne,null,xw.createElement(cB,{theme:s},xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy({},r)}},xw.createElement(Qse,Ry({},c,{livenessSettings:Oy(Oy({},o),d)}))))):u===uL.Mode.PASSIVE?xw.createElement(hne,null,xw.createElement(cB,{theme:s},xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy({},r)}},xw.createElement(Rse,Ry({},c,{livenessSettings:Oy(Oy({},o),d)}))))):xw.createElement(hne,null,xw.createElement(cB,{theme:s},xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy({},r)}},xw.createElement(bre,Ry({},c,{livenessSettings:Oy(Oy({},o),d)})))))}var Yse={DEFAULT:"default",ERROR:"error"};function $se(e){var t=e.className,r=e.width,n=e.height,o=e.type,i=e.strokeStyles,a=e.strokeWidth,s=e.radius,c=e.paddingStyle,u=e.defaultRectStyles,l=e.errorRectStyles,d=s+.8*a,f=xw.useMemo((function(){var e;return Oy((Py(e={},Yse.DEFAULT,u),Py(e,Yse.ERROR,l),e),i)}),[u,l,i])[o];return xw.createElement("svg",{width:r,height:n,className:t},xw.createElement("rect",{x:a/2,y:a/2,rx:s,ry:s,width:r-a,height:n-a,style:f}),xw.createElement("path",{d:"M0,".concat(d," Q0,0 ").concat(d,",0 L0,0 Z"),style:c}),xw.createElement("path",{d:"M0,".concat(n-d," Q0,").concat(n," ").concat(d,",").concat(n," L0,").concat(n," Z"),style:c}),xw.createElement("path",{d:"M".concat(r-d,",").concat(n," Q").concat(r,",").concat(n," ").concat(r,",").concat(n-d," L").concat(r,",").concat(n," Z"),style:c}),xw.createElement("path",{d:"M".concat(r-d,",0 Q").concat(r,",0 ").concat(r,",").concat(d," L").concat(r,",0 Z"),style:c}))}$se.propTypes={className:xC.string,width:xC.number,height:xC.number,strokeWidth:xC.number,strokeStyles:xC.shape({}),type:xC.oneOf([Yse.DEFAULT,Yse.ERROR]),radius:xC.number,paddingStyle:xC.shape({}),defaultRectStyles:xC.shape({}),errorRectStyles:xC.shape({})},$se.defaultProps={className:"",width:Are.IDCapturing.rectangleMask.width,height:Are.IDCapturing.rectangleMask.height,strokeWidth:Are.IDCapturing.rectangleMask.strokeWidth,strokeStyles:Are.IDCapturing.rectangleMask.strokeStyles,type:Yse.DEFAULT,radius:Are.IDCapturing.rectangleMask.radius,paddingStyle:Are.IDCapturing.rectangleMask.paddingStyle,defaultRectStyles:Are.IDCapturing.rectangleMask.default,errorRectStyles:Are.IDCapturing.rectangleMask.error};var Zse=uL.Errors,Jse=function(e,t){var r,n,o,i,a,s,c;return{width:null!==(r=e.width)&&void 0!==r?r:t5(t,"IDCapturing.rectangleMask.width",Are),height:null!==(n=e.height)&&void 0!==n?n:t5(t,"IDCapturing.rectangleMask.height",Are),strokeWidth:null!==(o=e.strokeWidth)&&void 0!==o?o:t5(t,"IDCapturing.rectangleMask.strokeWidth",Are),radius:null!==(i=e.radius)&&void 0!==i?i:t5(t,"IDCapturing.rectangleMask.radius",Are),paddingStyle:null!==(a=e.paddingStyle)&&void 0!==a?a:t5(t,"IDCapturing.rectangleMask.paddingStyle",Are),defaultRectStyles:null!==(s=e.default)&&void 0!==s?s:t5(t,"IDCapturing.rectangleMask.default",Are),errorRectStyles:null!==(c=e.error)&&void 0!==c?c:t5(t,"IDCapturing.rectangleMask.error",Are)}};function ece(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}function tce(e,t){return Math.sqrt(ece(e,t))}function rce(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.canvas,r=e.imgMargin,n=window,o=n.cv,i=t.width,a=t.height,s=r;s<1&&(s=parseInt(.5*(a+i)*s,10));var c=o.imread(t),u=new o.Mat;return o.copyMakeBorder(c,u,s,s,s,s,o.BORDER_CONSTANT,new o.Scalar(0,0,0,255)),c.delete(),{mat:u,margin:s}}function nce(e,t){var r=window.cv,n=Ky(t.map((function(e){return e.location})),4),o=n[0],i=n[1],a=n[2],s=n[3],c=tce(a,s),u=tce(i,o),l=Math.max(c,u),d=tce(i,a),f=tce(o,s),p=Math.max(d,f),h=[o.x,o.y,i.x,i.y,a.x,a.y,s.x,s.y],m=[0,0,l-1,0,l-1,p-1,0,p-1],g=r.imread(e),v=new r.Mat,y=new r.Size(l,p),b=r.matFromArray(4,1,r.CV_32FC2,h),w=r.matFromArray(4,1,r.CV_32FC2,m),C=r.getPerspectiveTransform(b,w);r.warpPerspective(g,v,C,y,r.INTER_LINEAR,r.BORDER_CONSTANT,new r.Scalar);var k=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),w.delete(),k}function oce(e,t,r){var n={x:t.x-e.x,y:t.y-e.y},o={x:r.x-e.x,y:r.y-e.y},i=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),a=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return 180*Math.acos((n.x*o.x+n.y*o.y)/(i*a))/Math.PI}function ice(e){var t=e.corners,r=e.width,n=e.height,o=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;t.forEach((function(e){var t=e.location,r=t.x,n=t.y;o=Math.min(o,r),i=Math.min(i,n),a=Math.max(a,r),s=Math.max(s,n)}));var c=.02;return o/r>=c&&i/n>=c&&(n-s)/n>=c&&(r-a)/r>=c}function ace(){return sce.apply(this,arguments)}function sce(){return(sce=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l,d,f,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=p.length>0&&void 0!==p[0]?p[0]:{},r=t.canvas,n=t.paddingPercent,o=void 0===n?.04:n,i=r.width,a=r.height,s=Math.floor(i*o),c=Math.floor(a*o),u=i-2*s,l=a-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=u,d.height=l,f.drawImage(r,s,c,u,l,0,0,u,l),e.abrupt("return",nq.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cce(e){for(var t=e.length,r=0;r<t;r++){var n=(r+t-1)%t,o=(r+1)%t,i=oce(e[r].location,e[n].location,e[o].location);if(i<70||i>110)return!1}return!0}function uce(e){return lce.apply(this,arguments)}function lce(){return(lce=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.blazefaceModel,n=t.predictedIdCardCanvas,o=t.frontSide,i=n.width,a=n.height,s=Math.floor(i/3),c=Math.floor(4*a/5),u=document.createElement("canvas"),l=u.getContext("2d"),u.width=s,u.height=c,l.drawImage(n,0,Math.floor(a/5),s,c,0,0,s,c),e.next=12,GV.getModelPredictions({model:r,sCanvas:u});case 12:if(d=e.sent,f=d.filter((function(e){var t=e.topLeft,r=e.bottomRight,n=Ky(e.probability,1)[0],o=e.landmarks;return!(n<.9||o.length<4)&&!(FV.rectAreaRatio({small:{coords:[t,r]},big:{coords:[[0,0],[GV.SIZE,GV.SIZE]]}})<.025)})),p=f.length,!o){e.next=22;break}if(0!==p){e.next=18;break}return e.abrupt("return",Zse.id_detector_error_front_side_no_faces);case 18:if(!(p>1)){e.next=20;break}return e.abrupt("return",Zse.id_detector_error_front_side_multiple_faces);case 20:e.next=24;break;case 22:if(!(p>0)){e.next=24;break}return e.abrupt("return",Zse.id_detector_error_back_side_has_faces);case 24:return e.abrupt("return",null);case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var dce,fce,pce,hce,mce,gce,vce,yce,bce,wce,Cce,kce,Sce,Ece,Bce,_ce,xce,Tce,Ace=function(e){var t=y1(e,"card.corners");if(t&&Array.isArray(t)&&t.length>0){var r=y1(t,"[0].location"),n=r.x,o=r.y;return"".concat(n,":").concat(o)}return"-1:-1"},Ice=function(e){var t,r,n,o,i,a,s=e.canvas,c=e.cardPosition,u=e.quality,l=void 0===u?1:u;if(!c||!c.corners||!Array.isArray(c.corners))return null;var d=Ky(c.corners,3),f=d[0],p=d[1],h=d[2],m=(null==p||null===(t=p.location)||void 0===t?void 0:t.x)-(null==f||null===(r=f.location)||void 0===r?void 0:r.x)-2*xre,g=(null==h||null===(n=h.location)||void 0===n?void 0:n.y)-(null==p||null===(o=p.location)||void 0===o?void 0:o.y)-2*xre,v=document.createElement("canvas");v.width=m,v.height=g,v.getContext("2d").drawImage(s,(null==f||null===(i=f.location)||void 0===i?void 0:i.x)+xre,(null==f||null===(a=f.location)||void 0===a?void 0:a.y)+xre,m,g,0,0,m,g);var y=v.toDataURL("image/jpeg",l);return zj.base64ToMD5({base64:y}).toString()},Pce=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.cardPosition,o=t.quality,i=t.count,a=void 0===i?3:i,n&&n.corners&&Array.isArray(n.corners)){e.next=3;break}return e.abrupt("return",[]);case 3:s=[];case 4:if(!(s.length<a)){e.next=12;break}if(c=performance.now(),u=Ice({canvas:r,cardPosition:n,quality:o}),s.push(u),!(s.length<a)){e.next=10;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=Math.floor(performance.now()-c),t=180-c>0?180-c:0,e.next=4,new Promise((function(e){return setTimeout(e,t)}));case 4:case"end":return e.stop()}}),e)}))(),"t0",10);case 10:e.next=4;break;case 12:return e.abrupt("return",s);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Rce=function(e,t){var r;if(0===t.length||t.includes("vn.national_id"))return!0;if("cmnd_new.back"===e&&t.includes("vn.cccd")||"cccd.back"===e&&t.includes("vn.cmnd_new"))return!0;var n=t.map((function(e){return e.replace("vn.","")})),o=null===(r=e.split("."))||void 0===r?void 0:r.filter((function(e){return"front"!==e&&"back"!==e&&"vn"!==e}));return n.some((function(e){return o.some((function(t){return e===t}))}))},Dce=["width","height","type"],Oce=dB($se)(dce||(dce=Wy([""]))),Nce=dB.img(fce||(fce=Wy(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),Lce=$7,Mce=kte,Fce=dB.div(pce||(pce=Wy(["\n ","\n ","\n"])),eee,Bte),Uce=dB.img(hce||(hce=Wy(["\n border-radius: 5px;\n opacity: 0.7;\n width: ",";\n height: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.cardIcon.width",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.cardIcon.height",Are)})),jce=10,Vce=60,zce=dB.div(mce||(mce=Wy(["\n cursor: pointer;\n text-align: center;\n width: ",";\n height: ",";\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.captureIcon.width",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.captureIcon.height",Are)}),s5+20,b1.isMobile?YE(["top:",";"],(function(e){return e.y})):YE(["bottom:","px;"],jce)),qce=dB.div(gce||(gce=Wy(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ",";\n height: ",";\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.loadingIcon.width",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.loadingIcon.height",Are)}),s5+20),Hce=dB.div(vce||(vce=Wy(["\n color: #fff;\n text-align: center;\n"]))),Wce=dB.div(yce||(yce=Wy(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),s5+20),Kce=dB.div(bce||(bce=Wy(["\n display: flex;\n align-items: center;\n"]))),Qce=dB(Hce)(wce||(wce=Wy(["\n margin-left: 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.title.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.title.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.title.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.title.backgroundColor",Are)})),Gce=dB(Hce)(Cce||(Cce=Wy(["\n font-size: 20px;\n margin-left: 10px;\n color: green;\n position: absolute;\n left: 0;\n top: 10px;\n background: white;\n z-index: ",";\n"])),s5+30),Xce=dB(Hce)(kce||(kce=Wy(["\n position: absolute;\n text-align: center;\n top: ",";\n z-index: ",";\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){return e.y}),s5+20,(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.border",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.instruction.borderRadius",Are)})),Yce=dB(Xce)(Sce||(Sce=Wy(["\n padding: ",";\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.padding",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.border",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.error.borderRadius",Are)})),$ce=dB(Hce)(Ece||(Ece=Wy(["\n position: absolute;\n text-align: center;\n padding: 5px 10px;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n"])),(function(e){return e.y}),s5+20,(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.color",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.border",Are)}),(function(e){var t=e.theme;return t5(t,"IDCapturing.countdown.borderRadius",Are)})),Zce=(dB.div(Bce||(Bce=Wy(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),function(e){var t=e.width,r=e.height,n=e.type,o=Vy(e,Dce),i=mB(),a=Jj.useAsset("id_card_frame.png"),s=Jj.useAsset("id_card_frame_error.png"),c=Jse(e,i);return xw.createElement(Fce,{width:t,height:r},xw.createElement(Nce,{src:n===Yse.ERROR?s:a,width:t,height:r}),xw.createElement(Oce,Ry({type:n},o,c)))}),Jce=uL.IDCardMessage,eue=dB.div(_ce||(_ce=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n ","\n"])),(function(e){var t=e.theme;return YE(["border-radius:",";padding:",";"],t5(t,"popup.borderRadius",e5),t5(t,"IDCapturing.timeoutPopup.padding",Are))})),tue=dB.div(xce||(xce=Wy(["\n ","\n"])),(function(e){var t=e.theme;return YE(["color:",";font-size:",";font-weight:",";text-align:",";border:",";border-radius:",";"],t5(t,"IDCapturing.timeoutPopup.text.color",Are),t5(t,"IDCapturing.timeoutPopup.text.fontSize",Are),t5(t,"IDCapturing.timeoutPopup.text.fontWeight",Are),t5(t,"IDCapturing.timeoutPopup.text.textAlign",Are),t5(t,"IDCapturing.timeoutPopup.text.border",Are),t5(t,"IDCapturing.timeoutPopup.text.borderRadius",Are))})),rue=dB.button(Tce||(Tce=Wy(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: ",";\n cursor: pointer;\n ","\n"])),(function(e){var t=e.theme;return t5(t,"IDCapturing.timeoutPopup.button.height",Are)}),(function(e){var t=e.theme;return YE(["color:",";font-size:",";font-weight:",";background-color:",";border:",";border-radius:",";outline:",";"],t5(t,"IDCapturing.timeoutPopup.button.color",Are),t5(t,"IDCapturing.timeoutPopup.button.fontSize",Are),t5(t,"IDCapturing.timeoutPopup.button.fontWeight",Are),t5(t,"IDCapturing.timeoutPopup.button.backgroundColor",Are),t5(t,"IDCapturing.timeoutPopup.button.border",Are),t5(t,"IDCapturing.timeoutPopup.button.borderRadius",Are),t5(t,"IDCapturing.timeoutPopup.button.outline",Are))})),nue=function(e){var t=e.onOk,r=e.maxSessionTime,n=yj.useSDKSettings().lang;return xw.createElement(eue,null,xw.createElement(tue,{className:"popup-message"},i9(Jce.TIMEOUT_INSTRUCTION[n])({x:r})),xw.createElement(rue,{className:"popup-button",onClick:t},_re.BTN_OK[n]))};nue.propTypes={onOk:xC.func,maxSessionTime:xC.number},nue.defaultProps={onOk:function(){},maxSessionTime:30};var oue=function(){var e=Ky(xw.useState(!1),2),t=e[0],r=e[1],n=Ky(xw.useState(null),2),o=n[0],i=n[1],a=Ky(xw.useState({}),2),s=a[0],c=a[1];return{showPopup:xw.useCallback((function(e){var t=e.popupType,n=e.props;c(void 0===n?{}:n),i(t),r(null!==t)}),[]),popupShown:t,popupType:o,props:s}},iue={SESSION_TIMEOUT:"SESSION_TIMEOUT",CONFIRM:"CONFIRM",QR_INVALID:"QR_INVALID",QR_INSTRUCTIONS:"QR_INSTRUCTIONS"};function aue(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}var sue=aue;function cue(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=q5(r))==r?r:0),void 0!==t&&(t=(t=q5(t))==t?t:0),sue(q5(e),t,r)}var uue=cue,lue="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function due(){return fue.apply(this,arguments)}function fue(){return(fue=xy(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.url,n=void 0===r?lue:r,e.abrupt("return",new Promise((function(e,t){var r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("type","text/javascript"),r.setAttribute("id","opencvjs"),r.addEventListener("load",xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!window.cv||!window.cv.getBuildInformation){t.next=4;break}e(),t.next=12;break;case 4:if(!(window.cv instanceof Promise)){t.next=11;break}return t.next=7,window.cv;case 7:window.cv=t.sent,e(),t.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return t.stop()}}),t)})))),r.addEventListener("error",(function(){t()})),r.src=n;var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(r,o)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var pue=S9(due),hue={vn:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/models/id-card/tflite/model-v3.tflite",ph:"https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.3/models/id-card/tflite/ph_card_model.tflite"},mue={vn:.4,ph:.5},gue={0:"top-left",1:"top-right",2:"bottom-right",3:"bottom-left",4:"cccd.front",5:"passport",6:"cmnd_old.front",7:"cmnd_old.back",8:"cmnd_new.front",9:"cmnd_new.back",10:"cccd_new.front",11:"cccd_new.back",12:"aadhaar_front",13:"aadhaar_back",14:"voter_front",15:"voter_back",16:"pan",17:"dl",18:"india_spassport",19:"aadhaar_letter",20:"pan_back",21:"passport_back",22:"unseen",23:"other",24:"BUREAU OF INTERNAL REVENUE",25:"COMMISSION ON ELECTIONS",26:"COVID VACCINATION CARD",27:"DRIVERS LICENSE",28:"HEALTH INSURANCE PHILHEALTH",29:"PAG-IBIG LOYALTY CARD",30:"PASSPORT",31:"PHILIPPINE IDENTIFICATION CARD",32:"POSTAL IDENTITY CARD",33:"PROFESSIONAL IDENTIFICATION CARD",34:"RESIDENT IDENTIFICATION CARD",35:"SOCIAL SECURITY SYSTEM",36:"UNIFIED MULTI PURPOSE ID",37:"VN_biz_license",38:"new_voter_front"};function vue(e){var t,r,n,o,i,a=e.card,s=e.corners,c=a.box,u={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},l=c[2]-c[0],d=c[1]-c[3],f=nb(s);try{for(f.s();!(i=f.n()).done;){var p=i.value;switch(p.label){case"top-left":t||(t=p.location);break;case"top-right":r||(r=p.location);break;case"bottom-right":n||(n=p.location);break;case"bottom-left":o||(o=p.location)}}}catch(e){f.e(e)}finally{f.f()}if(![t,r,n,o].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var h={x:(t.x+n.x)/2,y:(t.y+n.y)/2},m={x:(r.x+o.x)/2,y:(r.y+o.y)/2},g=ece(u,h),v=ece(u,m);return Math.sqrt(g)>(l+d)/8||Math.sqrt(v)>(l+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var yue=function(){function e(t){Ty(this,e),this.country=t||"vn",this.defaultModelUrl=hue[this.country]||hue.vn}var t,r,n,o,i,a,s;return Iy(e,[{key:"load",value:(s=xy(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.opencvUrl,n=t.modelUrl,e.next=3,Promise.all([pue({url:r}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"predictDummyInput",value:(a=xy(regeneratorRuntime.mark((function e(){var t,r,n,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,n=r.tidy((function(){var e=r.zeros(o.inputShape,"float32");return o.model.predict(e)})),e.abrupt("return",Promise.all([n[this.out_score_name].data()]));case 3:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"loadModel",value:(i=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,Vq.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,Vq.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,o=this.model.inputs,this.inputShape=o[0].shape,i=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),a=Ky(i,3),this.out_score_name=a[0],this.out_class_name=a[1],this.out_box_name=a[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"loadResource",value:(o=xy(regeneratorRuntime.mark((function e(){var t,r,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},r=t.modelUrl,n=void 0===r?this.defaultModelUrl:r,e.next=3,Vq.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"dispose",value:(n=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.model&&this.model.dispose();case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"predict",value:(r=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,C,k,S,E,B,_,x,T,A,I,P,R=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=R.length>1&&void 0!==R[1]?R[1]:{},n=r.imgMargin,o=r.detectThreshold,i=void 0===o?.3:o,a=r.maxNumReturns,s=void 0===a?100:a,c=window,u=c.cv,l={},d=t.width,f=t.height,l.originalWidth=d,l.originalHeight=f,p=rce({canvas:t,imgMargin:"number"==typeof n?n:mue[this.country]}),h=p.margin,m=p.mat,g=this.inputShape.slice(1,3),v=Ky(g,2),y=v[0],b=v[1],w=new u.Mat,u.resize(m,w,new u.Size(y,b),0,0,u.INTER_AREA),C=m.cols/y,k=m.rows/b,(S=document.createElement("canvas")).width=y,S.height=b,S.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(w.data),w.cols,w.rows),0,0),m.delete(),w.delete(),l.canvas=S,l.margin=h,E=performance.now(),e.next=25,this.detect(S,{detectThreshold:i,maxNumReturns:s});case 25:if(B=e.sent,_=Math.floor(performance.now()-E),x={inputImage:l,card:null,exeTime:_},T=[[],[],[],[]],A=[],I=[],B.forEach((function(e){var t=Ky(e.box,4),r=t[0],n=t[1],o=t[2],i=t[3];e.clazz<=3?T[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:uue(Math.floor((i+n)/2*C-h),0,d),y:uue(Math.floor((r+o)/2*k-h),0,f)},scaledLocation:{x:uue(Math.floor((i+n)/2),0,S.width),y:uue(Math.floor((r+o)/2),0,S.height)}}):I.push({label:e.label,score:e.score,box:[uue(Math.floor(r*k-h),0,f),uue(Math.floor(n*C-h),0,d),uue(Math.floor(o*k-h),0,f),uue(Math.floor(i*C-h),0,d)]})})),T.forEach((function(e){e.length&&(e.sort((function(e,t){return t.score-e.score})),A.push(e[0]))})),!(I.length>0&&4===A.length)){e.next=49;break}if(I.sort((function(e,t){return t.score-e.score})),A.sort((function(e,t){return e.clazz-t.clazz})),P=I[0],e.prev=37,vue({card:P,corners:A})){e.next=41;break}return console.debug("Not qualified.",P,A),e.abrupt("return",x);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",x);case 46:return P.corners=A,x.card=P,e.abrupt("return",x);case 49:return e.abrupt("return",x);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return r.apply(this,arguments)})},{key:"detect",value:(t=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,C,k,S,E,B=this,_=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=_.length>1&&void 0!==_[1]?_[1]:{},n=r.detectThreshold,o=r.maxNumReturns,i=window,a=i.tf,s=t.width,c=t.height,u=a.tidy((function(){var e=a.expandDims(a.cast(a.image.resizeBilinear(a.browser.fromPixels(t),B.inputShape.slice(1,3)),"float32"));return B.model.predict(e)})),e.next=7,Promise.all([u[this.out_score_name].data(),u[this.out_class_name].data(),u[this.out_box_name].array()]);case 7:l=e.sent,d=Ky(l,3),f=d[0],p=d[1],h=Ky(d[2],1),m=h[0],g=Math.min(f.length,o),v=[];try{for(y=0;y<g;y++)b=f[y],w=p[y],b>n&&(k=null!==(C=gue[Math.round(w)])&&void 0!==C?C:"NA",S=m[y],E=[S[0]*c,S[3]*s,S[2]*c,S[1]*s],v.push({score:b,clazz:w,box:E,label:k}))}catch(e){console.log(e)}return e.abrupt("return",v.length>=5?v:[]);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();class bue{static hasCamera(){return bue.listCameras(!1).then((e=>!!e.length)).catch((()=>!1))}static listCameras(e=!1){if(!navigator.mediaDevices)return Promise.resolve([]);let t=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((e=>t=e)).catch((()=>{})):Promise.resolve()).then((()=>navigator.mediaDevices.enumerateDevices())).then((e=>e.filter((e=>"videoinput"===e.kind)).map(((e,t)=>({id:e.deviceId,label:e.label||(0===t?"Default Camera":`Camera ${t+1}`)}))))).finally((()=>{if(t)for(const e of t.getTracks())e.stop(),t.removeTrack(e)}))}constructor(e,t,r=this._onDecodeError,n=this._calculateScanRegion,o="environment"){this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=t,this._legacyCanvasSize=bue.DEFAULT_CANVAS_SIZE,this._preferredCamera=o,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof r?(this._legacyCanvasSize=r,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=r,"number"==typeof n?(this._legacyCanvasSize=n,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._calculateScanRegion=n,this._scanRegion=this._calculateScanRegion(e),this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let i=!1;e.hidden&&(e.hidden=!1,i=!0),document.body.contains(e)||(document.body.appendChild(e),i=!0),requestAnimationFrame((()=>{const t=window.getComputedStyle(e);"none"===t.display&&(e.style.setProperty("display","block","important"),i=!0),"visible"!==t.visibility&&(e.style.setProperty("visibility","visible","important"),i=!0),i&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity=0,e.style.width=0,e.style.height=0)})),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),this._qrEnginePromise=bue.createQrEngine()}hasFlash(){let e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((({stream:t})=>(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=t,t.getVideoTracks()[0])))).then((e=>"torch"in e.getSettings())).catch((()=>!1)).finally((()=>{if(e)for(const t of e.getTracks())t.stop(),e.removeTrack(t)}))}isFlashOn(){return this._flashOn}toggleFlash(){return this._flashOn?this.turnFlashOff():this.turnFlashOn()}turnFlashOn(){return this._flashOn?Promise.resolve():(this._flashOn=!0,!this._active||this._paused?Promise.resolve():this.hasFlash().then((e=>e?this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]}):Promise.reject("No flash available"))).catch((()=>{throw this._flashOn=!1,e})))}turnFlashOff(){if(this._flashOn)return this._flashOn=!1,this._restartVideoStream()}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),this.stop(),bue._postWorkerMessage(this._qrEnginePromise,"close")}start(){return this._active&&!this._paused?Promise.resolve():("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,document.hidden?Promise.resolve():(this._paused=!1,this.$video.srcObject?(this.$video.play(),Promise.resolve()):this._getCameraStream().then((({stream:e,facingMode:t})=>{this.$video.srcObject=e,this.$video.play(),this._setVideoMirror(t),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch((()=>{})))})).catch((e=>{throw this._active=!1,e}))))}stop(){this.pause(),this._active=!1}pause(e=!1){if(this._paused=!0,!this._active)return Promise.resolve(!0);this.$video.pause();const t=()=>{const e=this.$video.srcObject?this.$video.srcObject.getTracks():[];for(const t of e)t.stop(),this.$video.srcObject.removeTrack(t);this.$video.srcObject=null};return e?(t(),Promise.resolve(!0)):new Promise((e=>setTimeout(e,300))).then((()=>!!this._paused&&(t(),!0)))}setCamera(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}static scanImage(e,t=null,r=null,n=null,o=!1,i=!1){const a=r instanceof Worker;let s=Promise.all([r||bue.createQrEngine(),bue._loadImage(e)]).then((([e,i])=>{let s;return r=e,[n,s]=this._drawToCanvas(i,t,n,o),r instanceof Worker?(a||r.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,t)=>{let o,i,a;i=n=>{"qrResult"===n.data.type&&(r.removeEventListener("message",i),r.removeEventListener("error",a),clearTimeout(o),null!==n.data.data?e(n.data.data):t(bue.NO_QR_CODE_FOUND))},a=e=>{r.removeEventListener("message",i),r.removeEventListener("error",a),clearTimeout(o);const n=e?e.message||e:"Unknown Error";t("Scanner error: "+n)},r.addEventListener("message",i),r.addEventListener("error",a),o=setTimeout((()=>a("timeout")),1e4);const c=s.getImageData(0,0,n.width,n.height);r.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise(((e,t)=>{const o=setTimeout((()=>t("Scanner error: timeout")),1e4);r.detect(n).then((r=>{r.length?e(r[0].rawValue):t(bue.NO_QR_CODE_FOUND)})).catch((e=>t("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(o)))}))}));return t&&i&&(s=s.catch((()=>bue.scanImage(e,null,r,n,o)))),s=s.finally((()=>{a||bue._postWorkerMessage(r,"close")})),s}setGrayscaleWeights(e,t,r,n=!0){bue._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:t,blue:r,useIntegerApproximation:n})}setInversionMode(e){bue._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=bue.WORKER_PATH){return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((t=>-1!==t.indexOf("qr_code")?new BarcodeDetector({formats:["qr_code"]}):new Worker(e)))}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video)}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){const t=Math.min(e.videoWidth,e.videoHeight),r=Math.round(2/3*t);return{x:Math.round((e.videoWidth-r)/2),y:Math.round((e.videoHeight-r)/2),width:r,height:r,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_scanFrame(){if(!this._active||this.$video.paused||this.$video.ended)return!1;requestAnimationFrame((()=>{this.$video.readyState<=1?this._scanFrame():this._qrEnginePromise.then((e=>bue.scanImage(this.$video,this._scanRegion,e,this.$canvas))).then(this._onDecode,(e=>{if(!this._active)return;-1!==(e.message||e).indexOf("service unavailable")&&(this._qrEnginePromise=bue.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==bue.NO_QR_CODE_FOUND&&console.log(e)}_getCameraStream(){if(!navigator.mediaDevices)return Promise.reject("Camera not found.");const e="environment"===this._preferredCamera||"user"===this._preferredCamera?"facingMode":"deviceId",t=[{width:{min:1024}},{width:{min:768}},{}];return[...t.map((t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}}))),...t].reduceRight(((e,t)=>()=>navigator.mediaDevices.getUserMedia({video:t,audio:!1}).then((e=>({stream:e,facingMode:this._getFacingMode(e)||(t.facingMode?this._preferredCamera:"environment"===this._preferredCamera?"user":"environment")}))).catch(e)),(()=>Promise.reject("Camera not found.")))()}_restartVideoStream(){const e=this._paused;return this.pause(!0).then((t=>{if(t&&!e&&this._active)return this.start()}))}_setVideoMirror(e){const t="user"===e?-1:1;this.$video.style.transform="scaleX("+t+")"}_getFacingMode(e){const t=e.getVideoTracks()[0];return t?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}static _drawToCanvas(e,t=null,r=null,n=!1){r=r||document.createElement("canvas");const o=t&&t.x?t.x:0,i=t&&t.y?t.y:0,a=t&&t.width?t.width:e.width||e.videoWidth,s=t&&t.height?t.height:e.height||e.videoHeight;if(!n){const e=t&&t.downScaledWidth?t.downScaledWidth:a,n=t&&t.downScaledHeight?t.downScaledHeight:s;r.width!==e&&(r.width=e),r.height!==n&&(r.height=n)}const c=r.getContext("2d",{alpha:!1});return c.imageSmoothingEnabled=!1,c.drawImage(e,o,i,a,s,0,0,r.width,r.height),[r,c]}static _loadImage(e){if(e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||window.ImageBitmap&&e instanceof window.ImageBitmap||window.OffscreenCanvas&&e instanceof window.OffscreenCanvas)return Promise.resolve(e);if(e instanceof Image)return bue._awaitImageLoad(e).then((()=>e));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){const t=new Image;return e instanceof File||e instanceof Blob?t.src=URL.createObjectURL(e):t.src=e,bue._awaitImageLoad(t).then((()=>((e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(t.src),t)))}return Promise.reject("Unsupported image type.")}static _awaitImageLoad(e){return new Promise(((t,r)=>{if(e.complete&&0!==e.naturalWidth)t();else{let n,o;n=()=>{e.removeEventListener("load",n),e.removeEventListener("error",o),t()},o=()=>{e.removeEventListener("load",n),e.removeEventListener("error",o),r("Image load error")},e.addEventListener("load",n),e.addEventListener("error",o)}}))}static _postWorkerMessage(e,t,r){return Promise.resolve(e).then((e=>{e instanceof Worker&&e.postMessage({type:t,data:r})}))}}function wue(){return Cue.apply(this,arguments)}function Cue(){return(Cue=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return bue.WORKER_PATH=mW(),e.next=3,bue.createQrEngine(bue.WORKER_PATH);case 3:return t=e.sent,e.abrupt("return",{qrEngine:t});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kue(){return Sue.apply(this,arguments)}function Sue(){return(Sue=xy(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([wue()]);case 2:return t=e.sent,r=Ky(t,1),n=r[0].qrEngine,e.abrupt("return",{qrScannerResources:{engine:n,canvas:document.createElement("canvas")},noModel:!0});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}bue.DEFAULT_CANVAS_SIZE=400,bue.NO_QR_CODE_FOUND="No QR code found",bue.WORKER_PATH="qr-scanner-worker.min.js";var Eue="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function Bue(){return _ue.apply(this,arguments)}function _ue(){return(_ue=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=xy(regeneratorRuntime.mark((function e(){var t,r,n,a,s,c,u,l,d,f,p,h,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="detect.prototxt",r="detect.caffemodel",n="sr.prototxt",a="sr.caffemodel",o){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return u=[i(t),i(r),i(n),i(a)],e.next=11,Promise.all(u);case 11:l=e.sent,d=Ky(l,4),f=d[0],p=d[1],h=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",p,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",h,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),o=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},a=function(){return s.apply(this,arguments)},t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.modelUrl,n=void 0===r?Eue:r,i=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(t));case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:return o=e.sent,e.abrupt("return",new Uint8Array(o));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,a();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",kue());case 13:return e.abrupt("return",{qrModel:o});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var xue=S9(Bue),Tue=900;function Aue(e){return Iue.apply(this,arguments)}function Iue(){return(Iue=xy(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,e.abrupt("return",new Promise((function(e,t){setTimeout(t,Tue),r.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pue(e){return Rue.apply(this,arguments)}function Rue(){return(Rue=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.idCardModel,n=!0,e.prev=2,o=performance.now(),e.next=6,Aue({idCardModel:r});case 6:(i=performance.now())-o+.6*(i-o)>Tue&&(n=!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n=!1;case 13:return e.abrupt("return",{fastEnough:n});case 14:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function Due(){return Oue.apply(this,arguments)}function Oue(){return(Oue=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c,u,l,d,f,p,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.blazefaceModelUrl,i=t.tfScriptUrls,a=t.wechatQRModelsUrl,s=h.length>1?h[1]:void 0,e.next=4,T9({blazefaceModelUrl:o,tfScriptUrls:i});case 4:return c=e.sent,u=c.blazefaceModel,l=!0,d=new yue(s),e.prev=8,e.next=11,d.load({opencvUrl:r,modelUrl:n});case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(8),e.abrupt("return",{ableToUseModel:!1});case 16:return e.next=18,xue({modelUrl:a});case 18:return e.prev=18,e.next=21,Pue({idCardModel:d});case 21:f=e.sent,p=f.fastEnough,l=p,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),l=!1;case 29:return e.abrupt("return",{ableToUseModel:l,idCardModel:d,blazefaceModel:u});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var Nue=S9(Due),Lue=uL.Errors,Mue=function(){return{imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}},Fue=function(){return{imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}};function Uue(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.allowedCardTypes,a=e.onError,s=e.frontSide,c=e.onAutoCaptureSuccess,u=e.quality,l=xw.useRef(null);null===l.current&&(l.current=document.createElement("canvas"));var d=xw.useRef([]),f=xw.useRef({}),p=xw.useRef(!1),h=xw.useRef([]),m=xw.useRef(!1),g=xw.useRef(null),v=Ky(xw.useState(!1),2),y=v[0],b=v[1],w=xw.useRef(Mue()),C=xw.useRef(Fue()),k=xw.useRef(!1),S=xw.useRef(!1),E=xw.useRef(null),B=xw.useRef(!1),_=xw.useRef({}),x=yj.useSDKSettings(),T=x.customUrls,A=x.country,I=xw.useMemo((function(){return Array.isArray(i)&&i.length>0?i:null==o?void 0:o.allowedCardTypesFromSettings}),[i,null==o?void 0:o.allowedCardTypesFromSettings]);xw.useEffect((function(){var e=!1;function t(){return(t=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o||y){t.next=14;break}if(!o.enableIdDetection){t.next=10;break}return t.next=4,Nue(T,A);case 4:return _.current=t.sent,t.next=7,Vq.initTensorFlow();case 7:E.current=o.enableBlurCheck&&_.current.ableToUseModel,t.next=11;break;case 10:E.current=!1;case 11:if(!e){t.next=13;break}return t.abrupt("return");case 13:b(!0);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return function(){t.apply(this,arguments)}(),function(){e=!0}}),[y,o,T,A]);var P=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pce({canvas:l.current,cardPosition:t,quality:u});case 2:d.current=e.sent;case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u]),R=xw.useCallback((function(){!0===m.current&&(m.current=!1)}),[]),D=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,i,a,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,i=o.blurThreshold,a=w.current,s=C.current,p.current=!1,!(r<i&&BV.hasBetterCardBlurScore(r,a.blurScore))){e.next=20;break}if(!B.current){e.next=10;break}a.imageBlob=s.imageBlob,e.next=16;break;case 10:return c=l.current,a.hash=Ice({canvas:c,cardPosition:n,quality:u}),e.next=14,xV.takePicture({canvas:c,quality:u});case 14:a.imageBlob=e.sent,a.captureTime=Date.now();case 16:a.takenAt=(new Date).getTime(),a.blurScore=r,a.detectedCard=n,a.captureType="auto";case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,u]),O=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.blurScore,n=t.detectedCard,S.current=!0,o=C.current,!BV.hasBetterCardBlurScore(r,o.blurScore)){e.next=16;break}return i=l.current,o.hash=Ice({canvas:i,cardPosition:n,quality:u}),e.next=8,xV.takePicture({canvas:i,quality:u});case 8:o.imageBlob=e.sent,o.captureDuration+=Date.now()-o.captureTime,o.captureTime=Date.now(),o.blurScore=r,o.detectedCard=n,o.captureCount++,o.captureType="manual",B.current=!0;case 16:S.current=!1;case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[u]),N=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.waitForBestImageTimeMs,r=o.enableVirtualCamHashes,null===(n=w.current).imageBlob){e.next=12;break}if(!((new Date).getTime()-n.takenAt>t)){e.next=12;break}if(!r){e.next=9;break}p.current=!0,e.next=12;break;case 9:return e.next=11,c(n);case 11:R();case 12:case"end":return e.stop()}}),e)}))),[o,c,R]),L=xw.useCallback((function(){k.current=!0}),[]),M=xw.useCallback((function(){return new Promise((function(e){k.current=!1;var t=setInterval((function(){S.current||(clearInterval(t),e())}),150)}))}),[]),F=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var t=o.blurThreshold,r=o.enableVirtualCamHashes,n=C.current;if(n.captureTime=Date.now(),E.current)L(),setTimeout((function(){M().then(xy(regeneratorRuntime.mark((function o(){var i,a;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(BV.hasBetterCardBlurScore(n.blurScore,t)||(n.error=Lue.id_detector_error_blur),i=l.current,null!==n.imageBlob){o.next=7;break}a=Ice({canvas:i,cardPosition:n.detectedCard}),xV.takePicture({canvas:i,quality:u}).then(function(){var t=xy(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),n.hash=a,!r){t.next=6;break}return t.next=6,P(n.detectedCard);case 6:e(n);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.next=11;break;case 7:if(!r){o.next=10;break}return o.next=10,P(n.detectedCard);case 10:e(n);case 11:case"end":return o.stop()}}),o)}))))}),2e3);else{var i=Ice({canvas:l.current,cardPosition:f.current,quality:u});xV.takePicture({canvas:l.current,quality:u}).then(function(){var t=xy(regeneratorRuntime.mark((function t(o){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.imageBlob=o,n.captureTime=Date.now(),n.hash=i,!r){t.next=6;break}return t.next=6,P(n.detectedCard);case 6:e(n);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}})));case 1:case"end":return e.stop()}}),e)}))),[o,L,M,u,P]),U=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,i,u,f,v,b,S,E,x,T,L,M,F,U,j,V,z,q,H,W,K;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&y&&!m.current){e.next=2;break}return e.abrupt("return");case 2:w.current=Mue(),C.current=Fue(),r=o.enableAutoCapture,n=o.enableBlurCheck,i=o.enableIdDetection,u=o.enableVirtualCamHashes,f=o.country,v=_.current,b=v.idCardModel,S=v.blazefaceModel,E=v.ableToUseModel,x=g.current,T=t.current,m.current=!0,L=x.cropX,M=x.cropY,F=x.cropWidth,U=x.cropHeight,j=x.cropWidthWithoutPadding,V=x.cropHeightWithoutPadding,(z=l.current).width=F,z.height=U,q=z.getContext("2d"),H=document.createElement("canvas"),W=H.getContext("2d"),K=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,l,g,v,y,_,x,Q;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(q.drawImage(T,L,M,F,U,0,0,F,U),t=performance.now(),B.current=!1,!i||!E){e.next=63;break}return l=null,e.next=7,b.predict(z,{detectThreshold:.3});case 7:if(g=e.sent,null==o||!o.trackCardCoordinates||C.current.imageBlob||w.current.imageBlob||h.current.push(Ace(g)),!g.card){e.next=59;break}if(!p.current&&!C.current.imageBlob&&d.current.length>0&&(d.current=[],p.current=!1),p.current&&setTimeout(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=3;break}return e.next=3,P(w.current.detectedCard);case 3:return e.next=5,c(w.current);case 5:R(),p.current=!1;case 7:case"end":return e.stop()}}),e)}))),0),!ice({corners:g.card.corners,width:F,height:U})){e.next=56;break}if(!cce(g.card.corners)){e.next=53;break}if(v=nce(z,g.card.corners),y=FV.rectAreaRatio({small:{area:v.width*v.height},big:{area:j*V}}),y1(o,"enableCardTypeCheck")&&I.length>0&&"vn"===f&&(_=y1(g,"card.label",""),Rce(_,I)||(l=Lue.not_allowed_card_types)),l){e.next=51;break}if(!(y<.5)){e.next=24;break}l=Lue.id_detector_card_too_small,e.next=51;break;case 24:if(!(y>.95)){e.next=28;break}l=Lue.id_detector_error_incomplete,e.next=51;break;case 28:return H.width=v.width,H.height=v.height,W.putImageData(v,0,0),e.next=33,ace({canvas:H});case 33:if(!e.sent){e.next=38;break}l=Lue.glare_detected,e.next=51;break;case 38:if("ph"===A){e.next=42;break}return e.next=41,uce({blazefaceModel:S,predictedIdCardCanvas:H,frontSide:s});case 41:l=e.sent;case 42:if(l){e.next=51;break}if(!n){e.next=51;break}if(x=BV.calculateIdCardBlurScore({canvas:H}),!k.current){e.next=48;break}return e.next=48,O({blurScore:x,detectedCard:g.card});case 48:if(!r){e.next=51;break}return e.next=51,D({blurScore:x,detectedCard:g.card});case 51:e.next=54;break;case 53:l=Lue.id_detector_validate_angle_error;case 54:e.next=57;break;case 56:l=Lue.id_detector_error_incomplete;case 57:e.next=60;break;case 59:l=Lue.id_detector_no_cards;case 60:return a(l),e.next=63,N();case 63:return t=Math.floor(performance.now()-t),Q=180-t>0?180-t:0,e.next=67,new Promise((function(e){return setTimeout(e,Q)}));case 67:m.current&&window.requestAnimationFrame(K);case 68:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(K);case 19:case"end":return e.stop()}}),e)}))),[o,y,t,a,N,c,R,A,P,s,O,D,I]);xw.useEffect((function(){var e=t.current;function o(){return(o=xy(regeneratorRuntime.mark((function t(){var r,o,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(g.current=xV.analyzeVideoAndWindowSizes(e,n,.05),r=g.current,o=r.cropWidth,i=r.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(o)&&!Number.isNaN(i)){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,U();case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r&&n&&y&&function(){o.apply(this,arguments)}()}),[r,n,t,R,U,y]);var j=xw.useCallback((function(){R()}),[R]);return xw.useEffect((function(){return j}),[j]),{refWorkingCanvas:l,stopCheckFrame:R,checkFrame:U,warmupDone:y,takePictureManually:F,refAbleToRunBurstMode:E,refVirtualFrames:d,refCardCoordinates:h}}var jue=function(){return{id:null,frames:[]}},Vue=180;function zue(){return[jue()]}function que(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=xw.useRef(null);null===i.current&&(i.current=document.createElement("canvas"));var a=xw.useRef(!1),s=xw.useRef(Jz.createResizer({width:960,height:640})),c=xw.useRef(null),u=xw.useRef(zue()),l=xw.useCallback((function(){!0===a.current&&(a.current=!1)}),[]),d=xw.useCallback((function(){u.current=zue()}),[]),f=xw.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push(jue())}),[]),p=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,i,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.workingCanvas,n=s.current,i=u.current,a=n.resize({srcCanvas:r}),c=a.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],i[i.length-1].frames.push({base64:c});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o]),h=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,s,u,l,d,f,h,m,g,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:if(r=o.frameCaptureIntervalMs,n=void 0===r?Vue:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:s=c.current,u=t.current,a.current=!0,l=s.cropX,d=s.cropY,f=s.cropWidth,h=s.cropHeight,(m=i.current).width=f,m.height=h,g=m.getContext("2d");case 13:return v=performance.now(),g.drawImage(u,l,d,f,h,0,0,f,h),e.next=18,p({workingCanvas:m});case 18:if(v=Math.floor(performance.now()-v),a.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,tV.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,p,o]);return xw.useEffect((function(){var e=t.current;function o(){return(o=xy(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c.current=xV.analyzeVideoAndWindowSizes(e,n),t.next=3,h();case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return r&&n&&function(){o.apply(this,arguments)}(),function(){l()}}),[r,n,t,l,f,h]),{refWorkingCanvas:i,stopCheckFrame:l,splitVideos:f,resetRecordedVideos:d,checkFrame:h,refRecordedVideos:u}}var Hue=function(e){var t=e.debug,r=e.refRecordedVideos,n=e.refWorkingCanvas,o=e.refVideo,i=e.onChange;xw.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,t=r.current,a=n.current,s=t[t.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==a?void 0:a.width,"canvas.height":null==a?void 0:a.height};i&&i(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[i,t,r,n,o])},Wue=function(e){var t=e.lang,r=e.onAboutToTimeout,n=e.onSessionTimeout,o=e.onVideoTimeLimitReached,i=e.settings,a=e.shouldStartTimers,s=e.sessionTime,c=xw.useRef(),u=Ky(xw.useState(0),2),l=u[0],d=u[1],f=xw.useCallback((function(){clearInterval(c.current)}),[]),p=xw.useCallback((function(){d((function(e){return e+1}))}),[]);return xw.useEffect((function(){if(a){var e=i.maxRecordingTimePerVideo,t=0,u=s/3;c.current=setInterval((function(){var i=s-(t+=1);i<=u&&r&&r({curTimeLeft:i}),t>0&&t%e==0&&o&&o(),0===i&&(f(),n&&n())}),1e3)}return function(){f()}}),[a,t,r,f,n,o,l,i,s]),{stopTimers:f,startTimers:p}};lW.initExifData();var Kue=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onModelErrorChange,a=e.frontSide,s=e.allowedCardTypes,c=e.onDebugInfoChange,u=e.onAboutToTimeout,l=e.onSessionTimeout,d=e.onCaptureDone,f=e.outputEncryptionSettings,p=e.quality,h=xw.useRef(!1),m=Ky(xw.useState(!1),2),g=m[0],v=m[1],y=xw.useRef((function(){})),b=Yj.useSDKTracking().sendEvent,w=xw.useRef(),C=xw.useRef(),k=xw.useRef(),S=yj.useSDKSettings(),E=S.debug,B=S.lang,_=S.enableAntiDebug,x=S.exifKey,T=hW(),A=T.startMotion,I=T.stopMotion,P=T.motionData,R=T.orientationData;xw.useEffect((function(){_&&zq.enableAntiDebug()}),[_]);var D=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b({tag:a?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,y.current(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[b,a]),O=xw.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];i.apply(void 0,t);var n=y1(t,"0.code");n&&n!==w.current&&(b({tag:a?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),w.current=n)}),[i,a,b]),N=Uue({refVideo:r,shouldStart:t,cropArea:n,allowedCardTypes:s,settings:o,onError:O,frontSide:a,onAutoCaptureSuccess:D,quality:p}),L=N.refWorkingCanvas,M=N.stopCheckFrame,F=N.checkFrame,U=N.warmupDone,j=N.takePictureManually,V=N.refAbleToRunBurstMode,z=N.refVirtualFrames,q=N.refCardCoordinates,H=que({refVideo:r,shouldStart:!1,cropArea:n,settings:o}),W=H.stopCheckFrame,K=H.splitVideos,Q=H.resetRecordedVideos,G=H.checkFrame,X=H.refRecordedVideos;Hue({debug:E,refRecordedVideos:X,refWorkingCanvas:L,refVideo:r,onChange:c});var Y=xw.useCallback((function(){W(),M(),Q(),l()}),[Q,W,M,l]),$=xw.useCallback((function(){K()}),[K]),Z=Wue({lang:B,onAboutToTimeout:u,onSessionTimeout:Y,onVideoTimeLimitReached:$,settings:o,shouldStartTimers:U&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),J=Z.stopTimers,ee=Z.startTimers,te=xw.useCallback((function(){h.current=!1}),[]),re=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return te(),ee(),e.next=4,Promise.all([G(),F()]);case 4:case"end":return e.stop()}}),e)}))),[te,ee,G,F]),ne=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r,n,i,s,c,u,l,p,m,g,y,w,S,E,B,_,T=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=T.length>0&&void 0!==T[0]?T[0]:{},r=t.imageBlob,n=t.error,i=t.detectedCard,s=t.captureTime,c=t.captureCount,u=t.captureDuration,l=t.captureType,p=t.hash,!h.current){e.next=3;break}return e.abrupt("return");case 3:return h.current=!0,v(!0),W(),M(),J(),O(null),m=null==o?void 0:o.enableVirtualCamHashes,g={},m&&null!==p&&(y=[p].concat(Gy(z.current))).length>0&&(g=y.reduce((function(e,t,r){return e["hash".concat(r+1)]=t,e}),{})),w=null==o?void 0:o.trackCardCoordinates,S="[".concat(q.current.slice(-(null==o?void 0:o.trackCardCoordinatesMaxLength)).toString(),"]"),I(),lW.preWriteExif({mode:lW.MODE.ID_CARD,motionData:P,orientationData:R,startTime:C.current,endTime:Date.now(),exifKey:x}),e.next=18,lW.writeExif({mode:lW.MODE.ID_CARD,imageData:Oy(Oy({detectedCard:i,captureTime:s,blob:r},m?{vCam:g}:{}),{},{captureCount:c,captureDuration:u,captureType:l},w?{cardTracking:S}:{}),enableExifData:null==o?void 0:o.enableExifData});case 18:if(E=e.sent,!f||!f.key){e.next=24;break}return _=f.key,e.next=23,Wq.encrypt({blob:E,key:_});case 23:B=e.sent;case 24:d({image:{blob:E,encrypted:B,detectedCard:i},error:n,recordedVideos:[]}),v(!1),b({tag:a?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-k.current)/1e3}});case 27:case"end":return e.stop()}}),e)}))),[W,M,J,O,d,a,b,f,P,R,I,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,x,null==o?void 0:o.trackCardCoordinates,null==o?void 0:o.trackCardCoordinatesMaxLength,z,q]);y.current=ne;var oe=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),J(),W(),V.current||M(),e.next=6,j();case 6:return t=e.sent,e.next=9,ne(t);case 9:v(!1),b({tag:a?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[j,ne,J,V,W,M,b,a]);return xw.useEffect((function(){t&&(b({tag:a?"id_front":"id_back",event:"user_activity.start",log:{}}),C.current=Date.now(),A())}),[b,a,t,A]),xw.useEffect((function(){U&&(b({tag:a?"id_front":"id_back",event:"user_activity.show",log:{}}),b({tag:a?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-C.current}}),k.current=performance.now())}),[b,a,U]),{warmupDone:U,isProcessing:g,takePictureManually:oe,restartSession:re,resetIsProcessingImageBlobTaken:te}},Que=uL.IDCardMessage,Gue=xw.forwardRef((function(e,t){var r=e.description,n=e.usePortraitMask,o=e.windowAndVideoInfo,i=e.refVideo,a=e.frontSide,s=e.allowedCardTypes,c=e.settings,u=e.onCaptureDone,l=e.onUISpacingChange,d=e.outputEncryptionSettings,f=mB(),p=Ky(xw.useState({}),2),h=p[0],m=p[1],g=h.yDescription,v=h.yMessage,y=h.yCaptureButton,b=r5(f,"IDCapturing.captureIcon.src","ic_camera.svg"),w=r5(f,"IDCapturing.loadingIcon.src","ic_loading.png"),C=Ky(xw.useState(""),2),k=C[0],S=C[1],E=yj.useSDKSettings(),B=E.debug,_=E.lang,x=Ky(xw.useState(null),2),T=x[0],A=x[1],I=Ky(xw.useState(""),2),P=I[0],R=I[1],D=Ky(xw.useState(null),2),O=D[0],N=D[1],L=oue(),M=L.showPopup,F=L.popupShown,U=L.popupType,j=xw.useCallback((function(e){R(null===e?"":i9(e.msg[_])({side:a?_re.FRONT[_]:_re.BACK[_]}))}),[_,a]),V=xw.useCallback((function(){A(""),M({popupType:iue.SESSION_TIMEOUT})}),[M]),z=xw.useCallback((function(){A(""),u.apply(void 0,arguments)}),[u]),q=xw.useCallback((function(e){var t=e.curTimeLeft;A(i9(Que.REMAINING_TIME[_])({x:t}))}),[_]),H=Kue({shouldStart:!0,refVideo:i,cropArea:O,settings:c,onModelErrorChange:j,frontSide:a,allowedCardTypes:s,onDebugInfoChange:S,onSessionTimeout:V,onCaptureDone:z,onAboutToTimeout:q,outputEncryptionSettings:d}),W=H.warmupDone,K=H.isProcessing,Q=H.takePictureManually,G=H.restartSession,X=H.resetIsProcessingImageBlobTaken,Y=xw.useCallback((function(){M({popupType:null}),X()}),[M,X]),$=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Y(),e.next=3,G();case 3:case"end":return e.stop()}}),e)}))),[G,Y]),Z=xw.useMemo((function(){return{backgroundColor:t5(f,"IDCapturing.backgroundColor",Are)}}),[f]);xw.useEffect((function(){if(o){var e,t,r,i,a,s,c,u=o.videoAreaWidth,d=o.videoAreaHeight,f=o.lostX,p=o.lostY,h=o.clientHeight;n?(a=.7*(s=d-165),r=(c=(e=p+10)+45)+20,i=(t=c+s+10)+60):(a=b1.isMobile?u-6:Math.floor(.7*u),r=(c=(e=p+10)+50)+20,i=(t=c+(s=Math.floor(Math.min(a/1.5,h-2*p-(Vce+2*jce)-100)))+10)+60);var g=Math.floor((u-a)/2)+f;N({x:g,y:c,width:a,height:s,surroundStyle:Z});var v={yTitle:e,yDescription:t,yMessage:r,yCaptureButton:i};m(v),l(v)}}),[o,n,l,Z]);var J=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(""),e.next=3,Q();case 3:case"end":return e.stop()}}),e)}))),[Q]);return xw.useImperativeHandle(t,(function(){return{restartSession:$}}),[$]),xw.createElement(xw.Fragment,null,!W&&xw.createElement(Y7,null),B&&xw.createElement(Gce,null,k),K&&xw.createElement(qce,null,xw.createElement("img",{src:w,alt:"",className:"spin"})),O&&xw.createElement(x5,{x:"".concat(O.x,"px"),y:"".concat(O.y,"px"),width:"".concat(O.width,"px"),height:"".concat(O.height,"px"),surroundStyle:O.surroundStyle},xw.createElement(Zce,{width:O.width,height:O.height,type:P?Yse.ERROR:Yse.DEFAULT})),!P&&xw.createElement(Xce,{y:"".concat(g,"px"),className:"description"},r),P&&xw.createElement(Yce,{y:"".concat(g,"px")},P),!K&&(!(null!=c&&c.disableCaptureButtonIfAlert)||!P)&&xw.createElement(zce,{onClick:J,y:"".concat(y,"px")},xw.createElement("img",{src:b,alt:""})),T&&xw.createElement($ce,{key:T,className:"message",y:"".concat(v,"px")},T),xw.createElement(Q7,{open:F},U===iue.SESSION_TIMEOUT&&xw.createElement(nue,{onOk:$,maxSessionTime:null==c?void 0:c.idCardSessionTime})))}));Gue.propTypes={usePortraitMask:xC.bool,description:xC.string,windowAndVideoInfo:xC.shape({}),refVideo:xC.shape({}),frontSide:xC.bool,allowedCardTypes:xC.arrayOf(xC.string),settings:xC.shape({}),onCaptureDone:xC.func,onUISpacingChange:xC.func,outputEncryptionSettings:xC.shape({})},Gue.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,allowedCardTypes:[],settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var Xue,Yue,$ue,Zue,Jue,ele,tle,rle,nle,ole,ile,ale,sle,cle={QR_INSTRUCTIONS_TEXT:{en:xw.createElement("span",null,"Please follow the instructions below to scan QR code:",xw.createElement("br",null),xw.createElement("br",null)," Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),vi:xw.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",xw.createElement("br",null),xw.createElement("br",null)," Đưa camera vào vị trí mã QR trên CCCD. Canh vừa mã QR vào 4 góc khung hình để quét mã")},QR_INSTRUCTIONS_START_BUTTON:{en:"Scan QR code",vi:"Tiến hành quét mã QR"},QR_INSTRUCTIONS_COUNTDOWN:{en:"Start in <%= x %> s",vi:"Bắt đầu trong <%= x %> giây"},QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR"},REMAINING_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Thời gian còn lại: <%= x %> giây"},SESSION_TIMEOUT_POPUP_DESCRIPTION:{en:xw.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",xw.createElement("br",null),xw.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",xw.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn."),vi:xw.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",xw.createElement("br",null),xw.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",xw.createElement("strong",{className:"text-primary"},"thử dịch chuyển camera [xa - gần]")," để camera điện thoại lấy nét chuẩn hơn.")},SESSION_TIMEOUT_POPUP_RETRY_BUTTON:{en:"Retry",vi:"Thực hiện lại"},SESSION_TIMEOUT_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"}},ule=dB.button(Xue||(Xue=Wy(["\n width: 100%;\n max-width: 294px;\n height: 66px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 3px;\n color: #fff;\n font-weight: normal;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),lle=(dB.a(Yue||(Yue=Wy(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),dB.div($ue||($ue=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"])))),dle=dB.div(Zue||(Zue=Wy(["\n background: #e7e6e6;\n width: 100%;\n border-radius: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.image.borderRadius",Are)})),fle=dB.img(Jue||(Jue=Wy(["\n width: 100%;\n height: auto;\n object-fit: contain;\n"]))),ple=dB.div(ele||(ele=Wy(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n text-align: ",";\n line-height: ",";\n"])),(function(e){var t=e.theme,r=e.$type;return t5(t,"QRStep.guidelinePopup.".concat(r,".color"),Are)}),(function(e){var t=e.theme,r=e.$type;return t5(t,"QRStep.guidelinePopup.".concat(r,".fontSize"),Are)}),(function(e){var t=e.theme,r=e.$type;return t5(t,"QRStep.guidelinePopup.".concat(r,".fontWeight"),Are)}),(function(e){var t=e.theme,r=e.$type;return t5(t,"QRStep.guidelinePopup.".concat(r,".textAlign"),Are)}),(function(e){var t=e.theme,r=e.$type;return t5(t,"QRStep.guidelinePopup.".concat(r,".lineHeight"),Are)})),hle=dB(ple)(tle||(tle=Wy(["\n white-space: nowrap;\n"]))),mle=dB(ule)(rle||(rle=Wy(["\n color: ",";\n font-size: ",";\n font-weight: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.border",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.outline",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.guidelinePopup.startButton.height",Are)})),gle=function(e){var t=e.onClickStart,r=e.onTimeout,n=e.timeout,o=yj.useSDKSettings().lang,i=mB(),a=r5(i,"QRStep.guidelinePopup.image.src","qr_code_banner.png"),s=xw.useRef(n),c=Ky(xw.useState((function(){return i9(cle.QR_INSTRUCTIONS_COUNTDOWN[o])({x:n})})),2),u=c[0],l=c[1],d=Yj.useSDKTracking().sendEvent,f=xw.useRef(!1);xw.useEffect((function(){d({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[d]),xw.useEffect((function(){var e=i9(cle.QR_INSTRUCTIONS_COUNTDOWN[o]),t=setInterval((function(){s.current--,l(e({x:s.current})),s.current<=0&&(clearInterval(t),f.current||d({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),r&&r())}),1e3);return function(){clearInterval(t)}}),[o,r]);return xw.createElement(lle,null,xw.createElement(dle,null,xw.createElement(zre,{ratio:1.6},xw.createElement(fle,{src:a}))),xw.createElement(Yre,{mt:"30px"},xw.createElement(ple,{$type:"guideText"},cle.QR_INSTRUCTIONS_TEXT[o])),xw.createElement(Yre,{mt:"30px"},xw.createElement(mle,{onClick:function(){d({tag:"id_qr",event:"user_activity.click_start",log:{}}),f.current=!0,t()}},cle.QR_INSTRUCTIONS_START_BUTTON[o])),xw.createElement(Yre,{my:"20px"},xw.createElement(hle,{$type:"countdownText"},u)))};gle.propTypes={onClickStart:xC.func,onTimeout:xC.func,timeout:xC.number},gle.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var vle,yle,ble,wle=dB.div(nle||(nle=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.padding",Are)})),Cle=dB.div(ole||(ole=Wy(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n margin: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.title.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.title.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.title.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.title.margin",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.title.padding",Are)})),kle=dB.div(ile||(ile=Wy(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n text-align: ",";\n margin: ",";\n padding: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.textAlign",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.margin",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.description.padding",Are)})),Sle=dB(ule)(ale||(ale=Wy(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n margin: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.border",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.outline",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.height",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.retryButton.margin",Are)})),Ele=dB(ule)(sle||(sle=Wy(["\n color: ",";\n font-weight: ",";\n font-size: ",";\n background-color: ",";\n border: ",";\n border-radius: ",";\n outline: ",";\n height: ",";\n margin: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.border",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.outline",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.height",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.invalidPopup.skipButton.margin",Are)})),Ble=function(e){var t=e.onRetry,r=e.onSkip,n=yj.useSDKSettings().lang;return xw.createElement(wle,null,xw.createElement(Cle,null,cle.QR_INVALID_POPUP_TITLE[n]),xw.createElement(kle,null,cle.QR_INVALID_POPUP_DESCRIPTION[n]),xw.createElement(Sle,{onClick:t},cle.QR_INVALID_POPUP_RETRY_BUTTON[n]),xw.createElement(Ele,{onClick:r},cle.QR_INVALID_POPUP_SKIP_BUTTON[n]))};Ble.propTypes={onRetry:xC.func,onSkip:xC.func},Ble.defaultProps={onRetry:function(){},onSkip:function(){}};var _le=10,xle=dB.div(vle||(vle=Wy(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: ",";\n top: ",";\n position: absolute;\n z-index: ",";\n color: ",";\n padding: ",";\n margin: 0 10px;\n max-width: 275px;\n text-align: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.scanTooltip.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanTooltip.borderRadius",Are)}),(function(e){return e.y}),s5+20,(function(e){var t=e.theme;return t5(t,"QRStep.scanTooltip.color",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanTooltip.padding",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanTooltip.textAlign",Are)})),Tle=dB.div(yle||(yle=Wy(["\n width: 0;\n height: 0;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n border-bottom: ",";\n position: absolute;\n left: 50%;\n top: ",";\n transform: translateX(-50%);\n"])),(function(e){var t=e.arrowSize,r=e.theme;return"".concat(t,"px solid ").concat(t5(r,"QRStep.scanTooltip.backgroundColor",Are))}),(function(e){return"".concat(e.top,"px")})),Ale=function(e){var t=e.children,r=e.y;return xw.createElement(xle,{y:r},xw.createElement(Tle,{arrowSize:_le,top:-_le}),t)},Ile=dB.div(ble||(ble=Wy(["\n text-align: ",";\n position: absolute;\n font-size: ",";\n font-weight: ",";\n border-radius: ",";\n padding: ",";\n background: ",";\n color: ",";\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.textAlign",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.fontSize",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.fontWeight",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.borderRadius",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.padding",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.backgroundColor",Are)}),(function(e){var t=e.theme;return t5(t,"QRStep.scanCountdown.color",Are)}),(function(e){return e.y}),s5+20),Ple=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g,Rle=function(e){var t=e.match(Ple);return{valid:Boolean(t)}};function Dle(e){var t=e.canvas,r=e.qrModel,n=window.cv,o=n.imread(t,n.IMREAD_GRAYSCALE);return r.detectAndDecode(o).get(0)}var Ole=function(){var e=xy(regeneratorRuntime.mark((function e(t,r){var n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,xue();case 2:if(n=e.sent,o=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return i=document.createElement("canvas"),a=i.getContext("2d"),e.next=11,new Promise((function(e){var r=URL.createObjectURL(t),n=new Image;n.onload=function(){var t=n.width,o=n.height;i.width=t/2,i.height=o/2,a.drawImage(n,t/2,0,i.width,i.height,0,0,i.width,i.height),URL.revokeObjectURL(r),e()},n.src=r}));case 11:return e.next=13,Dle({canvas:i,qrModel:o});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,lW.writeExif({mode:"",imageData:{blob:t,result:s,type:"qr_from_front_image"},enableExifData:!0});case 18:if(c=e.sent,!r||!r.key){e.next=24;break}return l=r.key,e.next=23,Wq.encrypt({imageBlobWithExif:c,key:l});case 23:u=e.sent;case 24:return e.abrupt("return",{result:s,validateResult:{valid:!0},image:{blob:c,encrypted:u}});case 25:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Nle=o((function(e,t){var r;"undefined"!=typeof self&&self,r=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height||!this.data[t*this.width+e])},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,o){for(var i=t;i<t+n;i++)for(var a=e;a<e+r;a++)this.set(a,i,!!o)},e}();t.BitMatrix=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.addOrSubtractGF=function(e,t){return e^t};var o=function(){function e(e,t,r){this.primitive=e,this.size=t,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var o=1,i=0;i<this.size;i++)this.expTable[i]=o,(o*=2)>=this.size&&(o=(o^this.primitive)&this.size-1);for(i=0;i<this.size-1;i++)this.logTable[this.expTable[i]]=i;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,t){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===t)return this.zero;var r=new Uint8ClampedArray(e+1);return r[0]=t,new n.default(this,r)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=function(){function e(e,t){if(0===t.length)throw new Error("No coefficients.");this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;if(n===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-n);for(var o=0;o<this.coefficients.length;o++)this.coefficients[o]=t[n+o]}}else this.coefficients=t}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(t){var r;if(this.isZero())return t;if(t.isZero())return this;var o=this.coefficients,i=t.coefficients;o.length>i.length&&(o=(r=[i,o])[0],i=r[1]);for(var a=new Uint8ClampedArray(i.length),s=i.length-o.length,c=0;c<s;c++)a[c]=i[c];for(c=s;c<i.length;c++)a[c]=n.addOrSubtractGF(o[c-s],i[c]);return new e(this.field,a)},e.prototype.multiply=function(t){if(0===t)return this.field.zero;if(1===t)return this;for(var r=this.coefficients.length,n=new Uint8ClampedArray(r),o=0;o<r;o++)n[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,n)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var r=this.coefficients,o=r.length,i=t.coefficients,a=i.length,s=new Uint8ClampedArray(o+a-1),c=0;c<o;c++)for(var u=r[c],l=0;l<a;l++)s[c+l]=n.addOrSubtractGF(s[c+l],this.field.multiply(u,i[l]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new Error("Invalid degree less than 0");if(0===r)return this.field.zero;for(var n=this.coefficients.length,o=new Uint8ClampedArray(n+t),i=0;i<n;i++)o[i]=this.field.multiply(this.coefficients[i],r);return new e(this.field,o)},e.prototype.evaluateAt=function(e){var t=0;if(0===e)return this.getCoefficient(0);var r=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){t=n.addOrSubtractGF(t,e)})),t;t=this.coefficients[0];for(var o=1;o<r;o++)t=n.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[o]);return t},e}();t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(5),i=r(11),a=r(12);function s(e){var t=a.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var s=n[r],c=i.extract(e,s),u=o.decode(c.matrix);if(u)return{binaryData:u.bytes,data:u.text,chunks:u.chunks,version:u.version,location:{topRightCorner:c.mappingFunction(s.dimension,0),topLeftCorner:c.mappingFunction(0,0),bottomRightCorner:c.mappingFunction(s.dimension,s.dimension),bottomLeftCorner:c.mappingFunction(0,s.dimension),topRightFinderPattern:s.topRight,topLeftFinderPattern:s.topLeft,bottomLeftFinderPattern:s.bottomLeft,bottomRightAlignmentPattern:s.alignmentPattern}}}return null}var c={inversionAttempts:"attemptBoth"};function u(e,t,r,o){void 0===o&&(o={});var i=c;Object.keys(i||{}).forEach((function(e){i[e]=o[e]||i[e]}));var a="attemptBoth"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,u="onlyInvert"===i.inversionAttempts||"invertFirst"===i.inversionAttempts,l=n.binarize(e,t,r,a),d=l.binarized,f=l.inverted,p=s(u?f:d);return p||"attemptBoth"!==i.inversionAttempts&&"invertFirst"!==i.inversionAttempts||(p=s(u?d:f)),p}u.default=u,t.default=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r){return e<t?t:e>r?r:e}var i=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,a){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var s=new i(t,r),c=0;c<t;c++)for(var u=0;u<r;u++){var l=e[4*(u*t+c)+0],d=e[4*(u*t+c)+1],f=e[4*(u*t+c)+2];s.set(c,u,.2126*l+.7152*d+.0722*f)}for(var p=Math.ceil(t/8),h=Math.ceil(r/8),m=new i(p,h),g=0;g<h;g++)for(var v=0;v<p;v++){var y=0,b=1/0,w=0;for(u=0;u<8;u++)for(c=0;c<8;c++){var C=s.get(8*v+c,8*g+u);y+=C,b=Math.min(b,C),w=Math.max(w,C)}var k=y/Math.pow(8,2);if(w-b<=24&&(k=b/2,g>0&&v>0)){var S=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<S&&(k=S)}m.set(v,g,k)}var E=n.BitMatrix.createEmpty(t,r),B=null;for(a&&(B=n.BitMatrix.createEmpty(t,r)),g=0;g<h;g++)for(v=0;v<p;v++){for(var _=o(v,2,p-3),x=o(g,2,h-3),T=(y=0,-2);T<=2;T++)for(var A=-2;A<=2;A++)y+=m.get(_+T,x+A);var I=y/25;for(T=0;T<8;T++)for(A=0;A<8;A++){c=8*v+T,u=8*g+A;var P=s.get(c,u);E.set(c,u,P<=I),a&&B.set(c,u,!(P<=I))}}return a?{binarized:E,inverted:B}:{binarized:E}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(6),i=r(9),a=r(10);function s(e,t){for(var r=e^t,n=0;r;)n++,r&=r-1;return n}function c(e,t){return t<<1|e}var u=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],l=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function d(e,t,r){for(var o=l[r.dataMask],i=e.height,a=function(e){var t=17+4*e.versionNumber,r=n.BitMatrix.createEmpty(t,t);r.setRegion(0,0,9,9,!0),r.setRegion(t-8,0,8,9,!0),r.setRegion(0,t-8,9,8,!0);for(var o=0,i=e.alignmentPatternCenters;o<i.length;o++)for(var a=i[o],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var u=c[s];6===a&&6===u||6===a&&u===t-7||a===t-7&&6===u||r.setRegion(a-2,u-2,5,5,!0)}return r.setRegion(6,9,1,t-17,!0),r.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),s=[],u=0,d=0,f=!0,p=i-1;p>0;p-=2){6===p&&p--;for(var h=0;h<i;h++)for(var m=f?i-1-h:h,g=0;g<2;g++){var v=p-g;if(!a.get(v,m)){d++;var y=e.get(v,m);o({y:m,x:v})&&(y=!y),u=c(y,u),8===d&&(s.push(u),d=0,u=0)}}f=!f}return s}function f(e){var t=function(e){var t=e.height,r=Math.floor((t-17)/4);if(r<=6)return a.VERSIONS[r-1];for(var n=0,o=5;o>=0;o--)for(var i=t-9;i>=t-11;i--)n=c(e.get(i,o),n);var u=0;for(i=5;i>=0;i--)for(o=t-9;o>=t-11;o--)u=c(e.get(i,o),u);for(var l,d=1/0,f=0,p=a.VERSIONS;f<p.length;f++){var h=p[f];if(h.infoBits===n||h.infoBits===u)return h;var m=s(n,h.infoBits);m<d&&(l=h,d=m),(m=s(u,h.infoBits))<d&&(l=h,d=m)}return d<=3?l:void 0}(e);if(!t)return null;var r=function(e){for(var t=0,r=0;r<=8;r++)6!==r&&(t=c(e.get(r,8),t));for(var n=7;n>=0;n--)6!==n&&(t=c(e.get(8,n),t));var o=e.height,i=0;for(n=o-1;n>=o-7;n--)i=c(e.get(8,n),i);for(r=o-8;r<o;r++)i=c(e.get(r,8),i);for(var a=1/0,l=null,d=0,f=u;d<f.length;d++){var p=f[d],h=p.bits,m=p.formatInfo;if(h===t||h===i)return m;var g=s(t,h);g<a&&(l=m,a=g),t!==i&&(g=s(i,h))<a&&(l=m,a=g)}return a<=3?l:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],o=[],i=0;if(n.ecBlocks.forEach((function(e){for(var t=0;t<e.numBlocks;t++)o.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),i+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<i)return null;e=e.slice(0,i);for(var a=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<a;s++)for(var c=0,u=o;c<u.length;c++)u[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var l=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)o[l+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,p=o;f<p.length;f++)p[f].codewords.push(e.shift());return o}(d(e,t,r),t,r.errorCorrectionLevel);if(!n)return null;for(var l=n.reduce((function(e,t){return e+t.numDataCodewords}),0),f=new Uint8ClampedArray(l),p=0,h=0,m=n;h<m.length;h++){var g=m[h],v=i.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[p++]=v[y]}try{return o.decode(f,t.versionNumber)}catch(e){return null}}t.decode=function(e){if(null==e)return null;var t=f(e);if(t)return t;for(var r=0;r<e.width;r++)for(var n=r+1;n<e.height;n++)e.get(r,n)!==e.get(n,r)&&(e.set(r,n,!e.get(r,n)),e.set(n,r,!e.get(n,r)));return f(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o,i=r(7),a=r(8);function s(e,t){for(var r=[],n="",o=[10,12,14][t],i=e.readBits(o);i>=3;){if((u=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var a=Math.floor(u/100),s=Math.floor(u/10)%10,c=u%10;r.push(48+a,48+s,48+c),n+=a.toString()+s.toString()+c.toString(),i-=3}if(2===i){if((u=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");a=Math.floor(u/10),s=u%10,r.push(48+a,48+s),n+=a.toString()+s.toString()}else if(1===i){var u;if((u=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+u),n+=u.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(o||(o={}));var c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(e,t){for(var r=[],n="",o=[9,11,13][t],i=e.readBits(o);i>=2;){var a=e.readBits(11),s=Math.floor(a/45),u=a%45;r.push(c[s].charCodeAt(0),c[u].charCodeAt(0)),n+=c[s]+c[u],i-=2}return 1===i&&(s=e.readBits(6),r.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:r,text:n}}function l(e,t){for(var r=[],n="",o=[8,16,16][t],i=e.readBits(o),a=0;a<i;a++){var s=e.readBits(8);r.push(s)}try{n+=decodeURIComponent(r.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:r,text:n}}function d(e,t){for(var r=[],n="",o=[8,10,12][t],i=e.readBits(o),s=0;s<i;s++){var c=e.readBits(13),u=Math.floor(c/192)<<8|c%192;u+=u<7936?33088:49472,r.push(u>>8,255&u),n+=String.fromCharCode(a.shiftJISTable[u])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,a,c,f,p=new i.BitStream(e),h=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};p.available()>=4;){var g=p.readBits(4);if(g===o.Terminator)return m;if(g===o.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===o.Numeric){var v=s(p,h);m.text+=v.text,(r=m.bytes).push.apply(r,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===o.Alphanumeric){var y=u(p,h);m.text+=y.text,(a=m.bytes).push.apply(a,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===o.Byte){var b=l(p,h);m.text+=b.text,(c=m.bytes).push.apply(c,b.bytes),m.chunks.push({type:n.Byte,bytes:b.bytes,text:b.text})}else if(g===o.Kanji){var w=d(p,h);m.text+=w.text,(f=m.bytes).push.apply(f,w.bytes),m.chunks.push({type:n.Kanji,bytes:w.bytes,text:w.text})}}if(0===p.available()||0===p.readBits(p.available()))return m}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e<r?e:r,o=255>>8-n<<(i=r-n);t=(this.bytes[this.byteOffset]&o)>>i,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var i;if(e>0)o=255>>(i=8-e)<<i,t=t<<e|(this.bytes[this.byteOffset]&o)>>i,this.bitOffset+=e}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35e3:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36e3:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37e3:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38e3:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39e3:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,4e4:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58e3:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59e3:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,6e4:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var i=new n.default(285,256,0),a=new o.default(i,r),s=new Uint8ClampedArray(t),c=!1,u=0;u<t;u++){var l=a.evaluateAt(i.exp(u+i.generatorBase));s[s.length-1-u]=l,0!==l&&(c=!0)}if(!c)return r;var d=new o.default(i,s),f=function(e,t,r,n){var o;t.degree()<r.degree()&&(t=(o=[r,t])[0],r=o[1]);for(var i=t,a=r,s=e.zero,c=e.one;a.degree()>=n/2;){var u=i,l=s;if(s=c,(i=a).isZero())return null;a=u;for(var d=e.zero,f=i.getCoefficient(i.degree()),p=e.inverse(f);a.degree()>=i.degree()&&!a.isZero();){var h=a.degree()-i.degree(),m=e.multiply(a.getCoefficient(a.degree()),p);d=d.addOrSubtract(e.buildMonomial(h,m)),a=a.addOrSubtract(i.multiplyByMonomial(h,m))}if(c=d.multiplyPoly(s).addOrSubtract(l),a.degree()>=i.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),a.multiply(v)]}(i,i.buildMonomial(t,1),d,t);if(null===f)return null;var p=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),o=0,i=1;i<e.size&&o<r;i++)0===t.evaluateAt(i)&&(n[o]=e.inverse(i),o++);return o!==r?null:n}(i,f[0]);if(null==p)return null;for(var h=function(e,t,r){for(var o=r.length,i=new Array(o),a=0;a<o;a++){for(var s=e.inverse(r[a]),c=1,u=0;u<o;u++)a!==u&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(r[u],s))));i[a]=e.multiply(t.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(i[a]=e.multiply(i[a],s))}return i}(i,f[1],p),m=0;m<p.length;m++){var g=r.length-1-i.log(p[m]);if(g<0)return null;r[g]=n.addOrSubtractGF(r[g],h[m])}return r}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function o(e,t,r,n){var o=e.x-t.x+r.x-n.x,i=e.y-t.y+r.y-n.y;if(0===o&&0===i)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:r.x-t.x,a22:r.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var a=t.x-r.x,s=n.x-r.x,c=t.y-r.y,u=n.y-r.y,l=a*u-s*c,d=(o*u-s*i)/l,f=(a*i-o*c)/l;return{a11:t.x-e.x+d*t.x,a12:t.y-e.y+d*t.y,a13:d,a21:n.x-e.x+f*n.x,a22:n.y-e.y+f*n.y,a23:f,a31:e.x,a32:e.y,a33:1}}t.extract=function(e,t){for(var r=function(e,t,r,n){var i=o(e,t,r,n);return{a11:i.a22*i.a33-i.a23*i.a32,a12:i.a13*i.a32-i.a12*i.a33,a13:i.a12*i.a23-i.a13*i.a22,a21:i.a23*i.a31-i.a21*i.a33,a22:i.a11*i.a33-i.a13*i.a31,a23:i.a13*i.a21-i.a11*i.a23,a31:i.a21*i.a32-i.a22*i.a31,a32:i.a12*i.a31-i.a11*i.a32,a33:i.a11*i.a22-i.a12*i.a21}}({x:3.5,y:3.5},{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),i=function(e,t){return{a11:e.a11*t.a11+e.a21*t.a12+e.a31*t.a13,a12:e.a12*t.a11+e.a22*t.a12+e.a32*t.a13,a13:e.a13*t.a11+e.a23*t.a12+e.a33*t.a13,a21:e.a11*t.a21+e.a21*t.a22+e.a31*t.a23,a22:e.a12*t.a21+e.a22*t.a22+e.a32*t.a23,a23:e.a13*t.a21+e.a23*t.a22+e.a33*t.a23,a31:e.a11*t.a31+e.a21*t.a32+e.a31*t.a33,a32:e.a12*t.a31+e.a22*t.a32+e.a32*t.a33,a33:e.a13*t.a31+e.a23*t.a32+e.a33*t.a33}}(o(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft),r),a=n.BitMatrix.createEmpty(t.dimension,t.dimension),s=function(e,t){var r=i.a13*e+i.a23*t+i.a33;return{x:(i.a11*e+i.a21*t+i.a31)/r,y:(i.a12*e+i.a22*t+i.a32)/r}},c=0;c<t.dimension;c++)for(var u=0;u<t.dimension;u++){var l=s(u+.5,c+.5);a.set(u,c,e.get(Math.floor(l.x),Math.floor(l.y)))}return{matrix:a,mappingFunction:s}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function o(e){return e.reduce((function(e,t){return e+t}))}function i(e,t,r,o){var i,a,s,c,u=[{x:Math.floor(e.x),y:Math.floor(e.y)}],l=Math.abs(t.y-e.y)>Math.abs(t.x-e.x);l?(i=Math.floor(e.y),a=Math.floor(e.x),s=Math.floor(t.y),c=Math.floor(t.x)):(i=Math.floor(e.x),a=Math.floor(e.y),s=Math.floor(t.x),c=Math.floor(t.y));for(var d=Math.abs(s-i),f=Math.abs(c-a),p=Math.floor(-d/2),h=i<s?1:-1,m=a<c?1:-1,g=!0,v=i,y=a;v!==s+h;v+=h){var b=l?y:v,w=l?v:y;if(r.get(b,w)!==g&&(g=!g,u.push({x:b,y:w}),u.length===o+1))break;if((p+=f)>0){if(y===c)break;y+=m,p-=d}}for(var C=[],k=0;k<o;k++)u[k]&&u[k+1]?C.push(n(u[k],u[k+1])):C.push(0);return C}function a(e,t,r,n){var o,a=t.y-e.y,s=t.x-e.x,c=i(e,t,r,Math.ceil(n/2)),u=i(e,{x:e.x-s,y:e.y-a},r,Math.ceil(n/2)),l=c.shift()+u.shift()-1;return(o=u.concat(l)).concat.apply(o,c)}function s(e,t){var r=o(e)/o(t),n=0;return t.forEach((function(t,o){n+=Math.pow(e[o]-t*r,2)})),{averageSize:r,error:n}}function c(e,t,r){try{var n=a(e,{x:-1,y:e.y},r,t.length),o=a(e,{x:e.x,y:-1},r,t.length),i=a(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),c=a(e,{x:Math.min(r.width,e.x+e.y)+1,y:Math.min(r.height,e.y+e.x)+1},r,t.length),u=s(n,t),l=s(o,t),d=s(i,t),f=s(c,t),p=Math.sqrt(u.error*u.error+l.error*l.error+d.error*d.error+f.error*f.error),h=(u.averageSize+l.averageSize+d.averageSize+f.averageSize)/4;return p+(Math.pow(u.averageSize-h,2)+Math.pow(l.averageSize-h,2)+Math.pow(d.averageSize-h,2)+Math.pow(f.averageSize-h,2))/h}catch(e){return 1/0}}function u(e,t){for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r--;for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n++;for(var o=(r+n)/2,i=Math.round(t.y);e.get(Math.round(o),i);)i--;for(var a=Math.round(t.y);e.get(Math.round(o),a);)a++;return{x:o,y:(i+a)/2}}function l(e,t,r,i,s){var u,l,d;try{u=function(e,t,r,i){var s=(o(a(e,r,i,5))/7+o(a(e,t,i,5))/7+o(a(r,e,i,5))/7+o(a(t,e,i,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,t)/s),u=Math.round(n(e,r)/s),l=Math.floor((c+u)/2)+7;switch(l%4){case 0:l++;break;case 2:l--}return{dimension:l,moduleSize:s}}(i,r,s,e),l=u.dimension,d=u.moduleSize}catch(e){return null}var f=r.x-i.x+s.x,p=r.y-i.y+s.y,h=(n(i,s)+n(i,r))/2/d,m=1-3/h,g={x:i.x+m*(f-i.x),y:i.y+m*(p-i.y)},v=t.map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,i=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(i))){var a=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1];return o(a),{x:r,y:i,score:c({x:Math.floor(r),y:Math.floor(i)},[1,1,1],e)+n({x:r,y:i},g)}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));return{alignmentPattern:h>=15&&v.length?v[0]:g,dimension:l}}t.locate=function(e){for(var t=[],r=[],i=[],a=[],s=function(n){for(var s=0,c=!1,u=[0,0,0,0,0],l=function(t){var i=e.get(t,n);if(i===c)s++;else{u=[u[1],u[2],u[3],u[4],s],s=1,c=i;var l=o(u)/7,d=Math.abs(u[0]-l)<l&&Math.abs(u[1]-l)<l&&Math.abs(u[2]-3*l)<3*l&&Math.abs(u[3]-l)<l&&Math.abs(u[4]-l)<l&&!i,f=o(u.slice(-3))/3,p=Math.abs(u[2]-f)<f&&Math.abs(u[3]-f)<f&&Math.abs(u[4]-f)<f&&i;if(d){var h=t-u[3]-u[4],m=h-u[2],g={startX:m,endX:h,y:n};(v=r.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||h>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&h>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:r.push({top:g,bottom:g})}if(p){var v,y=t-u[4],b=y-u[3];g={startX:b,y:n,endX:y},(v=a.filter((function(e){return b>=e.bottom.startX&&b<=e.bottom.endX||y>=e.bottom.startX&&b<=e.bottom.endX||b<=e.bottom.startX&&y>=e.bottom.endX&&u[2]/(e.bottom.endX-e.bottom.startX)<1.5&&u[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:a.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)l(d);t.push.apply(t,r.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),r=r.filter((function(e){return e.bottom.y===n})),i.push.apply(i,a.filter((function(e){return e.bottom.y!==n}))),a=a.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);t.push.apply(t,r.filter((function(e){return e.bottom.y-e.top.y>=2}))),i.push.apply(i,a);var f=t.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],a=o(i)/i.length;return{score:c({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:a}}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score})).map((function(e,t,r){if(t>4)return null;var n=r.filter((function(e,r){return t!==r})).map((function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}})).sort((function(e,t){return e.score-t.score}));if(n.length<2)return null;var o=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:o}})).filter((function(e){return!!e})).sort((function(e,t){return e.score-t.score}));if(0===f.length)return null;var p=function(e,t,r){var o,i,a,s,c,u,l,d=n(e,t),f=n(t,r),p=n(e,r);return f>=d&&f>=p?(c=(o=[t,e,r])[0],u=o[1],l=o[2]):p>=f&&p>=d?(c=(i=[e,t,r])[0],u=i[1],l=i[2]):(c=(a=[e,r,t])[0],u=a[1],l=a[2]),(l.x-u.x)*(c.y-u.y)-(l.y-u.y)*(c.x-u.x)<0&&(c=(s=[l,c])[0],l=s[1]),{bottomLeft:c,topLeft:u,topRight:l}}(f[0].points[0],f[0].points[1],f[0].points[2]),h=p.topRight,m=p.topLeft,g=p.bottomLeft,v=l(e,i,h,m,g),y=[];v&&y.push({alignmentPattern:{x:v.alignmentPattern.x,y:v.alignmentPattern.y},bottomLeft:{x:g.x,y:g.y},dimension:v.dimension,topLeft:{x:m.x,y:m.y},topRight:{x:h.x,y:h.y}});var b=u(e,h),w=u(e,m),C=u(e,g),k=l(e,i,b,w,C);return k&&y.push({alignmentPattern:{x:k.alignmentPattern.x,y:k.alignmentPattern.y},bottomLeft:{x:C.x,y:C.y},topLeft:{x:w.x,y:w.y},topRight:{x:b.x,y:b.y},dimension:k.dimension}),0===y.length?null:y}}]).default},e.exports=r()})),Lle=n(Nle);function Mle(e){return Fle.apply(this,arguments)}function Fle(){return(Fle=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.imageData,n=t.canvas,(o=r)||(i=n.getContext("2d"),o=i.getImageData(0,0,n.width,n.height)),!(a=Lle(o.data,o.width,o.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",a.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ule(e){return jle.apply(this,arguments)}function jle(){return(jle=xy(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.canvas,n=t.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),bue.scanImage(r,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Vle=function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.canvas,n=t.blob,o=t.qrScannerResources,i=r,!n){e.next=6;break}return e.next=5,Jz.blobToCanvas({blob:n});case 5:i=e.sent;case 6:return a=i.getContext("2d"),e.next=9,Mle({imageData:a.getImageData(0,0,i.width,i.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,Ule({canvas:i,qrScannerResources:o});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function zle(e){var t=e.refVideo,r=e.shouldStart,n=e.cropArea,o=e.settings,i=e.onResult,a=e.outputEncryptionSettings,s=xw.useRef(null);null===s.current&&(s.current=document.createElement("canvas"));var c=xw.useRef(!1),u=xw.useRef(null),l=xw.useRef(),d=Ky(xw.useState(!1),2),f=d[0],p=d[1],h=xw.useRef({}),m=yj.useSDKSettings(),g=m.customUrls,v=m.qrSettings,y=m.country,b=m.exifKey,w=hW(),C=w.motionData,k=w.orientationData;xw.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f){e.next=5;break}return e.next=3,xue({modelUrl:null==g?void 0:g.wechatQRModelsUrl});case 3:h.current=e.sent,p(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[f,g]);var S=xw.useCallback((function(){!0===c.current&&(c.current=!1)}),[]),E=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n,d,p,m,g,w,E,B,_,x,T,A;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f&&o&&!c.current){e.next=2;break}return e.abrupt("return");case 2:r=h.current,n=r.qrModel,d=r.qrScannerResources,p=r.noModel,m=u.current,g=t.current,c.current=!0,w=m.cropX,E=m.cropY,B=m.cropWidth,_=m.cropHeight,(x=s.current).width=B,x.height=_,T=x.getContext("2d"),A=function(){var e=xy(regeneratorRuntime.mark((function e(){var t,r,o,u,f,h,m,I;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T.drawImage(g,w,E,B,_,0,0,B,_),t=performance.now(),p){e.next=8;break}return e.next=5,Dle({canvas:x,qrModel:n});case 5:r=e.sent,e.next=11;break;case 8:return e.next=10,Vle({canvas:x,qrScannerResources:d});case 10:r=e.sent;case 11:if(t=Math.floor(performance.now()-t),!r){e.next=28;break}return S(),o="vn"===y?Rle(r):{valid:!0},e.next=17,xV.takePicture({canvas:s.current});case 17:return u=e.sent,lW.preWriteExif({mode:lW.MODE.ID_CARD,motionData:C,orientationData:k,startTime:l.current,endTime:Date.now(),exifKey:b}),e.next=21,lW.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:r,type:"qr"},enableExifData:"boolean"!=typeof(null==v?void 0:v.enableExif)||(null==v?void 0:v.enableExif)});case 21:if(f=e.sent,!a||!a.key){e.next=27;break}return m=a.key,e.next=26,Wq.encrypt({blob:f,key:m});case 26:h=e.sent;case 27:i({result:r,validateResult:o,image:{blob:f,encrypted:h}});case 28:return I=180-t>0?180-t:0,e.next=31,new Promise((function(e){return setTimeout(e,I)}));case 31:c.current&&window.requestAnimationFrame(A);case 32:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(A);case 13:case"end":return e.stop()}}),e)}))),[f,o,t,S,y,C,k,b,null==v?void 0:v.enableExif,a,i]),B=xw.useCallback((function(){S()}),[S]);return xw.useEffect((function(){var e=t.current;r||B(),f&&r&&n&&e&&e.videoWidth>0&&(l.current=Date.now(),u.current=xV.analyzeVideoAndWindowSizes(e,n,0),E())}),[r,n,t,S,E,f,B]),xw.useEffect((function(){return B}),[B]),{refWorkingCanvas:s,stopCheckFrame:S,checkFrame:E,warmupDone:f}}var qle,Hle=function(e){var t=e.shouldStart,r=e.refVideo,n=e.cropArea,o=e.settings,i=e.onSessionTimeout,a=e.onCaptureDone,s=e.onAboutToTimeout,c=e.outputEncryptionSettings,u=Ky(xw.useState(!1),2),l=u[0],d=u[1],f=xw.useRef((function(){})),p=xw.useRef((function(){})),h=yj.useSDKSettings().lang,m=xw.useCallback((function(){f.current.apply(f,arguments)}),[]),g=zle({refVideo:r,shouldStart:t,cropArea:n,settings:o,onResult:m,outputEncryptionSettings:c}),v=g.stopCheckFrame,y=g.checkFrame,b=g.warmupDone,w=que({refVideo:r,shouldStart:t&&b,cropArea:n,settings:o}),C=w.stopCheckFrame,k=w.refRecordedVideos,S=w.splitVideos,E=w.resetRecordedVideos,B=w.checkFrame;f.current=xw.useCallback((function(e){d(!0),C(),v(),p.current(),a(Oy(Oy({},e),null!=o&&o.enableRecording?{recordedVideos:k.current}:{})),d(!1)}),[C,a,k,v,null==o?void 0:o.enableRecording]);var _=xw.useCallback((function(){C(),v();var e=Gy(k.current),t=null!=o&&o.enableRecording?{recordedVideos:e}:null;i(t),E()}),[E,C,v,i,k,o]),x=xw.useCallback((function(){S()}),[S]),T=Wue({lang:h,onAboutToTimeout:s,onSessionTimeout:_,onVideoTimeLimitReached:x,settings:o,shouldStartTimers:t&&b,sessionTime:null==o?void 0:o.scanQrLimitTimeSecond}),A=T.stopTimers,I=T.startTimers;return p.current=A,{isProcessing:l,restartSession:xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(),e.next=3,Promise.all([B(),y()]);case 3:case"end":return e.stop()}}),e)}))),[B,y,I]),refRecordedVideos:k,warmupDone:b}},Wle=145;function Kle(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,i=e.onCaptureDone,a=e.outputEncryptionSettings,s=Ky(xw.useState(null),2),c=s[0],u=s[1],l=Jj.useAsset("qr_capture_cursor.png"),d=Ky(xw.useState({}),2),f=d[0],p=d[1],h=f.yTooltip,m=f.yMessage,g=yj.useSDKSettings().lang,v=Yj.useSDKTracking().sendEvent,y=oue(),b=y.showPopup,w=y.popupShown,C=y.popupType,k=Ky(xw.useState(!1),2),S=k[0],E=k[1],B=Ky(xw.useState(null),2),_=B[0],x=B[1],T=Jj.useAsset("ic_loading.png"),A=xw.useRef();xw.useEffect((function(){v({tag:"id_qr",event:"user_activity.start",log:{}}),A.current=performance.now()}),[v]),xw.useEffect((function(){b({popupType:iue.QR_INSTRUCTIONS})}),[b]),xw.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,i=b1.isMobile?Math.min(e-6,Wle):Wle,a=i,s=o+10,c=s+90,l=c+40,d=l+a+20,f=Math.floor((e-i)/2)+n;u({x:f,y:l,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:d,yMessage:c};p(h),r(h)}}),[t,r]);var I=xw.useCallback((function(e){v({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),x(""),i(e)}),[i,v]),P=xw.useCallback((function(e){var t=e.validateResult.valid;x("");var r=performance.now();t?(v({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-A.current)/1e3}}),i(e)):(b({popupType:iue.QR_INVALID}),v({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[b,i,v]),R=xw.useCallback((function(e){var t=e.curTimeLeft;x(i9(cle.REMAINING_TIME[g])({x:t}))}),[g]),D=Hle({shouldStart:S,refVideo:n,cropArea:c,settings:o,onSessionTimeout:I,onCaptureDone:P,onAboutToTimeout:R,outputEncryptionSettings:a}),O=D.isProcessing,N=D.restartSession,L=D.warmupDone,M=xw.useCallback((function(){b({popupType:null})}),[b]),F=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(),A.current=performance.now(),v({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,N();case 5:case"end":return e.stop()}}),e)}))),[N,M,v]),U=xw.useCallback((function(){M(),v({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),i()}),[M,i,v]),j=xw.useCallback((function(){M(),setTimeout((function(){E(!0)}),200)}),[M]);return xw.createElement(xw.Fragment,null,!L&&xw.createElement(Y7,{contentStyle:{maxWidth:"300px"}}),c&&xw.createElement(x5,{x:"".concat(c.x,"px"),y:"".concat(c.y,"px"),width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),surroundStyle:c.surroundStyle},xw.createElement("div",null,xw.createElement("img",{src:l,width:c.width,height:c.height,alt:""}))),xw.createElement(Ale,{y:"".concat(h,"px")},cle.QR_TOOLTIP[g]),_&&xw.createElement(Ile,{key:_,className:"message",y:"".concat(m,"px")},_),O&&xw.createElement(qce,null,xw.createElement("img",{src:T,alt:"",className:"spin"})),xw.createElement(Q7,{contentStyle:{maxWidth:"332px"},open:w},C===iue.QR_INVALID&&xw.createElement(Ble,{onRetry:F,onSkip:U}),C===iue.QR_INSTRUCTIONS&&xw.createElement(gle,{onClickStart:j,onTimeout:j})))}Kle.propTypes={windowAndVideoInfo:xC.shape({}),onUISpacingChange:xC.func,refVideo:xC.shape({}),settings:xC.shape({}),onCaptureDone:xC.func,outputEncryptionSettings:xC.shape({})},Kle.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var Qle=pB(qle||(qle=Wy(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),Gle=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons","allowedCardTypes"];function Xle(e){var t=e.onClose,r=e.onError,n=e.settings,o=e.outputEncryptionSettings,i=e.defaultCameraId,a=e.globalStyle,s=e.styledComponent,c=e.frontCamera,u=e.scannerTypeCons,l=e.allowedCardTypes,d=Vy(e,Gle),f=d.numberOfCaptures,p=d.stepNumber,h=d.frontSide,m=d.titleIcon,g=d.title,v=d.description,y=d.scannerType,b=d.usePortraitMask,w=d.shouldShowSpinner,C=d.handleQRCaptureDone,k=d.handleIDCardCaptureDone,S=d.handleRestartSession,E=d.refIDCardReader,B=d.handleClickConfirm,_=d.popupType,x=d.popupShown,T=d.popupProps,A=mB(),I=xw.useRef(null),P=Ky(xw.useState(null),2),R=P[0],D=P[1],O=Ky(xw.useState(!1),2),N=O[0],L=O[1],M=r5(A,"IDCapturing.loadingIcon.src","ic_loading.png"),F=Ky(xw.useState({}),2),U=F[0],j=F[1],V=U.yTitle,z=xw.useCallback((function(e){D(e),L(!0)}),[]);xw.useEffect((function(){L(!1)}),[c]);var q=r5(A,"IDCapturing.cardIcon.src",m),H=s.CloseCameraButton;return xw.createElement(cB,{theme:Tre},xw.createElement(Fce,null,xw.createElement(C5,{key:c,frontCamera:c,onVideoPlayed:z,onClose:t,flipHorizontal:c,ref:I,onError:r,defaultCameraId:i,closeButton:H||null},N&&xw.createElement(xw.Fragment,null,y===u.ID_CARD&&xw.createElement(Gue,{key:p,ref:E,windowAndVideoInfo:R,refVideo:I,settings:n,onCaptureDone:k,onUISpacingChange:j,frontSide:h,allowedCardTypes:l,description:v,usePortraitMask:b,outputEncryptionSettings:o}),y===u.QR_CODE&&xw.createElement(Kle,{key:p,refVideo:I,windowAndVideoInfo:R,settings:n,onCaptureDone:C,onUISpacingChange:j,outputEncryptionSettings:o})),xw.createElement(Mce,{keyForTransition:f}),xw.createElement(Wce,{y:"".concat(V,"px")},xw.createElement(Fee,null,xw.createElement(Iee,{key:g,timeout:{enter:Lce,exit:Lce},classNames:"flipY",unmountOnExit:!0},xw.createElement(Kce,null,m&&xw.createElement(Uce,{src:q,alt:""}),xw.createElement(Qce,{className:"title"},g))))),w&&xw.createElement(qce,null,xw.createElement("img",{src:M,alt:"",className:"spin"}))),xw.createElement(Q7,{open:x},_===iue.CONFIRM&&xw.createElement(one,Ry({},T,{onConfirm:B,onTryAgain:S,frontSide:h})))),xw.createElement(a,null))}var Yle={allowedCardTypes:xC.arrayOf(xC.string),settings:xC.shape({}),onClose:xC.func,onError:xC.func,outputEncryptionSettings:xC.shape({}),defaultCameraId:xC.string,globalStyle:xC.shape({}),styledComponent:xC.shape({CloseCameraButton:xC.node}),frontCamera:xC.bool,scannerTypeCons:xC.shape({}).isRequired},$le={allowedCardTypes:[],settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:Qle,styledComponent:{CloseCameraButton:null},frontCamera:!1};Xle.propTypes=Yle,Xle.defaultProps=$le;var Zle=uL.IDCardSide,Jle=uL.IDCardType,ede=uL.Errors,tde={ID_CARD:"id_card",QR_CODE:"qr_code"},rde=[{scannerType:tde.ID_CARD,title:"Mặt trước CMND/CCCD",description:"Vui lòng đặt CMND mặt trước vào trong khung",titleIcon:"id_card_front.svg",cardSide:uL.IDCardSide.FRONT,cardType:Jle.VN,enableConfirmPopup:!0},{scannerType:tde.ID_CARD,title:"Mặt sau CMND/CCCD",description:"Vui lòng đặt CMND mặt sau vào trong khung",titleIcon:"id_card_back.svg",cardSide:uL.IDCardSide.BACK,cardType:Jle.VN,enableConfirmPopup:!0}],nde={scannerType:tde.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},ode=function(){return Promise.resolve({card_label:""})},ide=function(e){var t=e.settings,r=e.onError,n=e.detectIdCard,o=void 0===n?ode:n,i=e.outputEncryptionSettings,a=e.steps,s=void 0===a?rde:a,c=e.onStepDone,u=Ky(xw.useState(0),2),l=u[0],d=u[1],f=Ky(xw.useState(s[l]),2),p=f[0],h=f[1],m=Ky(xw.useState(0),2),g=m[0],v=m[1],y=Ky(xw.useState(!1),2),b=y[0],w=y[1],C=xw.useRef({}),k=xw.useRef([]),S=xw.useRef(null),E=xw.useRef(),B=oue(),_=B.showPopup,x=B.popupShown,T=B.popupType,A=B.props,I=p.scannerType,P=p.title,R=p.titleIcon,D=p.cardSide,O=p.description,N=p.usePortraitMask,L=p.cardType,M=p.enableConfirmPopup,F=xw.useCallback((function(e){e>=s.length||setTimeout((function(){d(e),h(s[e])}),200)}),[s]),U=xw.useCallback((function(){F(l+1)}),[F,l]),j=xw.useCallback((function(){setTimeout((function(){h((function(e){return Oy(Oy({},e),nde)}))}),200)}),[]),V=xw.useCallback((function(){_({popupType:null})}),[_]),z=xw.useCallback((function(){V(),S.current=null,I===tde.QR_CODE?F(l):I===tde.ID_CARD&&E.current.restartSession()}),[F,l,V,I]),q=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Oy({stepNumber:l,cardSide:D,cardType:L,image:C.current},null!=t&&t.enableRecording?{recordedVideos:k.current}:{}),(I===tde.QR_CODE&&S.current||null!==(r=S.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=S.current),w(!0),e.next=5,c(n);case 5:w(!1),S.current=null,U();case 8:case"end":return e.stop()}}),e)}))),[t,l,c,U,I,w,D,L]),H=xw.useCallback((function(e){var t;if(S.current=e,e&&Array.isArray(e.recordedVideos)){var r,n=e.recordedVideos;(r=k.current).push.apply(r,Gy(n))}v((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);M?_({popupType:iue.CONFIRM,props:{hasValidQR:o,imageTaken:C.current}}):q()}),[_,M,q]),W=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(n){var a,s,c,u,l,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.image,s=n.error,c=n.recordedVideos,C.current=a,k.current=c,v((function(e){return e+1})),D!==uL.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!b1.isMobile){e.next=28;break}if(l=null==a||null===(u=a.detectedCard)||void 0===u?void 0:u.label){e.next=20;break}return w(!0),e.prev=9,e.next=12,o({image:a,cardType:L,cardSide:D});case 12:d=e.sent,l=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(ede.detect_id_card_error);case 19:w(!1);case 20:if(!l||!"vn.cccd_new.front".includes(l)){e.next=28;break}return w(!0),e.next=24,Ole(C.current.blob,i);case 24:return(f=e.sent)?H(f):j(),w(!1),e.abrupt("return");case 28:M?_({popupType:iue.CONFIRM,props:{imageTaken:C.current,error:s}}):q();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[M,_,D,t,L,o,q,j,r,H,i,w]),K=xw.useCallback((function(){V(),q()}),[q,V]);return{numberOfCaptures:g,stepNumber:l,titleIcon:R,title:P,description:O,frontSide:D===Zle.FRONT,scannerType:I,usePortraitMask:N,shouldShowSpinner:b,handleQRCaptureDone:H,handleIDCardCaptureDone:W,handleRestartSession:z,refIDCardReader:E,handleClickConfirm:K,showPopup:_,popupType:T,popupShown:x,popupProps:A}},ade={data:{country:"vn",settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},card_type_check:{enable:!1},track_card_coordinates:{enable:!1,max_length:150},blur_check:{enable:!0,threshold_web:.82},disable_capture_button_if_alert:!1,exif_data_settings:{enable:!0},id_detection:{enable:!0},limit_time_settings:{enable:!0,limit_time_second:30,video_partial_length_seconds:15},save_frame_settings:{enable:!1,frames_interval_ms:190,quality_web:80},scan_qr_settings:{enable:!0,limit_time_second:20},virtual_cam_hashes:{web:!0,mobile:!1}}}}}};function sde(e){var t=e.clientSettings,r=Ky(xw.useState(null),2),n=r[0],o=r[1];return xw.useEffect((function(){var e=bae(ade,t),r=y1(e,"data.settings.sdk_settings.id_detection_settings.card_type_check.enable"),n=y1(e,"data.country"),i=y1(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),a=y1(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.enable"),s=y1(e,"data.settings.sdk_settings.id_detection_settings.track_card_coordinates.max_length"),c=y1(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),u=y1(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),l=y1(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),d=y1(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),f=y1(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),p=y1(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),h=y1(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),m=y1(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),g=y1(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),v=y1(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),y=y1(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),b=y1(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),w=y1(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),C=y1(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),k=y1(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(b1.isMobile?"mobile":"web")),S=y1(e,"data.card_types",[]).map((function(e){return null==e?void 0:e.code}));o({country:n,enableRecording:i,enableCardTypeCheck:r,trackCardCoordinates:a,trackCardCoordinatesMaxLength:s,frameCaptureIntervalMs:c,idCardSessionTime:d,maxRecordingTimePerVideo:f,saveFrameQuality:u,enableTimers:l,enableAutoCapture:p,waitForBestImageTimeMs:h,enableBlurCheck:m,blurThreshold:g,disableCaptureButtonIfAlert:v,enableIdDetection:y,enableScanQr:b,scanQrLimitTimeSecond:w,enableExifData:C,enableVirtualCamHashes:k,allowedCardTypesFromSettings:S})}),[t]),{settings:n}}function cde(e){var t=e.logCredentials,r=e.clientSettings,n=e.uiOnlyComponent,o=e.onError,i=e.detectIdCard,a=e.outputEncryptionSettings,s=e.steps,c=e.onStepDone,u=e.customTheme,l=sde({clientSettings:r}).settings,d=Ry({},ide({settings:l,onError:o,detectIdCard:i,outputEncryptionSettings:a,steps:s,onStepDone:c}));return xw.createElement(hne,null,xw.createElement(cB,{theme:u},xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy({},t)}},xw.createElement(n,Ry({},e,{settings:l,scannerTypeCons:tde},d)))))}var ude={logCredentials:xC.shape({}),clientSettings:xC.shape({}),uiOnlyComponent:xC.func,customTheme:xC.shape({}),onError:xC.func,onStepDone:xC.func,steps:xC.arrayOf(xC.shape({})),detectIdCard:xC.func,outputEncryptionSettings:xC.shape({})};cde.propTypes=ude,cde.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:Xle,customTheme:{},onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var lde=uL.IDCardSide,dde=uL.Errors;function fde(e){return pde.apply(this,arguments)}function pde(){return(pde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.cardType,o=t.cardSide,i=t.apiClient,a=t.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(o)},!a||!a.key){e.next=4;break}return e.abrupt("return",i.httpClient.post("/v1/images",Oy({base64:r.encrypted.hex},s),{"X-TV-Key":a.key}));case 4:return e.abrupt("return",i.uploadImage(Oy({file:r.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hde(e){return mde.apply(this,arguments)}function mde(){return(mde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.image,n=t.apiClient,o=t.rawString,i=t.outputEncryptionSettings,a={label:"qr_code",metadata:JSON.stringify({raw:o})},!i||!i.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",Oy({base64:r.encrypted.hex},a),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",n.uploadImage(Oy({file:r.blob},a)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gde(e){return vde.apply(this,arguments)}function vde(){return(vde=xy(regeneratorRuntime.mark((function e(t){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.imageId,n=t.cardType,o=t.apiClient,e.abrupt("return",o.requestVerifyIDCard({card_type:n,image1:{id:r}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yde(e){return bde.apply(this,arguments)}function bde(){return(bde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiClient,n=t.cardType,o=t.frontCardId,i=t.isCapturingFrontSide,a=t.backCardId,s=t.recordedVideos,c=void 0===s?[]:s,u=t.qrImageId,l=c.filter((function(e){return null!==e.id})),d=c.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=5,Promise.all(d.map((function(e){return r.fileService.request({frames:e.frames})})));case 5:return f=e.sent,p={card_type:n,image:{id:o},image2:i?void 0:{id:a},videos:[].concat(Gy(l.map((function(e){return{id:e.id}}))),Gy(f.map((function(e){return{id:e.data.file_id}}))))},u&&(p.qr1_images=[{id:u}]),e.abrupt("return",r.detectIDTampering(p));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wde(e){return Cde.apply(this,arguments)}function Cde(){return(Cde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,n=t.apiClient,o=t.frontCardId,i=t.backCardId,a=t.isCapturingFrontSide,s=t.qrImageId,c={card_type:r,image1:a?{id:o}:{id:i}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kde(e){return Sde.apply(this,arguments)}function Sde(){return(Sde=xy(regeneratorRuntime.mark((function e(t){var r,n,o,i,a,s,c,u,l,d,f,p,h,m,g,v,y,b,w,C,k,S,E,B;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,o=t.frontCardId,i=t.qrImageId,a=t.onError,s=t.recordedVideos,c=t.apiClient,u=t.cardType,l=t.cardSide,d=t.qrScannedResult,f=t.outputEncryptionSettings,l!==lde.BACK||o){e.next=4;break}return a(dde.missing_front_id_card),e.abrupt("return");case 4:return p=[fde({image:n,cardType:u,cardSide:l,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&p.push(hde({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(p);case 8:if(h=e.sent,m=Ky(h,2),g=m[0],v=m[1],!g.errors){e.next=15;break}return a(Oy(Oy({},dde.upload_error),{},{details:g.errors})),e.abrupt("return");case 15:return y=g.data.image_id,b=(null==v||null===(r=v.data)||void 0===r?void 0:r.image_id)||i,(k=l===lde.FRONT)?w=y:(w=o,C=y),e.next=21,gde({imageId:y,cardType:u,apiClient:c});case 21:if(!(S=e.sent).errors){e.next=25;break}return a(Oy(Oy({},dde.sanity_check_error),{},{details:S.errors})),e.abrupt("return");case 25:return e.next=27,wde({cardType:u,apiClient:c,frontCardId:w,backCardId:C,isCapturingFrontSide:k,qrImageId:b});case 27:if(!(E=e.sent).errors){e.next=31;break}return a(Oy(Oy({},dde.read_id_card_error),{},{details:E.errors})),e.abrupt("return");case 31:return e.next=33,yde({apiClient:c,cardType:u,frontCardId:w,isCapturingFrontSide:k,backCardId:C,recordedVideos:s,qrImageId:b});case 33:if(!(B=e.sent).errors){e.next=37;break}return a(Oy(Oy({},dde.detect_id_tampering_error),{},{details:B.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:S.data,tamperingInfo:B.data,cardInfo:E.data,qrImageId:b});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ede=["readIDCardUIOnlyComponent"],Bde=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],_de=uL.Errors,xde=function(e){var t=e.readIDCardUIOnlyComponent,r=Vy(e,Ede),n=r.onError,o=r.onStepDone,i=r.apiCredentials,a=r.logCredentials,s=r.outputEncryptionSettings,c=Vy(r,Bde),u=Ky(xw.useState(null),2),l=u[0],d=u[1],f=fq.useApiClient({apiCredentials:i,logCredentials:a}).apiClient,p=xw.useRef(""),h=xw.useRef("");xw.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.clientSettings();case 2:t=e.sent,d(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[f]);var m=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var r,i,a,c,u,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.cardType,i=t.cardSide,a=t.recordedVideos,c=t.qrScannedResult,u=t.image,l=null,e.prev=2,e.next=5,kde({image:u,cardSide:i,frontCardId:p.current,qrImageId:h.current,onError:n,apiClient:f,cardType:r,recordedVideos:a,qrScannedResult:c,outputEncryptionSettings:s});case 5:l=e.sent,i===uL.IDCardSide.FRONT&&(p.current=l.cardInfo.image1.id),h.current=l.qrImageId,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n(Oy(Oy({},_de.api_call_error),{},{details:e.t0}));case 13:l&&o(Oy(Oy({},t),{},{apiResult:l}));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t){return e.apply(this,arguments)}}(),[f,n,o,s]);return l&&xw.createElement(t,Ry({logCredentials:a,onError:n,onStepDone:m,outputEncryptionSettings:s},c,{clientSettings:l}))};function Tde(){return Ade.apply(this,arguments)}function Ade(){return(Ade=xy(regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.opencvUrl,n=t.idCardModelUrl,o=t.tfScriptUrls,i=t.blazefaceModelUrl,a=t.closeEyesModelUrl,s=new yue,e.prev=2,Vq.loadTensorFlow(o).then((function(){Vq.loadBlazefaceModel({modelUrl:i})})),e.next=6,Promise.all([E9({closeEyesModelUrl:a}),s.loadResource({modelUrl:n}),pue({url:r})]);case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(2);case 10:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}xde.propTypes={onError:xC.func,onStepDone:xC.func,apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),logCredentials:xC.shape({}),outputEncryptionSettings:xC.shape({}),readIDCardUIOnlyComponent:xC.func},xde.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:cde};var Ide,Pde,Rde,Dde,Ode,Nde,Lde,Mde,Fde=S9(Tde),Ude=function(){return{checkCamera:ane,LivenessDetection:Xse,NativeCamera:cne,ReadIDCardUIOnly:cde,ReadIDCardWithApiCall:xde,warmUpReadIdCard:Nue,preloadEKYCResources:Fde,getListCamera:H1,FlashLiveness:gse}},jde=l7,Vde=Vy(Bre,["useLivenessDetection"]);function zde(e){var t=e.className;return xw.createElement("svg",{className:t,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xw.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"}))}zde.propTypes={className:xC.string},zde.defaultProps={className:""};var qde,Hde,Wde,Kde,Qde,Gde,Xde,Yde,$de,Zde,Jde=T5,efe=uee,tfe=aee,rfe=Ste,nfe=rfe.default,ofe=Vde.FaceDetectionError,ife=Vde.FaceVerificationInstructions,afe=Vde.FaceVerificationStepsWrapper,sfe=Vde.StepItem,cfe=Vde.BottomButtonsOverlay,ufe=Vde.Button,lfe=Vde.CountDownOverlay,dfe=Vde.InstructionsOverlay,ffe=Vde.CountdownTime,pfe=dB(_7)(Ide||(Ide=Wy(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),hfe=dB(zde)(Pde||(Pde=Wy(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var t=e.color;return null!=t?t:"rgba(0, 0, 0, 0.6)"})),mfe=dB.div(Rde||(Rde=Wy(["\n position: absolute;\n z-index: -1;\n background: rgba(223, 0, 0, 0.2);\n border-radius: 50%;\n width: 86%;\n height: 86%;\n top: 7%;\n left: 7%;\n"]))),gfe=dB(ife)(Dde||(Dde=Wy(["\n font-size: 20px;\n"]))),vfe=dB(dfe)(Ode||(Ode=Wy(["\n ",";\n ",";\n"])),tfe.default,efe.default),yfe=dB(ffe)(Nde||(Nde=Wy(["\n background-color: unset;\n color: #ffffff;\n font-size: 20px;\n"]))),bfe=b1.isMobile?{width:640}:null,wfe={background:"#000000",opacity:.6};function Cfe(e){return new Promise((function(t){var r=new Image;r.onload=t,r.onerror=t,r.src=e}))}function kfe(e){var t=e.apiCheck,r=e.mode,n=e.onLivenessDetectionDone,o=e.onClose,i=e.onError,a=e.captureFrameSettings,s=e.onFramesCaptured,c=e.frontCamera,u=e.customStepTimeConstraints,l=e.onProcessing,d=e.customErrors,f=e.customMessages,p=e.livenessSettings,h=e.customInstructions,m=e.apiCredentials,g=Jj.useAsset("bg_camera_mask.png"),v=Jj.useAsset("bg_camera_mask_red.png"),y=Ky(xw.useState({}),2),b=y[0],w=y[1],C=b.yFaceVerificationStepsWrapper,k=Ky(xw.useState(""),2),S=k[0],E=k[1],B=Ky(xw.useState(!1),2),_=B[0],x=B[1],T=xw.useCallback((function(e){var t=e.lostY,r=e.height,n=t+25,o=n+30;return w({yFaceDetectionError:n,yFaceVerificationStepsWrapper:o+r+20}),{y:Math.floor(o)}}),[]),A=jde({apiCheck:t,mode:r,bgCameraMask:g,bgCameraMaskRed:v,surroundStyle:wfe,onLivenessDetectionDone:n,onError:i,cropAreaDimension:T,captureFrameSettings:a,onFramesCaptured:s,livenessSettings:p,setRemainingTime:E,customStepTimeConstraints:u,onProcessing:l,customErrors:d,customMessages:f,customInstructions:h,apiCredentials:m}),I=A.countdownToTakePicture,P=A.cropArea,R=A.curStepIndex,D=A.directionIcon,O=A.faceDetectionError,N=A.handleTriggerPassiveMode,L=A.handleVideoPlayed,M=A.instructions,F=A.isActiveMode,U=A.refVideo,j=A.showCountdown,V=A.steps,z=A.videoPlayed,q=A.directionIconAnimation,H=A.isFirstValidFrameFound,W=A.warmupDone;xw.useEffect((function(){Promise.all(V.map((function(e){return Cfe(e.directionIcon)}))).then((function(){return x(!0)}))}),[V]);var K=xw.useRef(!1);return xw.useEffect((function(){H||(K.current=!1)}),[H]),O&&"liveness_terminated_time_out"===O.code&&(K.current=!0),xw.createElement(C5,{frontCamera:c,onVideoPlayed:L,onClose:o,flipHorizontal:c,ref:U,videoSettings:bfe,onError:i},!W&&xw.createElement(Y7,null),z&&_?xw.createElement(xw.Fragment,null,xw.createElement(nfe,{keyForTransition:R}),xw.createElement(ofe,{top:C,className:"face-detection-error",error:O}),S&&xw.createElement(yfe,{top:P.current.y-20},S),P.current?xw.createElement(x5,{x:"".concat(P.current.x,"px"),y:"".concat(P.current.y,"px"),width:"".concat(P.current.width,"px"),height:"".concat(P.current.height,"px"),surroundStyle:P.current.surroundStyle},xw.createElement(hfe,null),xw.createElement(pfe,{progress:R/V.length*100,showErrorRing:!!O,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:2,insideRingStrokeDash:"none"}),j?xw.createElement(lfe,null,I):null,F?xw.createElement(vfe,null,D?xw.createElement("img",{className:q,src:D,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):null):null,O&&xw.createElement(mfe,null)):null,F?xw.createElement(xw.Fragment,null,M?xw.createElement(gfe,{top:C-30,className:"instructions"},M):null,H&&!K.current&&xw.createElement(afe,{top:C+35},V.map((function(e,t){var r=e.name,n=e.image.objUrl;return xw.createElement(sfe,{key:r,active:R>=t,className:"step-item"},n?xw.createElement("img",{src:n,alt:""}):xw.createElement("span",null,t+1))})))):xw.createElement(xw.Fragment,null,O?null:xw.createElement(cfe,null,xw.createElement(ufe,{onClick:N},xw.createElement(Jde,null))))):null)}function Sfe(e){return xw.createElement(Xse,Ry({},e,{livenessComponent:kfe}))}kfe.propTypes={apiCheck:xC.bool,mode:xC.string,onLivenessDetectionDone:xC.func,onClose:xC.func,onError:xC.func,captureFrameSettings:xC.shape({}),onFramesCaptured:xC.func,frontCamera:xC.bool,customStepTimeConstraints:xC.shape({}),onProcessing:xC.func,customErrors:xC.shape({}),customMessages:xC.shape({}),livenessSettings:xC.shape({}),customInstructions:xC.shape({}),apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string})},kfe.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customStepTimeConstraints:(Lde={},Py(Lde,uL.FaceDirection.UP,{delayTime:0}),Py(Lde,uL.FaceDirection.LEFT,{delayTime:0}),Py(Lde,uL.FaceDirection.RIGHT,{delayTime:0}),Py(Lde,uL.FaceDirection.FRONTAL,{delayTime:2e3}),Lde),onProcessing:function(){},customErrors:{no_face:{code:"no_face",msg:{en:"Face is not detected.",vi:"Không nhận diện được khuôn mặt."}},multiple_faces:{code:"multiple_faces",msg:{en:"There are more than one face in the frame",vi:"Nhiều khuôn mặt xuất hiện trong khung hình"}},face_too_small:{code:"face_too_small",msg:{en:"The face is too small",vi:"Khuôn mặt quá nhỏ"}},face_too_large:{code:"face_too_large",msg:{en:"The face is too big",vi:"Khuôn mặt quá lớn"}},face_out_of_box:{code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt nằm ngoài khung ảnh"}},liveness_terminated_time_out:{code:"liveness_terminated_time_out",msg:{en:"The face verification need to be completed in <%= x %> seconds.\nPlease try again.",vi:"Xác thực khuôn mặt cần thực hiện trong <%= x %> giây.\nVui lòng thử lại."}}},customMessages:{REMAIN_TIME:{en:"Remaining time: <%= x %> seconds",vi:"Kết thúc sau <%= x %>"}},customInstructions:(Mde={},Py(Mde,uL.FaceDirection.LEFT,{en:"Please turn to the left",vi:"Vui lòng quay trái"}),Py(Mde,uL.FaceDirection.RIGHT,{en:"Please turn to the right",vi:"Vui lòng quay phải"}),Py(Mde,uL.FaceDirection.UP,{en:"Please look up",vi:"Vui lòng nhìn lên"}),Py(Mde,uL.FaceDirection.FRONTAL,{en:"Please look straight to camera",vi:"Vui lòng nhìn thẳng vào camera"}),Mde),livenessSettings:{face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,limit_time_liveness_check:{enable:!0,limit_time_second:45,remain_time_show:15,format:"mm:ss"},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3}},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""}};var Efe,Bfe=tee,_fe=_te,xfe=Ste,Tfe=Bfe.animationDuration,Afe=xfe.default,Ife=dB.div(qde||(qde=Wy(["\n ","\n ","\n"])),Bfe.default,_fe.default),Pfe=dB.img(Hde||(Hde=Wy(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),Rfe=10,Dfe=60,Ofe=dB.div(Wde||(Wde=Wy(["\n cursor: pointer;\n text-align: center;\n width: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n position: fixed;\n\n ","\n"])),Dfe,s5+20,b1.isMobile?YE(["top:",";"],(function(e){return e.y})):YE(["bottom:","px;"],Rfe)),Nfe=function(){return xw.createElement("div",{className:"box_loader",id:"vib-v2018-loading"},xw.createElement("div",{className:"loader"},xw.createElement("div",{className:"inner one"}),xw.createElement("div",{className:"inner two"}),xw.createElement("div",{className:"inner three"})))},Lfe=dB.div(Kde||(Kde=Wy(["\n color: #fff;\n text-align: center;\n"]))),Mfe=dB.div(Qde||(Qde=Wy(["\n transform: translateZ(1000px); // to fix rotating bug on safari\n transform-style: preserve-3d;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),s5+20),Ffe=dB.div(Gde||(Gde=Wy(["\n display: flex;\n align-items: center;\n"]))),Ufe=dB(Lfe)(Xde||(Xde=Wy(["\n font-size: 16px;\n margin-left: 10px;\n color: #fff;\n"]))),jfe=dB.div(Yde||(Yde=Wy(["\n margin: 0 auto;\n padding: 0 5px;\n position: absolute;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),s5+20),Vfe=dB(Lfe)($de||($de=Wy(["\n text-align: center;\n background: ",";\n padding: 5px 10px;\n font-size: 18px;\n"])),(function(e){return e.theme.dangerColor})),zfe=function(e){var t=e.children,r=e.y;return xw.createElement(jfe,{y:r},xw.createElement(Vfe,null,t))},qfe=dB($se)(Zde||(Zde=Wy(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),Hfe=uL.Errors,Wfe={BTN_OK:{en:"OK",vi:"Tôi đã hiểu"},FRONT:{en:"front",vi:"trước"},BACK:{en:"back",vi:"sau"},BTN_USE_THIS_PICTURE:{en:"Use this picture",vi:"Dùng ảnh này"},BTN_TRY_AGAIN:{en:"Try again",vi:"Thử lại"},CONFIRM_POPUP_VALID_QR:{en:"QR code scanned",vi:"Đã quét được mã QR"},CONFIRM_POPUP_INVALID_QR:{en:"Could not scan QR code",vi:"Không quét được mã QR"}},Kfe=Oy(Oy({},Hfe),{},{id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Take a photo of your ID card's <%= side %> side. Make sure the image of the card fits in the frame, (minimum 50% of frame).",vi:"Mặt <%= side %> CCCD cần nằm gọn trong khung hình, chiếm tối thiểu 50%."}},id_detector_validate_angle_error:{code:"id_detector_validate_angle_error",msg:{en:"Please put your ID card straight, not be oblique",vi:"Vui lòng đặt giấy tờ thẳng góc, không bị xô lệch khi chụp"}},id_detector_card_too_small:{code:"id_detector_card_too_small",msg:{en:"Please hold your ID card closer",vi:"Vui lòng đưa CCCD lại gần hơn"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please hold your ID card further",vi:"Vui lòng đưa CCCD ra xa hơn"}},id_detector_error_front_side_no_faces:{code:"id_detector_error_front_side_no_faces",msg:{en:"Take a photo of your ID card's front side",vi:"Vui lòng chụp ảnh mặt trước của CCCD"}},id_detector_error_front_side_multiple_faces:{code:"id_detector_error_front_side_multiple_faces",msg:{en:"Please remove other items out of the frame",vi:"Vui lòng không để lẫn vật thể khác trong khung chụp hình"}},glare_detected:{code:"glare_detected",msg:{en:"Your photo ID is glare. Please adjust the shooting angle.",vi:"Ảnh chụp bị lóa sáng. Vui lòng chụp lại"}},not_allowed_card_types:{code:"not_allowed_card_types",msg:{en:"Please use Citizen Identity card to register",vi:"Vui lòng sử dụng loại giấy tờ là CCCD"}}}),Qfe=xw.forwardRef((function(e,t){var r,n=e.usePortraitMask,o=e.windowAndVideoInfo,i=e.refVideo,a=e.frontSide,s=e.settings,c=e.onCaptureDone,u=e.onUISpacingChange,l=e.outputEncryptionSettings,d=e.allowedCardTypes,f=Ky(xw.useState({}),2),p=f[0],h=f[1],m=p.yErrorMessage,g=p.yCaptureButton,v=Jj.useAsset("ic_camera.svg"),y=yj.useSDKSettings().lang,b=Ky(xw.useState(""),2),w=b[0],C=b[1],k=Ky(xw.useState(null),2),S=k[0],E=k[1],B=qq.useThemeContext().dangerColor,_=xw.useRef((function(){})),x=xw.useCallback((function(e){C(null===e?"":i9(Kfe[e.code].msg[y])({side:a?Wfe.FRONT[y]:Wfe.BACK[y]}))}),[y,a]),T=xw.useCallback((function(){_.current()}),[]),A=Kue({shouldStart:!0,refVideo:i,cropArea:S,settings:s,onModelErrorChange:x,frontSide:a,onSessionTimeout:T,onCaptureDone:c,outputEncryptionSettings:l,allowedCardTypes:d}),I=A.warmupDone,P=A.isProcessing,R=A.takePictureManually,D=A.restartSession,O=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D();case 2:case"end":return e.stop()}}),e)}))),[D]);_.current=O,xw.useEffect((function(){if(o){var e,t,r,i,a,s,c=o.videoAreaWidth,l=o.videoAreaHeight,d=o.lostX,f=o.lostY,p=o.clientHeight;n?(i=.7*(a=l-165),r=(s=(e=f+10)+45)+a+70):(i=b1.isMobile?c-6:Math.floor(.7*c),a=Math.floor(Math.min(i/1.5,p-2*f-(Dfe+2*Rfe)-135)),r=(t=(s=(e=f+10)+(b1.isMobile?90:50))+a+10)+88);var m=Math.floor((c-i)/2)+d;E({x:m,y:s,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var g={yTitle:e,yErrorMessage:t,yCaptureButton:r};h(g),u(g)}}),[o,n,u]);var N=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R();case 2:case"end":return e.stop()}}),e)}))),[R]);return xw.useImperativeHandle(t,(function(){return{restartSession:O}}),[O]),xw.createElement(xw.Fragment,null,!I&&xw.createElement(Y7,null),P&&xw.createElement(Nfe,null),S&&xw.createElement(x5,{x:"".concat(S.x,"px"),y:"".concat(S.y,"px"),width:"".concat(S.width,"px"),height:"".concat(S.height,"px"),surroundStyle:S.surroundStyle},xw.createElement(qfe,{strokeStyles:(r={},Py(r,Yse.DEFAULT,{fill:"none",strokeWidth:1,stroke:"#fff"}),Py(r,Yse.ERROR,{fill:"rgba(255, 0, 0, 0.1)",strokeWidth:3,stroke:B}),r),strokeWidth:3,errorColor:B,width:S.width,height:S.height,type:w?Yse.ERROR:Yse.DEFAULT})),w&&xw.createElement(zfe,{y:"".concat(m,"px")},w),!P&&(!(null!=s&&s.disableCaptureButtonIfAlert)||!w)&&xw.createElement(Ofe,{onClick:N,y:"".concat(g,"px")},xw.createElement("img",{src:v,alt:""})))}));Qfe.propTypes={usePortraitMask:xC.bool,windowAndVideoInfo:xC.shape({}),refVideo:xC.shape({}),frontSide:xC.bool,settings:xC.shape({}),onCaptureDone:xC.func,onUISpacingChange:xC.func,outputEncryptionSettings:xC.shape({}),allowedCardTypes:xC.arrayOf(xC.string)},Qfe.defaultProps={usePortraitMask:!1,windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null,allowedCardTypes:[]};var Gfe,Xfe,Yfe,$fe,Zfe,Jfe,epe=dB.div(Efe||(Efe=Wy(["\n z-index: ",";\n padding: 10px;\n margin: 0 10px;\n color: #fff;\n position: absolute;\n top: ",";\n font-size: 16px;\n text-align: center;\n max-width: 400px;\n"])),s5+20,(function(e){return e.y})),tpe={QR_INVALID_POPUP_TITLE:{en:"Invalid QR code",vi:"QR không hợp lệ"},QR_INVALID_POPUP_DESCRIPTION:{en:"Please check and make sure scanning QR code on ID card",vi:"Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR trên CCCD thật"},QR_INVALID_POPUP_RETRY_BUTTON:{en:"Scan QR (on ID card)",vi:"Quét lại QR (trên CCCD)"},QR_INVALID_POPUP_SKIP_BUTTON:{en:"Skip",vi:"Bỏ qua"},QR_TOOLTIP:{en:"Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code",vi:"Canh vừa mã QR vào 4 góc khung hình và thử dịch chuyển camera [xa - gần] để quét được mã QR."}},rpe=dB.button(Gfe||(Gfe=Wy(["\n background: ",";\n height: 45px;\n border-radius: 5px;\n border: 0;\n padding: 0 20px;\n color: #000;\n cursor: pointer;\n font-size: 16px;\n font-weight: 600;\n"])),(function(e){return e.theme.primaryColor})),npe=dB.a(Xfe||(Xfe=Wy(["\n text-decoration: underline;\n font-size: 16px;\n color: #000;\n cursor: pointer;\n"]))),ope=dB.div(Yfe||(Yfe=Wy(["\n padding: 20px;\n"]))),ipe=dB.div($fe||($fe=Wy(["\n color: #000;\n font-size: 20px;\n"]))),ape=dB.div(Zfe||(Zfe=Wy(["\n color: #000;\n font-size: 16px;\n"]))),spe=dB.div(Jfe||(Jfe=Wy(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n"]))),cpe=function(e){var t=e.onRetry,r=e.onSkip,n=yj.useSDKSettings().lang;return xw.createElement(ope,null,xw.createElement(Yre,{mt:"15px"},xw.createElement(ipe,null,tpe.QR_INVALID_POPUP_TITLE[n])),xw.createElement(Yre,{mt:"20px"},xw.createElement(ape,null,tpe.QR_INVALID_POPUP_DESCRIPTION[n])),xw.createElement(Yre,{mt:"30px"},xw.createElement(spe,null,xw.createElement(Yre,{mr:"30px"},xw.createElement(npe,{onClick:r},tpe.QR_INVALID_POPUP_SKIP_BUTTON[n])),xw.createElement(rpe,{onClick:t},tpe.QR_INVALID_POPUP_RETRY_BUTTON[n]))))};cpe.propTypes={onRetry:xC.func,onSkip:xC.func},cpe.defaultProps={onRetry:function(){},onSkip:function(){}};var upe,lpe={SESSION_TIMEOUT:"SESSION_TIMEOUT",CONFIRM:"CONFIRM",QR_INVALID:"QR_INVALID"},dpe=["children","onClose"],fpe=dB.button(upe||(upe=Wy(["\n position: absolute;\n top: 20px;\n right: 20px;\n border: 0;\n padding: 0;\n background: none;\n cursor: pointer;\n\n img {\n width: 16px;\n height: 16px;\n }\n"]))),ppe=b1.isMobile?{contentStyle:{maxWidth:"100%",height:"100%",borderRadius:0},overlayStyle:{padding:0}}:{},hpe=function(e){var t=e.children,r=e.onClose,n=Vy(e,dpe),o=Jj.useAsset("ic_close_black.png");return xw.createElement(Q7,Ry({},ppe,n),t,xw.createElement(fpe,{onClick:r},xw.createElement("img",{src:o,alt:""})))};hpe.propTypes={children:xC.node,onClose:xC.func},hpe.defaultProps={children:null,onClose:function(){}};var mpe,gpe,vpe,ype,bpe=145;function wpe(e){var t=e.windowAndVideoInfo,r=e.onUISpacingChange,n=e.refVideo,o=e.settings,i=e.onCaptureDone,a=Ky(xw.useState(null),2),s=a[0],c=a[1],u=Jj.useAsset("qr_capture_cursor.png"),l=Ky(xw.useState({}),2),d=l[0],f=l[1],p=d.yTooltip,h=yj.useSDKSettings().lang,m=Yj.useSDKTracking().sendEvent,g=oue(),v=g.showPopup,y=g.popupShown,b=g.popupType,w=xw.useRef();xw.useEffect((function(){m({tag:"id_qr",event:"user_activity.start",log:{}}),w.current=performance.now()}),[m]),xw.useEffect((function(){if(t){var e=t.videoAreaWidth,n=t.lostX,o=t.lostY,i=b1.isMobile?Math.min(e-6,bpe):bpe,a=i,s=o+140,u=s+a+20,l=Math.floor((e-i)/2)+n;c({x:l,y:s,width:i,height:a,surroundStyle:{opacity:.6,background:"#000"}});var d={yTooltip:u};f(d),r(d)}}),[t,r]);var C=xw.useCallback((function(){m({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),i()}),[i,m]),k=xw.useCallback((function(e){var t=e.validateResult.valid,r=performance.now();t?(m({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(r-w.current)/1e3}}),i(e)):(v({popupType:lpe.QR_INVALID}),m({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[v,i,m]),S=Hle({shouldStart:!0,refVideo:n,cropArea:s,settings:o,onSessionTimeout:C,onCaptureDone:k}),E=S.isProcessing,B=S.restartSession,_=S.warmupDone,x=xw.useCallback((function(){v({popupType:null})}),[v]),T=xw.useCallback(xy(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(),w.current=performance.now(),m({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,B();case 5:case"end":return e.stop()}}),e)}))),[B,x,m]),A=xw.useCallback((function(){x(),m({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),i()}),[x,i,m]);return xw.createElement(xw.Fragment,null,!_&&xw.createElement(Y7,null),s&&xw.createElement(x5,{x:"".concat(s.x,"px"),y:"".concat(s.y,"px"),width:"".concat(s.width,"px"),height:"".concat(s.height,"px"),surroundStyle:s.surroundStyle},xw.createElement("div",null,xw.createElement("img",{src:u,width:s.width,height:s.height,alt:""}))),xw.createElement(epe,{y:"".concat(p,"px")},tpe.QR_TOOLTIP[h]),E&&xw.createElement(Nfe,null),xw.createElement(hpe,{open:y,onClose:A},b===lpe.QR_INVALID&&xw.createElement(cpe,{onRetry:T,onSkip:A})))}wpe.propTypes={windowAndVideoInfo:xC.shape({}),onUISpacingChange:xC.func,refVideo:xC.shape({}),settings:xC.shape({}),onCaptureDone:xC.func},wpe.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){}};var Cpe=dB.div(mpe||(mpe=Wy(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),kpe=dB.div(gpe||(gpe=Wy(["\n text-align: center;\n font-size: 1rem;\n color: ",";\n margin-top: 10px;\n"])),(function(e){return e.theme.dangerColor})),Spe=dB.img(vpe||(vpe=Wy(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),Epe=dB.div(ype||(ype=Wy(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n align-items: center;\n gap: 10px;\n"]))),Bpe=function(e){var t=e.imageTaken,r=e.onConfirm,n=e.onTryAgain,o=e.error,i=e.hasValidQR,a=Ky(xw.useState(null),2),s=a[0],c=a[1],u=yj.useSDKSettings().lang;return xw.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),c(e)),function(){URL.revokeObjectURL(e)}}),[t]),xw.createElement(Cpe,null,null!==i&&xw.createElement(Yre,{mb:"20px"},xw.createElement("div",null,xw.createElement(Lre,{type:i?Ire.SUCCESS:Ire.WARNING},i?Wfe.CONFIRM_POPUP_VALID_QR[u]:Wfe.CONFIRM_POPUP_INVALID_QR[u]))),xw.createElement(zre,{ratio:1.5},xw.createElement(Spe,{src:s})),o&&xw.createElement(kpe,{className:"confirm-popup-error-message"},o.msg[u]),xw.createElement(Epe,null,xw.createElement(npe,{onClick:n},Wfe.BTN_TRY_AGAIN[u]),xw.createElement(rpe,{onClick:r},Wfe.BTN_USE_THIS_PICTURE[u])))};Bpe.propTypes={imageTaken:xC.shape({}),error:xC.shape({msg:xC.shape({})}),onConfirm:xC.func,onTryAgain:xC.func,hasValidQR:xC.bool},Bpe.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null};var _pe,xpe={primaryColor:"#FDB913",dangerColor:"#FF0000"},Tpe=pB(_pe||(_pe=Wy(['\n ///////////////// Loading Icon (provided by VIB) //////////////////////\n .loader {\n position: fixed;\n top: calc(50% - 32px);\n left: calc(50% - 32px);\n width: 64px;\n height: 64px;\n border-radius: 50%;\n perspective: 800px;\n z-index: 999999\n }\n\n .box_loader::before {\n /* background-color:rgba(0,0,0,.8); */\n width: 100%;\n height: 100vh;\n position: fixed;\n top: 0;\n left: 0;\n content: "";\n display: block;\n z-index: 999995;\n }\n\n .inner {\n position: absolute;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border-radius: 50%\n }\n\n .inner.one {\n left: 0;\n top: 0;\n animation: rotate-one 1s linear infinite;\n border-bottom: 3px solid #fdb913\n }\n\n .inner.two {\n right: 0;\n top: 0;\n animation: rotate-two 1s linear infinite;\n border-right: 3px solid #f47920\n }\n\n .inner.three {\n right: 0;\n bottom: 0;\n animation: rotate-three 1s linear infinite;\n border-top: 3px solid #f7941d\n }\n\n @keyframes rotate-one {\n 0% {\n transform: rotateX(35deg) rotateY(-45deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(35deg) rotateY(-45deg) rotateZ(360deg)\n }\n }\n\n @keyframes rotate-two {\n 0% {\n transform: rotateX(50deg) rotateY(10deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(50deg) rotateY(10deg) rotateZ(360deg)\n }\n }\n\n @keyframes rotate-three {\n 0% {\n transform: rotateX(35deg) rotateY(55deg) rotateZ(0)\n }\n\n 100% {\n transform: rotateX(35deg) rotateY(55deg) rotateZ(360deg)\n }\n }\n ///////////////////////////////////////////////////////////\n']))),Ape=uL.IDCardSide,Ipe=uL.IDCardType,Ppe=uL.Errors,Rpe={ID_CARD:"id_card",QR_CODE:"qr_code"},Dpe=[{scannerType:Rpe.ID_CARD,title:"Chụp mặt trước CCCD",titleIcon:"id_card_front.svg",cardSide:uL.IDCardSide.FRONT,cardType:Ipe.VN,frontCamera:!1,enableConfirmPopup:!1},{scannerType:Rpe.ID_CARD,title:"Chụp mặt sau CCCD",titleIcon:"id_card_back.svg",cardSide:uL.IDCardSide.BACK,cardType:Ipe.VN,frontCamera:!1,enableConfirmPopup:!1}],Ope={scannerType:Rpe.QR_CODE,frontCamera:!1,cardSide:uL.IDCardSide.FRONT,cardType:Ipe.VN};function Npe(e){var t=e.onClose,r=e.onError,n=e.clientSettings,o=e.detectIdCard,i=e.onStepDone,a=e.steps,s=e.outputEncryptionSettings,c=e.allowedCardTypes,u=Ky(xw.useState(0),2),l=u[0],d=u[1],f=Ky(xw.useState(a[l]),2),p=f[0],h=f[1],m=xw.useRef(null),g=Ky(xw.useState(null),2),v=g[0],y=g[1],b=Ky(xw.useState(!1),2),w=b[0],C=b[1],k=Ky(xw.useState(0),2),S=k[0],E=k[1],B=xw.useRef(),_=p.scannerType,x=p.frontCamera,T=p.title,A=p.titleIcon,I=p.cardSide,P=p.usePortraitMask,R=p.cardType,D=p.enableConfirmPopup,O=I===Ape.FRONT,N=Jj.useAsset(A),L=oue(),M=L.showPopup,F=L.popupShown,U=L.popupType,j=L.props,V=Ky(xw.useState(!1),2),z=V[0],q=V[1],H=xw.useRef(null),W=xw.useRef(null),K=xw.useRef([]),Q=sde({clientSettings:n}).settings,G=Ky(xw.useState({}),2),X=G[0],Y=G[1],$=X.yTitle,Z=Yj.useSDKTracking().sendEvent,J=xw.useCallback((function(e){y(e),C(!0)}),[]);xw.useEffect((function(){C(!1)}),[x]);var ee=xw.useCallback((function(){M({popupType:null})}),[M]),te=xw.useCallback((function(e){e>=a.length||setTimeout((function(){d(e),h(a[e])}),200)}),[a]),re=xw.useCallback((function(){te(l+1)}),[te,l]),ne=xw.useCallback((function(){setTimeout((function(){h((function(e){return Oy(Oy({},Ope),{},{enableConfirmPopup:e.enableConfirmPopup})}))}),200)}),[]),oe=xw.useCallback(xy(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={stepNumber:l,cardSide:I,cardType:R,image:H.current,recordedVideos:null!=Q&&Q.enableRecording?K.current:[]},(_===Rpe.QR_CODE||null!==(t=W.current)&&void 0!==t&&t.result)&&(r.qrScannedResult=W.current),q(!0),e.next=5,i(r);case 5:Z({tag:"result",event:"sdk_mode.read_id_card_one_side",log:{result_object:r}}),q(!1),W.current=null,re();case 9:case"end":return e.stop()}}),e)}))),[Q,l,i,re,_,Z,I,R]),ie=xw.useCallback((function(){ee(),W.current=null,_===Rpe.QR_CODE?te(l):_===Rpe.ID_CARD&&(Z({tag:O?"id_front":"id_back",event:"user_activity.retry",log:{}}),B.current.restartSession())}),[te,l,ee,_,O,Z]),ae=xw.useCallback((function(){ee(),Z({tag:O?"id_front":"id_back",event:"user_activity.submit",log:{}}),oe()}),[oe,ee,Z,O]),se=xw.useCallback((function(e){var t;if(W.current=e,e&&Array.isArray(e.recordedVideos)){var r,n=e.recordedVideos;(r=K.current).push.apply(r,Gy(n))}E((function(e){return e+1}));var o=Boolean(null==e||null===(t=e.validateResult)||void 0===t?void 0:t.valid);D?M({popupType:lpe.CONFIRM,props:{hasValidQR:o,imageTaken:H.current}}):oe()}),[M,D,oe]),ce=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,i,a,c,u,l,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.image,i=t.error,a=t.recordedVideos,H.current=n,K.current=a,E((function(e){return e+1})),I!==uL.IDCardSide.FRONT){e.next=28;break}if(!Q.enableScanQr||!b1.isMobile){e.next=28;break}if(u=null==n||null===(c=n.detectedCard)||void 0===c?void 0:c.label){e.next=20;break}return q(!0),e.prev=9,e.next=12,o({image:n,cardType:R,cardSide:I});case 12:l=e.sent,u=l.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),r(Ppe.detect_id_card_error);case 19:q(!1);case 20:if(!u||!"vn.cccd_new.front".includes(u)){e.next=28;break}return q(!0),e.next=24,Ole(H.current.blob,s);case 24:return(d=e.sent)?se(d):ne(),q(!1),e.abrupt("return");case 28:D?M({popupType:lpe.CONFIRM,props:{imageTaken:H.current,error:i}}):oe();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),[D,M,I,Q,R,o,oe,ne,r,se,s]);return xw.createElement(cB,{theme:xpe},xw.createElement(Ife,null,xw.createElement(C5,{key:x,frontCamera:x,onVideoPlayed:J,onClose:t,flipHorizontal:x,ref:m,onError:r},w&&xw.createElement(xw.Fragment,null,_===Rpe.ID_CARD&&xw.createElement(Qfe,{key:l,ref:B,windowAndVideoInfo:v,refVideo:m,settings:Q,onCaptureDone:ce,onUISpacingChange:Y,frontSide:O,usePortraitMask:P,outputEncryptionSettings:s,allowedCardTypes:c}),_===Rpe.QR_CODE&&xw.createElement(wpe,{key:l,refVideo:m,windowAndVideoInfo:v,settings:Q,onCaptureDone:se,onUISpacingChange:Y})),xw.createElement(Afe,{keyForTransition:S}),xw.createElement(Mfe,{y:"".concat($,"px")},xw.createElement(Fee,null,xw.createElement(Iee,{key:T,timeout:{enter:Tfe,exit:Tfe},classNames:"flipY",unmountOnExit:!0},xw.createElement(Ffe,null,A&&xw.createElement(Pfe,{src:N,alt:""}),xw.createElement(Ufe,{className:"title"},T))))),z&&xw.createElement(Nfe,null)),xw.createElement(Q7,{open:F},U===lpe.CONFIRM&&xw.createElement(Bpe,Ry({},j,{onConfirm:ae,onTryAgain:ie})))),xw.createElement(Tpe,null))}Npe.propTypes={onClose:xC.func,onError:xC.func,clientSettings:xC.shape({}),detectIdCard:xC.func,onStepDone:xC.func,steps:xC.arrayOf(xC.shape({})),outputEncryptionSettings:xC.shape({}),allowedCardTypes:xC.arrayOf(xC.string)},Npe.defaultProps={onClose:function(){},onError:function(){},clientSettings:{},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:Dpe,outputEncryptionSettings:null,allowedCardTypes:[]};var Lpe=["tracking","clientSettings"];function Mpe(e){var t=e.tracking,r=e.clientSettings,n=Vy(e,Lpe),o=xw.useMemo((function(){return y1(r,"data.settings.sdk_settings.server_log_settings.enable",null==t?void 0:t.enable)}),[r,t]);return xw.createElement(hne,null,xw.createElement(Yj.SDKTrackingProvider,{value:{tracking:Oy(Oy({},t),{},{enable:o})}},xw.createElement(Npe,Ry({},n,{clientSettings:r}))))}Mpe.propTypes={tracking:xC.shape({}),clientSettings:xC.shape({})},Mpe.defaultProps={tracking:void 0,clientSettings:void 0};var Fpe=uL.Errors,Upe=function(e){var t=e.onClose,r=e.onError,n=e.detectIdCard,o=e.steps,i=e.onStepDone,a=e.apiCredentials,s=e.tracking,c=e.allowedCardTypes,u=Ky(xw.useState(null),2),l=u[0],d=u[1],f=fq.useApiClient({apiCredentials:a,tracking:s}).apiClient,p=xw.useRef(""),h=xw.useRef("");xw.useEffect((function(){function e(){return(e=xy(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.clientSettings();case 2:t=e.sent,d(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[f]);var m=xw.useCallback(function(){var e=xy(regeneratorRuntime.mark((function e(t){var n,a,s,c,u,l,d,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.stepNumber,a=t.recordedVideos,s=t.qrScannedResult,c=t.image,u=o[n],l=u.cardType,d=u.cardSide,m=null,e.prev=3,e.next=6,kde({image:c,cardSide:d,frontCardId:p.current,qrImageId:h.current,onError:r,apiClient:f,cardType:l,recordedVideos:a,qrScannedResult:s});case 6:m=e.sent,d===uL.IDCardSide.FRONT&&(p.current=m.cardInfo.image1.id),h.current=m.qrImageId,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),r(Oy(Oy({},Fpe.api_call_error),{},{details:e.t0}));case 14:m&&i(Oy(Oy({},t),{},{apiResult:m}));case 15:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t){return e.apply(this,arguments)}}(),[f,r,o,i]);return l&&xw.createElement(Mpe,{tracking:s,onClose:t,onError:r,clientSettings:l,detectIdCard:n,onStepDone:m,steps:o,allowedCardTypes:c})};Upe.propTypes={onClose:xC.func,onError:xC.func,detectIdCard:xC.func,onStepDone:xC.func,steps:xC.arrayOf(xC.shape({})),apiCredentials:xC.shape({accessKey:xC.string,secretKey:xC.string,apiUrl:xC.string}),tracking:xC.shape({}),allowedCardTypes:xC.arrayOf(xC.string)},Upe.defaultProps={onClose:function(){},onError:function(){},detectIdCard:function(){return Promise.resolve({card_label:""})},onStepDone:function(){},steps:Dpe,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},tracking:void 0,allowedCardTypes:[]};var jpe=function(e){Ny(r,e);var t=Hy(r);function r(e){return Ty(this,r),t.call(this,Oy(Oy({},e),{},{baseComponent:Ude(),component:{LivenessDetection:Sfe,ReadIDCardUIOnly:Mpe,ReadIDCardWithApiCall:Upe}}))}return r}(yW);t.APIUtils=fq,t.AntiDebugUtils=zq,t.AssetUtils=Jj,t.AsyncUtils=tV,t.BaseTVWebSDK=yW,t.BlurUtils=BV,t.CameraUtils=xV,t.CloseEyesDetector=fW,t.CommonUtils=AV,t.Constants=uL,t.CoordinateUtils=FV,t.CryptoUtils=Wq,t.DEFAULT_CLOSE_EYE_MODEL=dW,t.ExifUtils=lW,t.FaceUtils=KV,t.GlareUtils=nq,t.HashUtils=zj,t.ImageUtils=Jz,t.LoadResourceUtils=Cq,t.LocalStorageUtils=Fj,t.ModelUtils=Vq,t.PredictionUtils=GV,t.SDK=jpe,t.SDKTimer=Kq,t.ScannerType=c3,t.SettingsContext=yj,t.ThemeUtils=qq,t.TimeUtils=Nj,t.TrackingContext=Yj,t.UserAgentUtils=Rj,t.defaultClientSettings=D3,t.defaultReadIDCardSteps=u3,t.getCustomUrlsBySettings=pj,t.getQrScannerWorkerPath=mW,t.getSDKVersion=Ij,t.requestMotionPermission=pW,t.useDeviceMotion=hW,Object.defineProperty(t,"__esModule",{value:!0})}));