@tsocial/tvweb-sdk.dop 5.14.11 → 5.14.12

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.
@@ -20,7 +20,7 @@
20
20
  *
21
21
  * Copyright © 2012-2016 Faisal Salman <fyzlman@gmail.com>
22
22
  * Dual licensed under GPLv2 or MIT
23
- */!function(a,o){var i="function",s="undefined",c="object",l="model",d="name",f="type",h="vendor",p="version",m="architecture",g="console",v="mobile",y="tablet",b="smarttv",C="wearable",w={extend:function(e,r){var t={};for(var n in e)r[n]&&r[n].length%2==0?t[n]=r[n].concat(e[n]):t[n]=e[n];return t},has:function(e,r){return"string"==typeof e&&-1!==r.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},k={rgx:function(e,r){for(var t,n,a,s,l,d,f=0;f<r.length&&!l;){var h=r[f],p=r[f+1];for(t=n=0;t<h.length&&!l;)if(l=h[t++].exec(e))for(a=0;a<p.length;a++)d=l[++n],u(s=p[a])===c&&s.length>0?2==s.length?u(s[1])==i?this[s[0]]=s[1].call(this,d):this[s[0]]=s[1]:3==s.length?u(s[1])!==i||s[1].exec&&s[1].test?this[s[0]]=d?d.replace(s[1],s[2]):o:this[s[0]]=d?s[1].call(this,d,s[2]):o:4==s.length&&(this[s[0]]=d?s[3].call(this,d.replace(s[1],s[2])):o):this[s]=d||o;f+=2}},str:function(e,r){for(var t in r)if(u(r[t])===c&&r[t].length>0){for(var n=0;n<r[t].length;n++)if(w.has(r[t][n],e))return"?"===t?o:t}else if(w.has(r[t],e))return"?"===t?o:t;return e}},B={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"}}}},E={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[d,p],[/(opios)[\/\s]+([\w\.]+)/i],[[d,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[d,"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],[d,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[d,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[d,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[d,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[d,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[d,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[d,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[d,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[d,p],[/(QQ)\/([\d\.]+)/i],[d,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[d,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[d,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[d,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[d],[/(LBBROWSER)/i],[d],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[d,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[d,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[d,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[d,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[d,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[d,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[d,p],[/(dolfin)\/([\w\.]+)/i],[[d,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[d,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[d,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[d,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[d,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,d],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[d,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[d,[p,k.str,B.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[d,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[d,"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],[d,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,w.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[m,/ower/,"",w.lowerize]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[m,w.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[l,h,[f,y]],[/applecoremedia\/[\w\.]+ \((ipad)/],[l,[h,"Apple"],[f,y]],[/(apple\s{0,1}tv)/i],[[l,"Apple TV"],[h,"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],[h,l,[f,y]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[l,[h,"Amazon"],[f,y]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[l,k.str,B.device.amazon.model],[h,"Amazon"],[f,v]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[l,h,[f,v]],[/\((ip[honed|\s\w*]+);/i],[l,[h,"Apple"],[f,v]],[/(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],[h,l,[f,v]],[/\(bb10;\s(\w+)/i],[l,[h,"BlackBerry"],[f,v]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[l,[h,"Asus"],[f,y]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[h,"Sony"],[l,"Xperia Tablet"],[f,y]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[l,[h,"Sony"],[f,v]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[h,l,[f,g]],[/android.+;\s(shield)\sbuild/i],[l,[h,"Nvidia"],[f,g]],[/(playstation\s[34portablevi]+)/i],[l,[h,"Sony"],[f,g]],[/(sprint\s(\w+))/i],[[h,k.str,B.device.sprint.vendor],[l,k.str,B.device.sprint.model],[f,v]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[h,l,[f,y]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[h,[l,/_/g," "],[f,v]],[/(nexus\s9)/i],[l,[h,"HTC"],[f,y]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[l,[h,"Huawei"],[f,v]],[/(microsoft);\s(lumia[\s\w]+)/i],[h,l,[f,v]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[l,[h,"Microsoft"],[f,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,"Microsoft"],[f,v]],[/\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],[l,[h,"Motorola"],[f,v]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[l,[h,"Motorola"],[f,y]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[h,w.trim],[l,w.trim],[f,b]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,"Samsung"],[f,b]],[/\(dtv[\);].+(aquos)/i],[l,[h,"Sharp"],[f,b]],[/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],[[h,"Samsung"],l,[f,y]],[/smart-tv.+(samsung)/i],[h,[f,b],l],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[h,"Samsung"],l,[f,v]],[/sie-(\w*)/i],[l,[h,"Siemens"],[f,v]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[h,"Nokia"],l,[f,v]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[l,[h,"Acer"],[f,y]],[/android.+([vl]k\-?\d{3})\s+build/i],[l,[h,"LG"],[f,y]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[h,"LG"],l,[f,y]],[/(lg) netcast\.tv/i],[h,l,[f,b]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[l,[h,"LG"],[f,v]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[l,[h,"Lenovo"],[f,y]],[/linux;.+((jolla));/i],[h,l,[f,v]],[/((pebble))app\/[\d\.]+\s/i],[h,l,[f,C]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[h,l,[f,v]],[/crkey/i],[[l,"Chromecast"],[h,"Google"]],[/android.+;\s(glass)\s\d/i],[l,[h,"Google"],[f,C]],[/android.+;\s(pixel c)\s/i],[l,[h,"Google"],[f,y]],[/android.+;\s(pixel xl|pixel)\s/i],[l,[h,"Google"],[f,v]],[/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],[[l,/_/g," "],[h,"Xiaomi"],[f,v]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[l,/_/g," "],[h,"Xiaomi"],[f,y]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[l,[h,"Meizu"],[f,y]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[l,[h,"OnePlus"],[f,v]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[l,[h,"RCA"],[f,y]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[l,[h,"Dell"],[f,y]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[l,[h,"Verizon"],[f,y]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[h,"Barnes & Noble"],l,[f,y]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[l,[h,"NuVision"],[f,y]],[/android.+;\s(k88)\sbuild/i],[l,[h,"ZTE"],[f,y]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[l,[h,"Swiss"],[f,v]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[l,[h,"Swiss"],[f,y]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[l,[h,"Zeki"],[f,y]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[h,"Dragon Touch"],l,[f,y]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[l,[h,"Insignia"],[f,y]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[l,[h,"NextBook"],[f,y]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[h,"Voice"],l,[f,v]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[h,"LvTel"],l,[f,v]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[l,[h,"Envizen"],[f,y]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[h,l,[f,y]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[l,[h,"MachSpeed"],[f,y]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[h,l,[f,y]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[l,[h,"Rotor"],[f,y]],[/android.+(KS(.+))\s+build/i],[l,[h,"Amazon"],[f,y]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[h,l,[f,y]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[f,w.lowerize],h,l],[/(android[\w\.\s\-]{0,9});.+build/i],[l,[h,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[d,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[d,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,d]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[d,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],[d,[p,k.str,B.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[d,"Windows"],[p,k.str,B.os.windows.version]],[/\((bb)(10);/i],[[d,"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],[d,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[d,"Symbian"],p],[/\((series40);/i],[d],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[d,"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],[d,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[d,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[d,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[d,p],[/(haiku)\s(\w+)/i],[d,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[d,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[d,"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],[d,p]]},S=function e(r,t){if("object"==u(r)&&(t=r,r=o),!(this instanceof e))return new e(r,t).getResult();var n=r||(a&&a.navigator&&a.navigator.userAgent?a.navigator.userAgent:""),i=t?w.extend(E,t):E;return this.getBrowser=function(){var e={name:o,version:o};return k.rgx.call(e,n,i.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:o};return k.rgx.call(e,n,i.cpu),e},this.getDevice=function(){var e={vendor:o,model:o,type:o};return k.rgx.call(e,n,i.device),e},this.getEngine=function(){var e={name:o,version:o};return k.rgx.call(e,n,i.engine),e},this.getOS=function(){var e={name:o,version:o};return k.rgx.call(e,n,i.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};S.VERSION="0.7.18",S.BROWSER={NAME:d,MAJOR:"major",VERSION:p},S.CPU={ARCHITECTURE:m},S.DEVICE={MODEL:l,VENDOR:h,TYPE:f,CONSOLE:g,MOBILE:v,SMARTTV:b,TABLET:y,WEARABLE:C,EMBEDDED:"embedded"},S.ENGINE={NAME:d,VERSION:p},S.OS={NAME:d,VERSION:p},u(r)!==s?(u(e)!==s&&e.exports&&(r=e.exports=S),r.UAParser=S):t(3)?(n=function(){return S}.call(r,t,r,e))===o||(e.exports=n):a&&(a.UAParser=S);var _=a&&(a.jQuery||a.Zepto);if(u(_)!==s){var A=new S;_.ua=A.getResult(),_.ua.get=function(){return A.getUA()},_.ua.set=function(e){A.setUA(e);var r=A.getResult();for(var t in r)_.ua[t]=r[t]}}}("object"==("undefined"==typeof window?"undefined":u(window))?window:this)},function(e,r){(function(r){e.exports=r}).call(r,{})},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},a=t(0),o=a.DEVICE_TYPES,i=a.defaultData,s=r.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=r.isIOS13Check=function(e){var r=s();return r&&r.platform&&(-1!==r.platform.indexOf(e)||"MacIntel"===r.platform&&r.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case o.MOBILE:return{isMobile:!0};case o.TABLET:return{isTablet:!0};case o.SMART_TV:return{isSmartTV:!0};case o.CONSOLE:return{isConsole:!0};case o.WEARABLE:return{isWearable:!0};case o.BROWSER:return{isBrowser:!0};default:return i}},broPayload:function(e,r,t,n,a){return{isBrowser:e,browserMajorVersion:r.major,browserFullVersion:r.version,browserName:r.name,engineName:t.name||!1,engineVersion:t.version,osName:n.name,osVersion:n.version,userAgent:a}},mobilePayload:function(e,r,t,a){return n({},e,{vendor:r.vendor,model:r.model,os:t.name,osVersion:t.version,ua:a})},stvPayload:function(e,r,t,n){return{isSmartTV:e,engineName:r.name,engineVersion:r.version,osName:t.name,osVersion:t.version,userAgent:n}},consolePayload:function(e,r,t,n){return{isConsole:e,engineName:r.name,engineVersion:r.version,osName:t.name,osVersion:t.version,userAgent:n}},wearPayload:function(e,r,t,n){return{isWearable:e,engineName:r.name,engineVersion:r.version,osName:t.name,osVersion:t.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])}));function en(){return{"X-TV-Device-Model":"".concat(Jt.browserName," ").concat(Jt.browserVersion),"X-TV-OS-Version":"".concat(Jt.osName," ").concat(Jt.osVersion),"X-TV-OS-Platform":Jt.isMobile?"".concat(Jt.osName.toLowerCase(),"_web"):"web","X-TV-SDK-Version":"5.14.11"}}var rn=Object.freeze({__proto__:null,getUAMetadata:en});function tn(e){return e<10?"0".concat(e):e}function nn(e){return"".concat(e.getFullYear(),"-").concat(tn(e.getMonth()+1),"-").concat(tn(e.getDate()),"T").concat(tn(e.getHours()),":").concat(tn(e.getMinutes()),":").concat(tn(e.getSeconds())).concat(function(e){if(0===e)return"Z";var r=e>0?"-":"+";return e=Math.abs(e),"".concat(r+tn(Math.floor(e/60)),":").concat(tn(e%60))}(e.getTimezoneOffset()))}var an=Object.freeze({__proto__:null,rfc3339:nn});function on(e,r){window.localStorage&&window.JSON&&r&&localStorage.setItem(r,JSON.stringify(e))}function sn(e){if(window.localStorage&&window.JSON&&e){var r=localStorage.getItem(e);if(r)return JSON.parse(r)}}var cn=Object.freeze({__proto__:null,storeData:on,getData:sn,removeData:function(e){window.localStorage&&window.JSON&&e&&localStorage.removeItem(e)}}),ln=re((function(e,r){var t;e.exports=t=t||function(e,r){var t;if("undefined"!=typeof window&&window.crypto&&(t=window.crypto),"undefined"!=typeof self&&self.crypto&&(t=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(t=globalThis.crypto),!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto),!t&&void 0!==ee&&ee.crypto&&(t=ee.crypto),!t)try{t=Ht}catch(e){}var n=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(r){var t;return e.prototype=r,t=new e,e.prototype=null,t}}(),o={},i=o.lib={},s=i.Base={extend:function(e){var r=a(this);return e&&r.mixIn(e),r.hasOwnProperty("init")&&this.init!==r.init||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var r in e)e.hasOwnProperty(r)&&(this[r]=e[r]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=i.WordArray=s.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=null!=r?r:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var r=this.words,t=e.words,n=this.sigBytes,a=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<a;o++){var i=t[o>>>2]>>>24-o%4*8&255;r[n+o>>>2]|=i<<24-(n+o)%4*8}else for(var s=0;s<a;s+=4)r[n+s>>>2]=t[s>>>2];return this.sigBytes+=a,this},clamp:function(){var r=this.words,t=this.sigBytes;r[t>>>2]&=4294967295<<32-t%4*8,r.length=e.ceil(t/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var r=[],t=0;t<e;t+=4)r.push(n());return new c.init(r,e)}}),l=o.enc={},u=l.Hex={stringify:function(e){for(var r=e.words,t=e.sigBytes,n=[],a=0;a<t;a++){var o=r[a>>>2]>>>24-a%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var r=e.length,t=[],n=0;n<r;n+=2)t[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(t,r/2)}},d=l.Latin1={stringify:function(e){for(var r=e.words,t=e.sigBytes,n=[],a=0;a<t;a++){var o=r[a>>>2]>>>24-a%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,t=[],n=0;n<r;n++)t[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(t,r)}},f=l.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)))}},h=i.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(r){var t,n=this._data,a=n.words,o=n.sigBytes,i=this.blockSize,s=o/(4*i),l=(s=r?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*i,u=e.min(4*l,o);if(l){for(var d=0;d<l;d+=i)this._doProcessBlock(a,d);t=a.splice(0,l),n.sigBytes-=u}return new c.init(t,u)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(i.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.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(r,t){return new e.init(t).finalize(r)}},_createHmacHelper:function(e){return function(r,t){return new p.HMAC.init(e,t).finalize(r)}}}),o.algo={});return o}(Math)})),un=(re((function(e,r){var t,n,a,o,i,s;e.exports=(n=(t=s=ln).lib,a=n.Base,o=n.WordArray,(i=t.x64={}).Word=a.extend({init:function(e,r){this.high=e,this.low=r}}),i.WordArray=a.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=null!=r?r:8*e.length},toX32:function(){for(var e=this.words,r=e.length,t=[],n=0;n<r;n++){var a=e[n];t.push(a.high),t.push(a.low)}return o.create(t,this.sigBytes)},clone:function(){for(var e=a.clone.call(this),r=e.words=this.words.slice(0),t=r.length,n=0;n<t;n++)r[n]=r[n].clone();return e}}),s)})),re((function(e,r){var t;e.exports=(t=ln,function(){if("function"==typeof ArrayBuffer){var e=t.lib.WordArray,r=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 t=e.byteLength,n=[],a=0;a<t;a++)n[a>>>2]|=e[a]<<24-a%4*8;r.call(this,n,t)}else r.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray)})),re((function(e,r){var t;e.exports=(t=ln,function(){var e=t,r=e.lib.WordArray,n=e.enc;function a(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var r=e.words,t=e.sigBytes,n=[],a=0;a<t;a+=2){var o=r[a>>>2]>>>16-a%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,n=[],a=0;a<t;a++)n[a>>>1]|=e.charCodeAt(a)<<16-a%2*16;return r.create(n,2*t)}},n.Utf16LE={stringify:function(e){for(var r=e.words,t=e.sigBytes,n=[],o=0;o<t;o+=2){var i=a(r[o>>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o++)n[o>>>1]|=a(e.charCodeAt(o)<<16-o%2*16);return r.create(n,2*t)}}}(),t.enc.Utf16)})),re((function(e,r){var t;e.exports=(t=ln,function(){var e=t,r=e.lib.WordArray;function n(e,t,n){for(var a=[],o=0,i=0;i<t;i++)if(i%4){var s=n[e.charCodeAt(i-1)]<<i%4*2|n[e.charCodeAt(i)]>>>6-i%4*2;a[o>>>2]|=s<<24-o%4*8,o++}return r.create(a,o)}e.enc.Base64={stringify:function(e){var r=e.words,t=e.sigBytes,n=this._map;e.clamp();for(var a=[],o=0;o<t;o+=3)for(var i=(r[o>>>2]>>>24-o%4*8&255)<<16|(r[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|r[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<t;s++)a.push(n.charAt(i>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;a.length%4;)a.push(c);return a.join("")},parse:function(e){var r=e.length,t=this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var o=0;o<t.length;o++)a[t.charCodeAt(o)]=o}var i=t.charAt(64);if(i){var s=e.indexOf(i);-1!==s&&(r=s)}return n(e,r,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)})),re((function(e,r){var t;e.exports=(t=ln,function(){var e=t,r=e.lib.WordArray;function n(e,t,n){for(var a=[],o=0,i=0;i<t;i++)if(i%4){var s=n[e.charCodeAt(i-1)]<<i%4*2|n[e.charCodeAt(i)]>>>6-i%4*2;a[o>>>2]|=s<<24-o%4*8,o++}return r.create(a,o)}e.enc.Base64url={stringify:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=e.words,n=e.sigBytes,a=r?this._safe_map:this._map;e.clamp();for(var o=[],i=0;i<n;i+=3)for(var s=(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,c=0;c<4&&i+.75*c<n;c++)o.push(a.charAt(s>>>6*(3-c)&63));var l=a.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=e.length,a=r?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<a.length;i++)o[a.charCodeAt(i)]=i}var s=a.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(t=c)}return n(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),t.enc.Base64url)})),re((function(e,r){var t;e.exports=(t=ln,function(e){var r=t,n=r.lib,a=n.WordArray,o=n.Hasher,i=r.algo,s=[];!function(){for(var r=0;r<64;r++)s[r]=4294967296*e.abs(e.sin(r+1))|0}();var c=i.MD5=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,r){for(var t=0;t<16;t++){var n=r+t,a=e[n];e[n]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var o=this._hash.words,i=e[r+0],c=e[r+1],h=e[r+2],p=e[r+3],m=e[r+4],g=e[r+5],v=e[r+6],y=e[r+7],b=e[r+8],C=e[r+9],w=e[r+10],k=e[r+11],B=e[r+12],E=e[r+13],S=e[r+14],_=e[r+15],A=o[0],I=o[1],T=o[2],x=o[3];A=l(A,I,T,x,i,7,s[0]),x=l(x,A,I,T,c,12,s[1]),T=l(T,x,A,I,h,17,s[2]),I=l(I,T,x,A,p,22,s[3]),A=l(A,I,T,x,m,7,s[4]),x=l(x,A,I,T,g,12,s[5]),T=l(T,x,A,I,v,17,s[6]),I=l(I,T,x,A,y,22,s[7]),A=l(A,I,T,x,b,7,s[8]),x=l(x,A,I,T,C,12,s[9]),T=l(T,x,A,I,w,17,s[10]),I=l(I,T,x,A,k,22,s[11]),A=l(A,I,T,x,B,7,s[12]),x=l(x,A,I,T,E,12,s[13]),T=l(T,x,A,I,S,17,s[14]),A=u(A,I=l(I,T,x,A,_,22,s[15]),T,x,c,5,s[16]),x=u(x,A,I,T,v,9,s[17]),T=u(T,x,A,I,k,14,s[18]),I=u(I,T,x,A,i,20,s[19]),A=u(A,I,T,x,g,5,s[20]),x=u(x,A,I,T,w,9,s[21]),T=u(T,x,A,I,_,14,s[22]),I=u(I,T,x,A,m,20,s[23]),A=u(A,I,T,x,C,5,s[24]),x=u(x,A,I,T,S,9,s[25]),T=u(T,x,A,I,p,14,s[26]),I=u(I,T,x,A,b,20,s[27]),A=u(A,I,T,x,E,5,s[28]),x=u(x,A,I,T,h,9,s[29]),T=u(T,x,A,I,y,14,s[30]),A=d(A,I=u(I,T,x,A,B,20,s[31]),T,x,g,4,s[32]),x=d(x,A,I,T,b,11,s[33]),T=d(T,x,A,I,k,16,s[34]),I=d(I,T,x,A,S,23,s[35]),A=d(A,I,T,x,c,4,s[36]),x=d(x,A,I,T,m,11,s[37]),T=d(T,x,A,I,y,16,s[38]),I=d(I,T,x,A,w,23,s[39]),A=d(A,I,T,x,E,4,s[40]),x=d(x,A,I,T,i,11,s[41]),T=d(T,x,A,I,p,16,s[42]),I=d(I,T,x,A,v,23,s[43]),A=d(A,I,T,x,C,4,s[44]),x=d(x,A,I,T,B,11,s[45]),T=d(T,x,A,I,_,16,s[46]),A=f(A,I=d(I,T,x,A,h,23,s[47]),T,x,i,6,s[48]),x=f(x,A,I,T,y,10,s[49]),T=f(T,x,A,I,S,15,s[50]),I=f(I,T,x,A,g,21,s[51]),A=f(A,I,T,x,B,6,s[52]),x=f(x,A,I,T,p,10,s[53]),T=f(T,x,A,I,w,15,s[54]),I=f(I,T,x,A,c,21,s[55]),A=f(A,I,T,x,b,6,s[56]),x=f(x,A,I,T,_,10,s[57]),T=f(T,x,A,I,v,15,s[58]),I=f(I,T,x,A,E,21,s[59]),A=f(A,I,T,x,m,6,s[60]),x=f(x,A,I,T,k,10,s[61]),T=f(T,x,A,I,h,15,s[62]),I=f(I,T,x,A,C,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+I|0,o[2]=o[2]+T|0,o[3]=o[3]+x|0},_doFinalize:function(){var r=this._data,t=r.words,n=8*this._nDataBytes,a=8*r.sigBytes;t[a>>>5]|=128<<24-a%32;var o=e.floor(n/4294967296),i=n;t[15+(a+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t[14+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r.sigBytes=4*(t.length+1),this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,r,t,n,a,o,i){var s=e+(r&t|~r&n)+a+i;return(s<<o|s>>>32-o)+r}function u(e,r,t,n,a,o,i){var s=e+(r&n|t&~n)+a+i;return(s<<o|s>>>32-o)+r}function d(e,r,t,n,a,o,i){var s=e+(r^t^n)+a+i;return(s<<o|s>>>32-o)+r}function f(e,r,t,n,a,o,i){var s=e+(t^(r|~n))+a+i;return(s<<o|s>>>32-o)+r}r.MD5=o._createHelper(c),r.HmacMD5=o._createHmacHelper(c)}(Math),t.MD5)})),re((function(e,r){var t,n,a,o,i,s,c,l;e.exports=(n=(t=l=ln).lib,a=n.WordArray,o=n.Hasher,i=t.algo,s=[],c=i.SHA1=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,r){for(var t=this._hash.words,n=t[0],a=t[1],o=t[2],i=t[3],c=t[4],l=0;l<80;l++){if(l<16)s[l]=0|e[r+l];else{var u=s[l-3]^s[l-8]^s[l-14]^s[l-16];s[l]=u<<1|u>>>31}var d=(n<<5|n>>>27)+c+s[l];d+=l<20?1518500249+(a&o|~a&i):l<40?1859775393+(a^o^i):l<60?(a&o|a&i|o&i)-1894007588:(a^o^i)-899497514,c=i,i=o,o=a<<30|a>>>2,a=n,n=d}t[0]=t[0]+n|0,t[1]=t[1]+a|0,t[2]=t[2]+o|0,t[3]=t[3]+i|0,t[4]=t[4]+c|0},_doFinalize:function(){var e=this._data,r=e.words,t=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=Math.floor(t/4294967296),r[15+(n+64>>>9<<4)]=t,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=o._createHelper(c),t.HmacSHA1=o._createHmacHelper(c),l.SHA1)})),re((function(e,r){var t;e.exports=(t=ln,function(e){var r=t,n=r.lib,a=n.WordArray,o=n.Hasher,i=r.algo,s=[],c=[];!function(){function r(r){for(var t=e.sqrt(r),n=2;n<=t;n++)if(!(r%n))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var n=2,a=0;a<64;)r(n)&&(a<8&&(s[a]=t(e.pow(n,.5))),c[a]=t(e.pow(n,1/3)),a++),n++}();var l=[],u=i.SHA256=o.extend({_doReset:function(){this._hash=new a.init(s.slice(0))},_doProcessBlock:function(e,r){for(var t=this._hash.words,n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],u=t[5],d=t[6],f=t[7],h=0;h<64;h++){if(h<16)l[h]=0|e[r+h];else{var p=l[h-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=l[h-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[h]=m+l[h-7]+v+l[h-16]}var y=n&a^n&o^a&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),C=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&d)+c[h]+l[h];f=d,d=u,u=s,s=i+C|0,i=o,o=a,a=n,n=C+(b+y)|0}t[0]=t[0]+n|0,t[1]=t[1]+a|0,t[2]=t[2]+o|0,t[3]=t[3]+i|0,t[4]=t[4]+s|0,t[5]=t[5]+u|0,t[6]=t[6]+d|0,t[7]=t[7]+f|0},_doFinalize:function(){var r=this._data,t=r.words,n=8*this._nDataBytes,a=8*r.sigBytes;return t[a>>>5]|=128<<24-a%32,t[14+(a+64>>>9<<4)]=e.floor(n/4294967296),t[15+(a+64>>>9<<4)]=n,r.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(u),r.HmacSHA256=o._createHmacHelper(u)}(Math),t.SHA256)})),re((function(e,r){var t,n,a,o,i,s;e.exports=(n=(t=s=ln).lib.WordArray,a=t.algo,o=a.SHA256,i=a.SHA224=o.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=4,e}}),t.SHA224=o._createHelper(i),t.HmacSHA224=o._createHmacHelper(i),s.SHA224)})),re((function(e,r){var t;e.exports=(t=ln,function(){var e=t,r=e.lib.Hasher,n=e.x64,a=n.Word,o=n.WordArray,i=e.algo;function s(){return a.create.apply(a,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)],l=[];!function(){for(var e=0;e<80;e++)l[e]=s()}();var u=i.SHA512=r.extend({_doReset:function(){this._hash=new o.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(e,r){for(var t=this._hash.words,n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],u=t[5],d=t[6],f=t[7],h=n.high,p=n.low,m=a.high,g=a.low,v=o.high,y=o.low,b=i.high,C=i.low,w=s.high,k=s.low,B=u.high,E=u.low,S=d.high,_=d.low,A=f.high,I=f.low,T=h,x=p,P=m,R=g,D=v,N=y,L=b,O=C,M=w,U=k,F=B,V=E,j=S,z=_,H=A,q=I,K=0;K<80;K++){var G,W,Q=l[K];if(K<16)W=Q.high=0|e[r+2*K],G=Q.low=0|e[r+2*K+1];else{var X=l[K-15],Y=X.high,Z=X.low,$=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,J=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),ee=l[K-2],re=ee.high,te=ee.low,ne=(re>>>19|te<<13)^(re<<3|te>>>29)^re>>>6,ae=(te>>>19|re<<13)^(te<<3|re>>>29)^(te>>>6|re<<26),oe=l[K-7],ie=oe.high,se=oe.low,ce=l[K-16],le=ce.high,ue=ce.low;W=(W=(W=$+ie+((G=J+se)>>>0<J>>>0?1:0))+ne+((G+=ae)>>>0<ae>>>0?1:0))+le+((G+=ue)>>>0<ue>>>0?1:0),Q.high=W,Q.low=G}var de,fe=M&F^~M&j,he=U&V^~U&z,pe=T&P^T&D^P&D,me=x&R^x&N^R&N,ge=(T>>>28|x<<4)^(T<<30|x>>>2)^(T<<25|x>>>7),ve=(x>>>28|T<<4)^(x<<30|T>>>2)^(x<<25|T>>>7),ye=(M>>>14|U<<18)^(M>>>18|U<<14)^(M<<23|U>>>9),be=(U>>>14|M<<18)^(U>>>18|M<<14)^(U<<23|M>>>9),Ce=c[K],we=Ce.high,ke=Ce.low,Be=H+ye+((de=q+be)>>>0<q>>>0?1:0),Ee=ve+me;H=j,q=z,j=F,z=V,F=M,V=U,M=L+(Be=(Be=(Be=Be+fe+((de+=he)>>>0<he>>>0?1:0))+we+((de+=ke)>>>0<ke>>>0?1:0))+W+((de+=G)>>>0<G>>>0?1:0))+((U=O+de|0)>>>0<O>>>0?1:0)|0,L=D,O=N,D=P,N=R,P=T,R=x,T=Be+(ge+pe+(Ee>>>0<ve>>>0?1:0))+((x=de+Ee|0)>>>0<de>>>0?1:0)|0}p=n.low=p+x,n.high=h+T+(p>>>0<x>>>0?1:0),g=a.low=g+R,a.high=m+P+(g>>>0<R>>>0?1:0),y=o.low=y+N,o.high=v+D+(y>>>0<N>>>0?1:0),C=i.low=C+O,i.high=b+L+(C>>>0<O>>>0?1:0),k=s.low=k+U,s.high=w+M+(k>>>0<U>>>0?1:0),E=u.low=E+V,u.high=B+F+(E>>>0<V>>>0?1:0),_=d.low=_+z,d.high=S+j+(_>>>0<z>>>0?1:0),I=f.low=I+q,f.high=A+H+(I>>>0<q>>>0?1:0)},_doFinalize:function(){var e=this._data,r=e.words,t=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[30+(n+128>>>10<<5)]=Math.floor(t/4294967296),r[31+(n+128>>>10<<5)]=t,e.sigBytes=4*r.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=r._createHelper(u),e.HmacSHA512=r._createHmacHelper(u)}(),t.SHA512)})),re((function(e,r){var t,n,a,o,i,s,c,l;e.exports=(n=(t=l=ln).x64,a=n.Word,o=n.WordArray,i=t.algo,s=i.SHA512,c=i.SHA384=s.extend({_doReset:function(){this._hash=new o.init([new a.init(3418070365,3238371032),new a.init(1654270250,914150663),new a.init(2438529370,812702999),new a.init(355462360,4144912697),new a.init(1731405415,4290775857),new a.init(2394180231,1750603025),new a.init(3675008525,1694076839),new a.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=s._createHelper(c),t.HmacSHA384=s._createHmacHelper(c),l.SHA384)})),re((function(e,r){var t;e.exports=(t=ln,function(e){var r=t,n=r.lib,a=n.WordArray,o=n.Hasher,i=r.x64.Word,s=r.algo,c=[],l=[],u=[];!function(){for(var e=1,r=0,t=0;t<24;t++){c[e+5*r]=(t+1)*(t+2)/2%64;var n=(2*e+3*r)%5;e=r%5,r=n}for(e=0;e<5;e++)for(r=0;r<5;r++)l[e+5*r]=r+(2*e+3*r)%5*5;for(var a=1,o=0;o<24;o++){for(var s=0,d=0,f=0;f<7;f++){if(1&a){var h=(1<<f)-1;h<32?d^=1<<h:s^=1<<h-32}128&a?a=a<<1^113:a<<=1}u[o]=i.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=i.create()}();var f=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],r=0;r<25;r++)e[r]=new i.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,r){for(var t=this._state,n=this.blockSize/2,a=0;a<n;a++){var o=e[r+2*a],i=e[r+2*a+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),(I=t[a]).high^=i,I.low^=o}for(var s=0;s<24;s++){for(var f=0;f<5;f++){for(var h=0,p=0,m=0;m<5;m++)h^=(I=t[f+5*m]).high,p^=I.low;var g=d[f];g.high=h,g.low=p}for(f=0;f<5;f++){var v=d[(f+4)%5],y=d[(f+1)%5],b=y.high,C=y.low;for(h=v.high^(b<<1|C>>>31),p=v.low^(C<<1|b>>>31),m=0;m<5;m++)(I=t[f+5*m]).high^=h,I.low^=p}for(var w=1;w<25;w++){var k=(I=t[w]).high,B=I.low,E=c[w];E<32?(h=k<<E|B>>>32-E,p=B<<E|k>>>32-E):(h=B<<E-32|k>>>64-E,p=k<<E-32|B>>>64-E);var S=d[l[w]];S.high=h,S.low=p}var _=d[0],A=t[0];for(_.high=A.high,_.low=A.low,f=0;f<5;f++)for(m=0;m<5;m++){var I=t[w=f+5*m],T=d[w],x=d[(f+1)%5+5*m],P=d[(f+2)%5+5*m];I.high=T.high^~x.high&P.high,I.low=T.low^~x.low&P.low}I=t[0];var R=u[s];I.high^=R.high,I.low^=R.low}},_doFinalize:function(){var r=this._data,t=r.words,n=(this._nDataBytes,8*r.sigBytes),o=32*this.blockSize;t[n>>>5]|=1<<24-n%32,t[(e.ceil((n+1)/o)*o>>>5)-1]|=128,r.sigBytes=4*t.length,this._process();for(var i=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u<c;u++){var d=i[u],f=d.high,h=d.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),l.push(h),l.push(f)}return new a.init(l,s)},clone:function(){for(var e=o.clone.call(this),r=e._state=this._state.slice(0),t=0;t<25;t++)r[t]=r[t].clone();return e}});r.SHA3=o._createHelper(f),r.HmacSHA3=o._createHmacHelper(f)}(Math),t.SHA3)})),re((function(e,r){var t;e.exports=(t=ln,
23
+ */!function(a,o){var i="function",s="undefined",c="object",l="model",d="name",f="type",h="vendor",p="version",m="architecture",g="console",v="mobile",y="tablet",b="smarttv",C="wearable",w={extend:function(e,r){var t={};for(var n in e)r[n]&&r[n].length%2==0?t[n]=r[n].concat(e[n]):t[n]=e[n];return t},has:function(e,r){return"string"==typeof e&&-1!==r.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:o},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},k={rgx:function(e,r){for(var t,n,a,s,l,d,f=0;f<r.length&&!l;){var h=r[f],p=r[f+1];for(t=n=0;t<h.length&&!l;)if(l=h[t++].exec(e))for(a=0;a<p.length;a++)d=l[++n],u(s=p[a])===c&&s.length>0?2==s.length?u(s[1])==i?this[s[0]]=s[1].call(this,d):this[s[0]]=s[1]:3==s.length?u(s[1])!==i||s[1].exec&&s[1].test?this[s[0]]=d?d.replace(s[1],s[2]):o:this[s[0]]=d?s[1].call(this,d,s[2]):o:4==s.length&&(this[s[0]]=d?s[3].call(this,d.replace(s[1],s[2])):o):this[s]=d||o;f+=2}},str:function(e,r){for(var t in r)if(u(r[t])===c&&r[t].length>0){for(var n=0;n<r[t].length;n++)if(w.has(r[t][n],e))return"?"===t?o:t}else if(w.has(r[t],e))return"?"===t?o:t;return e}},B={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"}}}},E={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[d,p],[/(opios)[\/\s]+([\w\.]+)/i],[[d,"Opera Mini"],p],[/\s(opr)\/([\w\.]+)/i],[[d,"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],[d,p],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[d,"IE"],p],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[d,"Edge"],p],[/(yabrowser)\/([\w\.]+)/i],[[d,"Yandex"],p],[/(puffin)\/([\w\.]+)/i],[[d,"Puffin"],p],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[d,"UCBrowser"],p],[/(comodo_dragon)\/([\w\.]+)/i],[[d,/_/g," "],p],[/(micromessenger)\/([\w\.]+)/i],[[d,"WeChat"],p],[/(qqbrowserlite)\/([\w\.]+)/i],[d,p],[/(QQ)\/([\d\.]+)/i],[d,p],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[d,p],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[d,p],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[d,p],[/(MetaSr)[\/\s]?([\w\.]+)/i],[d],[/(LBBROWSER)/i],[d],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[p,[d,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[p,[d,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[p,[d,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[d,/(.+)/,"$1 WebView"],p],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[d,/(.+(?:g|us))(.+)/,"$1 $2"],p],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[p,[d,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[d,p],[/(dolfin)\/([\w\.]+)/i],[[d,"Dolphin"],p],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[d,"Chrome"],p],[/(coast)\/([\w\.]+)/i],[[d,"Opera Coast"],p],[/fxios\/([\w\.-]+)/i],[p,[d,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[p,[d,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[p,d],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[d,"GSA"],p],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[d,[p,k.str,B.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[d,p],[/(navigator|netscape)\/([\w\.-]+)/i],[[d,"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],[d,p]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,w.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[m,/ower/,"",w.lowerize]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[m,w.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[l,h,[f,y]],[/applecoremedia\/[\w\.]+ \((ipad)/],[l,[h,"Apple"],[f,y]],[/(apple\s{0,1}tv)/i],[[l,"Apple TV"],[h,"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],[h,l,[f,y]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[l,[h,"Amazon"],[f,y]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[l,k.str,B.device.amazon.model],[h,"Amazon"],[f,v]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[l,h,[f,v]],[/\((ip[honed|\s\w*]+);/i],[l,[h,"Apple"],[f,v]],[/(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],[h,l,[f,v]],[/\(bb10;\s(\w+)/i],[l,[h,"BlackBerry"],[f,v]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[l,[h,"Asus"],[f,y]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[h,"Sony"],[l,"Xperia Tablet"],[f,y]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[l,[h,"Sony"],[f,v]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[h,l,[f,g]],[/android.+;\s(shield)\sbuild/i],[l,[h,"Nvidia"],[f,g]],[/(playstation\s[34portablevi]+)/i],[l,[h,"Sony"],[f,g]],[/(sprint\s(\w+))/i],[[h,k.str,B.device.sprint.vendor],[l,k.str,B.device.sprint.model],[f,v]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[h,l,[f,y]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[h,[l,/_/g," "],[f,v]],[/(nexus\s9)/i],[l,[h,"HTC"],[f,y]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[l,[h,"Huawei"],[f,v]],[/(microsoft);\s(lumia[\s\w]+)/i],[h,l,[f,v]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[l,[h,"Microsoft"],[f,g]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,"Microsoft"],[f,v]],[/\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],[l,[h,"Motorola"],[f,v]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[l,[h,"Motorola"],[f,y]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[h,w.trim],[l,w.trim],[f,b]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,"Samsung"],[f,b]],[/\(dtv[\);].+(aquos)/i],[l,[h,"Sharp"],[f,b]],[/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],[[h,"Samsung"],l,[f,y]],[/smart-tv.+(samsung)/i],[h,[f,b],l],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[h,"Samsung"],l,[f,v]],[/sie-(\w*)/i],[l,[h,"Siemens"],[f,v]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[h,"Nokia"],l,[f,v]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[l,[h,"Acer"],[f,y]],[/android.+([vl]k\-?\d{3})\s+build/i],[l,[h,"LG"],[f,y]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[h,"LG"],l,[f,y]],[/(lg) netcast\.tv/i],[h,l,[f,b]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[l,[h,"LG"],[f,v]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[l,[h,"Lenovo"],[f,y]],[/linux;.+((jolla));/i],[h,l,[f,v]],[/((pebble))app\/[\d\.]+\s/i],[h,l,[f,C]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[h,l,[f,v]],[/crkey/i],[[l,"Chromecast"],[h,"Google"]],[/android.+;\s(glass)\s\d/i],[l,[h,"Google"],[f,C]],[/android.+;\s(pixel c)\s/i],[l,[h,"Google"],[f,y]],[/android.+;\s(pixel xl|pixel)\s/i],[l,[h,"Google"],[f,v]],[/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],[[l,/_/g," "],[h,"Xiaomi"],[f,v]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[l,/_/g," "],[h,"Xiaomi"],[f,y]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[l,[h,"Meizu"],[f,y]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[l,[h,"OnePlus"],[f,v]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[l,[h,"RCA"],[f,y]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[l,[h,"Dell"],[f,y]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[l,[h,"Verizon"],[f,y]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[h,"Barnes & Noble"],l,[f,y]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[l,[h,"NuVision"],[f,y]],[/android.+;\s(k88)\sbuild/i],[l,[h,"ZTE"],[f,y]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[l,[h,"Swiss"],[f,v]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[l,[h,"Swiss"],[f,y]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[l,[h,"Zeki"],[f,y]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[h,"Dragon Touch"],l,[f,y]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[l,[h,"Insignia"],[f,y]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[l,[h,"NextBook"],[f,y]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[h,"Voice"],l,[f,v]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[h,"LvTel"],l,[f,v]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[l,[h,"Envizen"],[f,y]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[h,l,[f,y]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[l,[h,"MachSpeed"],[f,y]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[h,l,[f,y]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[l,[h,"Rotor"],[f,y]],[/android.+(KS(.+))\s+build/i],[l,[h,"Amazon"],[f,y]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[h,l,[f,y]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[f,w.lowerize],h,l],[/(android[\w\.\s\-]{0,9});.+build/i],[l,[h,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[p,[d,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[d,p],[/rv\:([\w\.]{1,9}).+(gecko)/i],[p,d]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[d,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],[d,[p,k.str,B.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[d,"Windows"],[p,k.str,B.os.windows.version]],[/\((bb)(10);/i],[[d,"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],[d,p],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[d,"Symbian"],p],[/\((series40);/i],[d],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[d,"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],[d,p],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[d,"Chromium OS"],p],[/(sunos)\s?([\w\.\d]*)/i],[[d,"Solaris"],p],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[d,p],[/(haiku)\s(\w+)/i],[d,p],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[p,/_/g,"."],[d,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[d,"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],[d,p]]},S=function e(r,t){if("object"==u(r)&&(t=r,r=o),!(this instanceof e))return new e(r,t).getResult();var n=r||(a&&a.navigator&&a.navigator.userAgent?a.navigator.userAgent:""),i=t?w.extend(E,t):E;return this.getBrowser=function(){var e={name:o,version:o};return k.rgx.call(e,n,i.browser),e.major=w.major(e.version),e},this.getCPU=function(){var e={architecture:o};return k.rgx.call(e,n,i.cpu),e},this.getDevice=function(){var e={vendor:o,model:o,type:o};return k.rgx.call(e,n,i.device),e},this.getEngine=function(){var e={name:o,version:o};return k.rgx.call(e,n,i.engine),e},this.getOS=function(){var e={name:o,version:o};return k.rgx.call(e,n,i.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};S.VERSION="0.7.18",S.BROWSER={NAME:d,MAJOR:"major",VERSION:p},S.CPU={ARCHITECTURE:m},S.DEVICE={MODEL:l,VENDOR:h,TYPE:f,CONSOLE:g,MOBILE:v,SMARTTV:b,TABLET:y,WEARABLE:C,EMBEDDED:"embedded"},S.ENGINE={NAME:d,VERSION:p},S.OS={NAME:d,VERSION:p},u(r)!==s?(u(e)!==s&&e.exports&&(r=e.exports=S),r.UAParser=S):t(3)?(n=function(){return S}.call(r,t,r,e))===o||(e.exports=n):a&&(a.UAParser=S);var _=a&&(a.jQuery||a.Zepto);if(u(_)!==s){var A=new S;_.ua=A.getResult(),_.ua.get=function(){return A.getUA()},_.ua.set=function(e){A.setUA(e);var r=A.getResult();for(var t in r)_.ua[t]=r[t]}}}("object"==("undefined"==typeof window?"undefined":u(window))?window:this)},function(e,r){(function(r){e.exports=r}).call(r,{})},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},a=t(0),o=a.DEVICE_TYPES,i=a.defaultData,s=r.getNavigatorInstance=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},c=r.isIOS13Check=function(e){var r=s();return r&&r.platform&&(-1!==r.platform.indexOf(e)||"MacIntel"===r.platform&&r.maxTouchPoints>1&&!window.MSStream)};e.exports={checkType:function(e){switch(e){case o.MOBILE:return{isMobile:!0};case o.TABLET:return{isTablet:!0};case o.SMART_TV:return{isSmartTV:!0};case o.CONSOLE:return{isConsole:!0};case o.WEARABLE:return{isWearable:!0};case o.BROWSER:return{isBrowser:!0};default:return i}},broPayload:function(e,r,t,n,a){return{isBrowser:e,browserMajorVersion:r.major,browserFullVersion:r.version,browserName:r.name,engineName:t.name||!1,engineVersion:t.version,osName:n.name,osVersion:n.version,userAgent:a}},mobilePayload:function(e,r,t,a){return n({},e,{vendor:r.vendor,model:r.model,os:t.name,osVersion:t.version,ua:a})},stvPayload:function(e,r,t,n){return{isSmartTV:e,engineName:r.name,engineVersion:r.version,osName:t.name,osVersion:t.version,userAgent:n}},consolePayload:function(e,r,t,n){return{isConsole:e,engineName:r.name,engineVersion:r.version,osName:t.name,osVersion:t.version,userAgent:n}},wearPayload:function(e,r,t,n){return{isWearable:e,engineName:r.name,engineVersion:r.version,osName:t.name,osVersion:t.version,userAgent:n}},getNavigatorInstance:s,isIOS13Check:c}}])}));function en(){return{"X-TV-Device-Model":"".concat(Jt.browserName," ").concat(Jt.browserVersion),"X-TV-OS-Version":"".concat(Jt.osName," ").concat(Jt.osVersion),"X-TV-OS-Platform":Jt.isMobile?"".concat(Jt.osName.toLowerCase(),"_web"):"web","X-TV-SDK-Version":"5.14.12"}}var rn=Object.freeze({__proto__:null,getUAMetadata:en});function tn(e){return e<10?"0".concat(e):e}function nn(e){return"".concat(e.getFullYear(),"-").concat(tn(e.getMonth()+1),"-").concat(tn(e.getDate()),"T").concat(tn(e.getHours()),":").concat(tn(e.getMinutes()),":").concat(tn(e.getSeconds())).concat(function(e){if(0===e)return"Z";var r=e>0?"-":"+";return e=Math.abs(e),"".concat(r+tn(Math.floor(e/60)),":").concat(tn(e%60))}(e.getTimezoneOffset()))}var an=Object.freeze({__proto__:null,rfc3339:nn});function on(e,r){window.localStorage&&window.JSON&&r&&localStorage.setItem(r,JSON.stringify(e))}function sn(e){if(window.localStorage&&window.JSON&&e){var r=localStorage.getItem(e);if(r)return JSON.parse(r)}}var cn=Object.freeze({__proto__:null,storeData:on,getData:sn,removeData:function(e){window.localStorage&&window.JSON&&e&&localStorage.removeItem(e)}}),ln=re((function(e,r){var t;e.exports=t=t||function(e,r){var t;if("undefined"!=typeof window&&window.crypto&&(t=window.crypto),"undefined"!=typeof self&&self.crypto&&(t=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(t=globalThis.crypto),!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto),!t&&void 0!==ee&&ee.crypto&&(t=ee.crypto),!t)try{t=Ht}catch(e){}var n=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(r){var t;return e.prototype=r,t=new e,e.prototype=null,t}}(),o={},i=o.lib={},s=i.Base={extend:function(e){var r=a(this);return e&&r.mixIn(e),r.hasOwnProperty("init")&&this.init!==r.init||(r.init=function(){r.$super.init.apply(this,arguments)}),r.init.prototype=r,r.$super=this,r},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var r in e)e.hasOwnProperty(r)&&(this[r]=e[r]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=i.WordArray=s.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=null!=r?r:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var r=this.words,t=e.words,n=this.sigBytes,a=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<a;o++){var i=t[o>>>2]>>>24-o%4*8&255;r[n+o>>>2]|=i<<24-(n+o)%4*8}else for(var s=0;s<a;s+=4)r[n+s>>>2]=t[s>>>2];return this.sigBytes+=a,this},clamp:function(){var r=this.words,t=this.sigBytes;r[t>>>2]&=4294967295<<32-t%4*8,r.length=e.ceil(t/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var r=[],t=0;t<e;t+=4)r.push(n());return new c.init(r,e)}}),l=o.enc={},u=l.Hex={stringify:function(e){for(var r=e.words,t=e.sigBytes,n=[],a=0;a<t;a++){var o=r[a>>>2]>>>24-a%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var r=e.length,t=[],n=0;n<r;n+=2)t[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(t,r/2)}},d=l.Latin1={stringify:function(e){for(var r=e.words,t=e.sigBytes,n=[],a=0;a<t;a++){var o=r[a>>>2]>>>24-a%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,t=[],n=0;n<r;n++)t[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(t,r)}},f=l.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)))}},h=i.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(r){var t,n=this._data,a=n.words,o=n.sigBytes,i=this.blockSize,s=o/(4*i),l=(s=r?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*i,u=e.min(4*l,o);if(l){for(var d=0;d<l;d+=i)this._doProcessBlock(a,d);t=a.splice(0,l),n.sigBytes-=u}return new c.init(t,u)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),p=(i.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.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(r,t){return new e.init(t).finalize(r)}},_createHmacHelper:function(e){return function(r,t){return new p.HMAC.init(e,t).finalize(r)}}}),o.algo={});return o}(Math)})),un=(re((function(e,r){var t,n,a,o,i,s;e.exports=(n=(t=s=ln).lib,a=n.Base,o=n.WordArray,(i=t.x64={}).Word=a.extend({init:function(e,r){this.high=e,this.low=r}}),i.WordArray=a.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=null!=r?r:8*e.length},toX32:function(){for(var e=this.words,r=e.length,t=[],n=0;n<r;n++){var a=e[n];t.push(a.high),t.push(a.low)}return o.create(t,this.sigBytes)},clone:function(){for(var e=a.clone.call(this),r=e.words=this.words.slice(0),t=r.length,n=0;n<t;n++)r[n]=r[n].clone();return e}}),s)})),re((function(e,r){var t;e.exports=(t=ln,function(){if("function"==typeof ArrayBuffer){var e=t.lib.WordArray,r=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 t=e.byteLength,n=[],a=0;a<t;a++)n[a>>>2]|=e[a]<<24-a%4*8;r.call(this,n,t)}else r.apply(this,arguments)}).prototype=e}}(),t.lib.WordArray)})),re((function(e,r){var t;e.exports=(t=ln,function(){var e=t,r=e.lib.WordArray,n=e.enc;function a(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var r=e.words,t=e.sigBytes,n=[],a=0;a<t;a+=2){var o=r[a>>>2]>>>16-a%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,n=[],a=0;a<t;a++)n[a>>>1]|=e.charCodeAt(a)<<16-a%2*16;return r.create(n,2*t)}},n.Utf16LE={stringify:function(e){for(var r=e.words,t=e.sigBytes,n=[],o=0;o<t;o+=2){var i=a(r[o>>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o++)n[o>>>1]|=a(e.charCodeAt(o)<<16-o%2*16);return r.create(n,2*t)}}}(),t.enc.Utf16)})),re((function(e,r){var t;e.exports=(t=ln,function(){var e=t,r=e.lib.WordArray;function n(e,t,n){for(var a=[],o=0,i=0;i<t;i++)if(i%4){var s=n[e.charCodeAt(i-1)]<<i%4*2|n[e.charCodeAt(i)]>>>6-i%4*2;a[o>>>2]|=s<<24-o%4*8,o++}return r.create(a,o)}e.enc.Base64={stringify:function(e){var r=e.words,t=e.sigBytes,n=this._map;e.clamp();for(var a=[],o=0;o<t;o+=3)for(var i=(r[o>>>2]>>>24-o%4*8&255)<<16|(r[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|r[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<t;s++)a.push(n.charAt(i>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;a.length%4;)a.push(c);return a.join("")},parse:function(e){var r=e.length,t=this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var o=0;o<t.length;o++)a[t.charCodeAt(o)]=o}var i=t.charAt(64);if(i){var s=e.indexOf(i);-1!==s&&(r=s)}return n(e,r,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)})),re((function(e,r){var t;e.exports=(t=ln,function(){var e=t,r=e.lib.WordArray;function n(e,t,n){for(var a=[],o=0,i=0;i<t;i++)if(i%4){var s=n[e.charCodeAt(i-1)]<<i%4*2|n[e.charCodeAt(i)]>>>6-i%4*2;a[o>>>2]|=s<<24-o%4*8,o++}return r.create(a,o)}e.enc.Base64url={stringify:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=e.words,n=e.sigBytes,a=r?this._safe_map:this._map;e.clamp();for(var o=[],i=0;i<n;i+=3)for(var s=(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,c=0;c<4&&i+.75*c<n;c++)o.push(a.charAt(s>>>6*(3-c)&63));var l=a.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=e.length,a=r?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<a.length;i++)o[a.charCodeAt(i)]=i}var s=a.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(t=c)}return n(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),t.enc.Base64url)})),re((function(e,r){var t;e.exports=(t=ln,function(e){var r=t,n=r.lib,a=n.WordArray,o=n.Hasher,i=r.algo,s=[];!function(){for(var r=0;r<64;r++)s[r]=4294967296*e.abs(e.sin(r+1))|0}();var c=i.MD5=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,r){for(var t=0;t<16;t++){var n=r+t,a=e[n];e[n]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var o=this._hash.words,i=e[r+0],c=e[r+1],h=e[r+2],p=e[r+3],m=e[r+4],g=e[r+5],v=e[r+6],y=e[r+7],b=e[r+8],C=e[r+9],w=e[r+10],k=e[r+11],B=e[r+12],E=e[r+13],S=e[r+14],_=e[r+15],A=o[0],I=o[1],T=o[2],x=o[3];A=l(A,I,T,x,i,7,s[0]),x=l(x,A,I,T,c,12,s[1]),T=l(T,x,A,I,h,17,s[2]),I=l(I,T,x,A,p,22,s[3]),A=l(A,I,T,x,m,7,s[4]),x=l(x,A,I,T,g,12,s[5]),T=l(T,x,A,I,v,17,s[6]),I=l(I,T,x,A,y,22,s[7]),A=l(A,I,T,x,b,7,s[8]),x=l(x,A,I,T,C,12,s[9]),T=l(T,x,A,I,w,17,s[10]),I=l(I,T,x,A,k,22,s[11]),A=l(A,I,T,x,B,7,s[12]),x=l(x,A,I,T,E,12,s[13]),T=l(T,x,A,I,S,17,s[14]),A=u(A,I=l(I,T,x,A,_,22,s[15]),T,x,c,5,s[16]),x=u(x,A,I,T,v,9,s[17]),T=u(T,x,A,I,k,14,s[18]),I=u(I,T,x,A,i,20,s[19]),A=u(A,I,T,x,g,5,s[20]),x=u(x,A,I,T,w,9,s[21]),T=u(T,x,A,I,_,14,s[22]),I=u(I,T,x,A,m,20,s[23]),A=u(A,I,T,x,C,5,s[24]),x=u(x,A,I,T,S,9,s[25]),T=u(T,x,A,I,p,14,s[26]),I=u(I,T,x,A,b,20,s[27]),A=u(A,I,T,x,E,5,s[28]),x=u(x,A,I,T,h,9,s[29]),T=u(T,x,A,I,y,14,s[30]),A=d(A,I=u(I,T,x,A,B,20,s[31]),T,x,g,4,s[32]),x=d(x,A,I,T,b,11,s[33]),T=d(T,x,A,I,k,16,s[34]),I=d(I,T,x,A,S,23,s[35]),A=d(A,I,T,x,c,4,s[36]),x=d(x,A,I,T,m,11,s[37]),T=d(T,x,A,I,y,16,s[38]),I=d(I,T,x,A,w,23,s[39]),A=d(A,I,T,x,E,4,s[40]),x=d(x,A,I,T,i,11,s[41]),T=d(T,x,A,I,p,16,s[42]),I=d(I,T,x,A,v,23,s[43]),A=d(A,I,T,x,C,4,s[44]),x=d(x,A,I,T,B,11,s[45]),T=d(T,x,A,I,_,16,s[46]),A=f(A,I=d(I,T,x,A,h,23,s[47]),T,x,i,6,s[48]),x=f(x,A,I,T,y,10,s[49]),T=f(T,x,A,I,S,15,s[50]),I=f(I,T,x,A,g,21,s[51]),A=f(A,I,T,x,B,6,s[52]),x=f(x,A,I,T,p,10,s[53]),T=f(T,x,A,I,w,15,s[54]),I=f(I,T,x,A,c,21,s[55]),A=f(A,I,T,x,b,6,s[56]),x=f(x,A,I,T,_,10,s[57]),T=f(T,x,A,I,v,15,s[58]),I=f(I,T,x,A,E,21,s[59]),A=f(A,I,T,x,m,6,s[60]),x=f(x,A,I,T,k,10,s[61]),T=f(T,x,A,I,h,15,s[62]),I=f(I,T,x,A,C,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+I|0,o[2]=o[2]+T|0,o[3]=o[3]+x|0},_doFinalize:function(){var r=this._data,t=r.words,n=8*this._nDataBytes,a=8*r.sigBytes;t[a>>>5]|=128<<24-a%32;var o=e.floor(n/4294967296),i=n;t[15+(a+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t[14+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r.sigBytes=4*(t.length+1),this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,r,t,n,a,o,i){var s=e+(r&t|~r&n)+a+i;return(s<<o|s>>>32-o)+r}function u(e,r,t,n,a,o,i){var s=e+(r&n|t&~n)+a+i;return(s<<o|s>>>32-o)+r}function d(e,r,t,n,a,o,i){var s=e+(r^t^n)+a+i;return(s<<o|s>>>32-o)+r}function f(e,r,t,n,a,o,i){var s=e+(t^(r|~n))+a+i;return(s<<o|s>>>32-o)+r}r.MD5=o._createHelper(c),r.HmacMD5=o._createHmacHelper(c)}(Math),t.MD5)})),re((function(e,r){var t,n,a,o,i,s,c,l;e.exports=(n=(t=l=ln).lib,a=n.WordArray,o=n.Hasher,i=t.algo,s=[],c=i.SHA1=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,r){for(var t=this._hash.words,n=t[0],a=t[1],o=t[2],i=t[3],c=t[4],l=0;l<80;l++){if(l<16)s[l]=0|e[r+l];else{var u=s[l-3]^s[l-8]^s[l-14]^s[l-16];s[l]=u<<1|u>>>31}var d=(n<<5|n>>>27)+c+s[l];d+=l<20?1518500249+(a&o|~a&i):l<40?1859775393+(a^o^i):l<60?(a&o|a&i|o&i)-1894007588:(a^o^i)-899497514,c=i,i=o,o=a<<30|a>>>2,a=n,n=d}t[0]=t[0]+n|0,t[1]=t[1]+a|0,t[2]=t[2]+o|0,t[3]=t[3]+i|0,t[4]=t[4]+c|0},_doFinalize:function(){var e=this._data,r=e.words,t=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=Math.floor(t/4294967296),r[15+(n+64>>>9<<4)]=t,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=o._createHelper(c),t.HmacSHA1=o._createHmacHelper(c),l.SHA1)})),re((function(e,r){var t;e.exports=(t=ln,function(e){var r=t,n=r.lib,a=n.WordArray,o=n.Hasher,i=r.algo,s=[],c=[];!function(){function r(r){for(var t=e.sqrt(r),n=2;n<=t;n++)if(!(r%n))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var n=2,a=0;a<64;)r(n)&&(a<8&&(s[a]=t(e.pow(n,.5))),c[a]=t(e.pow(n,1/3)),a++),n++}();var l=[],u=i.SHA256=o.extend({_doReset:function(){this._hash=new a.init(s.slice(0))},_doProcessBlock:function(e,r){for(var t=this._hash.words,n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],u=t[5],d=t[6],f=t[7],h=0;h<64;h++){if(h<16)l[h]=0|e[r+h];else{var p=l[h-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=l[h-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[h]=m+l[h-7]+v+l[h-16]}var y=n&a^n&o^a&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),C=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&d)+c[h]+l[h];f=d,d=u,u=s,s=i+C|0,i=o,o=a,a=n,n=C+(b+y)|0}t[0]=t[0]+n|0,t[1]=t[1]+a|0,t[2]=t[2]+o|0,t[3]=t[3]+i|0,t[4]=t[4]+s|0,t[5]=t[5]+u|0,t[6]=t[6]+d|0,t[7]=t[7]+f|0},_doFinalize:function(){var r=this._data,t=r.words,n=8*this._nDataBytes,a=8*r.sigBytes;return t[a>>>5]|=128<<24-a%32,t[14+(a+64>>>9<<4)]=e.floor(n/4294967296),t[15+(a+64>>>9<<4)]=n,r.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=o._createHelper(u),r.HmacSHA256=o._createHmacHelper(u)}(Math),t.SHA256)})),re((function(e,r){var t,n,a,o,i,s;e.exports=(n=(t=s=ln).lib.WordArray,a=t.algo,o=a.SHA256,i=a.SHA224=o.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=4,e}}),t.SHA224=o._createHelper(i),t.HmacSHA224=o._createHmacHelper(i),s.SHA224)})),re((function(e,r){var t;e.exports=(t=ln,function(){var e=t,r=e.lib.Hasher,n=e.x64,a=n.Word,o=n.WordArray,i=e.algo;function s(){return a.create.apply(a,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)],l=[];!function(){for(var e=0;e<80;e++)l[e]=s()}();var u=i.SHA512=r.extend({_doReset:function(){this._hash=new o.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(e,r){for(var t=this._hash.words,n=t[0],a=t[1],o=t[2],i=t[3],s=t[4],u=t[5],d=t[6],f=t[7],h=n.high,p=n.low,m=a.high,g=a.low,v=o.high,y=o.low,b=i.high,C=i.low,w=s.high,k=s.low,B=u.high,E=u.low,S=d.high,_=d.low,A=f.high,I=f.low,T=h,x=p,P=m,R=g,D=v,N=y,L=b,O=C,M=w,U=k,F=B,V=E,j=S,z=_,H=A,q=I,K=0;K<80;K++){var G,W,Q=l[K];if(K<16)W=Q.high=0|e[r+2*K],G=Q.low=0|e[r+2*K+1];else{var X=l[K-15],Y=X.high,Z=X.low,$=(Y>>>1|Z<<31)^(Y>>>8|Z<<24)^Y>>>7,J=(Z>>>1|Y<<31)^(Z>>>8|Y<<24)^(Z>>>7|Y<<25),ee=l[K-2],re=ee.high,te=ee.low,ne=(re>>>19|te<<13)^(re<<3|te>>>29)^re>>>6,ae=(te>>>19|re<<13)^(te<<3|re>>>29)^(te>>>6|re<<26),oe=l[K-7],ie=oe.high,se=oe.low,ce=l[K-16],le=ce.high,ue=ce.low;W=(W=(W=$+ie+((G=J+se)>>>0<J>>>0?1:0))+ne+((G+=ae)>>>0<ae>>>0?1:0))+le+((G+=ue)>>>0<ue>>>0?1:0),Q.high=W,Q.low=G}var de,fe=M&F^~M&j,he=U&V^~U&z,pe=T&P^T&D^P&D,me=x&R^x&N^R&N,ge=(T>>>28|x<<4)^(T<<30|x>>>2)^(T<<25|x>>>7),ve=(x>>>28|T<<4)^(x<<30|T>>>2)^(x<<25|T>>>7),ye=(M>>>14|U<<18)^(M>>>18|U<<14)^(M<<23|U>>>9),be=(U>>>14|M<<18)^(U>>>18|M<<14)^(U<<23|M>>>9),Ce=c[K],we=Ce.high,ke=Ce.low,Be=H+ye+((de=q+be)>>>0<q>>>0?1:0),Ee=ve+me;H=j,q=z,j=F,z=V,F=M,V=U,M=L+(Be=(Be=(Be=Be+fe+((de+=he)>>>0<he>>>0?1:0))+we+((de+=ke)>>>0<ke>>>0?1:0))+W+((de+=G)>>>0<G>>>0?1:0))+((U=O+de|0)>>>0<O>>>0?1:0)|0,L=D,O=N,D=P,N=R,P=T,R=x,T=Be+(ge+pe+(Ee>>>0<ve>>>0?1:0))+((x=de+Ee|0)>>>0<de>>>0?1:0)|0}p=n.low=p+x,n.high=h+T+(p>>>0<x>>>0?1:0),g=a.low=g+R,a.high=m+P+(g>>>0<R>>>0?1:0),y=o.low=y+N,o.high=v+D+(y>>>0<N>>>0?1:0),C=i.low=C+O,i.high=b+L+(C>>>0<O>>>0?1:0),k=s.low=k+U,s.high=w+M+(k>>>0<U>>>0?1:0),E=u.low=E+V,u.high=B+F+(E>>>0<V>>>0?1:0),_=d.low=_+z,d.high=S+j+(_>>>0<z>>>0?1:0),I=f.low=I+q,f.high=A+H+(I>>>0<q>>>0?1:0)},_doFinalize:function(){var e=this._data,r=e.words,t=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[30+(n+128>>>10<<5)]=Math.floor(t/4294967296),r[31+(n+128>>>10<<5)]=t,e.sigBytes=4*r.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=r._createHelper(u),e.HmacSHA512=r._createHmacHelper(u)}(),t.SHA512)})),re((function(e,r){var t,n,a,o,i,s,c,l;e.exports=(n=(t=l=ln).x64,a=n.Word,o=n.WordArray,i=t.algo,s=i.SHA512,c=i.SHA384=s.extend({_doReset:function(){this._hash=new o.init([new a.init(3418070365,3238371032),new a.init(1654270250,914150663),new a.init(2438529370,812702999),new a.init(355462360,4144912697),new a.init(1731405415,4290775857),new a.init(2394180231,1750603025),new a.init(3675008525,1694076839),new a.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=s._createHelper(c),t.HmacSHA384=s._createHmacHelper(c),l.SHA384)})),re((function(e,r){var t;e.exports=(t=ln,function(e){var r=t,n=r.lib,a=n.WordArray,o=n.Hasher,i=r.x64.Word,s=r.algo,c=[],l=[],u=[];!function(){for(var e=1,r=0,t=0;t<24;t++){c[e+5*r]=(t+1)*(t+2)/2%64;var n=(2*e+3*r)%5;e=r%5,r=n}for(e=0;e<5;e++)for(r=0;r<5;r++)l[e+5*r]=r+(2*e+3*r)%5*5;for(var a=1,o=0;o<24;o++){for(var s=0,d=0,f=0;f<7;f++){if(1&a){var h=(1<<f)-1;h<32?d^=1<<h:s^=1<<h-32}128&a?a=a<<1^113:a<<=1}u[o]=i.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=i.create()}();var f=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],r=0;r<25;r++)e[r]=new i.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,r){for(var t=this._state,n=this.blockSize/2,a=0;a<n;a++){var o=e[r+2*a],i=e[r+2*a+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),(I=t[a]).high^=i,I.low^=o}for(var s=0;s<24;s++){for(var f=0;f<5;f++){for(var h=0,p=0,m=0;m<5;m++)h^=(I=t[f+5*m]).high,p^=I.low;var g=d[f];g.high=h,g.low=p}for(f=0;f<5;f++){var v=d[(f+4)%5],y=d[(f+1)%5],b=y.high,C=y.low;for(h=v.high^(b<<1|C>>>31),p=v.low^(C<<1|b>>>31),m=0;m<5;m++)(I=t[f+5*m]).high^=h,I.low^=p}for(var w=1;w<25;w++){var k=(I=t[w]).high,B=I.low,E=c[w];E<32?(h=k<<E|B>>>32-E,p=B<<E|k>>>32-E):(h=B<<E-32|k>>>64-E,p=k<<E-32|B>>>64-E);var S=d[l[w]];S.high=h,S.low=p}var _=d[0],A=t[0];for(_.high=A.high,_.low=A.low,f=0;f<5;f++)for(m=0;m<5;m++){var I=t[w=f+5*m],T=d[w],x=d[(f+1)%5+5*m],P=d[(f+2)%5+5*m];I.high=T.high^~x.high&P.high,I.low=T.low^~x.low&P.low}I=t[0];var R=u[s];I.high^=R.high,I.low^=R.low}},_doFinalize:function(){var r=this._data,t=r.words,n=(this._nDataBytes,8*r.sigBytes),o=32*this.blockSize;t[n>>>5]|=1<<24-n%32,t[(e.ceil((n+1)/o)*o>>>5)-1]|=128,r.sigBytes=4*t.length,this._process();for(var i=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u<c;u++){var d=i[u],f=d.high,h=d.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),l.push(h),l.push(f)}return new a.init(l,s)},clone:function(){for(var e=o.clone.call(this),r=e._state=this._state.slice(0),t=0;t<25;t++)r[t]=r[t].clone();return e}});r.SHA3=o._createHelper(f),r.HmacSHA3=o._createHmacHelper(f)}(Math),t.SHA3)})),re((function(e,r){var t;e.exports=(t=ln,
24
24
  /** @preserve
25
25
  (c) 2012 by Cédric Mesnil. All rights reserved.
26
26
 
@@ -52,7 +52,7 @@ function(e){var r=t,n=r.lib,a=n.WordArray,o=n.Hasher,i=r.algo,s=a.create([0,1,2,
52
52
  * @since jsrsasign 2.1
53
53
  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
54
54
  */
55
- var as={};void 0!==as.asn1&&as.asn1||(as.asn1={}),as.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var r=e.toString(16);return r.length%2==1&&(r="0"+r),r},this.bigIntToMinTwosComplementsHex=function(e){var r=e.toString(16);if("-"!=r.substr(0,1))r.length%2==1?r="0"+r:r.match(/^[0-7]/)||(r="00"+r);else{var t=r.substr(1).length;t%2==1?t+=1:r.match(/^[0-7]/)||(t+=2);for(var n="",a=0;a<t;a++)n+="f";r=new Pi(n,16).xor(e).add(Pi.ONE).toString(16).replace(/^-/,"")}return r},this.getPEMStringFromHex=function(e,r){return hextopem(e,r)},this.newObject=function(e){var r=as.asn1,t=r.DERBoolean,n=r.DERInteger,a=r.DERBitString,o=r.DEROctetString,i=r.DERNull,s=r.DERObjectIdentifier,c=r.DEREnumerated,l=r.DERUTF8String,u=r.DERNumericString,d=r.DERPrintableString,f=r.DERTeletexString,h=r.DERIA5String,p=r.DERUTCTime,m=r.DERGeneralizedTime,g=r.DERSequence,v=r.DERSet,y=r.DERTaggedObject,b=r.ASN1Util.newObject,C=Object.keys(e);if(1!=C.length)throw"key of param shall be only one.";var w=C[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":"))throw"undefined key: "+w;if("bool"==w)return new t(e[w]);if("int"==w)return new n(e[w]);if("bitstr"==w)return new a(e[w]);if("octstr"==w)return new o(e[w]);if("null"==w)return new i(e[w]);if("oid"==w)return new s(e[w]);if("enum"==w)return new c(e[w]);if("utf8str"==w)return new l(e[w]);if("numstr"==w)return new u(e[w]);if("prnstr"==w)return new d(e[w]);if("telstr"==w)return new f(e[w]);if("ia5str"==w)return new h(e[w]);if("utctime"==w)return new p(e[w]);if("gentime"==w)return new m(e[w]);if("seq"==w){for(var k=e[w],B=[],E=0;E<k.length;E++){var S=b(k[E]);B.push(S)}return new g({array:B})}if("set"==w){for(k=e[w],B=[],E=0;E<k.length;E++)S=b(k[E]),B.push(S);return new v({array:B})}if("tag"==w){var _=e[w];if("[object Array]"===Object.prototype.toString.call(_)&&3==_.length){var A=b(_[2]);return new y({tag:_[0],explicit:_[1],obj:A})}var I={};if(void 0!==_.explicit&&(I.explicit=_.explicit),void 0!==_.tag&&(I.tag=_.tag),void 0===_.obj)throw"obj shall be specified for 'tag'.";return I.obj=b(_.obj),new y(I)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},as.asn1.ASN1Util.oidHexToInt=function(e){for(var r="",t=parseInt(e.substr(0,2),16),n=(r=Math.floor(t/40)+"."+t%40,""),a=2;a<e.length;a+=2){var o=("00000000"+parseInt(e.substr(a,2),16).toString(2)).slice(-8);n+=o.substr(1,7),"0"==o.substr(0,1)&&(r=r+"."+new Pi(n,2).toString(10),n="")}return r},as.asn1.ASN1Util.oidIntToHex=function(e){var r=function(e){var r=e.toString(16);return 1==r.length&&(r="0"+r),r},t=function(e){var t="",n=new Pi(e,10).toString(2),a=7-n.length%7;7==a&&(a=0);for(var o="",i=0;i<a;i++)o+="0";for(n=o+n,i=0;i<n.length-1;i+=7){var s=n.substr(i,7);i!=n.length-7&&(s="1"+s),t+=r(parseInt(s,2))}return t};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",a=e.split("."),o=40*parseInt(a[0])+parseInt(a[1]);n+=r(o),a.splice(0,2);for(var i=0;i<a.length;i++)n+=t(a[i]);return n},as.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,r=e.toString(16);if(r.length%2==1&&(r="0"+r),e<128)return r;var t=r.length/2;if(t>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+t).toString(16)+r},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""}},as.asn1.DERAbstractString=function(e){as.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))},ns.lang.extend(as.asn1.DERAbstractString,as.asn1.ASN1Object),as.asn1.DERAbstractTime=function(e){as.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,r,t){var n=this.zeroPadding,a=this.localDateToUTC(e),o=String(a.getFullYear());"utc"==r&&(o=o.substr(2,2));var i=o+n(String(a.getMonth()+1),2)+n(String(a.getDate()),2)+n(String(a.getHours()),2)+n(String(a.getMinutes()),2)+n(String(a.getSeconds()),2);if(!0===t){var s=a.getMilliseconds();if(0!=s){var c=n(String(s),3);i=i+"."+(c=c.replace(/[0]+$/,""))}}return i+"Z"},this.zeroPadding=function(e,r){return e.length>=r?e:new Array(r-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,r,t,n,a,o){var i=new Date(Date.UTC(e,r-1,t,n,a,o,0));this.setByDate(i)},this.getFreshValueHex=function(){return this.hV}},ns.lang.extend(as.asn1.DERAbstractTime,as.asn1.ASN1Object),as.asn1.DERAbstractStructured=function(e){as.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)},ns.lang.extend(as.asn1.DERAbstractStructured,as.asn1.ASN1Object),as.asn1.DERBoolean=function(){as.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},ns.lang.extend(as.asn1.DERBoolean,as.asn1.ASN1Object),as.asn1.DERInteger=function(e){as.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=as.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var r=new Pi(String(e),10);this.setByBigInteger(r)},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))},ns.lang.extend(as.asn1.DERInteger,as.asn1.ASN1Object),as.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var r=as.asn1.ASN1Util.newObject(e.obj);e.hex="00"+r.getEncodedHex()}as.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,r){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var t="0"+e;this.hTLV=null,this.isModified=!0,this.hV=t+r},this.setByBinaryString=function(e){var r=8-(e=e.replace(/0+$/,"")).length%8;8==r&&(r=0);for(var t=0;t<=r;t++)e+="0";var n="";for(t=0;t<e.length-1;t+=8){var a=e.substr(t,8),o=parseInt(a,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+r+n},this.setByBooleanArray=function(e){for(var r="",t=0;t<e.length;t++)1==e[t]?r+="1":r+="0";this.setByBinaryString(r)},this.newFalseArray=function(e){for(var r=new Array(e),t=0;t<e;t++)r[t]=!1;return r},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))},ns.lang.extend(as.asn1.DERBitString,as.asn1.ASN1Object),as.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var r=as.asn1.ASN1Util.newObject(e.obj);e.hex=r.getEncodedHex()}as.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},ns.lang.extend(as.asn1.DEROctetString,as.asn1.DERAbstractString),as.asn1.DERNull=function(){as.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},ns.lang.extend(as.asn1.DERNull,as.asn1.ASN1Object),as.asn1.DERObjectIdentifier=function(e){var r=function(e){var r=e.toString(16);return 1==r.length&&(r="0"+r),r},t=function(e){var t="",n=new Pi(e,10).toString(2),a=7-n.length%7;7==a&&(a=0);for(var o="",i=0;i<a;i++)o+="0";for(n=o+n,i=0;i<n.length-1;i+=7){var s=n.substr(i,7);i!=n.length-7&&(s="1"+s),t+=r(parseInt(s,2))}return t};as.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="",a=e.split("."),o=40*parseInt(a[0])+parseInt(a[1]);n+=r(o),a.splice(0,2);for(var i=0;i<a.length;i++)n+=t(a[i]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var r=as.asn1.x509.OID.name2oid(e);if(""===r)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(r)},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))},ns.lang.extend(as.asn1.DERObjectIdentifier,as.asn1.ASN1Object),as.asn1.DEREnumerated=function(e){as.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=as.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var r=new Pi(String(e),10);this.setByBigInteger(r)},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))},ns.lang.extend(as.asn1.DEREnumerated,as.asn1.ASN1Object),as.asn1.DERUTF8String=function(e){as.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},ns.lang.extend(as.asn1.DERUTF8String,as.asn1.DERAbstractString),as.asn1.DERNumericString=function(e){as.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},ns.lang.extend(as.asn1.DERNumericString,as.asn1.DERAbstractString),as.asn1.DERPrintableString=function(e){as.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},ns.lang.extend(as.asn1.DERPrintableString,as.asn1.DERAbstractString),as.asn1.DERTeletexString=function(e){as.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},ns.lang.extend(as.asn1.DERTeletexString,as.asn1.DERAbstractString),as.asn1.DERIA5String=function(e){as.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},ns.lang.extend(as.asn1.DERIA5String,as.asn1.DERAbstractString),as.asn1.DERUTCTime=function(e){as.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))},ns.lang.extend(as.asn1.DERUTCTime,as.asn1.DERAbstractTime),as.asn1.DERGeneralizedTime=function(e){as.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))},ns.lang.extend(as.asn1.DERGeneralizedTime,as.asn1.DERAbstractTime),as.asn1.DERSequence=function(e){as.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",r=0;r<this.asn1Array.length;r++)e+=this.asn1Array[r].getEncodedHex();return this.hV=e,this.hV}},ns.lang.extend(as.asn1.DERSequence,as.asn1.DERAbstractStructured),as.asn1.DERSet=function(e){as.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,r=0;r<this.asn1Array.length;r++){var t=this.asn1Array[r];e.push(t.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)},ns.lang.extend(as.asn1.DERSet,as.asn1.DERAbstractStructured),as.asn1.DERTaggedObject=function(e){as.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,r,t){this.hT=r,this.isExplicit=e,this.asn1Object=t,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=t.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,r),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)))},ns.lang.extend(as.asn1.DERTaggedObject,as.asn1.ASN1Object);var os,is,ss,cs,ls=(os=function(e,r){return(os=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])})(e,r)},function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function t(){this.constructor=e}os(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}),us=function(e){function r(t){var n=e.call(this)||this;return t&&("string"==typeof t?n.parseKey(t):(r.hasPrivateKeyProperty(t)||r.hasPublicKeyProperty(t))&&n.parsePropertiesFrom(t)),n}return ls(r,e),r.prototype.parseKey=function(e){try{var r=0,t=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?function(e){var r;if(void 0===pi){var t="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(pi={},r=0;r<16;++r)pi[t.charAt(r)]=r;for(t=t.toLowerCase(),r=10;r<16;++r)pi[t.charAt(r)]=r;for(r=0;r<n.length;++r)pi[n.charAt(r)]=-1}var a=[],o=0,i=0;for(r=0;r<e.length;++r){var s=e.charAt(r);if("="==s)break;if(-1!=(s=pi[s])){if(void 0===s)throw new Error("Illegal character at offset "+r);o|=s,++i>=2?(a[a.length]=o,o=0,i=0):o<<=4}}if(i)throw new Error("Hex encoding incomplete: 4 bits missing");return a}(e):bi.unarmor(e),a=Ai.decode(n);if(3===a.sub.length&&(a=a.sub[2].sub[0]),9===a.sub.length){r=a.sub[1].getHexStringValue(),this.n=Mi(r,16),t=a.sub[2].getHexStringValue(),this.e=parseInt(t,16);var o=a.sub[3].getHexStringValue();this.d=Mi(o,16);var i=a.sub[4].getHexStringValue();this.p=Mi(i,16);var s=a.sub[5].getHexStringValue();this.q=Mi(s,16);var c=a.sub[6].getHexStringValue();this.dmp1=Mi(c,16);var l=a.sub[7].getHexStringValue();this.dmq1=Mi(l,16);var u=a.sub[8].getHexStringValue();this.coeff=Mi(u,16)}else{if(2!==a.sub.length)return!1;if(a.sub[0].sub){var d=a.sub[1].sub[0];r=d.sub[0].getHexStringValue(),this.n=Mi(r,16),t=d.sub[1].getHexStringValue(),this.e=parseInt(t,16)}else r=a.sub[0].getHexStringValue(),this.n=Mi(r,16),t=a.sub[1].getHexStringValue(),this.e=parseInt(t,16)}return!0}catch(e){return!1}},r.prototype.getPrivateBaseKey=function(){var e={array:[new as.asn1.DERInteger({int:0}),new as.asn1.DERInteger({bigint:this.n}),new as.asn1.DERInteger({int:this.e}),new as.asn1.DERInteger({bigint:this.d}),new as.asn1.DERInteger({bigint:this.p}),new as.asn1.DERInteger({bigint:this.q}),new as.asn1.DERInteger({bigint:this.dmp1}),new as.asn1.DERInteger({bigint:this.dmq1}),new as.asn1.DERInteger({bigint:this.coeff})]};return new as.asn1.DERSequence(e).getEncodedHex()},r.prototype.getPrivateBaseKeyB64=function(){return gi(this.getPrivateBaseKey())},r.prototype.getPublicBaseKey=function(){var e=new as.asn1.DERSequence({array:[new as.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new as.asn1.DERNull]}),r=new as.asn1.DERSequence({array:[new as.asn1.DERInteger({bigint:this.n}),new as.asn1.DERInteger({int:this.e})]}),t=new as.asn1.DERBitString({hex:"00"+r.getEncodedHex()});return new as.asn1.DERSequence({array:[e,t]}).getEncodedHex()},r.prototype.getPublicBaseKeyB64=function(){return gi(this.getPublicBaseKey())},r.wordwrap=function(e,r){if(!e)return e;var t="(.{1,"+(r=r||64)+"})( +|$\n?)|(.{1,"+r+"})";return e.match(RegExp(t,"g")).join("\n")},r.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return(e+=r.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},r.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return(e+=r.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},r.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},r.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")},r.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)},r}(rs),ds=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 us(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(vi(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return gi(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,r,t){try{return gi(this.getKey().sign(e,r,t))}catch(e){return!1}},e.prototype.verify=function(e,r,t){try{return this.getKey().verify(e,vi(r),t)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new us,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}(),fs=function(e,r,t){return null==e?e:function(e,r,t,n){if(!pe(e))return e;for(var a=-1,o=(r=pt(r,e)).length,i=o-1,s=e;null!=s&&++a<o;){var c=mt(r[a]),l=t;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(a!=i){var u=s[c];void 0===(l=n?n(u,c,s):void 0)&&(l=pe(u)?u:er(r[a+1])?[]:{})}ze(s,c,l),s=s[c]}return e}(e,r,t)},hs=["-","-","-","-","-","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","-","-","-","-","-"],ps={},ms={SELFIE:"selfie",ID_CARD:"id_card"},gs=Go((function(){var e=new ds;return e.setPublicKey(hs.join("")),e}));is=gs();var vs=function(e){var r=e.gesture;return{capture_time:e.captureTime,type:r,frames:e.frames}},ys=function(e){var r=e.detectedCard,t=e.captureTime,n=e.vCam,a=e.captureCount,o=e.captureDuration,i=e.captureType;return{capture_time:t,type:null==r?void 0:r.label,v_cam:n,capture_count:a,capture_duration:o,capture_type:i}},bs=function(){var e=L(regeneratorRuntime.mark((function e(r,t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return q(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},e.abrupt("return",new Promise((function(e){var a=new TextEncoder,o=a.encode(r),i=a.encode(t);window.crypto.subtle.importKey("raw",i,"AES-GCM",!0,["encrypt","decrypt"]).then((function(r){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},r,o).then((function(r){e("".concat(cs,".").concat(n(r)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),Cs=function(){var e=L(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.mode,a=r.imageData,r.enableExifData){e.next=3;break}return e.abrupt("return",new Promise((function(e){return e(a.blob)})));case 3:return o=z(z({},ps),n===ms.SELFIE?vs(a):ys(a)),i=z(z({},o),{},{sensor_data:"sensor data exceed 64KB"}),null!=a&&null!==(t=a.type)&&void 0!==t&&t.includes("qr")&&(o={capture_time:null==a?void 0:a.captureTime,type:null==a?void 0:a.type,qr_string:null==a?void 0:a.result}),e.next=8,bs(JSON.stringify(i),ss);case 8:return s=e.sent,e.next=11,bs(JSON.stringify(o),ss);case 11:return c=e.sent,l=ii.dump({Exif:F({},ii.ExifIFD.MakerNote,c)}),u=ii.dump({Exif:F({},ii.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var r=new FileReader;r.onload=function(){var r=L(regeneratorRuntime.mark((function r(t){var n,o,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:try{n=ii.insert(l,t.target.result)}catch(r){try{n=ii.insert(u,t.target.result)}catch(r){e(a.blob)}}return r.prev=1,r.next=4,fetch(n);case 4:return o=r.sent,r.next=7,o.blob();case 7:i=r.sent,URL.revokeObjectURL(n),e(i),r.next=15;break;case 12:r.prev=12,r.t0=r.catch(1),e(a.blob);case 15:case"end":return r.stop()}}),r,null,[[1,12]])})));return function(e){return r.apply(this,arguments)}}(),r.readAsDataURL(a.blob)})));case 15:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),ws=Object.freeze({__proto__:null,MODE:ms,initExifData:function(){ps={device_info:{device_brand_name:"".concat("none"===Jt.mobileVendor?"null":Jt.mobileVendor),device_model:"".concat("none"===Jt.mobileModel?"null":Jt.mobileModel),browser_version:"".concat(Jt.browserName," ").concat(Jt.browserVersion),browser_userAgent:"".concat(Jt.getUA),os:Jt.osName,os_version:Jt.osVersion},sdk_version:"5.14.11",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,r){fs(ps,e,r)},preWriteExif:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.mode,t=(e.motionData,e.orientationData,e.startTime),n=e.endTime;ps.user_action=z({},r===ms.SELFIE?{start_selfie:t,end_selfie:n}:{start_id_card:t,end_id_card:n}),ss=Zt().replace(/-/g,""),is||(is=gs()),cs=vi(is.encrypt(ss))},writeExif:Cs}),ks="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",Bs=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ks,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.342,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:368,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;O(this,e),this.model_path=r,this.threshold=t,this.size=Math.round(n/2),this.enable_profiling=a,this.num_threads=o}var r,t;return U(e,[{key:"load",value:(t=L(regeneratorRuntime.mark((function e(){var r,t,n,a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=window,t=r.tf,e.next=3,$o({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],t.tidy((function(){var e=t.randomNormal([1,a.input_width,a.input_height,3]);a.model.predict(e)}));case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"crop_eyes",value:function(e,r){var t=this,n=window.tf,a=r[0].map((function(e){return Math.round(e)})),o=r[1].map((function(e){return Math.round(e)}));a[0]>o[0]&&(a=r[1].map((function(e){return Math.round(e)})),o=r[0].map((function(e){return Math.round(e)})));var i=Math.round((a[0]+o[0])/2),s=i-a[0],c=o[0]-i;s>=this.size&&(s=this.size),c>=this.size&&(c=this.size);var l=Math.max(a[0]-s,0),u=Math.max(a[1]-s,0),d=Math.max(o[0]-c,0),f=Math.max(o[1]-c,0);return n.tidy((function(){var r=e.slice([u,l,0],[2*s,2*s,3]),a=e.slice([f,d,0],[2*c,2*c,3]);return{l_img:r=n.expandDims(n.image.resizeBilinear(r,[t.input_width,t.input_height])),r_img:a=n.expandDims(n.image.resizeBilinear(a,[t.input_width,t.input_height]))}}))}},{key:"predict",value:(r=L(regeneratorRuntime.mark((function e(r,t){var n,a,o,i,s,c,l,u,d,f=this,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=h.length>2&&void 0!==h[2]?h[2]:this.threshold,a=window,o=a.tf,i=r.getContext("2d"),s=i.getImageData(0,0,r.height,r.width),c=o.tidy((function(){var e=o.browser.fromPixels(s),r=f.crop_eyes(e,t),a=r.l_img,i=r.r_img,c=f.model.predict(a).arraySync()[0],l=f.model.predict(i).arraySync()[0];return[c>n,l>n]})),l=H(c,2),u=l[0],d=l[1],e.abrupt("return",{isEyeClose:u||d});case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}(),Es=function(){var e=L(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 Ss(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,n=void 0===t?100:t,a=r.useRef([]),o=r.useRef([]),i=(r.useRef(!1),r.useRef({})),s=r.useCallback((function(e){var r=Date.now(),t=e.type;return!!(i.current[t]&&r-i.current[t]<n)||(i.current[t]=r,!1)}),[n]),c=r.useCallback((function(e){s(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})}),[s]),l=r.useCallback((function(e){var r,t,n,o,i,c;s(e)||a.current.push({time:Date.now(),Accelerometer:{x:null==e||null===(r=e.acceleration)||void 0===r?void 0:r.x,y:null==e||null===(t=e.acceleration)||void 0===t?void 0:t.y,z:null==e||null===(n=e.acceleration)||void 0===n?void 0:n.z},Gyroscope:{z:null==e||null===(o=e.rotationRate)||void 0===o?void 0:o.alpha,x:null==e||null===(i=e.rotationRate)||void 0===i?void 0:i.beta,y:null==e||null===(c=e.rotationRate)||void 0===c?void 0:c.gamma}})}),[s]),u=r.useCallback((function(){}),[l,c]),d=r.useCallback((function(){}),[l,c]);return r.useEffect((function(){return function(){d()}}),[d]),{motionData:a.current,orientationData:o.current,startMotion:u,stopMotion:d}}var _s=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']))},As=en(),Is=function(){function e(r){var t=this,n=r.container,a=r.lang,o=void 0===a?"en":a,s=r.assetRoot,c=void 0===s?"https://unpkg.com/@tsocial/tvweb-sdk@latest/assets":s,u=r.resourceRoot,d=r.customUrls,f=void 0===d?{}:d,h=r.enableAntiDebug,p=void 0===h||h,m=r.warmupMessage,g=r.baseComponent,v=r.component,y=void 0===v?{}:v,b=r.country,C=void 0===b?"vn":b,w=r.idCardContext;O(this,e),F(this,"initNativeCamera",(function(e){var r=document.createElement("div");document.body.appendChild(r);var n=i.default.createRef(),a=t.component.NativeCamera;return l.default.render(i.default.createElement(a,V({},e,{ref:n})),r),{openCamera:function(){n.current.click()}}})),F(this,"runWarmUpReadIDCard",L(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.commonSettings.customUrls,e.abrupt("return",t.component.warmUpReadIdCard(r));case 2:case"end":return e.stop()}}),e)})))),F(this,"runPreloadEKYCResources",L(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.commonSettings.customUrls,t.component.preloadEKYCResources(r);case 2:case"end":return e.stop()}}),e)})))),F(this,"destroyView",(function(){l.default.unmountComponentAtNode(t.container)})),function(e,r,t,n,a,o,i,s){if(!e){var c;if(void 0===r)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[t,n,a,o,i,s],u=0;(c=new Error(r.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var k=Mt({resourceRoot:u,initCustomUrls:f,country:C});this.commonSettings=z({lang:o,assetRoot:c,customUrls:k,enableAntiDebug:p,debug:!1,warmupMessage:m,country:C},w),this.component=z(z({},g),y)}return U(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 r=this.component.ReadIDCardWithApiCall;l.default.render(i.default.createElement(Ft,{value:this.commonSettings},i.default.createElement(r,V({onClose:this.destroyView},e))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var r=this.component.ReadIDCardUIOnly;l.default.render(i.default.createElement(Ft,{value:this.commonSettings},i.default.createElement(r,V({onClose:this.destroyView},e))),this.container)}},{key:"livenessDetection",value:function(e){var r=this.component.LivenessDetection;l.default.render(i.default.createElement(Ft,{value:z({},this.commonSettings)},i.default.createElement(r,V({onClose:this.destroyView},e))),this.container)}},{key:"compareFaces",value:function(e){var r=e.accessKey,t=e.secretKey,n=e.apiUrl,a=e.image1,o=e.image2,i=e.onSuccess,s=e.onError;_o(new qt(r,t,n,{httpHeaders:As})).compareFaces({image1:{id:a},image2:{id:o}}).then((function(e){i(e)})).catch((function(e){s(e)}))}}]),e}(),Ts="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ps(e,r,t){return e(t={path:r,exports:{},require:function(e,r){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==r&&t.path)}},t.exports),t.exports}var Rs=Ps((function(e){e.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=1)}([function(e,r,t){var n={MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0};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:n,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,r,t){var n,a=t(2),o=t(0),i=o.BROWSER_TYPES,s=o.OS_TYPES,c=o.DEVICE_TYPES,l=t(4),u=l.checkType,d=l.broPayload,f=l.mobilePayload,h=l.wearPayload,p=l.consolePayload,m=l.stvPayload,g=l.getNavigatorInstance,v=l.isIOS13Check,y=new a,b=y.getBrowser(),C=y.getDevice(),w=y.getEngine(),k=y.getOS(),B=y.getUA(),E=i.CHROME,S=i.CHROMIUM,_=i.IE,A=i.INTERNET_EXPLORER,I=i.OPERA,T=i.FIREFOX,x=i.SAFARI,P=i.EDGE,R=i.YANDEX,D=i.MOBILE_SAFARI,N=c.MOBILE,L=c.TABLET,O=c.SMART_TV,M=c.BROWSER,U=c.WEARABLE,F=c.CONSOLE,V=s.ANDROID,j=s.WINDOWS_PHONE,z=s.IOS,H=s.WINDOWS,q=s.MAC_OS,K=function(){return k.name===s.WINDOWS&&"10"===k.version&&("string"==typeof B&&-1!==B.indexOf("Edg/"))},G=function(){return b.name===P},W=function(){return v("iPad")},Q=C.type===O,X=C.type===F,Y=C.type===U,Z=b.name===D||W(),$=b.name===S,J=function(){switch(C.type){case N:case L:return!0;default:return!1}}()||W(),ee=C.type===N,re=C.type===L||W(),te=C.type===M,ne=k.name===V,ae=k.name===j,oe=k.name===z||W(),ie=b.name===E,se=b.name===T,ce=b.name===x||b.name===D,le=b.name===I,ue=b.name===A||b.name===_,de=k.version?k.version:"none",fe=k.name?k.name:"none",he=b.major,pe=b.version,me=b.name,ge=C.vendor?C.vendor:"none",ve=C.model?C.model:"none",ye=w.name,be=w.version,Ce=B,we=G()||K(),ke=b.name===R,Be=C.type,Ee=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Se=W(),_e=v("iPhone"),Ae=v("iPod"),Ie=function(){var e=g(),r=e&&e.userAgent.toLowerCase();return"string"==typeof r&&/electron/.test(r)}(),Te=K(),xe=G(),Pe=k.name===H,Re=k.name===q,De=u(C.type);e.exports={deviceDetect:function(){var e=De.isBrowser,r=De.isMobile,t=De.isTablet,n=De.isSmartTV,a=De.isConsole,o=De.isWearable;return e?d(e,b,w,k,B):n?m(n,w,k,B):a?p(a,w,k,B):r||t?f(De,C,k,B):o?h(o,w,k,B):void 0},isSmartTV:Q,isConsole:X,isWearable:Y,isMobileSafari:Z,isChromium:$,isMobile:J,isMobileOnly:ee,isTablet:re,isBrowser:te,isAndroid:ne,isWinPhone:ae,isIOS:oe,isChrome:ie,isFirefox:se,isSafari:ce,isOpera:le,isIE:ue,osVersion:de,osName:fe,fullBrowserVersion:he,browserVersion:pe,browserName:me,mobileVendor:ge,mobileModel:ve,engineName:ye,engineVersion:be,getUA:Ce,isEdge:we,isYandex:ke,deviceType:Be,isIOS13:Ee,isIPad13:Se,isIPhone13:_e,isIPod13:Ae,isElectron:Ie,isEdgeChromium:Te,isLegacyEdge:xe,isWindows:Pe,isMacOs:Re}},function(e,r,t){var n;
55
+ var as={};void 0!==as.asn1&&as.asn1||(as.asn1={}),as.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var r=e.toString(16);return r.length%2==1&&(r="0"+r),r},this.bigIntToMinTwosComplementsHex=function(e){var r=e.toString(16);if("-"!=r.substr(0,1))r.length%2==1?r="0"+r:r.match(/^[0-7]/)||(r="00"+r);else{var t=r.substr(1).length;t%2==1?t+=1:r.match(/^[0-7]/)||(t+=2);for(var n="",a=0;a<t;a++)n+="f";r=new Pi(n,16).xor(e).add(Pi.ONE).toString(16).replace(/^-/,"")}return r},this.getPEMStringFromHex=function(e,r){return hextopem(e,r)},this.newObject=function(e){var r=as.asn1,t=r.DERBoolean,n=r.DERInteger,a=r.DERBitString,o=r.DEROctetString,i=r.DERNull,s=r.DERObjectIdentifier,c=r.DEREnumerated,l=r.DERUTF8String,u=r.DERNumericString,d=r.DERPrintableString,f=r.DERTeletexString,h=r.DERIA5String,p=r.DERUTCTime,m=r.DERGeneralizedTime,g=r.DERSequence,v=r.DERSet,y=r.DERTaggedObject,b=r.ASN1Util.newObject,C=Object.keys(e);if(1!=C.length)throw"key of param shall be only one.";var w=C[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":"))throw"undefined key: "+w;if("bool"==w)return new t(e[w]);if("int"==w)return new n(e[w]);if("bitstr"==w)return new a(e[w]);if("octstr"==w)return new o(e[w]);if("null"==w)return new i(e[w]);if("oid"==w)return new s(e[w]);if("enum"==w)return new c(e[w]);if("utf8str"==w)return new l(e[w]);if("numstr"==w)return new u(e[w]);if("prnstr"==w)return new d(e[w]);if("telstr"==w)return new f(e[w]);if("ia5str"==w)return new h(e[w]);if("utctime"==w)return new p(e[w]);if("gentime"==w)return new m(e[w]);if("seq"==w){for(var k=e[w],B=[],E=0;E<k.length;E++){var S=b(k[E]);B.push(S)}return new g({array:B})}if("set"==w){for(k=e[w],B=[],E=0;E<k.length;E++)S=b(k[E]),B.push(S);return new v({array:B})}if("tag"==w){var _=e[w];if("[object Array]"===Object.prototype.toString.call(_)&&3==_.length){var A=b(_[2]);return new y({tag:_[0],explicit:_[1],obj:A})}var I={};if(void 0!==_.explicit&&(I.explicit=_.explicit),void 0!==_.tag&&(I.tag=_.tag),void 0===_.obj)throw"obj shall be specified for 'tag'.";return I.obj=b(_.obj),new y(I)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},as.asn1.ASN1Util.oidHexToInt=function(e){for(var r="",t=parseInt(e.substr(0,2),16),n=(r=Math.floor(t/40)+"."+t%40,""),a=2;a<e.length;a+=2){var o=("00000000"+parseInt(e.substr(a,2),16).toString(2)).slice(-8);n+=o.substr(1,7),"0"==o.substr(0,1)&&(r=r+"."+new Pi(n,2).toString(10),n="")}return r},as.asn1.ASN1Util.oidIntToHex=function(e){var r=function(e){var r=e.toString(16);return 1==r.length&&(r="0"+r),r},t=function(e){var t="",n=new Pi(e,10).toString(2),a=7-n.length%7;7==a&&(a=0);for(var o="",i=0;i<a;i++)o+="0";for(n=o+n,i=0;i<n.length-1;i+=7){var s=n.substr(i,7);i!=n.length-7&&(s="1"+s),t+=r(parseInt(s,2))}return t};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",a=e.split("."),o=40*parseInt(a[0])+parseInt(a[1]);n+=r(o),a.splice(0,2);for(var i=0;i<a.length;i++)n+=t(a[i]);return n},as.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,r=e.toString(16);if(r.length%2==1&&(r="0"+r),e<128)return r;var t=r.length/2;if(t>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+t).toString(16)+r},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""}},as.asn1.DERAbstractString=function(e){as.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))},ns.lang.extend(as.asn1.DERAbstractString,as.asn1.ASN1Object),as.asn1.DERAbstractTime=function(e){as.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,r,t){var n=this.zeroPadding,a=this.localDateToUTC(e),o=String(a.getFullYear());"utc"==r&&(o=o.substr(2,2));var i=o+n(String(a.getMonth()+1),2)+n(String(a.getDate()),2)+n(String(a.getHours()),2)+n(String(a.getMinutes()),2)+n(String(a.getSeconds()),2);if(!0===t){var s=a.getMilliseconds();if(0!=s){var c=n(String(s),3);i=i+"."+(c=c.replace(/[0]+$/,""))}}return i+"Z"},this.zeroPadding=function(e,r){return e.length>=r?e:new Array(r-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,r,t,n,a,o){var i=new Date(Date.UTC(e,r-1,t,n,a,o,0));this.setByDate(i)},this.getFreshValueHex=function(){return this.hV}},ns.lang.extend(as.asn1.DERAbstractTime,as.asn1.ASN1Object),as.asn1.DERAbstractStructured=function(e){as.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)},ns.lang.extend(as.asn1.DERAbstractStructured,as.asn1.ASN1Object),as.asn1.DERBoolean=function(){as.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},ns.lang.extend(as.asn1.DERBoolean,as.asn1.ASN1Object),as.asn1.DERInteger=function(e){as.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=as.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var r=new Pi(String(e),10);this.setByBigInteger(r)},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))},ns.lang.extend(as.asn1.DERInteger,as.asn1.ASN1Object),as.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var r=as.asn1.ASN1Util.newObject(e.obj);e.hex="00"+r.getEncodedHex()}as.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,r){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var t="0"+e;this.hTLV=null,this.isModified=!0,this.hV=t+r},this.setByBinaryString=function(e){var r=8-(e=e.replace(/0+$/,"")).length%8;8==r&&(r=0);for(var t=0;t<=r;t++)e+="0";var n="";for(t=0;t<e.length-1;t+=8){var a=e.substr(t,8),o=parseInt(a,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+r+n},this.setByBooleanArray=function(e){for(var r="",t=0;t<e.length;t++)1==e[t]?r+="1":r+="0";this.setByBinaryString(r)},this.newFalseArray=function(e){for(var r=new Array(e),t=0;t<e;t++)r[t]=!1;return r},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))},ns.lang.extend(as.asn1.DERBitString,as.asn1.ASN1Object),as.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var r=as.asn1.ASN1Util.newObject(e.obj);e.hex=r.getEncodedHex()}as.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},ns.lang.extend(as.asn1.DEROctetString,as.asn1.DERAbstractString),as.asn1.DERNull=function(){as.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},ns.lang.extend(as.asn1.DERNull,as.asn1.ASN1Object),as.asn1.DERObjectIdentifier=function(e){var r=function(e){var r=e.toString(16);return 1==r.length&&(r="0"+r),r},t=function(e){var t="",n=new Pi(e,10).toString(2),a=7-n.length%7;7==a&&(a=0);for(var o="",i=0;i<a;i++)o+="0";for(n=o+n,i=0;i<n.length-1;i+=7){var s=n.substr(i,7);i!=n.length-7&&(s="1"+s),t+=r(parseInt(s,2))}return t};as.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="",a=e.split("."),o=40*parseInt(a[0])+parseInt(a[1]);n+=r(o),a.splice(0,2);for(var i=0;i<a.length;i++)n+=t(a[i]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var r=as.asn1.x509.OID.name2oid(e);if(""===r)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(r)},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))},ns.lang.extend(as.asn1.DERObjectIdentifier,as.asn1.ASN1Object),as.asn1.DEREnumerated=function(e){as.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=as.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var r=new Pi(String(e),10);this.setByBigInteger(r)},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))},ns.lang.extend(as.asn1.DEREnumerated,as.asn1.ASN1Object),as.asn1.DERUTF8String=function(e){as.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},ns.lang.extend(as.asn1.DERUTF8String,as.asn1.DERAbstractString),as.asn1.DERNumericString=function(e){as.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},ns.lang.extend(as.asn1.DERNumericString,as.asn1.DERAbstractString),as.asn1.DERPrintableString=function(e){as.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},ns.lang.extend(as.asn1.DERPrintableString,as.asn1.DERAbstractString),as.asn1.DERTeletexString=function(e){as.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},ns.lang.extend(as.asn1.DERTeletexString,as.asn1.DERAbstractString),as.asn1.DERIA5String=function(e){as.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},ns.lang.extend(as.asn1.DERIA5String,as.asn1.DERAbstractString),as.asn1.DERUTCTime=function(e){as.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))},ns.lang.extend(as.asn1.DERUTCTime,as.asn1.DERAbstractTime),as.asn1.DERGeneralizedTime=function(e){as.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))},ns.lang.extend(as.asn1.DERGeneralizedTime,as.asn1.DERAbstractTime),as.asn1.DERSequence=function(e){as.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",r=0;r<this.asn1Array.length;r++)e+=this.asn1Array[r].getEncodedHex();return this.hV=e,this.hV}},ns.lang.extend(as.asn1.DERSequence,as.asn1.DERAbstractStructured),as.asn1.DERSet=function(e){as.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,r=0;r<this.asn1Array.length;r++){var t=this.asn1Array[r];e.push(t.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)},ns.lang.extend(as.asn1.DERSet,as.asn1.DERAbstractStructured),as.asn1.DERTaggedObject=function(e){as.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,r,t){this.hT=r,this.isExplicit=e,this.asn1Object=t,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=t.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,r),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)))},ns.lang.extend(as.asn1.DERTaggedObject,as.asn1.ASN1Object);var os,is,ss,cs,ls=(os=function(e,r){return(os=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])})(e,r)},function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function t(){this.constructor=e}os(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}),us=function(e){function r(t){var n=e.call(this)||this;return t&&("string"==typeof t?n.parseKey(t):(r.hasPrivateKeyProperty(t)||r.hasPublicKeyProperty(t))&&n.parsePropertiesFrom(t)),n}return ls(r,e),r.prototype.parseKey=function(e){try{var r=0,t=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?function(e){var r;if(void 0===pi){var t="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(pi={},r=0;r<16;++r)pi[t.charAt(r)]=r;for(t=t.toLowerCase(),r=10;r<16;++r)pi[t.charAt(r)]=r;for(r=0;r<n.length;++r)pi[n.charAt(r)]=-1}var a=[],o=0,i=0;for(r=0;r<e.length;++r){var s=e.charAt(r);if("="==s)break;if(-1!=(s=pi[s])){if(void 0===s)throw new Error("Illegal character at offset "+r);o|=s,++i>=2?(a[a.length]=o,o=0,i=0):o<<=4}}if(i)throw new Error("Hex encoding incomplete: 4 bits missing");return a}(e):bi.unarmor(e),a=Ai.decode(n);if(3===a.sub.length&&(a=a.sub[2].sub[0]),9===a.sub.length){r=a.sub[1].getHexStringValue(),this.n=Mi(r,16),t=a.sub[2].getHexStringValue(),this.e=parseInt(t,16);var o=a.sub[3].getHexStringValue();this.d=Mi(o,16);var i=a.sub[4].getHexStringValue();this.p=Mi(i,16);var s=a.sub[5].getHexStringValue();this.q=Mi(s,16);var c=a.sub[6].getHexStringValue();this.dmp1=Mi(c,16);var l=a.sub[7].getHexStringValue();this.dmq1=Mi(l,16);var u=a.sub[8].getHexStringValue();this.coeff=Mi(u,16)}else{if(2!==a.sub.length)return!1;if(a.sub[0].sub){var d=a.sub[1].sub[0];r=d.sub[0].getHexStringValue(),this.n=Mi(r,16),t=d.sub[1].getHexStringValue(),this.e=parseInt(t,16)}else r=a.sub[0].getHexStringValue(),this.n=Mi(r,16),t=a.sub[1].getHexStringValue(),this.e=parseInt(t,16)}return!0}catch(e){return!1}},r.prototype.getPrivateBaseKey=function(){var e={array:[new as.asn1.DERInteger({int:0}),new as.asn1.DERInteger({bigint:this.n}),new as.asn1.DERInteger({int:this.e}),new as.asn1.DERInteger({bigint:this.d}),new as.asn1.DERInteger({bigint:this.p}),new as.asn1.DERInteger({bigint:this.q}),new as.asn1.DERInteger({bigint:this.dmp1}),new as.asn1.DERInteger({bigint:this.dmq1}),new as.asn1.DERInteger({bigint:this.coeff})]};return new as.asn1.DERSequence(e).getEncodedHex()},r.prototype.getPrivateBaseKeyB64=function(){return gi(this.getPrivateBaseKey())},r.prototype.getPublicBaseKey=function(){var e=new as.asn1.DERSequence({array:[new as.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new as.asn1.DERNull]}),r=new as.asn1.DERSequence({array:[new as.asn1.DERInteger({bigint:this.n}),new as.asn1.DERInteger({int:this.e})]}),t=new as.asn1.DERBitString({hex:"00"+r.getEncodedHex()});return new as.asn1.DERSequence({array:[e,t]}).getEncodedHex()},r.prototype.getPublicBaseKeyB64=function(){return gi(this.getPublicBaseKey())},r.wordwrap=function(e,r){if(!e)return e;var t="(.{1,"+(r=r||64)+"})( +|$\n?)|(.{1,"+r+"})";return e.match(RegExp(t,"g")).join("\n")},r.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return(e+=r.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},r.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return(e+=r.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},r.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},r.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")},r.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)},r}(rs),ds=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 us(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(vi(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return gi(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,r,t){try{return gi(this.getKey().sign(e,r,t))}catch(e){return!1}},e.prototype.verify=function(e,r,t){try{return this.getKey().verify(e,vi(r),t)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new us,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}(),fs=function(e,r,t){return null==e?e:function(e,r,t,n){if(!pe(e))return e;for(var a=-1,o=(r=pt(r,e)).length,i=o-1,s=e;null!=s&&++a<o;){var c=mt(r[a]),l=t;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(a!=i){var u=s[c];void 0===(l=n?n(u,c,s):void 0)&&(l=pe(u)?u:er(r[a+1])?[]:{})}ze(s,c,l),s=s[c]}return e}(e,r,t)},hs=["-","-","-","-","-","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","-","-","-","-","-"],ps={},ms={SELFIE:"selfie",ID_CARD:"id_card"},gs=Go((function(){var e=new ds;return e.setPublicKey(hs.join("")),e}));is=gs();var vs=function(e){var r=e.gesture;return{capture_time:e.captureTime,type:r,frames:e.frames}},ys=function(e){var r=e.detectedCard,t=e.captureTime,n=e.vCam,a=e.captureCount,o=e.captureDuration,i=e.captureType;return{capture_time:t,type:null==r?void 0:r.label,v_cam:n,capture_count:a,capture_duration:o,capture_type:i}},bs=function(){var e=L(regeneratorRuntime.mark((function e(r,t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return q(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},e.abrupt("return",new Promise((function(e){var a=new TextEncoder,o=a.encode(r),i=a.encode(t);window.crypto.subtle.importKey("raw",i,"AES-GCM",!0,["encrypt","decrypt"]).then((function(r){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},r,o).then((function(r){e("".concat(cs,".").concat(n(r)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),Cs=function(){var e=L(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.mode,a=r.imageData,r.enableExifData){e.next=3;break}return e.abrupt("return",new Promise((function(e){return e(a.blob)})));case 3:return o=z(z({},ps),n===ms.SELFIE?vs(a):ys(a)),i=z(z({},o),{},{sensor_data:"sensor data exceed 64KB"}),null!=a&&null!==(t=a.type)&&void 0!==t&&t.includes("qr")&&(o={capture_time:null==a?void 0:a.captureTime,type:null==a?void 0:a.type,qr_string:null==a?void 0:a.result}),e.next=8,bs(JSON.stringify(i),ss);case 8:return s=e.sent,e.next=11,bs(JSON.stringify(o),ss);case 11:return c=e.sent,l=ii.dump({Exif:F({},ii.ExifIFD.MakerNote,c)}),u=ii.dump({Exif:F({},ii.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var r=new FileReader;r.onload=function(){var r=L(regeneratorRuntime.mark((function r(t){var n,o,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:try{n=ii.insert(l,t.target.result)}catch(r){try{n=ii.insert(u,t.target.result)}catch(r){e(a.blob)}}return r.prev=1,r.next=4,fetch(n);case 4:return o=r.sent,r.next=7,o.blob();case 7:i=r.sent,URL.revokeObjectURL(n),e(i),r.next=15;break;case 12:r.prev=12,r.t0=r.catch(1),e(a.blob);case 15:case"end":return r.stop()}}),r,null,[[1,12]])})));return function(e){return r.apply(this,arguments)}}(),r.readAsDataURL(a.blob)})));case 15:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),ws=Object.freeze({__proto__:null,MODE:ms,initExifData:function(){ps={device_info:{device_brand_name:"".concat("none"===Jt.mobileVendor?"null":Jt.mobileVendor),device_model:"".concat("none"===Jt.mobileModel?"null":Jt.mobileModel),browser_version:"".concat(Jt.browserName," ").concat(Jt.browserVersion),browser_userAgent:"".concat(Jt.getUA),os:Jt.osName,os_version:Jt.osVersion},sdk_version:"5.14.12",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,r){fs(ps,e,r)},preWriteExif:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.mode,t=(e.motionData,e.orientationData,e.startTime),n=e.endTime;ps.user_action=z({},r===ms.SELFIE?{start_selfie:t,end_selfie:n}:{start_id_card:t,end_id_card:n}),ss=Zt().replace(/-/g,""),is||(is=gs()),cs=vi(is.encrypt(ss))},writeExif:Cs}),ks="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",Bs=function(){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ks,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.342,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:368,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;O(this,e),this.model_path=r,this.threshold=t,this.size=Math.round(n/2),this.enable_profiling=a,this.num_threads=o}var r,t;return U(e,[{key:"load",value:(t=L(regeneratorRuntime.mark((function e(){var r,t,n,a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=window,t=r.tf,e.next=3,$o({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],t.tidy((function(){var e=t.randomNormal([1,a.input_width,a.input_height,3]);a.model.predict(e)}));case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"crop_eyes",value:function(e,r){var t=this,n=window.tf,a=r[0].map((function(e){return Math.round(e)})),o=r[1].map((function(e){return Math.round(e)}));a[0]>o[0]&&(a=r[1].map((function(e){return Math.round(e)})),o=r[0].map((function(e){return Math.round(e)})));var i=Math.round((a[0]+o[0])/2),s=i-a[0],c=o[0]-i;s>=this.size&&(s=this.size),c>=this.size&&(c=this.size);var l=Math.max(a[0]-s,0),u=Math.max(a[1]-s,0),d=Math.max(o[0]-c,0),f=Math.max(o[1]-c,0);return n.tidy((function(){var r=e.slice([u,l,0],[2*s,2*s,3]),a=e.slice([f,d,0],[2*c,2*c,3]);return{l_img:r=n.expandDims(n.image.resizeBilinear(r,[t.input_width,t.input_height])),r_img:a=n.expandDims(n.image.resizeBilinear(a,[t.input_width,t.input_height]))}}))}},{key:"predict",value:(r=L(regeneratorRuntime.mark((function e(r,t){var n,a,o,i,s,c,l,u,d,f=this,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=h.length>2&&void 0!==h[2]?h[2]:this.threshold,a=window,o=a.tf,i=r.getContext("2d"),s=i.getImageData(0,0,r.height,r.width),c=o.tidy((function(){var e=o.browser.fromPixels(s),r=f.crop_eyes(e,t),a=r.l_img,i=r.r_img,c=f.model.predict(a).arraySync()[0],l=f.model.predict(i).arraySync()[0];return[c>n,l>n]})),l=H(c,2),u=l[0],d=l[1],e.abrupt("return",{isEyeClose:u||d});case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}(),Es=function(){var e=L(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 Ss(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,n=void 0===t?100:t,a=r.useRef([]),o=r.useRef([]),i=(r.useRef(!1),r.useRef({})),s=r.useCallback((function(e){var r=Date.now(),t=e.type;return!!(i.current[t]&&r-i.current[t]<n)||(i.current[t]=r,!1)}),[n]),c=r.useCallback((function(e){s(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})}),[s]),l=r.useCallback((function(e){var r,t,n,o,i,c;s(e)||a.current.push({time:Date.now(),Accelerometer:{x:null==e||null===(r=e.acceleration)||void 0===r?void 0:r.x,y:null==e||null===(t=e.acceleration)||void 0===t?void 0:t.y,z:null==e||null===(n=e.acceleration)||void 0===n?void 0:n.z},Gyroscope:{z:null==e||null===(o=e.rotationRate)||void 0===o?void 0:o.alpha,x:null==e||null===(i=e.rotationRate)||void 0===i?void 0:i.beta,y:null==e||null===(c=e.rotationRate)||void 0===c?void 0:c.gamma}})}),[s]),u=r.useCallback((function(){}),[l,c]),d=r.useCallback((function(){}),[l,c]);return r.useEffect((function(){return function(){d()}}),[d]),{motionData:a.current,orientationData:o.current,startMotion:u,stopMotion:d}}var _s=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']))},As=en(),Is=function(){function e(r){var t=this,n=r.container,a=r.lang,o=void 0===a?"en":a,s=r.assetRoot,c=void 0===s?"https://unpkg.com/@tsocial/tvweb-sdk@latest/assets":s,u=r.resourceRoot,d=r.customUrls,f=void 0===d?{}:d,h=r.enableAntiDebug,p=void 0===h||h,m=r.warmupMessage,g=r.baseComponent,v=r.component,y=void 0===v?{}:v,b=r.country,C=void 0===b?"vn":b,w=r.idCardContext;O(this,e),F(this,"initNativeCamera",(function(e){var r=document.createElement("div");document.body.appendChild(r);var n=i.default.createRef(),a=t.component.NativeCamera;return l.default.render(i.default.createElement(a,V({},e,{ref:n})),r),{openCamera:function(){n.current.click()}}})),F(this,"runWarmUpReadIDCard",L(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.commonSettings.customUrls,e.abrupt("return",t.component.warmUpReadIdCard(r));case 2:case"end":return e.stop()}}),e)})))),F(this,"runPreloadEKYCResources",L(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.commonSettings.customUrls,t.component.preloadEKYCResources(r);case 2:case"end":return e.stop()}}),e)})))),F(this,"destroyView",(function(){l.default.unmountComponentAtNode(t.container)})),function(e,r,t,n,a,o,i,s){if(!e){var c;if(void 0===r)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[t,n,a,o,i,s],u=0;(c=new Error(r.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var k=Mt({resourceRoot:u,initCustomUrls:f,country:C});this.commonSettings=z({lang:o,assetRoot:c,customUrls:k,enableAntiDebug:p,debug:!1,warmupMessage:m,country:C},w),this.component=z(z({},g),y)}return U(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 r=this.component.ReadIDCardWithApiCall;l.default.render(i.default.createElement(Ft,{value:this.commonSettings},i.default.createElement(r,V({onClose:this.destroyView},e))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var r=this.component.ReadIDCardUIOnly;l.default.render(i.default.createElement(Ft,{value:this.commonSettings},i.default.createElement(r,V({onClose:this.destroyView},e))),this.container)}},{key:"livenessDetection",value:function(e){var r=this.component.LivenessDetection;l.default.render(i.default.createElement(Ft,{value:z({},this.commonSettings)},i.default.createElement(r,V({onClose:this.destroyView},e))),this.container)}},{key:"compareFaces",value:function(e){var r=e.accessKey,t=e.secretKey,n=e.apiUrl,a=e.image1,o=e.image2,i=e.onSuccess,s=e.onError;_o(new qt(r,t,n,{httpHeaders:As})).compareFaces({image1:{id:a},image2:{id:o}}).then((function(e){i(e)})).catch((function(e){s(e)}))}}]),e}(),Ts="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ps(e,r,t){return e(t={path:r,exports:{},require:function(e,r){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==r&&t.path)}},t.exports),t.exports}var Rs=Ps((function(e){e.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=1)}([function(e,r,t){var n={MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0};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:n,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,r,t){var n,a=t(2),o=t(0),i=o.BROWSER_TYPES,s=o.OS_TYPES,c=o.DEVICE_TYPES,l=t(4),u=l.checkType,d=l.broPayload,f=l.mobilePayload,h=l.wearPayload,p=l.consolePayload,m=l.stvPayload,g=l.getNavigatorInstance,v=l.isIOS13Check,y=new a,b=y.getBrowser(),C=y.getDevice(),w=y.getEngine(),k=y.getOS(),B=y.getUA(),E=i.CHROME,S=i.CHROMIUM,_=i.IE,A=i.INTERNET_EXPLORER,I=i.OPERA,T=i.FIREFOX,x=i.SAFARI,P=i.EDGE,R=i.YANDEX,D=i.MOBILE_SAFARI,N=c.MOBILE,L=c.TABLET,O=c.SMART_TV,M=c.BROWSER,U=c.WEARABLE,F=c.CONSOLE,V=s.ANDROID,j=s.WINDOWS_PHONE,z=s.IOS,H=s.WINDOWS,q=s.MAC_OS,K=function(){return k.name===s.WINDOWS&&"10"===k.version&&("string"==typeof B&&-1!==B.indexOf("Edg/"))},G=function(){return b.name===P},W=function(){return v("iPad")},Q=C.type===O,X=C.type===F,Y=C.type===U,Z=b.name===D||W(),$=b.name===S,J=function(){switch(C.type){case N:case L:return!0;default:return!1}}()||W(),ee=C.type===N,re=C.type===L||W(),te=C.type===M,ne=k.name===V,ae=k.name===j,oe=k.name===z||W(),ie=b.name===E,se=b.name===T,ce=b.name===x||b.name===D,le=b.name===I,ue=b.name===A||b.name===_,de=k.version?k.version:"none",fe=k.name?k.name:"none",he=b.major,pe=b.version,me=b.name,ge=C.vendor?C.vendor:"none",ve=C.model?C.model:"none",ye=w.name,be=w.version,Ce=B,we=G()||K(),ke=b.name===R,Be=C.type,Ee=(n=g())&&(/iPad|iPhone|iPod/.test(n.platform)||"MacIntel"===n.platform&&n.maxTouchPoints>1)&&!window.MSStream,Se=W(),_e=v("iPhone"),Ae=v("iPod"),Ie=function(){var e=g(),r=e&&e.userAgent.toLowerCase();return"string"==typeof r&&/electron/.test(r)}(),Te=K(),xe=G(),Pe=k.name===H,Re=k.name===q,De=u(C.type);e.exports={deviceDetect:function(){var e=De.isBrowser,r=De.isMobile,t=De.isTablet,n=De.isSmartTV,a=De.isConsole,o=De.isWearable;return e?d(e,b,w,k,B):n?m(n,w,k,B):a?p(a,w,k,B):r||t?f(De,C,k,B):o?h(o,w,k,B):void 0},isSmartTV:Q,isConsole:X,isWearable:Y,isMobileSafari:Z,isChromium:$,isMobile:J,isMobileOnly:ee,isTablet:re,isBrowser:te,isAndroid:ne,isWinPhone:ae,isIOS:oe,isChrome:ie,isFirefox:se,isSafari:ce,isOpera:le,isIE:ue,osVersion:de,osName:fe,fullBrowserVersion:he,browserVersion:pe,browserName:me,mobileVendor:ge,mobileModel:ve,engineName:ye,engineVersion:be,getUA:Ce,isEdge:we,isYandex:ke,deviceType:Be,isIOS13:Ee,isIPad13:Se,isIPhone13:_e,isIPod13:Ae,isElectron:Ie,isEdgeChromium:Te,isLegacyEdge:xe,isWindows:Pe,isMacOs:Re}},function(e,r,t){var n;
56
56
  /*!
57
57
  * UAParser.js v0.7.18
58
58
  * Lightweight JavaScript-based User-Agent string parser
@@ -68,4 +68,4 @@ var as={};void 0!==as.asn1&&as.asn1||(as.asn1={}),as.asn1.ASN1Util=new function(
68
68
  *
69
69
  * This source code is licensed under the MIT license found in the
70
70
  * LICENSE file in the root directory of this source tree.
71
- */function mc(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case Zs:switch(e=e.type){case ac:case oc:case Js:case rc:case ec:case sc:return e;default:switch(e=e&&e.$$typeof){case nc:case ic:case uc:case lc:case tc:return e;default:return r}}case $s:return r}}}function gc(e){return mc(e)===oc}var vc={AsyncMode:ac,ConcurrentMode:oc,ContextConsumer:nc,ContextProvider:tc,Element:Zs,ForwardRef:ic,Fragment:Js,Lazy:uc,Memo:lc,Portal:$s,Profiler:rc,StrictMode:ec,Suspense:sc,isAsyncMode:function(e){return gc(e)||mc(e)===ac},isConcurrentMode:gc,isContextConsumer:function(e){return mc(e)===nc},isContextProvider:function(e){return mc(e)===tc},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Zs},isForwardRef:function(e){return mc(e)===ic},isFragment:function(e){return mc(e)===Js},isLazy:function(e){return mc(e)===uc},isMemo:function(e){return mc(e)===lc},isPortal:function(e){return mc(e)===$s},isProfiler:function(e){return mc(e)===rc},isStrictMode:function(e){return mc(e)===ec},isSuspense:function(e){return mc(e)===sc},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Js||e===oc||e===rc||e===ec||e===sc||e===cc||"object"==typeof e&&null!==e&&(e.$$typeof===uc||e.$$typeof===lc||e.$$typeof===tc||e.$$typeof===nc||e.$$typeof===ic||e.$$typeof===fc||e.$$typeof===hc||e.$$typeof===pc||e.$$typeof===dc)},typeOf:mc},yc=(Ps((function(e,r){})),Ps((function(e){e.exports=vc}))),bc={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Cc={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},wc={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},kc={};function Bc(e){return yc.isMemo(e)?wc:kc[e.$$typeof]||bc}kc[yc.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},kc[yc.Memo]=wc;var Ec=Object.defineProperty,Sc=Object.getOwnPropertyNames,_c=Object.getOwnPropertySymbols,Ac=Object.getOwnPropertyDescriptor,Ic=Object.getPrototypeOf,Tc=Object.prototype;var xc=function e(r,t,n){if("string"!=typeof t){if(Tc){var a=Ic(t);a&&a!==Tc&&e(r,a,n)}var o=Sc(t);_c&&(o=o.concat(_c(t)));for(var i=Bc(r),s=Bc(t),c=0;c<o.length;++c){var l=o[c];if(!(Cc[l]||n&&n[l]||s&&s[l]||i&&i[l])){var u=Ac(t,l);try{Ec(r,l,u)}catch(e){}}}}return r};function Pc(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===u(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,r){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(r){e(r.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 r(e)}}))}var Rc=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],Dc=function(e){if(!e)return{isVirtual:!1};var r=e.getTracks();if(!r||!r.length)return{isVirtual:!1};var t=r[0].label,n=t&&Rc.some((function(e){return t.toLowerCase().includes(e)}));return{deviceLabel:t,isVirtual:n}},Nc=function(e,r){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0&&!r)},Lc=function(){var e,r;return{updateTime:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start";"start"===n?e=t:"end"===n&&(r=t)},getStart:function(){return e},getEnd:function(){return r}}},Oc={closeButton:{top:"10px",right:"10px",left:"auto",bottom:"auto",display:"block"}},Mc=Array.isArray,Uc="object"==typeof Ts&&Ts&&Ts.Object===Object&&Ts,Fc="object"==typeof self&&self&&self.Object===Object&&self,Vc=Uc||Fc||Function("return this")(),jc=Vc.Symbol,zc=Object.prototype,Hc=zc.hasOwnProperty,qc=zc.toString,Kc=jc?jc.toStringTag:void 0;var Gc=function(e){var r=Hc.call(e,Kc),t=e[Kc];try{e[Kc]=void 0;var n=!0}catch(e){}var a=qc.call(e);return n&&(r?e[Kc]=t:delete e[Kc]),a},Wc=Object.prototype.toString;var Qc=function(e){return Wc.call(e)},Xc=jc?jc.toStringTag:void 0;var Yc=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Xc&&Xc in Object(e)?Gc(e):Qc(e)};var Zc=function(e){return null!=e&&"object"==typeof e};var $c=function(e){return"symbol"==typeof e||Zc(e)&&"[object Symbol]"==Yc(e)},Jc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,el=/^\w*$/;var rl=function(e,r){if(Mc(e))return!1;var t=typeof e;return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=e&&!$c(e))||(el.test(e)||!Jc.test(e)||null!=r&&e in Object(r))};var tl=function(e){var r=typeof e;return null!=e&&("object"==r||"function"==r)};var nl,al=function(e){if(!tl(e))return!1;var r=Yc(e);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},ol=Vc["__core-js_shared__"],il=(nl=/[^.]+$/.exec(ol&&ol.keys&&ol.keys.IE_PROTO||""))?"Symbol(src)_1."+nl:"";var sl=function(e){return!!il&&il in e},cl=Function.prototype.toString;var ll=function(e){if(null!=e){try{return cl.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ul=/^\[object .+?Constructor\]$/,dl=Function.prototype,fl=Object.prototype,hl=dl.toString,pl=fl.hasOwnProperty,ml=RegExp("^"+hl.call(pl).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var gl=function(e){return!(!tl(e)||sl(e))&&(al(e)?ml:ul).test(ll(e))};var vl=function(e,r){return null==e?void 0:e[r]};var yl=function(e,r){var t=vl(e,r);return gl(t)?t:void 0},bl=yl(Object,"create");var Cl=function(){this.__data__=bl?bl(null):{},this.size=0};var wl=function(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r},kl=Object.prototype.hasOwnProperty;var Bl=function(e){var r=this.__data__;if(bl){var t=r[e];return"__lodash_hash_undefined__"===t?void 0:t}return kl.call(r,e)?r[e]:void 0},El=Object.prototype.hasOwnProperty;var Sl=function(e){var r=this.__data__;return bl?void 0!==r[e]:El.call(r,e)};var _l=function(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=bl&&void 0===r?"__lodash_hash_undefined__":r,this};function Al(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Al.prototype.clear=Cl,Al.prototype.delete=wl,Al.prototype.get=Bl,Al.prototype.has=Sl,Al.prototype.set=_l;var Il=Al;var Tl=function(){this.__data__=[],this.size=0};var xl=function(e,r){return e===r||e!=e&&r!=r};var Pl=function(e,r){for(var t=e.length;t--;)if(xl(e[t][0],r))return t;return-1},Rl=Array.prototype.splice;var Dl=function(e){var r=this.__data__,t=Pl(r,e);return!(t<0)&&(t==r.length-1?r.pop():Rl.call(r,t,1),--this.size,!0)};var Nl=function(e){var r=this.__data__,t=Pl(r,e);return t<0?void 0:r[t][1]};var Ll=function(e){return Pl(this.__data__,e)>-1};var Ol=function(e,r){var t=this.__data__,n=Pl(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this};function Ml(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Ml.prototype.clear=Tl,Ml.prototype.delete=Dl,Ml.prototype.get=Nl,Ml.prototype.has=Ll,Ml.prototype.set=Ol;var Ul=Ml,Fl=yl(Vc,"Map");var Vl=function(){this.size=0,this.__data__={hash:new Il,map:new(Fl||Ul),string:new Il}};var jl=function(e){var r=typeof e;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e};var zl=function(e,r){var t=e.__data__;return jl(r)?t["string"==typeof r?"string":"hash"]:t.map};var Hl=function(e){var r=zl(this,e).delete(e);return this.size-=r?1:0,r};var ql=function(e){return zl(this,e).get(e)};var Kl=function(e){return zl(this,e).has(e)};var Gl=function(e,r){var t=zl(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this};function Wl(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Wl.prototype.clear=Vl,Wl.prototype.delete=Hl,Wl.prototype.get=ql,Wl.prototype.has=Kl,Wl.prototype.set=Gl;var Ql=Wl;function Xl(e,r){if("function"!=typeof e||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var t=function(){var n=arguments,a=r?r.apply(this,n):n[0],o=t.cache;if(o.has(a))return o.get(a);var i=e.apply(this,n);return t.cache=o.set(a,i)||o,i};return t.cache=new(Xl.Cache||Ql),t}Xl.Cache=Ql;var Yl=Xl;var Zl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$l=/\\(\\)?/g,Jl=function(e){var r=Yl(e,(function(e){return 500===t.size&&t.clear(),e})),t=r.cache;return r}((function(e){var r=[];return 46===e.charCodeAt(0)&&r.push(""),e.replace(Zl,(function(e,t,n,a){r.push(n?a.replace($l,"$1"):t||e)})),r}));var eu=function(e,r){for(var t=-1,n=null==e?0:e.length,a=Array(n);++t<n;)a[t]=r(e[t],t,e);return a},ru=jc?jc.prototype:void 0,tu=ru?ru.toString:void 0;var nu=function e(r){if("string"==typeof r)return r;if(Mc(r))return eu(r,e)+"";if($c(r))return tu?tu.call(r):"";var t=r+"";return"0"==t&&1/r==-Infinity?"-0":t};var au=function(e){return null==e?"":nu(e)};var ou=function(e,r){return Mc(e)?e:rl(e,r)?[e]:Jl(au(e))};var iu=function(e){if("string"==typeof e||$c(e))return e;var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r};var su=function(e,r){for(var t=0,n=(r=ou(r,e)).length;null!=e&&t<n;)e=e[iu(r[t++])];return t&&t==n?e:void 0};var cu,lu,uu,du,fu,hu=function(e,r,t){var n=null==e?void 0:su(e,r);return void 0===n?t:n},pu=function(e,r,t){return hu(e,r,hu(t,r,""))},mu=D.Errors,gu=c.default.div(cu||(cu=k(["\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"])),1e3,(function(e){return e.checkCameraMode&&"opacity: 0;"})),vu=c.default.video(lu||(lu=k(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),yu=c.default.div(uu||(uu=k(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),bu=c.default(yu)(du||(du=k(["\n z-index: ",";\n position: fixed;\n width: 20px;\n cursor: pointer;\n ","\n"])),2e3,(function(e){var r=e.theme;return n.css(["top:",";right:",";left:",";bottom:",";display:",";"],pu(r,"closeButton.top",Oc),pu(r,"closeButton.right",Oc),pu(r,"closeButton.left",Oc),pu(r,"closeButton.bottom",Oc),pu(r,"closeButton.display",Oc))})),Cu=c.default.div(fu||(fu=k(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),wu=i.default.createRef(),ku=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(r){return new Promise((function(t,n){e.call(navigator,r,t,n)}))}}:null}();function Bu(e){var t=e.checkCameraMode,n=e.frontCamera,a=e.onClose,o=e.children,s=e.onVideoPlayed,c=e.flipHorizontal,l=e.videoSettings,u=e.refVideo,d=e.onError,h=e.closeButton,p=e.videoClassName,m=e.scale,g=e.defaultCameraId,y=e.onWarning,b=r.useRef(),C=zt.useSDKSettings().lang,w=Cn.useSDKTracking().sendEvent,k=Bn.useAsset("ic_close.png"),E=B(r.useState(""),2),S=E[0],_=E[1],A=r.useRef(!1),I=r.useRef(!1),T=r.useRef(!1),x=r.useRef(),P=r.useRef([]),R=r.useRef(""),D=r.useCallback((function(e){d&&d(e)}),[d]),N=r.useCallback((function(){try{var e;clearInterval(b.current),(null==u||null===(e=u.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(u.current.srcObject.getTracks().forEach((function(e){return e.stop()})),u.current.srcObject=null)}catch(e){}clearTimeout(x)}),[u]);function L(){return O.apply(this,arguments)}function O(){return(O=f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Pc();case 3:r=e.sent,P.current=r.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),ws.addExifData("device_info.camera_list",JSON.stringify(P.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)}b.current||(b.current=setInterval((function(){document.getElementById("tv-camera-".concat(b.current))||N()}),1e3)),r.useEffect((function(){return function(){T.current=!0}}),[]);var M=r.useCallback((function(){x.current||(x.current=setTimeout((function(){A.current||(_(mu.camera_timeout.msg[C]),D(mu.camera_timeout))}),2e4))}),[C,D]),U=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,a,o,i,s,c,u,d,f,h,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=p.length>1&&void 0!==p[1]&&p[1],a={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return y&&y("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,a=Rs.isMobile?Rs.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},o=Lc(),i=o.updateTime,s=o.getStart,c=o.getEnd,e.prev=8,u=l||a,i(performance.now(),"start"),Nc(Rs.isMobile,Rs.isIOS)&&n&&(u={}),t&&(u={}),ws.addExifData("device_info.camera_label_dimension.req",JSON.stringify(u)),d={audio:!1,video:v(v({},r?{deviceId:r}:{facingMode:n?"user":"environment"}),u)},e.next=17,ku.getUserMedia(d);case 17:return f=e.sent,e.next=20,L();case 20:if(M(),f){e.next=25;break}return _(mu.not_supported.msg[C]),D(mu.not_supported),e.abrupt("return",null);case 25:i(performance.now(),"end"),window.tv_last_req_camera_complete=!0,c()-s()<1600?w({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):w({tag:"cam_permission",event:"user_activity.allow",log:{}});try{h=f.getVideoTracks()[0].getSettings(),ws.addExifData("device_info.camera_label_dimension.got","".concat(h.width,"x").concat(h.height))}catch(e){}return e.abrupt("return",f);case 32:e.prev=32,e.t0=e.catch(8),i(performance.now(),"end"),"NotAllowedError"===e.t0.name?(_(mu.no_permission.msg[C]),D(mu.no_permission),I.current=!0,w({tag:"cam_permission",event:"user_activity.cam",log:c()-s()<1600?{already_block:!0}:{click_block_on_popup:!0}})):I.current&&("NotReadableError"===e.t0.name?(D(mu.not_readable),_(mu.not_readable.msg[C])):(_(e.t0.message),D({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(r){return e.apply(this,arguments)}}(),[n,l,C,D,y,M,w]),F=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,c,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]:g,a=h.length>1&&void 0!==h[1]&&h[1],!(null!=(o=u.current)&&null!==(r=o.srcObject)&&void 0!==r&&r.id&&null!=o&&null!==(t=o.srcObject)&&void 0!==t&&t.active&&A.current)){e.next=5;break}return e.abrupt("return");case 5:return o.oncanplaythrough=function(){var e,r,t;o.play(),ws.addExifData("device_info.camera_label",null===(e=i)||void 0===e||null===(r=e.getVideoTracks())||void 0===r||null===(t=r[0])||void 0===t?void 0:t.label),A.current=!0,_("");var n=window.innerWidth,a=window.innerHeight,c=Zn.analyzeVideoAndWindowSizes(o),l=c.lostX,u=void 0===l?0:l,d=c.lostY,f=void 0===d?0:d,h=Math.min(n,Math.floor(n-2*u)),p=Math.min(a,Math.floor(a-2*f));s&&s({clientWidth:n,clientHeight:a,videoAreaWidth:h,videoAreaHeight:p,lostX:u,lostY:f})},e.next=8,U(n,a);case 8:i=e.sent,c=Dc(i),l=c.deviceLabel,(d=c.isVirtual)&&(R.current+="".concat(l,", "),(f=P.current.filter((function(e){return!R.current.includes(e.label)})))[0]&&f[0].deviceId&&F(f[0].deviceId)),i||I.current||(ws.addExifData("device_info.camera_label_retry","yes"),I.current=!0,F(n,!0)),i&&T.current&&(u.current.srcObject=i,N()),!i||T.current||d||(o.srcObject=i);case 14:case"end":return e.stop()}}),e)}))),[u,U,s,g,N]);r.useEffect((function(){function e(){return(e=f(regeneratorRuntime.mark((function e(){var r,t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:return e.next=4,Pc();case 4:r=e.sent,(t=r.filter((function(e){return"videoinput"===e.kind&&e.label.includes("back")&&e.label.includes("0")}))).length>0&&(n=t[0].deviceId,N(),F(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var r=u.current;return A.current?function(){}:(!ku||Rs.browserName&&["facebook"].includes(Rs.browserName.toLowerCase())||Rs.getUA.includes("Zalo iOS")?(_(mu.not_supported.msg[C]),D(mu.not_supported)):r&&(Rs.isAndroid&&!1===n?function(){e.apply(this,arguments)}():F()),function(){T.current&&N()})}),[u,C,n,F,N,D]);var V=r.useCallback((function(){N(),a&&a(),w({tag:"result",event:"user_activity.cancel",log:{}})}),[a,N,w]);return i.default.createElement(gu,{id:"tv-camera-".concat(b.current),checkCameraMode:t},function(){if(!S)return null;var e=mu.no_permission.msg[C];return S===e&&Rs.isIOS?i.default.createElement(Cu,null,S," ",i.default.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[C])):i.default.createElement(Cu,null,S)}(),i.default.createElement(vu,{ref:u,playsInline:!0,muted:!0,flipHorizontal:c,className:p,scale:m}),o,h?i.default.cloneElement(h,{onClick:V,"data-testid":"close-camera"}):i.default.createElement(bu,{onClick:V,"data-testid":"close-camera"},i.default.createElement("img",{src:k,alt:""})))}Bu.propTypes={checkCameraMode:s.default.bool,frontCamera:s.default.bool,onClose:s.default.func,onError:s.default.func,onVideoPlayed:s.default.func,children:s.default.node,flipHorizontal:s.default.bool,videoSettings:s.default.object,refVideo:s.default.object,closeButton:s.default.node,videoClassName:s.default.string,scale:s.default.number,defaultCameraId:s.default.string,onWarning:s.default.func},Bu.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 Eu,Su,_u,Au=function(e,t,n){class a extends r.Component{constructor(){super(...arguments),this.updateDebounced=Xs(this.forceUpdate,t,n)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return i.default.createElement(e,Object.assign({},this.props))}}return a.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,xc(a,e)}(Bu,250),Iu=i.default.forwardRef((function(e,r){return i.default.createElement(Bu,m({},e,{refVideo:r||wu}))})),Tu=i.default.forwardRef((function(e,r){return i.default.createElement(Au,m({},e,{refVideo:r||wu}))})),xu=c.default.table(Eu||(Eu=k(["\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"]))),Pu=c.default.div(Su||(Su=k(["\n position: relative;\n"]))),Ru=Array.from(Array(3).keys()),Du=Array.from(Array(3).keys());function Nu(e){var r=e.children,t=e.x,n=e.y,a=e.width,o=e.height,s=e.className,c=e.surroundStyle;return i.default.createElement(xu,{className:s},i.default.createElement("tbody",null,Ru.map((function(e,s){return i.default.createElement("tr",{key:e,style:{height:0===s?n:"auto"},"data-testid":"row"},Du.map((function(e,n){var l=1===s&&1===n,u="auto";return l?u=a:0===n&&(u=t),i.default.createElement("td",{"data-testid":l?"centeredCell":"cell",key:e,style:v({width:u,height:l?o:"auto"},l?{}:c)},l?i.default.createElement(Pu,{style:{width:u,height:o}},r):null)})))}))))}Nu.propTypes={children:s.default.node,x:s.default.string,y:s.default.string,width:s.default.string,height:s.default.string,className:s.default.string,surroundStyle:s.default.object},Nu.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var Lu=c.default(Nu)(_u||(_u=k(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: ",";\n"])),1010);function Ou(e){var r=e.className;return i.default.createElement("svg",{className:r,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},i.default.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),i.default.createElement("desc",null,"Created with sketchtool."),i.default.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i.default.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},i.default.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},i.default.createElement("g",{id:"Group-2"},i.default.createElement("g",{id:"camera"},i.default.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"})))))))}Ou.propTypes={className:s.default.string},Ou.defaultProps={className:""};var Mu=function(){return Vc.Date.now()},Uu=/\s/;var Fu=function(e){for(var r=e.length;r--&&Uu.test(e.charAt(r)););return r},Vu=/^\s+/;var ju=function(e){return e?e.slice(0,Fu(e)+1).replace(Vu,""):e},zu=/^[-+]0x[0-9a-f]+$/i,Hu=/^0b[01]+$/i,qu=/^0o[0-7]+$/i,Ku=parseInt;var Gu=function(e){if("number"==typeof e)return e;if($c(e))return NaN;if(tl(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=tl(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=ju(e);var t=Hu.test(e);return t||qu.test(e)?Ku(e.slice(2),t?2:8):zu.test(e)?NaN:+e},Wu=Math.max,Qu=Math.min;var Xu=function(e,r,t){var n,a,o,i,s,c,l=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(r){var t=n,o=a;return n=a=void 0,l=r,i=e.apply(o,t)}function p(e){return l=e,s=setTimeout(g,r),u?h(e):i}function m(e){var t=e-c;return void 0===c||t>=r||t<0||d&&e-l>=o}function g(){var e=Mu();if(m(e))return v(e);s=setTimeout(g,function(e){var t=r-(e-c);return d?Qu(t,o-(e-l)):t}(e))}function v(e){return s=void 0,f&&n?h(e):(n=a=void 0,i)}function y(){var e=Mu(),t=m(e);if(n=arguments,a=this,c=e,t){if(void 0===s)return p(c);if(d)return clearTimeout(s),s=setTimeout(g,r),h(c)}return void 0===s&&(s=setTimeout(g,r)),i}return r=Gu(r)||0,tl(t)&&(u=!!t.leading,o=(d="maxWait"in t)?Wu(Gu(t.maxWait)||0,r):o,f="trailing"in t?!!t.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=c=a=s=void 0},y.flush=function(){return void 0===s?i:v(Mu())},y};var Yu=function(e,r,t){var n=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return tl(t)&&(n="leading"in t?!!t.leading:n,a="trailing"in t?!!t.trailing:a),Xu(e,r,{leading:n,maxWait:r,trailing:a})},Zu=function(){try{var e=yl(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var $u=function(e,r,t){"__proto__"==r&&Zu?Zu(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t},Ju=Object.prototype.hasOwnProperty;var ed=function(e,r,t){var n=e[r];Ju.call(e,r)&&xl(n,t)&&(void 0!==t||r in e)||$u(e,r,t)};var rd=function(e,r,t,n){var a=!t;t||(t={});for(var o=-1,i=r.length;++o<i;){var s=r[o],c=n?n(t[s],e[s],s,t,e):void 0;void 0===c&&(c=e[s]),a?$u(t,s,c):ed(t,s,c)}return t};var td=function(e){return e};var nd=function(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)},ad=Math.max;var od=function(e,r,t){return r=ad(void 0===r?e.length-1:r,0),function(){for(var n=arguments,a=-1,o=ad(n.length-r,0),i=Array(o);++a<o;)i[a]=n[r+a];a=-1;for(var s=Array(r+1);++a<r;)s[a]=n[a];return s[r]=t(i),nd(e,this,s)}};var id=function(e){return function(){return e}},sd=Zu?function(e,r){return Zu(e,"toString",{configurable:!0,enumerable:!1,value:id(r),writable:!0})}:td,cd=Date.now;var ld=function(e){var r=0,t=0;return function(){var n=cd(),a=16-(n-t);if(t=n,a>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}(sd);var ud=function(e,r){return ld(od(e,r,td),e+"")};var dd=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var fd=function(e){return null!=e&&dd(e.length)&&!al(e)},hd=/^(?:0|[1-9]\d*)$/;var pd=function(e,r){var t=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==t||"symbol"!=t&&hd.test(e))&&e>-1&&e%1==0&&e<r};var md=function(e,r,t){if(!tl(t))return!1;var n=typeof r;return!!("number"==n?fd(t)&&pd(r,t.length):"string"==n&&r in t)&&xl(t[r],e)};var gd=function(e){return ud((function(r,t){var n=-1,a=t.length,o=a>1?t[a-1]:void 0,i=a>2?t[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,i&&md(t[0],t[1],i)&&(o=a<3?void 0:o,a=1),r=Object(r);++n<a;){var s=t[n];s&&e(r,s,n,o)}return r}))};var vd=function(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n};var yd=function(e){return Zc(e)&&"[object Arguments]"==Yc(e)},bd=Object.prototype,Cd=bd.hasOwnProperty,wd=bd.propertyIsEnumerable,kd=yd(function(){return arguments}())?yd:function(e){return Zc(e)&&Cd.call(e,"callee")&&!wd.call(e,"callee")};var Bd=function(){return!1},Ed=Ps((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t?Vc.Buffer:void 0,o=(a?a.isBuffer:void 0)||Bd;e.exports=o})),Sd={};Sd["[object Float32Array]"]=Sd["[object Float64Array]"]=Sd["[object Int8Array]"]=Sd["[object Int16Array]"]=Sd["[object Int32Array]"]=Sd["[object Uint8Array]"]=Sd["[object Uint8ClampedArray]"]=Sd["[object Uint16Array]"]=Sd["[object Uint32Array]"]=!0,Sd["[object Arguments]"]=Sd["[object Array]"]=Sd["[object ArrayBuffer]"]=Sd["[object Boolean]"]=Sd["[object DataView]"]=Sd["[object Date]"]=Sd["[object Error]"]=Sd["[object Function]"]=Sd["[object Map]"]=Sd["[object Number]"]=Sd["[object Object]"]=Sd["[object RegExp]"]=Sd["[object Set]"]=Sd["[object String]"]=Sd["[object WeakMap]"]=!1;var _d=function(e){return Zc(e)&&dd(e.length)&&!!Sd[Yc(e)]};var Ad=function(e){return function(r){return e(r)}},Id=Ps((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t&&Uc.process,o=function(){try{var e=n&&n.require&&n.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=o})),Td=Id&&Id.isTypedArray,xd=Td?Ad(Td):_d,Pd=Object.prototype.hasOwnProperty;var Rd=function(e,r){var t=Mc(e),n=!t&&kd(e),a=!t&&!n&&Ed(e),o=!t&&!n&&!a&&xd(e),i=t||n||a||o,s=i?vd(e.length,String):[],c=s.length;for(var l in e)!r&&!Pd.call(e,l)||i&&("length"==l||a&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||pd(l,c))||s.push(l);return s},Dd=Object.prototype;var Nd=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||Dd)};var Ld=function(e){var r=[];if(null!=e)for(var t in Object(e))r.push(t);return r},Od=Object.prototype.hasOwnProperty;var Md=function(e){if(!tl(e))return Ld(e);var r=Nd(e),t=[];for(var n in e)("constructor"!=n||!r&&Od.call(e,n))&&t.push(n);return t};var Ud=function(e){return fd(e)?Rd(e,!0):Md(e)},Fd=gd((function(e,r,t,n){rd(r,Ud(r),e,n)}));var Vd=function(e,r){return function(t){return e(r(t))}},jd=Vd(Object.getPrototypeOf,Object),zd=Function.prototype,Hd=Object.prototype,qd=zd.toString,Kd=Hd.hasOwnProperty,Gd=qd.call(Object);var Wd=function(e){if(!Zc(e)||"[object Object]"!=Yc(e))return!1;var r=jd(e);if(null===r)return!0;var t=Kd.call(r,"constructor")&&r.constructor;return"function"==typeof t&&t instanceof t&&qd.call(t)==Gd};var Qd=function(e){if(!Zc(e))return!1;var r=Yc(e);return"[object Error]"==r||"[object DOMException]"==r||"string"==typeof e.message&&"string"==typeof e.name&&!Wd(e)},Xd=ud((function(e,r){try{return nd(e,void 0,r)}catch(e){return Qd(e)?e:new Error(e)}}));var Yd=function(e,r){return eu(r,(function(r){return e[r]}))},Zd=Object.prototype,$d=Zd.hasOwnProperty;var Jd=function(e,r,t,n){return void 0===e||xl(e,Zd[t])&&!$d.call(n,t)?r:e},ef={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var rf=function(e){return"\\"+ef[e]},tf=Vd(Object.keys,Object),nf=Object.prototype.hasOwnProperty;var af=function(e){if(!Nd(e))return tf(e);var r=[];for(var t in Object(e))nf.call(e,t)&&"constructor"!=t&&r.push(t);return r};var of=function(e){return fd(e)?Rd(e):af(e)},sf=/<%=([\s\S]+?)%>/g;var cf=function(e){return function(r){return null==e?void 0:e[r]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),lf=/[&<>"']/g,uf=RegExp(lf.source);var df={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:sf,variable:"",imports:{_:{escape:function(e){return(e=au(e))&&uf.test(e)?e.replace(lf,cf):e}}}},ff=/\b__p \+= '';/g,hf=/\b(__p \+=) '' \+/g,pf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mf=/[()=,{}\[\]\/\s]/,gf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vf=/($^)/,yf=/['\n\r\u2028\u2029\\]/g,bf=Object.prototype.hasOwnProperty;var Cf=function(e,r,t){var n=df.imports._.templateSettings||df;t&&md(e,r,t)&&(r=void 0),e=au(e),r=Fd({},r,n,Jd);var a,o,i=Fd({},r.imports,n.imports,Jd),s=of(i),c=Yd(i,s),l=0,u=r.interpolate||vf,d="__p += '",f=RegExp((r.escape||vf).source+"|"+u.source+"|"+(u===sf?gf:vf).source+"|"+(r.evaluate||vf).source+"|$","g"),h=bf.call(r,"sourceURL")?"//# sourceURL="+(r.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(r,t,n,i,s,c){return n||(n=i),d+=e.slice(l,c).replace(yf,rf),t&&(a=!0,d+="' +\n__e("+t+") +\n'"),s&&(o=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=c+r.length,r})),d+="';\n";var p=bf.call(r,"variable")&&r.variable;if(p){if(mf.test(p))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(ff,""):d).replace(hf,"$1").replace(pf,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Xd((function(){return Function(s,h+"return "+d).apply(void 0,c)}));if(m.source=d,Qd(m))throw m;return m},wf=D.Errors;function kf(e){var t=e.livenessSettings,n=e.apiClient,a=e.apiCheck,o=e.onError,i=B(r.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,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}}),2),s=i[0],c=i[1];return r.useEffect((function(){t&&Object.keys(t).length>0?c((function(e){return v(v({},e),t)})):a&&n.clientSettings().then((function(e){if(e&&e.data){var r,t=hu(e,"data.settings.sdk_settings.active_liveness_settings"),n=hu(e,"data.settings.sdk_settings.liveness_settings"),a=hu(t,"save_encoded_frames",{});a.enable&&(r={enable:!0,framesIntervalTime:a.frames_interval_ms,framesBatchLength:a.frames_batch_len});var i=hu(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});c(v(v(v({},t),n),{},{captureFrameSettings:r,exif_data_settings:i}))}e&&e.errors&&o(wf.server_error)})).catch((function(e){o(e)}))}),[t,n,o,a]),s}var Bf=function(e){var r=e.curStep,t=e.faceDirection,n=hu(r,"stepTimeConstraints.delayTime");return!!n&&(null===r.firstFrameSpottedAt?(r.name===t&&(r.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-r.firstFrameSpottedAt<n)};var Ef=function(e){return e?Infinity===(e=Gu(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Sf=function(e){var r=Ef(e),t=r%1;return r==r?t?r-t:r:0};var _f=function(e,r){var t;if("function"!=typeof r)throw new TypeError("Expected a function");return e=Sf(e),function(){return--e>0&&(t=r.apply(this,arguments)),e<=1&&(r=void 0),t}};var Af=function(e){return _f(2,e)},If=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.closeEyesModelUrl,n=void 0===t?ks:t,e.next=3,ei.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();function Tf(){return(Tf=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,l,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>0&&void 0!==u[0]?u[0]:{},t=r.blazefaceModelUrl,n=r.tfScriptUrls,a=r.closeEyesModelUrl,o=new Bs(a),e.next=4,ei.loadTensorFlow(n);case 4:return e.next=6,ei.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[ei.loadBlazefaceModel({modelUrl:t}),o.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=B(s,1),l=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:l,closeEyesModel:o});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var xf,Pf=Af((function(){return Tf.apply(this,arguments)})),Rf=[],Df=function(){Rf=[]},Nf=function(e,r,t){t&&Df(),Rf.push({id:null});var n=Rf.length-1;r.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?Rf[n].id=e.data.file_id:Rf[n].id=-1}))},Lf=function(e){return e.enable?Rf.some((function(e){return-1===e.id}))?null:Rf:[]},Of=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.steps,n=r.apiClient,a=r.FaceDirection,o=r.outputEncryptionSettings,i=r.video,s=[],t.forEach((function(e){var r=e.name,t=e.image,i=e.frontalFaceImage;if(r!==a.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:t.leftRightScore,gesture:r})};o&&o.key?s.push(n.httpClient.post("/v1/images",v({base64:t.encrypted.hex},c),{"X-TV-Key":o.key})):s.push(n.uploadImage(v({file:t.blob},c)))}else s.push(Promise.resolve({data:{image_id:null}}));if(i.blob){var l={label:"portrait",metadata:JSON.stringify({gesture_score:i.leftRightScore,gesture:a.FRONTAL})};o&&o.key?s.push(n.httpClient.post("/v1/images",v({base64:i.encrypted.hex},l),{"X-TV-Key":o.key})):s.push(n.uploadImage(v({file:i.blob},l)))}else s.push(Promise.resolve({data:{image_id:null}}))})),c=i?n.uploadFile({file:i,label:"video"}):Promise.resolve({data:{file_id:null}}),e.next=6,Promise.all([c].concat(s));case 6:return l=e.sent,u=S(h=l)||_(h)||A(h)||T(),d=u[0],f=u.slice(1),t.forEach((function(e,r){e.image.imageId=f[2*r].data.image_id,e.frontalFaceImage.imageId=f[2*r+1].data.image_id})),e.abrupt("return",d);case 12:case"end":return e.stop()}var h}),e)})));return function(r){return e.apply(this,arguments)}}(),Mf=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h,p,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.apiClient,n=r.faceVerificationFlowData,a=r.onLivenessDetectionDone,o=r.captureFrameSettings,i=r.FaceDirection,s=r.onError,c=r.outputEncryptionSettings,l=r.video,e.prev=1,u=n.current.steps,e.next=5,Of({steps:u,apiClient:t,FaceDirection:i,outputEncryptionSettings:c,video:l});case 5:if(0!==(d=u.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=10;break}a({error:"wrong_face_movement"}),e.next=27;break;case 10:return e.next=12,new Promise((function(e){var r=setInterval((function(){Rf.every((function(e){return e.id}))&&(e(),clearInterval(r))}),200)}));case 12:if(f=Lf(o)){e.next=17;break}a({error:"network_error"}),e.next=27;break;case 17:return h=t.verifyFaceLiveness({images:d.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:u.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:f}),p=t.requestVerifyPortrait({image:{id:d[d.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([h,p]);case 21:m=e.sent,g=B(m,2),v=g[0],y=g[1],b=!0===v.data.is_live,a({apiCheckPassed:b,verifyFaceLivenessResult:v.data,verifyFacePortraitResult:y.data,frontalFaces:d.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:u.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){var r=e.name,t=e.image;return{name:r,blob:t.blob,id:t.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(r){return e.apply(this,arguments)}}(),Uf=[],Ff=null,Vf=!1,jf=function(){return Uf},zf=function(){Vf=!0,Uf=[];try{Ff instanceof MediaStream&&(Ff.getTracks().forEach((function(e){return e.stop()})),Ff=null)}catch(e){}};function Hf(e,r,t){if(e.data.size>0){var n=new Blob([e.data],{type:"video/mp4"});Uf.push(n),r()}else console.error("No video have recored!"),t()}function qf(e,r,t,n){if(e&&n){var a=n.cropX,o=n.cropY,i=n.cropWidth,s=n.cropHeight;e.drawImage(r,a,o,i,s,0,0,t,t),Vf||requestAnimationFrame((function(){return qf(e,r,t,n)}))}}function Kf(e){return Gf.apply(this,arguments)}function Gf(){return(Gf=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.outputImagesSize,n=r.videoEl,a=r.resultAnalyzeVideoAndWindowSizes,zf(),(i=document.createElement("canvas")).width=t,i.height=t,s=i.getContext("2d"),e.prev=6,c={width:{min:360,ideal:400},height:{min:360,ideal:400}},l={mimeType:"video/webm"},e.prev=9,Ff=null==n||null===(u=n.captureStream())||void 0===u?void 0:u.clone(),d=Ff.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")&&(Vf=!1,qf(s,n,t,a),Ff=i.captureStream(25),l={mimeType:"video/mp4",videoBitsPerSecond:25e5}),o=new MediaRecorder(Ff,l),h=function(){return new Promise((function(e,r){o.ondataavailable=function(t){return Hf(t,e,r)},"inactive"!==o.state&&o.stop()}))},p=function(){var e=f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h();case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),m=function(){"inactive"!==o.state&&o.stop()},o.stopVideoRecording=p,o.discardRecording=m,e.next=29;break;case 27:e.prev=27,e.t1=e.catch(6);case 29:return e.abrupt("return",{mediaRecorder:o});case 30:case"end":return e.stop()}}),e,null,[[6,27],[9,16]])})))).apply(this,arguments)}var Wf,Qf,Xf,Yf,Zf,$f,Jf,eh=ha.faceTracker(),rh=new oi,th=D.Mode,nh=D.FaceDirection,ah=D.Errors,oh=D.Messages,ih=D.TrackLivenessEvents,sh={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(xf={},p(xf,D.FaceDirection.UP,{delayTime:0}),p(xf,D.FaceDirection.LEFT,{delayTime:0}),p(xf,D.FaceDirection.RIGHT,{delayTime:0}),p(xf,D.FaceDirection.FRONTAL,{delayTime:2e3}),xf),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}};function ch(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,n=e.mode,a=e.bgCameraMask,o=e.bgCameraMaskRed,i=e.surroundStyle,s=e.cropAreaDimension,c=e.customInstructions,l=e.customIcon,d=e.customDirectionIcon,h=e.customStepTimeConstraints,m=void 0===h?sh.customStepTimeConstraints:h,g=e.onLivenessDetectionDone,y=e.onError,b=e.frontalMinSize,C=e.waitingTimeToGetBetterFrames,w=void 0===C?500:C,k=e.captureFrameSettings,S=void 0===k?sh.captureFrameSettings:k,_=e.livenessSettings,A=e.setRemainingTime,I=void 0===A?sh.setRemainingTime:A,T=e.onProcessing,x=void 0===T?sh.onProcessing:T,P=e.customErrors,R=e.customMessages,N=e.apiCredentials,L=void 0===N?{}:N,O=e.onFramesCaptured,M=void 0===O?sh.onFramesCaptured:O,U=e.initFirstGestureTimeout,F=void 0===U?2e3:U,V=e.outputEncryptionSettings,j=e.cameraScale,z=void 0===j?1:j,H=e.passiveModeAuto,q=void 0!==H&&H,K=e.sendCustomEvent,G=r.useState(!1),W=B(G,2),Q=W[0],X=W[1],Y=r.useState(!1),Z=B(Y,2),$=Z[0],J=Z[1],ee=r.useState(!1),re=B(ee,2),te=re[0],ne=re[1],ae=r.useRef(null),oe=zt.useSDKSettings(),ie=oe.lang,se=oe.assetRoot,ce=oe.customUrls,le=Ao.useApiClient({apiCredentials:L}),ue=le.apiClient,de=n===th.ACTIVE,fe=r.useReducer((function(e){return e+1}),0),he=B(fe,2),pe=(he[0],he[1]),me=r.useRef(null),ge=r.useRef(!1),ve=r.useState(!1),ye=B(ve,2),be=ye[0],Ce=ye[1],we=r.useRef({}),ke=Cn.useSDKTracking(),Be=ke.sendEvent,Ee=Ss(),Se=Ee.startMotion,_e=Ee.stopMotion,Ae=Ee.motionData,Ie=Ee.orientationData,Te=r.useRef(null);null===Te.current&&(Te.current=ha.initFaceVerificationData({assetRoot:se,customInstructions:c,customIcon:l,customDirectionIcon:d,customStepTimeConstraints:m}));var xe=r.useState(),Pe=B(xe,2),Re=Pe[0],De=Pe[1],Ne=r.useCallback((function(e){De(e)}),[]),Le=r.useMemo((function(){return Yu(Ne,500)}),[Ne]),Oe=r.useRef([]),Me=r.useRef(),Ue=kf({livenessSettings:_,apiClient:ue,apiCheck:t,onError:y}),Fe=Ue.face_tracking_setting,Ve=Ue.flow_interval_time_ms,je=Ue.limit_time_liveness_check,ze=Ue.terminate_if_no_face,He=Ue.close_eye_detector,qe=void 0===He?{}:He,Ke=Ue.captureFrameSettings,Ge=void 0===Ke?S:Ke,We=Ue.exif_data_settings,Qe=Ue.record_video,Xe=null==Qe?void 0:Qe.enable,Ye=r.useRef(""),Ze=r.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==ih?void 0:ih.show_alert)){var r,t=null===(r=e.log)||void 0===r?void 0:r.alert;if(t===Ye.current)return;Ye.current=t}Be(e),K&&K(e)}}),[K,Be]),$e=r.useMemo((function(){return Yu((function(e){Ze(e)}),2e3)}),[Ze]),Je=r.useRef(0),er=r.useRef(),rr=r.useRef();r.useEffect((function(){Ze({tag:"selfie",event:null==ih?void 0:ih.start_camera,log:{}})}),[Ze]),r.useEffect((function(){return rh.start(),ws.initExifData(),function(){rh.stop()}}),[]),r.useEffect((function(){var e=!1;function r(){return(r=f(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(be){r.next=13;break}return Me.current=performance.now(),r.next=4,Pf(ce);case 4:return we.current=r.sent,r.next=7,ei.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){r.next=9;break}return r.abrupt("return");case 9:Ce(!0),Ze({tag:"selfie",event:null==ih?void 0:ih.show_warmup,log:{}}),Ze({tag:"selfie",event:null==ih?void 0:ih.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Me.current}}),Me.current=null;case 13:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){e=!0}}),[be,ce,Ze]);var tr=r.useCallback((function(){var e;I(""),Te.current.curStepIndex=Te.current.steps.length,J(!1),rh.stop(),null===(e=rr.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;Te.current=ha.initFaceVerificationData({assetRoot:se,customInstructions:c,customIcon:l,customDirectionIcon:d}),rh.start(),Je.current=0,er.current=null,Oe.current=[],ne(!1),Df(),null===(e=rr.current)||void 0===e||e.start(),pe()}),Ve)}),[se,c,l,d,Ve,I]),nr=r.useMemo((function(){return v(v({},ah),P)}),[P]),ar=r.useMemo((function(){return v(v({},oh),R)}),[R]),or=400;r.useEffect((function(){if(Q&&je.enable&&te){var e=je.limit_time_second+1,r=je.remain_time_show||10,t=je.format||"s";rh.start("limit",(function(n){var a=e-n;if(Te.current.curStepIndex<Te.current.steps.length){if(a<=r&&a>=1){var o=Cf(ar.REMAIN_TIME[ie]),i=a;switch(t){case"mm:ss":i=a.toString().padStart(5,"00:00");break;case"ss":i=a.toString().padStart(2,"0")}I(o({x:i}))}if(0===a){var s,c={};Object.keys(null===(s=nr.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var r,t=Cf(null===(r=nr.liveness_terminated_time_out)||void 0===r?void 0:r.msg[e]);c[e]=t({x:je.limit_time_second})})),De(v(v({},nr.liveness_terminated_time_out),{},{msg:c,duration:Ve})),Ze({tag:"selfie",event:null==ih?void 0:ih.show_alert,log:{alert:"liveness_terminated_time_out,"}}),tr()}}}))}}),[tr,I,Q,ie,Ve,je.enable,je.limit_time_second,te,nr.liveness_terminated_time_out,ar.REMAIN_TIME,je.format,je.remain_time_show,Ze]);var ir=r.useCallback((function(e){var r,t,n=e.clientWidth,o=e.clientHeight,c=e.videoAreaWidth,l=e.videoAreaHeight,d=e.lostX,f=e.lostY;Rs.isMobile?t=r=c:r=t=l-200;var h=Math.floor((c-r)/2)+d,p=5+f,m=a;me.current={x:h,y:p,width:r,height:t,image:m,surroundStyle:i},"object"===u(s)?me.current=v(v({},me.current),s):"function"==typeof s&&(me.current=v(v({},me.current),s({clientWidth:n,clientHeight:o,videoAreaWidth:c,videoAreaHeight:l,lostX:d,lostY:f,isMobile:Rs.isMobile,width:r,height:t}))),pe(),X(!0)}),[a,i,s]),sr=r.useState(3),cr=B(sr,2),lr=cr[0],ur=cr[1],dr=r.useState(!1),fr=B(dr,2),hr=fr[0],pr=fr[1],mr=r.useRef(!1),gr=r.useCallback((function(e){pr(e),mr.current=e}),[]),vr=r.useRef(null),yr=r.useRef([]),br=r.useCallback((function(){ur(3),clearInterval(vr.current),gr(!0);var e=function(){var e=f(regeneratorRuntime.mark((function e(r){var n,a,o,i,s,c,l,u,d,f,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r-1!=0){e.next=25;break}return clearInterval(vr.current),a=yr.current,x(),e.next=6,null===(n=rr.current)||void 0===n?void 0:n.stopVideoRecording();case 6:return _e(),ws.preWriteExif({mode:ws.MODE.SELFIE,motionData:Ae,orientationData:Ie,startTime:Date.now()-1e3*rh.duration("from_1st_frame"),endTime:Date.now()}),o=a.map((function(e){return po.resizeBlobImg(e.blob,or,or)})),e.next=11,Promise.all(o);case 11:return i=e.sent,s=i.map((function(e,r){return ws.writeExif({mode:ws.MODE.SELFIE,imageData:v(v({},a[r]),{},{blob:e,gesture:"frontal"}),enableExifData:We.enable})})),e.next=15,Promise.all(s);case 15:if(c=e.sent,l={},!V||!V.key){e.next=24;break}return u=V.key,d=c.map((function(e){return ai.encrypt({blob:e,key:u})})),e.next=22,Promise.all(d);case 22:f=e.sent,l={frontalFacesEncrypted:f};case 24:t?(h=E(Oe.current),p=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:nh.FRONTAL})}},m=a.map((function(e,r){return ue.uploadImage(v({file:c[r]},p(e.leftRightScore)))})),V&&V.key&&(m=a.map((function(e,r){return ue.httpClient.post("/v1/images",v({base64:l.frontalFacesEncrypted[r].hex},p(e.leftRightScore)),{"X-TV-Key":V.key})}))),Promise.all(m).then((function(e){return ue.verifyFaceLiveness({images:e.map((function(e){return{id:e.data.image_id}})),videos:[{frames:h}]})})).then((function(e){g({apiCheckPassed:e.data.is_live,verifyFaceLivenessResult:e.data})})).catch((function(e){y({error:e})}))):(g(v(v({frontalFaces:c},l),{},{capturedFrames:Oe.current,video:jf()})),zf());case 25:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();vr.current=setInterval((function(){ur((function(r){return e(r),r-1}))}),1e3)}),[gr,t,g,ue,y,x,V,_e,Ae,Ie,We.enable]),Cr=r.useRef({});r.useEffect((function(){Cr.current.isFirstValidFrameFoundRef=te}),[te]),r.useEffect((function(){var e,r=ae.current,n=function(){var e=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,l,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Te.current.steps,t=[],r.map((function(e){return t.push({name:e.name,blob:e.image.blob,captureTime:e.image.captureTime,gesture:e.name}),e.frontalFaceImage.blob&&t.push({name:e.name,blob:e.frontalFaceImage.blob,captureTime:e.frontalFaceImage.captureTime,gesture:nh.FRONTAL}),0})),n=t.map((function(e){return po.resizeBlobImg(e.blob,or,or)})),e.next=6,Promise.all(n);case 6:return a=e.sent,o="0",S.framesBatchLength>0&&(i="".concat(Math.floor(Oe.current.length/S.framesBatchLength),"x").concat(S.framesBatchLength),s=Oe.current.length%S.framesBatchLength>0?"+".concat(Oe.current.length%S.framesBatchLength):"",o="".concat(Oe.current.length,":").concat(i).concat(s)),c=a.map((function(e,r){return ws.writeExif({mode:ws.MODE.SELFIE,imageData:v(v({},t[r]),{},{blob:e,frames:o}),enableExifData:We.enable})})),e.next=12,Promise.all(c);case 12:return l=e.sent,u=t.map((function(e,r){return{name:e.name,blob:l[r]}})),e.next=16,Promise.all(r.map(function(){var e=f(regeneratorRuntime.mark((function e(t,n){var a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=u.filter((function(e){return e.name===t.name})),r[n].image.blob=a[0].blob,t.frontalFaceImage.blob&&(r[n].frontalFaceImage.blob=a[1].blob),!V||!V.key){e.next=12;break}return o=V.key,e.next=7,ai.encrypt({blob:a[0].blob,key:o});case 7:if(r[n].image.encrypted=e.sent,!t.frontalFaceImage.blob){e.next=12;break}return e.next=11,ai.encrypt({blob:a[1].blob,key:o});case 11:r[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),i=function(){var e=f(regeneratorRuntime.mark((function e(){var r,a,o,i,s,c,l,u,d,f,h,m,v,C;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Te.current.steps,o=a[Te.current.curStepIndex],p(r={},D.FaceDirection.UP,null==ih?void 0:ih.capture_up_face),p(r,D.FaceDirection.LEFT,null==ih?void 0:ih.capture_left_face),p(r,D.FaceDirection.RIGHT,null==ih?void 0:ih.capture_right_face),p(r,D.FaceDirection.FRONTAL,null==ih?void 0:ih.capture_frontal_face),Ze({tag:"selfie",event:r[o.name],log:{time_capture_in_seconds:((performance.now()-Me.current)/1e3).toFixed(1)}}),Te.current.curStepIndex++,Me.current=performance.now(),Fe.enable&&"each_gesture"===Fe.limit_for&&(Je.current=0),Te.current.curStepIndex!==a.length){e.next=42;break}if(je.enable&&I(""),!g){e.next=42;break}return Ge.enable&&Ge.framesBatchLength>0&&Oe.current.length%Ge.framesBatchLength>0&&(M(Oe.current.slice(Oe.current.length%Ge.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&Nf(Oe.current.slice(Oe.current.length%Ge.framesBatchLength*-1),ue)),Ze({tag:"selfie",event:null==ih?void 0:ih.finish_capture,log:{time_capture_in_seconds:rh.duration("from_1st_frame")}}),x(),e.next=15,null===(i=rr.current)||void 0===i?void 0:i.stopVideoRecording();case 15:return _e(),ws.preWriteExif({mode:ws.MODE.SELFIE,motionData:Ae,orientationData:Ie,startTime:Date.now()-1e3*rh.duration("from_1st_frame"),endTime:Date.now()}),e.next=19,n();case 19:if(t){e.next=40;break}if(d=a.filter((function(e){return e.name!==nh.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),f=a.filter((function(e){return e.name!==nh.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),h=a.filter((function(e){return e.name!==nh.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),m=null===(s=a.find((function(e){return e.name===nh.FRONTAL})))||void 0===s||null===(c=s.image)||void 0===c?void 0:c.blob,v=null===(l=a.find((function(e){return e.name===nh.FRONTAL})))||void 0===l||null===(u=l.image)||void 0===u?void 0:u.encrypted,!m||!b){e.next=31;break}return e.next=28,po.scaleImage(m,{minSize:b});case 28:e.t0=e.sent,e.next=32;break;case 31:e.t0=null;case 32:C=e.t0,m&&f.push(m),v&&h.push(v),Ze({tag:"result",event:null==ih?void 0:ih.liveness_detection_done,log:{result_object:{steps:d,frontalFaces:f,frontalScaledImage:C}}}),g({steps:d,frontalFaces:f,frontalFacesEncrypted:h,frontalScaledImage:C,capturedFrames:Oe.current,video:jf().length?jf()[0]:null}),zf(),e.next=42;break;case 40:return e.next=42,Mf({apiClient:ue,faceVerificationFlowData:Te,onLivenessDetectionDone:g,captureFrameSettings:Ge,FaceDirection:nh,onError:y,outputEncryptionSettings:V,video:jf().length?jf()[0]:null});case 42:pe();case 43:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=Xu((function(){var e=Te.current,r=e.curStepIndex,t=e.steps,n=t[r],a=null!==(null==n?void 0:n.image.blob),o=null!==(null==n?void 0:n.frontalFaceImage.blob),s=t.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return a&&(o||![1].includes(r)||s>=1)?(ge.current=!1,i(),c=!0):ge.current=!(!a||o),J(!1),c}),w);function c(e){return l.apply(this,arguments)}function l(){return(l=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,c,l,u,d,f,h,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.faceDirection,n=r.canvas,a=r.blurScore,o=r.leftRightScore,c=r.isEyeClose,l=Te.current,u=l.curStepIndex,d=l.steps,!(u<d.length)){e.next=29;break}if(f=d[u],!Bf({faceDirection:t,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(t!==nh.FRONTAL||null!==f.frontalFaceImage.blurScore&&!Xn.hasBetterBlurScore(a,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=a,e.next=12,Zn.takePicture({canvas:n});case 12:h=e.sent,f.frontalFaceImage.blob=h,f.frontalFaceImage.leftRightScore=o,f.frontalFaceImage.captureTime=Date.now(),ge.current&&(ge.current=!1,i());case 17:if(f.name!==t||null!==f.image.blurScore&&!Xn.hasBetterBlurScore(a,f.image.blurScore)){e.next=29;break}return J(!0),f.image.blurScore=a,e.next=22,Zn.takePicture({canvas:n});case 22:p=e.sent,f.image.blob=p,f.image.leftRightScore=o,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(p),s();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function u(e,r,t){return d.apply(this,arguments)}function d(){return(d=f(regeneratorRuntime.mark((function e(r,t,n){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!0===mr.current&&r===nh.FRONTAL&&yr.current.length<3)){e.next=5;break}return e.next=3,Zn.takePicture({canvas:t});case 3:a=e.sent,yr.current.push({blob:a,leftRightScore:n,captureTime:Date.now()});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e,r,n,a){if(Oe.current.length&&Date.now()-Oe.current[Oe.current.length-1].time<Ge.framesIntervalTime)return null;if(Ge.enable&&!a){var o=e.topLeft,i=e.bottomRight,s=[].concat(E(o),E(i)),c=eh(e,0===Oe.current.length),l=c.score,u=c.time,d=r.toDataURL("image/jpeg",.8);return Oe.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:l,time:u,index:Oe.current.length,bbox:s,original_bbox:s}),Ge.framesBatchLength>0&&Oe.current.length%Ge.framesBatchLength==0&&M&&(M(Oe.current.slice(-Ge.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&Nf(Oe.current.slice(-Ge.framesBatchLength),ue,Oe.current.length===Ge.framesBatchLength)),l}return null}function C(e){var r=e.trackingScore,t=e.isFirstValidFrameFoundRef;if(!Fe.enable||null===r||!t)return!0;var n=Fe.web_warning_threshold,a=Fe.web_terminate_threshold,o=Fe.max_warning_time;return r<n||(r<a&&Je.current<o?(Je.current++,Je.current===o?(De(v(v({},nr.liveness_terminated_face_tracking),{},{duration:Ve})),Ze({tag:"selfie",event:null==ih?void 0:ih.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):De(v(v({},nr.liveness_too_fast),{},{duration:1500})),!0):(De(v(v({},nr.liveness_terminated),{},{duration:Ve})),Ze({tag:"selfie",event:null==ih?void 0:ih.show_alert,log:{alert:"liveness_terminated"}}),tr(),!1))}function k(e){var r=e.noFace,t=e.isFirstValidFrameFoundRef;if(ze.enable&&t){var n=ze.max_time_ms;er.current&&r||(er.current={time:Date.now(),frame:0}),r&&er.current.frame++;var a=er.current.time;r&&Date.now()-a>=n&&(De(v(v({},nr.liveness_terminated_no_face),{},{duration:Ve})),Ze({tag:"selfie",event:null==ih?void 0:ih.show_alert,log:{alert:"liveness_terminated_no_face"}}),tr())}}function _(e,r){return A.apply(this,arguments)}function A(){return(A=f(regeneratorRuntime.mark((function t(n,i){var s,l,d,f,p,g,v,y,b,w,E,S,A,I,T,x,P,R,N,L,O,M,U,F,V,j,H,K,G,W,Q,X,Y,Z,$,J,ee;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==i?void 0:i.width)&&0!==(null==i?void 0:i.height)){t.next=2;break}return t.abrupt("return");case 2:return f=Cr.current.isFirstValidFrameFoundRef,p=n.cropX,g=n.cropY,v=n.cropWidth,y=n.cropHeight,i.getContext("2d").drawImage(r,p,g,v,y,-(or*z-or)/2/z,-(or*z-or)/2/z,or,or),b=we.current,w=b.blazefaceModel,E=b.closeEyesModel,t.next=9,Promise.all([Xn.calculateBlurScore(i),ma.getModelPredictions({model:w,sCanvas:i})]);case 9:return S=t.sent,A=B(S,2),I=A[0],T=A[1],t.next=15,ha.validatePredictions({predictions:T,width:ma.SIZE,height:ma.SIZE});case 15:if(P=t.sent,R=P.error,N=P.fullFace,L=P.faceRatio,O=P.faceNotFrontalMinThreshold,x=R,me.current.image=a,U=null,F=null,V=null,j=null,H=Te.current,K=H.curStepIndex,G=H.steps,!N){t.next=44;break}return W=G[K],Q=W&&W.name===nh.FRONTAL,V=N.landmarks,t.next=33,ha.calculateFaceDirection({landmarks:V,getPerfectFrontal:Q});case 33:if((X=t.sent)&&(U=X.gesture,F=X.leftRightScore),Y=(null==qe?void 0:qe.web_timeout)+m[D.FaceDirection.FRONTAL].delayTime/1e3,!(Q&&null!=qe&&qe.enable&&(-1===rh.duration("limit_close_eye")||rh.duration("limit_close_eye")<Y))){t.next=44;break}return-1===rh.duration("limit_close_eye")&&rh.start("limit_close_eye"),t.next=40,E.predict(i,V,null==qe?void 0:qe.web_threshold);case 40:Z=t.sent,$=Z.isEyeClose,(j=$)&&!x&&(x=ah.close_eye);case 44:if(J="no_face"===(null===(s=x)||void 0===s?void 0:s.code)||"partial_face"===(null===(l=x)||void 0===l?void 0:l.code),ee=K<G.length,k({noFace:J&&ee,isFirstValidFrameFoundRef:f}),null!==(d=x)&&void 0!==d&&d.code&&$e({tag:"selfie",event:null==ih?void 0:ih.show_alert,log:{alert:x.code}}),x&&!("face_too_small"===x.code&&U!==nh.FRONTAL&&L>=O)){t.next=70;break}if(de||h(T[0],i,V),!de){t.next=58;break}if(f||(ne(!0),Me.current=performance.now(),rh.start("from_1st_frame")),!C({trackingScore:h(T[0],i,V,K>=G.length),isFirstValidFrameFoundRef:f})){t.next=56;break}return t.next=56,c({faceDirection:U,canvas:i,blurScore:I,leftRightScore:F,isEyeClose:j});case 56:t.next=68;break;case 58:if(U===nh.FRONTAL){t.next=63;break}M=nr.not_frontal_face,me.current.image=o,t.next=68;break;case 63:if(x){t.next=68;break}return f||(ne(!0),rh.start("from_1st_frame")),q&&!mr.current&&0===yr.current.length&&setTimeout((function(){br()}),500),t.next=68,u(U,i,F);case 68:t.next=71;break;case 70:K<G.length&&(M=nr[x.code],me.current.image=o);case 71:Le(M),-1!==e&&(e=requestAnimationFrame((function(){return _(n,i)})));case 73:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function T(){return(T=f(regeneratorRuntime.mark((function e(){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Zn.analyzeVideoAndWindowSizes(r,me.current),(n=document.createElement("canvas")).width=or,n.height=or,(a=n.getContext("2d")).translate(or,0),a.scale(-1*z,1*z),!Xe||!r){e.next=13;break}return e.next=10,Kf({outputImagesSize:or,videoEl:r,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:o=e.t0,i=o.mediaRecorder,rr.current=i,rr.current&&rr.current.start(),_(t,n);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return Q&&be&&setTimeout((function(){!function(){T.apply(this,arguments)}()}),F),function(){cancelAnimationFrame(e),e=-1}}),[F,Q,ie,de,ue,t,a,o,g,y,b,w,Ge,x,Fe,je.enable,I,Le,m,Ve,tr,ze,nr,be,Ze,M,V,z,br,q,qe.enable,qe.web_threshold,qe.web_timeout,Ae,Ie,_e,We.enable,$e,S.framesBatchLength,Xe]),r.useEffect((function(){Re&&(clearInterval(vr.current),gr(!1),yr.current=[]),Se()}),[Re,gr,Se]);var wr=Te.current,kr=wr.curStepIndex,Br=wr.steps,Er=r.useMemo((function(){return Br.find((function(e){return e.name===D.FaceDirection.FRONTAL}))}),[Br]),Sr=ge.current?Er:Br[kr],_r=Sr&&te?Sr.instructions[ie]:null,Ar=Sr&&te?Sr.directionIcon:"",Ir=Sr?Sr.directionIconAnimation:"";return{countdownToTakePicture:lr,cropArea:me,curStepIndex:kr,directionIcon:Ar,directionIconAnimation:Ir,faceDetectionError:Re,handleTriggerPassiveMode:br,handleVideoPlayed:ir,instructions:_r,isActiveMode:de,refVideo:ae,showCountdown:hr,steps:Br,videoPlayed:Q,activeCapturing:$,isFirstValidFrameFound:te,warmupDone:be,motionData:Ae,orientationData:Ie}}var lh=(p(Wf={},D.FaceDirection.LEFT,90),p(Wf,D.FaceDirection.RIGHT,270),p(Wf,D.FaceDirection.UP,180),p(Wf,D.FaceDirection.DOWN,0),Wf),uh=n.keyframes(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),dh=c.default.div(Qf||(Qf=k(["\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"])),lh[D.FaceDirection.DOWN],lh[D.FaceDirection.LEFT],lh[D.FaceDirection.UP],lh[D.FaceDirection.RIGHT]),fh=c.default.div(Xf||(Xf=k(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var r,t=e.direction;return null!==(r=lh[t])&&void 0!==r?r:0})),hh=c.default.span(Yf||(Yf=k(["\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"])),uh),ph=c.default(hh)(Zf||(Zf=k(["\n animation-delay: 0s;\n"]))),mh=c.default(hh)($f||($f=k(["\n animation-delay: 0.5s;\n"]))),gh=c.default(hh)(Jf||(Jf=k(["\n animation-delay: 1s;\n"])));function vh(e){var r=e.type;return r!==D.FaceDirection.FRONTAL?i.default.createElement(fh,{direction:r},i.default.createElement(ph,null),i.default.createElement(mh,null),i.default.createElement(gh,null)):i.default.createElement(dh,null,i.default.createElement(fh,{className:"top"},i.default.createElement(ph,null),i.default.createElement(mh,null),i.default.createElement(gh,null)),i.default.createElement(fh,{className:"right"},i.default.createElement(ph,null),i.default.createElement(mh,null),i.default.createElement(gh,null)),i.default.createElement(fh,{className:"bottom"},i.default.createElement(ph,null),i.default.createElement(mh,null),i.default.createElement(gh,null)),i.default.createElement(fh,{className:"left"},i.default.createElement(ph,null),i.default.createElement(mh,null),i.default.createElement(gh,null)))}vh.propTypes={type:s.default.oneOf([D.FaceDirection.LEFT,D.FaceDirection.RIGHT,D.FaceDirection.UP,D.FaceDirection.FRONTAL])},vh.defaultProps={type:D.FaceDirection.LEFT};var yh,bh=D.ErrorDuration;function Ch(e){var r=e.children,t=e.errorMsg,n=e.className;return i.default.isValidElement(r)?t?i.default.createElement("div",{className:n},i.default.cloneElement(r,{errorMsg:t})):null:t?i.default.createElement("div",{className:n},t):null}function wh(e){var t=e.children,n=e.className,a=e.error,o=r.useRef(0),i=r.useRef(""),s=zt.useSDKSettings().lang,c=r.useRef(bh.SHORT),l=a||{},u=l.msg,d=l.duration,f=void 0===d?bh.SHORT:d,h=null==u?void 0:u[s];return Date.now()-o.current>=c.current?(o.current=Date.now(),c.current=f,i.current=h,Ch({children:t,errorMsg:h,className:n})):Ch({children:t,errorMsg:i.current,className:n})}wh.propTypes={children:s.default.node,className:s.default.string},wh.defaultProps={className:""};var kh=c.default.circle(yh||(yh=k(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function Bh(e){var r=e.className,t=e.style,n=e.radius,a=e.strokeWidth,o=e.progress,s=e.hasError,c=e.activeColor,l=e.innerPadding,u=e.outsideRingColor,d=e.outsideRingOpacity,f=e.insideRingColor,h=e.insideRingWidth,p=e.insideRingStrokeDash,m=e.errorRingWidth,g=e.errorRingColor,v=e.dashedRingColor,y=e.dashedRingOpacity,b=e.dashedRingWidth,C=e.dashedRingLineThick,w=e.dashedRingLineSpacing,k=e.dashedInsideRingColor,B=e.dashedInsideRingWidth,E=e.showOutsideRing,S=e.showInsideRing,_=e.showDashedRing,A=2*n,I=2*n,T=n-2*a,x=2*Math.PI*T,P=x-o/100*x,R=T-b/2-a/2-l,D=2*Math.PI*R,N=D-o/100*D,L=R-B/2-b/2,O=2*Math.PI*L,M=O-o/100*O,U=L-h/2-B/2,F=L-m/2-B/2;return i.default.createElement("svg",{className:r,style:t,width:A,height:I,viewBox:"0 0 ".concat(A," ").concat(I),fill:"none",xmlns:"http://www.w3.org/2000/svg"},E?i.default.createElement(i.default.Fragment,null,i.default.createElement("circle",{"data-testid":"outsideRing",opacity:d,cx:n,cy:n,r:T,stroke:u}),i.default.createElement(kh,{"data-testid":"outsideAnimateRing",cx:n,cy:n,r:T,stroke:c,strokeWidth:a,strokeLinecap:"round",strokeDasharray:"".concat(x," ").concat(x),style:{strokeDashoffset:P}})):null,_?i.default.createElement(i.default.Fragment,null,i.default.createElement("circle",{"data-testid":"dashedRing",opacity:y,cx:n,cy:n,r:R,stroke:v,strokeWidth:b,strokeDasharray:"".concat(C," ").concat(w)}),i.default.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},i.default.createElement("circle",{cx:n,cy:n,r:R,stroke:c,strokeWidth:b,strokeDasharray:"".concat(C," ").concat(w)})),i.default.createElement("g",{mask:"url(#mask0)"},i.default.createElement(kh,{"data-testid":"dashedAnimateRing",cx:n,cy:n,r:R,stroke:c,strokeWidth:b,strokeDasharray:"".concat(D," ").concat(D),style:{strokeDashoffset:N}})),i.default.createElement("circle",{"data-testid":"dashedInsideRing",opacity:y,cx:n,cy:n,r:L,stroke:k,strokeWidth:B}),i.default.createElement(kh,{"data-testid":"dashedInsideAnimateRing",cx:n,cy:n,r:L,stroke:c,strokeWidth:B,strokeLinecap:"round",strokeDasharray:"".concat(O," ").concat(O),style:{strokeDashoffset:M}})):null,S?i.default.createElement("circle",{"data-testid":"insideRing",strokeDasharray:p,cx:n,cy:n,r:U,stroke:f,strokeWidth:h}):null,s?i.default.createElement("circle",{"data-testid":"errorRing",strokeDasharray:p,cx:n,cy:n,r:F,stroke:g,strokeWidth:m}):null)}function Eh(e){var r=e.className;return i.default.createElement("svg",{className:r,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.default.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 Sh(){return(Sh=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}Bh.propTypes={className:s.default.string,style:s.default.shape({}),radius:s.default.number,strokeWidth:s.default.number,progress:s.default.number,hasError:s.default.bool,activeColor:s.default.string,innerPadding:s.default.number,outsideRingColor:s.default.string,outsideRingOpacity:s.default.number,insideRingColor:s.default.string,insideRingWidth:s.default.number,insideRingStrokeDash:s.default.string,errorRingColor:s.default.string,errorRingWidth:s.default.number,dashedRingColor:s.default.string,dashedRingOpacity:s.default.number,dashedRingWidth:s.default.number,dashedRingLineThick:s.default.number,dashedRingLineSpacing:s.default.number,dashedInsideRingColor:s.default.string,dashedInsideRingWidth:s.default.number,showOutsideRing:s.default.bool,showDashedRing:s.default.bool,showInsideRing:s.default.bool},Bh.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,hasError:!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},Eh.propTypes={className:s.default.string},Eh.defaultProps={className:""};var _h,Ah,Ih="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,Th={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}}},xh=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],Ph=function(e,r,t,n,a){var o=a.offsetX,i=a.offsetY,s=n?8:0,c=t.split(" "),l=e.top+e.height/2,u=e.left+e.width/2,d=r.height,f=r.width,h=l-d/2,p=u-f/2,m="",g="0%",v="0%";switch(c[0]){case"top":h-=d/2+e.height/2+s,m="rotate(180deg) translateX(50%)",g="100%",v="50%";break;case"bottom":h+=d/2+e.height/2+s,m="rotate(0deg) translateY(-100%) translateX(-50%)",v="50%";break;case"left":p-=f/2+e.width/2+s,m=" rotate(90deg) translateY(50%) translateX(-25%)",v="100%",g="50%";break;case"right":p+=f/2+e.width/2+s,m="rotate(-90deg) translateY(-150%) translateX(25%)",g="50%"}switch(c[1]){case"top":h=e.top,g=e.height/2+"px";break;case"bottom":h=e.top-d+e.height,g=d-e.height/2+"px";break;case"left":p=e.left,v=e.width/2+"px";break;case"right":p=e.left-f+e.width,v=f-e.width/2+"px"}return{top:h="top"===c[0]?h-i:h+i,left:p="left"===c[0]?p-o:p+o,transform:m,arrowLeft:v,arrowTop:g}},Rh=function(e,r,t,n,a,o){var i=a.offsetX,s=a.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},l=0,u=function(e){var r={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var t=document.querySelector(e);null!==t&&(r=t.getBoundingClientRect())}return r}(o),d=Array.isArray(t)?t:[t];for((o||Array.isArray(t))&&(d=[].concat(d,xh));l<d.length;){var f={top:(c=Ph(e,r,d[l],n,{offsetX:i,offsetY:s})).top,left:c.left,width:r.width,height:r.height};if(!(f.top<=u.top||f.left<=u.left||f.top+f.height>=u.top+u.height||f.left+f.width>=u.left+u.width))break;l++}return c},Dh=0,Nh=r.forwardRef((function(e,t){var n=e.trigger,a=void 0===n?null:n,o=e.onOpen,s=void 0===o?function(){}:o,c=e.onClose,u=void 0===c?function(){}:c,d=e.defaultOpen,f=void 0!==d&&d,h=e.open,p=void 0===h?void 0:h,m=e.disabled,g=void 0!==m&&m,v=e.nested,y=void 0!==v&&v,b=e.closeOnDocumentClick,C=void 0===b||b,w=e.repositionOnResize,k=void 0===w||w,B=e.closeOnEscape,E=void 0===B||B,S=e.on,_=void 0===S?["click"]:S,A=e.contentStyle,I=void 0===A?{}:A,T=e.arrowStyle,x=void 0===T?{}:T,P=e.overlayStyle,R=void 0===P?{}:P,D=e.className,N=void 0===D?"":D,L=e.position,O=void 0===L?"bottom center":L,M=e.modal,U=void 0!==M&&M,F=e.lockScroll,V=void 0!==F&&F,j=e.arrow,z=void 0===j||j,H=e.offsetX,q=void 0===H?0:H,K=e.offsetY,G=void 0===K?0:K,W=e.mouseEnterDelay,Q=void 0===W?100:W,X=e.mouseLeaveDelay,Y=void 0===X?100:X,Z=e.keepTooltipInside,$=void 0!==Z&&Z,J=e.children,ee=r.useState(p||f),re=ee[0],te=ee[1],ne=r.useRef(null),ae=r.useRef(null),oe=r.useRef(null),ie=r.useRef(null),se=r.useRef("popup-"+ ++Dh),ce=!!U||!a,le=r.useRef(0);Ih((function(){return re?(ie.current=document.activeElement,we(),ye(),ge()):ve(),function(){clearTimeout(le.current)}}),[re]),r.useEffect((function(){"boolean"==typeof p&&(p?ue():de())}),[p,g]);var ue=function(e){re||g||(te(!0),setTimeout((function(){return s(e)}),0))},de=function(e){var r;re&&!g&&(te(!1),ce&&(null===(r=ie.current)||void 0===r||r.focus()),setTimeout((function(){return u(e)}),0))},fe=function(e){null==e||e.stopPropagation(),re?de(e):ue(e)},he=function(e){clearTimeout(le.current),le.current=setTimeout((function(){return ue(e)}),Q)},pe=function(e){null==e||e.preventDefault(),fe()},me=function(e){clearTimeout(le.current),le.current=setTimeout((function(){return de(e)}),Y)},ge=function(){ce&&V&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},ve=function(){ce&&V&&(document.getElementsByTagName("body")[0].style.overflow="auto")},ye=function(){var e,r=null==ae||null===(e=ae.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"]'),t=Array.prototype.slice.call(r)[0];null==t||t.focus()};r.useImperativeHandle(t,(function(){return{open:function(){ue()},close:function(){de()},toggle:function(){fe()}}}));var be,Ce,we=function(){if(!ce&&re&&(null==ne?void 0:ne.current)&&(null==ne?void 0:ne.current)&&(null==ae?void 0:ae.current)){var e,r,t=ne.current.getBoundingClientRect(),n=ae.current.getBoundingClientRect(),a=Rh(t,n,O,z,{offsetX:q,offsetY:G},$);if(ae.current.style.top=a.top+window.scrollY+"px",ae.current.style.left=a.left+window.scrollX+"px",z&&oe.current)oe.current.style.transform=a.transform,oe.current.style.setProperty("-ms-transform",a.transform),oe.current.style.setProperty("-webkit-transform",a.transform),oe.current.style.top=(null===(e=x.top)||void 0===e?void 0:e.toString())||a.arrowTop,oe.current.style.left=(null===(r=x.left)||void 0===r?void 0:r.toString())||a.arrowLeft}};be=de,void 0===(Ce=E)&&(Ce=!0),r.useEffect((function(){if(Ce){var e=function(e){"Escape"===e.key&&be(e)};return document.addEventListener("keyup",e),function(){Ce&&document.removeEventListener("keyup",e)}}}),[be,Ce]),function(e,t){void 0===t&&(t=!0),r.useEffect((function(){if(t){var r=function(r){if(9===r.keyCode){var t,n=null==e||null===(t=e.current)||void 0===t?void 0:t.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),a=Array.prototype.slice.call(n);if(1===a.length)return void r.preventDefault();var o=a[0],i=a[a.length-1];r.shiftKey&&document.activeElement===o?(r.preventDefault(),i.focus()):document.activeElement===i&&(r.preventDefault(),o.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])}(ae,re&&ce),function(e,t){void 0===t&&(t=!0),r.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])}(we,k),function(e,t,n){void 0===n&&(n=!0),r.useEffect((function(){if(n){var r=function(r){var n=Array.isArray(e)?e:[e],a=!1;n.forEach((function(e){e.current&&!e.current.contains(r.target)||(a=!0)})),r.stopPropagation(),a||t(r)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),function(){n&&(document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r))}}}),[e,t,n])}(a?[ae,ne]:[ae],de,C&&!y);var ke,Be=function(){return i.default.createElement("div",Object.assign({},(e=ce?Th.popupContent.modal:Th.popupContent.tooltip,r={className:"popup-content "+(""!==N?N.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:Sh({},e,I,{pointerEvents:"auto"}),ref:ae,onClick:function(e){e.stopPropagation()}},!U&&_.indexOf("hover")>=0&&(r.onMouseEnter=he,r.onMouseLeave=me),r),{key:"C",role:ce?"dialog":"tooltip",id:se.current}),z&&!ce&&i.default.createElement("div",{ref:oe,style:Th.popupArrow},i.default.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==N?N.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:Sh({position:"absolute"},x)},i.default.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),J&&"function"==typeof J?J(de,re):J);var e,r},Ee=!(_.indexOf("hover")>=0),Se=ce?Th.overlay.modal:Th.overlay.tooltip,_e=[Ee&&i.default.createElement("div",{key:"O","data-testid":"overlay","data-popup":ce?"modal":"tooltip",className:"popup-overlay "+(""!==N?N.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:Sh({},Se,R,{pointerEvents:C&&y||ce?"auto":"none"}),onClick:C&&y?de:void 0,tabIndex:-1},ce&&Be()),!ce&&Be()];return i.default.createElement(i.default.Fragment,null,function(){for(var e={key:"T",ref:ne,"aria-describedby":se.current},r=Array.isArray(_)?_:[_],t=0,n=r.length;t<n;t++)switch(r[t]){case"click":e.onClick=fe;break;case"right-click":e.onContextMenu=pe;break;case"hover":e.onMouseEnter=he,e.onMouseLeave=me;break;case"focus":e.onFocus=he,e.onBlur=me}if("function"==typeof a){var o=a(re);return!!a&&i.default.cloneElement(o,e)}return!!a&&i.default.cloneElement(a,e)}(),re&&l.default.createPortal(_e,(null===(ke=document.getElementById("popup-root"))&&((ke=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(ke)),ke)))})),Lh=n.createGlobalStyle(_h||(_h=k(["\n .popup-content {\n margin: auto;\n background: #fff;\n width: 100%;\n padding: 5px;\n border: 1px solid #d7d7d7;\n max-width: 568px;\n border-radius: 10px;\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n border-radius: 5px\n }\n\n .popup-overlay {\n background: rgba(0, 0, 0, .5);\n padding: 10px;\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"]))),Oh=["open","children","overlayStyle"],Mh=function(e){var r=e.open,t=e.children,n=e.overlayStyle,a=w(e,Oh);return i.default.createElement(i.default.Fragment,null,r&&i.default.createElement(i.default.Fragment,null,i.default.createElement(Nh,m({overlayStyle:v(v({},n),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:r},a),t),i.default.createElement(Lh,null)))};Mh.propTypes={open:s.default.bool,children:s.default.node,overlayStyle:s.default.shape({})},Mh.defaultProps={open:!1,children:null,overlayStyle:{}};var Uh={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},Fh=c.default.div(Ah||(Ah=k(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),Vh=function(e){var r=e.contentStyle,t=zt.useSDKSettings(),n=t.lang,a=t.warmupMessage,o=a?a[n]:Uh.WARMUP_INTRO[n];return i.default.createElement(Mh,{open:!0,contentStyle:r},i.default.createElement(Fh,{className:"warmup-message"},o))};Vh.propTypes={contentStyle:s.default.shape({})},Vh.defaultProps={contentStyle:{}};var jh=n.keyframes(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),zh=n.keyframes(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),Hh=n.css([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],jh,500,zh,500),qh=Object.freeze({__proto__:null,animationDuration:500,default:Hh}),Kh=n.keyframes(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),Gh=n.keyframes(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20),Wh=n.css([".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;}"],Kh,Gh),Qh=Object.freeze({__proto__:null,default:Wh}),Xh=n.keyframes(["from,to{opacity:1;}50%{opacity:0;}"]),Yh=n.css([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],Xh),Zh=Object.freeze({__proto__:null,default:Yh});function $h(){return($h=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function Jh(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}function ep(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function rp(e,r){return e.replace(new RegExp("(^|\\s)"+r+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var tp=!1,np=i.default.createContext(null),ap="entering",op="entered",ip=function(e){function r(r,t){var n;n=e.call(this,r,t)||this;var a,o=t&&!t.isMounting?r.enter:r.appear;return n.appearStatus=null,r.in?o?(a="exited",n.appearStatus=ap):a=op:a=r.unmountOnExit||r.mountOnEnter?"unmounted":"exited",n.state={status:a},n.nextCallback=null,n}ep(r,e),r.getDerivedStateFromProps=function(e,r){return e.in&&"unmounted"===r.status?{status:"exited"}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(e){var r=null;if(e!==this.props){var t=this.state.status;this.props.in?t!==ap&&t!==op&&(r=ap):t!==ap&&t!==op||(r="exiting")}this.updateStatus(!1,r)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var e,r,t,n=this.props.timeout;return e=r=t=n,null!=n&&"number"!=typeof n&&(e=n.exit,r=n.enter,t=void 0!==n.appear?n.appear:r),{exit:e,enter:r,appear:t}},t.updateStatus=function(e,r){void 0===e&&(e=!1),null!==r?(this.cancelNextCallback(),r===ap?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},t.performEnter=function(e){var r=this,t=this.props.enter,n=this.context?this.context.isMounting:e,a=this.props.nodeRef?[n]:[l.default.findDOMNode(this),n],o=a[0],i=a[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!t||tp?this.safeSetState({status:op},(function(){r.props.onEntered(o)})):(this.props.onEnter(o,i),this.safeSetState({status:ap},(function(){r.props.onEntering(o,i),r.onTransitionEnd(c,(function(){r.safeSetState({status:op},(function(){r.props.onEntered(o,i)}))}))})))},t.performExit=function(){var e=this,r=this.props.exit,t=this.getTimeouts(),n=this.props.nodeRef?void 0:l.default.findDOMNode(this);r&&!tp?(this.props.onExit(n),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(n),e.onTransitionEnd(t.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))},t.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(e,r){r=this.setNextCallback(r),this.setState(e,r)},t.setNextCallback=function(e){var r=this,t=!0;return this.nextCallback=function(n){t&&(t=!1,r.nextCallback=null,e(n))},this.nextCallback.cancel=function(){t=!1},this.nextCallback},t.onTransitionEnd=function(e,r){this.setNextCallback(r);var t=this.props.nodeRef?this.props.nodeRef.current:l.default.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(t&&!n){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[t,this.nextCallback],o=a[0],i=a[1];this.props.addEndListener(o,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},t.render=function(){var e=this.state.status;if("unmounted"===e)return null;var r=this.props,t=r.children,n=(r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef,Jh(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.default.createElement(np.Provider,{value:null},"function"==typeof t?t(e,n):i.default.cloneElement(i.default.Children.only(t),n))},r}(i.default.Component);function sp(){}ip.contextType=np,ip.propTypes={},ip.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:sp,onEntering:sp,onEntered:sp,onExit:sp,onExiting:sp,onExited:sp},ip.UNMOUNTED="unmounted",ip.EXITED="exited",ip.ENTERING=ap,ip.ENTERED=op,ip.EXITING="exiting";var cp,lp,up=function(e,r){return e&&r&&r.split(" ").forEach((function(r){return n=r,void((t=e).classList?t.classList.add(n):function(e,r){return e.classList?!!r&&e.classList.contains(r):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+r+" ")}(t,n)||("string"==typeof t.className?t.className=t.className+" "+n:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+n)));var t,n}))},dp=function(e,r){return e&&r&&r.split(" ").forEach((function(r){return n=r,void((t=e).classList?t.classList.remove(n):"string"==typeof t.className?t.className=rp(t.className,n):t.setAttribute("class",rp(t.className&&t.className.baseVal||"",n)));var t,n}))},fp=function(e){function r(){for(var r,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return(r=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1];r.removeClasses(a,"exit"),r.addClass(a,o?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(e,t)},r.onEntering=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1]?"appear":"enter";r.addClass(a,o,"active"),r.props.onEntering&&r.props.onEntering(e,t)},r.onEntered=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1]?"appear":"enter";r.removeClasses(a,o),r.addClass(a,o,"done"),r.props.onEntered&&r.props.onEntered(e,t)},r.onExit=function(e){var t=r.resolveArguments(e)[0];r.removeClasses(t,"appear"),r.removeClasses(t,"enter"),r.addClass(t,"exit","base"),r.props.onExit&&r.props.onExit(e)},r.onExiting=function(e){var t=r.resolveArguments(e)[0];r.addClass(t,"exit","active"),r.props.onExiting&&r.props.onExiting(e)},r.onExited=function(e){var t=r.resolveArguments(e)[0];r.removeClasses(t,"exit"),r.addClass(t,"exit","done"),r.props.onExited&&r.props.onExited(e)},r.resolveArguments=function(e,t){return r.props.nodeRef?[r.props.nodeRef.current,e]:[e,t]},r.getClassNames=function(e){var t=r.props.classNames,n="string"==typeof t,a=n?""+(n&&t?t+"-":"")+e:t[e];return{baseClassName:a,activeClassName:n?a+"-active":t[e+"Active"],doneClassName:n?a+"-done":t[e+"Done"]}},r}ep(r,e);var t=r.prototype;return t.addClass=function(e,r,t){var n=this.getClassNames(r)[t+"ClassName"],a=this.getClassNames("enter").doneClassName;"appear"===r&&"done"===t&&a&&(n+=" "+a),"active"===t&&e&&e.scrollTop,n&&(this.appliedClasses[r][t]=n,up(e,n))},t.removeClasses=function(e,r){var t=this.appliedClasses[r],n=t.base,a=t.active,o=t.done;this.appliedClasses[r]={},n&&dp(e,n),a&&dp(e,a),o&&dp(e,o)},t.render=function(){var e=this.props,r=(e.classNames,Jh(e,["classNames"]));return i.default.createElement(ip,$h({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},r}(i.default.Component);fp.defaultProps={classNames:""},fp.propTypes={};var hp,pp,mp="out-in",gp="in-out",vp=function(e,r,t){return function(){var n;e.props[r]&&(n=e.props)[r].apply(n,arguments),t()}},yp=((cp={})[mp]=function(e){var r=e.current,t=e.changeState;return i.default.cloneElement(r,{in:!1,onExited:vp(r,"onExited",(function(){t(ap,null)}))})},cp[gp]=function(e){var r=e.current,t=e.changeState,n=e.children;return[r,i.default.cloneElement(n,{in:!0,onEntered:vp(n,"onEntered",(function(){t(ap)}))})]},cp),bp=((lp={})[mp]=function(e){var r=e.children,t=e.changeState;return i.default.cloneElement(r,{in:!0,onEntered:vp(r,"onEntered",(function(){t(op,i.default.cloneElement(r,{in:!0}))}))})},lp[gp]=function(e){var r=e.current,t=e.children,n=e.changeState;return[i.default.cloneElement(r,{in:!1,onExited:vp(r,"onExited",(function(){n(op,i.default.cloneElement(t,{in:!0}))}))}),i.default.cloneElement(t,{in:!0})]},lp),Cp=function(e){function r(){for(var r,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return(r=e.call.apply(e,[this].concat(n))||this).state={status:op,current:null},r.appeared=!1,r.changeState=function(e,t){void 0===t&&(t=r.state.current),r.setState({status:e,current:t})},r}ep(r,e);var t=r.prototype;return t.componentDidMount=function(){this.appeared=!0},r.getDerivedStateFromProps=function(e,r){return null==e.children?{current:null}:r.status===ap&&e.mode===gp?{status:ap}:!r.current||(t=r.current,n=e.children,t===n||i.default.isValidElement(t)&&i.default.isValidElement(n)&&null!=t.key&&t.key===n.key)?{current:i.default.cloneElement(e.children,{in:!0})}:{status:"exiting"};var t,n},t.render=function(){var e,r=this.props,t=r.children,n=r.mode,a=this.state,o=a.status,s=a.current,c={children:t,current:s,changeState:this.changeState,status:o};switch(o){case ap:e=bp[n](c);break;case"exiting":e=yp[n](c);break;case op:e=s}return i.default.createElement(np.Provider,{value:{isMounting:!this.appeared}},e)},r}(i.default.Component);Cp.propTypes={},Cp.defaultProps={mode:mp};var wp,kp,Bp,Ep,Sp,_p,Ap,Ip,Tp,xp,Pp,Rp,Dp,Np,Lp,Op,Mp=c.default.div(hp||(hp=k(["\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"])),1001),Up=n.keyframes(["from{background:#000;}to{}"]),Fp=n.css([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],Up,300),Vp=c.default.div(pp||(pp=k(["\n ","\n"])),Fp),jp=function(e){var r=e.keyForTransition,t=void 0===r?0:r;return i.default.createElement(Vp,null,i.default.createElement(Cp,null,i.default.createElement(fp,{key:t,timeout:{enter:300,exit:0},classNames:"splash",unmountOnExit:!1},i.default.createElement(Mp,null))))},zp=Object.freeze({__proto__:null,default:jp}),Hp=n.keyframes(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),qp=n.css([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],Hp),Kp=Object.freeze({__proto__:null,default:qp}),Gp=Object.freeze({__proto__:null,flipY:qh,slide:Qh,blink:Zh,splash:zp,spin:Kp}),Wp=Object.freeze({__proto__:null,CloseCameraButton:function(e){var r=e.className,t=e.onClick,n=Bn.useAsset("ic_close.png");return i.default.createElement(bu,{className:r,onClick:t},i.default.createElement("img",{src:n,alt:""}))}}),Qp=Zh,Xp=Qh,Yp=n.css(["z-index:",";color:#ffffff;"],1020),Zp=c.default.div(wp||(wp=k(["\n ","\n"])),Yp),$p=c.default(wh)(kp||(kp=k(["\n ","\n ","\n ","\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n white-space: pre-wrap;\n text-align: center;\n max-width: 80%;\n"])),Yp,(function(e){var r=e.top;return r&&n.css(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&n.css(["bottom:","px;"],r)}),(function(e){return e.centerY&&n.css(["top:50%;transform:translateY(-50%);"])})),Jp=c.default(Zp)(Bp||(Bp=k(["\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var r=e.top;return r&&n.css(["top:","px;"],r)})),em=c.default(Zp)(Ep||(Ep=k(["\n position: absolute;\n ","\n ","\n font-size: ",";\n text-shadow: 2px 2px 4px #000000;\n"])),(function(e){var r=e.top;return r&&n.css(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&n.css(["bottom:","px;"],r)}),(function(){return Rs.isMobile?"20px":"22px"})),rm=c.default.div(Sp||(Sp=k(["\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 Rs.isMobile?"50px":"70px"}),(function(e){var r=e.top;return r&&n.css(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&n.css(["bottom:","px;"],r)}),1020),tm=c.default.div(_p||(_p=k(["\n width: ",";\n height: ",";\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid #ffffff;\n font-size: 16px;\n color: #fff;\n font-weight: 700;\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: 50%;\n }\n"])),(function(){return Rs.isMobile?"40px":"50px"}),(function(){return Rs.isMobile?"40px":"50px"}),(function(e){return!e.active&&n.css(["opacity:0.6;"])})),nm=c.default.div(Ap||(Ap=k(["\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"])),1020),am=c.default.div(Ip||(Ip=k(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),om=c.default.div(Tp||(Tp=k(["\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"]))),im=c.default.div(xp||(xp=k(["\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"])),Xp.default,Qp.default),sm=c.default(Bh)(Pp||(Pp=k(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),cm=c.default(Eh)(Rp||(Rp=k(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var r=e.color;return null!=r?r:"rgba(0, 0, 0, 0.6)"})),lm=c.default.div(Dp||(Dp=k(["\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"]))),um=n.keyframes(["from{opacity:1;}to{opacity:0;}"]),dm=c.default.div(Np||(Np=k(["\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"])),um),fm=Rs.isMobile?{width:{ideal:640}}:null,hm={background:"#000000",opacity:.6};function pm(e){var t=e.apiCheck,n=e.mode,a=e.onLivenessDetectionDone,o=e.onClose,s=e.onError,c=e.captureFrameSettings,l=e.onFramesCaptured,u=e.frontCamera,d=e.customDirectionIcon,f=e.customStepTimeConstraints,h=e.onProcessing,p=e.customErrors,m=e.livenessSettings,g=e.apiCredentials,v=e.outputEncryptionSettings,y=e.cameraScale,b=e.defaultCameraId,C=e.passiveModeAuto,w=e.offsetFaceY,k=e.styledComponent,E=Bn.useAsset("bg_camera_mask.png"),S=Bn.useAsset("bg_camera_mask_red.png"),_=B(r.useState({}),2),A=_[0],I=_[1],T=A.yFaceDetectionError,x=A.yFaceVerificationStepsWrapper,P=B(r.useState(""),2),R=P[0],D=P[1],N=r.useCallback((function(e){var r=e.lostY,t=e.height,n=e.clientHeight,a=r+25,o=a+30;I({yFaceDetectionError:a,yFaceVerificationStepsWrapper:o+t+20});var i=Math.floor(r),c=Math.floor(n-r),l=Math.floor(o);return 0!==w&&(l+w<i||l+w+t>c)?s({code:"offsetFaceY must be in [-".concat(l-i,", ").concat(c-t-l,"]")}):l+=w,{y:l}}),[w,s]),L=ch({apiCheck:t,mode:n,bgCameraMask:E,bgCameraMaskRed:S,surroundStyle:hm,onLivenessDetectionDone:a,onError:s,cropAreaDimension:N,customDirectionIcon:d,captureFrameSettings:c,onFramesCaptured:l,livenessSettings:m,setRemainingTime:D,customStepTimeConstraints:f,onProcessing:h,customErrors:p,apiCredentials:g,outputEncryptionSettings:v,cameraScale:y,passiveModeAuto:C}),O=L.countdownToTakePicture,M=L.cropArea,U=L.curStepIndex,F=L.directionIcon,V=L.directionIconAnimation,j=L.faceDetectionError,z=L.handleTriggerPassiveMode,H=L.handleVideoPlayed,q=L.instructions,K=L.isActiveMode,G=L.refVideo,W=L.showCountdown,Q=L.steps,X=L.videoPlayed,Y=L.activeCapturing,Z=L.isFirstValidFrameFound,$=L.warmupDone;r.useEffect((function(){var e;"string"==typeof(null===(e=Q[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(Q.map((function(e){return r=e.directionIcon,new Promise((function(e){var t=new Image;t.onload=e,t.onerror=e,t.src=r}));var r})))}),[Q]);var J=k.CloseCameraButton;return i.default.createElement(Tu,{frontCamera:u,onVideoPlayed:H,onClose:o,flipHorizontal:u,ref:G,videoSettings:fm,onError:s,scale:y,defaultCameraId:b,closeButton:J||null},!$&&i.default.createElement(Vh,null),X?i.default.createElement(i.default.Fragment,null,i.default.createElement($p,{top:T-15,className:"face-detection-error",error:j}),M.current?i.default.createElement(Lu,{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},i.default.createElement(cm,null),i.default.createElement(sm,{progress:U/Q.length*100,hasError:!!j,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:1,insideRingStrokeDash:"2"}),W?i.default.createElement(om,null,O):null,K?i.default.createElement(i.default.Fragment,null,i.default.createElement(im,null,function(e,r){return e?"string"==typeof e?i.default.createElement("img",{className:r,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}(F,V)),Y&&i.default.createElement(dm,null)):null,j&&i.default.createElement(lm,null)):null,K?i.default.createElement(i.default.Fragment,null,R&&i.default.createElement(Jp,{top:x-30},R),q?i.default.createElement(em,{top:x+5,className:"instructions"},q):null,Z&&i.default.createElement(rm,{top:x+35},Q.map((function(e,r){var t=e.name,n=e.image.objUrl;return i.default.createElement(tm,{key:t,active:U>=r,className:"step-item"},n?i.default.createElement("img",{src:n,alt:""}):i.default.createElement("span",null,r+1))})))):i.default.createElement(i.default.Fragment,null,!Z||j||C?null:i.default.createElement(nm,null,i.default.createElement(am,{onClick:z},i.default.createElement(Ou,null))))):null)}pm.propTypes={apiCheck:s.default.bool,mode:s.default.string,onLivenessDetectionDone:s.default.func,onClose:s.default.func,onError:s.default.func,captureFrameSettings:s.default.shape({}),onFramesCaptured:s.default.func,frontCamera:s.default.bool,customDirectionIcon:s.default.shape({}),customStepTimeConstraints:s.default.shape({}),onProcessing:s.default.func,customErrors:s.default.shape({}),livenessSettings:s.default.shape({}),apiCredentials:s.default.shape({accessKey:s.default.string,secretKey:s.default.string,apiUrl:s.default.string}),outputEncryptionSettings:s.default.shape({}),cameraScale:s.default.number,defaultCameraId:s.default.string,passiveModeAuto:s.default.bool,offsetFaceY:s.default.number,styledComponent:s.default.shape({CloseCameraButton:s.default.node})},pm.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(Lp={},p(Lp,D.FaceDirection.LEFT,i.default.createElement(vh,{type:D.FaceDirection.LEFT})),p(Lp,D.FaceDirection.RIGHT,i.default.createElement(vh,{type:D.FaceDirection.RIGHT})),p(Lp,D.FaceDirection.UP,i.default.createElement(vh,{type:D.FaceDirection.UP})),p(Lp,D.FaceDirection.FRONTAL,i.default.createElement(vh,{type:D.FaceDirection.FRONTAL})),Lp),customStepTimeConstraints:(Op={},p(Op,D.FaceDirection.UP,{delayTime:0}),p(Op,D.FaceDirection.LEFT,{delayTime:0}),p(Op,D.FaceDirection.RIGHT,{delayTime:0}),p(Op,D.FaceDirection.FRONTAL,{delayTime:2e3}),Op),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 mm,gm=Object.freeze({__proto__:null,Text:Zp,FaceDetectionError:$p,CountdownTime:Jp,FaceVerificationInstructions:em,FaceVerificationStepsWrapper:rm,StepItem:tm,BottomButtonsOverlay:nm,Button:am,CountDownOverlay:om,InstructionsOverlay:im,LivenessStyledComponent:Wp,default:pm,useLivenessDetection:ch}),vm=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.frontCamera,t=void 0===r||r,n=document.createElement("div");document.body.appendChild(n);var a=function(){l.default.unmountComponentAtNode(n)};return new Promise((function(e){l.default.render(i.default.createElement(zt.SDKSettingsProvider,{value:{lang:"en"}},i.default.createElement(Tu,{checkCameraMode:!0,frontCamera:t,onVideoPlayed:function(){a(),e(null)},onClose:a,onError:function(r){a(),e(r)}})),n)}))},ym=c.default.input(mm||(mm=k(["\n display: none;\n"]))),bm=r.forwardRef((function(e,t){var n=e.useFileBrowse,a=e.accept,o=e.frontCamera,s=e.onCaptureDone,c=e.outputEncryptionSettings,l=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.target.files,!s){e.next=8;break}if(n=t[0],!c||!c.key){e.next=7;break}return e.next=6,ai.encrypt({blob:n,key:c.key});case 6:a=e.sent;case 7:s({file:n,encrypted:a});case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[s,c]);return i.default.createElement(ym,m({ref:t,type:"file",accept:a,onChange:l},n?{}:{capture:o?"user":"environment"}))}));bm.propTypes={useFileBrowse:s.default.bool,accept:s.default.string,frontCamera:s.default.bool,onCaptureDone:s.default.func,outputEncryptionSettings:s.default.shape({key:s.default.string})},bm.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var Cm,wm=Object.freeze({__proto__:null,Camera:Ou}),km="landscape",Bm="portrait",Em="desktop",Sm=D.Errors,_m=c.default.div(Cm||(Cm=k(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function Am(e){var t=e.children,n=zt.useSDKSettings().lang,a=Sm.wrong_orientation.msg[n],o=function(){var e=r.useRef(window.matchMedia("(orientation: portrait)")),t=r.useRef(e.current.matches?Bm:km),n=B(r.useState(t.current),2),a=n[0],o=n[1];return r.useEffect((function(){function r(e){e.matches?o(Bm):o(km)}return e.current.addEventListener("change",r),function(){e.current.removeEventListener("change",r)}}),[]),Rs.isMobile?{curOrientation:a,initOrientation:t.current}:{curOrientation:Em}}().curOrientation;return i.default.createElement(i.default.Fragment,null,o===km&&i.default.createElement(Mh,{open:!0},i.default.createElement(_m,null,a)),(o===Bm||o===Em)&&i.default.createElement(i.default.Fragment,null,t))}var Im={LOADING:0,FAR_FACE:1,CLOSE_FACE:2,START_FLASHING:3,STOP_DECTECTING:4},Tm="far_face",xm="close_face",Pm="flashing",Rm=Rs.isMobile?200:400;function Dm(){return(Dm=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=l.length>0&&void 0!==l[0]?l[0]:{},t=r.tfScriptUrls,n=r.closeEyesModelUrl,a=new Bs(n),e.next=4,ei.loadTensorFlow(t);case 4:return e.next=6,ei.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return o=[ei.loadFaceDetectionModel({detectorConfig:{runtime:"mediapipe",solutionPath:t.mediaPipeUrl}}),a.load()],e.next=9,Promise.all(o);case 9:return i=e.sent,s=B(i,1),c=s[0].faceDetector,e.abrupt("return",{faceDetector:c,closeEyesModel:a});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nm=Af((function(){return Dm.apply(this,arguments)})),Lm=function(e){var t=e.width,n=e.height,a=e.cameraScale,o=void 0===a?1:a,i=e.debug,s=void 0!==i&&i,c=B(r.useState(null),2),l=c[0],u=c[1];return r.useEffect((function(){var e=document.createElement("canvas");e.width=t,e.height=n;var r=e.getContext("2d");return r.translate(t,0),r.scale(-1*o,1*o),s&&(document.body.appendChild(e),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.zIndex="9999"),u(e),function(){s&&document.body.removeChild(e)}}),[o,s,n,t]),l},Om=function(e){var t=e.videoRef,n=e.cropArea;return r.useMemo((function(){return t.current?0===Object.keys(n).length?{}:Zn.analyzeVideoAndWindowSizes(t.current,n):{}}),[t,n])},Mm=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";default:return""}},Um=function(e,r){var t=e.getContext("2d");t.clearRect(0,0,e.width,e.height),t.beginPath(),t.lineWidth="1",t.strokeStyle="red",t.rect(0,0,e.width,e.height),t.stroke(),t.closePath(),Object.entries(r).forEach((function(e,r){var n=B(e,2),a=n[0],o=n[1];t.beginPath(),t.fillStyle="red",t.font="16px",t.fillText("".concat(a,": ").concat(o),10,20+20*r),t.closePath()}))},Fm=r.createContext(!1),Vm=function(e){var r=e.children,t=e.debug;return i.default.createElement(Fm.Provider,{value:t},r)};Vm.defaultProps={debug:!1,children:null},Vm.propTypes={debug:s.default.bool,children:s.default.node};var jm=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.getContext("2d"),a=e.width;n.strokeStyle="blue",n.fillStyle="blue",n.lineWidth=1,r.forEach((function(e){e.landmarks.forEach((function(e){n.beginPath(),n.arc(t?a-e[0]:e[0],e[1],2,0,2*Math.PI),n.fill(),n.closePath()})),n.beginPath();var r={x:t?a-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(r.x,r.y,r.width,r.height),n.stroke(),n.closePath()}))},zm=function(e){var t=e.size,n=e.scale,a=void 0===n?1:n,o=e.video,i=e.baseSize,s=void 0===i?200:i,c=t.width,l=t.height;return r.useMemo((function(){var e=null!=o?o:{},r=e.videoWidth,t=void 0===r?Number.MAX_SAFE_INTEGER:r,n=e.videoHeight,i=void 0===n?Number.MAX_SAFE_INTEGER:n,u=Math.min(c,l)/s,d=c/u*a,f=l/u*a;return d>t||f>i?{width:Rs.isMobile?t:i,height:i}:{width:d,height:f}}),[s,l,a,o,c])},Hm=function(e,r){return{topLeft:[e.topLeft[0]*r,e.topLeft[1]*r],bottomRight:[e.bottomRight[0]*r,e.bottomRight[1]*r],probability:e.probability,landmarks:e.landmarks.map((function(e){return[e[0]*r,e[1]*r]}))}};function qm(e){var t=e.cameraScale,n=void 0===t?1:t,a=e.isVideoPlaying,o=e.step,i=e.cropArea,s=e.videoRef,c=e.onCloseFaceDetected,l=e.onMovingCloseFace,u=e.onFarFaceDetected,d=e.onFarFullFaceDetected,h=e.onFlashingFramesCaptured,p=e.frameInterval,m=void 0===p?180:p,g=e.useFaceDetectorWhenFlashing,v=e.onFaceError,y=e.onError,b=e.faceSettings,C=e.ovalBoundingRect,w=e.isOvalTransitioning,k=e.closeEyesSettings,E=e.maskSettings,S=e.captureFrameSettings,_=E.ovalPadding,A=E.chinToMaskBottomPadding,I=S.frameScale,T=k.enable,x=k.timeout,P=r.useContext(Fm),R=Om({videoRef:s,cropArea:i}),N=zm({size:{width:R.cropWidth,height:R.cropHeight},scale:I,video:s.current}),L=function(e){var t=e.cropArea,n=e.ovalBoundingRect,a=e.ovalPadding,o=e.baseCanvasSize;return r.useMemo((function(){var e,r,i,s,c=t.width,l=t.height,u=t.x,d=t.y,f=Math.min(c,l)/o,h=c/f,p=l/f,m=null!==(e=null==n?void 0:n.left)&&void 0!==e?e:0,g=null!==(r=null==n?void 0:n.top)&&void 0!==r?r:0,v=null!==(i=null==n?void 0:n.right)&&void 0!==i?i:c,y=null!==(s=null==n?void 0:n.bottom)&&void 0!==s?s:l;return{left:Math.max((m-u-a.left)/f,0),right:Math.min((v-u+a.right)/f,h-0),top:Math.max((g-d-a.top)/f,0),bottom:Math.min((y-d+a.bottom)/f,p-0)}}),[t,null==n?void 0:n.bottom,null==n?void 0:n.left,null==n?void 0:n.right,null==n?void 0:n.top,a.bottom,a.left,a.right,a.top,o])}({cropArea:i,ovalBoundingRect:C,ovalPadding:_,baseCanvasSize:Math.min(N.width,N.height)}),O=b.minFarFaceRatio,M=b.maxFarFaceRatio,U=b.closeFaceRatio,F=Lm({width:N.width,height:N.height,cameraScale:n}),V=N.height/N.width,j=Lm({width:Rm,height:Rm*V,cameraScale:n,debug:P}),z=function(e){var t=e.width,n=e.height,a=e.debug,o=r.useRef(null),i=r.useMemo((function(){var e=document.createElement("canvas");return e.width=t,e.height=n,e.style.position="fixed",e.style.bottom="0",e.style.left="0",e.style.zIndex="99999",o.current=e,a&&document.body.appendChild(e),e}),[n,t,a]);return r.useEffect((function(){return function(){a&&document.body.removeChild(o.current)}}),[a]),i}({width:160,height:150,debug:P}),H=function(e,t){var n=B(r.useState({}),2),a=n[0],o=n[1],i=Object.keys(a).length>0;return r.useEffect((function(){var r=!1;return function(){var n=f(regeneratorRuntime.mark((function n(){var a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Nm(e);case 3:if(a=n.sent,!r){n.next=6;break}return n.abrupt("return");case 6:o(a),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]),[a,i]}(zt.useSDKSettings().customUrls,y),q=B(H,2),K=q[0],G=q[1],W=r.useRef(null),Q=function(e){var t=e.timeout,n=r.useRef(null),a=r.useCallback((function(){n.current=performance.now()}),[]),o=r.useCallback((function(){return null===n.current?(a(),!1):performance.now()-n.current>t}),[a,t]);return{markTime:a,checkIfEllapsed:o}}({timeout:1e3*x}),X=Q.markTime,Y=Q.checkIfEllapsed,Z=G&&a,$=B(r.useState(""),2),J=$[0],ee=$[1],re=K.closeEyesModel,te=K.faceDetector,ne=r.useMemo((function(){return Yu(ee,1e3)}),[]),ae=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r,t){var n,a,i,f,p,m,b,C,k,B,E,S,_,I,x,R,N,F,V,H,q,K,G,W,Q,Z,$,J,ee,ae,oe,ie;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(null==t?void 0:t.width)&&0!==(null==t?void 0:t.height)){e.next=3;break}return e.abrupt("return");case 3:if(null!==s.current){e.next=5;break}return e.abrupt("return");case 5:if(!w){e.next=7;break}return e.abrupt("return");case 7:if(o!==Im.STOP_DECTECTING){e.next=9;break}return e.abrupt("return");case 9:if(n=r.cropX,a=r.cropY,i=r.cropWidth,f=r.cropHeight,p=t.width,m=t.height,t.getContext("2d").drawImage(s.current,n,a,i,f,0,0,p,m),b=Rm/p,P&&j.getContext("2d").drawImage(s.current,n,a,i,f,0,0,p*b,m*b),g||o!==Im.START_FLASHING){e.next=21;break}if("function"!=typeof h){e.next=20;break}return e.next=20,h({prediction:null,canvas:t,landmarks:null});case 20:return e.abrupt("return");case 21:return e.next=23,te.estimateFaces(t);case 23:return C=e.sent,k=ha.faceDetectorToBlazefacePredictions(C),e.next=27,ha.validatePredictions({predictions:k,width:p,height:m});case 27:return B=e.sent,E=B.fullFace,S=B.ratio,_=[[L.left,L.top],[L.right,L.bottom]],e.next=33,ha.validatePredictions({predictions:k,cropAreaCoordinates:_});case 33:if(I=e.sent,x=I.error,R=I.fullFace,N=I.faceRatio,P&&(F={left:L.left*b,top:L.top*b,right:L.right*b,bottom:L.bottom*b},se={x:F.left,y:F.top,width:F.right-F.left,height:F.bottom-F.top},ce="red",le=void 0,(le=j.getContext("2d")).strokeStyle=ce,le.lineWidth=1,le.beginPath(),le.rect(se.x,se.y,se.width,se.height),le.stroke(),le.closePath(),V=k.map((function(e){return Hm(e,b)})),jm(j,V,!0)),H=D.FaceDirection.FRONTAL,!R){e.next=44;break}return e.next=42,ha.calculateFaceDirection({landmarks:R.landmarks,upDownBound:{lower:.35,upper:.7}});case 42:K=e.sent,H=null!==(q=null==K?void 0:K.gesture)&&void 0!==q?q:"";case 44:if(!E||o!==Im.FAR_FACE){e.next=48;break}if("function"!=typeof u){e.next=48;break}return e.next=48,u({prediction:k[0],canvas:t,landmarks:E.landmarks,faceArea:r});case 48:if(!E||o!==Im.CLOSE_FACE){e.next=52;break}if("function"!=typeof l){e.next=52;break}return e.next=52,l({prediction:k[0],canvas:t,landmarks:E.landmarks,faceArea:r});case 52:if(G=null==x?void 0:x.code,e.prev=53,G!==D.Errors.no_face.code){e.next=56;break}throw new Error("no_face");case 56:if(!(G===D.Errors.multiple_faces.code||k.length>1)){e.next=61;break}if(W=ha.calculateFaceArea(k[0]),Q=ha.calculateFaceArea(k[1]),!(W<=2*Q)){e.next=61;break}throw new Error("multiple_faces");case 61:if(H===D.FaceDirection.FRONTAL){e.next=63;break}throw new Error("face_not_frontal");case 63:if(G!==D.Errors.partial_face.code){e.next=68;break}if(Z=ha.cropFaceInsideBox([k[0].topLeft,k[0].bottomRight],_),!(oa.rectEdgeRatio(Z,_)>.95)){e.next=68;break}throw new Error("face_too_large");case 68:if(o!==Im.FAR_FACE){e.next=73;break}if(!(N>M)){e.next=71;break}throw new Error("face_too_large");case 71:if(!(N<O)){e.next=73;break}throw new Error("face_too_small");case 73:if(o!==Im.CLOSE_FACE){e.next=76;break}if(!(N<U)){e.next=76;break}throw new Error("face_too_small");case 76:if(!(Array.isArray(k)&&k.length>0&&L.bottom-k[0].bottomRight[1]>A)){e.next=78;break}throw new Error("face_too_high");case 78:if(G!==D.Errors.face_out_of_box.code){e.next=85;break}if(o!==Im.FAR_FACE){e.next=82;break}if(!(N>=O&&N<=M)){e.next=82;break}throw new Error("");case 82:if(o!==Im.CLOSE_FACE){e.next=85;break}if(!(N>=U)){e.next=85;break}throw new Error("");case 85:e.next=90;break;case 87:e.prev=87,e.t0=e.catch(53),G=e.t0.message;case 90:if(!T){e.next=100;break}if(G){e.next=99;break}return e.next=94,re.predict(t,E.landmarks);case 94:$=e.sent,J=Y(),$.isEyeClose&&!J&&(G="eye_close"),e.next=100;break;case 99:X();case 100:if(P&&Um(z,{ratio:null!==(ee=null==S?void 0:S.toFixed(3))&&void 0!==ee?ee:"undefined",error:G,ovalFaceRatio:null!==(ae=null==N?void 0:N.toFixed(3))&&void 0!==ae?ae:"undefined",ovalError:null!==(oe=null==x?void 0:x.code)&&void 0!==oe?oe:"undefined",step:o===Im.FAR_FACE?"far":"close"}),ie=Mm(G),ne(ie),!ie){e.next=108;break}if("function"!=typeof v){e.next=107;break}return e.next=107,v({error:G,currentStep:o});case 107:return e.abrupt("return");case 108:if(!(E&&o===Im.FAR_FACE&&O<=N&&N<=M)){e.next=113;break}if("function"!=typeof d){e.next=113;break}return e.next=112,d({prediction:k[0],canvas:t,landmarks:E.landmarks,faceArea:r});case 112:return e.abrupt("return");case 113:if(!(E&&o===Im.CLOSE_FACE&&N>=U)){e.next=118;break}if("function"!=typeof c){e.next=118;break}return e.next=117,c({prediction:k[0],canvas:t,landmarks:E.landmarks,faceArea:r});case 117:return e.abrupt("return");case 118:if(!(E&&o===Im.START_FLASHING&&N>=U)){e.next=123;break}if("function"!=typeof h){e.next=123;break}return e.next=122,h({prediction:k[0],canvas:t,landmarks:E.landmarks,faceArea:r});case 122:return e.abrupt("return");case 123:e.next=129;break;case 125:e.prev=125,e.t1=e.catch(0),console.error(e.t1),y({error:e.t1});case 129:case"end":return e.stop()}var se,ce,le}),e,null,[[0,125],[53,87]])})));return function(r,t){return e.apply(this,arguments)}}(),[j,z,P,s,w,o,te,L.left,L.top,L.right,L.bottom,ne,O,M,U,h,u,v,d,l,c,y,A,g,T,re,Y,X]);return r.useEffect((function(){var e=null,r=!1;return Z&&function t(){e=requestAnimationFrame(function(){var e=f(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=2;break}return e.abrupt("return");case 2:if(null!==s.current){e.next=4;break}return e.abrupt("return");case 4:if(null===W.current&&(W.current=n),!(n-W.current<m)){e.next=9;break}return t(),e.abrupt("return");case 9:return W.current=n,e.next=12,ae(R,F);case 12:t();case 13:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}())}(),function(){r=!0,cancelAnimationFrame(e)}}),[F,R,ae,Z,s,m]),{warmupDone:G,faceError:J}}var Km="rgba(0,0,0,0.6)",Gm=function(e){var t=e.onVideoPlayed,n=B(r.useState(!1),2),a=n[0],o=n[1],i=B(r.useState({}),2),s=i[0],c=i[1];return{onVideoPlayed:r.useCallback((function(e){var r=function(e){var r,t,n=e.videoAreaWidth,a=e.videoAreaHeight,o=e.lostX,i=e.lostY;Rs.isMobile?(r=n,t=a):(r=window.innerHeight,t=window.innerHeight);var s=Math.max(Math.round((n-r)/2+o),0),c=Math.max(Math.round((a-t)/2+i),0),l={};return l.width=Rs.isMobile?n:a-200,l.height=Rs.isMobile?n:a-200,l.x=Math.floor((n-l.width)/2)+o,l.y=5+i,{width:r,height:t,x:s,y:c,square:l}}(e);c(r),o(!0),"function"==typeof t&&t(e)}),[t]),cropArea:s,isPlaying:a}},Wm=function(e){var r=e.prediction,t=e.canvas,n=e.landmarks,a=e.index,o=e.quality,i=void 0===o?.8:o,s=t.toDataURL("image/jpeg",i);return r?{label:"portrait",base64:s.split(",")[1],landmarks:n,index:a}:{label:"portrait",base64:s.split(",")[1],index:a}},Qm=function(){var e=f(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)}}(),Xm=function(e){var r=e.className,t=e.iconColor;return i.default.createElement("svg",{className:r,width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.default.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",fill:t}),i.default.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"}),i.default.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"}),i.default.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"}),i.default.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"}),i.default.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"}),i.default.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",stroke:"#DAEAFB"}))};Xm.defaultProps={className:"",iconColor:"#0276F1"},Xm.propTypes={className:s.default.string,iconColor:s.default.string};var Ym,Zm,$m,Jm={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"}}},eg=c.default.div(Ym||(Ym=k(["\n & .indicator {\n color: ",";\n }\n\n & .gauge {\n background-color: ",";\n }\n"])),(function(e){var r=e.theme;return pu(r,"FlashLiveness.progressBar.mainColor",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.progressBar.mainColor",Jm)})),rg=c.default.div(Zm||(Zm=k(["\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 r=e.theme;return pu(r,"FlashLiveness.progressBar.secondaryColor",Jm)})),tg=function(e){var r=e.value,t=e.className;return i.default.createElement(eg,{className:t},i.default.createElement(rg,null,i.default.createElement("span",{className:"gauge",style:{width:"".concat(r,"%")}})),i.default.createElement("div",null,i.default.createElement("span",{className:"indicator"},"• ",r,"%")))};tg.defaultProps={value:0,className:""},tg.propTypes={value:s.default.number,className:s.default.string};var ng,ag=c.default.span($m||($m=k(["\n padding: 8px 12px;\n display: flex;\n align-items: center;\n flex-direction: row;\n"]))),og=function(e){var r=e.children,t=e.className;return i.default.createElement(ag,{className:t},r)};og.defaultProps={children:null,className:""},og.propTypes={children:s.default.node,className:s.default.string};var ig,sg=c.default.span(ng||(ng=k(["\n ","\n padding: 12px 16px;\n max-width: 200px;\n text-align: center;\n display: inline-block;\n"])),(function(e){var r=e.theme;return n.css(["font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";"],pu(r,"FlashLiveness.instruction.fontSize",Jm),pu(r,"FlashLiveness.instruction.color",Jm),pu(r,"FlashLiveness.instruction.fontWeight",Jm),pu(r,"FlashLiveness.instruction.background",Jm),pu(r,"FlashLiveness.instruction.borderRadius",Jm),pu(r,"FlashLiveness.instruction.border",Jm))})),cg=function(e){var r=e.children,t=e.className;return i.default.createElement(sg,{className:t},r)};cg.defaultProps={children:null,className:""},cg.propTypes={children:s.default.node,className:s.default.string};var lg,ug,dg=c.default.div(ig||(ig=k(["\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"})),fg=function(e){var r=e.children,t=e.overlay,n=e.loadingComponent;return i.default.createElement(dg,{$overlay:t},t&&n,i.default.createElement("div",{style:{visibility:t?"hidden":"visible"}},r))};fg.defaultProps={children:null,overlay:!1,loadingComponent:i.default.createElement(Vh,null)},fg.propTypes={children:s.default.node,overlay:s.default.bool,loadingComponent:s.default.node};var hg={width:210,height:300},pg={width:Rs.isMobile?window.innerWidth:window.innerHeight,height:window.innerHeight},mg=c.default.ellipse(lg||(lg=k(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),gg=c.default.rect(ug||(ug=k(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),vg=r.forwardRef((function(e,r){var t=e.className,n=e.scale,a=e.debug,o=e.width,s=e.height,c=e.padding,l=e.verticalOffset,u=e.ovalMaskFillColor,d={left:o/2-hg.width/2-c.left,top:s/2-hg.height/2-c.top+l,right:o/2+hg.width/2+c.right,bottom:s/2+hg.height/2+c.bottom+l};return i.default.createElement("svg",{className:t,viewBox:"0 0 ".concat(o," ").concat(s),width:o,height:s},i.default.createElement("mask",{id:"OVAL_MASK"},i.default.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),i.default.createElement(mg,{ref:r,cx:o/2,cy:s/2+l,rx:hg.width/2,ry:hg.height/2,$scale:n})),i.default.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:u,mask:"url(#OVAL_MASK)"}),a&&i.default.createElement("rect",{x:"0",y:"0",width:o,height:s,stroke:"red",fill:"none"}),a&&i.default.createElement(gg,{x:d.left,y:d.top,width:d.right-d.left,height:d.bottom-d.top,$scale:n,fill:"none",stroke:"red",strokeWidth:.5}))}));vg.propTypes={className:s.default.string,scale:s.default.oneOfType([s.default.number,s.default.string]),debug:s.default.bool,width:s.default.number,height:s.default.number,padding:s.default.oneOfType([s.default.number,s.default.shape({top:s.default.number,right:s.default.number,bottom:s.default.number,left:s.default.number})]),verticalOffset:s.default.number,ovalMaskFillColor:s.default.string},vg.defaultProps={className:"",scale:1,debug:!1,width:pg.width,height:pg.height,padding:0,verticalOffset:0,ovalMaskFillColor:"#fff"};var yg={en:{face_authentication:"Face authentication",hold_still:"Hold still",uploading:"Uploading",start:"Start",continue:"Continue",retry:"Retry","face_authentication.successful":"Successful face authentication","face_authentication.unsuccessful":"Unsuccessful face authentication",move_face_into_frame:"Fit your face into the oval",face_not_found:"No face detected",processing_result:"Processing result",please_move_face_into_center_frame:"Please fit your face in the oval",please_move_face_closer:"Please move your face a bit closer",please_move_face_farther:"Please move your face a bit further",please_open_your_eyes:"Please open your eyes",please_look_straight_at_the_camera:"Please hold your device at eye level",please_only_one_face:"Multiple faces detected",please_move_face_down:"Please move your face down a little","timeout.remaining":"Remaining time: <%= remain %> seconds","timeout.expired":"You need to complete within <%= timeout %> seconds. Please try again.",move_face_closer:"Move your face closer"},vi:{face_authentication:"Xác thực khuôn mặt",hold_still:"Giữ yên",uploading:"Đang tải lên",start:"Bắt đầu",continue:"Tiếp tục",retry:"Thử lại","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:"Đưa mặt vào khung",face_not_found:"Không tìm thấy khuôn mặt",processing_result:"Đang xử lý kết quả",please_move_face_into_center_frame:"Đưa khuôn mặt vào giữa hình oval",please_move_face_closer:"Đưa khuôn mặt lại gần một chút",please_move_face_farther:"Đưa khuôn mặt ra xa một chút",please_open_your_eyes:"Vui lòng mở to mắt",please_look_straight_at_the_camera:"Vui lòng đưa thiết bị ngang tầm mắt",please_only_one_face:"Có nhiều mặt trong khung hình",please_move_face_down:"Đưa khuôn mặt xuống một chút","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:"Đưa mặt lại gần"}},bg=r.createContext({}),Cg=function(e){var r,t=e.children,n=zt.useSDKSettings().lang;return i.default.createElement(bg.Provider,{value:null!==(r=yg[n])&&void 0!==r?r:yg.vi},t)};Cg.propTypes={children:s.default.node.isRequired};var wg,kg=function(){var e=r.useContext(bg);return r.useCallback((function(r,t){var n,a;return t?Cf(null!==(n=e[r])&&void 0!==n?n:r)(t):null!==(a=e[r])&&void 0!==a?a:r}),[e])},Bg=function(e,t){var n=r.useRef(e);r.useEffect((function(){n.current=e}),[e]),r.useEffect((function(){t&&"function"==typeof n.current&&n.current()}),[t])},Eg=Object.freeze({READY:"READY",RUNNING:"RUNNING",STOPPED:"STOPPED"}),Sg=c.default.span(wg||(wg=k(["\n display: inline-block;\n margin-block-start: 10px;\n text-align: center;\n max-width: 350px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n padding: ",";\n"])),(function(e){var r=e.theme;return pu(r,"FlashLiveness.timeoutText.color",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.timeoutText.fontSize",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.timeoutText.fontWeight",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.timeoutText.padding",Jm)})),_g=function(e){var t=e.onTimeout,n=e.timeout,a=e.shouldStart,o=e.shouldStop,s=kg(),c=function(e){var t=e.startTime,n=void 0===t?3:t,a=e.onCountDownDone,o=e.autoRestartAfter,i=void 0===o?-1:o,s=B(r.useState(n),2),c=s[0],l=s[1],u=B(r.useState(Eg.READY),2),d=u[0],f=u[1],h=r.useRef(),p=r.useCallback((function(){f(Eg.RUNNING),h.current=setInterval((function(){l((function(e){return e-1}))}),1e3)}),[]),m=r.useCallback((function(){f(Eg.READY),l(n),clearInterval(h.current)}),[n]);return r.useEffect((function(){var e=null;return 0===c&&(f(Eg.STOPPED),clearInterval(h.current),"function"==typeof a&&a(),-1!==i&&(e=setTimeout((function(){m(),p()}),1e3*i))),function(){clearTimeout(e)}}),[c,a,i,m,p]),{state:d,countdown:c,startCountDown:p,stopCountDown:m}}({startTime:n,onCountDownDone:t,autoRestartAfter:3}),l=c.countdown,u=c.startCountDown,d=c.stopCountDown;return Bg(u,a),Bg(d,o),i.default.createElement(i.default.Fragment,null,l>0&&l<10&&i.default.createElement(Sg,null,s("timeout.remaining",{remain:l})),0===l&&i.default.createElement(Sg,null,s("timeout.expired",{timeout:n})))};_g.propTypes={onTimeout:s.default.func.isRequired,timeout:s.default.number.isRequired,shouldStart:s.default.bool.isRequired,shouldStop:s.default.bool.isRequired};var Ag={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"]},Ig=function(e){var r,t=(p(r={},Tm,0),p(r,xm,0),p(r,Pm,0),r);return e.forEach((function(e){var r;null!=e&&null!==(r=e.metadata)&&void 0!==r&&r.type&&(t[e.metadata.type]+=1)})),t},Tg=r.createContext({}),xg=function(e){var r=e.apiCredentials,t=e.children,n=Ao.useApiClient({apiCredentials:r}).apiClient;return i.default.createElement(Tg.Provider,{value:n},t)};xg.propTypes={apiCredentials:s.default.shape({accessKey:s.default.string.isRequired,secretKey:s.default.string.isRequired,apiUrl:s.default.string.isRequired}),children:s.default.node.isRequired},xg.defaultProps={apiCredentials:{}};var Pg,Rg,Dg=function(){return r.useContext(Tg)},Ng=(Pg=[],Rg=null,{uploadFrameBatch:function(e,r){Rg!==e[e.length-1]&&(Rg=e[e.length-1],Pg.push(r.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})})))},getAllUploadedBatches:function(){var e=f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Pg);case 2:if(!(r=e.sent).some((function(e){var r;return void 0===(null==e||null===(r=e.data)||void 0===r?void 0:r.file_id)}))){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",r.map((function(e){return{id:e.data.file_id}})));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),resetUploadBatches:function(){Pg.length=0}}),Lg=r.createContext({}),Og={},Mg=function(e){var t=e.children,n=e.clientSettings,a=e.apiCheck,o=B(r.useState({}),2),s=o[0],c=o[1],l=Dg();r.useEffect((function(){function e(){return(e=f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof l.clientSettings){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,l.clientSettings();case 4:r=e.sent,c(r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[l]);var u=Og;return Object.keys(n).length>0?u=n:a&&(u=s),i.default.createElement(Lg.Provider,{value:u},t)};Mg.propTypes={children:s.default.node.isRequired,clientSettings:s.default.shape({}),apiCheck:s.default.bool},Mg.defaultProps={clientSettings:{},apiCheck:!1};var Ug,Fg,Vg,jg,zg,Hg,qg,Kg,Gg,Wg,Qg,Xg,Yg,Zg,$g=function(){return r.useContext(Lg)},Jg={captureFrameSettings:{enable:!1,framesIntervalTime:0,framesBatchLength:10,frameScale:1,frameQuality:.8},livenessSettings:{timeout:30,enableFarStep:!0},flashSettings:{flashColor:"rgb(255, 0, 0)",colorsLength:10,delayBetweenColors:120,framesPerColor:4,flashIntensity:1,useFaceDetectorWhenFlashing:!1},maskSettings:{smallScale:Rs.isMobile?.65:.6,largeScale:Rs.isMobile?.9:.85,ovalPadding:{left:Rs.isMobile?20:30,right:Rs.isMobile?20:30,top:(Rs.isMobile,0),bottom:(Rs.isMobile,20)},ovalVerticalOffset:Rs.isMobile?60:0,chinToMaskBottomPadding:(Rs.isMobile,20)},faceSettings:{minFarFaceRatio:Rs.isMobile?.85:.8,maxFarFaceRatio:(Rs.isMobile,.9),closeFaceRatio:Rs.isMobile?.95:.82},closeEyesSettings:{enable:!1,timeout:5},exifSettings:{enable:!0},imageSettings:{imageScale:1,imageQuality:1}},ev=function(){var e=$g();return r.useMemo((function(){return{captureFrameSettings:{enable:hu(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.enable",Jg.captureFrameSettings.enable),framesIntervalTime:hu(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frames_interval_time",Jg.captureFrameSettings.framesIntervalTime),framesBatchLength:hu(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frames_batch_length",Jg.captureFrameSettings.framesBatchLength),frameScale:hu(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_scale",Jg.captureFrameSettings.frameScale),frameQuality:hu(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_quality",Jg.captureFrameSettings.frameQuality)},livenessSettings:{timeout:hu(e,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.timeout",Jg.livenessSettings.timeout),enableFarStep:hu(e,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.enable_far_step",Jg.livenessSettings.enableFarStep)},flashSettings:{flashColor:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_color",Jg.flashSettings.flashColor),colorsLength:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.colors_length",Jg.flashSettings.colorsLength),delayBetweenColors:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.delay_between_colors",Jg.flashSettings.delayBetweenColors),framesPerColor:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.frames_per_color",Jg.flashSettings.framesPerColor),flashIntensity:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_intensity",Jg.flashSettings.flashIntensity),useFaceDetectorWhenFlashing:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.use_face_detector_when_flashing",Jg.flashSettings.useFaceDetectorWhenFlashing)},maskSettings:{smallScale:hu(e,Rs.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.small_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.small_scale",Jg.maskSettings.smallScale),largeScale:hu(e,Rs.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.large_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.large_scale",Jg.maskSettings.largeScale),ovalPadding:{left:hu(e,Rs.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",Jg.maskSettings.ovalPadding.left),right:hu(e,Rs.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",Jg.maskSettings.ovalPadding.right),top:hu(e,Rs.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",Jg.maskSettings.ovalPadding.top),bottom:hu(e,Rs.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",Jg.maskSettings.ovalPadding.bottom)},ovalVerticalOffset:hu(e,Rs.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",Jg.maskSettings.ovalVerticalOffset),chinToMaskBottomPadding:hu(e,Rs.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",Jg.maskSettings.chinToMaskBottomPadding)},faceSettings:{minFarFaceRatio:hu(e,Rs.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",Jg.faceSettings.minFarFaceRatio),maxFarFaceRatio:hu(e,Rs.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",Jg.faceSettings.maxFarFaceRatio),closeFaceRatio:hu(e,Rs.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",Jg.faceSettings.closeFaceRatio)},closeEyesSettings:{enable:hu(e,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.enable",Jg.closeEyesSettings.enable),timeout:hu(e,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.timeout",Jg.closeEyesSettings.timeout)},exifSettings:{enable:hu(e,"data.settings.sdk_settings.flash_liveness_settings.exif_data_settings.enable",Jg.exifSettings.enable)},imageSettings:{imageScale:hu(e,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_scale",Jg.imageSettings.imageScale),imageQuality:hu(e,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_quality",Jg.imageSettings.imageQuality)}}}),[e])},rv=function(e){return Array.isArray(e)?e.map((function(e){var r=e.base64,t=e.label,n=e.index,a=e.metadata;return{base64:r,label:t,index:n,metadata:JSON.stringify(a)}})):e},tv=(c.default.div(Ug||(Ug=k(["\n color: #ffffff;\n"]))),c.default.div(Fg||(Fg=k(["\n ","\n"])),(function(e){var r=e.theme;return pu(r,"FlashLiveness.title.hidden",Jm)?n.css(["display:none;"]):n.css(["display:flex;justify-content:center;align-items:center;width:100%;height:","};color:",";font-size:",";font-weight:",";"],pu(r,"FlashLiveness.title.height",Jm),pu(r,"FlashLiveness.title.color",Jm),pu(r,"FlashLiveness.title.fontSize",Jm),pu(r,"FlashLiveness.title.fontWeight",Jm))}))),nv=c.default(vg)(Vg||(Vg=k(["\n z-index: 2010;\n width: 100%;\n height: 100%;\n opacity: 1;\n margin: 0;\n"]))),av=c.default(og)(jg||(jg=k(["\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"])),1002,(function(e){var r=e.theme;return e.$flashing?n.css(["transform:translateY(45vh);font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";padding:",";"],pu(r,"FlashLiveness.guideline.text.flashing.fontSize",Jm),pu(r,"FlashLiveness.guideline.text.flashing.color",Jm),pu(r,"FlashLiveness.guideline.text.flashing.fontWeight",Jm),pu(r,"FlashLiveness.guideline.text.flashing.background",Jm),pu(r,"FlashLiveness.guideline.text.flashing.borderRadius",Jm),pu(r,"FlashLiveness.guideline.text.flashing.border",Jm),pu(r,"FlashLiveness.guideline.text.flashing.padding",Jm)):n.css(["font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";padding:",";"],pu(r,"FlashLiveness.guideline.text.normal.fontSize",Jm),pu(r,"FlashLiveness.guideline.text.normal.color",Jm),pu(r,"FlashLiveness.guideline.text.normal.fontWeight",Jm),pu(r,"FlashLiveness.guideline.text.normal.background",Jm),pu(r,"FlashLiveness.guideline.text.normal.borderRadius",Jm),pu(r,"FlashLiveness.guideline.text.normal.border",Jm),pu(r,"FlashLiveness.guideline.text.normal.padding",Jm))})),ov=c.default((function(e){return i.default.createElement("svg",m({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i.default.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"}))}))(zg||(zg=k(["\n ","\n"])),(function(e){var r=e.theme;return n.css(["z-index:1001;cursor:pointer;position:fixed;top:",";right:",";left:",";bottom:",";display:",";"],pu(r,"closeButton.top",Oc),pu(r,"closeButton.right",Oc),pu(r,"closeButton.left",Oc),pu(r,"closeButton.bottom",Oc),pu(r,"closeButton.display",Oc))})),iv=c.default.div(Hg||(Hg=k(["\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}),1001),sv=c.default.div(qg||(qg=k(["\n background-color: ",";\n opacity: ",";\n width: 100vw;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n"])),(function(e){var r=e.theme;return pu(r,"FlashLiveness.errorOverlay.backgroundColor",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.errorOverlay.opacity",Jm)})),cv=c.default(tg)(Kg||(Kg=k(["\n margin-block-start: 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n width: 300px;\n z-index: 1002;\n"])),(function(e){var r=e.theme;return pu(r,"FlashLiveness.progressBar.mainColor",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.progressBar.fontSize",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.progressBar.fontWeight",Jm)})),lv=c.default.div(Gg||(Gg=k(["\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"])),1002),uv=c.default.div(Wg||(Wg=k(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),dv=c.default.div(Qg||(Qg=k(["\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n"]))),fv=Rs.isMobile?{width:{ideal:640},whiteBalanceMode:"none"}:null;function hv(e){var t=e.onFlashDone,o=e.apiCheck,s=e.onClose,c=e.onError,l=e.frontCamera,d=e.styledComponent,h=e.onFramesCaptured,m=ev(),g=m.maskSettings,y=m.flashSettings,b=m.faceSettings,C=m.closeEyesSettings,w=m.livenessSettings,k=m.captureFrameSettings,E=m.exifSettings,S=m.imageSettings;if(g.smallScale>g.largeScale)throw new Error("smallScale must be smaller than largeScale");var _,A,I,T,x=Dg(),P=k.framesIntervalTime,R=r.useRef(),N=(_=r.useRef(),A=Cn.useSDKTracking().sendEvent,r.useCallback((function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=performance.now(),a={};"object"===u(t)&&(a=v({},t),_.current&&(a.interval_vs_previous_in_ms=n-_.current)),"function"==typeof t&&(a=t({lastTimeLog:_.current})),_.current=n,A({tag:e,event:r,log:a})}),[A])),L=kg(),O=r.useContext(Fm),M=y.colorsLength,U=y.framesPerColor,F=y.delayBetweenColors,V=y.useFaceDetectorWhenFlashing,j=y.flashIntensity,z=y.flashColor,H=(I=M,r.useMemo((function(){var e=Ag[I];return e[Math.floor(Math.random()*e.length)]}),[I])),q=n.useTheme(),K=function(e){var t=B(r.useState(e),2),n=t[0],a=t[1];return r.useEffect((function(){!function(){var r=f(regeneratorRuntime.mark((function r(){var t,n,o,i,s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Promise.all([60,Qm()]);case 3:t=r.sent,n=B(t,2),o=n[0],i=n[1],s=Math.max(1e3/o,1e3/i,e),a(s),r.next=15;break;case 11:r.prev=11,r.t0=r.catch(0),console.error(r.t0),a(20);case 15:case"end":return r.stop()}}),r,null,[[0,11]])})));return function(){return r.apply(this,arguments)}}()()}),[e]),n}(P),G=r.useRef(null),W=function(){var e,t=B(r.useState(null),2),n=t[0],a=t[1],o=B(r.useState(!1),2),i=o[0],s=o[1],c=r.useRef(null);return r.useEffect((function(){if(!c.current)return function(){};var e=c.current,r=function(){a(e.getBoundingClientRect()),s(!1)},t=function(){s(!0)};return e.addEventListener("transitionstart",t),e.addEventListener("transitionend",r),function(){e.removeEventListener("transitionstart",t),e.removeEventListener("transitionend",r)}}),[]),[c,null!=n?n:null===(e=c.current)||void 0===e?void 0:e.getBoundingClientRect(),i,s]}(),Q=B(W,4),X=Q[0],Y=Q[1],Z=Q[2],$=Q[3],J=B(r.useState(0),2),ee=J[0],re=J[1],te=B(r.useState(Im.LOADING),2),ne=te[0],ae=te[1],oe=B(r.useState(""),2),ie=oe[0],se=oe[1],ce=r.useRef({frames:[],images:[],total:p({},Tm,0)}),le=function(e){var t=e.mode,n=e.enableWriteExif,a=r.useRef(Date.now()),o=r.useCallback((function(){if(n){var e=Date.now();ws.preWriteExif({mode:t,startTime:a.current,endTime:e})}}),[t,n]),i=r.useCallback((function(e,r){n&&ws.addExifData(e,r)}),[n]),s=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.imageData){e.next=3;break}return e.abrupt("return",null);case 3:if(n){e.next=5;break}return e.abrupt("return",a.blob);case 5:return e.next=7,ws.writeExif({mode:t,imageData:a,enableExifData:!0});case 7:return o=e.sent,e.abrupt("return",o);case 9:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[t,n]);return r.useEffect((function(){n&&ws.initExifData()}),[n]),{prepareExifData:o,writeExifData:s,addExifData:i}}({mode:ws.MODE.SELFIE,enableWriteExif:E.enable}),ue=le.prepareExifData,de=le.writeExifData,fe=le.addExifData,he=r.useCallback((function(){se(L("move_face_into_frame"))}),[L]),pe=Gm({onVideoPlayed:he}),me=pe.onVideoPlayed,ge=pe.cropArea,ve=pe.isPlaying,ye=function(e){var r,t=e.imageScale,n=e.cropArea,a=e.videoRef,o=Om({videoRef:a,cropArea:null!==(r=n.square)&&void 0!==r?r:{}}),i=Om({videoRef:a,cropArea:n}),s="number"==typeof o.cropHeight?400/o.cropHeight:1,c=zm({size:{width:i.cropWidth,height:i.cropHeight},scale:t*s,video:a.current,baseSize:Math.min(i.cropHeight,i.cropWidth)}),l=c.width,u=c.height;return Lm({width:l,height:u})}({imageScale:S.imageScale,videoRef:G,cropArea:ge}),be=function(e,r,t){var n=e.smallScale,a=e.largeScale,o=e.ovalPadding,i=r.width/r.height,s=n/a,c=n*t.height,l=a*t.height,u=o.top+o.bottom,d=o.left+o.right,f=c-u,h=l-u;if(parseFloat((h*i).toFixed(2))+d>t.width){var p=((t.width-d)/r.width).toFixed(2);return{smallScale:(p*s).toFixed(2),largeScale:p}}return{smallScale:(f/r.height).toFixed(2),largeScale:(h/r.height).toFixed(2)}}(g,hg,{width:ge.width,height:ge.height}),Ce=be.smallScale,we=be.largeScale,ke=r.useMemo((function(){return Xu((function(){ce.current.frames=[],ce.current.images=[],ce.current.total[Tm]=0,Ng.resetUploadBatches(),w.enableFarStep&&(re(Ce),ae(Im.FAR_FACE)),se(L("move_face_into_frame"))}),200,{leading:!0})}),[re,Ce,L,w.enableFarStep]),Be=function(e){var r=e.offset,t=e.ovalPadding,n=e.largeScale,a=e.ovalHeight,o=e.maskHeight,i=a/2+t.bottom;return(i+r)*n>o/2?o/2/n-i:r}({offset:g.ovalVerticalOffset,ovalPadding:g.ovalPadding,largeScale:we,maskHeight:ge.height,ovalHeight:hg.height}),Ee=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,n,a,i,s,l,u,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ae(Im.STOP_DECTECTING),se(""),N("selfie_flash","user_activity.finish_flash"),N("selfie_flash","user_activity",(function(e){return{flash_liveness_in_ms:e.lastTimeLog-R.current}})),r=ce.current.frames,k.enable&&k.framesBatchLength>0&&0!==(n=r.length%k.framesBatchLength)&&(a=r.slice(-1*n),"function"==typeof h&&h(a),o&&Ng.uploadFrameBatch(rv(a),x)),i=Ig(r),!w.enableFarStep){e.next=12;break}return ce.current.images[1].frames=ce.current.total[Tm],e.next=11,ce.current.images[1].blob;case 11:ce.current.images[1].blob=e.sent;case 12:return ce.current.images[0].frames=i[xm],e.next=15,ce.current.images[0].blob;case 15:return ce.current.images[0].blob=e.sent,ue(),fe("selfie_type",D.Mode.FLASH),fe("flash_liveness_in_ms",performance.now()-R.current),fe("far_batches",ce.current.total[Tm]),fe("close_batches",i[xm]),fe("flash_batches",i[Pm]),fe("colors",H),fe("flash_color",z),fe("frames_per_color",U),fe("frame_interval",P),fe("delay_between_colors",F),fe("use_face_detector_when_flashing",V),e.next=30,Promise.all([de({imageData:ce.current.images[1]}),de({imageData:ce.current.images[0]})]);case 30:if(s=e.sent,l=B(s,2),u=l[0],d=l[1],w.enableFarStep&&(ce.current.images[1].blob=u),ce.current.images[0].blob=d,ce.current.images=ce.current.images.filter((function(e){return!!e})),e.prev=37,"function"!=typeof t){e.next=41;break}return e.next=41,t({images:ce.current.images,frames:ce.current.frames},{colors:H,flashColor:z});case 41:e.next=46;break;case 43:e.prev=43,e.t0=e.catch(37),c({error:e.t0});case 46:case"end":return e.stop()}}),e,null,[[37,43]])}))),[N,k.enable,k.framesBatchLength,w.enableFarStep,ue,fe,H,z,U,P,F,V,de,h,o,x,t,c]),Se=function(e){var t=e.colors,n=e.onFlashDone,a=e.framesPerColor,o=e.flashColor,i=B(r.useState(null),2),s=i[0],c=i[1],l=r.useMemo((function(){return t.split("").reduce((function(e,r){return e+r.repeat(a)}),"")}),[t,a]),u=" "===l[s]?Km:o,d=r.useCallback((function(){c((function(e){return e+1}))}),[]),f=r.useCallback((function(){c(0)}),[]);return r.useEffect((function(){s>l.length-1&&(c(null),"function"==typeof n&&n())}),[s,l.length,n]),{colorIndex:s,currentColor:u,goToNextColor:d,startFlashing:f}}({colors:H,onFlashDone:Ee,framesPerColor:U,flashColor:z}),_e=Se.currentColor,Ae=Se.colorIndex,Ie=Se.startFlashing,Te=Se.goToNextColor,xe=r.useCallback((function(){ce.current.total[Tm]+=1}),[]),Pe=r.useCallback((function(e){var r=e.faceArea;if(!ce.current.images[1]){var t=r.cropX,n=r.cropY,a=r.cropWidth,o=r.cropHeight,i=ye.width,s=ye.height;ye.getContext("2d").drawImage(G.current,t,n,a,o,0,0,i,s),ce.current.images[1]={blob:Zn.takePicture({canvas:ye,quality:S.imageQuality}),gesture:"frontal",capture_time:Date.now(),step:Tm}}re(we),$(!0),ae(Im.CLOSE_FACE),se(L("move_face_closer"))}),[we,$,L,ye,S.imageQuality]),Re=r.useCallback((function(e){var r=e.faceArea;if(!ce.current.images[0]){var t=r.cropX,n=r.cropY,o=r.cropWidth,i=r.cropHeight,s=ye.width,c=ye.height;ye.getContext("2d").drawImage(G.current,t,n,o,i,0,0,s,c),ce.current.images[0]={blob:Zn.takePicture({canvas:ye,quality:S.imageQuality}),gesture:"frontal",capture_time:Date.now(),step:xm}}a.unstable_batchedUpdates((function(){ae(Im.START_FLASHING),Ie()}))}),[S.imageQuality,Ie,ye]),De=null!==Ae&&ne===Im.START_FLASHING,Ne=r.useCallback((function(e){var r=e.prediction,t=e.canvas,n=e.landmarks,a=ce.current.frames,i=Wm({prediction:r,canvas:t,landmarks:n,index:a.length,quality:k.frameQuality});if(i.metadata={color:_e,type:Pm},a.push(i),k.enable&&k.framesBatchLength>0&&a.length%k.framesBatchLength==0){var s=a.slice(-1*k.framesBatchLength);"function"==typeof h&&h(s),o&&Ng.uploadFrameBatch(rv(s),x)}De&&Te()}),[o,x,k.enable,k.frameQuality,k.framesBatchLength,_e,Te,De,h]),Le=r.useCallback((function(e){var r=e.error;"no_face"!==r&&"multiple_faces"!==r||ke()}),[ke]),Oe=r.useCallback((function(e){var r=e.prediction,t=e.canvas,n=e.landmarks,a=ce.current.frames,i=Wm({prediction:r,canvas:t,landmarks:n,index:a.length,quality:k.frameQuality});if(i.metadata={color:"",type:xm},a.push(i),k.enable&&k.framesBatchLength>0&&a.length%k.framesBatchLength==0){var s=a.slice(-1*k.framesBatchLength);"function"==typeof h&&h(s),o&&Ng.uploadFrameBatch(rv(s),x)}}),[o,x,k.enable,k.frameQuality,k.framesBatchLength,h]),Me=r.useMemo((function(){return null===Ae?K:Ae%U==0?Math.max(F,K):K}),[Ae,F,K,U]),Ue=qm({onError:c,isVideoPlaying:ve,step:ne,cropArea:ge,videoRef:G,onCloseFaceDetected:Re,onFarFullFaceDetected:Pe,onFlashingFramesCaptured:Ne,frameInterval:Me,useFaceDetectorWhenFlashing:V,onFaceError:Le,onMovingCloseFace:Oe,onFarFaceDetected:xe,faceSettings:b,ovalBoundingRect:Y,isOvalTransitioning:Z,maskSettings:g,closeEyesSettings:C,captureFrameSettings:k}),Fe=Ue.faceError,Ve=Ue.warmupDone;T=G.current,r.useEffect((function(){return function(){var e;T&&(null===(e=T.srcObject)||void 0===e||e.getTracks().forEach((function(e){e.stop()})))}}),[T]);Bg((function(){w.enableFarStep?(ae(Im.FAR_FACE),re(Ce)):(ae(Im.CLOSE_FACE),re(we)),R.current||(R.current=performance.now())}),Ve&&ve),Bg((function(){return N("selfie_flash","user_activity.start")}),!0),Bg((function(){return N("selfie_flash","user_activity.start_far")}),ne===Im.FAR_FACE),Bg((function(){return N("selfie_flash","user_activity.start_close")}),ne===Im.CLOSE_FACE),Bg((function(){return N("selfie_flash","user_activity.start_flash")}),ne===Im.START_FLASHING);var je=null===Ae?0:Math.min(Math.round((Ae+1)/(H.length*U)*100),100),ze=d.CloseCameraButton,He=d.Loading;return i.default.createElement(i.default.Fragment,null,i.default.createElement(Iu,{frontCamera:l,onVideoPlayed:me,onClose:s,flipHorizontal:l,ref:G,onError:c,videoSettings:fv,closeButton:null!=ze?ze:i.default.createElement(ov,null)},i.default.createElement(fg,{overlay:!Ve||!ve,loadingComponent:He},""!==Fe&&i.default.createElement(sv,null),i.default.createElement(Lu,{x:"".concat(Math.round(ge.x),"px"),y:"".concat(Math.round(ge.y),"px"),width:"".concat(ge.width,"px"),height:"".concat(ge.height,"px"),surroundStyle:{background:pu(q,"FlashLiveness.maskFill",Jm)}},i.default.createElement(nv,{ref:X,scale:ee,debug:O,width:ge.width,height:ge.height,padding:g.ovalPadding,verticalOffset:Be,ovalMaskFillColor:pu(q,"FlashLiveness.maskFill",Jm)}),i.default.createElement(dv,null,""!==Fe&&ne!==Im.FLASHING&&i.default.createElement(cg,null,L(Fe)))))),i.default.createElement(lv,null,i.default.createElement(uv,null,Ve&&ve&&ne!==Im.START_FLASHING&&i.default.createElement(tv,null,L("face_authentication")),ne!==Im.LOADING&&ie&&i.default.createElement(av,{$flashing:ne===Im.START_FLASHING},ne===Im.START_FLASHING?L("hold_still"):i.default.createElement(i.default.Fragment,null,i.default.createElement(Xm,{iconColor:pu(q,"FlashLiveness.guideline.icon.color",Jm)})," ",ie)),ne===Im.START_FLASHING&&i.default.createElement(cv,{value:je,max:100})),i.default.createElement(_g,{onTimeout:ke,timeout:w.timeout,shouldStart:Ve&&ve,shouldStop:ne===Im.START_FLASHING})),ne===Im.START_FLASHING&&i.default.createElement(iv,{$backgroundColor:_e,$intensity:j}))}var pv=c.default.div(Xg||(Xg=k(["\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"]))),mv=c.default.div(Yg||(Yg=k(["\n & > img {\n width: 100%;\n }\n\n ","\n"])),qp),gv=c.default.p(Zg||(Zg=k(["\n color: #1d1d1d;\n font-size: 20px;\n"]))),vv=function(e){var r=e.loading,t=Bn.useAsset("loader.jpg"),n=kg();return r?i.default.createElement(pv,null,i.default.createElement(mv,null,i.default.createElement("img",{src:t,className:"spin",alt:"loading-icon"})),i.default.createElement(gv,null,n("processing_result"))):null};vv.propTypes={loading:s.default.bool},vv.defaultProps={loading:!1};var yv=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Array.isArray(e)?e.map((function(e,t){var n,a,o;return{name:e.step,image:{blob:e.blob,id:null!==(n=null===(a=r[t])||void 0===a||null===(o=a.data)||void 0===o?void 0:o.image_id)&&void 0!==n?n:null}}})):[]},bv=["apiCheck","onLivenessDetectionDone"],Cv=function(e){var t,n=e.apiCheck,a=e.onLivenessDetectionDone,o=w(e,bv),s=B(r.useState(!1),2),c=s[0],l=s[1],u=(t=Dg(),{verifyFlashLiveness:r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var n,a,o,i,s,c,l,u,d,f,h,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.videos,a=r.images,o=r.enableFarStep,i=r.metadata,e.prev=1,e.next=4,Promise.all(a.map((function(e){return t.uploadImage({label:"portrait",file:e})})));case 4:return s=e.sent,c=[t.verifyFaceLiveness({images:s.map((function(e){var r;return{id:null==e||null===(r=e.data)||void 0===r?void 0:r.image_id,label:"portrait"}})),videos:n,metadata:i,selfie_type:D.Mode.FLASH})],o&&c.push(t.requestVerifyPortrait({image:{id:null===(l=s[0])||void 0===l||null===(u=l.data)||void 0===u?void 0:u.image_id},selfie_type:D.Mode.FLASH})),e.next=9,Promise.all(c);case 9:return d=e.sent,f=B(d,2),h=f[0],p=f[1],e.abrupt("return",{uploadedImages:s,faceLivenessResult:h,portraitResult:p});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(r){return e.apply(this,arguments)}}(),[t])}).verifyFlashLiveness,d=ev(),h=d.captureFrameSettings,p=d.flashSettings,g=d.livenessSettings,v=h.framesIntervalTime,y=g.enableFarStep,b=e.onError,C=function(){var e=f(regeneratorRuntime.mark((function e(r,t){var o,i,s,c,d,f,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o={flash_color:t.flashColor,colors:t.colors,frames_per_color:p.framesPerColor,frame_interval:v,delay_between_colors:p.delayBetweenColors,use_face_detector_when_flashing:p.useFaceDetectorWhenFlashing},n){e.next=5;break}return e.next=4,a({capturedFrames:r.frames,steps:yv(r.images),metadata:o});case 4:return e.abrupt("return");case 5:if(e.prev=5,l(!0),s=null,!h.enable){e.next=14;break}return e.next=11,Ng.getAllUploadedBatches();case 11:s=e.sent,e.next=15;break;case 14:s=[{frames:rv(r.frames)}];case 15:return e.next=17,u({videos:s,images:r.images.map((function(e){return e.blob})),enableFarStep:y,metadata:o});case 17:if(c=e.sent,d=c.uploadedImages,f=c.faceLivenessResult,m=c.portraitResult,Ng.resetUploadBatches(),l(!1),!f.errors){e.next=25;break}throw f.errors;case 25:if(null==m||!m.errors){e.next=27;break}throw m.errors;case 27:return e.next=29,a({capturedFrames:r.frames,steps:yv(r.images,d),apiCheckPassed:f.data.is_live,verifyFaceLivenessResult:f.data,verifyPortraitResult:null!==(i=null==m?void 0:m.data)&&void 0!==i?i:null});case 29:e.next=36;break;case 31:e.prev=31,e.t0=e.catch(5),console.error(e.t0),l(!1),b({error:e.t0});case 36:case"end":return e.stop()}}),e,null,[[5,31]])})));return function(r,t){return e.apply(this,arguments)}}();return i.default.createElement(i.default.Fragment,null,i.default.createElement(hv,m({},o,{apiCheck:n,onFlashDone:C})),n&&i.default.createElement(vv,{loading:c}))},wv=function(e){var r=e.value,t=e.children,n=$g(),a=hu(n,"data.settings.sdk_settings.server_log_settings.enable"),o=null!=a?a:null==r?void 0:r.enable;return i.default.createElement(Cn.SDKTrackingProvider,{value:{tracking:v(v({},r),{},{enable:o})}},t)};wv.propTypes={value:s.default.shape({enable:s.default.bool,accessKey:s.default.string,secretKey:s.default.string,apiUrl:s.default.string}).isRequired,children:s.default.node.isRequired};var kv=function(e){var r=e.apiCheck,t=e.debug,a=e.clientSettings,o=e.apiCredentials,s=e.logCredentials,c=e.customTheme;return i.default.createElement(Vm,{debug:t},i.default.createElement(xg,{apiCredentials:o},i.default.createElement(Mg,{apiCheck:r,clientSettings:a},i.default.createElement(Am,null,i.default.createElement(n.ThemeProvider,{theme:c},i.default.createElement(Cg,null,i.default.createElement(wv,{value:v({enable:!0},s)},i.default.createElement(Cv,e))))))))};kv.propTypes={apiCheck:s.default.bool,apiCredentials:s.default.shape({accessKey:s.default.string,secretKey:s.default.string,apiUrl:s.default.string}),onLivenessDetectionDone:s.default.func,onClose:s.default.func,onError:s.default.func,onFramesCaptured:s.default.func,frontCamera:s.default.bool,styledComponent:s.default.shape({CloseCameraButton:s.default.node}),clientSettings:s.default.shape({}),logCredentials:s.default.shape({accessKey:s.default.string,secretKey:s.default.string,apiUrl:s.default.string,userId:s.default.string,logSignature:s.default.shape({logUrl:s.default.string,timestamp:s.default.string,signature:s.default.string})}),debug:s.default.bool,customTheme:s.default.shape({})},kv.defaultProps={apiCheck:!1,apiCredentials:{},onLivenessDetectionDone:function(){},onClose:function(){},onError:function(){},onFramesCaptured:function(){},frontCamera:!0,styledComponent:{CloseCameraButton:null},clientSettings:{},logCredentials:{},debug:!1,customTheme:{}};var Bv=["logCredentials","clientSettings","livenessSettings","livenessComponent","customTheme"];function Ev(e){var r=e.logCredentials,t=void 0===r?{enable:!0}:r,a=e.clientSettings,o=e.livenessSettings,s=e.livenessComponent,c=void 0===s?pm:s,l=e.customTheme,u=void 0===l?{}:l,d=w(e,Bv);switch(d.mode){case D.Mode.FLASH:return i.default.createElement(kv,m({},d,{customTheme:u,clientSettings:a,logCredentials:t}));default:var f=hu(a,"data.settings.sdk_settings",{});return i.default.createElement(Am,null,i.default.createElement(n.ThemeProvider,{theme:u},i.default.createElement(Cn.SDKTrackingProvider,{value:{tracking:v({},t)}},i.default.createElement(c,m({},d,{livenessSettings:v(v(v({},o),null==f?void 0:f.active_liveness_settings),null==f?void 0:f.liveness_settings)})))))}}var Sv={DEFAULT:"default",ERROR:"error"};function _v(e){var t=e.className,n=e.width,a=e.height,o=e.type,s=e.strokeStyles,c=e.strokeWidth,l=e.radius,u=e.paddingStyle,d=r.useMemo((function(){var e;return v((p(e={},Sv.DEFAULT,{fill:"none",strokeWidth:c,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),p(e,Sv.ERROR,{fill:"rgba(234,50,35, 0.1)",strokeWidth:c,stroke:"#ea3223"}),e),s)}),[c,s]),f=l+.8*c,h=d[o];return i.default.createElement("svg",{width:n,height:a,className:t},i.default.createElement("rect",{x:c/2,y:c/2,rx:l,ry:l,width:n-c,height:a-c,style:h}),i.default.createElement("path",{d:"M0,".concat(f," Q0,0 ").concat(f,",0 L0,0 Z"),style:u}),i.default.createElement("path",{d:"M0,".concat(a-f," Q0,").concat(a," ").concat(f,",").concat(a," L0,").concat(a," Z"),style:u}),i.default.createElement("path",{d:"M".concat(n-f,",").concat(a," Q").concat(n,",").concat(a," ").concat(n,",").concat(a-f," L").concat(n,",").concat(a," Z"),style:u}),i.default.createElement("path",{d:"M".concat(n-f,",0 Q").concat(n,",0 ").concat(n,",").concat(f," L").concat(n,",0 Z"),style:u}))}_v.propTypes={className:s.default.string,width:s.default.number,height:s.default.number,strokeWidth:s.default.number,strokeStyles:s.default.shape({}),type:s.default.oneOf([Sv.DEFAULT,Sv.ERROR]),radius:s.default.number,paddingStyle:s.default.shape({})},_v.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:Sv.DEFAULT,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var Av,Iv,Tv,xv,Pv,Rv,Dv,Nv,Lv,Ov,Mv,Uv,Fv,Vv,jv,zv,Hv,qv,Kv=["width","height","type"],Gv=c.default(_v)(Av||(Av=k([""]))),Wv=c.default.img(Iv||(Iv=k(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),Qv=jp,Xv=c.default.div(Tv||(Tv=k(["\n ","\n ","\n"])),Hh,qp),Yv=c.default.img(xv||(xv=k(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),Zv=c.default.div(Pv||(Pv=k(["\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"])),60,1020,Rs.isMobile?n.css(["top:",";"],(function(e){return e.y})):n.css(["bottom:","px;"],10)),$v=c.default.div(Rv||(Rv=k(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ","px;\n height: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),100,100,1020),Jv=c.default.div(Dv||(Dv=k(["\n color: #fff;\n text-align: center;\n"]))),ey=c.default.div(Nv||(Nv=k(["\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}),1020),ry=c.default.div(Lv||(Lv=k(["\n display: flex;\n align-items: center;\n"]))),ty=c.default(Jv)(Ov||(Ov=k(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),ny=c.default(Jv)(Mv||(Mv=k(["\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"])),1030),ay=c.default(Jv)(Uv||(Uv=k(["\n position: absolute;\n font-size: 16px;\n text-align: center;\n color: #fff;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),oy=c.default(ay)(Fv||(Fv=k(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),iy=c.default(Jv)(Vv||(Vv=k(["\n position: absolute;\n font-size: 18px;\n text-align: center;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),sy=(c.default.div(jv||(jv=k(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),function(e){var r=e.width,t=e.height,n=e.type,a=w(e,Kv),o=Bn.useAsset("id_card_frame.png"),s=Bn.useAsset("id_card_frame_error.png");return i.default.createElement(Xv,{width:r,height:t},i.default.createElement(Wv,{src:n===Sv.ERROR?s:o,width:r,height:t}),i.default.createElement(Gv,m({width:r,height:t,type:n},a)))}),cy={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"}},ly=D.IDCardMessage,uy=c.default.div(zv||(zv=k(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),dy=c.default.div(Hv||(Hv=k(["\n text-align: center;\n font-size: 1rem;\n"]))),fy=c.default.button(qv||(qv=k(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),hy=function(e){var r=e.onOk,t=e.maxSessionTime,n=zt.useSDKSettings().lang;return i.default.createElement(uy,null,i.default.createElement(dy,{className:"popup-message"},Cf(ly.TIMEOUT_INSTRUCTION[n])({x:t})),i.default.createElement(fy,{className:"popup-button",onClick:r},cy.BTN_OK[n]))};hy.propTypes={onOk:s.default.func,maxSessionTime:s.default.number},hy.defaultProps={onOk:function(){},maxSessionTime:30};var py=function(){var e=B(r.useState(!1),2),t=e[0],n=e[1],a=B(r.useState(null),2),o=a[0],i=a[1],s=B(r.useState({}),2),c=s[0],l=s[1];return{showPopup:r.useCallback((function(e){var r=e.popupType,t=e.props;l(void 0===t?{}:t),i(r),n(null!==r)}),[]),popupShown:t,popupType:o,props:c}},my="SESSION_TIMEOUT",gy="CONFIRM",vy="QR_INVALID",yy="QR_INSTRUCTIONS",by=D.Errors;function Cy(e,r){return Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2)}function wy(e,r){return Math.sqrt(Cy(e,r))}function ky(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.canvas,t=e.imgMargin,n=window,a=n.cv,o=r.width,i=r.height,s=t;s<1&&(s=parseInt(.5*(i+o)*s,10));var c=a.imread(r),l=new a.Mat;return a.copyMakeBorder(c,l,s,s,s,s,a.BORDER_CONSTANT,new a.Scalar(0,0,0,255)),c.delete(),{mat:l,margin:s}}function By(e,r){var t=window.cv,n=B(r.map((function(e){return e.location})),4),a=n[0],o=n[1],i=n[2],s=n[3],c=wy(i,s),l=wy(o,a),u=Math.max(c,l),d=wy(o,i),f=wy(a,s),h=Math.max(d,f),p=[a.x,a.y,o.x,o.y,i.x,i.y,s.x,s.y],m=[0,0,u-1,0,u-1,h-1,0,h-1],g=t.imread(e),v=new t.Mat,y=new t.Size(u,h),b=t.matFromArray(4,1,t.CV_32FC2,p),C=t.matFromArray(4,1,t.CV_32FC2,m),w=t.getPerspectiveTransform(b,C);t.warpPerspective(g,v,w,y,t.INTER_LINEAR,t.BORDER_CONSTANT,new t.Scalar);var k=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),C.delete(),k}function Ey(e,r,t){var n={x:r.x-e.x,y:r.y-e.y},a={x:t.x-e.x,y:t.y-e.y},o=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),i=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));return 180*Math.acos((n.x*a.x+n.y*a.y)/(o*i))/Math.PI}function Sy(e){var r=e.corners,t=e.width,n=e.height,a=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;r.forEach((function(e){var r=e.location,t=r.x,n=r.y;a=Math.min(a,t),o=Math.min(o,n),i=Math.max(i,t),s=Math.max(s,n)}));var c=.02;return a/t>=c&&o/n>=c&&(n-s)/n>=c&&(t-i)/t>=c}function _y(){return Ay.apply(this,arguments)}function Ay(){return(Ay=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,l,u,d,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=h.length>0&&void 0!==h[0]?h[0]:{},t=r.canvas,n=r.paddingPercent,a=void 0===n?.04:n,o=t.width,i=t.height,s=Math.floor(o*a),c=Math.floor(i*a),l=o-2*s,u=i-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=l,d.height=u,f.drawImage(t,s,c,l,u,0,0,l,u),e.abrupt("return",yo.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Iy(e){for(var r=e.length,t=0;t<r;t++){var n=(t+r-1)%r,a=(t+1)%r,o=Ey(e[t].location,e[n].location,e[a].location);if(o<70||o>110)return!1}return!0}function Ty(e){return xy.apply(this,arguments)}function xy(){return(xy=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.blazefaceModel,n=r.predictedIdCardCanvas,a=r.frontSide,o=n.width,i=n.height,s=Math.floor(o/3),c=Math.floor(4*i/5),l=document.createElement("canvas"),u=l.getContext("2d"),l.width=s,l.height=c,u.drawImage(n,0,Math.floor(i/5),s,c,0,0,s,c),e.next=12,ma.getModelPredictions({model:t,sCanvas:l});case 12:if(d=e.sent,f=d.filter((function(e){var r=e.topLeft,t=e.bottomRight,n=B(e.probability,1)[0],a=e.landmarks;return!(n<.9||a.length<4)&&!(oa.rectAreaRatio({small:{coords:[r,t]},big:{coords:[[0,0],[ma.SIZE,ma.SIZE]]}})<.025)})),h=f.length,!a){e.next=22;break}if(0!==h){e.next=18;break}return e.abrupt("return",by.id_detector_error_front_side_no_faces);case 18:if(!(h>1)){e.next=20;break}return e.abrupt("return",by.id_detector_error_front_side_multiple_faces);case 20:e.next=24;break;case 22:if(!(h>0)){e.next=24;break}return e.abrupt("return",by.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 Py=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,h,p,m,g,v,y,b,C,w,k,S,_,A,I,T,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=r.currentWorkingCanvas,l=r.refVirtualWorkingCanvas,u=r.refCountVirtualFrames,d=r.refVirtualFrames,h=r.refWorkingCanvas,(p=r.refCardResult).current.corners&&Array.isArray(p.current.corners)){e.next=3;break}return e.abrupt("return");case 3:return m=B(p.current.corners,3),g=m[0],v=m[1],y=m[2],b=(null==v||null===(t=v.location)||void 0===t?void 0:t.x)-(null==g||null===(n=g.location)||void 0===n?void 0:n.x)-100,C=(null==y||null===(a=y.location)||void 0===a?void 0:a.y)-(null==v||null===(o=v.location)||void 0===o?void 0:o.y)-100,w=performance.now(),(k=l.current).width=b,k.height=C,(S=k.getContext("2d")).drawImage(c,(null==g||null===(i=g.location)||void 0===i?void 0:i.x)+50,(null==g||null===(s=g.location)||void 0===s?void 0:s.y)+50,b,C,0,0,b,C),e.next=14,new Promise((function(e){k.toBlob(function(){var r=f(regeneratorRuntime.mark((function r(t){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,fn.MD5({blob:t});case 2:n=r.sent,d.current=[].concat(E(d.current),[n]),e();case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}));case 14:return w=Math.floor(performance.now()-w),_=180-w>0?180-w:0,e.next=18,new Promise((function(e){return setTimeout(e,_)}));case 18:if(!(u.current<3)){e.next=29;break}return T=performance.now(),x=h.current,S.drawImage(x,(null==g||null===(A=g.location)||void 0===A?void 0:A.x)+50,(null==g||null===(I=g.location)||void 0===I?void 0:I.y)+50,b,C,0,0,b,C),e.next=24,new Promise((function(e){k.toBlob(function(){var r=f(regeneratorRuntime.mark((function r(t){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,fn.MD5({blob:t});case 2:n=r.sent,d.current=[].concat(E(d.current),[n]),e();case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}));case 24:if(!(u.current<2)){e.next=26;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T=Math.floor(performance.now()-T),r=180-T>0?180-T:0,e.next=4,new Promise((function(e){return setTimeout(e,r)}));case 4:case"end":return e.stop()}}),e)}))(),"t0",26);case 26:u.current+=1,e.next=18;break;case 29:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();var Ry=function(e,r,t){return e==e&&(void 0!==t&&(e=e<=t?e:t),void 0!==r&&(e=e>=r?e:r)),e};var Dy=function(e,r,t){return void 0===t&&(t=r,r=void 0),void 0!==t&&(t=(t=Gu(t))==t?t:0),void 0!==r&&(r=(r=Gu(r))==r?r:0),Ry(Gu(e),r,t)},Ny="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function Ly(){return(Ly=f(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.url,n=void 0===t?Ny:t,e.abrupt("return",new Promise((function(e,r){var t=document.createElement("script");t.setAttribute("async",""),t.setAttribute("type","text/javascript"),t.setAttribute("id","opencvjs"),t.addEventListener("load",f(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!window.cv||!window.cv.getBuildInformation){r.next=4;break}e(),r.next=12;break;case 4:if(!(window.cv instanceof Promise)){r.next=11;break}return r.next=7,window.cv;case 7:window.cv=r.sent,e(),r.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return r.stop()}}),r)})))),t.addEventListener("error",(function(){r()})),t.src=n;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(t,a)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Oy=Af((function(){return Ly.apply(this,arguments)})),My={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"},Uy={vn:.4,ph:.5},Fy={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 Vy(e){var r,t,n,a,o,i=e.card,s=e.corners,c=i.box,l={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},u=c[2]-c[0],d=c[1]-c[3],f=x(s);try{for(f.s();!(o=f.n()).done;){var h=o.value;switch(h.label){case"top-left":r||(r=h.location);break;case"top-right":t||(t=h.location);break;case"bottom-right":n||(n=h.location);break;case"bottom-left":a||(a=h.location)}}}catch(e){f.e(e)}finally{f.f()}if(![r,t,n,a].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var p={x:(r.x+n.x)/2,y:(r.y+n.y)/2},m={x:(t.x+a.x)/2,y:(t.y+a.y)/2},g=Cy(l,p),v=Cy(l,m);return Math.sqrt(g)>(u+d)/8||Math.sqrt(v)>(u+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var jy=function(){function e(r){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.country=r||"vn",this.defaultModelUrl=My[this.country]||My.vn}var r,t,n,a,o,i,s,c,l,u;return r=e,(t=[{key:"load",value:(u=f(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.opencvUrl,n=r.modelUrl,e.next=3,Promise.all([Oy({url:t}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"predictDummyInput",value:(l=f(regeneratorRuntime.mark((function e(){var r,t,n,a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=window,t=r.tf,n=t.tidy((function(){var e=t.zeros(a.inputShape,"float32");return a.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 l.apply(this,arguments)})},{key:"loadModel",value:(c=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>0&&void 0!==s[0]?s[0]:{},t=r.modelUrl,n=void 0===t?this.defaultModelUrl:t,e.next=3,ei.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,ei.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,a=this.model.inputs,this.inputShape=a[0].shape,o=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),i=B(o,3),this.out_score_name=i[0],this.out_class_name=i[1],this.out_box_name=i[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"loadResource",value:(s=f(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.modelUrl,n=void 0===t?this.defaultModelUrl:t,e.next=3,ei.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"dispose",value:(i=f(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 i.apply(this,arguments)})},{key:"predict",value:(o=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h,p,m,g,v,y,b,C,w,k,E,S,_,A,I,T,x,P,R,D=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=D.length>1&&void 0!==D[1]?D[1]:{},n=t.imgMargin,a=t.detectThreshold,o=void 0===a?.3:a,i=t.maxNumReturns,s=void 0===i?100:i,c=window,l=c.cv,u={},d=r.width,f=r.height,u.originalWidth=d,u.originalHeight=f,h=ky({canvas:r,imgMargin:"number"==typeof n?n:Uy[this.country]}),p=h.margin,m=h.mat,g=this.inputShape.slice(1,3),v=B(g,2),y=v[0],b=v[1],C=new l.Mat,l.resize(m,C,new l.Size(y,b),0,0,l.INTER_AREA),w=m.cols/y,k=m.rows/b,(E=document.createElement("canvas")).width=y,E.height=b,E.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(C.data),C.cols,C.rows),0,0),m.delete(),C.delete(),u.canvas=E,u.margin=p,S=performance.now(),e.next=25,this.detect(E,{detectThreshold:o,maxNumReturns:s});case 25:if(_=e.sent,A=Math.floor(performance.now()-S),I={inputImage:u,card:null,exeTime:A},T=[[],[],[],[]],x=[],P=[],_.forEach((function(e){var r=B(e.box,4),t=r[0],n=r[1],a=r[2],o=r[3];e.clazz<=3?T[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:Dy(Math.floor((o+n)/2*w-p),0,d),y:Dy(Math.floor((t+a)/2*k-p),0,f)},scaledLocation:{x:Dy(Math.floor((o+n)/2),0,E.width),y:Dy(Math.floor((t+a)/2),0,E.height)}}):P.push({label:e.label,score:e.score,box:[Dy(Math.floor(t*k-p),0,f),Dy(Math.floor(n*w-p),0,d),Dy(Math.floor(a*k-p),0,f),Dy(Math.floor(o*w-p),0,d)]})})),T.forEach((function(e){e.length&&(e.sort((function(e,r){return r.score-e.score})),x.push(e[0]))})),!(P.length>0&&4===x.length)){e.next=49;break}if(P.sort((function(e,r){return r.score-e.score})),x.sort((function(e,r){return e.clazz-r.clazz})),R=P[0],e.prev=37,Vy({card:R,corners:x})){e.next=41;break}return console.debug("Not qualified.",R,x),e.abrupt("return",I);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",I);case 46:return R.corners=x,I.card=R,e.abrupt("return",I);case 49:return e.abrupt("return",I);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return o.apply(this,arguments)})},{key:"detect",value:(a=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h,p,m,g,v,y,b,C,w,k,E,S,_=this,A=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=A.length>1&&void 0!==A[1]?A[1]:{},n=t.detectThreshold,a=t.maxNumReturns,o=window,i=o.tf,s=r.width,c=r.height,l=i.tidy((function(){var e=i.expandDims(i.cast(i.image.resizeBilinear(i.browser.fromPixels(r),_.inputShape.slice(1,3)),"float32"));return _.model.predict(e)})),e.next=7,Promise.all([l[this.out_score_name].data(),l[this.out_class_name].data(),l[this.out_box_name].array()]);case 7:u=e.sent,d=B(u,3),f=d[0],h=d[1],p=B(d[2],1),m=p[0],g=Math.min(f.length,a),v=[];try{for(y=0;y<g;y++)b=f[y],C=h[y],b>n&&(k=null!==(w=Fy[Math.round(C)])&&void 0!==w?w:"NA",E=m[y],S=[E[0]*c,E[3]*s,E[2]*c,E[1]*s],v.push({score:b,clazz:C,box:S,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 a.apply(this,arguments)})}])&&h(r.prototype,t),n&&h(r,n),e}();class zy{static hasCamera(){return zy.listCameras(!1).then((e=>!!e.length)).catch((()=>!1))}static listCameras(e=!1){if(!navigator.mediaDevices)return Promise.resolve([]);let r=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((e=>r=e)).catch((()=>{})):Promise.resolve()).then((()=>navigator.mediaDevices.enumerateDevices())).then((e=>e.filter((e=>"videoinput"===e.kind)).map(((e,r)=>({id:e.deviceId,label:e.label||(0===r?"Default Camera":`Camera ${r+1}`)}))))).finally((()=>{if(r)for(const e of r.getTracks())e.stop(),r.removeTrack(e)}))}constructor(e,r,t=this._onDecodeError,n=this._calculateScanRegion,a="environment"){this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=r,this._legacyCanvasSize=zy.DEFAULT_CANVAS_SIZE,this._preferredCamera=a,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof t?(this._legacyCanvasSize=t,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=t,"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 o=!1;e.hidden&&(e.hidden=!1,o=!0),document.body.contains(e)||(document.body.appendChild(e),o=!0),requestAnimationFrame((()=>{const r=window.getComputedStyle(e);"none"===r.display&&(e.style.setProperty("display","block","important"),o=!0),"visible"!==r.visibility&&(e.style.setProperty("visibility","visible","important"),o=!0),o&&(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=zy.createQrEngine()}hasFlash(){let e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((({stream:r})=>(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=r,r.getVideoTracks()[0])))).then((e=>"torch"in e.getSettings())).catch((()=>!1)).finally((()=>{if(e)for(const r of e.getTracks())r.stop(),e.removeTrack(r)}))}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(),zy._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:r})=>{this.$video.srcObject=e,this.$video.play(),this._setVideoMirror(r),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 r=()=>{const e=this.$video.srcObject?this.$video.srcObject.getTracks():[];for(const r of e)r.stop(),this.$video.srcObject.removeTrack(r);this.$video.srcObject=null};return e?(r(),Promise.resolve(!0)):new Promise((e=>setTimeout(e,300))).then((()=>!!this._paused&&(r(),!0)))}setCamera(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}static scanImage(e,r=null,t=null,n=null,a=!1,o=!1){const i=t instanceof Worker;let s=Promise.all([t||zy.createQrEngine(),zy._loadImage(e)]).then((([e,o])=>{let s;return t=e,[n,s]=this._drawToCanvas(o,r,n,a),t instanceof Worker?(i||t.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,r)=>{let a,o,i;o=n=>{"qrResult"===n.data.type&&(t.removeEventListener("message",o),t.removeEventListener("error",i),clearTimeout(a),null!==n.data.data?e(n.data.data):r(zy.NO_QR_CODE_FOUND))},i=e=>{t.removeEventListener("message",o),t.removeEventListener("error",i),clearTimeout(a);const n=e?e.message||e:"Unknown Error";r("Scanner error: "+n)},t.addEventListener("message",o),t.addEventListener("error",i),a=setTimeout((()=>i("timeout")),1e4);const c=s.getImageData(0,0,n.width,n.height);t.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise(((e,r)=>{const a=setTimeout((()=>r("Scanner error: timeout")),1e4);t.detect(n).then((t=>{t.length?e(t[0].rawValue):r(zy.NO_QR_CODE_FOUND)})).catch((e=>r("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(a)))}))}));return r&&o&&(s=s.catch((()=>zy.scanImage(e,null,t,n,a)))),s=s.finally((()=>{i||zy._postWorkerMessage(t,"close")})),s}setGrayscaleWeights(e,r,t,n=!0){zy._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:r,blue:t,useIntegerApproximation:n})}setInversionMode(e){zy._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=zy.WORKER_PATH){return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((r=>-1!==r.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 r=Math.min(e.videoWidth,e.videoHeight),t=Math.round(2/3*r);return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,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=>zy.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=zy.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==zy.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",r=[{width:{min:1024}},{width:{min:768}},{}];return[...r.map((r=>Object.assign({},r,{[e]:{exact:this._preferredCamera}}))),...r].reduceRight(((e,r)=>()=>navigator.mediaDevices.getUserMedia({video:r,audio:!1}).then((e=>({stream:e,facingMode:this._getFacingMode(e)||(r.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((r=>{if(r&&!e&&this._active)return this.start()}))}_setVideoMirror(e){const r="user"===e?-1:1;this.$video.style.transform="scaleX("+r+")"}_getFacingMode(e){const r=e.getVideoTracks()[0];return r?/rear|back|environment/i.test(r.label)?"environment":/front|user|face/i.test(r.label)?"user":null:null}static _drawToCanvas(e,r=null,t=null,n=!1){t=t||document.createElement("canvas");const a=r&&r.x?r.x:0,o=r&&r.y?r.y:0,i=r&&r.width?r.width:e.width||e.videoWidth,s=r&&r.height?r.height:e.height||e.videoHeight;if(!n){const e=r&&r.downScaledWidth?r.downScaledWidth:i,n=r&&r.downScaledHeight?r.downScaledHeight:s;t.width!==e&&(t.width=e),t.height!==n&&(t.height=n)}const c=t.getContext("2d",{alpha:!1});return c.imageSmoothingEnabled=!1,c.drawImage(e,a,o,i,s,0,0,t.width,t.height),[t,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 zy._awaitImageLoad(e).then((()=>e));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){const r=new Image;return e instanceof File||e instanceof Blob?r.src=URL.createObjectURL(e):r.src=e,zy._awaitImageLoad(r).then((()=>((e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(r.src),r)))}return Promise.reject("Unsupported image type.")}static _awaitImageLoad(e){return new Promise(((r,t)=>{if(e.complete&&0!==e.naturalWidth)r();else{let n,a;n=()=>{e.removeEventListener("load",n),e.removeEventListener("error",a),r()},a=()=>{e.removeEventListener("load",n),e.removeEventListener("error",a),t("Image load error")},e.addEventListener("load",n),e.addEventListener("error",a)}}))}static _postWorkerMessage(e,r,t){return Promise.resolve(e).then((e=>{e instanceof Worker&&e.postMessage({type:r,data:t})}))}}function Hy(){return qy.apply(this,arguments)}function qy(){return(qy=f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return zy.WORKER_PATH=_s(),e.next=3,zy.createQrEngine(zy.WORKER_PATH);case 3:return r=e.sent,e.abrupt("return",{qrEngine:r});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ky(){return Gy.apply(this,arguments)}function Gy(){return(Gy=f(regeneratorRuntime.mark((function e(){var r,t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([Hy()]);case 2:return r=e.sent,t=B(r,1),n=t[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)}zy.DEFAULT_CANVAS_SIZE=400,zy.NO_QR_CODE_FOUND="No QR code found",zy.WORKER_PATH="qr-scanner-worker.min.js";var Wy="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function Qy(){return(Qy=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=f(regeneratorRuntime.mark((function e(){var r,t,n,i,s,c,l,u,d,f,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="detect.prototxt",t="detect.caffemodel",n="sr.prototxt",i="sr.caffemodel",a){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return l=[o(r),o(t),o(n),o(i)],e.next=11,Promise.all(l);case 11:u=e.sent,d=B(u,4),f=d[0],h=d[1],p=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",h,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",p,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),a=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return s.apply(this,arguments)},r=c.length>0&&void 0!==c[0]?c[0]:{},t=r.modelUrl,n=void 0===t?Wy:t,o=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(r));case 2:return t=e.sent,e.next=5,t.arrayBuffer();case 5:return a=e.sent,e.abrupt("return",new Uint8Array(a));case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,i();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",Ky());case 13:return e.abrupt("return",{qrModel:a});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var Xy=Af((function(){return Qy.apply(this,arguments)}));function Yy(e){return Zy.apply(this,arguments)}function Zy(){return(Zy=f(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.idCardModel,e.abrupt("return",new Promise((function(e,r){setTimeout(r,900),t.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $y(e){return Jy.apply(this,arguments)}function Jy(){return(Jy=f(regeneratorRuntime.mark((function e(r){var t,n,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.idCardModel,n=!0,e.prev=2,a=performance.now(),e.next=6,Yy({idCardModel:t});case 6:(o=performance.now())-a+.6*(o-a)>900&&(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 eb(){return(eb=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,l,u,d,f,h,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p.length>0&&void 0!==p[0]?p[0]:{},t=r.opencvUrl,n=r.idCardModelUrl,a=r.blazefaceModelUrl,o=r.tfScriptUrls,i=r.wechatQRModelsUrl,s=p.length>1?p[1]:void 0,e.next=4,Pf({blazefaceModelUrl:a,tfScriptUrls:o});case 4:return c=e.sent,l=c.blazefaceModel,u=!0,d=new jy(s),e.prev=8,e.next=11,d.load({opencvUrl:t,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,Xy({modelUrl:i});case 18:return e.prev=18,e.next=21,$y({idCardModel:d});case 21:f=e.sent,h=f.fastEnough,u=h,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),u=!1;case 29:return e.abrupt("return",{ableToUseModel:u,idCardModel:d,blazefaceModel:l});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var rb=Af((function(){return eb.apply(this,arguments)})),tb=D.Errors;function nb(e){var t=e.refVideo,n=e.shouldStart,a=e.cropArea,o=e.settings,i=r.useRef(null);null===i.current&&(i.current=document.createElement("canvas"));var s=r.useRef(!1),c=r.useRef(po.createResizer({width:960,height:640})),l=r.useRef(null),u=r.useRef([{id:null,frames:[]}]),d=r.useCallback((function(){!0===s.current&&(s.current=!1)}),[]),h=r.useCallback((function(){u.current=[{id:null,frames:[]}]}),[]),p=r.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),m=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=r.workingCanvas,n=c.current,a=u.current,i=n.resize({srcCanvas:t}),s=i.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:s});case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[o]),g=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,n,a,c,u,d,f,h,p,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?180:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:a=l.current,c=t.current,s.current=!0,u=a.cropX,d=a.cropY,f=a.cropWidth,h=a.cropHeight,(p=i.current).width=f,p.height=h,g=p.getContext("2d");case 13:return v=performance.now(),g.drawImage(c,u,d,f,h,0,0,f,h),e.next=18,m({workingCanvas:p});case 18:if(v=Math.floor(performance.now()-v),s.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,Sn.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,m,o]);return r.useEffect((function(){var e=t.current;function r(){return(r=f(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return l.current=Zn.analyzeVideoAndWindowSizes(e,a),r.next=3,g();case 3:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return n&&a&&function(){r.apply(this,arguments)}(),function(){d()}}),[n,a,t,d,p,g]),{refWorkingCanvas:i,stopCheckFrame:d,splitVideos:p,resetRecordedVideos:h,checkFrame:g,refRecordedVideos:u}}var ab=function(e){var t=e.lang,n=e.onAboutToTimeout,a=e.onSessionTimeout,o=e.onVideoTimeLimitReached,i=e.settings,s=e.shouldStartTimers,c=e.sessionTime,l=r.useRef(),u=B(r.useState(0),2),d=u[0],f=u[1],h=r.useCallback((function(){clearInterval(l.current)}),[]),p=r.useCallback((function(){f((function(e){return e+1}))}),[]);return r.useEffect((function(){if(s){var e=i.maxRecordingTimePerVideo,r=0,t=c/3;l.current=setInterval((function(){var i=c-(r+=1);i<=t&&n&&n({curTimeLeft:i}),r>0&&r%e==0&&o&&o(),0===i&&(h(),a&&a())}),1e3)}return function(){h()}}),[s,t,n,h,a,o,d,i,c]),{stopTimers:h,startTimers:p}};ws.initExifData();var ob,ib,sb,cb=function(e){var t=e.shouldStart,n=e.refVideo,a=e.cropArea,o=e.settings,i=e.onModelErrorChange,s=e.frontSide,c=e.onDebugInfoChange,l=e.onAboutToTimeout,u=e.onSessionTimeout,d=e.onCaptureDone,h=e.outputEncryptionSettings,m=e.quality,g=r.useRef(!1),y=B(r.useState(!1),2),b=y[0],C=y[1],w=r.useRef((function(){})),k=Cn.useSDKTracking().sendEvent,E=r.useRef(),S=r.useRef(),_=r.useRef(),A=zt.useSDKSettings(),I=A.debug,T=A.lang,x=A.enableAntiDebug,P=Ss(),R=P.startMotion,D=P.stopMotion,N=P.motionData,L=P.orientationData;r.useEffect((function(){x&&ri.enableAntiDebug()}),[x]);var O=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k({tag:s?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,w.current(r);case 3:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[k,s]),M=r.useCallback((function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];i.apply(void 0,r);var n=hu(r,"0.code");n&&n!==E.current&&(k({tag:s?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),E.current=n)}),[i,s,k]),U=function(e){var t=e.refVideo,n=e.shouldStart,a=e.cropArea,o=e.settings,i=e.onError,s=e.frontSide,c=e.onAutoCaptureSuccess,l=e.quality,u=r.useRef(null);null===u.current&&(u.current=document.createElement("canvas"));var d=r.useRef(0),h=r.useRef([]),p=r.useRef(null);null===p.current&&(p.current=document.createElement("canvas"));var m=r.useRef({}),g=r.useRef(!1),v=r.useRef(null),y=B(r.useState(!1),2),b=y[0],C=y[1],w=r.useRef({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),k=r.useRef({imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}),E=r.useRef(!1),S=r.useRef(!1),_=r.useRef(null),A=r.useRef(!1),I=r.useRef({}),T=zt.useSDKSettings(),x=T.customUrls,P=T.country;r.useEffect((function(){var e=!1;function r(){return(r=f(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!o||b){r.next=14;break}if(!o.enableIdDetection){r.next=10;break}return r.next=4,rb(x,P);case 4:return I.current=r.sent,r.next=7,ei.initTensorFlow();case 7:_.current=o.enableBlurCheck&&I.current.ableToUseModel,r.next=11;break;case 10:_.current=!1;case 11:if(!e){r.next=13;break}return r.abrupt("return");case 13:C(!0);case 14:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){e=!0}}),[b,o,x,P]);var R=r.useCallback((function(e){return Py({currentWorkingCanvas:e,refVirtualWorkingCanvas:p,refCountVirtualFrames:d,refVirtualFrames:h,refWorkingCanvas:u,refCardResult:m})}),[]),D=r.useCallback((function(){!0===g.current&&(g.current=!1)}),[]),N=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blurScore,n=r.detectedCard,a=o.blurThreshold,i=w.current,s=k.current,!(t<a&&Xn.hasBetterCardBlurScore(t,i.blurScore))){e.next=17;break}if(!A.current){e.next=9;break}i.imageBlob=s.imageBlob,e.next=13;break;case 9:return e.next=11,Zn.takePicture({canvas:u.current,quality:l});case 11:i.imageBlob=e.sent,i.captureTime=Date.now();case 13:i.takenAt=(new Date).getTime(),i.blurScore=t,i.detectedCard=n,i.captureType="auto";case 17:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[o,l]),L=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blurScore,n=r.detectedCard,S.current=!0,a=k.current,!Xn.hasBetterCardBlurScore(t,a.blurScore)){e.next=14;break}return e.next=6,Zn.takePicture({canvas:u.current,quality:l});case 6:a.imageBlob=e.sent,a.captureDuration+=Date.now()-a.captureTime,a.captureTime=Date.now(),a.blurScore=t,a.detectedCard=n,a.captureCount++,a.captureType="manual",A.current=!0;case 14:S.current=!1;case 15:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[l]),O=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.waitForBestImageTimeMs,null===(t=w.current).imageBlob){e.next=8;break}if(!((new Date).getTime()-t.takenAt>r)){e.next=8;break}return e.next=7,c(t);case 7:D();case 8:case"end":return e.stop()}}),e)}))),[c,o,D]),M=r.useCallback((function(){E.current=!0}),[]),U=r.useCallback((function(){return new Promise((function(e){E.current=!1;var r=setInterval((function(){S.current||(clearInterval(r),e())}),150)}))}),[]),F=r.useCallback(f(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 r=o.blurThreshold,t=o.enableVirtualCamHashes,n=k.current;n.captureTime=Date.now(),_.current?(M(),setTimeout((function(){U().then(f(regeneratorRuntime.mark((function a(){var o;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(Xn.hasBetterCardBlurScore(n.blurScore,r)||(n.error=tb.id_detector_error_blur),o=u.current,null!==n.imageBlob){a.next=6;break}Zn.takePicture({canvas:o,quality:l}).then(function(){var r=f(regeneratorRuntime.mark((function r(a){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n.imageBlob=a,n.captureTime=Date.now(),!t){r.next=5;break}return r.next=5,R(o);case 5:e(n);case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()),a.next=10;break;case 6:if(!t){a.next=9;break}return a.next=9,R(o);case 9:e(n);case 10:case"end":return a.stop()}}),a)}))))}),2e3)):Zn.takePicture({canvas:u.current,quality:l}).then(function(){var r=f(regeneratorRuntime.mark((function r(a){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n.imageBlob=a,n.captureTime=Date.now(),!t){r.next=5;break}return r.next=5,R(u.current);case 5:e(n);case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),[o,M,U,l,R]),V=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,n,a,c,l,p,y,C,B,S,_,T,x,R,D,M,U,F,V,j;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&b&&!g.current){e.next=2;break}return e.abrupt("return");case 2:w.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},k.current={imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0},r=o.enableAutoCapture,n=o.enableBlurCheck,a=o.enableIdDetection,c=I.current,l=c.idCardModel,p=c.blazefaceModel,y=c.ableToUseModel,C=v.current,B=t.current,g.current=!0,S=C.cropX,_=C.cropY,T=C.cropWidth,x=C.cropHeight,R=C.cropWidthWithoutPadding,D=C.cropHeightWithoutPadding,(M=u.current).width=T,M.height=x,U=M.getContext("2d"),F=document.createElement("canvas"),V=F.getContext("2d"),j=function(){var e=f(regeneratorRuntime.mark((function e(){var t,o,c,u,f,v,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(U.drawImage(B,S,_,T,x,0,0,T,x),t=performance.now(),A.current=!1,!a||!y){e.next=60;break}return o=null,e.next=7,l.predict(M,{detectThreshold:.3});case 7:if(!(c=e.sent).card){e.next=56;break}if(m.current=c.card,!k.current.imageBlob&&h.current.length>0&&(h.current=[],d.current=0),!Sy({corners:c.card.corners,width:T,height:x})){e.next=53;break}if(!Iy(c.card.corners)){e.next=50;break}if(u=By(M,c.card.corners),!((f=oa.rectAreaRatio({small:{area:u.width*u.height},big:{area:R*D}}))<.5)){e.next=21;break}o=tb.id_detector_card_too_small,e.next=48;break;case 21:if(!(f>.95)){e.next=25;break}o=tb.id_detector_error_incomplete,e.next=48;break;case 25:return F.width=u.width,F.height=u.height,V.putImageData(u,0,0),e.next=30,_y({canvas:F});case 30:if(!e.sent){e.next=35;break}o=tb.glare_detected,e.next=48;break;case 35:if("ph"===P){e.next=39;break}return e.next=38,Ty({blazefaceModel:p,predictedIdCardCanvas:F,frontSide:s});case 38:o=e.sent;case 39:if(o){e.next=48;break}if(!n){e.next=48;break}if(v=Xn.calculateIdCardBlurScore({canvas:F}),!E.current){e.next=45;break}return e.next=45,L({blurScore:v,detectedCard:c.card});case 45:if(!r){e.next=48;break}return e.next=48,N({blurScore:v,detectedCard:c.card});case 48:e.next=51;break;case 50:o=tb.id_detector_validate_angle_error;case 51:e.next=54;break;case 53:o=tb.id_detector_error_incomplete;case 54:e.next=57;break;case 56:o=tb.id_detector_no_cards;case 57:return i(o),e.next=60,O();case 60:return t=Math.floor(performance.now()-t),b=180-t>0?180-t:0,e.next=64,new Promise((function(e){return setTimeout(e,b)}));case 64:g.current&&window.requestAnimationFrame(j);case 65:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(j);case 19:case"end":return e.stop()}}),e)}))),[o,b,t,i,O,s,L,N,P]);r.useEffect((function(){var e=t.current;function r(){return(r=f(regeneratorRuntime.mark((function r(){var t,n,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(v.current=Zn.analyzeVideoAndWindowSizes(e,a,.05),t=v.current,n=t.cropWidth,o=t.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(n)&&!Number.isNaN(o)){r.next=4;break}return r.abrupt("return");case 4:return r.next=6,V();case 6:case"end":return r.stop()}}),r)})))).apply(this,arguments)}n&&a&&b&&function(){r.apply(this,arguments)}()}),[n,a,t,D,V,b]);var j=r.useCallback((function(){D()}),[D]);return r.useEffect((function(){return j}),[j]),{refWorkingCanvas:u,stopCheckFrame:D,checkFrame:V,warmupDone:b,takePictureManually:F,refAbleToRunBurstMode:_,refVirtualFrames:h}}({refVideo:n,shouldStart:t,cropArea:a,settings:o,onError:M,frontSide:s,onAutoCaptureSuccess:O,quality:m}),F=U.refWorkingCanvas,V=U.stopCheckFrame,j=U.checkFrame,z=U.warmupDone,H=U.takePictureManually,q=U.refAbleToRunBurstMode,K=U.refVirtualFrames,G=nb({refVideo:n,shouldStart:!1,cropArea:a,settings:o}),W=G.stopCheckFrame,Q=G.splitVideos,X=G.resetRecordedVideos,Y=G.checkFrame;!function(e){var t=e.debug,n=e.refRecordedVideos,a=e.refWorkingCanvas,o=e.refVideo,i=e.onChange;r.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,r=n.current,t=a.current,s=r[r.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==t?void 0:t.width,"canvas.height":null==t?void 0:t.height};i&&i(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[i,t,n,a,o])}({debug:I,refRecordedVideos:G.refRecordedVideos,refWorkingCanvas:F,refVideo:n,onChange:c});var Z=r.useCallback((function(){W(),V(),X(),u()}),[X,W,V,u]),$=r.useCallback((function(){Q()}),[Q]),J=ab({lang:T,onAboutToTimeout:l,onSessionTimeout:Z,onVideoTimeLimitReached:$,settings:o,shouldStartTimers:z&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),ee=J.stopTimers,re=J.startTimers,te=r.useCallback((function(){g.current=!1}),[]),ne=r.useCallback(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return te(),re(),e.next=4,Promise.all([Y(),j()]);case 4:case"end":return e.stop()}}),e)}))),[te,re,Y,j]),ae=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,t,n,a,i,c,l,u,f,m,y,b,w,B,E=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=E.length>0&&void 0!==E[0]?E[0]:{},t=r.imageBlob,n=r.error,a=r.detectedCard,i=r.captureTime,c=r.captureCount,l=r.captureDuration,u=r.captureType,!g.current){e.next=3;break}return e.abrupt("return");case 3:return g.current=!0,C(!0),W(),V(),ee(),M(null),f=null==o?void 0:o.enableVirtualCamHashes,m={},f&&(y=K).current.length>0&&(m=y.current.reduce((function(e,r,t){return v(v({},e),{},p({},"hash".concat(t+1),r))}),m)),D(),ws.preWriteExif({mode:ws.MODE.ID_CARD,motionData:N,orientationData:L,startTime:S.current,endTime:Date.now()}),e.next=16,ws.writeExif({mode:ws.MODE.ID_CARD,imageData:v(v({detectedCard:a,captureTime:i,blob:t},f?{vCam:m}:{}),{},{captureCount:c,captureDuration:l,captureType:u}),enableExifData:null==o?void 0:o.enableExifData});case 16:if(b=e.sent,!h||!h.key){e.next=22;break}return B=h.key,e.next=21,ai.encrypt({blob:b,key:B});case 21:w=e.sent;case 22:d({image:{blob:b,encrypted:w,detectedCard:a},error:n,recordedVideos:[]}),C(!1),k({tag:s?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-_.current)/1e3}});case 25:case"end":return e.stop()}}),e)}))),[W,V,ee,M,d,s,k,h,N,L,D,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,K]);w.current=ae;var oe=r.useCallback(f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C(!0),ee(),W(),q.current||V(),e.next=6,H();case 6:return r=e.sent,e.next=9,ae(r);case 9:C(!1),k({tag:s?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[H,ae,ee,q,W,V,k,s]);return r.useEffect((function(){t&&(k({tag:s?"id_front":"id_back",event:"user_activity.start",log:{}}),S.current=Date.now(),R())}),[k,s,t,R]),r.useEffect((function(){z&&(k({tag:s?"id_front":"id_back",event:"user_activity.show",log:{}}),k({tag:s?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-S.current}}),_.current=performance.now())}),[k,s,z]),{warmupDone:z,isProcessing:b,takePictureManually:oe,restartSession:ne,resetIsProcessingImageBlobTaken:te}},lb=D.IDCardMessage,ub=r.forwardRef((function(e,t){var n=e.description,a=e.usePortraitMask,o=e.windowAndVideoInfo,s=e.refVideo,c=e.frontSide,l=e.settings,u=e.onCaptureDone,d=e.onUISpacingChange,h=e.outputEncryptionSettings,p=B(r.useState({}),2),m=p[0],g=p[1],v=m.yDescription,y=m.yMessage,b=m.yCaptureButton,C=Bn.useAsset("ic_camera.svg"),w=Bn.useAsset("ic_loading.png"),k=B(r.useState(""),2),E=k[0],S=k[1],_=zt.useSDKSettings(),A=_.debug,I=_.lang,T=B(r.useState(null),2),x=T[0],P=T[1],R=B(r.useState(""),2),D=R[0],N=R[1],L=B(r.useState(null),2),O=L[0],M=L[1],U=py(),F=U.showPopup,V=U.popupShown,j=U.popupType,z=r.useCallback((function(e){N(null===e?"":Cf(e.msg[I])({side:c?cy.FRONT[I]:cy.BACK[I]}))}),[I,c]),H=r.useCallback((function(){P(""),F({popupType:my})}),[F]),q=r.useCallback((function(){P(""),u.apply(void 0,arguments)}),[u]),K=r.useCallback((function(e){var r=e.curTimeLeft;P(Cf(lb.REMAINING_TIME[I])({x:r}))}),[I]),G=cb({shouldStart:!0,refVideo:s,cropArea:O,settings:l,onModelErrorChange:z,frontSide:c,onDebugInfoChange:S,onSessionTimeout:H,onCaptureDone:q,onAboutToTimeout:K,outputEncryptionSettings:h}),W=G.warmupDone,Q=G.isProcessing,X=G.takePictureManually,Y=G.restartSession,Z=G.resetIsProcessingImageBlobTaken,$=r.useCallback((function(){F({popupType:null}),Z()}),[F,Z]),J=r.useCallback(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $(),e.next=3,Y();case 3:case"end":return e.stop()}}),e)}))),[Y,$]);r.useEffect((function(){if(o){var e,r,t,n,i,s,c,l=o.videoAreaWidth,u=o.videoAreaHeight,f=o.lostX,h=o.lostY,p=o.clientHeight;a?(i=.7*(s=u-165),t=(c=(e=h+10)+45)+20,n=(r=c+s+10)+60):(i=Rs.isMobile?l-6:Math.floor(.7*l),t=(c=(e=h+10)+50)+20,n=(r=c+(s=Math.floor(Math.min(i/1.5,p-2*h-80-100)))+10)+60);var m=Math.floor((l-i)/2)+f;M({x:m,y:c,width:i,height:s,surroundStyle:{opacity:.6,background:"#000"}});var v={yTitle:e,yDescription:r,yMessage:t,yCaptureButton:n};g(v),d(v)}}),[o,a,d]);var ee=r.useCallback(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P(""),e.next=3,X();case 3:case"end":return e.stop()}}),e)}))),[X]);return r.useImperativeHandle(t,(function(){return{restartSession:J}}),[J]),i.default.createElement(i.default.Fragment,null,!W&&i.default.createElement(Vh,null),A&&i.default.createElement(ny,null,E),Q&&i.default.createElement($v,null,i.default.createElement("img",{src:w,alt:"",className:"spin"})),O&&i.default.createElement(Lu,{x:"".concat(O.x,"px"),y:"".concat(O.y,"px"),width:"".concat(O.width,"px"),height:"".concat(O.height,"px"),surroundStyle:O.surroundStyle},i.default.createElement(sy,{width:O.width,height:O.height,type:D?Sv.ERROR:Sv.DEFAULT})),!D&&i.default.createElement(ay,{y:"".concat(v,"px"),className:"description"},n),D&&i.default.createElement(oy,{y:"".concat(v,"px")},D),!Q&&(!(null!=l&&l.disableCaptureButtonIfAlert)||!D)&&i.default.createElement(Zv,{onClick:ee,y:"".concat(b,"px")},i.default.createElement("img",{src:C,alt:""})),x&&i.default.createElement(iy,{key:x,className:"message",y:"".concat(y,"px")},x),i.default.createElement(Mh,{open:V},j===my&&i.default.createElement(hy,{onOk:J,maxSessionTime:null==l?void 0:l.idCardSessionTime})))}));ub.propTypes={usePortraitMask:s.default.bool,description:s.default.string,windowAndVideoInfo:s.default.shape({}),refVideo:s.default.shape({}),frontSide:s.default.bool,settings:s.default.shape({}),onCaptureDone:s.default.func,onUISpacingChange:s.default.func,outputEncryptionSettings:s.default.shape({})},ub.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var db,fb,hb=c.default.div(ob||(ob=k(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: 8px;\n top: ",";\n position: absolute;\n z-index: ",";\n color: #fff;\n padding: 10px;\n margin: 0 10px;\n max-width: 275px;\n text-align: center;\n"])),(function(e){return e.background}),(function(e){return e.y}),1020),pb=c.default.div(ib||(ib=k(["\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){return"".concat(e.arrowSize,"px solid ").concat(e.color)}),(function(e){return"".concat(e.top,"px")})),mb=function(e){var r=e.children,t=e.y;return i.default.createElement(hb,{y:t,background:"#00ce78"},i.default.createElement(pb,{arrowSize:10,top:-10,color:"#00ce78"}),r)},gb=c.default.div(sb||(sb=k(["\n text-align: center;\n position: absolute;\n font-size: 18px;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),vb={QR_INSTRUCTIONS_TEXT:{en:i.default.createElement("span",null,"Please follow the instructions below to scan QR code:",i.default.createElement("br",null),i.default.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:i.default.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",i.default.createElement("br",null),i.default.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:i.default.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",i.default.createElement("br",null),i.default.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",i.default.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:i.default.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",i.default.createElement("br",null),i.default.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",i.default.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"}},yb=function(e){var r=e.children,t=e.mt,n=e.mb,a=e.ml,o=e.mr,s=e.mx,c=e.my,l=e.pt,u=e.pb,d=e.pl,f=e.pr,h=e.px,p=e.py,m=r.props.style||{},g={};return null!==s&&(g.marginLeft=s,g.marginRight=s),null!==c&&(g.marginTop=c,g.marginBottom=c),null!==t&&(g.marginTop=t),null!==n&&(g.marginBottom=n),null!==a&&(g.marginLeft=a),null!==o&&(g.marginRight=o),null!==h&&(g.paddingLeft=h,g.paddingRight=h),null!==p&&(g.paddingTop=p,g.paddingBottom=p),null!==l&&(g.paddingTop=l),null!==u&&(g.paddingBottom=u),null!==d&&(g.paddingLeft=d),null!==f&&(g.paddingRight=f),i.default.cloneElement(r,{style:v(v({},m),g)})};yb.propTypes={mt:s.default.string,ml:s.default.string,mr:s.default.string,mb:s.default.string,mx:s.default.string,my:s.default.string,pt:s.default.string,pl:s.default.string,pr:s.default.string,pb:s.default.string,px:s.default.string,py:s.default.string},yb.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 bb,Cb,wb,kb=c.default.button(db||(db=k(["\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})),Bb=c.default.a(fb||(fb=k(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),Eb=c.default.div(bb||(bb=k(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Sb=c.default.div(Cb||(Cb=k(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),_b=c.default.div(wb||(wb=k(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),Ab=function(e){var r=e.onRetry,t=e.onSkip,n=zt.useSDKSettings().lang;return i.default.createElement(Eb,null,i.default.createElement(yb,{mt:"25px"},i.default.createElement(Sb,null,vb.QR_INVALID_POPUP_TITLE[n])),i.default.createElement(yb,{mt:"30px"},i.default.createElement(_b,null,vb.QR_INVALID_POPUP_DESCRIPTION[n])),i.default.createElement(yb,{mt:"30px"},i.default.createElement(kb,{onClick:r},vb.QR_INVALID_POPUP_RETRY_BUTTON[n])),i.default.createElement(yb,{my:"20px"},i.default.createElement(Bb,{onClick:t},vb.QR_INVALID_POPUP_SKIP_BUTTON[n])))};Ab.propTypes={onRetry:s.default.func,onSkip:s.default.func},Ab.defaultProps={onRetry:function(){},onSkip:function(){}};var Ib,Tb,xb,Pb,Rb,Db,Nb,Lb=["children","ratio","padding"],Ob=c.default.div(Ib||(Ib=k(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),Mb=c.default.div(Tb||(Tb=k(["\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})),Ub=function(e){var r=e.children,t=e.ratio,n=e.padding,a=w(e,Lb);return i.default.createElement(Ob,m({ratio:t},a),i.default.createElement(Mb,{padding:n},r))};Ub.propTypes={children:s.default.node,ratio:s.default.number,padding:s.default.string},Ub.defaultProps={children:null,ratio:4/3,padding:"0"};var Fb=c.default.div(xb||(xb=k(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Vb=c.default.div(Pb||(Pb=k(["\n background: #e7e6e6;\n width: 100%;\n"]))),jb=c.default.img(Rb||(Rb=k(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),zb=c.default.div(Db||(Db=k(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n line-height: 20px;\n"])),(function(e){return e.theme.tsSecondary})),Hb=c.default(zb)(Nb||(Nb=k(["\n white-space: nowrap;\n"]))),qb=function(e){var t=e.onClickStart,n=e.onTimeout,a=e.timeout,o=zt.useSDKSettings().lang,s=Bn.useAsset("qr_code_banner.png"),c=r.useRef(a),l=B(r.useState((function(){return Cf(vb.QR_INSTRUCTIONS_COUNTDOWN[o])({x:a})})),2),u=l[0],d=l[1],f=Cn.useSDKTracking().sendEvent,h=r.useRef(!1);r.useEffect((function(){f({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[f]),r.useEffect((function(){var e=Cf(vb.QR_INSTRUCTIONS_COUNTDOWN[o]),r=setInterval((function(){c.current--,d(e({x:c.current})),c.current<=0&&(clearInterval(r),h.current||f({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),n&&n())}),1e3);return function(){clearInterval(r)}}),[o,n]);return i.default.createElement(Fb,null,i.default.createElement(Vb,null,i.default.createElement(Ub,{ratio:1.6},i.default.createElement(jb,{src:s}))),i.default.createElement(yb,{mt:"30px"},i.default.createElement(zb,null,vb.QR_INSTRUCTIONS_TEXT[o])),i.default.createElement(yb,{mt:"30px"},i.default.createElement(kb,{onClick:function(){f({tag:"id_qr",event:"user_activity.click_start",log:{}}),h.current=!0,t()}},vb.QR_INSTRUCTIONS_START_BUTTON[o])),i.default.createElement(yb,{my:"20px"},i.default.createElement(Hb,null,u)))};qb.propTypes={onClickStart:s.default.func,onTimeout:s.default.func,timeout:s.default.number},qb.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var Kb=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function Gb(e){var r=e.canvas,t=e.qrModel,n=window.cv,a=n.imread(r,n.IMREAD_GRAYSCALE);return t.detectAndDecode(a).get(0)}var Wb=function(){var e=f(regeneratorRuntime.mark((function e(r,t){var n,a,o,i,s,c,l,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:if(n=e.sent,a=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return o=document.createElement("canvas"),i=o.getContext("2d"),e.next=11,new Promise((function(e){var t=URL.createObjectURL(r),n=new Image;n.onload=function(){var r=n.width,a=n.height;o.width=r/2,o.height=a/2,i.drawImage(n,r/2,0,o.width,o.height,0,0,o.width,o.height),URL.revokeObjectURL(t),e()},n.src=t}));case 11:return e.next=13,Gb({canvas:o,qrModel:a});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,ws.writeExif({mode:"",imageData:{blob:r,result:s,type:"qr_from_front_image"},enableExifData:!0});case 18:if(c=e.sent,!t||!t.key){e.next=24;break}return u=t.key,e.next=23,ai.encrypt({imageBlobWithExif:c,key:u});case 23:l=e.sent;case 24:return e.abrupt("return",{result:s,validateResult:{valid:!0},image:{blob:c,encrypted:l}});case 25:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),Qb=xs(Ps((function(e,r){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=3)}([function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,r){this.width=r,this.height=e.length/r,this.data=e}return e.createEmpty=function(r,t){return new e(new Uint8ClampedArray(r*t),r)},e.prototype.get=function(e,r){return!(e<0||e>=this.width||r<0||r>=this.height||!this.data[r*this.width+e])},e.prototype.set=function(e,r,t){this.data[r*this.width+e]=t?1:0},e.prototype.setRegion=function(e,r,t,n,a){for(var o=r;o<r+n;o++)for(var i=e;i<e+t;i++)this.set(i,o,!!a)},e}();r.BitMatrix=n},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(2);r.addOrSubtractGF=function(e,r){return e^r};var a=function(){function e(e,r,t){this.primitive=e,this.size=r,this.generatorBase=t,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var a=1,o=0;o<this.size;o++)this.expTable[o]=a,(a*=2)>=this.size&&(a=(a^this.primitive)&this.size-1);for(o=0;o<this.size-1;o++)this.logTable[this.expTable[o]]=o;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,r){return 0===e||0===r?0:this.expTable[(this.logTable[e]+this.logTable[r])%(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,r){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===r)return this.zero;var t=new Uint8ClampedArray(e+1);return t[0]=r,new n.default(this,t)},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}();r.default=a},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=function(){function e(e,r){if(0===r.length)throw new Error("No coefficients.");this.field=e;var t=r.length;if(t>1&&0===r[0]){for(var n=1;n<t&&0===r[n];)n++;if(n===t)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(t-n);for(var a=0;a<this.coefficients.length;a++)this.coefficients[a]=r[n+a]}}else this.coefficients=r}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(r){var t;if(this.isZero())return r;if(r.isZero())return this;var a=this.coefficients,o=r.coefficients;a.length>o.length&&(a=(t=[o,a])[0],o=t[1]);for(var i=new Uint8ClampedArray(o.length),s=o.length-a.length,c=0;c<s;c++)i[c]=o[c];for(c=s;c<o.length;c++)i[c]=n.addOrSubtractGF(a[c-s],o[c]);return new e(this.field,i)},e.prototype.multiply=function(r){if(0===r)return this.field.zero;if(1===r)return this;for(var t=this.coefficients.length,n=new Uint8ClampedArray(t),a=0;a<t;a++)n[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,n)},e.prototype.multiplyPoly=function(r){if(this.isZero()||r.isZero())return this.field.zero;for(var t=this.coefficients,a=t.length,o=r.coefficients,i=o.length,s=new Uint8ClampedArray(a+i-1),c=0;c<a;c++)for(var l=t[c],u=0;u<i;u++)s[c+u]=n.addOrSubtractGF(s[c+u],this.field.multiply(l,o[u]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(r,t){if(r<0)throw new Error("Invalid degree less than 0");if(0===t)return this.field.zero;for(var n=this.coefficients.length,a=new Uint8ClampedArray(n+r),o=0;o<n;o++)a[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,a)},e.prototype.evaluateAt=function(e){var r=0;if(0===e)return this.getCoefficient(0);var t=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){r=n.addOrSubtractGF(r,e)})),r;r=this.coefficients[0];for(var a=1;a<t;a++)r=n.addOrSubtractGF(this.field.multiply(e,r),this.coefficients[a]);return r},e}();r.default=a},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(4),a=t(5),o=t(11),i=t(12);function s(e){var r=i.locate(e);if(!r)return null;for(var t=0,n=r;t<n.length;t++){var s=n[t],c=o.extract(e,s),l=a.decode(c.matrix);if(l)return{binaryData:l.bytes,data:l.text,chunks:l.chunks,version:l.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 l(e,r,t,a){void 0===a&&(a={});var o=c;Object.keys(o||{}).forEach((function(e){o[e]=a[e]||o[e]}));var i="attemptBoth"===o.inversionAttempts||"invertFirst"===o.inversionAttempts,l="onlyInvert"===o.inversionAttempts||"invertFirst"===o.inversionAttempts,u=n.binarize(e,r,t,i),d=u.binarized,f=u.inverted,h=s(l?f:d);return h||"attemptBoth"!==o.inversionAttempts&&"invertFirst"!==o.inversionAttempts||(h=s(l?d:f)),h}l.default=l,r.default=l},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0);function a(e,r,t){return e<r?r:e>t?t:e}var o=function(){function e(e,r){this.width=e,this.data=new Uint8ClampedArray(e*r)}return e.prototype.get=function(e,r){return this.data[r*this.width+e]},e.prototype.set=function(e,r,t){this.data[r*this.width+e]=t},e}();r.binarize=function(e,r,t,i){if(e.length!==r*t*4)throw new Error("Malformed data passed to binarizer.");for(var s=new o(r,t),c=0;c<r;c++)for(var l=0;l<t;l++){var u=e[4*(l*r+c)+0],d=e[4*(l*r+c)+1],f=e[4*(l*r+c)+2];s.set(c,l,.2126*u+.7152*d+.0722*f)}for(var h=Math.ceil(r/8),p=Math.ceil(t/8),m=new o(h,p),g=0;g<p;g++)for(var v=0;v<h;v++){var y=0,b=1/0,C=0;for(l=0;l<8;l++)for(c=0;c<8;c++){var w=s.get(8*v+c,8*g+l);y+=w,b=Math.min(b,w),C=Math.max(C,w)}var k=y/Math.pow(8,2);if(C-b<=24&&(k=b/2,g>0&&v>0)){var B=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<B&&(k=B)}m.set(v,g,k)}var E=n.BitMatrix.createEmpty(r,t),S=null;for(i&&(S=n.BitMatrix.createEmpty(r,t)),g=0;g<p;g++)for(v=0;v<h;v++){for(var _=a(v,2,h-3),A=a(g,2,p-3),I=(y=0,-2);I<=2;I++)for(var T=-2;T<=2;T++)y+=m.get(_+I,A+T);var x=y/25;for(I=0;I<8;I++)for(T=0;T<8;T++){c=8*v+I,l=8*g+T;var P=s.get(c,l);E.set(c,l,P<=x),i&&S.set(c,l,!(P<=x))}}return i?{binarized:E,inverted:S}:{binarized:E}}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0),a=t(6),o=t(9),i=t(10);function s(e,r){for(var t=e^r,n=0;t;)n++,t&=t-1;return n}function c(e,r){return r<<1|e}var l=[{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}}],u=[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,r,t){for(var a=u[t.dataMask],o=e.height,i=function(e){var r=17+4*e.versionNumber,t=n.BitMatrix.createEmpty(r,r);t.setRegion(0,0,9,9,!0),t.setRegion(r-8,0,8,9,!0),t.setRegion(0,r-8,9,8,!0);for(var a=0,o=e.alignmentPatternCenters;a<o.length;a++)for(var i=o[a],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var l=c[s];6===i&&6===l||6===i&&l===r-7||i===r-7&&6===l||t.setRegion(i-2,l-2,5,5,!0)}return t.setRegion(6,9,1,r-17,!0),t.setRegion(9,6,r-17,1,!0),e.versionNumber>6&&(t.setRegion(r-11,0,3,6,!0),t.setRegion(0,r-11,6,3,!0)),t}(r),s=[],l=0,d=0,f=!0,h=o-1;h>0;h-=2){6===h&&h--;for(var p=0;p<o;p++)for(var m=f?o-1-p:p,g=0;g<2;g++){var v=h-g;if(!i.get(v,m)){d++;var y=e.get(v,m);a({y:m,x:v})&&(y=!y),l=c(y,l),8===d&&(s.push(l),d=0,l=0)}}f=!f}return s}function f(e){var r=function(e){var r=e.height,t=Math.floor((r-17)/4);if(t<=6)return i.VERSIONS[t-1];for(var n=0,a=5;a>=0;a--)for(var o=r-9;o>=r-11;o--)n=c(e.get(o,a),n);var l=0;for(o=5;o>=0;o--)for(a=r-9;a>=r-11;a--)l=c(e.get(o,a),l);for(var u,d=1/0,f=0,h=i.VERSIONS;f<h.length;f++){var p=h[f];if(p.infoBits===n||p.infoBits===l)return p;var m=s(n,p.infoBits);m<d&&(u=p,d=m),(m=s(l,p.infoBits))<d&&(u=p,d=m)}return d<=3?u:void 0}(e);if(!r)return null;var t=function(e){for(var r=0,t=0;t<=8;t++)6!==t&&(r=c(e.get(t,8),r));for(var n=7;n>=0;n--)6!==n&&(r=c(e.get(8,n),r));var a=e.height,o=0;for(n=a-1;n>=a-7;n--)o=c(e.get(8,n),o);for(t=a-8;t<a;t++)o=c(e.get(t,8),o);for(var i=1/0,u=null,d=0,f=l;d<f.length;d++){var h=f[d],p=h.bits,m=h.formatInfo;if(p===r||p===o)return m;var g=s(r,p);g<i&&(u=m,i=g),r!==o&&(g=s(o,p))<i&&(u=m,i=g)}return i<=3?u:null}(e);if(!t)return null;var n=function(e,r,t){var n=r.errorCorrectionLevels[t],a=[],o=0;if(n.ecBlocks.forEach((function(e){for(var r=0;r<e.numBlocks;r++)a.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),o+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<o)return null;e=e.slice(0,o);for(var i=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<i;s++)for(var c=0,l=a;c<l.length;c++)l[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var u=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)a[u+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,h=a;f<h.length;f++)h[f].codewords.push(e.shift());return a}(d(e,r,t),r,t.errorCorrectionLevel);if(!n)return null;for(var u=n.reduce((function(e,r){return e+r.numDataCodewords}),0),f=new Uint8ClampedArray(u),h=0,p=0,m=n;p<m.length;p++){var g=m[p],v=o.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[h++]=v[y]}try{return a.decode(f,r.versionNumber)}catch(e){return null}}r.decode=function(e){if(null==e)return null;var r=f(e);if(r)return r;for(var t=0;t<e.width;t++)for(var n=t+1;n<e.height;n++)e.get(t,n)!==e.get(n,t)&&(e.set(t,n,!e.get(t,n)),e.set(n,t,!e.get(n,t)));return f(e)}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n,a,o=t(7),i=t(8);function s(e,r){for(var t=[],n="",a=[10,12,14][r],o=e.readBits(a);o>=3;){if((l=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var i=Math.floor(l/100),s=Math.floor(l/10)%10,c=l%10;t.push(48+i,48+s,48+c),n+=i.toString()+s.toString()+c.toString(),o-=3}if(2===o){if((l=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");i=Math.floor(l/10),s=l%10,t.push(48+i,48+s),n+=i.toString()+s.toString()}else if(1===o){var l;if((l=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");t.push(48+l),n+=l.toString()}return{bytes:t,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=r.Mode||(r.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"}(a||(a={}));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 l(e,r){for(var t=[],n="",a=[9,11,13][r],o=e.readBits(a);o>=2;){var i=e.readBits(11),s=Math.floor(i/45),l=i%45;t.push(c[s].charCodeAt(0),c[l].charCodeAt(0)),n+=c[s]+c[l],o-=2}return 1===o&&(s=e.readBits(6),t.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:t,text:n}}function u(e,r){for(var t=[],n="",a=[8,16,16][r],o=e.readBits(a),i=0;i<o;i++){var s=e.readBits(8);t.push(s)}try{n+=decodeURIComponent(t.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:t,text:n}}function d(e,r){for(var t=[],n="",a=[8,10,12][r],o=e.readBits(a),s=0;s<o;s++){var c=e.readBits(13),l=Math.floor(c/192)<<8|c%192;l+=l<7936?33088:49472,t.push(l>>8,255&l),n+=String.fromCharCode(i.shiftJISTable[l])}return{bytes:t,text:n}}r.decode=function(e,r){for(var t,i,c,f,h=new o.BitStream(e),p=r<=9?0:r<=26?1:2,m={text:"",bytes:[],chunks:[],version:r};h.available()>=4;){var g=h.readBits(4);if(g===a.Terminator)return m;if(g===a.ECI)0===h.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:h.readBits(7)}):0===h.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:h.readBits(14)}):0===h.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:h.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===a.Numeric){var v=s(h,p);m.text+=v.text,(t=m.bytes).push.apply(t,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===a.Alphanumeric){var y=l(h,p);m.text+=y.text,(i=m.bytes).push.apply(i,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===a.Byte){var b=u(h,p);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===a.Kanji){var C=d(h,p);m.text+=C.text,(f=m.bytes).push.apply(f,C.bytes),m.chunks.push({type:n.Kanji,bytes:C.bytes,text:C.text})}}if(0===h.available()||0===h.readBits(h.available()))return m}},function(e,r,t){Object.defineProperty(r,"__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 r=0;if(this.bitOffset>0){var t=8-this.bitOffset,n=e<t?e:t,a=255>>8-n<<(o=t-n);r=(this.bytes[this.byteOffset]&a)>>o,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)r=r<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var o;if(e>0)a=255>>(o=8-e)<<o,r=r<<e|(this.bytes[this.byteOffset]&a)>>o,this.bitOffset+=e}return r},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();r.BitStream=n},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.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,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=t(2);r.decode=function(e,r){var t=new Uint8ClampedArray(e.length);t.set(e);for(var o=new n.default(285,256,0),i=new a.default(o,t),s=new Uint8ClampedArray(r),c=!1,l=0;l<r;l++){var u=i.evaluateAt(o.exp(l+o.generatorBase));s[s.length-1-l]=u,0!==u&&(c=!0)}if(!c)return t;var d=new a.default(o,s),f=function(e,r,t,n){var a;r.degree()<t.degree()&&(r=(a=[t,r])[0],t=a[1]);for(var o=r,i=t,s=e.zero,c=e.one;i.degree()>=n/2;){var l=o,u=s;if(s=c,(o=i).isZero())return null;i=l;for(var d=e.zero,f=o.getCoefficient(o.degree()),h=e.inverse(f);i.degree()>=o.degree()&&!i.isZero();){var p=i.degree()-o.degree(),m=e.multiply(i.getCoefficient(i.degree()),h);d=d.addOrSubtract(e.buildMonomial(p,m)),i=i.addOrSubtract(o.multiplyByMonomial(p,m))}if(c=d.multiplyPoly(s).addOrSubtract(u),i.degree()>=o.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),i.multiply(v)]}(o,o.buildMonomial(r,1),d,r);if(null===f)return null;var h=function(e,r){var t=r.degree();if(1===t)return[r.getCoefficient(1)];for(var n=new Array(t),a=0,o=1;o<e.size&&a<t;o++)0===r.evaluateAt(o)&&(n[a]=e.inverse(o),a++);return a!==t?null:n}(o,f[0]);if(null==h)return null;for(var p=function(e,r,t){for(var a=t.length,o=new Array(a),i=0;i<a;i++){for(var s=e.inverse(t[i]),c=1,l=0;l<a;l++)i!==l&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(t[l],s))));o[i]=e.multiply(r.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(o[i]=e.multiply(o[i],s))}return o}(o,f[1],h),m=0;m<h.length;m++){var g=t.length-1-o.log(h[m]);if(g<0)return null;t[g]=n.addOrSubtractGF(t[g],p[m])}return t}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.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,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0);function a(e,r,t,n){var a=e.x-r.x+t.x-n.x,o=e.y-r.y+t.y-n.y;if(0===a&&0===o)return{a11:r.x-e.x,a12:r.y-e.y,a13:0,a21:t.x-r.x,a22:t.y-r.y,a23:0,a31:e.x,a32:e.y,a33:1};var i=r.x-t.x,s=n.x-t.x,c=r.y-t.y,l=n.y-t.y,u=i*l-s*c,d=(a*l-s*o)/u,f=(i*o-a*c)/u;return{a11:r.x-e.x+d*r.x,a12:r.y-e.y+d*r.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}}r.extract=function(e,r){for(var t=function(e,r,t,n){var o=a(e,r,t,n);return{a11:o.a22*o.a33-o.a23*o.a32,a12:o.a13*o.a32-o.a12*o.a33,a13:o.a12*o.a23-o.a13*o.a22,a21:o.a23*o.a31-o.a21*o.a33,a22:o.a11*o.a33-o.a13*o.a31,a23:o.a13*o.a21-o.a11*o.a23,a31:o.a21*o.a32-o.a22*o.a31,a32:o.a12*o.a31-o.a11*o.a32,a33:o.a11*o.a22-o.a12*o.a21}}({x:3.5,y:3.5},{x:r.dimension-3.5,y:3.5},{x:r.dimension-6.5,y:r.dimension-6.5},{x:3.5,y:r.dimension-3.5}),o=function(e,r){return{a11:e.a11*r.a11+e.a21*r.a12+e.a31*r.a13,a12:e.a12*r.a11+e.a22*r.a12+e.a32*r.a13,a13:e.a13*r.a11+e.a23*r.a12+e.a33*r.a13,a21:e.a11*r.a21+e.a21*r.a22+e.a31*r.a23,a22:e.a12*r.a21+e.a22*r.a22+e.a32*r.a23,a23:e.a13*r.a21+e.a23*r.a22+e.a33*r.a23,a31:e.a11*r.a31+e.a21*r.a32+e.a31*r.a33,a32:e.a12*r.a31+e.a22*r.a32+e.a32*r.a33,a33:e.a13*r.a31+e.a23*r.a32+e.a33*r.a33}}(a(r.topLeft,r.topRight,r.alignmentPattern,r.bottomLeft),t),i=n.BitMatrix.createEmpty(r.dimension,r.dimension),s=function(e,r){var t=o.a13*e+o.a23*r+o.a33;return{x:(o.a11*e+o.a21*r+o.a31)/t,y:(o.a12*e+o.a22*r+o.a32)/t}},c=0;c<r.dimension;c++)for(var l=0;l<r.dimension;l++){var u=s(l+.5,c+.5);i.set(l,c,e.get(Math.floor(u.x),Math.floor(u.y)))}return{matrix:i,mappingFunction:s}}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(e,r){return Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2))};function a(e){return e.reduce((function(e,r){return e+r}))}function o(e,r,t,a){var o,i,s,c,l=[{x:Math.floor(e.x),y:Math.floor(e.y)}],u=Math.abs(r.y-e.y)>Math.abs(r.x-e.x);u?(o=Math.floor(e.y),i=Math.floor(e.x),s=Math.floor(r.y),c=Math.floor(r.x)):(o=Math.floor(e.x),i=Math.floor(e.y),s=Math.floor(r.x),c=Math.floor(r.y));for(var d=Math.abs(s-o),f=Math.abs(c-i),h=Math.floor(-d/2),p=o<s?1:-1,m=i<c?1:-1,g=!0,v=o,y=i;v!==s+p;v+=p){var b=u?y:v,C=u?v:y;if(t.get(b,C)!==g&&(g=!g,l.push({x:b,y:C}),l.length===a+1))break;if((h+=f)>0){if(y===c)break;y+=m,h-=d}}for(var w=[],k=0;k<a;k++)l[k]&&l[k+1]?w.push(n(l[k],l[k+1])):w.push(0);return w}function i(e,r,t,n){var a,i=r.y-e.y,s=r.x-e.x,c=o(e,r,t,Math.ceil(n/2)),l=o(e,{x:e.x-s,y:e.y-i},t,Math.ceil(n/2)),u=c.shift()+l.shift()-1;return(a=l.concat(u)).concat.apply(a,c)}function s(e,r){var t=a(e)/a(r),n=0;return r.forEach((function(r,a){n+=Math.pow(e[a]-r*t,2)})),{averageSize:t,error:n}}function c(e,r,t){try{var n=i(e,{x:-1,y:e.y},t,r.length),a=i(e,{x:e.x,y:-1},t,r.length),o=i(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},t,r.length),c=i(e,{x:Math.min(t.width,e.x+e.y)+1,y:Math.min(t.height,e.y+e.x)+1},t,r.length),l=s(n,r),u=s(a,r),d=s(o,r),f=s(c,r),h=Math.sqrt(l.error*l.error+u.error*u.error+d.error*d.error+f.error*f.error),p=(l.averageSize+u.averageSize+d.averageSize+f.averageSize)/4;return h+(Math.pow(l.averageSize-p,2)+Math.pow(u.averageSize-p,2)+Math.pow(d.averageSize-p,2)+Math.pow(f.averageSize-p,2))/p}catch(e){return 1/0}}function l(e,r){for(var t=Math.round(r.x);e.get(t,Math.round(r.y));)t--;for(var n=Math.round(r.x);e.get(n,Math.round(r.y));)n++;for(var a=(t+n)/2,o=Math.round(r.y);e.get(Math.round(a),o);)o--;for(var i=Math.round(r.y);e.get(Math.round(a),i);)i++;return{x:a,y:(o+i)/2}}function u(e,r,t,o,s){var l,u,d;try{l=function(e,r,t,o){var s=(a(i(e,t,o,5))/7+a(i(e,r,o,5))/7+a(i(t,e,o,5))/7+a(i(r,e,o,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,r)/s),l=Math.round(n(e,t)/s),u=Math.floor((c+l)/2)+7;switch(u%4){case 0:u++;break;case 2:u--}return{dimension:u,moduleSize:s}}(o,t,s,e),u=l.dimension,d=l.moduleSize}catch(e){return null}var f=t.x-o.x+s.x,h=t.y-o.y+s.y,p=(n(o,s)+n(o,t))/2/d,m=1-3/p,g={x:o.x+m*(f-o.x),y:o.y+m*(h-o.y)},v=r.map((function(r){var t=(r.top.startX+r.top.endX+r.bottom.startX+r.bottom.endX)/4,o=(r.top.y+r.bottom.y+1)/2;if(e.get(Math.floor(t),Math.floor(o))){var i=[r.top.endX-r.top.startX,r.bottom.endX-r.bottom.startX,r.bottom.y-r.top.y+1];return a(i),{x:t,y:o,score:c({x:Math.floor(t),y:Math.floor(o)},[1,1,1],e)+n({x:t,y:o},g)}}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score}));return{alignmentPattern:p>=15&&v.length?v[0]:g,dimension:u}}r.locate=function(e){for(var r=[],t=[],o=[],i=[],s=function(n){for(var s=0,c=!1,l=[0,0,0,0,0],u=function(r){var o=e.get(r,n);if(o===c)s++;else{l=[l[1],l[2],l[3],l[4],s],s=1,c=o;var u=a(l)/7,d=Math.abs(l[0]-u)<u&&Math.abs(l[1]-u)<u&&Math.abs(l[2]-3*u)<3*u&&Math.abs(l[3]-u)<u&&Math.abs(l[4]-u)<u&&!o,f=a(l.slice(-3))/3,h=Math.abs(l[2]-f)<f&&Math.abs(l[3]-f)<f&&Math.abs(l[4]-f)<f&&o;if(d){var p=r-l[3]-l[4],m=p-l[2],g={startX:m,endX:p,y:n};(v=t.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||p>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&p>=e.bottom.endX&&l[2]/(e.bottom.endX-e.bottom.startX)<1.5&&l[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:t.push({top:g,bottom:g})}if(h){var v,y=r-l[4],b=y-l[3];g={startX:b,y:n,endX:y},(v=i.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&&l[2]/(e.bottom.endX-e.bottom.startX)<1.5&&l[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:i.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)u(d);r.push.apply(r,t.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),t=t.filter((function(e){return e.bottom.y===n})),o.push.apply(o,i.filter((function(e){return e.bottom.y!==n}))),i=i.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);r.push.apply(r,t.filter((function(e){return e.bottom.y-e.top.y>=2}))),o.push.apply(o,i);var f=r.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(r){var t=(r.top.startX+r.top.endX+r.bottom.startX+r.bottom.endX)/4,n=(r.top.y+r.bottom.y+1)/2;if(e.get(Math.round(t),Math.round(n))){var o=[r.top.endX-r.top.startX,r.bottom.endX-r.bottom.startX,r.bottom.y-r.top.y+1],i=a(o)/o.length;return{score:c({x:Math.round(t),y:Math.round(n)},[1,1,3,1,1],e),x:t,y:n,size:i}}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score})).map((function(e,r,t){if(r>4)return null;var n=t.filter((function(e,t){return r!==t})).map((function(r){return{x:r.x,y:r.y,score:r.score+Math.pow(r.size-e.size,2)/e.size,size:r.size}})).sort((function(e,r){return e.score-r.score}));if(n.length<2)return null;var a=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:a}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score}));if(0===f.length)return null;var h=function(e,r,t){var a,o,i,s,c,l,u,d=n(e,r),f=n(r,t),h=n(e,t);return f>=d&&f>=h?(c=(a=[r,e,t])[0],l=a[1],u=a[2]):h>=f&&h>=d?(c=(o=[e,r,t])[0],l=o[1],u=o[2]):(c=(i=[e,t,r])[0],l=i[1],u=i[2]),(u.x-l.x)*(c.y-l.y)-(u.y-l.y)*(c.x-l.x)<0&&(c=(s=[u,c])[0],u=s[1]),{bottomLeft:c,topLeft:l,topRight:u}}(f[0].points[0],f[0].points[1],f[0].points[2]),p=h.topRight,m=h.topLeft,g=h.bottomLeft,v=u(e,o,p,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:p.x,y:p.y}});var b=l(e,p),C=l(e,m),w=l(e,g),k=u(e,o,b,C,w);return k&&y.push({alignmentPattern:{x:k.alignmentPattern.x,y:k.alignmentPattern.y},bottomLeft:{x:w.x,y:w.y},topLeft:{x:C.x,y:C.y},topRight:{x:b.x,y:b.y},dimension:k.dimension}),0===y.length?null:y}}]).default},e.exports=t()})));function Xb(e){return Yb.apply(this,arguments)}function Yb(){return(Yb=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.imageData,n=r.canvas,(a=t)||(o=n.getContext("2d"),a=o.getImageData(0,0,n.width,n.height)),!(i=Qb(a.data,a.width,a.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",i.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zb(e){return $b.apply(this,arguments)}function $b(){return($b=f(regeneratorRuntime.mark((function e(r){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.canvas,n=r.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),zy.scanImage(t,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Jb=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.canvas,n=r.blob,a=r.qrScannerResources,o=t,!n){e.next=6;break}return e.next=5,po.blobToCanvas({blob:n});case 5:o=e.sent;case 6:return i=o.getContext("2d"),e.next=9,Xb({imageData:i.getImageData(0,0,o.width,o.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,Zb({canvas:o,qrScannerResources:a});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();var eC,rC,tC,nC,aC,oC,iC=function(e){var t=e.shouldStart,n=e.refVideo,a=e.cropArea,o=e.settings,i=e.onSessionTimeout,s=e.onCaptureDone,c=e.onAboutToTimeout,l=e.outputEncryptionSettings,u=B(r.useState(!1),2),d=u[0],h=u[1],p=r.useRef((function(){})),m=r.useRef((function(){})),g=zt.useSDKSettings().lang,y=r.useCallback((function(){p.current.apply(p,arguments)}),[]),b=function(e){var t=e.refVideo,n=e.shouldStart,a=e.cropArea,o=e.settings,i=e.onResult,s=e.outputEncryptionSettings,c=r.useRef(null);null===c.current&&(c.current=document.createElement("canvas"));var l=r.useRef(!1),u=r.useRef(null),d=B(r.useState(!1),2),h=d[0],p=d[1],m=r.useRef({}),g=zt.useSDKSettings(),v=g.customUrls,y=g.qrSettings;r.useEffect((function(){function e(){return(e=f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h){e.next=5;break}return e.next=3,Xy({modelUrl:null==v?void 0:v.wechatQRModelsUrl});case 3:m.current=e.sent,p(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[h,v]);var b=r.useCallback((function(){!0===l.current&&(l.current=!1)}),[]),C=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,n,a,d,p,g,v,C,w,k,B,E,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h&&o&&!l.current){e.next=2;break}return e.abrupt("return");case 2:r=m.current,n=r.qrModel,a=r.qrScannerResources,d=r.noModel,p=u.current,g=t.current,l.current=!0,v=p.cropX,C=p.cropY,w=p.cropWidth,k=p.cropHeight,(B=c.current).width=w,B.height=k,E=B.getContext("2d"),S=function(){var e=f(regeneratorRuntime.mark((function e(){var r,t,o,u,f,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E.drawImage(g,v,C,w,k,0,0,w,k),r=performance.now(),d){e.next=8;break}return e.next=5,Gb({canvas:B,qrModel:n});case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,Jb({canvas:B,qrScannerResources:a});case 10:t=e.sent;case 11:if(r=Math.floor(performance.now()-r),!t){e.next=27;break}return b(),_=void 0,_=t.match(Kb),o={valid:Boolean(_)},e.next=17,Zn.takePicture({canvas:c.current});case 17:return u=e.sent,e.next=20,ws.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:t,type:"qr"},enableExifData:"boolean"!=typeof(null==y?void 0:y.enableExif)||(null==y?void 0:y.enableExif)});case 20:if(f=e.sent,!s||!s.key){e.next=26;break}return p=s.key,e.next=25,ai.encrypt({blob:f,key:p});case 25:h=e.sent;case 26:i({result:t,validateResult:o,image:{blob:f,encrypted:h}});case 27:return m=180-r>0?180-r:0,e.next=30,new Promise((function(e){return setTimeout(e,m)}));case 30:l.current&&window.requestAnimationFrame(S);case 31:case"end":return e.stop()}var _}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(S);case 13:case"end":return e.stop()}}),e)}))),[h,o,t,b,null==y?void 0:y.enableExif,s,i]),w=r.useCallback((function(){b()}),[b]);return r.useEffect((function(){var e=t.current;n||w(),h&&n&&a&&e&&e.videoWidth>0&&(u.current=Zn.analyzeVideoAndWindowSizes(e,a,0),C())}),[n,a,t,b,C,h,w]),r.useEffect((function(){return w}),[w]),{refWorkingCanvas:c,stopCheckFrame:b,checkFrame:C,warmupDone:h}}({refVideo:n,shouldStart:t,cropArea:a,settings:o,onResult:y,outputEncryptionSettings:l}),C=b.stopCheckFrame,w=b.checkFrame,k=b.warmupDone,S=nb({refVideo:n,shouldStart:t&&k,cropArea:a,settings:o}),_=S.stopCheckFrame,A=S.refRecordedVideos,I=S.splitVideos,T=S.resetRecordedVideos,x=S.checkFrame;p.current=r.useCallback((function(e){h(!0),_(),C(),m.current(),s(v(v({},e),null!=o&&o.enableRecording?{recordedVideos:A.current}:{})),h(!1)}),[_,s,A,C,null==o?void 0:o.enableRecording]);var P=r.useCallback((function(){_(),C();var e=E(A.current),r=null!=o&&o.enableRecording?{recordedVideos:e}:null;i(r),T()}),[T,_,C,i,A,o]),R=r.useCallback((function(){I()}),[I]),D=ab({lang:g,onAboutToTimeout:c,onSessionTimeout:P,onVideoTimeLimitReached:R,settings:o,shouldStartTimers:t&&k,sessionTime:null==o?void 0:o.scanQrLimitTimeSecond}),N=D.stopTimers,L=D.startTimers;return m.current=N,{isProcessing:d,restartSession:r.useCallback(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(),e.next=3,Promise.all([x(),w()]);case 3:case"end":return e.stop()}}),e)}))),[x,w,L]),refRecordedVideos:A,warmupDone:k}};function sC(e){var t=e.windowAndVideoInfo,n=e.onUISpacingChange,a=e.refVideo,o=e.settings,s=e.onCaptureDone,c=e.outputEncryptionSettings,l=B(r.useState(null),2),u=l[0],d=l[1],h=Bn.useAsset("qr_capture_cursor.png"),p=B(r.useState({}),2),m=p[0],g=p[1],v=m.yTooltip,y=m.yMessage,b=zt.useSDKSettings().lang,C=Cn.useSDKTracking().sendEvent,w=py(),k=w.showPopup,E=w.popupShown,S=w.popupType,_=B(r.useState(!1),2),A=_[0],I=_[1],T=B(r.useState(null),2),x=T[0],P=T[1],R=Bn.useAsset("ic_loading.png"),D=r.useRef();r.useEffect((function(){C({tag:"id_qr",event:"user_activity.start",log:{}}),D.current=performance.now()}),[C]),r.useEffect((function(){k({popupType:yy})}),[k]),r.useEffect((function(){if(t){var e=t.videoAreaWidth,r=t.lostX,a=t.lostY,o=Rs.isMobile?Math.min(e-6,145):145,i=o,s=a+10,c=s+90,l=c+40,u=l+i+20,f=Math.floor((e-o)/2)+r;d({x:f,y:l,width:o,height:i,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:u,yMessage:c};g(h),n(h)}}),[t,n]);var N=r.useCallback((function(e){C({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),P(""),s(e)}),[s,C]),L=r.useCallback((function(e){var r=e.validateResult.valid;P("");var t=performance.now();r?(C({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(t-D.current)/1e3}}),s(e)):(k({popupType:vy}),C({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[k,s,C]),O=r.useCallback((function(e){var r=e.curTimeLeft;P(Cf(vb.REMAINING_TIME[b])({x:r}))}),[b]),M=iC({shouldStart:A,refVideo:a,cropArea:u,settings:o,onSessionTimeout:N,onCaptureDone:L,onAboutToTimeout:O,outputEncryptionSettings:c}),U=M.isProcessing,F=M.restartSession,V=M.warmupDone,j=r.useCallback((function(){k({popupType:null})}),[k]),z=r.useCallback(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j(),D.current=performance.now(),C({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,F();case 5:case"end":return e.stop()}}),e)}))),[F,j,C]),H=r.useCallback((function(){j(),C({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),s()}),[j,s,C]),q=r.useCallback((function(){j(),setTimeout((function(){I(!0)}),200)}),[j]);return i.default.createElement(i.default.Fragment,null,!V&&i.default.createElement(Vh,{contentStyle:{maxWidth:"300px"}}),u&&i.default.createElement(Lu,{x:"".concat(u.x,"px"),y:"".concat(u.y,"px"),width:"".concat(u.width,"px"),height:"".concat(u.height,"px"),surroundStyle:u.surroundStyle},i.default.createElement("div",null,i.default.createElement("img",{src:h,width:u.width,height:u.height,alt:""}))),i.default.createElement(mb,{y:"".concat(v,"px")},vb.QR_TOOLTIP[b]),x&&i.default.createElement(gb,{key:x,className:"message",y:"".concat(y,"px")},x),U&&i.default.createElement($v,null,i.default.createElement("img",{src:R,alt:"",className:"spin"})),i.default.createElement(Mh,{contentStyle:{maxWidth:"332px"},open:E},S===vy&&i.default.createElement(Ab,{onRetry:z,onSkip:H}),S===yy&&i.default.createElement(qb,{onClickStart:q,onTimeout:q})))}sC.propTypes={windowAndVideoInfo:s.default.shape({}),onUISpacingChange:s.default.func,refVideo:s.default.shape({}),settings:s.default.shape({}),onCaptureDone:s.default.func,outputEncryptionSettings:s.default.shape({})},sC.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var cC,lC,uC,dC,fC,hC={SUCCESS:"SUCCESS",WARNING:"WARNING"},pC=(p(eC={},hC.SUCCESS,"52,206,95"),p(eC,hC.WARNING,"255,148,50"),eC),mC=(p(rC={},hC.SUCCESS,"✓"),p(rC,hC.WARNING,"!"),rC),gC=c.default.div(tC||(tC=k(["\n font-weight: normal;\n"]))),vC=c.default.div(nC||(nC=k(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return n.css(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],pC[e.type],pC[e.type],pC[e.type])})),yC=c.default.div(aC||(aC=k(["\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){return n.css(["rgb(",")"],pC[e.type])})),bC=c.default.div(oC||(oC=k(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),CC=function(e){var r=e.children,t=e.type,n=e.className;return i.default.createElement(gC,{className:n},i.default.createElement(vC,{type:t}),i.default.createElement(bC,null,i.default.createElement(yC,{type:t},mC[t]),r),i.default.createElement(vC,{type:t}))};CC.propTypes={children:s.default.node,type:s.default.string,className:s.default.string},CC.defaultProps={children:null,type:hC.SUCCESS,className:""};var wC=c.default.div(cC||(cC=k(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),kC=c.default.div(lC||(lC=k(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),BC=c.default.button(uC||(uC=k(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),EC=c.default.img(dC||(dC=k(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),SC=c.default.div(fC||(fC=k(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),_C=function(e){var t=e.imageTaken,n=e.onConfirm,a=e.onTryAgain,o=e.error,s=e.hasValidQR,c=e.frontSide,l=B(r.useState(null),2),u=l[0],d=l[1],f=zt.useSDKSettings().lang,h=Cn.useSDKTracking().sendEvent;return r.useEffect((function(){h({tag:c?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[c,h]),r.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),d(e)),function(){URL.revokeObjectURL(e)}}),[t]),i.default.createElement(wC,null,null!==s&&i.default.createElement(yb,{mb:"20px"},i.default.createElement("div",null,i.default.createElement(CC,{type:s?hC.SUCCESS:hC.WARNING},s?cy.CONFIRM_POPUP_VALID_QR[f]:cy.CONFIRM_POPUP_INVALID_QR[f]))),i.default.createElement(Ub,{ratio:1.5},i.default.createElement(EC,{src:u})),o&&i.default.createElement(kC,{className:"confirm-popup-error-message"},o.msg[f]),i.default.createElement(SC,null,i.default.createElement(BC,{onClick:function(){h({tag:c?"id_front":"id_back",event:"user_activity.retry",log:{}}),a()}},cy.BTN_TRY_AGAIN[f]),i.default.createElement(BC,{onClick:function(){h({tag:c?"id_front":"id_back",event:"user_activity.submit",log:{}}),n()}},cy.BTN_USE_THIS_PICTURE[f])))};_C.propTypes={imageTaken:s.default.shape({}),error:s.default.shape({msg:s.default.shape({})}),onConfirm:s.default.func,onTryAgain:s.default.func,hasValidQR:s.default.bool,frontSide:s.default.bool},_C.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var AC,IC={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},TC=n.createGlobalStyle(AC||(AC=k(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),xC=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons"];function PC(e){var t=e.onClose,a=e.onError,o=e.settings,s=e.outputEncryptionSettings,c=e.defaultCameraId,l=e.globalStyle,u=e.styledComponent,d=e.frontCamera,f=e.scannerTypeCons,h=w(e,xC),p=h.numberOfCaptures,g=h.stepNumber,v=h.frontSide,y=h.titleIcon,b=h.title,C=h.description,k=h.scannerType,E=h.usePortraitMask,S=h.shouldShowSpinner,_=h.handleQRCaptureDone,A=h.handleIDCardCaptureDone,I=h.handleRestartSession,T=h.refIDCardReader,x=h.handleClickConfirm,P=h.popupType,R=h.popupShown,D=h.popupProps,N=r.useRef(null),L=B(r.useState(null),2),O=L[0],M=L[1],U=B(r.useState(!1),2),F=U[0],V=U[1],j=Bn.useAsset("ic_loading.png"),z=B(r.useState({}),2),H=z[0],q=z[1],K=H.yTitle,G=r.useCallback((function(e){M(e),V(!0)}),[]);r.useEffect((function(){V(!1)}),[d]);var W=Bn.useAsset(y),Q=u.CloseCameraButton;return i.default.createElement(n.ThemeProvider,{theme:IC},i.default.createElement(Xv,null,i.default.createElement(Tu,{key:d,frontCamera:d,onVideoPlayed:G,onClose:t,flipHorizontal:d,ref:N,onError:a,defaultCameraId:c,closeButton:Q||null},F&&i.default.createElement(i.default.Fragment,null,k===f.ID_CARD&&i.default.createElement(ub,{key:g,ref:T,windowAndVideoInfo:O,refVideo:N,settings:o,onCaptureDone:A,onUISpacingChange:q,frontSide:v,description:C,usePortraitMask:E,outputEncryptionSettings:s}),k===f.QR_CODE&&i.default.createElement(sC,{key:g,refVideo:N,windowAndVideoInfo:O,settings:o,onCaptureDone:_,onUISpacingChange:q,outputEncryptionSettings:s})),i.default.createElement(Qv,{keyForTransition:p}),i.default.createElement(ey,{y:"".concat(K,"px")},i.default.createElement(Cp,null,i.default.createElement(fp,{key:b,timeout:{enter:500,exit:500},classNames:"flipY",unmountOnExit:!0},i.default.createElement(ry,null,y&&i.default.createElement(Yv,{src:W,alt:""}),i.default.createElement(ty,{className:"title"},b))))),S&&i.default.createElement($v,null,i.default.createElement("img",{src:j,alt:"",className:"spin"}))),i.default.createElement(Mh,{open:R},P===gy&&i.default.createElement(_C,m({},D,{onConfirm:x,onTryAgain:I,frontSide:v})))),i.default.createElement(l,null))}var RC={settings:s.default.shape({}),onClose:s.default.func,onError:s.default.func,outputEncryptionSettings:s.default.shape({}),defaultCameraId:s.default.string,globalStyle:s.default.shape({}),styledComponent:s.default.shape({CloseCameraButton:s.default.node}),frontCamera:s.default.bool,scannerTypeCons:s.default.shape({}).isRequired},DC={settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:TC,styledComponent:{CloseCameraButton:null},frontCamera:!1};PC.propTypes=RC,PC.defaultProps=DC;var NC=D.IDCardSide,LC=D.IDCardType,OC=D.Errors,MC={ID_CARD:"id_card",QR_CODE:"qr_code"},UC=[{scannerType:MC.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:D.IDCardSide.FRONT,cardType:LC.VN,enableConfirmPopup:!0},{scannerType:MC.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:D.IDCardSide.BACK,cardType:LC.VN,enableConfirmPopup:!0}],FC={scannerType:MC.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},VC=function(){return Promise.resolve({card_label:""})};var jC=function(){this.__data__=new Ul,this.size=0};var zC=function(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t};var HC=function(e){return this.__data__.get(e)};var qC=function(e){return this.__data__.has(e)};var KC=function(e,r){var t=this.__data__;if(t instanceof Ul){var n=t.__data__;if(!Fl||n.length<199)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new Ql(n)}return t.set(e,r),this.size=t.size,this};function GC(e){var r=this.__data__=new Ul(e);this.size=r.size}GC.prototype.clear=jC,GC.prototype.delete=zC,GC.prototype.get=HC,GC.prototype.has=qC,GC.prototype.set=KC;var WC=GC;var QC=function(e,r,t){(void 0!==t&&!xl(e[r],t)||void 0===t&&!(r in e))&&$u(e,r,t)};var XC=function(e){return function(r,t,n){for(var a=-1,o=Object(r),i=n(r),s=i.length;s--;){var c=i[e?s:++a];if(!1===t(o[c],c,o))break}return r}}(),YC=Ps((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t?Vc.Buffer:void 0,o=a?a.allocUnsafe:void 0;e.exports=function(e,r){if(r)return e.slice();var t=e.length,n=o?o(t):new e.constructor(t);return e.copy(n),n}})),ZC=Vc.Uint8Array;var $C=function(e){var r=new e.constructor(e.byteLength);return new ZC(r).set(new ZC(e)),r};var JC=function(e,r){var t=r?$C(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)};var ew=function(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r},rw=Object.create,tw=function(){function e(){}return function(r){if(!tl(r))return{};if(rw)return rw(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();var nw=function(e){return"function"!=typeof e.constructor||Nd(e)?{}:tw(jd(e))};var aw=function(e){return Zc(e)&&fd(e)};var ow=function(e,r){if(("constructor"!==r||"function"!=typeof e[r])&&"__proto__"!=r)return e[r]};var iw=function(e){return rd(e,Ud(e))};var sw=function(e,r,t,n,a,o,i){var s=ow(e,t),c=ow(r,t),l=i.get(c);if(l)QC(e,t,l);else{var u=o?o(s,c,t+"",e,r,i):void 0,d=void 0===u;if(d){var f=Mc(c),h=!f&&Ed(c),p=!f&&!h&&xd(c);u=c,f||h||p?Mc(s)?u=s:aw(s)?u=ew(s):h?(d=!1,u=YC(c,!0)):p?(d=!1,u=JC(c,!0)):u=[]:Wd(c)||kd(c)?(u=s,kd(s)?u=iw(s):tl(s)&&!al(s)||(u=nw(c))):d=!1}d&&(i.set(c,u),a(u,c,n,o,i),i.delete(c)),QC(e,t,u)}};var cw=function e(r,t,n,a,o){r!==t&&XC(t,(function(i,s){if(o||(o=new WC),tl(i))sw(r,t,s,n,e,a,o);else{var c=a?a(ow(r,s),i,s+"",r,t,o):void 0;void 0===c&&(c=i),QC(r,s,c)}}),Ud)},lw=gd((function(e,r,t){cw(e,r,t)})),uw={data:{settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},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 dw(e){var t=e.clientSettings,n=B(r.useState(null),2),a=n[0],o=n[1];return r.useEffect((function(){var e=lw(uw,t),r=hu(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),n=hu(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),a=hu(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),i=hu(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),s=hu(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),c=hu(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),l=hu(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),u=hu(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),d=hu(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),f=hu(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),h=hu(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),p=hu(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),m=hu(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),g=hu(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),v=hu(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),y=hu(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(Rs.isMobile?"mobile":"web"));o({enableRecording:r,frameCaptureIntervalMs:n,idCardSessionTime:s,maxRecordingTimePerVideo:c,saveFrameQuality:a,enableTimers:i,enableAutoCapture:l,waitForBestImageTimeMs:u,enableBlurCheck:d,blurThreshold:f,disableCaptureButtonIfAlert:h,enableIdDetection:p,enableScanQr:m,scanQrLimitTimeSecond:g,enableExifData:v,enableVirtualCamHashes:y})}),[t]),{settings:a}}function fw(e){var t=e.logCredentials,n=e.clientSettings,a=e.uiOnlyComponent,o=e.onError,s=e.detectIdCard,c=e.outputEncryptionSettings,l=e.steps,u=e.onStepDone,d=dw({clientSettings:n}).settings,h=m({},function(e){var t=e.settings,n=e.onError,a=e.detectIdCard,o=void 0===a?VC:a,i=e.outputEncryptionSettings,s=e.steps,c=void 0===s?UC:s,l=e.onStepDone,u=B(r.useState(0),2),d=u[0],h=u[1],p=B(r.useState(c[d]),2),m=p[0],g=p[1],y=B(r.useState(0),2),b=y[0],C=y[1],w=B(r.useState(!1),2),k=w[0],S=w[1],_=r.useRef({}),A=r.useRef([]),I=r.useRef(null),T=r.useRef(),x=py(),P=x.showPopup,R=x.popupShown,N=x.popupType,L=x.props,O=m.scannerType,M=m.title,U=m.titleIcon,F=m.cardSide,V=m.description,j=m.usePortraitMask,z=m.cardType,H=m.enableConfirmPopup,q=r.useCallback((function(e){e>=c.length||setTimeout((function(){h(e),g(c[e])}),200)}),[c]),K=r.useCallback((function(){q(d+1)}),[q,d]),G=r.useCallback((function(){setTimeout((function(){g((function(e){return v(v({},e),FC)}))}),200)}),[]),W=r.useCallback((function(){P({popupType:null})}),[P]),Q=r.useCallback((function(){W(),I.current=null,O===MC.QR_CODE?q(d):O===MC.ID_CARD&&T.current.restartSession()}),[q,d,W,O]),X=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=v({stepNumber:d,cardSide:F,cardType:z,image:_.current},null!=t&&t.enableRecording?{recordedVideos:A.current}:{}),(O===MC.QR_CODE&&I.current||null!==(r=I.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=I.current),S(!0),e.next=5,l(n);case 5:S(!1),I.current=null,K();case 8:case"end":return e.stop()}}),e)}))),[t,d,l,K,O,S,F,z]),Y=r.useCallback((function(e){var r;if(I.current=e,e&&e.recordedVideos){var t,n=e.recordedVideos;(t=A.current).push.apply(t,E(n))}C((function(e){return e+1}));var a=Boolean(null==e||null===(r=e.validateResult)||void 0===r?void 0:r.valid);H?P({popupType:gy,props:{hasValidQR:a,imageTaken:_.current}}):X()}),[P,H,X]),Z=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var a,s,c,l,u,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.image,s=r.error,c=r.recordedVideos,_.current=a,A.current=c,C((function(e){return e+1})),F!==D.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!Rs.isMobile){e.next=28;break}if(u=null==a||null===(l=a.detectedCard)||void 0===l?void 0:l.label){e.next=20;break}return S(!0),e.prev=9,e.next=12,o({image:a,cardType:z,cardSide:F});case 12:d=e.sent,u=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),n(OC.detect_id_card_error);case 19:S(!1);case 20:if(!u||!"vn.cccd_new.front".includes(u)){e.next=28;break}return S(!0),e.next=24,Wb(_.current.blob,i);case 24:return(f=e.sent)?Y(f):G(),S(!1),e.abrupt("return");case 28:H?P({popupType:gy,props:{imageTaken:_.current,error:s}}):X();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(r){return e.apply(this,arguments)}}(),[H,P,F,t,z,o,X,G,n,Y,i,S]),$=r.useCallback((function(){W(),X()}),[X,W]);return{numberOfCaptures:b,stepNumber:d,titleIcon:U,title:M,description:V,frontSide:F===NC.FRONT,scannerType:O,usePortraitMask:j,shouldShowSpinner:k,handleQRCaptureDone:Y,handleIDCardCaptureDone:Z,handleRestartSession:Q,refIDCardReader:T,handleClickConfirm:$,showPopup:P,popupType:N,popupShown:R,popupProps:L}}({settings:d,onError:o,detectIdCard:s,outputEncryptionSettings:c,steps:l,onStepDone:u}));return i.default.createElement(Am,null,i.default.createElement(Cn.SDKTrackingProvider,{value:{tracking:v({},t)}},i.default.createElement(a,m({},e,{settings:d,scannerTypeCons:MC},h))))}var hw={logCredentials:s.default.shape({}),clientSettings:s.default.shape({}),uiOnlyComponent:s.default.func,onError:s.default.func,onStepDone:s.default.func,steps:s.default.arrayOf(s.default.shape({})),detectIdCard:s.default.func,outputEncryptionSettings:s.default.shape({})};fw.propTypes=hw,fw.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:PC,onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var pw=D.IDCardSide,mw=D.Errors;function gw(e){return vw.apply(this,arguments)}function vw(){return(vw=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.image,n=r.cardType,a=r.cardSide,o=r.apiClient,i=r.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(a)},!i||!i.key){e.next=4;break}return e.abrupt("return",o.httpClient.post("/v1/images",v({base64:t.encrypted.hex},s),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",o.uploadImage(v({file:t.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yw(e){return bw.apply(this,arguments)}function bw(){return(bw=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.image,n=r.apiClient,a=r.rawString,o=r.outputEncryptionSettings,i={label:"qr_code",metadata:JSON.stringify({raw:a})},!o||!o.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",v({base64:t.encrypted.hex},i),{"X-TV-Key":o.key}));case 4:return e.abrupt("return",n.uploadImage(v({file:t.blob},i)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cw(e){return ww.apply(this,arguments)}function ww(){return(ww=f(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.imageId,n=r.cardType,a=r.apiClient,e.abrupt("return",a.requestVerifyIDCard({card_type:n,image1:{id:t}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kw(e){return Bw.apply(this,arguments)}function Bw(){return(Bw=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.apiClient,n=r.cardType,a=r.frontCardId,o=r.isCapturingFrontSide,i=r.backCardId,s=r.recordedVideos,c=r.qrImageId,l=s.filter((function(e){return null!==e.id})),u=s.filter((function(e){return null===e.id&&e.frames.length>0})),e.next=5,Promise.all(u.map((function(e){return t.fileService.request({frames:e.frames})})));case 5:return d=e.sent,f={card_type:n,image:{id:a},image2:o?void 0:{id:i},videos:[].concat(E(l.map((function(e){return{id:e.id}}))),E(d.map((function(e){return{id:e.data.file_id}}))))},c&&(f.qr1_images=[{id:c}]),e.abrupt("return",t.detectIDTampering(f));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ew(e){return Sw.apply(this,arguments)}function Sw(){return(Sw=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.cardType,n=r.apiClient,a=r.frontCardId,o=r.backCardId,i=r.isCapturingFrontSide,s=r.qrImageId,c={card_type:t,image1:i?{id:a}:{id:o}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _w(e){return Aw.apply(this,arguments)}function Aw(){return(Aw=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h,p,m,g,y,b,C,w,k,E,S,_,A;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.image,a=r.frontCardId,o=r.qrImageId,i=r.onError,s=r.recordedVideos,c=r.apiClient,l=r.cardType,u=r.cardSide,d=r.qrScannedResult,f=r.outputEncryptionSettings,u!==pw.BACK||a){e.next=4;break}return i(mw.missing_front_id_card),e.abrupt("return");case 4:return h=[gw({image:n,cardType:l,cardSide:u,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&h.push(yw({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(h);case 8:if(p=e.sent,m=B(p,2),g=m[0],y=m[1],!g.errors){e.next=15;break}return i(v(v({},mw.upload_error),{},{details:g.errors})),e.abrupt("return");case 15:return b=g.data.image_id,C=(null==y||null===(t=y.data)||void 0===t?void 0:t.image_id)||o,(E=u===pw.FRONT)?w=b:(w=a,k=b),e.next=21,Cw({imageId:b,cardType:l,apiClient:c});case 21:if(!(S=e.sent).errors){e.next=25;break}return i(v(v({},mw.sanity_check_error),{},{details:S.errors})),e.abrupt("return");case 25:return e.next=27,Ew({cardType:l,apiClient:c,frontCardId:w,backCardId:k,isCapturingFrontSide:E,qrImageId:C});case 27:if(!(_=e.sent).errors){e.next=31;break}return i(v(v({},mw.read_id_card_error),{},{details:_.errors})),e.abrupt("return");case 31:return e.next=33,kw({apiClient:c,cardType:l,frontCardId:w,isCapturingFrontSide:E,backCardId:k,recordedVideos:s,qrImageId:C});case 33:if(!(A=e.sent).errors){e.next=37;break}return i(v(v({},mw.detect_id_tampering_error),{},{details:A.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:S.data,tamperingInfo:A.data,cardInfo:_.data,qrImageId:C});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Iw=["readIDCardUIOnlyComponent"],Tw=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],xw=D.Errors,Pw=function(e){var t=e.readIDCardUIOnlyComponent,n=w(e,Iw),a=n.onError,o=n.onStepDone,s=n.apiCredentials,c=n.logCredentials,l=n.outputEncryptionSettings,u=w(n,Tw),d=B(r.useState(null),2),h=d[0],p=d[1],g=Ao.useApiClient({apiCredentials:s,logCredentials:c}).apiClient,y=r.useRef(""),b=r.useRef("");r.useEffect((function(){function e(){return(e=f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.clientSettings();case 2:r=e.sent,p(r);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[g]);var C=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,i,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.cardType,n=r.cardSide,i=r.recordedVideos,s=r.qrScannedResult,c=r.image,u=null,e.prev=2,e.next=5,_w({image:c,cardSide:n,frontCardId:y.current,qrImageId:b.current,onError:a,apiClient:g,cardType:t,recordedVideos:i,qrScannedResult:s,outputEncryptionSettings:l});case 5:u=e.sent,n===D.IDCardSide.FRONT&&(y.current=u.cardInfo.image1.id),b.current=u.qrImageId,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),a(v(v({},xw.api_call_error),{},{details:e.t0}));case 13:u&&o(v(v({},r),{},{apiResult:u}));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(r){return e.apply(this,arguments)}}(),[g,a,o,l]);return h&&i.default.createElement(t,m({logCredentials:c,onError:a,onStepDone:C,outputEncryptionSettings:l},u,{clientSettings:h}))};function Rw(){return(Rw=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>0&&void 0!==c[0]?c[0]:{},t=r.opencvUrl,n=r.idCardModelUrl,a=r.tfScriptUrls,o=r.blazefaceModelUrl,i=r.closeEyesModelUrl,s=new jy,e.prev=2,ei.loadTensorFlow(a).then((function(){ei.loadBlazefaceModel({modelUrl:o})})),e.next=6,Promise.all([If({closeEyesModelUrl:i}),s.loadResource({modelUrl:n}),Oy({url:t})]);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)}Pw.propTypes={onError:s.default.func,onStepDone:s.default.func,apiCredentials:s.default.shape({accessKey:s.default.string,secretKey:s.default.string,apiUrl:s.default.string}),logCredentials:s.default.shape({}),outputEncryptionSettings:s.default.shape({}),readIDCardUIOnlyComponent:s.default.func},Pw.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:fw};var Dw,Nw,Lw,Ow,Mw,Uw,Fw,Vw=Af((function(){return Rw.apply(this,arguments)})),jw=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blob,n=r.resultWarmup,a=n.idCardModel,o=n.ableToUseModel){e.next=4;break}return e.abrupt("return",{ableToUseModel:o});case 4:return e.next=6,po.blobToCanvas({blob:t});case 6:return i=e.sent,e.abrupt("return",a.predict(i,{detectThreshold:.3}));case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),zw=ch,Hw=w(gm,["useLivenessDetection"]);function qw(e){var r=e.className;return i.default.createElement("svg",{className:r,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.default.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"}))}qw.propTypes={className:s.default.string},qw.defaultProps={className:""};var Kw,Gw,Ww,Qw,Xw,Yw,Zw,$w,Jw,ek,rk,tk,nk=(p(Dw={},D.FaceDirection.LEFT,90),p(Dw,D.FaceDirection.RIGHT,270),p(Dw,D.FaceDirection.UP,180),p(Dw,D.FaceDirection.DOWN,0),Dw),ak=n.keyframes(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),ok=c.default.div(Nw||(Nw=k(["\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"])),nk[D.FaceDirection.DOWN],nk[D.FaceDirection.LEFT],nk[D.FaceDirection.UP],nk[D.FaceDirection.RIGHT]),ik=c.default.div(Lw||(Lw=k(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var r,t=e.direction;return null!==(r=nk[t])&&void 0!==r?r:0})),sk=c.default.span(Ow||(Ow=k(["\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"])),ak),ck=c.default(sk)(Mw||(Mw=k(["\n animation-delay: 0s;\n"]))),lk=c.default(sk)(Uw||(Uw=k(["\n animation-delay: 0.5s;\n"]))),uk=c.default(sk)(Fw||(Fw=k(["\n animation-delay: 1s;\n"])));function dk(e){var r=e.type;return r!==D.FaceDirection.FRONTAL?i.default.createElement(ik,{direction:r},i.default.createElement(ck,null),i.default.createElement(lk,null),i.default.createElement(uk,null)):i.default.createElement(ok,null,i.default.createElement(ik,{className:"top"},i.default.createElement(ck,null),i.default.createElement(lk,null),i.default.createElement(uk,null)),i.default.createElement(ik,{className:"right"},i.default.createElement(ck,null),i.default.createElement(lk,null),i.default.createElement(uk,null)),i.default.createElement(ik,{className:"bottom"},i.default.createElement(ck,null),i.default.createElement(lk,null),i.default.createElement(uk,null)),i.default.createElement(ik,{className:"left"},i.default.createElement(ck,null),i.default.createElement(lk,null),i.default.createElement(uk,null)))}dk.propTypes={type:s.default.oneOf([D.FaceDirection.LEFT,D.FaceDirection.RIGHT,D.FaceDirection.UP,D.FaceDirection.FRONTAL])},dk.defaultProps={type:D.FaceDirection.LEFT};var fk=650,hk=750,pk=Ou,mk=Hw.Text,gk=Hw.FaceDetectionError,vk=Hw.FaceVerificationInstructions,yk=Hw.FaceVerificationStepsWrapper,bk=Hw.StepItem,Ck=Hw.BottomButtonsOverlay,wk=Hw.Button,kk=Hw.CountDownOverlay,Bk=Hw.InstructionsOverlay,Ek=c.default(yk)(Kw||(Kw=k(["\n height: 50px;\n"]))),Sk=c.default(mk)(Gw||(Gw=k(["\n position: absolute;\n font-style: normal;\n font-weight: bold;\n font-size: 1.5rem;\n text-align: center;\n padding: 0 1.75rem;\n color: ",";\n\n ","\n\n ",";\n"])),(function(e){return e.color}),(function(e){var r=e.top;return r&&n.css(["top:","px;"],r)}),(function(e){return e.isMobile&&n.css(["font-size:1.125rem;"])})),_k=c.default(gk)(Ww||(Ww=k(["\n position: absolute;\n font-size: 1.125rem;\n text-align: center;\n\n ",";\n"])),(function(e){return e.isMobile&&n.css(["font-size:0.875rem;"])})),Ak=c.default(vk)(Qw||(Qw=k(["\n position: absolute;\n font-size: 1.125rem;\n text-align: center;\n padding: 0 1.75rem;\n color: ",";\n text-shadow: none;\n\n ",";\n"])),(function(e){return e.color}),(function(e){return e.isMobile&&n.css(["font-size:0.875rem;"])})),Ik=c.default(qw)(Xw||(Xw=k(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var r=e.color;return null!=r?r:"#06243c"})),Tk=c.default.img(Yw||(Yw=k(["\n && {\n width: 20px;\n border-radius: 50%;\n margin: 0;\n\n ","\n }\n"])),(function(e){return"preview"===e.mode&&n.css(["width:42px;"])})),xk=c.default(bk)(Zw||(Zw=k(["\n width: 50px;\n height: 50px;\n border: 1px solid #005993;\n border-radius: 50%;\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n"])),(function(e){return!e.active&&n.css(["border-color:#f2f6f9;opacity:0.3;"])})),Pk=c.default(Bh)($w||($w=k(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),Rk=c.default.div(Jw||(Jw=k(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n"]))),Dk=c.default(Rk)(ek||(ek=k(["\n background: rgba(223, 0, 0, 0.2);\n"]))),Nk=n.keyframes(["from{opacity:1;}to{opacity:0;}"]),Lk=c.default(Rk)(rk||(rk=k(["\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n"])),Nk),Ok=Rs.isMobile?{width:640}:null;function Mk(e){var t=e.className,n=e.apiCheck,a=e.enableInstructionsOverlay,o=e.enableErrorOverlay,s=e.enableCapturingOverlay,c=e.frontalMinSize,l=e.mode,u=e.minPadding,d=e.backgroundColor,f=e.textColor,h=e.progressProps,p=e.title,g=e.description,v=e.customInstructions,y=e.customIcon,b=e.customDirectionIcon,C=e.onLivenessDetectionDone,w=e.onClose,k=e.onError,B=e.captureFrameSettings,E=e.onFramesCaptured,S=e.livenessSettings,_=e.initFirstGestureTimeout,A=r.useCallback((function(e){var r=e.clientWidth,t=e.clientHeight,n=e.videoAreaWidth,a=e.videoAreaHeight,o=e.lostX,i=e.lostY,s=Math.max(80,i),c=Math.max(140,i);t>fk&&(s=Math.max(110,i),c=Math.max(170,i)),t>hk&&(s=Math.max(140,i),c=Math.max(200,i));var l=Math.max(u,o),d=Math.max(u,o),f=Math.min(n,a),h=Math.max(Math.floor(Math.min(r-(l+d),t-(s+c),f)),160);return{x:Math.min(Math.floor(l+(r-d-l)/2-h/2),r-h),y:Math.min(Math.floor(s+(t-c-s)/2-h/2),t-h),width:h,height:h}}),[u]),I=r.useMemo((function(){return{background:d,opacity:1}}),[d]),T=zw({apiCheck:n,frontalMinSize:c,mode:l,bgCameraMask:null,bgCameraMaskRed:null,surroundStyle:I,cropAreaDimension:A,customInstructions:v,customIcon:y,customDirectionIcon:b,onLivenessDetectionDone:C,captureFrameSettings:B,onFramesCaptured:E,livenessSettings:S,initFirstGestureTimeout:_}),x=T.countdownToTakePicture,P=T.cropArea,R=T.curStepIndex,D=T.directionIcon,N=T.faceDetectionError,L=T.handleTriggerPassiveMode,O=T.handleVideoPlayed,M=T.instructions,U=T.isActiveMode,F=T.refVideo,V=T.showCountdown,j=T.steps,z=T.videoPlayed,H=T.activeCapturing,q=T.warmupDone,K=10,G=45,W=2,Q=50,X=12,Y=14;window.innerHeight>fk&&(K=25,G=65,W=3,Q=50,X=24,Y=34),window.innerHeight>hk&&(K=30,G=80,W=5,Q=50,X=32,Y=54);var Z=P.current?P.current.y+P.current.height+W:0,$=Y+Q+X,J=o&&N;return i.default.createElement(Tu,{ref:F,className:t,frontCamera:!0,flipHorizontal:!0,videoSettings:Ok,onVideoPlayed:O,onClose:w,onError:k},!q&&i.default.createElement(Vh,null),z?i.default.createElement(i.default.Fragment,null,i.default.createElement(Sk,{top:K,isMobile:Rs.isMobile,color:f},p),P.current?i.default.createElement(Lu,{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},i.default.createElement(Ik,{color:d}),i.default.createElement(Pk,m({progress:R/j.length*100,hasError:J},h)),V?i.default.createElement(kk,null,x):null,U&&a&&D?i.default.createElement(Bk,null,D):null,U&&s&&H?i.default.createElement(Lk,null):null,J?i.default.createElement(Dk,null):null):null,N?i.default.createElement(_k,{top:Z,isMobile:Rs.isMobile,error:N}):null,U?i.default.createElement(i.default.Fragment,null,i.default.createElement(Ak,{top:G,isMobile:Rs.isMobile,color:f},g),M?i.default.createElement(Ak,{bottom:$,isMobile:Rs.isMobile,color:f},M):null,i.default.createElement(Ek,{bottom:Y},j.map((function(e,r){var t=e.name,n=e.icon,a=e.image.objUrl,o=R>=r;return i.default.createElement(xk,{key:t,active:o},a?i.default.createElement(Tk,{src:a,alt:"",mode:"preview"}):function(e,r){return"string"==typeof e?i.default.createElement(Tk,{src:e,alt:""}):i.default.cloneElement(e,r)}(n,{active:o}))})))):i.default.createElement(i.default.Fragment,null,N?null:i.default.createElement(Ck,null,i.default.createElement(wk,{onClick:L},i.default.createElement(pk,null))))):null)}Mk.propTypes={className:s.default.string,apiCheck:s.default.bool,enableInstructionsOverlay:s.default.bool,enableErrorOverlay:s.default.bool,enableCapturingOverlay:s.default.bool,frontalMinSize:s.default.number,mode:s.default.string,minPadding:s.default.number,backgroundColor:s.default.string,textColor:s.default.string,progressProps:s.default.shape({className:s.default.string,style:s.default.shape({}),radius:s.default.number,strokeWidth:s.default.number,progress:s.default.number,activeColor:s.default.string,innerPadding:s.default.number,outsideRingColor:s.default.string,insideRingColor:s.default.string,insideRingWidth:s.default.number,dashedRingColor:s.default.string,dashedRingWidth:s.default.number,dashedRingLineThick:s.default.number,dashedRingLineSpacing:s.default.number,showOutsideRing:s.default.bool,showDashedRing:s.default.bool,showInsideRing:s.default.bool}),title:s.default.string,description:s.default.string,customInstructions:s.default.shape({}),customIcon:s.default.shape({}),customDirectionIcon:s.default.shape({}),onLivenessDetectionDone:s.default.func,onClose:s.default.func,onError:s.default.func,captureFrameSettings:s.default.shape({}),onFramesCaptured:s.default.func,livenessSettings:s.default.shape({}),initFirstGestureTimeout:s.default.number},Mk.defaultProps={className:"",apiCheck:!1,enableInstructionsOverlay:!1,enableErrorOverlay:!1,enableCapturingOverlay:!1,frontalMinSize:720,mode:null,minPadding:30,backgroundColor:"#06243c",textColor:"#ffffff",progressProps:null,title:"Chụp ảnh chân dung",description:"Xin đưa khuôn mặt vào khung hình. Hình ảnh sẽ tự động được ghi lại.",customInstructions:null,customIcon:null,customDirectionIcon:(tk={},p(tk,D.FaceDirection.LEFT,i.default.createElement(dk,{type:D.FaceDirection.LEFT})),p(tk,D.FaceDirection.RIGHT,i.default.createElement(dk,{type:D.FaceDirection.RIGHT})),p(tk,D.FaceDirection.UP,i.default.createElement(dk,{type:D.FaceDirection.UP})),p(tk,D.FaceDirection.FRONTAL,i.default.createElement(dk,{type:D.FaceDirection.FRONTAL})),tk),onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},livenessSettings:null,initFirstGestureTimeout:2e3},exports.APIUtils=Ao,exports.Animations=Gp,exports.AntiDebugUtils=ri,exports.AssetUtils=Bn,exports.AsyncUtils=Sn,exports.BASE_Z_INDEX=1e3,exports.BaseTVWebSDK=Is,exports.BlurUtils=Xn,exports.Button=kb,exports.ButtonLink=Bb,exports.Camera=Tu,exports.CameraUtils=Zn,exports.CloseButton=bu,exports.CloseEyesDetector=Bs,exports.CommonUtils=Jn,exports.Constants=D,exports.CoordinateUtils=oa,exports.CropAreaOverlayWrapper=Lu,exports.CryptoUtils=ai,exports.DEFAULT_CLOSE_EYE_MODEL=ks,exports.ExifUtils=ws,exports.FaceUtils=ha,exports.FlashLiveness=kv,exports.GlareUtils=yo,exports.HashUtils=fn,exports.HighlightResult=CC,exports.HighlightResultType=hC,exports.Icons=wm,exports.ImageUtils=po,exports.LivenessDetection=Mk,exports.LivenessDetectionComponents=Hw,exports.LoadResourceUtils=Oo,exports.LocalStorageUtils=cn,exports.MobileDetect=Ns,exports.ModelUtils=ei,exports.NativeCamera=bm,exports.NormalCamera=Iu,exports.OrientationDetection=Am,exports.PlacementArea=Nu,exports.Popup=Mh,exports.PredictionUtils=ma,exports.ProgressCircle=Bh,exports.QRCodeScanner=sC,exports.RatioWrapper=Ub,exports.ReadIDCardUIOnly=fw,exports.ReadIDCardWithApiCall=Pw,exports.RectangleMask=_v,exports.RectangleMaskType=Sv,exports.SDKTimer=oi,exports.ScannerType=MC,exports.SettingsContext=zt,exports.Spacing=yb,exports.ThemeUtils=ti,exports.TimeUtils=an,exports.TrackingContext=Cn,exports.UIOnlyDefaultProps=DC,exports.UIOnlyPropTypes=RC,exports.UserAgentUtils=rn,exports.WarmupPopup=Vh,exports.checkCamera=vm,exports.defaultClientSettings=uw,exports.defaultReadIDCardSteps=UC,exports.getBaseSDKComponent=function(){return{checkCamera:vm,LivenessDetection:Ev,NativeCamera:bm,ReadIDCardUIOnly:fw,ReadIDCardWithApiCall:Pw,warmUpReadIdCard:rb,preloadEKYCResources:Vw,getListCamera:Pc,FlashLiveness:kv}},exports.getCustomUrlsBySettings=Mt,exports.getQrScannerWorkerPath=_s,exports.getSDKVersion=function(){return"5.14.11"},exports.handleApiCheckReadIdCard=_w,exports.preloadEKYCResources=Vw,exports.readIdCardFromImage=jw,exports.readQRFromFrontImage=Wb,exports.requestMotionPermission=Es,exports.useDeviceMotion=Ss,exports.useLivenessDetection=zw,exports.useMainProcessQRCodeScanner=iC,exports.useMainProcessReadIdCard=cb,exports.useSettingsReadIdCard=dw,exports.useShowPopup=py,exports.warmUpQRCodeScanner=Xy,exports.warmUpReadIdCard=rb,exports.warmupSelfieActive=Pf;
71
+ */function mc(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case Zs:switch(e=e.type){case ac:case oc:case Js:case rc:case ec:case sc:return e;default:switch(e=e&&e.$$typeof){case nc:case ic:case uc:case lc:case tc:return e;default:return r}}case $s:return r}}}function gc(e){return mc(e)===oc}var vc={AsyncMode:ac,ConcurrentMode:oc,ContextConsumer:nc,ContextProvider:tc,Element:Zs,ForwardRef:ic,Fragment:Js,Lazy:uc,Memo:lc,Portal:$s,Profiler:rc,StrictMode:ec,Suspense:sc,isAsyncMode:function(e){return gc(e)||mc(e)===ac},isConcurrentMode:gc,isContextConsumer:function(e){return mc(e)===nc},isContextProvider:function(e){return mc(e)===tc},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Zs},isForwardRef:function(e){return mc(e)===ic},isFragment:function(e){return mc(e)===Js},isLazy:function(e){return mc(e)===uc},isMemo:function(e){return mc(e)===lc},isPortal:function(e){return mc(e)===$s},isProfiler:function(e){return mc(e)===rc},isStrictMode:function(e){return mc(e)===ec},isSuspense:function(e){return mc(e)===sc},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Js||e===oc||e===rc||e===ec||e===sc||e===cc||"object"==typeof e&&null!==e&&(e.$$typeof===uc||e.$$typeof===lc||e.$$typeof===tc||e.$$typeof===nc||e.$$typeof===ic||e.$$typeof===fc||e.$$typeof===hc||e.$$typeof===pc||e.$$typeof===dc)},typeOf:mc},yc=(Ps((function(e,r){})),Ps((function(e){e.exports=vc}))),bc={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Cc={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},wc={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},kc={};function Bc(e){return yc.isMemo(e)?wc:kc[e.$$typeof]||bc}kc[yc.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},kc[yc.Memo]=wc;var Ec=Object.defineProperty,Sc=Object.getOwnPropertyNames,_c=Object.getOwnPropertySymbols,Ac=Object.getOwnPropertyDescriptor,Ic=Object.getPrototypeOf,Tc=Object.prototype;var xc=function e(r,t,n){if("string"!=typeof t){if(Tc){var a=Ic(t);a&&a!==Tc&&e(r,a,n)}var o=Sc(t);_c&&(o=o.concat(_c(t)));for(var i=Bc(r),s=Bc(t),c=0;c<o.length;++c){var l=o[c];if(!(Cc[l]||n&&n[l]||s&&s[l]||i&&i[l])){var u=Ac(t,l);try{Ec(r,l,u)}catch(e){}}}}return r};function Pc(){return"function"==typeof navigator.enumerateDevices?navigator.enumerateDevices():"object"===u(navigator.mediaDevices)&&"function"==typeof navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices():new Promise((function(e,r){try{if(null==window.MediaStreamTrack||null==window.MediaStreamTrack.getSources)throw new Error;window.MediaStreamTrack.getSources((function(r){e(r.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 r(e)}}))}var Rc=["camtwist","manycam","obs virtual","logi capture","iglasses","splitcam","virtual"],Dc=function(e){if(!e)return{isVirtual:!1};var r=e.getTracks();if(!r||!r.length)return{isVirtual:!1};var t=r[0].label,n=t&&Rc.some((function(e){return t.toLowerCase().includes(e)}));return{deviceLabel:t,isVirtual:n}},Nc=function(e,r){return!e||(1===navigator.maxTouchPoints||navigator.plugins.length>0&&!r)},Lc=function(){var e,r;return{updateTime:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"start";"start"===n?e=t:"end"===n&&(r=t)},getStart:function(){return e},getEnd:function(){return r}}},Oc={closeButton:{top:"10px",right:"10px",left:"auto",bottom:"auto",display:"block"}},Mc=Array.isArray,Uc="object"==typeof Ts&&Ts&&Ts.Object===Object&&Ts,Fc="object"==typeof self&&self&&self.Object===Object&&self,Vc=Uc||Fc||Function("return this")(),jc=Vc.Symbol,zc=Object.prototype,Hc=zc.hasOwnProperty,qc=zc.toString,Kc=jc?jc.toStringTag:void 0;var Gc=function(e){var r=Hc.call(e,Kc),t=e[Kc];try{e[Kc]=void 0;var n=!0}catch(e){}var a=qc.call(e);return n&&(r?e[Kc]=t:delete e[Kc]),a},Wc=Object.prototype.toString;var Qc=function(e){return Wc.call(e)},Xc=jc?jc.toStringTag:void 0;var Yc=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Xc&&Xc in Object(e)?Gc(e):Qc(e)};var Zc=function(e){return null!=e&&"object"==typeof e};var $c=function(e){return"symbol"==typeof e||Zc(e)&&"[object Symbol]"==Yc(e)},Jc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,el=/^\w*$/;var rl=function(e,r){if(Mc(e))return!1;var t=typeof e;return!("number"!=t&&"symbol"!=t&&"boolean"!=t&&null!=e&&!$c(e))||(el.test(e)||!Jc.test(e)||null!=r&&e in Object(r))};var tl=function(e){var r=typeof e;return null!=e&&("object"==r||"function"==r)};var nl,al=function(e){if(!tl(e))return!1;var r=Yc(e);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},ol=Vc["__core-js_shared__"],il=(nl=/[^.]+$/.exec(ol&&ol.keys&&ol.keys.IE_PROTO||""))?"Symbol(src)_1."+nl:"";var sl=function(e){return!!il&&il in e},cl=Function.prototype.toString;var ll=function(e){if(null!=e){try{return cl.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ul=/^\[object .+?Constructor\]$/,dl=Function.prototype,fl=Object.prototype,hl=dl.toString,pl=fl.hasOwnProperty,ml=RegExp("^"+hl.call(pl).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var gl=function(e){return!(!tl(e)||sl(e))&&(al(e)?ml:ul).test(ll(e))};var vl=function(e,r){return null==e?void 0:e[r]};var yl=function(e,r){var t=vl(e,r);return gl(t)?t:void 0},bl=yl(Object,"create");var Cl=function(){this.__data__=bl?bl(null):{},this.size=0};var wl=function(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r},kl=Object.prototype.hasOwnProperty;var Bl=function(e){var r=this.__data__;if(bl){var t=r[e];return"__lodash_hash_undefined__"===t?void 0:t}return kl.call(r,e)?r[e]:void 0},El=Object.prototype.hasOwnProperty;var Sl=function(e){var r=this.__data__;return bl?void 0!==r[e]:El.call(r,e)};var _l=function(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=bl&&void 0===r?"__lodash_hash_undefined__":r,this};function Al(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Al.prototype.clear=Cl,Al.prototype.delete=wl,Al.prototype.get=Bl,Al.prototype.has=Sl,Al.prototype.set=_l;var Il=Al;var Tl=function(){this.__data__=[],this.size=0};var xl=function(e,r){return e===r||e!=e&&r!=r};var Pl=function(e,r){for(var t=e.length;t--;)if(xl(e[t][0],r))return t;return-1},Rl=Array.prototype.splice;var Dl=function(e){var r=this.__data__,t=Pl(r,e);return!(t<0)&&(t==r.length-1?r.pop():Rl.call(r,t,1),--this.size,!0)};var Nl=function(e){var r=this.__data__,t=Pl(r,e);return t<0?void 0:r[t][1]};var Ll=function(e){return Pl(this.__data__,e)>-1};var Ol=function(e,r){var t=this.__data__,n=Pl(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this};function Ml(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Ml.prototype.clear=Tl,Ml.prototype.delete=Dl,Ml.prototype.get=Nl,Ml.prototype.has=Ll,Ml.prototype.set=Ol;var Ul=Ml,Fl=yl(Vc,"Map");var Vl=function(){this.size=0,this.__data__={hash:new Il,map:new(Fl||Ul),string:new Il}};var jl=function(e){var r=typeof e;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==e:null===e};var zl=function(e,r){var t=e.__data__;return jl(r)?t["string"==typeof r?"string":"hash"]:t.map};var Hl=function(e){var r=zl(this,e).delete(e);return this.size-=r?1:0,r};var ql=function(e){return zl(this,e).get(e)};var Kl=function(e){return zl(this,e).has(e)};var Gl=function(e,r){var t=zl(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this};function Wl(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Wl.prototype.clear=Vl,Wl.prototype.delete=Hl,Wl.prototype.get=ql,Wl.prototype.has=Kl,Wl.prototype.set=Gl;var Ql=Wl;function Xl(e,r){if("function"!=typeof e||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var t=function(){var n=arguments,a=r?r.apply(this,n):n[0],o=t.cache;if(o.has(a))return o.get(a);var i=e.apply(this,n);return t.cache=o.set(a,i)||o,i};return t.cache=new(Xl.Cache||Ql),t}Xl.Cache=Ql;var Yl=Xl;var Zl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$l=/\\(\\)?/g,Jl=function(e){var r=Yl(e,(function(e){return 500===t.size&&t.clear(),e})),t=r.cache;return r}((function(e){var r=[];return 46===e.charCodeAt(0)&&r.push(""),e.replace(Zl,(function(e,t,n,a){r.push(n?a.replace($l,"$1"):t||e)})),r}));var eu=function(e,r){for(var t=-1,n=null==e?0:e.length,a=Array(n);++t<n;)a[t]=r(e[t],t,e);return a},ru=jc?jc.prototype:void 0,tu=ru?ru.toString:void 0;var nu=function e(r){if("string"==typeof r)return r;if(Mc(r))return eu(r,e)+"";if($c(r))return tu?tu.call(r):"";var t=r+"";return"0"==t&&1/r==-Infinity?"-0":t};var au=function(e){return null==e?"":nu(e)};var ou=function(e,r){return Mc(e)?e:rl(e,r)?[e]:Jl(au(e))};var iu=function(e){if("string"==typeof e||$c(e))return e;var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r};var su=function(e,r){for(var t=0,n=(r=ou(r,e)).length;null!=e&&t<n;)e=e[iu(r[t++])];return t&&t==n?e:void 0};var cu,lu,uu,du,fu,hu=function(e,r,t){var n=null==e?void 0:su(e,r);return void 0===n?t:n},pu=function(e,r,t){return hu(e,r,hu(t,r,""))},mu=D.Errors,gu=c.default.div(cu||(cu=k(["\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"])),1e3,(function(e){return e.checkCameraMode&&"opacity: 0;"})),vu=c.default.video(lu||(lu=k(["\n width: 100%;\n ","\n"])),(function(e){return e.flipHorizontal&&"\n transform: scale(".concat(-1*e.scale,", ").concat(1*e.scale,");\n ")})),yu=c.default.div(uu||(uu=k(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),bu=c.default(yu)(du||(du=k(["\n z-index: ",";\n position: fixed;\n width: 20px;\n cursor: pointer;\n ","\n"])),2e3,(function(e){var r=e.theme;return n.css(["top:",";right:",";left:",";bottom:",";display:",";"],pu(r,"closeButton.top",Oc),pu(r,"closeButton.right",Oc),pu(r,"closeButton.left",Oc),pu(r,"closeButton.bottom",Oc),pu(r,"closeButton.display",Oc))})),Cu=c.default.div(fu||(fu=k(["\n z-index: ",";\n position: absolute;\n top: 40px;\n color: red;\n"])),1020),wu=i.default.createRef(),ku=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(r){return new Promise((function(t,n){e.call(navigator,r,t,n)}))}}:null}();function Bu(e){var t=e.checkCameraMode,n=e.frontCamera,a=e.onClose,o=e.children,s=e.onVideoPlayed,c=e.flipHorizontal,l=e.videoSettings,u=e.refVideo,d=e.onError,h=e.closeButton,p=e.videoClassName,m=e.scale,g=e.defaultCameraId,y=e.onWarning,b=r.useRef(),C=zt.useSDKSettings().lang,w=Cn.useSDKTracking().sendEvent,k=Bn.useAsset("ic_close.png"),E=B(r.useState(""),2),S=E[0],_=E[1],A=r.useRef(!1),I=r.useRef(!1),T=r.useRef(!1),x=r.useRef(),P=r.useRef([]),R=r.useRef(""),D=r.useCallback((function(e){d&&d(e)}),[d]),N=r.useCallback((function(){try{var e;clearInterval(b.current),(null==u||null===(e=u.current)||void 0===e?void 0:e.srcObject)instanceof MediaStream&&(u.current.srcObject.getTracks().forEach((function(e){return e.stop()})),u.current.srcObject=null)}catch(e){}clearTimeout(x)}),[u]);function L(){return O.apply(this,arguments)}function O(){return(O=f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Pc();case 3:r=e.sent,P.current=r.filter((function(e){return e.deviceId&&"videoinput"===e.kind})),ws.addExifData("device_info.camera_list",JSON.stringify(P.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)}b.current||(b.current=setInterval((function(){document.getElementById("tv-camera-".concat(b.current))||N()}),1e3)),r.useEffect((function(){return function(){T.current=!0}}),[]);var M=r.useCallback((function(){x.current||(x.current=setTimeout((function(){A.current||(_(mu.camera_timeout.msg[C]),D(mu.camera_timeout))}),2e4))}),[C,D]),U=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,a,o,i,s,c,u,d,f,h,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=p.length>1&&void 0!==p[1]&&p[1],a={},!1!==window.tv_last_req_camera_complete){e.next=5;break}return y&&y("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,a=Rs.isMobile?Rs.isIOS?{width:{ideal:1460},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{height:{ideal:720},aspectRatio:{ideal:window.innerHeight/window.innerWidth}}:{width:{ideal:9999}},o=Lc(),i=o.updateTime,s=o.getStart,c=o.getEnd,e.prev=8,u=l||a,i(performance.now(),"start"),Nc(Rs.isMobile,Rs.isIOS)&&n&&(u={}),t&&(u={}),ws.addExifData("device_info.camera_label_dimension.req",JSON.stringify(u)),d={audio:!1,video:v(v({},r?{deviceId:r}:{facingMode:n?"user":"environment"}),u)},e.next=17,ku.getUserMedia(d);case 17:return f=e.sent,e.next=20,L();case 20:if(M(),f){e.next=25;break}return _(mu.not_supported.msg[C]),D(mu.not_supported),e.abrupt("return",null);case 25:i(performance.now(),"end"),window.tv_last_req_camera_complete=!0,c()-s()<1600?w({tag:"cam_permission",event:"user_activity.cam",log:{already_enable:!0}}):w({tag:"cam_permission",event:"user_activity.allow",log:{}});try{h=f.getVideoTracks()[0].getSettings(),ws.addExifData("device_info.camera_label_dimension.got","".concat(h.width,"x").concat(h.height))}catch(e){}return e.abrupt("return",f);case 32:e.prev=32,e.t0=e.catch(8),i(performance.now(),"end"),"NotAllowedError"===e.t0.name?(_(mu.no_permission.msg[C]),D(mu.no_permission),I.current=!0,w({tag:"cam_permission",event:"user_activity.cam",log:c()-s()<1600?{already_block:!0}:{click_block_on_popup:!0}})):I.current&&("NotReadableError"===e.t0.name?(D(mu.not_readable),_(mu.not_readable.msg[C])):(_(e.t0.message),D({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(r){return e.apply(this,arguments)}}(),[n,l,C,D,y,M,w]),F=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,c,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]:g,a=h.length>1&&void 0!==h[1]&&h[1],!(null!=(o=u.current)&&null!==(r=o.srcObject)&&void 0!==r&&r.id&&null!=o&&null!==(t=o.srcObject)&&void 0!==t&&t.active&&A.current)){e.next=5;break}return e.abrupt("return");case 5:return o.oncanplaythrough=function(){var e,r,t;o.play(),ws.addExifData("device_info.camera_label",null===(e=i)||void 0===e||null===(r=e.getVideoTracks())||void 0===r||null===(t=r[0])||void 0===t?void 0:t.label),A.current=!0,_("");var n=window.innerWidth,a=window.innerHeight,c=Zn.analyzeVideoAndWindowSizes(o),l=c.lostX,u=void 0===l?0:l,d=c.lostY,f=void 0===d?0:d,h=Math.min(n,Math.floor(n-2*u)),p=Math.min(a,Math.floor(a-2*f));s&&s({clientWidth:n,clientHeight:a,videoAreaWidth:h,videoAreaHeight:p,lostX:u,lostY:f})},e.next=8,U(n,a);case 8:i=e.sent,c=Dc(i),l=c.deviceLabel,(d=c.isVirtual)&&(R.current+="".concat(l,", "),(f=P.current.filter((function(e){return!R.current.includes(e.label)})))[0]&&f[0].deviceId&&F(f[0].deviceId)),i||I.current||(ws.addExifData("device_info.camera_label_retry","yes"),I.current=!0,F(n,!0)),i&&T.current&&(u.current.srcObject=i,N()),!i||T.current||d||(o.srcObject=i);case 14:case"end":return e.stop()}}),e)}))),[u,U,s,g,N]);r.useEffect((function(){function e(){return(e=f(regeneratorRuntime.mark((function e(){var r,t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F();case 2:return e.next=4,Pc();case 4:r=e.sent,(t=r.filter((function(e){return"videoinput"===e.kind&&e.label.includes("back")&&e.label.includes("0")}))).length>0&&(n=t[0].deviceId,N(),F(n));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var r=u.current;return A.current?function(){}:(!ku||Rs.browserName&&["facebook"].includes(Rs.browserName.toLowerCase())||Rs.getUA.includes("Zalo iOS")?(_(mu.not_supported.msg[C]),D(mu.not_supported)):r&&(Rs.isAndroid&&!1===n?function(){e.apply(this,arguments)}():F()),function(){T.current&&N()})}),[u,C,n,F,N,D]);var V=r.useCallback((function(){N(),a&&a(),w({tag:"result",event:"user_activity.cancel",log:{}})}),[a,N,w]);return i.default.createElement(gu,{id:"tv-camera-".concat(b.current),checkCameraMode:t},function(){if(!S)return null;var e=mu.no_permission.msg[C];return S===e&&Rs.isIOS?i.default.createElement(Cu,null,S," ",i.default.createElement("button",{onClick:function(){window.location.reload()}},{vi:"Cấp lại quyền truy cập camera",en:"Request camera permission"}[C])):i.default.createElement(Cu,null,S)}(),i.default.createElement(vu,{ref:u,playsInline:!0,muted:!0,flipHorizontal:c,className:p,scale:m}),o,h?i.default.cloneElement(h,{onClick:V,"data-testid":"close-camera"}):i.default.createElement(bu,{onClick:V,"data-testid":"close-camera"},i.default.createElement("img",{src:k,alt:""})))}Bu.propTypes={checkCameraMode:s.default.bool,frontCamera:s.default.bool,onClose:s.default.func,onError:s.default.func,onVideoPlayed:s.default.func,children:s.default.node,flipHorizontal:s.default.bool,videoSettings:s.default.object,refVideo:s.default.object,closeButton:s.default.node,videoClassName:s.default.string,scale:s.default.number,defaultCameraId:s.default.string,onWarning:s.default.func},Bu.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 Eu,Su,_u,Au=function(e,t,n){class a extends r.Component{constructor(){super(...arguments),this.updateDebounced=Xs(this.forceUpdate,t,n)}shouldComponentUpdate(){return this.updateDebounced(),!1}componentWillUnmount(){this.updateDebounced.cancel()}render(){return i.default.createElement(e,Object.assign({},this.props))}}return a.displayName=`debounceRender(${e.displayName||e.name||"Component"})`,xc(a,e)}(Bu,250),Iu=i.default.forwardRef((function(e,r){return i.default.createElement(Bu,m({},e,{refVideo:r||wu}))})),Tu=i.default.forwardRef((function(e,r){return i.default.createElement(Au,m({},e,{refVideo:r||wu}))})),xu=c.default.table(Eu||(Eu=k(["\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"]))),Pu=c.default.div(Su||(Su=k(["\n position: relative;\n"]))),Ru=Array.from(Array(3).keys()),Du=Array.from(Array(3).keys());function Nu(e){var r=e.children,t=e.x,n=e.y,a=e.width,o=e.height,s=e.className,c=e.surroundStyle;return i.default.createElement(xu,{className:s},i.default.createElement("tbody",null,Ru.map((function(e,s){return i.default.createElement("tr",{key:e,style:{height:0===s?n:"auto"},"data-testid":"row"},Du.map((function(e,n){var l=1===s&&1===n,u="auto";return l?u=a:0===n&&(u=t),i.default.createElement("td",{"data-testid":l?"centeredCell":"cell",key:e,style:v({width:u,height:l?o:"auto"},l?{}:c)},l?i.default.createElement(Pu,{style:{width:u,height:o}},r):null)})))}))))}Nu.propTypes={children:s.default.node,x:s.default.string,y:s.default.string,width:s.default.string,height:s.default.string,className:s.default.string,surroundStyle:s.default.object},Nu.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var Lu=c.default(Nu)(_u||(_u=k(["\n background: transparent;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: ",";\n"])),1010);function Ou(e){var r=e.className;return i.default.createElement("svg",{className:r,width:"38px",height:"32px",viewBox:"0 0 24 21","data-testid":"camera-icon"},i.default.createElement("title",null,"FA45C15C-1E21-4D7B-9585-07FB9F999CB8"),i.default.createElement("desc",null,"Created with sketchtool."),i.default.createElement("g",{id:"Web-demo",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},i.default.createElement("g",{id:"step1",transform:"translate(-950.000000, -380.000000)",fill:"currentColor",fillRule:"nonzero"},i.default.createElement("g",{id:"Group",transform:"translate(950.000000, 380.000000)"},i.default.createElement("g",{id:"Group-2"},i.default.createElement("g",{id:"camera"},i.default.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"})))))))}Ou.propTypes={className:s.default.string},Ou.defaultProps={className:""};var Mu=function(){return Vc.Date.now()},Uu=/\s/;var Fu=function(e){for(var r=e.length;r--&&Uu.test(e.charAt(r)););return r},Vu=/^\s+/;var ju=function(e){return e?e.slice(0,Fu(e)+1).replace(Vu,""):e},zu=/^[-+]0x[0-9a-f]+$/i,Hu=/^0b[01]+$/i,qu=/^0o[0-7]+$/i,Ku=parseInt;var Gu=function(e){if("number"==typeof e)return e;if($c(e))return NaN;if(tl(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=tl(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=ju(e);var t=Hu.test(e);return t||qu.test(e)?Ku(e.slice(2),t?2:8):zu.test(e)?NaN:+e},Wu=Math.max,Qu=Math.min;var Xu=function(e,r,t){var n,a,o,i,s,c,l=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(r){var t=n,o=a;return n=a=void 0,l=r,i=e.apply(o,t)}function p(e){return l=e,s=setTimeout(g,r),u?h(e):i}function m(e){var t=e-c;return void 0===c||t>=r||t<0||d&&e-l>=o}function g(){var e=Mu();if(m(e))return v(e);s=setTimeout(g,function(e){var t=r-(e-c);return d?Qu(t,o-(e-l)):t}(e))}function v(e){return s=void 0,f&&n?h(e):(n=a=void 0,i)}function y(){var e=Mu(),t=m(e);if(n=arguments,a=this,c=e,t){if(void 0===s)return p(c);if(d)return clearTimeout(s),s=setTimeout(g,r),h(c)}return void 0===s&&(s=setTimeout(g,r)),i}return r=Gu(r)||0,tl(t)&&(u=!!t.leading,o=(d="maxWait"in t)?Wu(Gu(t.maxWait)||0,r):o,f="trailing"in t?!!t.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),l=0,n=c=a=s=void 0},y.flush=function(){return void 0===s?i:v(Mu())},y};var Yu=function(e,r,t){var n=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return tl(t)&&(n="leading"in t?!!t.leading:n,a="trailing"in t?!!t.trailing:a),Xu(e,r,{leading:n,maxWait:r,trailing:a})},Zu=function(){try{var e=yl(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var $u=function(e,r,t){"__proto__"==r&&Zu?Zu(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t},Ju=Object.prototype.hasOwnProperty;var ed=function(e,r,t){var n=e[r];Ju.call(e,r)&&xl(n,t)&&(void 0!==t||r in e)||$u(e,r,t)};var rd=function(e,r,t,n){var a=!t;t||(t={});for(var o=-1,i=r.length;++o<i;){var s=r[o],c=n?n(t[s],e[s],s,t,e):void 0;void 0===c&&(c=e[s]),a?$u(t,s,c):ed(t,s,c)}return t};var td=function(e){return e};var nd=function(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)},ad=Math.max;var od=function(e,r,t){return r=ad(void 0===r?e.length-1:r,0),function(){for(var n=arguments,a=-1,o=ad(n.length-r,0),i=Array(o);++a<o;)i[a]=n[r+a];a=-1;for(var s=Array(r+1);++a<r;)s[a]=n[a];return s[r]=t(i),nd(e,this,s)}};var id=function(e){return function(){return e}},sd=Zu?function(e,r){return Zu(e,"toString",{configurable:!0,enumerable:!1,value:id(r),writable:!0})}:td,cd=Date.now;var ld=function(e){var r=0,t=0;return function(){var n=cd(),a=16-(n-t);if(t=n,a>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}(sd);var ud=function(e,r){return ld(od(e,r,td),e+"")};var dd=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var fd=function(e){return null!=e&&dd(e.length)&&!al(e)},hd=/^(?:0|[1-9]\d*)$/;var pd=function(e,r){var t=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==t||"symbol"!=t&&hd.test(e))&&e>-1&&e%1==0&&e<r};var md=function(e,r,t){if(!tl(t))return!1;var n=typeof r;return!!("number"==n?fd(t)&&pd(r,t.length):"string"==n&&r in t)&&xl(t[r],e)};var gd=function(e){return ud((function(r,t){var n=-1,a=t.length,o=a>1?t[a-1]:void 0,i=a>2?t[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,i&&md(t[0],t[1],i)&&(o=a<3?void 0:o,a=1),r=Object(r);++n<a;){var s=t[n];s&&e(r,s,n,o)}return r}))};var vd=function(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n};var yd=function(e){return Zc(e)&&"[object Arguments]"==Yc(e)},bd=Object.prototype,Cd=bd.hasOwnProperty,wd=bd.propertyIsEnumerable,kd=yd(function(){return arguments}())?yd:function(e){return Zc(e)&&Cd.call(e,"callee")&&!wd.call(e,"callee")};var Bd=function(){return!1},Ed=Ps((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t?Vc.Buffer:void 0,o=(a?a.isBuffer:void 0)||Bd;e.exports=o})),Sd={};Sd["[object Float32Array]"]=Sd["[object Float64Array]"]=Sd["[object Int8Array]"]=Sd["[object Int16Array]"]=Sd["[object Int32Array]"]=Sd["[object Uint8Array]"]=Sd["[object Uint8ClampedArray]"]=Sd["[object Uint16Array]"]=Sd["[object Uint32Array]"]=!0,Sd["[object Arguments]"]=Sd["[object Array]"]=Sd["[object ArrayBuffer]"]=Sd["[object Boolean]"]=Sd["[object DataView]"]=Sd["[object Date]"]=Sd["[object Error]"]=Sd["[object Function]"]=Sd["[object Map]"]=Sd["[object Number]"]=Sd["[object Object]"]=Sd["[object RegExp]"]=Sd["[object Set]"]=Sd["[object String]"]=Sd["[object WeakMap]"]=!1;var _d=function(e){return Zc(e)&&dd(e.length)&&!!Sd[Yc(e)]};var Ad=function(e){return function(r){return e(r)}},Id=Ps((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t&&Uc.process,o=function(){try{var e=n&&n.require&&n.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=o})),Td=Id&&Id.isTypedArray,xd=Td?Ad(Td):_d,Pd=Object.prototype.hasOwnProperty;var Rd=function(e,r){var t=Mc(e),n=!t&&kd(e),a=!t&&!n&&Ed(e),o=!t&&!n&&!a&&xd(e),i=t||n||a||o,s=i?vd(e.length,String):[],c=s.length;for(var l in e)!r&&!Pd.call(e,l)||i&&("length"==l||a&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||pd(l,c))||s.push(l);return s},Dd=Object.prototype;var Nd=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||Dd)};var Ld=function(e){var r=[];if(null!=e)for(var t in Object(e))r.push(t);return r},Od=Object.prototype.hasOwnProperty;var Md=function(e){if(!tl(e))return Ld(e);var r=Nd(e),t=[];for(var n in e)("constructor"!=n||!r&&Od.call(e,n))&&t.push(n);return t};var Ud=function(e){return fd(e)?Rd(e,!0):Md(e)},Fd=gd((function(e,r,t,n){rd(r,Ud(r),e,n)}));var Vd=function(e,r){return function(t){return e(r(t))}},jd=Vd(Object.getPrototypeOf,Object),zd=Function.prototype,Hd=Object.prototype,qd=zd.toString,Kd=Hd.hasOwnProperty,Gd=qd.call(Object);var Wd=function(e){if(!Zc(e)||"[object Object]"!=Yc(e))return!1;var r=jd(e);if(null===r)return!0;var t=Kd.call(r,"constructor")&&r.constructor;return"function"==typeof t&&t instanceof t&&qd.call(t)==Gd};var Qd=function(e){if(!Zc(e))return!1;var r=Yc(e);return"[object Error]"==r||"[object DOMException]"==r||"string"==typeof e.message&&"string"==typeof e.name&&!Wd(e)},Xd=ud((function(e,r){try{return nd(e,void 0,r)}catch(e){return Qd(e)?e:new Error(e)}}));var Yd=function(e,r){return eu(r,(function(r){return e[r]}))},Zd=Object.prototype,$d=Zd.hasOwnProperty;var Jd=function(e,r,t,n){return void 0===e||xl(e,Zd[t])&&!$d.call(n,t)?r:e},ef={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var rf=function(e){return"\\"+ef[e]},tf=Vd(Object.keys,Object),nf=Object.prototype.hasOwnProperty;var af=function(e){if(!Nd(e))return tf(e);var r=[];for(var t in Object(e))nf.call(e,t)&&"constructor"!=t&&r.push(t);return r};var of=function(e){return fd(e)?Rd(e):af(e)},sf=/<%=([\s\S]+?)%>/g;var cf=function(e){return function(r){return null==e?void 0:e[r]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),lf=/[&<>"']/g,uf=RegExp(lf.source);var df={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:sf,variable:"",imports:{_:{escape:function(e){return(e=au(e))&&uf.test(e)?e.replace(lf,cf):e}}}},ff=/\b__p \+= '';/g,hf=/\b(__p \+=) '' \+/g,pf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mf=/[()=,{}\[\]\/\s]/,gf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vf=/($^)/,yf=/['\n\r\u2028\u2029\\]/g,bf=Object.prototype.hasOwnProperty;var Cf=function(e,r,t){var n=df.imports._.templateSettings||df;t&&md(e,r,t)&&(r=void 0),e=au(e),r=Fd({},r,n,Jd);var a,o,i=Fd({},r.imports,n.imports,Jd),s=of(i),c=Yd(i,s),l=0,u=r.interpolate||vf,d="__p += '",f=RegExp((r.escape||vf).source+"|"+u.source+"|"+(u===sf?gf:vf).source+"|"+(r.evaluate||vf).source+"|$","g"),h=bf.call(r,"sourceURL")?"//# sourceURL="+(r.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(f,(function(r,t,n,i,s,c){return n||(n=i),d+=e.slice(l,c).replace(yf,rf),t&&(a=!0,d+="' +\n__e("+t+") +\n'"),s&&(o=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=c+r.length,r})),d+="';\n";var p=bf.call(r,"variable")&&r.variable;if(p){if(mf.test(p))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(ff,""):d).replace(hf,"$1").replace(pf,"$1;"),d="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Xd((function(){return Function(s,h+"return "+d).apply(void 0,c)}));if(m.source=d,Qd(m))throw m;return m},wf=D.Errors;function kf(e){var t=e.livenessSettings,n=e.apiClient,a=e.apiCheck,o=e.onError,i=B(r.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,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}}),2),s=i[0],c=i[1];return r.useEffect((function(){t&&Object.keys(t).length>0?c((function(e){return v(v({},e),t)})):a&&n.clientSettings().then((function(e){if(e&&e.data){var r,t=hu(e,"data.settings.sdk_settings.active_liveness_settings"),n=hu(e,"data.settings.sdk_settings.liveness_settings"),a=hu(t,"save_encoded_frames",{});a.enable&&(r={enable:!0,framesIntervalTime:a.frames_interval_ms,framesBatchLength:a.frames_batch_len});var i=hu(e,"data.settings.sdk_settings.liveness_settings.exif_data_settings",{enable:!0});c(v(v(v({},t),n),{},{captureFrameSettings:r,exif_data_settings:i}))}e&&e.errors&&o(wf.server_error)})).catch((function(e){o(e)}))}),[t,n,o,a]),s}var Bf=function(e){var r=e.curStep,t=e.faceDirection,n=hu(r,"stepTimeConstraints.delayTime");return!!n&&(null===r.firstFrameSpottedAt?(r.name===t&&(r.firstFrameSpottedAt=(new Date).getTime()),!0):(new Date).getTime()-r.firstFrameSpottedAt<n)};var Ef=function(e){return e?Infinity===(e=Gu(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var Sf=function(e){var r=Ef(e),t=r%1;return r==r?t?r-t:r:0};var _f=function(e,r){var t;if("function"!=typeof r)throw new TypeError("Expected a function");return e=Sf(e),function(){return--e>0&&(t=r.apply(this,arguments)),e<=1&&(r=void 0),t}};var Af=function(e){return _f(2,e)},If=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.closeEyesModelUrl,n=void 0===t?ks:t,e.next=3,ei.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();function Tf(){return(Tf=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,l,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>0&&void 0!==u[0]?u[0]:{},t=r.blazefaceModelUrl,n=r.tfScriptUrls,a=r.closeEyesModelUrl,o=new Bs(a),e.next=4,ei.loadTensorFlow(n);case 4:return e.next=6,ei.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return i=[ei.loadBlazefaceModel({modelUrl:t}),o.load()],e.next=9,Promise.all(i);case 9:return s=e.sent,c=B(s,1),l=c[0].blazefaceModel,e.abrupt("return",{blazefaceModel:l,closeEyesModel:o});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var xf,Pf=Af((function(){return Tf.apply(this,arguments)})),Rf=[],Df=function(){Rf=[]},Nf=function(e,r,t){t&&Df(),Rf.push({id:null});var n=Rf.length-1;r.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})}).then((function(e){e&&e.data&&e.data.file_id?Rf[n].id=e.data.file_id:Rf[n].id=-1}))},Lf=function(e){return e.enable?Rf.some((function(e){return-1===e.id}))?null:Rf:[]},Of=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.steps,n=r.apiClient,a=r.FaceDirection,o=r.outputEncryptionSettings,i=r.video,s=[],t.forEach((function(e){var r=e.name,t=e.image,i=e.frontalFaceImage;if(r!==a.FRONTAL){var c={label:"portrait",metadata:JSON.stringify({gesture_score:t.leftRightScore,gesture:r})};o&&o.key?s.push(n.httpClient.post("/v1/images",v({base64:t.encrypted.hex},c),{"X-TV-Key":o.key})):s.push(n.uploadImage(v({file:t.blob},c)))}else s.push(Promise.resolve({data:{image_id:null}}));if(i.blob){var l={label:"portrait",metadata:JSON.stringify({gesture_score:i.leftRightScore,gesture:a.FRONTAL})};o&&o.key?s.push(n.httpClient.post("/v1/images",v({base64:i.encrypted.hex},l),{"X-TV-Key":o.key})):s.push(n.uploadImage(v({file:i.blob},l)))}else s.push(Promise.resolve({data:{image_id:null}}))})),c=i?n.uploadFile({file:i,label:"video"}):Promise.resolve({data:{file_id:null}}),e.next=6,Promise.all([c].concat(s));case 6:return l=e.sent,u=S(h=l)||_(h)||A(h)||T(),d=u[0],f=u.slice(1),t.forEach((function(e,r){e.image.imageId=f[2*r].data.image_id,e.frontalFaceImage.imageId=f[2*r+1].data.image_id})),e.abrupt("return",d);case 12:case"end":return e.stop()}var h}),e)})));return function(r){return e.apply(this,arguments)}}(),Mf=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h,p,m,g,v,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.apiClient,n=r.faceVerificationFlowData,a=r.onLivenessDetectionDone,o=r.captureFrameSettings,i=r.FaceDirection,s=r.onError,c=r.outputEncryptionSettings,l=r.video,e.prev=1,u=n.current.steps,e.next=5,Of({steps:u,apiClient:t,FaceDirection:i,outputEncryptionSettings:c,video:l});case 5:if(0!==(d=u.filter((function(e){return e.frontalFaceImage.imageId}))).length){e.next=10;break}a({error:"wrong_face_movement"}),e.next=27;break;case 10:return e.next=12,new Promise((function(e){var r=setInterval((function(){Rf.every((function(e){return e.id}))&&(e(),clearInterval(r))}),200)}));case 12:if(f=Lf(o)){e.next=17;break}a({error:"network_error"}),e.next=27;break;case 17:return h=t.verifyFaceLiveness({images:d.map((function(e){return{id:e.frontalFaceImage.imageId}})),gesture_images:u.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){return{gesture:e.name,images:[{id:e.image.imageId}]}})),videos:f}),p=t.requestVerifyPortrait({image:{id:d[d.length-1].frontalFaceImage.imageId}}),e.next=21,Promise.all([h,p]);case 21:m=e.sent,g=B(m,2),v=g[0],y=g[1],b=!0===v.data.is_live,a({apiCheckPassed:b,verifyFaceLivenessResult:v.data,verifyFacePortraitResult:y.data,frontalFaces:d.map((function(e){return{id:e.frontalFaceImage.imageId,blob:e.frontalFaceImage.blob}})),steps:u.filter((function(e){return e.image.imageId&&e.name!==i.FRONTAL})).map((function(e){var r=e.name,t=e.image;return{name:r,blob:t.blob,id:t.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(r){return e.apply(this,arguments)}}(),Uf=[],Ff=null,Vf=!1,jf=function(){return Uf},zf=function(){Vf=!0,Uf=[];try{Ff instanceof MediaStream&&(Ff.getTracks().forEach((function(e){return e.stop()})),Ff=null)}catch(e){}};function Hf(e,r,t){if(e.data.size>0){var n=new Blob([e.data],{type:"video/mp4"});Uf.push(n),r()}else console.error("No video have recored!"),t()}function qf(e,r,t,n){if(e&&n){var a=n.cropX,o=n.cropY,i=n.cropWidth,s=n.cropHeight;e.drawImage(r,a,o,i,s,0,0,t,t),Vf||requestAnimationFrame((function(){return qf(e,r,t,n)}))}}function Kf(e){return Gf.apply(this,arguments)}function Gf(){return(Gf=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.outputImagesSize,n=r.videoEl,a=r.resultAnalyzeVideoAndWindowSizes,zf(),(i=document.createElement("canvas")).width=t,i.height=t,s=i.getContext("2d"),e.prev=6,c={width:{min:360,ideal:400},height:{min:360,ideal:400}},l={mimeType:"video/webm"},e.prev=9,Ff=null==n||null===(u=n.captureStream())||void 0===u?void 0:u.clone(),d=Ff.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")&&(Vf=!1,qf(s,n,t,a),Ff=i.captureStream(25),l={mimeType:"video/mp4",videoBitsPerSecond:25e5}),o=new MediaRecorder(Ff,l),h=function(){return new Promise((function(e,r){o.ondataavailable=function(t){return Hf(t,e,r)},"inactive"!==o.state&&o.stop()}))},p=function(){var e=f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h();case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),m=function(){"inactive"!==o.state&&o.stop()},o.stopVideoRecording=p,o.discardRecording=m,e.next=29;break;case 27:e.prev=27,e.t1=e.catch(6);case 29:return e.abrupt("return",{mediaRecorder:o});case 30:case"end":return e.stop()}}),e,null,[[6,27],[9,16]])})))).apply(this,arguments)}var Wf,Qf,Xf,Yf,Zf,$f,Jf,eh=ha.faceTracker(),rh=new oi,th=D.Mode,nh=D.FaceDirection,ah=D.Errors,oh=D.Messages,ih=D.TrackLivenessEvents,sh={captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},customStepTimeConstraints:(xf={},p(xf,D.FaceDirection.UP,{delayTime:0}),p(xf,D.FaceDirection.LEFT,{delayTime:0}),p(xf,D.FaceDirection.RIGHT,{delayTime:0}),p(xf,D.FaceDirection.FRONTAL,{delayTime:2e3}),xf),setRemainingTime:function(){},onFramesCaptured:function(){},onProcessing:function(){}};function ch(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCheck,n=e.mode,a=e.bgCameraMask,o=e.bgCameraMaskRed,i=e.surroundStyle,s=e.cropAreaDimension,c=e.customInstructions,l=e.customIcon,d=e.customDirectionIcon,h=e.customStepTimeConstraints,m=void 0===h?sh.customStepTimeConstraints:h,g=e.onLivenessDetectionDone,y=e.onError,b=e.frontalMinSize,C=e.waitingTimeToGetBetterFrames,w=void 0===C?500:C,k=e.captureFrameSettings,S=void 0===k?sh.captureFrameSettings:k,_=e.livenessSettings,A=e.setRemainingTime,I=void 0===A?sh.setRemainingTime:A,T=e.onProcessing,x=void 0===T?sh.onProcessing:T,P=e.customErrors,R=e.customMessages,N=e.apiCredentials,L=void 0===N?{}:N,O=e.onFramesCaptured,M=void 0===O?sh.onFramesCaptured:O,U=e.initFirstGestureTimeout,F=void 0===U?2e3:U,V=e.outputEncryptionSettings,j=e.cameraScale,z=void 0===j?1:j,H=e.passiveModeAuto,q=void 0!==H&&H,K=e.sendCustomEvent,G=r.useState(!1),W=B(G,2),Q=W[0],X=W[1],Y=r.useState(!1),Z=B(Y,2),$=Z[0],J=Z[1],ee=r.useState(!1),re=B(ee,2),te=re[0],ne=re[1],ae=r.useRef(null),oe=zt.useSDKSettings(),ie=oe.lang,se=oe.assetRoot,ce=oe.customUrls,le=Ao.useApiClient({apiCredentials:L}),ue=le.apiClient,de=n===th.ACTIVE,fe=r.useReducer((function(e){return e+1}),0),he=B(fe,2),pe=(he[0],he[1]),me=r.useRef(null),ge=r.useRef(!1),ve=r.useState(!1),ye=B(ve,2),be=ye[0],Ce=ye[1],we=r.useRef({}),ke=Cn.useSDKTracking(),Be=ke.sendEvent,Ee=Ss(),Se=Ee.startMotion,_e=Ee.stopMotion,Ae=Ee.motionData,Ie=Ee.orientationData,Te=r.useRef(null);null===Te.current&&(Te.current=ha.initFaceVerificationData({assetRoot:se,customInstructions:c,customIcon:l,customDirectionIcon:d,customStepTimeConstraints:m}));var xe=r.useState(),Pe=B(xe,2),Re=Pe[0],De=Pe[1],Ne=r.useCallback((function(e){De(e)}),[]),Le=r.useMemo((function(){return Yu(Ne,500)}),[Ne]),Oe=r.useRef([]),Me=r.useRef(),Ue=kf({livenessSettings:_,apiClient:ue,apiCheck:t,onError:y}),Fe=Ue.face_tracking_setting,Ve=Ue.flow_interval_time_ms,je=Ue.limit_time_liveness_check,ze=Ue.terminate_if_no_face,He=Ue.close_eye_detector,qe=void 0===He?{}:He,Ke=Ue.captureFrameSettings,Ge=void 0===Ke?S:Ke,We=Ue.exif_data_settings,Qe=Ue.record_video,Xe=null==Qe?void 0:Qe.enable,Ye=r.useRef(""),Ze=r.useCallback((function(e){if(null!=e&&e.event){if(e.event===(null==ih?void 0:ih.show_alert)){var r,t=null===(r=e.log)||void 0===r?void 0:r.alert;if(t===Ye.current)return;Ye.current=t}Be(e),K&&K(e)}}),[K,Be]),$e=r.useMemo((function(){return Yu((function(e){Ze(e)}),2e3)}),[Ze]),Je=r.useRef(0),er=r.useRef(),rr=r.useRef();r.useEffect((function(){Ze({tag:"selfie",event:null==ih?void 0:ih.start_camera,log:{}})}),[Ze]),r.useEffect((function(){return rh.start(),ws.initExifData(),function(){rh.stop()}}),[]),r.useEffect((function(){var e=!1;function r(){return(r=f(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(be){r.next=13;break}return Me.current=performance.now(),r.next=4,Pf(ce);case 4:return we.current=r.sent,r.next=7,ei.initTensorFlow({preferredBackends:["wasm","webgl","cpu"]});case 7:if(!e){r.next=9;break}return r.abrupt("return");case 9:Ce(!0),Ze({tag:"selfie",event:null==ih?void 0:ih.show_warmup,log:{}}),Ze({tag:"selfie",event:null==ih?void 0:ih.finish_load_model,log:{status:"success",time_in_ms:performance.now()-Me.current}}),Me.current=null;case 13:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){e=!0}}),[be,ce,Ze]);var tr=r.useCallback((function(){var e;I(""),Te.current.curStepIndex=Te.current.steps.length,J(!1),rh.stop(),null===(e=rr.current)||void 0===e||e.discardRecording(),setTimeout((function(){var e;Te.current=ha.initFaceVerificationData({assetRoot:se,customInstructions:c,customIcon:l,customDirectionIcon:d}),rh.start(),Je.current=0,er.current=null,Oe.current=[],ne(!1),Df(),null===(e=rr.current)||void 0===e||e.start(),pe()}),Ve)}),[se,c,l,d,Ve,I]),nr=r.useMemo((function(){return v(v({},ah),P)}),[P]),ar=r.useMemo((function(){return v(v({},oh),R)}),[R]),or=400;r.useEffect((function(){if(Q&&je.enable&&te){var e=je.limit_time_second+1,r=je.remain_time_show||10,t=je.format||"s";rh.start("limit",(function(n){var a=e-n;if(Te.current.curStepIndex<Te.current.steps.length){if(a<=r&&a>=1){var o=Cf(ar.REMAIN_TIME[ie]),i=a;switch(t){case"mm:ss":i=a.toString().padStart(5,"00:00");break;case"ss":i=a.toString().padStart(2,"0")}I(o({x:i}))}if(0===a){var s,c={};Object.keys(null===(s=nr.liveness_terminated_time_out)||void 0===s?void 0:s.msg).forEach((function(e){var r,t=Cf(null===(r=nr.liveness_terminated_time_out)||void 0===r?void 0:r.msg[e]);c[e]=t({x:je.limit_time_second})})),De(v(v({},nr.liveness_terminated_time_out),{},{msg:c,duration:Ve})),Ze({tag:"selfie",event:null==ih?void 0:ih.show_alert,log:{alert:"liveness_terminated_time_out,"}}),tr()}}}))}}),[tr,I,Q,ie,Ve,je.enable,je.limit_time_second,te,nr.liveness_terminated_time_out,ar.REMAIN_TIME,je.format,je.remain_time_show,Ze]);var ir=r.useCallback((function(e){var r,t,n=e.clientWidth,o=e.clientHeight,c=e.videoAreaWidth,l=e.videoAreaHeight,d=e.lostX,f=e.lostY;Rs.isMobile?t=r=c:r=t=l-200;var h=Math.floor((c-r)/2)+d,p=5+f,m=a;me.current={x:h,y:p,width:r,height:t,image:m,surroundStyle:i},"object"===u(s)?me.current=v(v({},me.current),s):"function"==typeof s&&(me.current=v(v({},me.current),s({clientWidth:n,clientHeight:o,videoAreaWidth:c,videoAreaHeight:l,lostX:d,lostY:f,isMobile:Rs.isMobile,width:r,height:t}))),pe(),X(!0)}),[a,i,s]),sr=r.useState(3),cr=B(sr,2),lr=cr[0],ur=cr[1],dr=r.useState(!1),fr=B(dr,2),hr=fr[0],pr=fr[1],mr=r.useRef(!1),gr=r.useCallback((function(e){pr(e),mr.current=e}),[]),vr=r.useRef(null),yr=r.useRef([]),br=r.useCallback((function(){ur(3),clearInterval(vr.current),gr(!0);var e=function(){var e=f(regeneratorRuntime.mark((function e(r){var n,a,o,i,s,c,l,u,d,f,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r-1!=0){e.next=25;break}return clearInterval(vr.current),a=yr.current,x(),e.next=6,null===(n=rr.current)||void 0===n?void 0:n.stopVideoRecording();case 6:return _e(),ws.preWriteExif({mode:ws.MODE.SELFIE,motionData:Ae,orientationData:Ie,startTime:Date.now()-1e3*rh.duration("from_1st_frame"),endTime:Date.now()}),o=a.map((function(e){return po.resizeBlobImg(e.blob,or,or)})),e.next=11,Promise.all(o);case 11:return i=e.sent,s=i.map((function(e,r){return ws.writeExif({mode:ws.MODE.SELFIE,imageData:v(v({},a[r]),{},{blob:e,gesture:"frontal"}),enableExifData:We.enable})})),e.next=15,Promise.all(s);case 15:if(c=e.sent,l={},!V||!V.key){e.next=24;break}return u=V.key,d=c.map((function(e){return ai.encrypt({blob:e,key:u})})),e.next=22,Promise.all(d);case 22:f=e.sent,l={frontalFacesEncrypted:f};case 24:t?(h=E(Oe.current),p=function(e){return{label:"portrait",metadata:JSON.stringify({gesture_score:e,gesture:nh.FRONTAL})}},m=a.map((function(e,r){return ue.uploadImage(v({file:c[r]},p(e.leftRightScore)))})),V&&V.key&&(m=a.map((function(e,r){return ue.httpClient.post("/v1/images",v({base64:l.frontalFacesEncrypted[r].hex},p(e.leftRightScore)),{"X-TV-Key":V.key})}))),Promise.all(m).then((function(e){return ue.verifyFaceLiveness({images:e.map((function(e){return{id:e.data.image_id}})),videos:[{frames:h}]})})).then((function(e){g({apiCheckPassed:e.data.is_live,verifyFaceLivenessResult:e.data})})).catch((function(e){y({error:e})}))):(g(v(v({frontalFaces:c},l),{},{capturedFrames:Oe.current,video:jf()})),zf());case 25:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();vr.current=setInterval((function(){ur((function(r){return e(r),r-1}))}),1e3)}),[gr,t,g,ue,y,x,V,_e,Ae,Ie,We.enable]),Cr=r.useRef({});r.useEffect((function(){Cr.current.isFirstValidFrameFoundRef=te}),[te]),r.useEffect((function(){var e,r=ae.current,n=function(){var e=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,l,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Te.current.steps,t=[],r.map((function(e){return t.push({name:e.name,blob:e.image.blob,captureTime:e.image.captureTime,gesture:e.name}),e.frontalFaceImage.blob&&t.push({name:e.name,blob:e.frontalFaceImage.blob,captureTime:e.frontalFaceImage.captureTime,gesture:nh.FRONTAL}),0})),n=t.map((function(e){return po.resizeBlobImg(e.blob,or,or)})),e.next=6,Promise.all(n);case 6:return a=e.sent,o="0",S.framesBatchLength>0&&(i="".concat(Math.floor(Oe.current.length/S.framesBatchLength),"x").concat(S.framesBatchLength),s=Oe.current.length%S.framesBatchLength>0?"+".concat(Oe.current.length%S.framesBatchLength):"",o="".concat(Oe.current.length,":").concat(i).concat(s)),c=a.map((function(e,r){return ws.writeExif({mode:ws.MODE.SELFIE,imageData:v(v({},t[r]),{},{blob:e,frames:o}),enableExifData:We.enable})})),e.next=12,Promise.all(c);case 12:return l=e.sent,u=t.map((function(e,r){return{name:e.name,blob:l[r]}})),e.next=16,Promise.all(r.map(function(){var e=f(regeneratorRuntime.mark((function e(t,n){var a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=u.filter((function(e){return e.name===t.name})),r[n].image.blob=a[0].blob,t.frontalFaceImage.blob&&(r[n].frontalFaceImage.blob=a[1].blob),!V||!V.key){e.next=12;break}return o=V.key,e.next=7,ai.encrypt({blob:a[0].blob,key:o});case 7:if(r[n].image.encrypted=e.sent,!t.frontalFaceImage.blob){e.next=12;break}return e.next=11,ai.encrypt({blob:a[1].blob,key:o});case 11:r[n].frontalFaceImage.encrypted=e.sent;case 12:return e.abrupt("return",0);case 13:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}()));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),i=function(){var e=f(regeneratorRuntime.mark((function e(){var r,a,o,i,s,c,l,u,d,f,h,m,v,C;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Te.current.steps,o=a[Te.current.curStepIndex],p(r={},D.FaceDirection.UP,null==ih?void 0:ih.capture_up_face),p(r,D.FaceDirection.LEFT,null==ih?void 0:ih.capture_left_face),p(r,D.FaceDirection.RIGHT,null==ih?void 0:ih.capture_right_face),p(r,D.FaceDirection.FRONTAL,null==ih?void 0:ih.capture_frontal_face),Ze({tag:"selfie",event:r[o.name],log:{time_capture_in_seconds:((performance.now()-Me.current)/1e3).toFixed(1)}}),Te.current.curStepIndex++,Me.current=performance.now(),Fe.enable&&"each_gesture"===Fe.limit_for&&(Je.current=0),Te.current.curStepIndex!==a.length){e.next=42;break}if(je.enable&&I(""),!g){e.next=42;break}return Ge.enable&&Ge.framesBatchLength>0&&Oe.current.length%Ge.framesBatchLength>0&&(M(Oe.current.slice(Oe.current.length%Ge.framesBatchLength*-1).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&Nf(Oe.current.slice(Oe.current.length%Ge.framesBatchLength*-1),ue)),Ze({tag:"selfie",event:null==ih?void 0:ih.finish_capture,log:{time_capture_in_seconds:rh.duration("from_1st_frame")}}),x(),e.next=15,null===(i=rr.current)||void 0===i?void 0:i.stopVideoRecording();case 15:return _e(),ws.preWriteExif({mode:ws.MODE.SELFIE,motionData:Ae,orientationData:Ie,startTime:Date.now()-1e3*rh.duration("from_1st_frame"),endTime:Date.now()}),e.next=19,n();case 19:if(t){e.next=40;break}if(d=a.filter((function(e){return e.name!==nh.FRONTAL})).map((function(e){return{name:e.name,image:{blob:e.image.blob,encrypted:e.image.encrypted}}})),f=a.filter((function(e){return e.name!==nh.FRONTAL})).map((function(e){return e.frontalFaceImage.blob})).filter((function(e){return null!==e})),h=a.filter((function(e){return e.name!==nh.FRONTAL})).map((function(e){return e.frontalFaceImage.encrypted})).filter((function(e){return e&&e.hex})),m=null===(s=a.find((function(e){return e.name===nh.FRONTAL})))||void 0===s||null===(c=s.image)||void 0===c?void 0:c.blob,v=null===(l=a.find((function(e){return e.name===nh.FRONTAL})))||void 0===l||null===(u=l.image)||void 0===u?void 0:u.encrypted,!m||!b){e.next=31;break}return e.next=28,po.scaleImage(m,{minSize:b});case 28:e.t0=e.sent,e.next=32;break;case 31:e.t0=null;case 32:C=e.t0,m&&f.push(m),v&&h.push(v),Ze({tag:"result",event:null==ih?void 0:ih.liveness_detection_done,log:{result_object:{steps:d,frontalFaces:f,frontalScaledImage:C}}}),g({steps:d,frontalFaces:f,frontalFacesEncrypted:h,frontalScaledImage:C,capturedFrames:Oe.current,video:jf().length?jf()[0]:null}),zf(),e.next=42;break;case 40:return e.next=42,Mf({apiClient:ue,faceVerificationFlowData:Te,onLivenessDetectionDone:g,captureFrameSettings:Ge,FaceDirection:nh,onError:y,outputEncryptionSettings:V,video:jf().length?jf()[0]:null});case 42:pe();case 43:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=Xu((function(){var e=Te.current,r=e.curStepIndex,t=e.steps,n=t[r],a=null!==(null==n?void 0:n.image.blob),o=null!==(null==n?void 0:n.frontalFaceImage.blob),s=t.filter((function(e){return e.frontalFaceImage.blob})).length,c=!1;return a&&(o||![1].includes(r)||s>=1)?(ge.current=!1,i(),c=!0):ge.current=!(!a||o),J(!1),c}),w);function c(e){return l.apply(this,arguments)}function l(){return(l=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,c,l,u,d,f,h,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.faceDirection,n=r.canvas,a=r.blurScore,o=r.leftRightScore,c=r.isEyeClose,l=Te.current,u=l.curStepIndex,d=l.steps,!(u<d.length)){e.next=29;break}if(f=d[u],!Bf({faceDirection:t,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(t!==nh.FRONTAL||null!==f.frontalFaceImage.blurScore&&!Xn.hasBetterBlurScore(a,f.frontalFaceImage.blurScore)){e.next=17;break}return f.frontalFaceImage.blurScore=a,e.next=12,Zn.takePicture({canvas:n});case 12:h=e.sent,f.frontalFaceImage.blob=h,f.frontalFaceImage.leftRightScore=o,f.frontalFaceImage.captureTime=Date.now(),ge.current&&(ge.current=!1,i());case 17:if(f.name!==t||null!==f.image.blurScore&&!Xn.hasBetterBlurScore(a,f.image.blurScore)){e.next=29;break}return J(!0),f.image.blurScore=a,e.next=22,Zn.takePicture({canvas:n});case 22:p=e.sent,f.image.blob=p,f.image.leftRightScore=o,f.image.captureTime=Date.now(),f.image.objUrl&&URL.revokeObjectURL(f.image.objUrl),f.image.objUrl=URL.createObjectURL(p),s();case 29:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function u(e,r,t){return d.apply(this,arguments)}function d(){return(d=f(regeneratorRuntime.mark((function e(r,t,n){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!0===mr.current&&r===nh.FRONTAL&&yr.current.length<3)){e.next=5;break}return e.next=3,Zn.takePicture({canvas:t});case 3:a=e.sent,yr.current.push({blob:a,leftRightScore:n,captureTime:Date.now()});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e,r,n,a){if(Oe.current.length&&Date.now()-Oe.current[Oe.current.length-1].time<Ge.framesIntervalTime)return null;if(Ge.enable&&!a){var o=e.topLeft,i=e.bottomRight,s=[].concat(E(o),E(i)),c=eh(e,0===Oe.current.length),l=c.score,u=c.time,d=r.toDataURL("image/jpeg",.8);return Oe.current.push({label:"portrait",base64:d.split(",")[1],landmarks:n,original_landmarks:n,score:l,time:u,index:Oe.current.length,bbox:s,original_bbox:s}),Ge.framesBatchLength>0&&Oe.current.length%Ge.framesBatchLength==0&&M&&(M(Oe.current.slice(-Ge.framesBatchLength).map((function(e){return{base64:e.base64,label:e.label,index:e.index}}))),t&&Nf(Oe.current.slice(-Ge.framesBatchLength),ue,Oe.current.length===Ge.framesBatchLength)),l}return null}function C(e){var r=e.trackingScore,t=e.isFirstValidFrameFoundRef;if(!Fe.enable||null===r||!t)return!0;var n=Fe.web_warning_threshold,a=Fe.web_terminate_threshold,o=Fe.max_warning_time;return r<n||(r<a&&Je.current<o?(Je.current++,Je.current===o?(De(v(v({},nr.liveness_terminated_face_tracking),{},{duration:Ve})),Ze({tag:"selfie",event:null==ih?void 0:ih.show_alert,log:{alert:"liveness_terminated_face_tracking"}})):De(v(v({},nr.liveness_too_fast),{},{duration:1500})),!0):(De(v(v({},nr.liveness_terminated),{},{duration:Ve})),Ze({tag:"selfie",event:null==ih?void 0:ih.show_alert,log:{alert:"liveness_terminated"}}),tr(),!1))}function k(e){var r=e.noFace,t=e.isFirstValidFrameFoundRef;if(ze.enable&&t){var n=ze.max_time_ms;er.current&&r||(er.current={time:Date.now(),frame:0}),r&&er.current.frame++;var a=er.current.time;r&&Date.now()-a>=n&&(De(v(v({},nr.liveness_terminated_no_face),{},{duration:Ve})),Ze({tag:"selfie",event:null==ih?void 0:ih.show_alert,log:{alert:"liveness_terminated_no_face"}}),tr())}}function _(e,r){return A.apply(this,arguments)}function A(){return(A=f(regeneratorRuntime.mark((function t(n,i){var s,l,d,f,p,g,v,y,b,w,E,S,A,I,T,x,P,R,N,L,O,M,U,F,V,j,H,K,G,W,Q,X,Y,Z,$,J,ee;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(0!==(null==i?void 0:i.width)&&0!==(null==i?void 0:i.height)){t.next=2;break}return t.abrupt("return");case 2:return f=Cr.current.isFirstValidFrameFoundRef,p=n.cropX,g=n.cropY,v=n.cropWidth,y=n.cropHeight,i.getContext("2d").drawImage(r,p,g,v,y,-(or*z-or)/2/z,-(or*z-or)/2/z,or,or),b=we.current,w=b.blazefaceModel,E=b.closeEyesModel,t.next=9,Promise.all([Xn.calculateBlurScore(i),ma.getModelPredictions({model:w,sCanvas:i})]);case 9:return S=t.sent,A=B(S,2),I=A[0],T=A[1],t.next=15,ha.validatePredictions({predictions:T,width:ma.SIZE,height:ma.SIZE});case 15:if(P=t.sent,R=P.error,N=P.fullFace,L=P.faceRatio,O=P.faceNotFrontalMinThreshold,x=R,me.current.image=a,U=null,F=null,V=null,j=null,H=Te.current,K=H.curStepIndex,G=H.steps,!N){t.next=44;break}return W=G[K],Q=W&&W.name===nh.FRONTAL,V=N.landmarks,t.next=33,ha.calculateFaceDirection({landmarks:V,getPerfectFrontal:Q});case 33:if((X=t.sent)&&(U=X.gesture,F=X.leftRightScore),Y=(null==qe?void 0:qe.web_timeout)+m[D.FaceDirection.FRONTAL].delayTime/1e3,!(Q&&null!=qe&&qe.enable&&(-1===rh.duration("limit_close_eye")||rh.duration("limit_close_eye")<Y))){t.next=44;break}return-1===rh.duration("limit_close_eye")&&rh.start("limit_close_eye"),t.next=40,E.predict(i,V,null==qe?void 0:qe.web_threshold);case 40:Z=t.sent,$=Z.isEyeClose,(j=$)&&!x&&(x=ah.close_eye);case 44:if(J="no_face"===(null===(s=x)||void 0===s?void 0:s.code)||"partial_face"===(null===(l=x)||void 0===l?void 0:l.code),ee=K<G.length,k({noFace:J&&ee,isFirstValidFrameFoundRef:f}),null!==(d=x)&&void 0!==d&&d.code&&$e({tag:"selfie",event:null==ih?void 0:ih.show_alert,log:{alert:x.code}}),x&&!("face_too_small"===x.code&&U!==nh.FRONTAL&&L>=O)){t.next=70;break}if(de||h(T[0],i,V),!de){t.next=58;break}if(f||(ne(!0),Me.current=performance.now(),rh.start("from_1st_frame")),!C({trackingScore:h(T[0],i,V,K>=G.length),isFirstValidFrameFoundRef:f})){t.next=56;break}return t.next=56,c({faceDirection:U,canvas:i,blurScore:I,leftRightScore:F,isEyeClose:j});case 56:t.next=68;break;case 58:if(U===nh.FRONTAL){t.next=63;break}M=nr.not_frontal_face,me.current.image=o,t.next=68;break;case 63:if(x){t.next=68;break}return f||(ne(!0),rh.start("from_1st_frame")),q&&!mr.current&&0===yr.current.length&&setTimeout((function(){br()}),500),t.next=68,u(U,i,F);case 68:t.next=71;break;case 70:K<G.length&&(M=nr[x.code],me.current.image=o);case 71:Le(M),-1!==e&&(e=requestAnimationFrame((function(){return _(n,i)})));case 73:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function T(){return(T=f(regeneratorRuntime.mark((function e(){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Zn.analyzeVideoAndWindowSizes(r,me.current),(n=document.createElement("canvas")).width=or,n.height=or,(a=n.getContext("2d")).translate(or,0),a.scale(-1*z,1*z),!Xe||!r){e.next=13;break}return e.next=10,Kf({outputImagesSize:or,videoEl:r,resultAnalyzeVideoAndWindowSizes:t});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0={};case 14:o=e.t0,i=o.mediaRecorder,rr.current=i,rr.current&&rr.current.start(),_(t,n);case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return Q&&be&&setTimeout((function(){!function(){T.apply(this,arguments)}()}),F),function(){cancelAnimationFrame(e),e=-1}}),[F,Q,ie,de,ue,t,a,o,g,y,b,w,Ge,x,Fe,je.enable,I,Le,m,Ve,tr,ze,nr,be,Ze,M,V,z,br,q,qe.enable,qe.web_threshold,qe.web_timeout,Ae,Ie,_e,We.enable,$e,S.framesBatchLength,Xe]),r.useEffect((function(){Re&&(clearInterval(vr.current),gr(!1),yr.current=[]),Se()}),[Re,gr,Se]);var wr=Te.current,kr=wr.curStepIndex,Br=wr.steps,Er=r.useMemo((function(){return Br.find((function(e){return e.name===D.FaceDirection.FRONTAL}))}),[Br]),Sr=ge.current?Er:Br[kr],_r=Sr&&te?Sr.instructions[ie]:null,Ar=Sr&&te?Sr.directionIcon:"",Ir=Sr?Sr.directionIconAnimation:"";return{countdownToTakePicture:lr,cropArea:me,curStepIndex:kr,directionIcon:Ar,directionIconAnimation:Ir,faceDetectionError:Re,handleTriggerPassiveMode:br,handleVideoPlayed:ir,instructions:_r,isActiveMode:de,refVideo:ae,showCountdown:hr,steps:Br,videoPlayed:Q,activeCapturing:$,isFirstValidFrameFound:te,warmupDone:be,motionData:Ae,orientationData:Ie}}var lh=(p(Wf={},D.FaceDirection.LEFT,90),p(Wf,D.FaceDirection.RIGHT,270),p(Wf,D.FaceDirection.UP,180),p(Wf,D.FaceDirection.DOWN,0),Wf),uh=n.keyframes(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),dh=c.default.div(Qf||(Qf=k(["\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"])),lh[D.FaceDirection.DOWN],lh[D.FaceDirection.LEFT],lh[D.FaceDirection.UP],lh[D.FaceDirection.RIGHT]),fh=c.default.div(Xf||(Xf=k(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var r,t=e.direction;return null!==(r=lh[t])&&void 0!==r?r:0})),hh=c.default.span(Yf||(Yf=k(["\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"])),uh),ph=c.default(hh)(Zf||(Zf=k(["\n animation-delay: 0s;\n"]))),mh=c.default(hh)($f||($f=k(["\n animation-delay: 0.5s;\n"]))),gh=c.default(hh)(Jf||(Jf=k(["\n animation-delay: 1s;\n"])));function vh(e){var r=e.type;return r!==D.FaceDirection.FRONTAL?i.default.createElement(fh,{direction:r},i.default.createElement(ph,null),i.default.createElement(mh,null),i.default.createElement(gh,null)):i.default.createElement(dh,null,i.default.createElement(fh,{className:"top"},i.default.createElement(ph,null),i.default.createElement(mh,null),i.default.createElement(gh,null)),i.default.createElement(fh,{className:"right"},i.default.createElement(ph,null),i.default.createElement(mh,null),i.default.createElement(gh,null)),i.default.createElement(fh,{className:"bottom"},i.default.createElement(ph,null),i.default.createElement(mh,null),i.default.createElement(gh,null)),i.default.createElement(fh,{className:"left"},i.default.createElement(ph,null),i.default.createElement(mh,null),i.default.createElement(gh,null)))}vh.propTypes={type:s.default.oneOf([D.FaceDirection.LEFT,D.FaceDirection.RIGHT,D.FaceDirection.UP,D.FaceDirection.FRONTAL])},vh.defaultProps={type:D.FaceDirection.LEFT};var yh,bh=D.ErrorDuration;function Ch(e){var r=e.children,t=e.errorMsg,n=e.className;return i.default.isValidElement(r)?t?i.default.createElement("div",{className:n},i.default.cloneElement(r,{errorMsg:t})):null:t?i.default.createElement("div",{className:n},t):null}function wh(e){var t=e.children,n=e.className,a=e.error,o=r.useRef(0),i=r.useRef(""),s=zt.useSDKSettings().lang,c=r.useRef(bh.SHORT),l=a||{},u=l.msg,d=l.duration,f=void 0===d?bh.SHORT:d,h=null==u?void 0:u[s];return Date.now()-o.current>=c.current?(o.current=Date.now(),c.current=f,i.current=h,Ch({children:t,errorMsg:h,className:n})):Ch({children:t,errorMsg:i.current,className:n})}wh.propTypes={children:s.default.node,className:s.default.string},wh.defaultProps={className:""};var kh=c.default.circle(yh||(yh=k(["\n transition: stroke-dashoffset 0.4s;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n"])));function Bh(e){var r=e.className,t=e.style,n=e.radius,a=e.strokeWidth,o=e.progress,s=e.hasError,c=e.activeColor,l=e.innerPadding,u=e.outsideRingColor,d=e.outsideRingOpacity,f=e.insideRingColor,h=e.insideRingWidth,p=e.insideRingStrokeDash,m=e.errorRingWidth,g=e.errorRingColor,v=e.dashedRingColor,y=e.dashedRingOpacity,b=e.dashedRingWidth,C=e.dashedRingLineThick,w=e.dashedRingLineSpacing,k=e.dashedInsideRingColor,B=e.dashedInsideRingWidth,E=e.showOutsideRing,S=e.showInsideRing,_=e.showDashedRing,A=2*n,I=2*n,T=n-2*a,x=2*Math.PI*T,P=x-o/100*x,R=T-b/2-a/2-l,D=2*Math.PI*R,N=D-o/100*D,L=R-B/2-b/2,O=2*Math.PI*L,M=O-o/100*O,U=L-h/2-B/2,F=L-m/2-B/2;return i.default.createElement("svg",{className:r,style:t,width:A,height:I,viewBox:"0 0 ".concat(A," ").concat(I),fill:"none",xmlns:"http://www.w3.org/2000/svg"},E?i.default.createElement(i.default.Fragment,null,i.default.createElement("circle",{"data-testid":"outsideRing",opacity:d,cx:n,cy:n,r:T,stroke:u}),i.default.createElement(kh,{"data-testid":"outsideAnimateRing",cx:n,cy:n,r:T,stroke:c,strokeWidth:a,strokeLinecap:"round",strokeDasharray:"".concat(x," ").concat(x),style:{strokeDashoffset:P}})):null,_?i.default.createElement(i.default.Fragment,null,i.default.createElement("circle",{"data-testid":"dashedRing",opacity:y,cx:n,cy:n,r:R,stroke:v,strokeWidth:b,strokeDasharray:"".concat(C," ").concat(w)}),i.default.createElement("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse"},i.default.createElement("circle",{cx:n,cy:n,r:R,stroke:c,strokeWidth:b,strokeDasharray:"".concat(C," ").concat(w)})),i.default.createElement("g",{mask:"url(#mask0)"},i.default.createElement(kh,{"data-testid":"dashedAnimateRing",cx:n,cy:n,r:R,stroke:c,strokeWidth:b,strokeDasharray:"".concat(D," ").concat(D),style:{strokeDashoffset:N}})),i.default.createElement("circle",{"data-testid":"dashedInsideRing",opacity:y,cx:n,cy:n,r:L,stroke:k,strokeWidth:B}),i.default.createElement(kh,{"data-testid":"dashedInsideAnimateRing",cx:n,cy:n,r:L,stroke:c,strokeWidth:B,strokeLinecap:"round",strokeDasharray:"".concat(O," ").concat(O),style:{strokeDashoffset:M}})):null,S?i.default.createElement("circle",{"data-testid":"insideRing",strokeDasharray:p,cx:n,cy:n,r:U,stroke:f,strokeWidth:h}):null,s?i.default.createElement("circle",{"data-testid":"errorRing",strokeDasharray:p,cx:n,cy:n,r:F,stroke:g,strokeWidth:m}):null)}function Eh(e){var r=e.className;return i.default.createElement("svg",{className:r,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.default.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 Sh(){return(Sh=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}Bh.propTypes={className:s.default.string,style:s.default.shape({}),radius:s.default.number,strokeWidth:s.default.number,progress:s.default.number,hasError:s.default.bool,activeColor:s.default.string,innerPadding:s.default.number,outsideRingColor:s.default.string,outsideRingOpacity:s.default.number,insideRingColor:s.default.string,insideRingWidth:s.default.number,insideRingStrokeDash:s.default.string,errorRingColor:s.default.string,errorRingWidth:s.default.number,dashedRingColor:s.default.string,dashedRingOpacity:s.default.number,dashedRingWidth:s.default.number,dashedRingLineThick:s.default.number,dashedRingLineSpacing:s.default.number,dashedInsideRingColor:s.default.string,dashedInsideRingWidth:s.default.number,showOutsideRing:s.default.bool,showDashedRing:s.default.bool,showInsideRing:s.default.bool},Bh.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,hasError:!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},Eh.propTypes={className:s.default.string},Eh.defaultProps={className:""};var _h,Ah,Ih="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,Th={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}}},xh=["top left","top center","top right","right top","right center","right bottom","bottom left","bottom center","bottom right","left top","left center","left bottom"],Ph=function(e,r,t,n,a){var o=a.offsetX,i=a.offsetY,s=n?8:0,c=t.split(" "),l=e.top+e.height/2,u=e.left+e.width/2,d=r.height,f=r.width,h=l-d/2,p=u-f/2,m="",g="0%",v="0%";switch(c[0]){case"top":h-=d/2+e.height/2+s,m="rotate(180deg) translateX(50%)",g="100%",v="50%";break;case"bottom":h+=d/2+e.height/2+s,m="rotate(0deg) translateY(-100%) translateX(-50%)",v="50%";break;case"left":p-=f/2+e.width/2+s,m=" rotate(90deg) translateY(50%) translateX(-25%)",v="100%",g="50%";break;case"right":p+=f/2+e.width/2+s,m="rotate(-90deg) translateY(-150%) translateX(25%)",g="50%"}switch(c[1]){case"top":h=e.top,g=e.height/2+"px";break;case"bottom":h=e.top-d+e.height,g=d-e.height/2+"px";break;case"left":p=e.left,v=e.width/2+"px";break;case"right":p=e.left-f+e.width,v=f-e.width/2+"px"}return{top:h="top"===c[0]?h-i:h+i,left:p="left"===c[0]?p-o:p+o,transform:m,arrowLeft:v,arrowTop:g}},Rh=function(e,r,t,n,a,o){var i=a.offsetX,s=a.offsetY,c={arrowLeft:"0%",arrowTop:"0%",left:0,top:0,transform:"rotate(135deg)"},l=0,u=function(e){var r={top:0,left:0,width:window.innerWidth,height:window.innerHeight};if("string"==typeof e){var t=document.querySelector(e);null!==t&&(r=t.getBoundingClientRect())}return r}(o),d=Array.isArray(t)?t:[t];for((o||Array.isArray(t))&&(d=[].concat(d,xh));l<d.length;){var f={top:(c=Ph(e,r,d[l],n,{offsetX:i,offsetY:s})).top,left:c.left,width:r.width,height:r.height};if(!(f.top<=u.top||f.left<=u.left||f.top+f.height>=u.top+u.height||f.left+f.width>=u.left+u.width))break;l++}return c},Dh=0,Nh=r.forwardRef((function(e,t){var n=e.trigger,a=void 0===n?null:n,o=e.onOpen,s=void 0===o?function(){}:o,c=e.onClose,u=void 0===c?function(){}:c,d=e.defaultOpen,f=void 0!==d&&d,h=e.open,p=void 0===h?void 0:h,m=e.disabled,g=void 0!==m&&m,v=e.nested,y=void 0!==v&&v,b=e.closeOnDocumentClick,C=void 0===b||b,w=e.repositionOnResize,k=void 0===w||w,B=e.closeOnEscape,E=void 0===B||B,S=e.on,_=void 0===S?["click"]:S,A=e.contentStyle,I=void 0===A?{}:A,T=e.arrowStyle,x=void 0===T?{}:T,P=e.overlayStyle,R=void 0===P?{}:P,D=e.className,N=void 0===D?"":D,L=e.position,O=void 0===L?"bottom center":L,M=e.modal,U=void 0!==M&&M,F=e.lockScroll,V=void 0!==F&&F,j=e.arrow,z=void 0===j||j,H=e.offsetX,q=void 0===H?0:H,K=e.offsetY,G=void 0===K?0:K,W=e.mouseEnterDelay,Q=void 0===W?100:W,X=e.mouseLeaveDelay,Y=void 0===X?100:X,Z=e.keepTooltipInside,$=void 0!==Z&&Z,J=e.children,ee=r.useState(p||f),re=ee[0],te=ee[1],ne=r.useRef(null),ae=r.useRef(null),oe=r.useRef(null),ie=r.useRef(null),se=r.useRef("popup-"+ ++Dh),ce=!!U||!a,le=r.useRef(0);Ih((function(){return re?(ie.current=document.activeElement,we(),ye(),ge()):ve(),function(){clearTimeout(le.current)}}),[re]),r.useEffect((function(){"boolean"==typeof p&&(p?ue():de())}),[p,g]);var ue=function(e){re||g||(te(!0),setTimeout((function(){return s(e)}),0))},de=function(e){var r;re&&!g&&(te(!1),ce&&(null===(r=ie.current)||void 0===r||r.focus()),setTimeout((function(){return u(e)}),0))},fe=function(e){null==e||e.stopPropagation(),re?de(e):ue(e)},he=function(e){clearTimeout(le.current),le.current=setTimeout((function(){return ue(e)}),Q)},pe=function(e){null==e||e.preventDefault(),fe()},me=function(e){clearTimeout(le.current),le.current=setTimeout((function(){return de(e)}),Y)},ge=function(){ce&&V&&(document.getElementsByTagName("body")[0].style.overflow="hidden")},ve=function(){ce&&V&&(document.getElementsByTagName("body")[0].style.overflow="auto")},ye=function(){var e,r=null==ae||null===(e=ae.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"]'),t=Array.prototype.slice.call(r)[0];null==t||t.focus()};r.useImperativeHandle(t,(function(){return{open:function(){ue()},close:function(){de()},toggle:function(){fe()}}}));var be,Ce,we=function(){if(!ce&&re&&(null==ne?void 0:ne.current)&&(null==ne?void 0:ne.current)&&(null==ae?void 0:ae.current)){var e,r,t=ne.current.getBoundingClientRect(),n=ae.current.getBoundingClientRect(),a=Rh(t,n,O,z,{offsetX:q,offsetY:G},$);if(ae.current.style.top=a.top+window.scrollY+"px",ae.current.style.left=a.left+window.scrollX+"px",z&&oe.current)oe.current.style.transform=a.transform,oe.current.style.setProperty("-ms-transform",a.transform),oe.current.style.setProperty("-webkit-transform",a.transform),oe.current.style.top=(null===(e=x.top)||void 0===e?void 0:e.toString())||a.arrowTop,oe.current.style.left=(null===(r=x.left)||void 0===r?void 0:r.toString())||a.arrowLeft}};be=de,void 0===(Ce=E)&&(Ce=!0),r.useEffect((function(){if(Ce){var e=function(e){"Escape"===e.key&&be(e)};return document.addEventListener("keyup",e),function(){Ce&&document.removeEventListener("keyup",e)}}}),[be,Ce]),function(e,t){void 0===t&&(t=!0),r.useEffect((function(){if(t){var r=function(r){if(9===r.keyCode){var t,n=null==e||null===(t=e.current)||void 0===t?void 0:t.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]'),a=Array.prototype.slice.call(n);if(1===a.length)return void r.preventDefault();var o=a[0],i=a[a.length-1];r.shiftKey&&document.activeElement===o?(r.preventDefault(),i.focus()):document.activeElement===i&&(r.preventDefault(),o.focus())}};return document.addEventListener("keydown",r),function(){t&&document.removeEventListener("keydown",r)}}}),[e,t])}(ae,re&&ce),function(e,t){void 0===t&&(t=!0),r.useEffect((function(){if(t){var r=function(){e()};return window.addEventListener("resize",r),function(){t&&window.removeEventListener("resize",r)}}}),[e,t])}(we,k),function(e,t,n){void 0===n&&(n=!0),r.useEffect((function(){if(n){var r=function(r){var n=Array.isArray(e)?e:[e],a=!1;n.forEach((function(e){e.current&&!e.current.contains(r.target)||(a=!0)})),r.stopPropagation(),a||t(r)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),function(){n&&(document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r))}}}),[e,t,n])}(a?[ae,ne]:[ae],de,C&&!y);var ke,Be=function(){return i.default.createElement("div",Object.assign({},(e=ce?Th.popupContent.modal:Th.popupContent.tooltip,r={className:"popup-content "+(""!==N?N.split(" ").map((function(e){return e+"-content"})).join(" "):""),style:Sh({},e,I,{pointerEvents:"auto"}),ref:ae,onClick:function(e){e.stopPropagation()}},!U&&_.indexOf("hover")>=0&&(r.onMouseEnter=he,r.onMouseLeave=me),r),{key:"C",role:ce?"dialog":"tooltip",id:se.current}),z&&!ce&&i.default.createElement("div",{ref:oe,style:Th.popupArrow},i.default.createElement("svg",{"data-testid":"arrow",className:"popup-arrow "+(""!==N?N.split(" ").map((function(e){return e+"-arrow"})).join(" "):""),viewBox:"0 0 32 16",style:Sh({position:"absolute"},x)},i.default.createElement("path",{d:"M16 0l16 16H0z",fill:"currentcolor"}))),J&&"function"==typeof J?J(de,re):J);var e,r},Ee=!(_.indexOf("hover")>=0),Se=ce?Th.overlay.modal:Th.overlay.tooltip,_e=[Ee&&i.default.createElement("div",{key:"O","data-testid":"overlay","data-popup":ce?"modal":"tooltip",className:"popup-overlay "+(""!==N?N.split(" ").map((function(e){return e+"-overlay"})).join(" "):""),style:Sh({},Se,R,{pointerEvents:C&&y||ce?"auto":"none"}),onClick:C&&y?de:void 0,tabIndex:-1},ce&&Be()),!ce&&Be()];return i.default.createElement(i.default.Fragment,null,function(){for(var e={key:"T",ref:ne,"aria-describedby":se.current},r=Array.isArray(_)?_:[_],t=0,n=r.length;t<n;t++)switch(r[t]){case"click":e.onClick=fe;break;case"right-click":e.onContextMenu=pe;break;case"hover":e.onMouseEnter=he,e.onMouseLeave=me;break;case"focus":e.onFocus=he,e.onBlur=me}if("function"==typeof a){var o=a(re);return!!a&&i.default.cloneElement(o,e)}return!!a&&i.default.cloneElement(a,e)}(),re&&l.default.createPortal(_e,(null===(ke=document.getElementById("popup-root"))&&((ke=document.createElement("div")).setAttribute("id","popup-root"),document.body.appendChild(ke)),ke)))})),Lh=n.createGlobalStyle(_h||(_h=k(["\n .popup-content {\n margin: auto;\n background: #fff;\n width: 100%;\n padding: 5px;\n border: 1px solid #d7d7d7;\n max-width: 568px;\n border-radius: 10px;\n }\n\n [role=tooltip].popup-content {\n width: 200px;\n box-shadow: 0 0 3px rgba(0, 0, 0, .16);\n border-radius: 5px\n }\n\n .popup-overlay {\n background: rgba(0, 0, 0, .5);\n padding: 10px;\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"]))),Oh=["open","children","overlayStyle"],Mh=function(e){var r=e.open,t=e.children,n=e.overlayStyle,a=w(e,Oh);return i.default.createElement(i.default.Fragment,null,r&&i.default.createElement(i.default.Fragment,null,i.default.createElement(Nh,m({overlayStyle:v(v({},n),{},{zIndex:2e3}),closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:r},a),t),i.default.createElement(Lh,null)))};Mh.propTypes={open:s.default.bool,children:s.default.node,overlayStyle:s.default.shape({})},Mh.defaultProps={open:!1,children:null,overlayStyle:{}};var Uh={WARMUP_INTRO:{en:"Warming up... Please wait a moment",vi:"Đang khởi động, vui lòng chờ trong giây lát..."}},Fh=c.default.div(Ah||(Ah=k(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),Vh=function(e){var r=e.contentStyle,t=zt.useSDKSettings(),n=t.lang,a=t.warmupMessage,o=a?a[n]:Uh.WARMUP_INTRO[n];return i.default.createElement(Mh,{open:!0,contentStyle:r},i.default.createElement(Fh,{className:"warmup-message"},o))};Vh.propTypes={contentStyle:s.default.shape({})},Vh.defaultProps={contentStyle:{}};var jh=n.keyframes(["from{transform:perspective(400px);}to{transform:perspective(400px) rotateY(90deg);}"]),zh=n.keyframes(["from{transform:perspective(400px) rotateY(-90deg);}to{transform:perspective(400px);}"]),Hh=n.css([".flipY-exit{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}.flipY-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-out;}"],jh,500,zh,500),qh=Object.freeze({__proto__:null,animationDuration:500,default:Hh}),Kh=n.keyframes(["from,to{transform:translate3d(-","px,0,0);}50%{transform:translate3d(","px,0,0);}"],20,20),Gh=n.keyframes(["from,to{transform:translate3d(0,-","px,0);}50%{transform:translate3d(0,","px,0);}"],20,20),Wh=n.css([".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;}"],Kh,Gh),Qh=Object.freeze({__proto__:null,default:Wh}),Xh=n.keyframes(["from,to{opacity:1;}50%{opacity:0;}"]),Yh=n.css([".blink{animation-name:",";animation-iteration-count:infinite;animation-duration:2000ms;animation-timing-function:linear;}"],Xh),Zh=Object.freeze({__proto__:null,default:Yh});function $h(){return($h=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function Jh(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}function ep(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r}function rp(e,r){return e.replace(new RegExp("(^|\\s)"+r+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var tp=!1,np=i.default.createContext(null),ap="entering",op="entered",ip=function(e){function r(r,t){var n;n=e.call(this,r,t)||this;var a,o=t&&!t.isMounting?r.enter:r.appear;return n.appearStatus=null,r.in?o?(a="exited",n.appearStatus=ap):a=op:a=r.unmountOnExit||r.mountOnEnter?"unmounted":"exited",n.state={status:a},n.nextCallback=null,n}ep(r,e),r.getDerivedStateFromProps=function(e,r){return e.in&&"unmounted"===r.status?{status:"exited"}:null};var t=r.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(e){var r=null;if(e!==this.props){var t=this.state.status;this.props.in?t!==ap&&t!==op&&(r=ap):t!==ap&&t!==op||(r="exiting")}this.updateStatus(!1,r)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var e,r,t,n=this.props.timeout;return e=r=t=n,null!=n&&"number"!=typeof n&&(e=n.exit,r=n.enter,t=void 0!==n.appear?n.appear:r),{exit:e,enter:r,appear:t}},t.updateStatus=function(e,r){void 0===e&&(e=!1),null!==r?(this.cancelNextCallback(),r===ap?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},t.performEnter=function(e){var r=this,t=this.props.enter,n=this.context?this.context.isMounting:e,a=this.props.nodeRef?[n]:[l.default.findDOMNode(this),n],o=a[0],i=a[1],s=this.getTimeouts(),c=n?s.appear:s.enter;!e&&!t||tp?this.safeSetState({status:op},(function(){r.props.onEntered(o)})):(this.props.onEnter(o,i),this.safeSetState({status:ap},(function(){r.props.onEntering(o,i),r.onTransitionEnd(c,(function(){r.safeSetState({status:op},(function(){r.props.onEntered(o,i)}))}))})))},t.performExit=function(){var e=this,r=this.props.exit,t=this.getTimeouts(),n=this.props.nodeRef?void 0:l.default.findDOMNode(this);r&&!tp?(this.props.onExit(n),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(n),e.onTransitionEnd(t.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(n)}))},t.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(e,r){r=this.setNextCallback(r),this.setState(e,r)},t.setNextCallback=function(e){var r=this,t=!0;return this.nextCallback=function(n){t&&(t=!1,r.nextCallback=null,e(n))},this.nextCallback.cancel=function(){t=!1},this.nextCallback},t.onTransitionEnd=function(e,r){this.setNextCallback(r);var t=this.props.nodeRef?this.props.nodeRef.current:l.default.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(t&&!n){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[t,this.nextCallback],o=a[0],i=a[1];this.props.addEndListener(o,i)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},t.render=function(){var e=this.state.status;if("unmounted"===e)return null;var r=this.props,t=r.children,n=(r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef,Jh(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.default.createElement(np.Provider,{value:null},"function"==typeof t?t(e,n):i.default.cloneElement(i.default.Children.only(t),n))},r}(i.default.Component);function sp(){}ip.contextType=np,ip.propTypes={},ip.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:sp,onEntering:sp,onEntered:sp,onExit:sp,onExiting:sp,onExited:sp},ip.UNMOUNTED="unmounted",ip.EXITED="exited",ip.ENTERING=ap,ip.ENTERED=op,ip.EXITING="exiting";var cp,lp,up=function(e,r){return e&&r&&r.split(" ").forEach((function(r){return n=r,void((t=e).classList?t.classList.add(n):function(e,r){return e.classList?!!r&&e.classList.contains(r):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+r+" ")}(t,n)||("string"==typeof t.className?t.className=t.className+" "+n:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+n)));var t,n}))},dp=function(e,r){return e&&r&&r.split(" ").forEach((function(r){return n=r,void((t=e).classList?t.classList.remove(n):"string"==typeof t.className?t.className=rp(t.className,n):t.setAttribute("class",rp(t.className&&t.className.baseVal||"",n)));var t,n}))},fp=function(e){function r(){for(var r,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return(r=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1];r.removeClasses(a,"exit"),r.addClass(a,o?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(e,t)},r.onEntering=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1]?"appear":"enter";r.addClass(a,o,"active"),r.props.onEntering&&r.props.onEntering(e,t)},r.onEntered=function(e,t){var n=r.resolveArguments(e,t),a=n[0],o=n[1]?"appear":"enter";r.removeClasses(a,o),r.addClass(a,o,"done"),r.props.onEntered&&r.props.onEntered(e,t)},r.onExit=function(e){var t=r.resolveArguments(e)[0];r.removeClasses(t,"appear"),r.removeClasses(t,"enter"),r.addClass(t,"exit","base"),r.props.onExit&&r.props.onExit(e)},r.onExiting=function(e){var t=r.resolveArguments(e)[0];r.addClass(t,"exit","active"),r.props.onExiting&&r.props.onExiting(e)},r.onExited=function(e){var t=r.resolveArguments(e)[0];r.removeClasses(t,"exit"),r.addClass(t,"exit","done"),r.props.onExited&&r.props.onExited(e)},r.resolveArguments=function(e,t){return r.props.nodeRef?[r.props.nodeRef.current,e]:[e,t]},r.getClassNames=function(e){var t=r.props.classNames,n="string"==typeof t,a=n?""+(n&&t?t+"-":"")+e:t[e];return{baseClassName:a,activeClassName:n?a+"-active":t[e+"Active"],doneClassName:n?a+"-done":t[e+"Done"]}},r}ep(r,e);var t=r.prototype;return t.addClass=function(e,r,t){var n=this.getClassNames(r)[t+"ClassName"],a=this.getClassNames("enter").doneClassName;"appear"===r&&"done"===t&&a&&(n+=" "+a),"active"===t&&e&&e.scrollTop,n&&(this.appliedClasses[r][t]=n,up(e,n))},t.removeClasses=function(e,r){var t=this.appliedClasses[r],n=t.base,a=t.active,o=t.done;this.appliedClasses[r]={},n&&dp(e,n),a&&dp(e,a),o&&dp(e,o)},t.render=function(){var e=this.props,r=(e.classNames,Jh(e,["classNames"]));return i.default.createElement(ip,$h({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},r}(i.default.Component);fp.defaultProps={classNames:""},fp.propTypes={};var hp,pp,mp="out-in",gp="in-out",vp=function(e,r,t){return function(){var n;e.props[r]&&(n=e.props)[r].apply(n,arguments),t()}},yp=((cp={})[mp]=function(e){var r=e.current,t=e.changeState;return i.default.cloneElement(r,{in:!1,onExited:vp(r,"onExited",(function(){t(ap,null)}))})},cp[gp]=function(e){var r=e.current,t=e.changeState,n=e.children;return[r,i.default.cloneElement(n,{in:!0,onEntered:vp(n,"onEntered",(function(){t(ap)}))})]},cp),bp=((lp={})[mp]=function(e){var r=e.children,t=e.changeState;return i.default.cloneElement(r,{in:!0,onEntered:vp(r,"onEntered",(function(){t(op,i.default.cloneElement(r,{in:!0}))}))})},lp[gp]=function(e){var r=e.current,t=e.children,n=e.changeState;return[i.default.cloneElement(r,{in:!1,onExited:vp(r,"onExited",(function(){n(op,i.default.cloneElement(t,{in:!0}))}))}),i.default.cloneElement(t,{in:!0})]},lp),Cp=function(e){function r(){for(var r,t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return(r=e.call.apply(e,[this].concat(n))||this).state={status:op,current:null},r.appeared=!1,r.changeState=function(e,t){void 0===t&&(t=r.state.current),r.setState({status:e,current:t})},r}ep(r,e);var t=r.prototype;return t.componentDidMount=function(){this.appeared=!0},r.getDerivedStateFromProps=function(e,r){return null==e.children?{current:null}:r.status===ap&&e.mode===gp?{status:ap}:!r.current||(t=r.current,n=e.children,t===n||i.default.isValidElement(t)&&i.default.isValidElement(n)&&null!=t.key&&t.key===n.key)?{current:i.default.cloneElement(e.children,{in:!0})}:{status:"exiting"};var t,n},t.render=function(){var e,r=this.props,t=r.children,n=r.mode,a=this.state,o=a.status,s=a.current,c={children:t,current:s,changeState:this.changeState,status:o};switch(o){case ap:e=bp[n](c);break;case"exiting":e=yp[n](c);break;case op:e=s}return i.default.createElement(np.Provider,{value:{isMounting:!this.appeared}},e)},r}(i.default.Component);Cp.propTypes={},Cp.defaultProps={mode:mp};var wp,kp,Bp,Ep,Sp,_p,Ap,Ip,Tp,xp,Pp,Rp,Dp,Np,Lp,Op,Mp=c.default.div(hp||(hp=k(["\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"])),1001),Up=n.keyframes(["from{background:#000;}to{}"]),Fp=n.css([".splash-enter{animation-name:",";animation-duration:","ms;animation-timing-function:ease-in;}"],Up,300),Vp=c.default.div(pp||(pp=k(["\n ","\n"])),Fp),jp=function(e){var r=e.keyForTransition,t=void 0===r?0:r;return i.default.createElement(Vp,null,i.default.createElement(Cp,null,i.default.createElement(fp,{key:t,timeout:{enter:300,exit:0},classNames:"splash",unmountOnExit:!1},i.default.createElement(Mp,null))))},zp=Object.freeze({__proto__:null,default:jp}),Hp=n.keyframes(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),qp=n.css([".spin{animation-name:",";animation-iteration-count:infinite;animation-duration:1000ms;animation-timing-function:linear;}"],Hp),Kp=Object.freeze({__proto__:null,default:qp}),Gp=Object.freeze({__proto__:null,flipY:qh,slide:Qh,blink:Zh,splash:zp,spin:Kp}),Wp=Object.freeze({__proto__:null,CloseCameraButton:function(e){var r=e.className,t=e.onClick,n=Bn.useAsset("ic_close.png");return i.default.createElement(bu,{className:r,onClick:t},i.default.createElement("img",{src:n,alt:""}))}}),Qp=Zh,Xp=Qh,Yp=n.css(["z-index:",";color:#ffffff;"],1020),Zp=c.default.div(wp||(wp=k(["\n ","\n"])),Yp),$p=c.default(wh)(kp||(kp=k(["\n ","\n ","\n ","\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n white-space: pre-wrap;\n text-align: center;\n max-width: 80%;\n"])),Yp,(function(e){var r=e.top;return r&&n.css(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&n.css(["bottom:","px;"],r)}),(function(e){return e.centerY&&n.css(["top:50%;transform:translateY(-50%);"])})),Jp=c.default(Zp)(Bp||(Bp=k(["\n ","\n font-size: 18px;\n background: #ea3223;\n color: #fff;\n padding: 5px 10px;\n border-radius: 3px;\n position: absolute;\n left: 50%;\n transform: translate(-50%, 0);\n white-space: nowrap;\n"])),(function(e){var r=e.top;return r&&n.css(["top:","px;"],r)})),em=c.default(Zp)(Ep||(Ep=k(["\n position: absolute;\n ","\n ","\n font-size: ",";\n text-shadow: 2px 2px 4px #000000;\n"])),(function(e){var r=e.top;return r&&n.css(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&n.css(["bottom:","px;"],r)}),(function(){return Rs.isMobile?"20px":"22px"})),rm=c.default.div(Sp||(Sp=k(["\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 Rs.isMobile?"50px":"70px"}),(function(e){var r=e.top;return r&&n.css(["top:","px;"],r)}),(function(e){var r=e.bottom;return r&&n.css(["bottom:","px;"],r)}),1020),tm=c.default.div(_p||(_p=k(["\n width: ",";\n height: ",";\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 2px solid #ffffff;\n font-size: 16px;\n color: #fff;\n font-weight: 700;\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n img {\n width: 100%;\n margin: 0;\n border-radius: 50%;\n }\n"])),(function(){return Rs.isMobile?"40px":"50px"}),(function(){return Rs.isMobile?"40px":"50px"}),(function(e){return!e.active&&n.css(["opacity:0.6;"])})),nm=c.default.div(Ap||(Ap=k(["\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"])),1020),am=c.default.div(Ip||(Ip=k(["\n cursor: pointer;\n text-align: center;\n width: 50px;\n\n img {\n width: 100%;\n }\n"]))),om=c.default.div(Tp||(Tp=k(["\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"]))),im=c.default.div(xp||(xp=k(["\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"])),Xp.default,Qp.default),sm=c.default(Bh)(Pp||(Pp=k(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),cm=c.default(Eh)(Rp||(Rp=k(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var r=e.color;return null!=r?r:"rgba(0, 0, 0, 0.6)"})),lm=c.default.div(Dp||(Dp=k(["\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"]))),um=n.keyframes(["from{opacity:1;}to{opacity:0;}"]),dm=c.default.div(Np||(Np=k(["\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"])),um),fm=Rs.isMobile?{width:{ideal:640}}:null,hm={background:"#000000",opacity:.6};function pm(e){var t=e.apiCheck,n=e.mode,a=e.onLivenessDetectionDone,o=e.onClose,s=e.onError,c=e.captureFrameSettings,l=e.onFramesCaptured,u=e.frontCamera,d=e.customDirectionIcon,f=e.customStepTimeConstraints,h=e.onProcessing,p=e.customErrors,m=e.livenessSettings,g=e.apiCredentials,v=e.outputEncryptionSettings,y=e.cameraScale,b=e.defaultCameraId,C=e.passiveModeAuto,w=e.offsetFaceY,k=e.styledComponent,E=Bn.useAsset("bg_camera_mask.png"),S=Bn.useAsset("bg_camera_mask_red.png"),_=B(r.useState({}),2),A=_[0],I=_[1],T=A.yFaceDetectionError,x=A.yFaceVerificationStepsWrapper,P=B(r.useState(""),2),R=P[0],D=P[1],N=r.useCallback((function(e){var r=e.lostY,t=e.height,n=e.clientHeight,a=r+25,o=a+30;I({yFaceDetectionError:a,yFaceVerificationStepsWrapper:o+t+20});var i=Math.floor(r),c=Math.floor(n-r),l=Math.floor(o);return 0!==w&&(l+w<i||l+w+t>c)?s({code:"offsetFaceY must be in [-".concat(l-i,", ").concat(c-t-l,"]")}):l+=w,{y:l}}),[w,s]),L=ch({apiCheck:t,mode:n,bgCameraMask:E,bgCameraMaskRed:S,surroundStyle:hm,onLivenessDetectionDone:a,onError:s,cropAreaDimension:N,customDirectionIcon:d,captureFrameSettings:c,onFramesCaptured:l,livenessSettings:m,setRemainingTime:D,customStepTimeConstraints:f,onProcessing:h,customErrors:p,apiCredentials:g,outputEncryptionSettings:v,cameraScale:y,passiveModeAuto:C}),O=L.countdownToTakePicture,M=L.cropArea,U=L.curStepIndex,F=L.directionIcon,V=L.directionIconAnimation,j=L.faceDetectionError,z=L.handleTriggerPassiveMode,H=L.handleVideoPlayed,q=L.instructions,K=L.isActiveMode,G=L.refVideo,W=L.showCountdown,Q=L.steps,X=L.videoPlayed,Y=L.activeCapturing,Z=L.isFirstValidFrameFound,$=L.warmupDone;r.useEffect((function(){var e;"string"==typeof(null===(e=Q[0])||void 0===e?void 0:e.directionIcon)&&Promise.all(Q.map((function(e){return r=e.directionIcon,new Promise((function(e){var t=new Image;t.onload=e,t.onerror=e,t.src=r}));var r})))}),[Q]);var J=k.CloseCameraButton;return i.default.createElement(Tu,{frontCamera:u,onVideoPlayed:H,onClose:o,flipHorizontal:u,ref:G,videoSettings:fm,onError:s,scale:y,defaultCameraId:b,closeButton:J||null},!$&&i.default.createElement(Vh,null),X?i.default.createElement(i.default.Fragment,null,i.default.createElement($p,{top:T-15,className:"face-detection-error",error:j}),M.current?i.default.createElement(Lu,{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},i.default.createElement(cm,null),i.default.createElement(sm,{progress:U/Q.length*100,hasError:!!j,showDashedRing:!1,showOutsideRing:!1,insideRingWidth:1,errorRingWidth:1,insideRingStrokeDash:"2"}),W?i.default.createElement(om,null,O):null,K?i.default.createElement(i.default.Fragment,null,i.default.createElement(im,null,function(e,r){return e?"string"==typeof e?i.default.createElement("img",{className:r,src:e,alt:"",style:{maxWidth:"98px",maxHeight:"98px",marginBottom:"25px"}}):e:null}(F,V)),Y&&i.default.createElement(dm,null)):null,j&&i.default.createElement(lm,null)):null,K?i.default.createElement(i.default.Fragment,null,R&&i.default.createElement(Jp,{top:x-30},R),q?i.default.createElement(em,{top:x+5,className:"instructions"},q):null,Z&&i.default.createElement(rm,{top:x+35},Q.map((function(e,r){var t=e.name,n=e.image.objUrl;return i.default.createElement(tm,{key:t,active:U>=r,className:"step-item"},n?i.default.createElement("img",{src:n,alt:""}):i.default.createElement("span",null,r+1))})))):i.default.createElement(i.default.Fragment,null,!Z||j||C?null:i.default.createElement(nm,null,i.default.createElement(am,{onClick:z},i.default.createElement(Ou,null))))):null)}pm.propTypes={apiCheck:s.default.bool,mode:s.default.string,onLivenessDetectionDone:s.default.func,onClose:s.default.func,onError:s.default.func,captureFrameSettings:s.default.shape({}),onFramesCaptured:s.default.func,frontCamera:s.default.bool,customDirectionIcon:s.default.shape({}),customStepTimeConstraints:s.default.shape({}),onProcessing:s.default.func,customErrors:s.default.shape({}),livenessSettings:s.default.shape({}),apiCredentials:s.default.shape({accessKey:s.default.string,secretKey:s.default.string,apiUrl:s.default.string}),outputEncryptionSettings:s.default.shape({}),cameraScale:s.default.number,defaultCameraId:s.default.string,passiveModeAuto:s.default.bool,offsetFaceY:s.default.number,styledComponent:s.default.shape({CloseCameraButton:s.default.node})},pm.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},frontCamera:!0,customDirectionIcon:(Lp={},p(Lp,D.FaceDirection.LEFT,i.default.createElement(vh,{type:D.FaceDirection.LEFT})),p(Lp,D.FaceDirection.RIGHT,i.default.createElement(vh,{type:D.FaceDirection.RIGHT})),p(Lp,D.FaceDirection.UP,i.default.createElement(vh,{type:D.FaceDirection.UP})),p(Lp,D.FaceDirection.FRONTAL,i.default.createElement(vh,{type:D.FaceDirection.FRONTAL})),Lp),customStepTimeConstraints:(Op={},p(Op,D.FaceDirection.UP,{delayTime:0}),p(Op,D.FaceDirection.LEFT,{delayTime:0}),p(Op,D.FaceDirection.RIGHT,{delayTime:0}),p(Op,D.FaceDirection.FRONTAL,{delayTime:2e3}),Op),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 mm,gm=Object.freeze({__proto__:null,Text:Zp,FaceDetectionError:$p,CountdownTime:Jp,FaceVerificationInstructions:em,FaceVerificationStepsWrapper:rm,StepItem:tm,BottomButtonsOverlay:nm,Button:am,CountDownOverlay:om,InstructionsOverlay:im,LivenessStyledComponent:Wp,default:pm,useLivenessDetection:ch}),vm=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.frontCamera,t=void 0===r||r,n=document.createElement("div");document.body.appendChild(n);var a=function(){l.default.unmountComponentAtNode(n)};return new Promise((function(e){l.default.render(i.default.createElement(zt.SDKSettingsProvider,{value:{lang:"en"}},i.default.createElement(Tu,{checkCameraMode:!0,frontCamera:t,onVideoPlayed:function(){a(),e(null)},onClose:a,onError:function(r){a(),e(r)}})),n)}))},ym=c.default.input(mm||(mm=k(["\n display: none;\n"]))),bm=r.forwardRef((function(e,t){var n=e.useFileBrowse,a=e.accept,o=e.frontCamera,s=e.onCaptureDone,c=e.outputEncryptionSettings,l=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.target.files,!s){e.next=8;break}if(n=t[0],!c||!c.key){e.next=7;break}return e.next=6,ai.encrypt({blob:n,key:c.key});case 6:a=e.sent;case 7:s({file:n,encrypted:a});case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[s,c]);return i.default.createElement(ym,m({ref:t,type:"file",accept:a,onChange:l},n?{}:{capture:o?"user":"environment"}))}));bm.propTypes={useFileBrowse:s.default.bool,accept:s.default.string,frontCamera:s.default.bool,onCaptureDone:s.default.func,outputEncryptionSettings:s.default.shape({key:s.default.string})},bm.defaultProps={useFileBrowse:!1,accept:"image/*",frontCamera:!1,onCaptureDone:null,outputEncryptionSettings:{key:""}};var Cm,wm=Object.freeze({__proto__:null,Camera:Ou}),km="landscape",Bm="portrait",Em="desktop",Sm=D.Errors,_m=c.default.div(Cm||(Cm=k(["\n text-align: center;\n font-size: 20px;\n font-weight: 600;\n"])));function Am(e){var t=e.children,n=zt.useSDKSettings().lang,a=Sm.wrong_orientation.msg[n],o=function(){var e=r.useRef(window.matchMedia("(orientation: portrait)")),t=r.useRef(e.current.matches?Bm:km),n=B(r.useState(t.current),2),a=n[0],o=n[1];return r.useEffect((function(){function r(e){e.matches?o(Bm):o(km)}return e.current.addEventListener("change",r),function(){e.current.removeEventListener("change",r)}}),[]),Rs.isMobile?{curOrientation:a,initOrientation:t.current}:{curOrientation:Em}}().curOrientation;return i.default.createElement(i.default.Fragment,null,o===km&&i.default.createElement(Mh,{open:!0},i.default.createElement(_m,null,a)),(o===Bm||o===Em)&&i.default.createElement(i.default.Fragment,null,t))}var Im={LOADING:0,FAR_FACE:1,CLOSE_FACE:2,START_FLASHING:3,STOP_DECTECTING:4},Tm="far_face",xm="close_face",Pm="flashing",Rm=Rs.isMobile?200:400;function Dm(){return(Dm=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=l.length>0&&void 0!==l[0]?l[0]:{},t=r.tfScriptUrls,n=r.closeEyesModelUrl,a=new Bs(n),e.next=4,ei.loadTensorFlow(t);case 4:return e.next=6,ei.initTensorFlow({preferredBackends:["wasm","cpu"]});case 6:return o=[ei.loadFaceDetectionModel({detectorConfig:{runtime:"mediapipe",solutionPath:t.mediaPipeUrl}}),a.load()],e.next=9,Promise.all(o);case 9:return i=e.sent,s=B(i,1),c=s[0].faceDetector,e.abrupt("return",{faceDetector:c,closeEyesModel:a});case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Nm=Af((function(){return Dm.apply(this,arguments)})),Lm=function(e){var t=e.width,n=e.height,a=e.cameraScale,o=void 0===a?1:a,i=e.debug,s=void 0!==i&&i,c=B(r.useState(null),2),l=c[0],u=c[1];return r.useEffect((function(){var e=document.createElement("canvas");e.width=t,e.height=n;var r=e.getContext("2d");return r.translate(t,0),r.scale(-1*o,1*o),s&&(document.body.appendChild(e),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.zIndex="9999"),u(e),function(){s&&document.body.removeChild(e)}}),[o,s,n,t]),l},Om=function(e){var t=e.videoRef,n=e.cropArea;return r.useMemo((function(){return t.current?0===Object.keys(n).length?{}:Zn.analyzeVideoAndWindowSizes(t.current,n):{}}),[t,n])},Mm=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";default:return""}},Um=function(e,r){var t=e.getContext("2d");t.clearRect(0,0,e.width,e.height),t.beginPath(),t.lineWidth="1",t.strokeStyle="red",t.rect(0,0,e.width,e.height),t.stroke(),t.closePath(),Object.entries(r).forEach((function(e,r){var n=B(e,2),a=n[0],o=n[1];t.beginPath(),t.fillStyle="red",t.font="16px",t.fillText("".concat(a,": ").concat(o),10,20+20*r),t.closePath()}))},Fm=r.createContext(!1),Vm=function(e){var r=e.children,t=e.debug;return i.default.createElement(Fm.Provider,{value:t},r)};Vm.defaultProps={debug:!1,children:null},Vm.propTypes={debug:s.default.bool,children:s.default.node};var jm=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.getContext("2d"),a=e.width;n.strokeStyle="blue",n.fillStyle="blue",n.lineWidth=1,r.forEach((function(e){e.landmarks.forEach((function(e){n.beginPath(),n.arc(t?a-e[0]:e[0],e[1],2,0,2*Math.PI),n.fill(),n.closePath()})),n.beginPath();var r={x:t?a-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(r.x,r.y,r.width,r.height),n.stroke(),n.closePath()}))},zm=function(e){var t=e.size,n=e.scale,a=void 0===n?1:n,o=e.video,i=e.baseSize,s=void 0===i?200:i,c=t.width,l=t.height;return r.useMemo((function(){var e=null!=o?o:{},r=e.videoWidth,t=void 0===r?Number.MAX_SAFE_INTEGER:r,n=e.videoHeight,i=void 0===n?Number.MAX_SAFE_INTEGER:n,u=Math.min(c,l)/s,d=c/u*a,f=l/u*a;return d>t||f>i?{width:Rs.isMobile?t:i,height:i}:{width:d,height:f}}),[s,l,a,o,c])},Hm=function(e,r){return{topLeft:[e.topLeft[0]*r,e.topLeft[1]*r],bottomRight:[e.bottomRight[0]*r,e.bottomRight[1]*r],probability:e.probability,landmarks:e.landmarks.map((function(e){return[e[0]*r,e[1]*r]}))}};function qm(e){var t=e.cameraScale,n=void 0===t?1:t,a=e.isVideoPlaying,o=e.step,i=e.cropArea,s=e.videoRef,c=e.onCloseFaceDetected,l=e.onMovingCloseFace,u=e.onFarFaceDetected,d=e.onFarFullFaceDetected,h=e.onFlashingFramesCaptured,p=e.frameInterval,m=void 0===p?180:p,g=e.useFaceDetectorWhenFlashing,v=e.onFaceError,y=e.onError,b=e.faceSettings,C=e.ovalBoundingRect,w=e.isOvalTransitioning,k=e.closeEyesSettings,E=e.maskSettings,S=e.captureFrameSettings,_=E.ovalPadding,A=E.chinToMaskBottomPadding,I=S.frameScale,T=k.enable,x=k.timeout,P=r.useContext(Fm),R=Om({videoRef:s,cropArea:i}),N=zm({size:{width:R.cropWidth,height:R.cropHeight},scale:I,video:s.current}),L=function(e){var t=e.cropArea,n=e.ovalBoundingRect,a=e.ovalPadding,o=e.baseCanvasSize;return r.useMemo((function(){var e,r,i,s,c=t.width,l=t.height,u=t.x,d=t.y,f=Math.min(c,l)/o,h=c/f,p=l/f,m=null!==(e=null==n?void 0:n.left)&&void 0!==e?e:0,g=null!==(r=null==n?void 0:n.top)&&void 0!==r?r:0,v=null!==(i=null==n?void 0:n.right)&&void 0!==i?i:c,y=null!==(s=null==n?void 0:n.bottom)&&void 0!==s?s:l;return{left:Math.max((m-u-a.left)/f,0),right:Math.min((v-u+a.right)/f,h-0),top:Math.max((g-d-a.top)/f,0),bottom:Math.min((y-d+a.bottom)/f,p-0)}}),[t,null==n?void 0:n.bottom,null==n?void 0:n.left,null==n?void 0:n.right,null==n?void 0:n.top,a.bottom,a.left,a.right,a.top,o])}({cropArea:i,ovalBoundingRect:C,ovalPadding:_,baseCanvasSize:Math.min(N.width,N.height)}),O=b.minFarFaceRatio,M=b.maxFarFaceRatio,U=b.closeFaceRatio,F=Lm({width:N.width,height:N.height,cameraScale:n}),V=N.height/N.width,j=Lm({width:Rm,height:Rm*V,cameraScale:n,debug:P}),z=function(e){var t=e.width,n=e.height,a=e.debug,o=r.useRef(null),i=r.useMemo((function(){var e=document.createElement("canvas");return e.width=t,e.height=n,e.style.position="fixed",e.style.bottom="0",e.style.left="0",e.style.zIndex="99999",o.current=e,a&&document.body.appendChild(e),e}),[n,t,a]);return r.useEffect((function(){return function(){a&&document.body.removeChild(o.current)}}),[a]),i}({width:160,height:150,debug:P}),H=function(e,t){var n=B(r.useState({}),2),a=n[0],o=n[1],i=Object.keys(a).length>0;return r.useEffect((function(){var r=!1;return function(){var n=f(regeneratorRuntime.mark((function n(){var a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Nm(e);case 3:if(a=n.sent,!r){n.next=6;break}return n.abrupt("return");case 6:o(a),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]),[a,i]}(zt.useSDKSettings().customUrls,y),q=B(H,2),K=q[0],G=q[1],W=r.useRef(null),Q=function(e){var t=e.timeout,n=r.useRef(null),a=r.useCallback((function(){n.current=performance.now()}),[]),o=r.useCallback((function(){return null===n.current?(a(),!1):performance.now()-n.current>t}),[a,t]);return{markTime:a,checkIfEllapsed:o}}({timeout:1e3*x}),X=Q.markTime,Y=Q.checkIfEllapsed,Z=G&&a,$=B(r.useState(""),2),J=$[0],ee=$[1],re=K.closeEyesModel,te=K.faceDetector,ne=r.useMemo((function(){return Yu(ee,1e3)}),[]),ae=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r,t){var n,a,i,f,p,m,b,C,k,B,E,S,_,I,x,R,N,F,V,H,q,K,G,W,Q,Z,$,J,ee,ae,oe,ie;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==(null==t?void 0:t.width)&&0!==(null==t?void 0:t.height)){e.next=3;break}return e.abrupt("return");case 3:if(null!==s.current){e.next=5;break}return e.abrupt("return");case 5:if(!w){e.next=7;break}return e.abrupt("return");case 7:if(o!==Im.STOP_DECTECTING){e.next=9;break}return e.abrupt("return");case 9:if(n=r.cropX,a=r.cropY,i=r.cropWidth,f=r.cropHeight,p=t.width,m=t.height,t.getContext("2d").drawImage(s.current,n,a,i,f,0,0,p,m),b=Rm/p,P&&j.getContext("2d").drawImage(s.current,n,a,i,f,0,0,p*b,m*b),g||o!==Im.START_FLASHING){e.next=21;break}if("function"!=typeof h){e.next=20;break}return e.next=20,h({prediction:null,canvas:t,landmarks:null});case 20:return e.abrupt("return");case 21:return e.next=23,te.estimateFaces(t);case 23:return C=e.sent,k=ha.faceDetectorToBlazefacePredictions(C),e.next=27,ha.validatePredictions({predictions:k,width:p,height:m});case 27:return B=e.sent,E=B.fullFace,S=B.ratio,_=[[L.left,L.top],[L.right,L.bottom]],e.next=33,ha.validatePredictions({predictions:k,cropAreaCoordinates:_});case 33:if(I=e.sent,x=I.error,R=I.fullFace,N=I.faceRatio,P&&(F={left:L.left*b,top:L.top*b,right:L.right*b,bottom:L.bottom*b},se={x:F.left,y:F.top,width:F.right-F.left,height:F.bottom-F.top},ce="red",le=void 0,(le=j.getContext("2d")).strokeStyle=ce,le.lineWidth=1,le.beginPath(),le.rect(se.x,se.y,se.width,se.height),le.stroke(),le.closePath(),V=k.map((function(e){return Hm(e,b)})),jm(j,V,!0)),H=D.FaceDirection.FRONTAL,!R){e.next=44;break}return e.next=42,ha.calculateFaceDirection({landmarks:R.landmarks,upDownBound:{lower:.35,upper:.7}});case 42:K=e.sent,H=null!==(q=null==K?void 0:K.gesture)&&void 0!==q?q:"";case 44:if(!E||o!==Im.FAR_FACE){e.next=48;break}if("function"!=typeof u){e.next=48;break}return e.next=48,u({prediction:k[0],canvas:t,landmarks:E.landmarks,faceArea:r});case 48:if(!E||o!==Im.CLOSE_FACE){e.next=52;break}if("function"!=typeof l){e.next=52;break}return e.next=52,l({prediction:k[0],canvas:t,landmarks:E.landmarks,faceArea:r});case 52:if(G=null==x?void 0:x.code,e.prev=53,G!==D.Errors.no_face.code){e.next=56;break}throw new Error("no_face");case 56:if(!(G===D.Errors.multiple_faces.code||k.length>1)){e.next=61;break}if(W=ha.calculateFaceArea(k[0]),Q=ha.calculateFaceArea(k[1]),!(W<=2*Q)){e.next=61;break}throw new Error("multiple_faces");case 61:if(H===D.FaceDirection.FRONTAL){e.next=63;break}throw new Error("face_not_frontal");case 63:if(G!==D.Errors.partial_face.code){e.next=68;break}if(Z=ha.cropFaceInsideBox([k[0].topLeft,k[0].bottomRight],_),!(oa.rectEdgeRatio(Z,_)>.95)){e.next=68;break}throw new Error("face_too_large");case 68:if(o!==Im.FAR_FACE){e.next=73;break}if(!(N>M)){e.next=71;break}throw new Error("face_too_large");case 71:if(!(N<O)){e.next=73;break}throw new Error("face_too_small");case 73:if(o!==Im.CLOSE_FACE){e.next=76;break}if(!(N<U)){e.next=76;break}throw new Error("face_too_small");case 76:if(!(Array.isArray(k)&&k.length>0&&L.bottom-k[0].bottomRight[1]>A)){e.next=78;break}throw new Error("face_too_high");case 78:if(G!==D.Errors.face_out_of_box.code){e.next=85;break}if(o!==Im.FAR_FACE){e.next=82;break}if(!(N>=O&&N<=M)){e.next=82;break}throw new Error("");case 82:if(o!==Im.CLOSE_FACE){e.next=85;break}if(!(N>=U)){e.next=85;break}throw new Error("");case 85:e.next=90;break;case 87:e.prev=87,e.t0=e.catch(53),G=e.t0.message;case 90:if(!T){e.next=100;break}if(G){e.next=99;break}return e.next=94,re.predict(t,E.landmarks);case 94:$=e.sent,J=Y(),$.isEyeClose&&!J&&(G="eye_close"),e.next=100;break;case 99:X();case 100:if(P&&Um(z,{ratio:null!==(ee=null==S?void 0:S.toFixed(3))&&void 0!==ee?ee:"undefined",error:G,ovalFaceRatio:null!==(ae=null==N?void 0:N.toFixed(3))&&void 0!==ae?ae:"undefined",ovalError:null!==(oe=null==x?void 0:x.code)&&void 0!==oe?oe:"undefined",step:o===Im.FAR_FACE?"far":"close"}),ie=Mm(G),ne(ie),!ie){e.next=108;break}if("function"!=typeof v){e.next=107;break}return e.next=107,v({error:G,currentStep:o});case 107:return e.abrupt("return");case 108:if(!(E&&o===Im.FAR_FACE&&O<=N&&N<=M)){e.next=113;break}if("function"!=typeof d){e.next=113;break}return e.next=112,d({prediction:k[0],canvas:t,landmarks:E.landmarks,faceArea:r});case 112:return e.abrupt("return");case 113:if(!(E&&o===Im.CLOSE_FACE&&N>=U)){e.next=118;break}if("function"!=typeof c){e.next=118;break}return e.next=117,c({prediction:k[0],canvas:t,landmarks:E.landmarks,faceArea:r});case 117:return e.abrupt("return");case 118:if(!(E&&o===Im.START_FLASHING&&N>=U)){e.next=123;break}if("function"!=typeof h){e.next=123;break}return e.next=122,h({prediction:k[0],canvas:t,landmarks:E.landmarks,faceArea:r});case 122:return e.abrupt("return");case 123:e.next=129;break;case 125:e.prev=125,e.t1=e.catch(0),console.error(e.t1),y({error:e.t1});case 129:case"end":return e.stop()}var se,ce,le}),e,null,[[0,125],[53,87]])})));return function(r,t){return e.apply(this,arguments)}}(),[j,z,P,s,w,o,te,L.left,L.top,L.right,L.bottom,ne,O,M,U,h,u,v,d,l,c,y,A,g,T,re,Y,X]);return r.useEffect((function(){var e=null,r=!1;return Z&&function t(){e=requestAnimationFrame(function(){var e=f(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=2;break}return e.abrupt("return");case 2:if(null!==s.current){e.next=4;break}return e.abrupt("return");case 4:if(null===W.current&&(W.current=n),!(n-W.current<m)){e.next=9;break}return t(),e.abrupt("return");case 9:return W.current=n,e.next=12,ae(R,F);case 12:t();case 13:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}())}(),function(){r=!0,cancelAnimationFrame(e)}}),[F,R,ae,Z,s,m]),{warmupDone:G,faceError:J}}var Km="rgba(0,0,0,0.6)",Gm=function(e){var t=e.onVideoPlayed,n=B(r.useState(!1),2),a=n[0],o=n[1],i=B(r.useState({}),2),s=i[0],c=i[1];return{onVideoPlayed:r.useCallback((function(e){var r=function(e){var r,t,n=e.videoAreaWidth,a=e.videoAreaHeight,o=e.lostX,i=e.lostY;Rs.isMobile?(r=n,t=a):(r=window.innerHeight,t=window.innerHeight);var s=Math.max(Math.round((n-r)/2+o),0),c=Math.max(Math.round((a-t)/2+i),0),l={};return l.width=Rs.isMobile?n:a-200,l.height=Rs.isMobile?n:a-200,l.x=Math.floor((n-l.width)/2)+o,l.y=5+i,{width:r,height:t,x:s,y:c,square:l}}(e);c(r),o(!0),"function"==typeof t&&t(e)}),[t]),cropArea:s,isPlaying:a}},Wm=function(e){var r=e.prediction,t=e.canvas,n=e.landmarks,a=e.index,o=e.quality,i=void 0===o?.8:o,s=t.toDataURL("image/jpeg",i);return r?{label:"portrait",base64:s.split(",")[1],landmarks:n,index:a}:{label:"portrait",base64:s.split(",")[1],index:a}},Qm=function(){var e=f(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)}}(),Xm=function(e){var r=e.className,t=e.iconColor;return i.default.createElement("svg",{className:r,width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.default.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",fill:t}),i.default.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"}),i.default.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"}),i.default.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"}),i.default.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"}),i.default.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"}),i.default.createElement("rect",{x:"0.5",y:"0.5",width:"47",height:"47",rx:"23.5",stroke:"#DAEAFB"}))};Xm.defaultProps={className:"",iconColor:"#0276F1"},Xm.propTypes={className:s.default.string,iconColor:s.default.string};var Ym,Zm,$m,Jm={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"}}},eg=c.default.div(Ym||(Ym=k(["\n & .indicator {\n color: ",";\n }\n\n & .gauge {\n background-color: ",";\n }\n"])),(function(e){var r=e.theme;return pu(r,"FlashLiveness.progressBar.mainColor",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.progressBar.mainColor",Jm)})),rg=c.default.div(Zm||(Zm=k(["\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 r=e.theme;return pu(r,"FlashLiveness.progressBar.secondaryColor",Jm)})),tg=function(e){var r=e.value,t=e.className;return i.default.createElement(eg,{className:t},i.default.createElement(rg,null,i.default.createElement("span",{className:"gauge",style:{width:"".concat(r,"%")}})),i.default.createElement("div",null,i.default.createElement("span",{className:"indicator"},"• ",r,"%")))};tg.defaultProps={value:0,className:""},tg.propTypes={value:s.default.number,className:s.default.string};var ng,ag=c.default.span($m||($m=k(["\n padding: 8px 12px;\n display: flex;\n align-items: center;\n flex-direction: row;\n"]))),og=function(e){var r=e.children,t=e.className;return i.default.createElement(ag,{className:t},r)};og.defaultProps={children:null,className:""},og.propTypes={children:s.default.node,className:s.default.string};var ig,sg=c.default.span(ng||(ng=k(["\n ","\n padding: 12px 16px;\n max-width: 200px;\n text-align: center;\n display: inline-block;\n"])),(function(e){var r=e.theme;return n.css(["font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";"],pu(r,"FlashLiveness.instruction.fontSize",Jm),pu(r,"FlashLiveness.instruction.color",Jm),pu(r,"FlashLiveness.instruction.fontWeight",Jm),pu(r,"FlashLiveness.instruction.background",Jm),pu(r,"FlashLiveness.instruction.borderRadius",Jm),pu(r,"FlashLiveness.instruction.border",Jm))})),cg=function(e){var r=e.children,t=e.className;return i.default.createElement(sg,{className:t},r)};cg.defaultProps={children:null,className:""},cg.propTypes={children:s.default.node,className:s.default.string};var lg,ug,dg=c.default.div(ig||(ig=k(["\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"})),fg=function(e){var r=e.children,t=e.overlay,n=e.loadingComponent;return i.default.createElement(dg,{$overlay:t},t&&n,i.default.createElement("div",{style:{visibility:t?"hidden":"visible"}},r))};fg.defaultProps={children:null,overlay:!1,loadingComponent:i.default.createElement(Vh,null)},fg.propTypes={children:s.default.node,overlay:s.default.bool,loadingComponent:s.default.node};var hg={width:210,height:300},pg={width:Rs.isMobile?window.innerWidth:window.innerHeight,height:window.innerHeight},mg=c.default.ellipse(lg||(lg=k(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),gg=c.default.rect(ug||(ug=k(["\n transition: all 0.3s ease-in-out;\n transform-origin: center;\n transform: scale(",");\n"])),(function(e){return e.$scale})),vg=r.forwardRef((function(e,r){var t=e.className,n=e.scale,a=e.debug,o=e.width,s=e.height,c=e.padding,l=e.verticalOffset,u=e.ovalMaskFillColor,d={left:o/2-hg.width/2-c.left,top:s/2-hg.height/2-c.top+l,right:o/2+hg.width/2+c.right,bottom:s/2+hg.height/2+c.bottom+l};return i.default.createElement("svg",{className:t,viewBox:"0 0 ".concat(o," ").concat(s),width:o,height:s},i.default.createElement("mask",{id:"OVAL_MASK"},i.default.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#OVAL_MASK)"}),i.default.createElement(mg,{ref:r,cx:o/2,cy:s/2+l,rx:hg.width/2,ry:hg.height/2,$scale:n})),i.default.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:u,mask:"url(#OVAL_MASK)"}),a&&i.default.createElement("rect",{x:"0",y:"0",width:o,height:s,stroke:"red",fill:"none"}),a&&i.default.createElement(gg,{x:d.left,y:d.top,width:d.right-d.left,height:d.bottom-d.top,$scale:n,fill:"none",stroke:"red",strokeWidth:.5}))}));vg.propTypes={className:s.default.string,scale:s.default.oneOfType([s.default.number,s.default.string]),debug:s.default.bool,width:s.default.number,height:s.default.number,padding:s.default.oneOfType([s.default.number,s.default.shape({top:s.default.number,right:s.default.number,bottom:s.default.number,left:s.default.number})]),verticalOffset:s.default.number,ovalMaskFillColor:s.default.string},vg.defaultProps={className:"",scale:1,debug:!1,width:pg.width,height:pg.height,padding:0,verticalOffset:0,ovalMaskFillColor:"#fff"};var yg={en:{face_authentication:"Face authentication",hold_still:"Hold still",uploading:"Uploading",start:"Start",continue:"Continue",retry:"Retry","face_authentication.successful":"Successful face authentication","face_authentication.unsuccessful":"Unsuccessful face authentication",move_face_into_frame:"Fit your face into the oval",face_not_found:"No face detected",processing_result:"Processing result",please_move_face_into_center_frame:"Please fit your face in the oval",please_move_face_closer:"Please move your face a bit closer",please_move_face_farther:"Please move your face a bit further",please_open_your_eyes:"Please open your eyes",please_look_straight_at_the_camera:"Please hold your device at eye level",please_only_one_face:"Multiple faces detected",please_move_face_down:"Please move your face down a little","timeout.remaining":"Remaining time: <%= remain %> seconds","timeout.expired":"You need to complete within <%= timeout %> seconds. Please try again.",move_face_closer:"Move your face closer"},vi:{face_authentication:"Xác thực khuôn mặt",hold_still:"Giữ yên",uploading:"Đang tải lên",start:"Bắt đầu",continue:"Tiếp tục",retry:"Thử lại","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:"Đưa mặt vào khung",face_not_found:"Không tìm thấy khuôn mặt",processing_result:"Đang xử lý kết quả",please_move_face_into_center_frame:"Đưa khuôn mặt vào giữa hình oval",please_move_face_closer:"Đưa khuôn mặt lại gần một chút",please_move_face_farther:"Đưa khuôn mặt ra xa một chút",please_open_your_eyes:"Vui lòng mở to mắt",please_look_straight_at_the_camera:"Vui lòng đưa thiết bị ngang tầm mắt",please_only_one_face:"Có nhiều mặt trong khung hình",please_move_face_down:"Đưa khuôn mặt xuống một chút","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:"Đưa mặt lại gần"}},bg=r.createContext({}),Cg=function(e){var r,t=e.children,n=zt.useSDKSettings().lang;return i.default.createElement(bg.Provider,{value:null!==(r=yg[n])&&void 0!==r?r:yg.vi},t)};Cg.propTypes={children:s.default.node.isRequired};var wg,kg=function(){var e=r.useContext(bg);return r.useCallback((function(r,t){var n,a;return t?Cf(null!==(n=e[r])&&void 0!==n?n:r)(t):null!==(a=e[r])&&void 0!==a?a:r}),[e])},Bg=function(e,t){var n=r.useRef(e);r.useEffect((function(){n.current=e}),[e]),r.useEffect((function(){t&&"function"==typeof n.current&&n.current()}),[t])},Eg=Object.freeze({READY:"READY",RUNNING:"RUNNING",STOPPED:"STOPPED"}),Sg=c.default.span(wg||(wg=k(["\n display: inline-block;\n margin-block-start: 10px;\n text-align: center;\n max-width: 350px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n padding: ",";\n"])),(function(e){var r=e.theme;return pu(r,"FlashLiveness.timeoutText.color",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.timeoutText.fontSize",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.timeoutText.fontWeight",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.timeoutText.padding",Jm)})),_g=function(e){var t=e.onTimeout,n=e.timeout,a=e.shouldStart,o=e.shouldStop,s=kg(),c=function(e){var t=e.startTime,n=void 0===t?3:t,a=e.onCountDownDone,o=e.autoRestartAfter,i=void 0===o?-1:o,s=B(r.useState(n),2),c=s[0],l=s[1],u=B(r.useState(Eg.READY),2),d=u[0],f=u[1],h=r.useRef(),p=r.useCallback((function(){f(Eg.RUNNING),h.current=setInterval((function(){l((function(e){return e-1}))}),1e3)}),[]),m=r.useCallback((function(){f(Eg.READY),l(n),clearInterval(h.current)}),[n]);return r.useEffect((function(){var e=null;return 0===c&&(f(Eg.STOPPED),clearInterval(h.current),"function"==typeof a&&a(),-1!==i&&(e=setTimeout((function(){m(),p()}),1e3*i))),function(){clearTimeout(e)}}),[c,a,i,m,p]),{state:d,countdown:c,startCountDown:p,stopCountDown:m}}({startTime:n,onCountDownDone:t,autoRestartAfter:3}),l=c.countdown,u=c.startCountDown,d=c.stopCountDown;return Bg(u,a),Bg(d,o),i.default.createElement(i.default.Fragment,null,l>0&&l<10&&i.default.createElement(Sg,null,s("timeout.remaining",{remain:l})),0===l&&i.default.createElement(Sg,null,s("timeout.expired",{timeout:n})))};_g.propTypes={onTimeout:s.default.func.isRequired,timeout:s.default.number.isRequired,shouldStart:s.default.bool.isRequired,shouldStop:s.default.bool.isRequired};var Ag={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"]},Ig=function(e){var r,t=(p(r={},Tm,0),p(r,xm,0),p(r,Pm,0),r);return e.forEach((function(e){var r;null!=e&&null!==(r=e.metadata)&&void 0!==r&&r.type&&(t[e.metadata.type]+=1)})),t},Tg=r.createContext({}),xg=function(e){var r=e.apiCredentials,t=e.children,n=Ao.useApiClient({apiCredentials:r}).apiClient;return i.default.createElement(Tg.Provider,{value:n},t)};xg.propTypes={apiCredentials:s.default.shape({accessKey:s.default.string.isRequired,secretKey:s.default.string.isRequired,apiUrl:s.default.string.isRequired}),children:s.default.node.isRequired},xg.defaultProps={apiCredentials:{}};var Pg,Rg,Dg=function(){return r.useContext(Tg)},Ng=(Pg=[],Rg=null,{uploadFrameBatch:function(e,r){Rg!==e[e.length-1]&&(Rg=e[e.length-1],Pg.push(r.httpClient.post("/v1/files",{frames:e,metadata:JSON.stringify({type:"selfie"})})))},getAllUploadedBatches:function(){var e=f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Pg);case 2:if(!(r=e.sent).some((function(e){var r;return void 0===(null==e||null===(r=e.data)||void 0===r?void 0:r.file_id)}))){e.next=5;break}return e.abrupt("return",null);case 5:return e.abrupt("return",r.map((function(e){return{id:e.data.file_id}})));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),resetUploadBatches:function(){Pg.length=0}}),Lg=r.createContext({}),Og={},Mg=function(e){var t=e.children,n=e.clientSettings,a=e.apiCheck,o=B(r.useState({}),2),s=o[0],c=o[1],l=Dg();r.useEffect((function(){function e(){return(e=f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"==typeof l.clientSettings){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,l.clientSettings();case 4:r=e.sent,c(r);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[l]);var u=Og;return Object.keys(n).length>0?u=n:a&&(u=s),i.default.createElement(Lg.Provider,{value:u},t)};Mg.propTypes={children:s.default.node.isRequired,clientSettings:s.default.shape({}),apiCheck:s.default.bool},Mg.defaultProps={clientSettings:{},apiCheck:!1};var Ug,Fg,Vg,jg,zg,Hg,qg,Kg,Gg,Wg,Qg,Xg,Yg,Zg,$g=function(){return r.useContext(Lg)},Jg={captureFrameSettings:{enable:!1,framesIntervalTime:0,framesBatchLength:10,frameScale:1,frameQuality:.8},livenessSettings:{timeout:30,enableFarStep:!0},flashSettings:{flashColor:"rgb(255, 0, 0)",colorsLength:10,delayBetweenColors:120,framesPerColor:4,flashIntensity:1,useFaceDetectorWhenFlashing:!1},maskSettings:{smallScale:Rs.isMobile?.65:.6,largeScale:Rs.isMobile?.9:.85,ovalPadding:{left:Rs.isMobile?20:30,right:Rs.isMobile?20:30,top:(Rs.isMobile,0),bottom:(Rs.isMobile,20)},ovalVerticalOffset:Rs.isMobile?60:0,chinToMaskBottomPadding:(Rs.isMobile,20)},faceSettings:{minFarFaceRatio:Rs.isMobile?.85:.8,maxFarFaceRatio:(Rs.isMobile,.9),closeFaceRatio:Rs.isMobile?.95:.82},closeEyesSettings:{enable:!1,timeout:5},exifSettings:{enable:!0},imageSettings:{imageScale:1,imageQuality:1}},ev=function(){var e=$g();return r.useMemo((function(){return{captureFrameSettings:{enable:hu(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.enable",Jg.captureFrameSettings.enable),framesIntervalTime:hu(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frames_interval_time",Jg.captureFrameSettings.framesIntervalTime),framesBatchLength:hu(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frames_batch_length",Jg.captureFrameSettings.framesBatchLength),frameScale:hu(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_scale",Jg.captureFrameSettings.frameScale),frameQuality:hu(e,"data.settings.sdk_settings.flash_liveness_settings.capture_frame_settings.frame_quality",Jg.captureFrameSettings.frameQuality)},livenessSettings:{timeout:hu(e,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.timeout",Jg.livenessSettings.timeout),enableFarStep:hu(e,"data.settings.sdk_settings.flash_liveness_settings.liveness_settings.enable_far_step",Jg.livenessSettings.enableFarStep)},flashSettings:{flashColor:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_color",Jg.flashSettings.flashColor),colorsLength:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.colors_length",Jg.flashSettings.colorsLength),delayBetweenColors:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.delay_between_colors",Jg.flashSettings.delayBetweenColors),framesPerColor:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.frames_per_color",Jg.flashSettings.framesPerColor),flashIntensity:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.flash_intensity",Jg.flashSettings.flashIntensity),useFaceDetectorWhenFlashing:hu(e,"data.settings.sdk_settings.flash_liveness_settings.flash_settings.use_face_detector_when_flashing",Jg.flashSettings.useFaceDetectorWhenFlashing)},maskSettings:{smallScale:hu(e,Rs.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.small_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.small_scale",Jg.maskSettings.smallScale),largeScale:hu(e,Rs.isMobile?"data.settings.sdk_settings.flash_liveness_settings.mask_settings.mobile.large_scale":"data.settings.sdk_settings.flash_liveness_settings.mask_settings.large_scale",Jg.maskSettings.largeScale),ovalPadding:{left:hu(e,Rs.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",Jg.maskSettings.ovalPadding.left),right:hu(e,Rs.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",Jg.maskSettings.ovalPadding.right),top:hu(e,Rs.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",Jg.maskSettings.ovalPadding.top),bottom:hu(e,Rs.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",Jg.maskSettings.ovalPadding.bottom)},ovalVerticalOffset:hu(e,Rs.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",Jg.maskSettings.ovalVerticalOffset),chinToMaskBottomPadding:hu(e,Rs.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",Jg.maskSettings.chinToMaskBottomPadding)},faceSettings:{minFarFaceRatio:hu(e,Rs.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",Jg.faceSettings.minFarFaceRatio),maxFarFaceRatio:hu(e,Rs.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",Jg.faceSettings.maxFarFaceRatio),closeFaceRatio:hu(e,Rs.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",Jg.faceSettings.closeFaceRatio)},closeEyesSettings:{enable:hu(e,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.enable",Jg.closeEyesSettings.enable),timeout:hu(e,"data.settings.sdk_settings.flash_liveness_settings.close_eyes_settings.timeout",Jg.closeEyesSettings.timeout)},exifSettings:{enable:hu(e,"data.settings.sdk_settings.flash_liveness_settings.exif_data_settings.enable",Jg.exifSettings.enable)},imageSettings:{imageScale:hu(e,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_scale",Jg.imageSettings.imageScale),imageQuality:hu(e,"data.settings.sdk_settings.flash_liveness_settings.image_settings.image_quality",Jg.imageSettings.imageQuality)}}}),[e])},rv=function(e){return Array.isArray(e)?e.map((function(e){var r=e.base64,t=e.label,n=e.index,a=e.metadata;return{base64:r,label:t,index:n,metadata:JSON.stringify(a)}})):e},tv=(c.default.div(Ug||(Ug=k(["\n color: #ffffff;\n"]))),c.default.div(Fg||(Fg=k(["\n ","\n"])),(function(e){var r=e.theme;return pu(r,"FlashLiveness.title.hidden",Jm)?n.css(["display:none;"]):n.css(["display:flex;justify-content:center;align-items:center;width:100%;height:","};color:",";font-size:",";font-weight:",";"],pu(r,"FlashLiveness.title.height",Jm),pu(r,"FlashLiveness.title.color",Jm),pu(r,"FlashLiveness.title.fontSize",Jm),pu(r,"FlashLiveness.title.fontWeight",Jm))}))),nv=c.default(vg)(Vg||(Vg=k(["\n z-index: 2010;\n width: 100%;\n height: 100%;\n opacity: 1;\n margin: 0;\n"]))),av=c.default(og)(jg||(jg=k(["\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"])),1002,(function(e){var r=e.theme;return e.$flashing?n.css(["transform:translateY(45vh);font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";padding:",";"],pu(r,"FlashLiveness.guideline.text.flashing.fontSize",Jm),pu(r,"FlashLiveness.guideline.text.flashing.color",Jm),pu(r,"FlashLiveness.guideline.text.flashing.fontWeight",Jm),pu(r,"FlashLiveness.guideline.text.flashing.background",Jm),pu(r,"FlashLiveness.guideline.text.flashing.borderRadius",Jm),pu(r,"FlashLiveness.guideline.text.flashing.border",Jm),pu(r,"FlashLiveness.guideline.text.flashing.padding",Jm)):n.css(["font-size:",";color:",";font-weight:",";background:",";border-radius:",";border:",";padding:",";"],pu(r,"FlashLiveness.guideline.text.normal.fontSize",Jm),pu(r,"FlashLiveness.guideline.text.normal.color",Jm),pu(r,"FlashLiveness.guideline.text.normal.fontWeight",Jm),pu(r,"FlashLiveness.guideline.text.normal.background",Jm),pu(r,"FlashLiveness.guideline.text.normal.borderRadius",Jm),pu(r,"FlashLiveness.guideline.text.normal.border",Jm),pu(r,"FlashLiveness.guideline.text.normal.padding",Jm))})),ov=c.default((function(e){return i.default.createElement("svg",m({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),i.default.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"}))}))(zg||(zg=k(["\n ","\n"])),(function(e){var r=e.theme;return n.css(["z-index:1001;cursor:pointer;position:fixed;top:",";right:",";left:",";bottom:",";display:",";"],pu(r,"closeButton.top",Oc),pu(r,"closeButton.right",Oc),pu(r,"closeButton.left",Oc),pu(r,"closeButton.bottom",Oc),pu(r,"closeButton.display",Oc))})),iv=c.default.div(Hg||(Hg=k(["\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}),1001),sv=c.default.div(qg||(qg=k(["\n background-color: ",";\n opacity: ",";\n width: 100vw;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n"])),(function(e){var r=e.theme;return pu(r,"FlashLiveness.errorOverlay.backgroundColor",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.errorOverlay.opacity",Jm)})),cv=c.default(tg)(Kg||(Kg=k(["\n margin-block-start: 10px;\n color: ",";\n font-size: ",";\n font-weight: ",";\n width: 300px;\n z-index: 1002;\n"])),(function(e){var r=e.theme;return pu(r,"FlashLiveness.progressBar.mainColor",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.progressBar.fontSize",Jm)}),(function(e){var r=e.theme;return pu(r,"FlashLiveness.progressBar.fontWeight",Jm)})),lv=c.default.div(Gg||(Gg=k(["\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"])),1002),uv=c.default.div(Wg||(Wg=k(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"]))),dv=c.default.div(Qg||(Qg=k(["\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n"]))),fv=Rs.isMobile?{width:{ideal:640},whiteBalanceMode:"none"}:null;function hv(e){var t=e.onFlashDone,o=e.apiCheck,s=e.onClose,c=e.onError,l=e.frontCamera,d=e.styledComponent,h=e.onFramesCaptured,m=ev(),g=m.maskSettings,y=m.flashSettings,b=m.faceSettings,C=m.closeEyesSettings,w=m.livenessSettings,k=m.captureFrameSettings,E=m.exifSettings,S=m.imageSettings;if(g.smallScale>g.largeScale)throw new Error("smallScale must be smaller than largeScale");var _,A,I,T,x=Dg(),P=k.framesIntervalTime,R=r.useRef(),N=(_=r.useRef(),A=Cn.useSDKTracking().sendEvent,r.useCallback((function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=performance.now(),a={};"object"===u(t)&&(a=v({},t),_.current&&(a.interval_vs_previous_in_ms=n-_.current)),"function"==typeof t&&(a=t({lastTimeLog:_.current})),_.current=n,A({tag:e,event:r,log:a})}),[A])),L=kg(),O=r.useContext(Fm),M=y.colorsLength,U=y.framesPerColor,F=y.delayBetweenColors,V=y.useFaceDetectorWhenFlashing,j=y.flashIntensity,z=y.flashColor,H=(I=M,r.useMemo((function(){var e=Ag[I];return e[Math.floor(Math.random()*e.length)]}),[I])),q=n.useTheme(),K=function(e){var t=B(r.useState(e),2),n=t[0],a=t[1];return r.useEffect((function(){!function(){var r=f(regeneratorRuntime.mark((function r(){var t,n,o,i,s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Promise.all([60,Qm()]);case 3:t=r.sent,n=B(t,2),o=n[0],i=n[1],s=Math.max(1e3/o,1e3/i,e),a(s),r.next=15;break;case 11:r.prev=11,r.t0=r.catch(0),console.error(r.t0),a(20);case 15:case"end":return r.stop()}}),r,null,[[0,11]])})));return function(){return r.apply(this,arguments)}}()()}),[e]),n}(P),G=r.useRef(null),W=function(){var e,t=B(r.useState(null),2),n=t[0],a=t[1],o=B(r.useState(!1),2),i=o[0],s=o[1],c=r.useRef(null);return r.useEffect((function(){if(!c.current)return function(){};var e=c.current,r=function(){a(e.getBoundingClientRect()),s(!1)},t=function(){s(!0)};return e.addEventListener("transitionstart",t),e.addEventListener("transitionend",r),function(){e.removeEventListener("transitionstart",t),e.removeEventListener("transitionend",r)}}),[]),[c,null!=n?n:null===(e=c.current)||void 0===e?void 0:e.getBoundingClientRect(),i,s]}(),Q=B(W,4),X=Q[0],Y=Q[1],Z=Q[2],$=Q[3],J=B(r.useState(0),2),ee=J[0],re=J[1],te=B(r.useState(Im.LOADING),2),ne=te[0],ae=te[1],oe=B(r.useState(""),2),ie=oe[0],se=oe[1],ce=r.useRef({frames:[],images:[],total:p({},Tm,0)}),le=function(e){var t=e.mode,n=e.enableWriteExif,a=r.useRef(Date.now()),o=r.useCallback((function(){if(n){var e=Date.now();ws.preWriteExif({mode:t,startTime:a.current,endTime:e})}}),[t,n]),i=r.useCallback((function(e,r){n&&ws.addExifData(e,r)}),[n]),s=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.imageData){e.next=3;break}return e.abrupt("return",null);case 3:if(n){e.next=5;break}return e.abrupt("return",a.blob);case 5:return e.next=7,ws.writeExif({mode:t,imageData:a,enableExifData:!0});case 7:return o=e.sent,e.abrupt("return",o);case 9:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[t,n]);return r.useEffect((function(){n&&ws.initExifData()}),[n]),{prepareExifData:o,writeExifData:s,addExifData:i}}({mode:ws.MODE.SELFIE,enableWriteExif:E.enable}),ue=le.prepareExifData,de=le.writeExifData,fe=le.addExifData,he=r.useCallback((function(){se(L("move_face_into_frame"))}),[L]),pe=Gm({onVideoPlayed:he}),me=pe.onVideoPlayed,ge=pe.cropArea,ve=pe.isPlaying,ye=function(e){var r,t=e.imageScale,n=e.cropArea,a=e.videoRef,o=Om({videoRef:a,cropArea:null!==(r=n.square)&&void 0!==r?r:{}}),i=Om({videoRef:a,cropArea:n}),s="number"==typeof o.cropHeight?400/o.cropHeight:1,c=zm({size:{width:i.cropWidth,height:i.cropHeight},scale:t*s,video:a.current,baseSize:Math.min(i.cropHeight,i.cropWidth)}),l=c.width,u=c.height;return Lm({width:l,height:u})}({imageScale:S.imageScale,videoRef:G,cropArea:ge}),be=function(e,r,t){var n=e.smallScale,a=e.largeScale,o=e.ovalPadding,i=r.width/r.height,s=n/a,c=n*t.height,l=a*t.height,u=o.top+o.bottom,d=o.left+o.right,f=c-u,h=l-u;if(parseFloat((h*i).toFixed(2))+d>t.width){var p=((t.width-d)/r.width).toFixed(2);return{smallScale:(p*s).toFixed(2),largeScale:p}}return{smallScale:(f/r.height).toFixed(2),largeScale:(h/r.height).toFixed(2)}}(g,hg,{width:ge.width,height:ge.height}),Ce=be.smallScale,we=be.largeScale,ke=r.useMemo((function(){return Xu((function(){ce.current.frames=[],ce.current.images=[],ce.current.total[Tm]=0,Ng.resetUploadBatches(),w.enableFarStep&&(re(Ce),ae(Im.FAR_FACE)),se(L("move_face_into_frame"))}),200,{leading:!0})}),[re,Ce,L,w.enableFarStep]),Be=function(e){var r=e.offset,t=e.ovalPadding,n=e.largeScale,a=e.ovalHeight,o=e.maskHeight,i=a/2+t.bottom;return(i+r)*n>o/2?o/2/n-i:r}({offset:g.ovalVerticalOffset,ovalPadding:g.ovalPadding,largeScale:we,maskHeight:ge.height,ovalHeight:hg.height}),Ee=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,n,a,i,s,l,u,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ae(Im.STOP_DECTECTING),se(""),N("selfie_flash","user_activity.finish_flash"),N("selfie_flash","user_activity",(function(e){return{flash_liveness_in_ms:e.lastTimeLog-R.current}})),r=ce.current.frames,k.enable&&k.framesBatchLength>0&&0!==(n=r.length%k.framesBatchLength)&&(a=r.slice(-1*n),"function"==typeof h&&h(a),o&&Ng.uploadFrameBatch(rv(a),x)),i=Ig(r),!w.enableFarStep){e.next=12;break}return ce.current.images[1].frames=ce.current.total[Tm],e.next=11,ce.current.images[1].blob;case 11:ce.current.images[1].blob=e.sent;case 12:return ce.current.images[0].frames=i[xm],e.next=15,ce.current.images[0].blob;case 15:return ce.current.images[0].blob=e.sent,ue(),fe("selfie_type",D.Mode.FLASH),fe("flash_liveness_in_ms",performance.now()-R.current),fe("far_batches",ce.current.total[Tm]),fe("close_batches",i[xm]),fe("flash_batches",i[Pm]),fe("colors",H),fe("flash_color",z),fe("frames_per_color",U),fe("frame_interval",P),fe("delay_between_colors",F),fe("use_face_detector_when_flashing",V),e.next=30,Promise.all([de({imageData:ce.current.images[1]}),de({imageData:ce.current.images[0]})]);case 30:if(s=e.sent,l=B(s,2),u=l[0],d=l[1],w.enableFarStep&&(ce.current.images[1].blob=u),ce.current.images[0].blob=d,ce.current.images=ce.current.images.filter((function(e){return!!e})),e.prev=37,"function"!=typeof t){e.next=41;break}return e.next=41,t({images:ce.current.images,frames:ce.current.frames},{colors:H,flashColor:z});case 41:e.next=46;break;case 43:e.prev=43,e.t0=e.catch(37),c({error:e.t0});case 46:case"end":return e.stop()}}),e,null,[[37,43]])}))),[N,k.enable,k.framesBatchLength,w.enableFarStep,ue,fe,H,z,U,P,F,V,de,h,o,x,t,c]),Se=function(e){var t=e.colors,n=e.onFlashDone,a=e.framesPerColor,o=e.flashColor,i=B(r.useState(null),2),s=i[0],c=i[1],l=r.useMemo((function(){return t.split("").reduce((function(e,r){return e+r.repeat(a)}),"")}),[t,a]),u=" "===l[s]?Km:o,d=r.useCallback((function(){c((function(e){return e+1}))}),[]),f=r.useCallback((function(){c(0)}),[]);return r.useEffect((function(){s>l.length-1&&(c(null),"function"==typeof n&&n())}),[s,l.length,n]),{colorIndex:s,currentColor:u,goToNextColor:d,startFlashing:f}}({colors:H,onFlashDone:Ee,framesPerColor:U,flashColor:z}),_e=Se.currentColor,Ae=Se.colorIndex,Ie=Se.startFlashing,Te=Se.goToNextColor,xe=r.useCallback((function(){ce.current.total[Tm]+=1}),[]),Pe=r.useCallback((function(e){var r=e.faceArea;if(!ce.current.images[1]){var t=r.cropX,n=r.cropY,a=r.cropWidth,o=r.cropHeight,i=ye.width,s=ye.height;ye.getContext("2d").drawImage(G.current,t,n,a,o,0,0,i,s),ce.current.images[1]={blob:Zn.takePicture({canvas:ye,quality:S.imageQuality}),gesture:"frontal",capture_time:Date.now(),step:Tm}}re(we),$(!0),ae(Im.CLOSE_FACE),se(L("move_face_closer"))}),[we,$,L,ye,S.imageQuality]),Re=r.useCallback((function(e){var r=e.faceArea;if(!ce.current.images[0]){var t=r.cropX,n=r.cropY,o=r.cropWidth,i=r.cropHeight,s=ye.width,c=ye.height;ye.getContext("2d").drawImage(G.current,t,n,o,i,0,0,s,c),ce.current.images[0]={blob:Zn.takePicture({canvas:ye,quality:S.imageQuality}),gesture:"frontal",capture_time:Date.now(),step:xm}}a.unstable_batchedUpdates((function(){ae(Im.START_FLASHING),Ie()}))}),[S.imageQuality,Ie,ye]),De=null!==Ae&&ne===Im.START_FLASHING,Ne=r.useCallback((function(e){var r=e.prediction,t=e.canvas,n=e.landmarks,a=ce.current.frames,i=Wm({prediction:r,canvas:t,landmarks:n,index:a.length,quality:k.frameQuality});if(i.metadata={color:_e,type:Pm},a.push(i),k.enable&&k.framesBatchLength>0&&a.length%k.framesBatchLength==0){var s=a.slice(-1*k.framesBatchLength);"function"==typeof h&&h(s),o&&Ng.uploadFrameBatch(rv(s),x)}De&&Te()}),[o,x,k.enable,k.frameQuality,k.framesBatchLength,_e,Te,De,h]),Le=r.useCallback((function(e){var r=e.error;"no_face"!==r&&"multiple_faces"!==r||ke()}),[ke]),Oe=r.useCallback((function(e){var r=e.prediction,t=e.canvas,n=e.landmarks,a=ce.current.frames,i=Wm({prediction:r,canvas:t,landmarks:n,index:a.length,quality:k.frameQuality});if(i.metadata={color:"",type:xm},a.push(i),k.enable&&k.framesBatchLength>0&&a.length%k.framesBatchLength==0){var s=a.slice(-1*k.framesBatchLength);"function"==typeof h&&h(s),o&&Ng.uploadFrameBatch(rv(s),x)}}),[o,x,k.enable,k.frameQuality,k.framesBatchLength,h]),Me=r.useMemo((function(){return null===Ae?K:Ae%U==0?Math.max(F,K):K}),[Ae,F,K,U]),Ue=qm({onError:c,isVideoPlaying:ve,step:ne,cropArea:ge,videoRef:G,onCloseFaceDetected:Re,onFarFullFaceDetected:Pe,onFlashingFramesCaptured:Ne,frameInterval:Me,useFaceDetectorWhenFlashing:V,onFaceError:Le,onMovingCloseFace:Oe,onFarFaceDetected:xe,faceSettings:b,ovalBoundingRect:Y,isOvalTransitioning:Z,maskSettings:g,closeEyesSettings:C,captureFrameSettings:k}),Fe=Ue.faceError,Ve=Ue.warmupDone;T=G.current,r.useEffect((function(){return function(){var e;T&&(null===(e=T.srcObject)||void 0===e||e.getTracks().forEach((function(e){e.stop()})))}}),[T]);Bg((function(){w.enableFarStep?(ae(Im.FAR_FACE),re(Ce)):(ae(Im.CLOSE_FACE),re(we)),R.current||(R.current=performance.now())}),Ve&&ve),Bg((function(){return N("selfie_flash","user_activity.start")}),!0),Bg((function(){return N("selfie_flash","user_activity.start_far")}),ne===Im.FAR_FACE),Bg((function(){return N("selfie_flash","user_activity.start_close")}),ne===Im.CLOSE_FACE),Bg((function(){return N("selfie_flash","user_activity.start_flash")}),ne===Im.START_FLASHING);var je=null===Ae?0:Math.min(Math.round((Ae+1)/(H.length*U)*100),100),ze=d.CloseCameraButton,He=d.Loading;return i.default.createElement(i.default.Fragment,null,i.default.createElement(Iu,{frontCamera:l,onVideoPlayed:me,onClose:s,flipHorizontal:l,ref:G,onError:c,videoSettings:fv,closeButton:null!=ze?ze:i.default.createElement(ov,null)},i.default.createElement(fg,{overlay:!Ve||!ve,loadingComponent:He},""!==Fe&&i.default.createElement(sv,null),i.default.createElement(Lu,{x:"".concat(Math.round(ge.x),"px"),y:"".concat(Math.round(ge.y),"px"),width:"".concat(ge.width,"px"),height:"".concat(ge.height,"px"),surroundStyle:{background:pu(q,"FlashLiveness.maskFill",Jm)}},i.default.createElement(nv,{ref:X,scale:ee,debug:O,width:ge.width,height:ge.height,padding:g.ovalPadding,verticalOffset:Be,ovalMaskFillColor:pu(q,"FlashLiveness.maskFill",Jm)}),i.default.createElement(dv,null,""!==Fe&&ne!==Im.FLASHING&&i.default.createElement(cg,null,L(Fe)))))),i.default.createElement(lv,null,i.default.createElement(uv,null,Ve&&ve&&ne!==Im.START_FLASHING&&i.default.createElement(tv,null,L("face_authentication")),ne!==Im.LOADING&&ie&&i.default.createElement(av,{$flashing:ne===Im.START_FLASHING},ne===Im.START_FLASHING?L("hold_still"):i.default.createElement(i.default.Fragment,null,i.default.createElement(Xm,{iconColor:pu(q,"FlashLiveness.guideline.icon.color",Jm)})," ",ie)),ne===Im.START_FLASHING&&i.default.createElement(cv,{value:je,max:100})),i.default.createElement(_g,{onTimeout:ke,timeout:w.timeout,shouldStart:Ve&&ve,shouldStop:ne===Im.START_FLASHING})),ne===Im.START_FLASHING&&i.default.createElement(iv,{$backgroundColor:_e,$intensity:j}))}var pv=c.default.div(Xg||(Xg=k(["\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"]))),mv=c.default.div(Yg||(Yg=k(["\n & > img {\n width: 100%;\n }\n\n ","\n"])),qp),gv=c.default.p(Zg||(Zg=k(["\n color: #1d1d1d;\n font-size: 20px;\n"]))),vv=function(e){var r=e.loading,t=Bn.useAsset("loader.jpg"),n=kg();return r?i.default.createElement(pv,null,i.default.createElement(mv,null,i.default.createElement("img",{src:t,className:"spin",alt:"loading-icon"})),i.default.createElement(gv,null,n("processing_result"))):null};vv.propTypes={loading:s.default.bool},vv.defaultProps={loading:!1};var yv=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Array.isArray(e)?e.map((function(e,t){var n,a,o;return{name:e.step,image:{blob:e.blob,id:null!==(n=null===(a=r[t])||void 0===a||null===(o=a.data)||void 0===o?void 0:o.image_id)&&void 0!==n?n:null}}})):[]},bv=["apiCheck","onLivenessDetectionDone"],Cv=function(e){var t,n=e.apiCheck,a=e.onLivenessDetectionDone,o=w(e,bv),s=B(r.useState(!1),2),c=s[0],l=s[1],u=(t=Dg(),{verifyFlashLiveness:r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var n,a,o,i,s,c,l,u,d,f,h,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.videos,a=r.images,o=r.enableFarStep,i=r.metadata,e.prev=1,e.next=4,Promise.all(a.map((function(e){return t.uploadImage({label:"portrait",file:e})})));case 4:return s=e.sent,c=[t.verifyFaceLiveness({images:s.map((function(e){var r;return{id:null==e||null===(r=e.data)||void 0===r?void 0:r.image_id,label:"portrait"}})),videos:n,metadata:i,selfie_type:D.Mode.FLASH})],o&&c.push(t.requestVerifyPortrait({image:{id:null===(l=s[0])||void 0===l||null===(u=l.data)||void 0===u?void 0:u.image_id},selfie_type:D.Mode.FLASH})),e.next=9,Promise.all(c);case 9:return d=e.sent,f=B(d,2),h=f[0],p=f[1],e.abrupt("return",{uploadedImages:s,faceLivenessResult:h,portraitResult:p});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(r){return e.apply(this,arguments)}}(),[t])}).verifyFlashLiveness,d=ev(),h=d.captureFrameSettings,p=d.flashSettings,g=d.livenessSettings,v=h.framesIntervalTime,y=g.enableFarStep,b=e.onError,C=function(){var e=f(regeneratorRuntime.mark((function e(r,t){var o,i,s,c,d,f,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o={flash_color:t.flashColor,colors:t.colors,frames_per_color:p.framesPerColor,frame_interval:v,delay_between_colors:p.delayBetweenColors,use_face_detector_when_flashing:p.useFaceDetectorWhenFlashing},n){e.next=5;break}return e.next=4,a({capturedFrames:r.frames,steps:yv(r.images),metadata:o});case 4:return e.abrupt("return");case 5:if(e.prev=5,l(!0),s=null,!h.enable){e.next=14;break}return e.next=11,Ng.getAllUploadedBatches();case 11:s=e.sent,e.next=15;break;case 14:s=[{frames:rv(r.frames)}];case 15:return e.next=17,u({videos:s,images:r.images.map((function(e){return e.blob})),enableFarStep:y,metadata:o});case 17:if(c=e.sent,d=c.uploadedImages,f=c.faceLivenessResult,m=c.portraitResult,Ng.resetUploadBatches(),l(!1),!f.errors){e.next=25;break}throw f.errors;case 25:if(null==m||!m.errors){e.next=27;break}throw m.errors;case 27:return e.next=29,a({capturedFrames:r.frames,steps:yv(r.images,d),apiCheckPassed:f.data.is_live,verifyFaceLivenessResult:f.data,verifyPortraitResult:null!==(i=null==m?void 0:m.data)&&void 0!==i?i:null});case 29:e.next=36;break;case 31:e.prev=31,e.t0=e.catch(5),console.error(e.t0),l(!1),b({error:e.t0});case 36:case"end":return e.stop()}}),e,null,[[5,31]])})));return function(r,t){return e.apply(this,arguments)}}();return i.default.createElement(i.default.Fragment,null,i.default.createElement(hv,m({},o,{apiCheck:n,onFlashDone:C})),n&&i.default.createElement(vv,{loading:c}))},wv=function(e){var r=e.value,t=e.children,n=$g(),a=hu(n,"data.settings.sdk_settings.server_log_settings.enable"),o=null!=a?a:null==r?void 0:r.enable;return i.default.createElement(Cn.SDKTrackingProvider,{value:{tracking:v(v({},r),{},{enable:o})}},t)};wv.propTypes={value:s.default.shape({enable:s.default.bool,accessKey:s.default.string,secretKey:s.default.string,apiUrl:s.default.string}).isRequired,children:s.default.node.isRequired};var kv=function(e){var r=e.apiCheck,t=e.debug,a=e.clientSettings,o=e.apiCredentials,s=e.logCredentials,c=e.customTheme;return i.default.createElement(Vm,{debug:t},i.default.createElement(xg,{apiCredentials:o},i.default.createElement(Mg,{apiCheck:r,clientSettings:a},i.default.createElement(Am,null,i.default.createElement(n.ThemeProvider,{theme:c},i.default.createElement(Cg,null,i.default.createElement(wv,{value:v({enable:!0},s)},i.default.createElement(Cv,e))))))))};kv.propTypes={apiCheck:s.default.bool,apiCredentials:s.default.shape({accessKey:s.default.string,secretKey:s.default.string,apiUrl:s.default.string}),onLivenessDetectionDone:s.default.func,onClose:s.default.func,onError:s.default.func,onFramesCaptured:s.default.func,frontCamera:s.default.bool,styledComponent:s.default.shape({CloseCameraButton:s.default.node}),clientSettings:s.default.shape({}),logCredentials:s.default.shape({accessKey:s.default.string,secretKey:s.default.string,apiUrl:s.default.string,userId:s.default.string,logSignature:s.default.shape({logUrl:s.default.string,timestamp:s.default.string,signature:s.default.string})}),debug:s.default.bool,customTheme:s.default.shape({})},kv.defaultProps={apiCheck:!1,apiCredentials:{},onLivenessDetectionDone:function(){},onClose:function(){},onError:function(){},onFramesCaptured:function(){},frontCamera:!0,styledComponent:{CloseCameraButton:null},clientSettings:{},logCredentials:{},debug:!1,customTheme:{}};var Bv=["logCredentials","clientSettings","livenessSettings","livenessComponent","customTheme"];function Ev(e){var r=e.logCredentials,t=void 0===r?{enable:!0}:r,a=e.clientSettings,o=e.livenessSettings,s=e.livenessComponent,c=void 0===s?pm:s,l=e.customTheme,u=void 0===l?{}:l,d=w(e,Bv);switch(d.mode){case D.Mode.FLASH:return i.default.createElement(kv,m({},d,{customTheme:u,clientSettings:a,logCredentials:t}));default:var f=hu(a,"data.settings.sdk_settings",{});return i.default.createElement(Am,null,i.default.createElement(n.ThemeProvider,{theme:u},i.default.createElement(Cn.SDKTrackingProvider,{value:{tracking:v({},t)}},i.default.createElement(c,m({},d,{livenessSettings:v(v(v({},o),null==f?void 0:f.active_liveness_settings),null==f?void 0:f.liveness_settings)})))))}}var Sv={DEFAULT:"default",ERROR:"error"};function _v(e){var t=e.className,n=e.width,a=e.height,o=e.type,s=e.strokeStyles,c=e.strokeWidth,l=e.radius,u=e.paddingStyle,d=r.useMemo((function(){var e;return v((p(e={},Sv.DEFAULT,{fill:"none",strokeWidth:c,stroke:"#fff",strokeDasharray:"7, 4",opacity:.6}),p(e,Sv.ERROR,{fill:"rgba(234,50,35, 0.1)",strokeWidth:c,stroke:"#ea3223"}),e),s)}),[c,s]),f=l+.8*c,h=d[o];return i.default.createElement("svg",{width:n,height:a,className:t},i.default.createElement("rect",{x:c/2,y:c/2,rx:l,ry:l,width:n-c,height:a-c,style:h}),i.default.createElement("path",{d:"M0,".concat(f," Q0,0 ").concat(f,",0 L0,0 Z"),style:u}),i.default.createElement("path",{d:"M0,".concat(a-f," Q0,").concat(a," ").concat(f,",").concat(a," L0,").concat(a," Z"),style:u}),i.default.createElement("path",{d:"M".concat(n-f,",").concat(a," Q").concat(n,",").concat(a," ").concat(n,",").concat(a-f," L").concat(n,",").concat(a," Z"),style:u}),i.default.createElement("path",{d:"M".concat(n-f,",0 Q").concat(n,",0 ").concat(n,",").concat(f," L").concat(n,",0 Z"),style:u}))}_v.propTypes={className:s.default.string,width:s.default.number,height:s.default.number,strokeWidth:s.default.number,strokeStyles:s.default.shape({}),type:s.default.oneOf([Sv.DEFAULT,Sv.ERROR]),radius:s.default.number,paddingStyle:s.default.shape({})},_v.defaultProps={className:"",width:600,height:400,strokeWidth:2,strokeStyles:{},type:Sv.DEFAULT,radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"}};var Av,Iv,Tv,xv,Pv,Rv,Dv,Nv,Lv,Ov,Mv,Uv,Fv,Vv,jv,zv,Hv,qv,Kv=["width","height","type"],Gv=c.default(_v)(Av||(Av=k([""]))),Wv=c.default.img(Iv||(Iv=k(["\n position: absolute;\n top: 0;\n left: 0;\n"]))),Qv=jp,Xv=c.default.div(Tv||(Tv=k(["\n ","\n ","\n"])),Hh,qp),Yv=c.default.img(xv||(xv=k(["\n border-radius: 5px;\n opacity: 0.7;\n height: 38px;\n"]))),Zv=c.default.div(Pv||(Pv=k(["\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"])),60,1020,Rs.isMobile?n.css(["top:",";"],(function(e){return e.y})):n.css(["bottom:","px;"],10)),$v=c.default.div(Rv||(Rv=k(["\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n position: absolute;\n margin: auto;\n width: ","px;\n height: ","px;\n\n img {\n width: 100%;\n }\n\n z-index: ",";\n"])),100,100,1020),Jv=c.default.div(Dv||(Dv=k(["\n color: #fff;\n text-align: center;\n"]))),ey=c.default.div(Nv||(Nv=k(["\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}),1020),ry=c.default.div(Lv||(Lv=k(["\n display: flex;\n align-items: center;\n"]))),ty=c.default(Jv)(Ov||(Ov=k(["\n font-size: 20px;\n margin-left: 10px;\n color: #fff;\n"]))),ny=c.default(Jv)(Mv||(Mv=k(["\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"])),1030),ay=c.default(Jv)(Uv||(Uv=k(["\n position: absolute;\n font-size: 16px;\n text-align: center;\n color: #fff;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),oy=c.default(ay)(Fv||(Fv=k(["\n background: #ea3223;\n padding: 5px 10px;\n border-radius: 3px;\n"]))),iy=c.default(Jv)(Vv||(Vv=k(["\n position: absolute;\n font-size: 18px;\n text-align: center;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: 0 10px;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),sy=(c.default.div(jv||(jv=k(["\n font-size: 18px;\n text-align: center;\n padding: 10px;\n"]))),function(e){var r=e.width,t=e.height,n=e.type,a=w(e,Kv),o=Bn.useAsset("id_card_frame.png"),s=Bn.useAsset("id_card_frame_error.png");return i.default.createElement(Xv,{width:r,height:t},i.default.createElement(Wv,{src:n===Sv.ERROR?s:o,width:r,height:t}),i.default.createElement(Gv,m({width:r,height:t,type:n},a)))}),cy={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"}},ly=D.IDCardMessage,uy=c.default.div(zv||(zv=k(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),dy=c.default.div(Hv||(Hv=k(["\n text-align: center;\n font-size: 1rem;\n"]))),fy=c.default.button(qv||(qv=k(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),hy=function(e){var r=e.onOk,t=e.maxSessionTime,n=zt.useSDKSettings().lang;return i.default.createElement(uy,null,i.default.createElement(dy,{className:"popup-message"},Cf(ly.TIMEOUT_INSTRUCTION[n])({x:t})),i.default.createElement(fy,{className:"popup-button",onClick:r},cy.BTN_OK[n]))};hy.propTypes={onOk:s.default.func,maxSessionTime:s.default.number},hy.defaultProps={onOk:function(){},maxSessionTime:30};var py=function(){var e=B(r.useState(!1),2),t=e[0],n=e[1],a=B(r.useState(null),2),o=a[0],i=a[1],s=B(r.useState({}),2),c=s[0],l=s[1];return{showPopup:r.useCallback((function(e){var r=e.popupType,t=e.props;l(void 0===t?{}:t),i(r),n(null!==r)}),[]),popupShown:t,popupType:o,props:c}},my="SESSION_TIMEOUT",gy="CONFIRM",vy="QR_INVALID",yy="QR_INSTRUCTIONS",by=D.Errors;function Cy(e,r){return Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2)}function wy(e,r){return Math.sqrt(Cy(e,r))}function ky(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.canvas,t=e.imgMargin,n=window,a=n.cv,o=r.width,i=r.height,s=t;s<1&&(s=parseInt(.5*(i+o)*s,10));var c=a.imread(r),l=new a.Mat;return a.copyMakeBorder(c,l,s,s,s,s,a.BORDER_CONSTANT,new a.Scalar(0,0,0,255)),c.delete(),{mat:l,margin:s}}function By(e,r){var t=window.cv,n=B(r.map((function(e){return e.location})),4),a=n[0],o=n[1],i=n[2],s=n[3],c=wy(i,s),l=wy(o,a),u=Math.max(c,l),d=wy(o,i),f=wy(a,s),h=Math.max(d,f),p=[a.x,a.y,o.x,o.y,i.x,i.y,s.x,s.y],m=[0,0,u-1,0,u-1,h-1,0,h-1],g=t.imread(e),v=new t.Mat,y=new t.Size(u,h),b=t.matFromArray(4,1,t.CV_32FC2,p),C=t.matFromArray(4,1,t.CV_32FC2,m),w=t.getPerspectiveTransform(b,C);t.warpPerspective(g,v,w,y,t.INTER_LINEAR,t.BORDER_CONSTANT,new t.Scalar);var k=new ImageData(new Uint8ClampedArray(v.data),v.cols,v.rows);return g.delete(),v.delete(),b.delete(),C.delete(),k}function Ey(e,r,t){var n={x:r.x-e.x,y:r.y-e.y},a={x:t.x-e.x,y:t.y-e.y},o=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)),i=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2));return 180*Math.acos((n.x*a.x+n.y*a.y)/(o*i))/Math.PI}function Sy(e){var r=e.corners,t=e.width,n=e.height,a=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;r.forEach((function(e){var r=e.location,t=r.x,n=r.y;a=Math.min(a,t),o=Math.min(o,n),i=Math.max(i,t),s=Math.max(s,n)}));var c=.02;return a/t>=c&&o/n>=c&&(n-s)/n>=c&&(t-i)/t>=c}function _y(){return Ay.apply(this,arguments)}function Ay(){return(Ay=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,l,u,d,f,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=h.length>0&&void 0!==h[0]?h[0]:{},t=r.canvas,n=r.paddingPercent,a=void 0===n?.04:n,o=t.width,i=t.height,s=Math.floor(o*a),c=Math.floor(i*a),l=o-2*s,u=i-2*c,d=document.createElement("canvas"),f=d.getContext("2d"),d.width=l,d.height=u,f.drawImage(t,s,c,l,u,0,0,l,u),e.abrupt("return",yo.isCardGlare(d));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Iy(e){for(var r=e.length,t=0;t<r;t++){var n=(t+r-1)%r,a=(t+1)%r,o=Ey(e[t].location,e[n].location,e[a].location);if(o<70||o>110)return!1}return!0}function Ty(e){return xy.apply(this,arguments)}function xy(){return(xy=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.blazefaceModel,n=r.predictedIdCardCanvas,a=r.frontSide,o=n.width,i=n.height,s=Math.floor(o/3),c=Math.floor(4*i/5),l=document.createElement("canvas"),u=l.getContext("2d"),l.width=s,l.height=c,u.drawImage(n,0,Math.floor(i/5),s,c,0,0,s,c),e.next=12,ma.getModelPredictions({model:t,sCanvas:l});case 12:if(d=e.sent,f=d.filter((function(e){var r=e.topLeft,t=e.bottomRight,n=B(e.probability,1)[0],a=e.landmarks;return!(n<.9||a.length<4)&&!(oa.rectAreaRatio({small:{coords:[r,t]},big:{coords:[[0,0],[ma.SIZE,ma.SIZE]]}})<.025)})),h=f.length,!a){e.next=22;break}if(0!==h){e.next=18;break}return e.abrupt("return",by.id_detector_error_front_side_no_faces);case 18:if(!(h>1)){e.next=20;break}return e.abrupt("return",by.id_detector_error_front_side_multiple_faces);case 20:e.next=24;break;case 22:if(!(h>0)){e.next=24;break}return e.abrupt("return",by.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 Py=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,h,p,m,g,v,y,b,C,w,k,S,_,A,I,T,x;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=r.currentWorkingCanvas,l=r.refVirtualWorkingCanvas,u=r.refCountVirtualFrames,d=r.refVirtualFrames,h=r.refWorkingCanvas,(p=r.refCardResult).current.corners&&Array.isArray(p.current.corners)){e.next=3;break}return e.abrupt("return");case 3:return m=B(p.current.corners,3),g=m[0],v=m[1],y=m[2],b=(null==v||null===(t=v.location)||void 0===t?void 0:t.x)-(null==g||null===(n=g.location)||void 0===n?void 0:n.x)-100,C=(null==y||null===(a=y.location)||void 0===a?void 0:a.y)-(null==v||null===(o=v.location)||void 0===o?void 0:o.y)-100,w=performance.now(),(k=l.current).width=b,k.height=C,(S=k.getContext("2d")).drawImage(c,(null==g||null===(i=g.location)||void 0===i?void 0:i.x)+50,(null==g||null===(s=g.location)||void 0===s?void 0:s.y)+50,b,C,0,0,b,C),e.next=14,new Promise((function(e){k.toBlob(function(){var r=f(regeneratorRuntime.mark((function r(t){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,fn.MD5({blob:t});case 2:n=r.sent,d.current=[].concat(E(d.current),[n]),e();case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}));case 14:return w=Math.floor(performance.now()-w),_=180-w>0?180-w:0,e.next=18,new Promise((function(e){return setTimeout(e,_)}));case 18:if(!(u.current<3)){e.next=29;break}return T=performance.now(),x=h.current,S.drawImage(x,(null==g||null===(A=g.location)||void 0===A?void 0:A.x)+50,(null==g||null===(I=g.location)||void 0===I?void 0:I.y)+50,b,C,0,0,b,C),e.next=24,new Promise((function(e){k.toBlob(function(){var r=f(regeneratorRuntime.mark((function r(t){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,fn.MD5({blob:t});case 2:n=r.sent,d.current=[].concat(E(d.current),[n]),e();case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}));case 24:if(!(u.current<2)){e.next=26;break}return e.delegateYield(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T=Math.floor(performance.now()-T),r=180-T>0?180-T:0,e.next=4,new Promise((function(e){return setTimeout(e,r)}));case 4:case"end":return e.stop()}}),e)}))(),"t0",26);case 26:u.current+=1,e.next=18;break;case 29:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();var Ry=function(e,r,t){return e==e&&(void 0!==t&&(e=e<=t?e:t),void 0!==r&&(e=e>=r?e:r)),e};var Dy=function(e,r,t){return void 0===t&&(t=r,r=void 0),void 0!==t&&(t=(t=Gu(t))==t?t:0),void 0!==r&&(r=(r=Gu(r))==r?r:0),Ry(Gu(e),r,t)},Ny="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/libs/opencv-4.6.0.js";function Ly(){return(Ly=f(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.url,n=void 0===t?Ny:t,e.abrupt("return",new Promise((function(e,r){var t=document.createElement("script");t.setAttribute("async",""),t.setAttribute("type","text/javascript"),t.setAttribute("id","opencvjs"),t.addEventListener("load",f(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!window.cv||!window.cv.getBuildInformation){r.next=4;break}e(),r.next=12;break;case 4:if(!(window.cv instanceof Promise)){r.next=11;break}return r.next=7,window.cv;case 7:window.cv=r.sent,e(),r.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return r.stop()}}),r)})))),t.addEventListener("error",(function(){r()})),t.src=n;var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(t,a)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Oy=Af((function(){return Ly.apply(this,arguments)})),My={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"},Uy={vn:.4,ph:.5},Fy={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 Vy(e){var r,t,n,a,o,i=e.card,s=e.corners,c=i.box,l={x:(c[1]+c[3])/2,y:(c[0]+c[2])/2},u=c[2]-c[0],d=c[1]-c[3],f=x(s);try{for(f.s();!(o=f.n()).done;){var h=o.value;switch(h.label){case"top-left":r||(r=h.location);break;case"top-right":t||(t=h.location);break;case"bottom-right":n||(n=h.location);break;case"bottom-left":a||(a=h.location)}}}catch(e){f.e(e)}finally{f.f()}if(![r,t,n,a].every(Boolean))return console.debug("Not qualified, corners missing"),!1;var p={x:(r.x+n.x)/2,y:(r.y+n.y)/2},m={x:(t.x+a.x)/2,y:(t.y+a.y)/2},g=Cy(l,p),v=Cy(l,m);return Math.sqrt(g)>(u+d)/8||Math.sqrt(v)>(u+d)/8?(console.debug("Not qualified, not close enough"),!1):(console.debug("Qualified"),!0)}var jy=function(){function e(r){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),this.country=r||"vn",this.defaultModelUrl=My[this.country]||My.vn}var r,t,n,a,o,i,s,c,l,u;return r=e,(t=[{key:"load",value:(u=f(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.opencvUrl,n=r.modelUrl,e.next=3,Promise.all([Oy({url:t}),this.loadModel({modelUrl:n})]);case 3:return e.next=5,this.predictDummyInput();case 5:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"predictDummyInput",value:(l=f(regeneratorRuntime.mark((function e(){var r,t,n,a=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=window,t=r.tf,n=t.tidy((function(){var e=t.zeros(a.inputShape,"float32");return a.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 l.apply(this,arguments)})},{key:"loadModel",value:(c=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>0&&void 0!==s[0]?s[0]:{},t=r.modelUrl,n=void 0===t?this.defaultModelUrl:t,e.next=3,ei.initTensorFlow({preferredBackends:["wasm","cpu"]});case 3:return e.next=5,ei.loadTFLiteModel({modelUrl:n});case 5:this.model=e.sent,a=this.model.inputs,this.inputShape=a[0].shape,o=this.model.outputs.map((function(e){return e.name})).splice(0,3).reverse(),i=B(o,3),this.out_score_name=i[0],this.out_class_name=i[1],this.out_box_name=i[2];case 13:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"loadResource",value:(s=f(regeneratorRuntime.mark((function e(){var r,t,n,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>0&&void 0!==a[0]?a[0]:{},t=r.modelUrl,n=void 0===t?this.defaultModelUrl:t,e.next=3,ei.preloadResource({modelUrl:n});case 3:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"dispose",value:(i=f(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 i.apply(this,arguments)})},{key:"predict",value:(o=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h,p,m,g,v,y,b,C,w,k,E,S,_,A,I,T,x,P,R,D=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=D.length>1&&void 0!==D[1]?D[1]:{},n=t.imgMargin,a=t.detectThreshold,o=void 0===a?.3:a,i=t.maxNumReturns,s=void 0===i?100:i,c=window,l=c.cv,u={},d=r.width,f=r.height,u.originalWidth=d,u.originalHeight=f,h=ky({canvas:r,imgMargin:"number"==typeof n?n:Uy[this.country]}),p=h.margin,m=h.mat,g=this.inputShape.slice(1,3),v=B(g,2),y=v[0],b=v[1],C=new l.Mat,l.resize(m,C,new l.Size(y,b),0,0,l.INTER_AREA),w=m.cols/y,k=m.rows/b,(E=document.createElement("canvas")).width=y,E.height=b,E.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(C.data),C.cols,C.rows),0,0),m.delete(),C.delete(),u.canvas=E,u.margin=p,S=performance.now(),e.next=25,this.detect(E,{detectThreshold:o,maxNumReturns:s});case 25:if(_=e.sent,A=Math.floor(performance.now()-S),I={inputImage:u,card:null,exeTime:A},T=[[],[],[],[]],x=[],P=[],_.forEach((function(e){var r=B(e.box,4),t=r[0],n=r[1],a=r[2],o=r[3];e.clazz<=3?T[e.clazz].push({clazz:e.clazz,label:e.label,score:e.score,location:{x:Dy(Math.floor((o+n)/2*w-p),0,d),y:Dy(Math.floor((t+a)/2*k-p),0,f)},scaledLocation:{x:Dy(Math.floor((o+n)/2),0,E.width),y:Dy(Math.floor((t+a)/2),0,E.height)}}):P.push({label:e.label,score:e.score,box:[Dy(Math.floor(t*k-p),0,f),Dy(Math.floor(n*w-p),0,d),Dy(Math.floor(a*k-p),0,f),Dy(Math.floor(o*w-p),0,d)]})})),T.forEach((function(e){e.length&&(e.sort((function(e,r){return r.score-e.score})),x.push(e[0]))})),!(P.length>0&&4===x.length)){e.next=49;break}if(P.sort((function(e,r){return r.score-e.score})),x.sort((function(e,r){return e.clazz-r.clazz})),R=P[0],e.prev=37,Vy({card:R,corners:x})){e.next=41;break}return console.debug("Not qualified.",R,x),e.abrupt("return",I);case 41:e.next=46;break;case 43:return e.prev=43,e.t0=e.catch(37),e.abrupt("return",I);case 46:return R.corners=x,I.card=R,e.abrupt("return",I);case 49:return e.abrupt("return",I);case 50:case"end":return e.stop()}}),e,this,[[37,43]])}))),function(e){return o.apply(this,arguments)})},{key:"detect",value:(a=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h,p,m,g,v,y,b,C,w,k,E,S,_=this,A=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=A.length>1&&void 0!==A[1]?A[1]:{},n=t.detectThreshold,a=t.maxNumReturns,o=window,i=o.tf,s=r.width,c=r.height,l=i.tidy((function(){var e=i.expandDims(i.cast(i.image.resizeBilinear(i.browser.fromPixels(r),_.inputShape.slice(1,3)),"float32"));return _.model.predict(e)})),e.next=7,Promise.all([l[this.out_score_name].data(),l[this.out_class_name].data(),l[this.out_box_name].array()]);case 7:u=e.sent,d=B(u,3),f=d[0],h=d[1],p=B(d[2],1),m=p[0],g=Math.min(f.length,a),v=[];try{for(y=0;y<g;y++)b=f[y],C=h[y],b>n&&(k=null!==(w=Fy[Math.round(C)])&&void 0!==w?w:"NA",E=m[y],S=[E[0]*c,E[3]*s,E[2]*c,E[1]*s],v.push({score:b,clazz:C,box:S,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 a.apply(this,arguments)})}])&&h(r.prototype,t),n&&h(r,n),e}();class zy{static hasCamera(){return zy.listCameras(!1).then((e=>!!e.length)).catch((()=>!1))}static listCameras(e=!1){if(!navigator.mediaDevices)return Promise.resolve([]);let r=null;return(e?navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then((e=>r=e)).catch((()=>{})):Promise.resolve()).then((()=>navigator.mediaDevices.enumerateDevices())).then((e=>e.filter((e=>"videoinput"===e.kind)).map(((e,r)=>({id:e.deviceId,label:e.label||(0===r?"Default Camera":`Camera ${r+1}`)}))))).finally((()=>{if(r)for(const e of r.getTracks())e.stop(),r.removeTrack(e)}))}constructor(e,r,t=this._onDecodeError,n=this._calculateScanRegion,a="environment"){this.$video=e,this.$canvas=document.createElement("canvas"),this._onDecode=r,this._legacyCanvasSize=zy.DEFAULT_CANVAS_SIZE,this._preferredCamera=a,this._active=!1,this._paused=!1,this._flashOn=!1,"number"==typeof t?(this._legacyCanvasSize=t,console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future")):this._onDecodeError=t,"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 o=!1;e.hidden&&(e.hidden=!1,o=!0),document.body.contains(e)||(document.body.appendChild(e),o=!0),requestAnimationFrame((()=>{const r=window.getComputedStyle(e);"none"===r.display&&(e.style.setProperty("display","block","important"),o=!0),"visible"!==r.visibility&&(e.style.setProperty("visibility","visible","important"),o=!0),o&&(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=zy.createQrEngine()}hasFlash(){let e=null;return(this.$video.srcObject?Promise.resolve(this.$video.srcObject.getVideoTracks()[0]):this._getCameraStream().then((({stream:r})=>(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e=r,r.getVideoTracks()[0])))).then((e=>"torch"in e.getSettings())).catch((()=>!1)).finally((()=>{if(e)for(const r of e.getTracks())r.stop(),e.removeTrack(r)}))}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(),zy._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:r})=>{this.$video.srcObject=e,this.$video.play(),this._setVideoMirror(r),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 r=()=>{const e=this.$video.srcObject?this.$video.srcObject.getTracks():[];for(const r of e)r.stop(),this.$video.srcObject.removeTrack(r);this.$video.srcObject=null};return e?(r(),Promise.resolve(!0)):new Promise((e=>setTimeout(e,300))).then((()=>!!this._paused&&(r(),!0)))}setCamera(e){return e===this._preferredCamera?Promise.resolve():(this._preferredCamera=e,this._restartVideoStream())}static scanImage(e,r=null,t=null,n=null,a=!1,o=!1){const i=t instanceof Worker;let s=Promise.all([t||zy.createQrEngine(),zy._loadImage(e)]).then((([e,o])=>{let s;return t=e,[n,s]=this._drawToCanvas(o,r,n,a),t instanceof Worker?(i||t.postMessage({type:"inversionMode",data:"both"}),new Promise(((e,r)=>{let a,o,i;o=n=>{"qrResult"===n.data.type&&(t.removeEventListener("message",o),t.removeEventListener("error",i),clearTimeout(a),null!==n.data.data?e(n.data.data):r(zy.NO_QR_CODE_FOUND))},i=e=>{t.removeEventListener("message",o),t.removeEventListener("error",i),clearTimeout(a);const n=e?e.message||e:"Unknown Error";r("Scanner error: "+n)},t.addEventListener("message",o),t.addEventListener("error",i),a=setTimeout((()=>i("timeout")),1e4);const c=s.getImageData(0,0,n.width,n.height);t.postMessage({type:"decode",data:c},[c.data.buffer])}))):new Promise(((e,r)=>{const a=setTimeout((()=>r("Scanner error: timeout")),1e4);t.detect(n).then((t=>{t.length?e(t[0].rawValue):r(zy.NO_QR_CODE_FOUND)})).catch((e=>r("Scanner error: "+(e.message||e)))).finally((()=>clearTimeout(a)))}))}));return r&&o&&(s=s.catch((()=>zy.scanImage(e,null,t,n,a)))),s=s.finally((()=>{i||zy._postWorkerMessage(t,"close")})),s}setGrayscaleWeights(e,r,t,n=!0){zy._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:r,blue:t,useIntegerApproximation:n})}setInversionMode(e){zy._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static createQrEngine(e=zy.WORKER_PATH){return("BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats?BarcodeDetector.getSupportedFormats():Promise.resolve([])).then((r=>-1!==r.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 r=Math.min(e.videoWidth,e.videoHeight),t=Math.round(2/3*r);return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,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=>zy.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=zy.createQrEngine()),this._onDecodeError(e)})).then((()=>this._scanFrame()))}))}_onDecodeError(e){e!==zy.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",r=[{width:{min:1024}},{width:{min:768}},{}];return[...r.map((r=>Object.assign({},r,{[e]:{exact:this._preferredCamera}}))),...r].reduceRight(((e,r)=>()=>navigator.mediaDevices.getUserMedia({video:r,audio:!1}).then((e=>({stream:e,facingMode:this._getFacingMode(e)||(r.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((r=>{if(r&&!e&&this._active)return this.start()}))}_setVideoMirror(e){const r="user"===e?-1:1;this.$video.style.transform="scaleX("+r+")"}_getFacingMode(e){const r=e.getVideoTracks()[0];return r?/rear|back|environment/i.test(r.label)?"environment":/front|user|face/i.test(r.label)?"user":null:null}static _drawToCanvas(e,r=null,t=null,n=!1){t=t||document.createElement("canvas");const a=r&&r.x?r.x:0,o=r&&r.y?r.y:0,i=r&&r.width?r.width:e.width||e.videoWidth,s=r&&r.height?r.height:e.height||e.videoHeight;if(!n){const e=r&&r.downScaledWidth?r.downScaledWidth:i,n=r&&r.downScaledHeight?r.downScaledHeight:s;t.width!==e&&(t.width=e),t.height!==n&&(t.height=n)}const c=t.getContext("2d",{alpha:!1});return c.imageSmoothingEnabled=!1,c.drawImage(e,a,o,i,s,0,0,t.width,t.height),[t,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 zy._awaitImageLoad(e).then((()=>e));if(e instanceof File||e instanceof Blob||e instanceof URL||"string"==typeof e){const r=new Image;return e instanceof File||e instanceof Blob?r.src=URL.createObjectURL(e):r.src=e,zy._awaitImageLoad(r).then((()=>((e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(r.src),r)))}return Promise.reject("Unsupported image type.")}static _awaitImageLoad(e){return new Promise(((r,t)=>{if(e.complete&&0!==e.naturalWidth)r();else{let n,a;n=()=>{e.removeEventListener("load",n),e.removeEventListener("error",a),r()},a=()=>{e.removeEventListener("load",n),e.removeEventListener("error",a),t("Image load error")},e.addEventListener("load",n),e.addEventListener("error",a)}}))}static _postWorkerMessage(e,r,t){return Promise.resolve(e).then((e=>{e instanceof Worker&&e.postMessage({type:r,data:t})}))}}function Hy(){return qy.apply(this,arguments)}function qy(){return(qy=f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return zy.WORKER_PATH=_s(),e.next=3,zy.createQrEngine(zy.WORKER_PATH);case 3:return r=e.sent,e.abrupt("return",{qrEngine:r});case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ky(){return Gy.apply(this,arguments)}function Gy(){return(Gy=f(regeneratorRuntime.mark((function e(){var r,t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([Hy()]);case 2:return r=e.sent,t=B(r,1),n=t[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)}zy.DEFAULT_CANVAS_SIZE=400,zy.NO_QR_CODE_FOUND="No QR code found",zy.WORKER_PATH="qr-scanner-worker.min.js";var Wy="https://unpkg.com/@tsocial/tv_web_sdk_resources@2.0.0/wechat_qr_models/";function Qy(){return(Qy=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=f(regeneratorRuntime.mark((function e(){var r,t,n,i,s,c,l,u,d,f,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="detect.prototxt",t="detect.caffemodel",n="sr.prototxt",i="sr.caffemodel",a){e.next=22;break}if(s=window,c=s.cv){e.next=8;break}throw new Error("Opencv not found!");case 8:return l=[o(r),o(t),o(n),o(i)],e.next=11,Promise.all(l);case 11:u=e.sent,d=B(u,4),f=d[0],h=d[1],p=d[2],m=d[3],c.FS_createDataFile("/","detect.prototxt",f,!0,!1,!1),c.FS_createDataFile("/","detect.caffemodel",h,!0,!1,!1),c.FS_createDataFile("/","sr.prototxt",p,!0,!1,!1),c.FS_createDataFile("/","sr.caffemodel",m,!0,!1,!1),a=new c.wechat_qrcode_WeChatQRCode("detect.prototxt","detect.caffemodel","sr.prototxt","sr.caffemodel");case 22:case"end":return e.stop()}}),e)})))).apply(this,arguments)},i=function(){return s.apply(this,arguments)},r=c.length>0&&void 0!==c[0]?c[0]:{},t=r.modelUrl,n=void 0===t?Wy:t,o=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(n).concat(r));case 2:return t=e.sent,e.next=5,t.arrayBuffer();case 5:return a=e.sent,e.abrupt("return",new Uint8Array(a));case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,i();case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.log(e.t0),e.abrupt("return",Ky());case 13:return e.abrupt("return",{qrModel:a});case 14:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}var Xy=Af((function(){return Qy.apply(this,arguments)}));function Yy(e){return Zy.apply(this,arguments)}function Zy(){return(Zy=f(regeneratorRuntime.mark((function e(r){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.idCardModel,e.abrupt("return",new Promise((function(e,r){setTimeout(r,900),t.predictDummyInput().then(e)})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $y(e){return Jy.apply(this,arguments)}function Jy(){return(Jy=f(regeneratorRuntime.mark((function e(r){var t,n,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.idCardModel,n=!0,e.prev=2,a=performance.now(),e.next=6,Yy({idCardModel:t});case 6:(o=performance.now())-a+.6*(o-a)>900&&(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 eb(){return(eb=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c,l,u,d,f,h,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=p.length>0&&void 0!==p[0]?p[0]:{},t=r.opencvUrl,n=r.idCardModelUrl,a=r.blazefaceModelUrl,o=r.tfScriptUrls,i=r.wechatQRModelsUrl,s=p.length>1?p[1]:void 0,e.next=4,Pf({blazefaceModelUrl:a,tfScriptUrls:o});case 4:return c=e.sent,l=c.blazefaceModel,u=!0,d=new jy(s),e.prev=8,e.next=11,d.load({opencvUrl:t,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,Xy({modelUrl:i});case 18:return e.prev=18,e.next=21,$y({idCardModel:d});case 21:f=e.sent,h=f.fastEnough,u=h,e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),u=!1;case 29:return e.abrupt("return",{ableToUseModel:u,idCardModel:d,blazefaceModel:l});case 30:case"end":return e.stop()}}),e,null,[[8,13],[18,26]])})))).apply(this,arguments)}var rb=Af((function(){return eb.apply(this,arguments)})),tb=D.Errors;function nb(e){var t=e.refVideo,n=e.shouldStart,a=e.cropArea,o=e.settings,i=r.useRef(null);null===i.current&&(i.current=document.createElement("canvas"));var s=r.useRef(!1),c=r.useRef(po.createResizer({width:960,height:640})),l=r.useRef(null),u=r.useRef([{id:null,frames:[]}]),d=r.useCallback((function(){!0===s.current&&(s.current=!1)}),[]),h=r.useCallback((function(){u.current=[{id:null,frames:[]}]}),[]),p=r.useCallback((function(){var e=u.current;e[e.length-1].frames.length>0&&e.push({id:null,frames:[]})}),[]),m=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=r.workingCanvas,n=c.current,a=u.current,i=n.resize({srcCanvas:t}),s=i.toDataURL("image/jpeg",o.saveFrameQuality/100).split(",")[1],a[a.length-1].frames.push({base64:s});case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[o]),g=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,n,a,c,u,d,f,h,p,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?180:r,o.enableRecording){e.next=5;break}return e.abrupt("return");case 5:a=l.current,c=t.current,s.current=!0,u=a.cropX,d=a.cropY,f=a.cropWidth,h=a.cropHeight,(p=i.current).width=f,p.height=h,g=p.getContext("2d");case 13:return v=performance.now(),g.drawImage(c,u,d,f,h,0,0,f,h),e.next=18,m({workingCanvas:p});case 18:if(v=Math.floor(performance.now()-v),s.current){e.next=21;break}return e.abrupt("break",27);case 21:return y=0,n-v>0&&(y=n-v),e.next=25,Sn.sleep(y);case 25:e.next=13;break;case 27:case"end":return e.stop()}}),e)}))),[t,m,o]);return r.useEffect((function(){var e=t.current;function r(){return(r=f(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return l.current=Zn.analyzeVideoAndWindowSizes(e,a),r.next=3,g();case 3:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return n&&a&&function(){r.apply(this,arguments)}(),function(){d()}}),[n,a,t,d,p,g]),{refWorkingCanvas:i,stopCheckFrame:d,splitVideos:p,resetRecordedVideos:h,checkFrame:g,refRecordedVideos:u}}var ab=function(e){var t=e.lang,n=e.onAboutToTimeout,a=e.onSessionTimeout,o=e.onVideoTimeLimitReached,i=e.settings,s=e.shouldStartTimers,c=e.sessionTime,l=r.useRef(),u=B(r.useState(0),2),d=u[0],f=u[1],h=r.useCallback((function(){clearInterval(l.current)}),[]),p=r.useCallback((function(){f((function(e){return e+1}))}),[]);return r.useEffect((function(){if(s){var e=i.maxRecordingTimePerVideo,r=0,t=c/3;l.current=setInterval((function(){var i=c-(r+=1);i<=t&&n&&n({curTimeLeft:i}),r>0&&r%e==0&&o&&o(),0===i&&(h(),a&&a())}),1e3)}return function(){h()}}),[s,t,n,h,a,o,d,i,c]),{stopTimers:h,startTimers:p}};ws.initExifData();var ob,ib,sb,cb=function(e){var t=e.shouldStart,n=e.refVideo,a=e.cropArea,o=e.settings,i=e.onModelErrorChange,s=e.frontSide,c=e.onDebugInfoChange,l=e.onAboutToTimeout,u=e.onSessionTimeout,d=e.onCaptureDone,h=e.outputEncryptionSettings,m=e.quality,g=r.useRef(!1),y=B(r.useState(!1),2),b=y[0],C=y[1],w=r.useRef((function(){})),k=Cn.useSDKTracking().sendEvent,E=r.useRef(),S=r.useRef(),_=r.useRef(),A=zt.useSDKSettings(),I=A.debug,T=A.lang,x=A.enableAntiDebug,P=Ss(),R=P.startMotion,D=P.stopMotion,N=P.motionData,L=P.orientationData;r.useEffect((function(){x&&ri.enableAntiDebug()}),[x]);var O=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k({tag:s?"id_front":"id_back",event:"sdk_ui.auto_capture",log:{}}),e.next=3,w.current(r);case 3:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[k,s]),M=r.useCallback((function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];i.apply(void 0,r);var n=hu(r,"0.code");n&&n!==E.current&&(k({tag:s?"id_front":"id_back",event:"sdk_ui.show_alert",log:{alert:n}}),E.current=n)}),[i,s,k]),U=function(e){var t=e.refVideo,n=e.shouldStart,a=e.cropArea,o=e.settings,i=e.onError,s=e.frontSide,c=e.onAutoCaptureSuccess,l=e.quality,u=r.useRef(null);null===u.current&&(u.current=document.createElement("canvas"));var d=r.useRef(0),h=r.useRef([]),p=r.useRef(null);null===p.current&&(p.current=document.createElement("canvas"));var m=r.useRef({}),g=r.useRef(!1),v=r.useRef(null),y=B(r.useState(!1),2),b=y[0],C=y[1],w=r.useRef({imageBlob:null,takenAt:null,blurScore:null,detectedCard:null}),k=r.useRef({imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0}),E=r.useRef(!1),S=r.useRef(!1),_=r.useRef(null),A=r.useRef(!1),I=r.useRef({}),T=zt.useSDKSettings(),x=T.customUrls,P=T.country;r.useEffect((function(){var e=!1;function r(){return(r=f(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!o||b){r.next=14;break}if(!o.enableIdDetection){r.next=10;break}return r.next=4,rb(x,P);case 4:return I.current=r.sent,r.next=7,ei.initTensorFlow();case 7:_.current=o.enableBlurCheck&&I.current.ableToUseModel,r.next=11;break;case 10:_.current=!1;case 11:if(!e){r.next=13;break}return r.abrupt("return");case 13:C(!0);case 14:case"end":return r.stop()}}),r)})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){e=!0}}),[b,o,x,P]);var R=r.useCallback((function(e){return Py({currentWorkingCanvas:e,refVirtualWorkingCanvas:p,refCountVirtualFrames:d,refVirtualFrames:h,refWorkingCanvas:u,refCardResult:m})}),[]),D=r.useCallback((function(){!0===g.current&&(g.current=!1)}),[]),N=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blurScore,n=r.detectedCard,a=o.blurThreshold,i=w.current,s=k.current,!(t<a&&Xn.hasBetterCardBlurScore(t,i.blurScore))){e.next=17;break}if(!A.current){e.next=9;break}i.imageBlob=s.imageBlob,e.next=13;break;case 9:return e.next=11,Zn.takePicture({canvas:u.current,quality:l});case 11:i.imageBlob=e.sent,i.captureTime=Date.now();case 13:i.takenAt=(new Date).getTime(),i.blurScore=t,i.detectedCard=n,i.captureType="auto";case 17:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[o,l]),L=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blurScore,n=r.detectedCard,S.current=!0,a=k.current,!Xn.hasBetterCardBlurScore(t,a.blurScore)){e.next=14;break}return e.next=6,Zn.takePicture({canvas:u.current,quality:l});case 6:a.imageBlob=e.sent,a.captureDuration+=Date.now()-a.captureTime,a.captureTime=Date.now(),a.blurScore=t,a.detectedCard=n,a.captureCount++,a.captureType="manual",A.current=!0;case 14:S.current=!1;case 15:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),[l]),O=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=o.waitForBestImageTimeMs,null===(t=w.current).imageBlob){e.next=8;break}if(!((new Date).getTime()-t.takenAt>r)){e.next=8;break}return e.next=7,c(t);case 7:D();case 8:case"end":return e.stop()}}),e)}))),[c,o,D]),M=r.useCallback((function(){E.current=!0}),[]),U=r.useCallback((function(){return new Promise((function(e){E.current=!1;var r=setInterval((function(){S.current||(clearInterval(r),e())}),150)}))}),[]),F=r.useCallback(f(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 r=o.blurThreshold,t=o.enableVirtualCamHashes,n=k.current;n.captureTime=Date.now(),_.current?(M(),setTimeout((function(){U().then(f(regeneratorRuntime.mark((function a(){var o;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(Xn.hasBetterCardBlurScore(n.blurScore,r)||(n.error=tb.id_detector_error_blur),o=u.current,null!==n.imageBlob){a.next=6;break}Zn.takePicture({canvas:o,quality:l}).then(function(){var r=f(regeneratorRuntime.mark((function r(a){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n.imageBlob=a,n.captureTime=Date.now(),!t){r.next=5;break}return r.next=5,R(o);case 5:e(n);case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()),a.next=10;break;case 6:if(!t){a.next=9;break}return a.next=9,R(o);case 9:e(n);case 10:case"end":return a.stop()}}),a)}))))}),2e3)):Zn.takePicture({canvas:u.current,quality:l}).then(function(){var r=f(regeneratorRuntime.mark((function r(a){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n.imageBlob=a,n.captureTime=Date.now(),!t){r.next=5;break}return r.next=5,R(u.current);case 5:e(n);case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),[o,M,U,l,R]),V=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,n,a,c,l,p,y,C,B,S,_,T,x,R,D,M,U,F,V,j;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o&&b&&!g.current){e.next=2;break}return e.abrupt("return");case 2:w.current={imageBlob:null,takenAt:null,blurScore:null,detectedCard:null},k.current={imageBlob:null,blurScore:null,error:null,detectedCard:null,captureCount:0,captureDuration:0},r=o.enableAutoCapture,n=o.enableBlurCheck,a=o.enableIdDetection,c=I.current,l=c.idCardModel,p=c.blazefaceModel,y=c.ableToUseModel,C=v.current,B=t.current,g.current=!0,S=C.cropX,_=C.cropY,T=C.cropWidth,x=C.cropHeight,R=C.cropWidthWithoutPadding,D=C.cropHeightWithoutPadding,(M=u.current).width=T,M.height=x,U=M.getContext("2d"),F=document.createElement("canvas"),V=F.getContext("2d"),j=function(){var e=f(regeneratorRuntime.mark((function e(){var t,o,c,u,f,v,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(U.drawImage(B,S,_,T,x,0,0,T,x),t=performance.now(),A.current=!1,!a||!y){e.next=60;break}return o=null,e.next=7,l.predict(M,{detectThreshold:.3});case 7:if(!(c=e.sent).card){e.next=56;break}if(m.current=c.card,!k.current.imageBlob&&h.current.length>0&&(h.current=[],d.current=0),!Sy({corners:c.card.corners,width:T,height:x})){e.next=53;break}if(!Iy(c.card.corners)){e.next=50;break}if(u=By(M,c.card.corners),!((f=oa.rectAreaRatio({small:{area:u.width*u.height},big:{area:R*D}}))<.5)){e.next=21;break}o=tb.id_detector_card_too_small,e.next=48;break;case 21:if(!(f>.95)){e.next=25;break}o=tb.id_detector_error_incomplete,e.next=48;break;case 25:return F.width=u.width,F.height=u.height,V.putImageData(u,0,0),e.next=30,_y({canvas:F});case 30:if(!e.sent){e.next=35;break}o=tb.glare_detected,e.next=48;break;case 35:if("ph"===P){e.next=39;break}return e.next=38,Ty({blazefaceModel:p,predictedIdCardCanvas:F,frontSide:s});case 38:o=e.sent;case 39:if(o){e.next=48;break}if(!n){e.next=48;break}if(v=Xn.calculateIdCardBlurScore({canvas:F}),!E.current){e.next=45;break}return e.next=45,L({blurScore:v,detectedCard:c.card});case 45:if(!r){e.next=48;break}return e.next=48,N({blurScore:v,detectedCard:c.card});case 48:e.next=51;break;case 50:o=tb.id_detector_validate_angle_error;case 51:e.next=54;break;case 53:o=tb.id_detector_error_incomplete;case 54:e.next=57;break;case 56:o=tb.id_detector_no_cards;case 57:return i(o),e.next=60,O();case 60:return t=Math.floor(performance.now()-t),b=180-t>0?180-t:0,e.next=64,new Promise((function(e){return setTimeout(e,b)}));case 64:g.current&&window.requestAnimationFrame(j);case 65:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(j);case 19:case"end":return e.stop()}}),e)}))),[o,b,t,i,O,s,L,N,P]);r.useEffect((function(){var e=t.current;function r(){return(r=f(regeneratorRuntime.mark((function r(){var t,n,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(v.current=Zn.analyzeVideoAndWindowSizes(e,a,.05),t=v.current,n=t.cropWidth,o=t.cropHeight,e.videoWidth&&e.videoHeight&&!Number.isNaN(n)&&!Number.isNaN(o)){r.next=4;break}return r.abrupt("return");case 4:return r.next=6,V();case 6:case"end":return r.stop()}}),r)})))).apply(this,arguments)}n&&a&&b&&function(){r.apply(this,arguments)}()}),[n,a,t,D,V,b]);var j=r.useCallback((function(){D()}),[D]);return r.useEffect((function(){return j}),[j]),{refWorkingCanvas:u,stopCheckFrame:D,checkFrame:V,warmupDone:b,takePictureManually:F,refAbleToRunBurstMode:_,refVirtualFrames:h}}({refVideo:n,shouldStart:t,cropArea:a,settings:o,onError:M,frontSide:s,onAutoCaptureSuccess:O,quality:m}),F=U.refWorkingCanvas,V=U.stopCheckFrame,j=U.checkFrame,z=U.warmupDone,H=U.takePictureManually,q=U.refAbleToRunBurstMode,K=U.refVirtualFrames,G=nb({refVideo:n,shouldStart:!1,cropArea:a,settings:o}),W=G.stopCheckFrame,Q=G.splitVideos,X=G.resetRecordedVideos,Y=G.checkFrame;!function(e){var t=e.debug,n=e.refRecordedVideos,a=e.refWorkingCanvas,o=e.refVideo,i=e.onChange;r.useEffect((function(){var e;return t&&(e=setInterval((function(){var e=o.current,r=n.current,t=a.current,s=r[r.length-1],c={videoWidth:e.videoWidth,videoHeight:e.videoHeight,framesCount:s.frames.length,"window.innerWidth":window.innerWidth,"window.innerHeight":window.innerHeight,"canvas.width":null==t?void 0:t.width,"canvas.height":null==t?void 0:t.height};i&&i(JSON.stringify(c,null,2))}),1e3)),function(){return clearInterval(e)}}),[i,t,n,a,o])}({debug:I,refRecordedVideos:G.refRecordedVideos,refWorkingCanvas:F,refVideo:n,onChange:c});var Z=r.useCallback((function(){W(),V(),X(),u()}),[X,W,V,u]),$=r.useCallback((function(){Q()}),[Q]),J=ab({lang:T,onAboutToTimeout:l,onSessionTimeout:Z,onVideoTimeLimitReached:$,settings:o,shouldStartTimers:z&&t&&(null==o?void 0:o.enableTimers),sessionTime:null==o?void 0:o.idCardSessionTime}),ee=J.stopTimers,re=J.startTimers,te=r.useCallback((function(){g.current=!1}),[]),ne=r.useCallback(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return te(),re(),e.next=4,Promise.all([Y(),j()]);case 4:case"end":return e.stop()}}),e)}))),[te,re,Y,j]),ae=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,t,n,a,i,c,l,u,f,m,y,b,w,B,E=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=E.length>0&&void 0!==E[0]?E[0]:{},t=r.imageBlob,n=r.error,a=r.detectedCard,i=r.captureTime,c=r.captureCount,l=r.captureDuration,u=r.captureType,!g.current){e.next=3;break}return e.abrupt("return");case 3:return g.current=!0,C(!0),W(),V(),ee(),M(null),f=null==o?void 0:o.enableVirtualCamHashes,m={},f&&(y=K).current.length>0&&(m=y.current.reduce((function(e,r,t){return v(v({},e),{},p({},"hash".concat(t+1),r))}),m)),D(),ws.preWriteExif({mode:ws.MODE.ID_CARD,motionData:N,orientationData:L,startTime:S.current,endTime:Date.now()}),e.next=16,ws.writeExif({mode:ws.MODE.ID_CARD,imageData:v(v({detectedCard:a,captureTime:i,blob:t},f?{vCam:m}:{}),{},{captureCount:c,captureDuration:l,captureType:u}),enableExifData:null==o?void 0:o.enableExifData});case 16:if(b=e.sent,!h||!h.key){e.next=22;break}return B=h.key,e.next=21,ai.encrypt({blob:b,key:B});case 21:w=e.sent;case 22:d({image:{blob:b,encrypted:w,detectedCard:a},error:n,recordedVideos:[]}),C(!1),k({tag:s?"id_front":"id_back",event:"user_activity",log:{time_capture_in_seconds:(performance.now()-_.current)/1e3}});case 25:case"end":return e.stop()}}),e)}))),[W,V,ee,M,d,s,k,h,N,L,D,null==o?void 0:o.enableExifData,null==o?void 0:o.enableVirtualCamHashes,K]);w.current=ae;var oe=r.useCallback(f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C(!0),ee(),W(),q.current||V(),e.next=6,H();case 6:return r=e.sent,e.next=9,ae(r);case 9:C(!1),k({tag:s?"id_front":"id_back",event:"user_activity.capture",log:{}});case 11:case"end":return e.stop()}}),e)}))),[H,ae,ee,q,W,V,k,s]);return r.useEffect((function(){t&&(k({tag:s?"id_front":"id_back",event:"user_activity.start",log:{}}),S.current=Date.now(),R())}),[k,s,t,R]),r.useEffect((function(){z&&(k({tag:s?"id_front":"id_back",event:"user_activity.show",log:{}}),k({tag:s?"id_front":"id_back",event:"sdk.load_model",log:{status:"success",time_in_ms:Date.now()-S.current}}),_.current=performance.now())}),[k,s,z]),{warmupDone:z,isProcessing:b,takePictureManually:oe,restartSession:ne,resetIsProcessingImageBlobTaken:te}},lb=D.IDCardMessage,ub=r.forwardRef((function(e,t){var n=e.description,a=e.usePortraitMask,o=e.windowAndVideoInfo,s=e.refVideo,c=e.frontSide,l=e.settings,u=e.onCaptureDone,d=e.onUISpacingChange,h=e.outputEncryptionSettings,p=B(r.useState({}),2),m=p[0],g=p[1],v=m.yDescription,y=m.yMessage,b=m.yCaptureButton,C=Bn.useAsset("ic_camera.svg"),w=Bn.useAsset("ic_loading.png"),k=B(r.useState(""),2),E=k[0],S=k[1],_=zt.useSDKSettings(),A=_.debug,I=_.lang,T=B(r.useState(null),2),x=T[0],P=T[1],R=B(r.useState(""),2),D=R[0],N=R[1],L=B(r.useState(null),2),O=L[0],M=L[1],U=py(),F=U.showPopup,V=U.popupShown,j=U.popupType,z=r.useCallback((function(e){N(null===e?"":Cf(e.msg[I])({side:c?cy.FRONT[I]:cy.BACK[I]}))}),[I,c]),H=r.useCallback((function(){P(""),F({popupType:my})}),[F]),q=r.useCallback((function(){P(""),u.apply(void 0,arguments)}),[u]),K=r.useCallback((function(e){var r=e.curTimeLeft;P(Cf(lb.REMAINING_TIME[I])({x:r}))}),[I]),G=cb({shouldStart:!0,refVideo:s,cropArea:O,settings:l,onModelErrorChange:z,frontSide:c,onDebugInfoChange:S,onSessionTimeout:H,onCaptureDone:q,onAboutToTimeout:K,outputEncryptionSettings:h}),W=G.warmupDone,Q=G.isProcessing,X=G.takePictureManually,Y=G.restartSession,Z=G.resetIsProcessingImageBlobTaken,$=r.useCallback((function(){F({popupType:null}),Z()}),[F,Z]),J=r.useCallback(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $(),e.next=3,Y();case 3:case"end":return e.stop()}}),e)}))),[Y,$]);r.useEffect((function(){if(o){var e,r,t,n,i,s,c,l=o.videoAreaWidth,u=o.videoAreaHeight,f=o.lostX,h=o.lostY,p=o.clientHeight;a?(i=.7*(s=u-165),t=(c=(e=h+10)+45)+20,n=(r=c+s+10)+60):(i=Rs.isMobile?l-6:Math.floor(.7*l),t=(c=(e=h+10)+50)+20,n=(r=c+(s=Math.floor(Math.min(i/1.5,p-2*h-80-100)))+10)+60);var m=Math.floor((l-i)/2)+f;M({x:m,y:c,width:i,height:s,surroundStyle:{opacity:.6,background:"#000"}});var v={yTitle:e,yDescription:r,yMessage:t,yCaptureButton:n};g(v),d(v)}}),[o,a,d]);var ee=r.useCallback(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return P(""),e.next=3,X();case 3:case"end":return e.stop()}}),e)}))),[X]);return r.useImperativeHandle(t,(function(){return{restartSession:J}}),[J]),i.default.createElement(i.default.Fragment,null,!W&&i.default.createElement(Vh,null),A&&i.default.createElement(ny,null,E),Q&&i.default.createElement($v,null,i.default.createElement("img",{src:w,alt:"",className:"spin"})),O&&i.default.createElement(Lu,{x:"".concat(O.x,"px"),y:"".concat(O.y,"px"),width:"".concat(O.width,"px"),height:"".concat(O.height,"px"),surroundStyle:O.surroundStyle},i.default.createElement(sy,{width:O.width,height:O.height,type:D?Sv.ERROR:Sv.DEFAULT})),!D&&i.default.createElement(ay,{y:"".concat(v,"px"),className:"description"},n),D&&i.default.createElement(oy,{y:"".concat(v,"px")},D),!Q&&(!(null!=l&&l.disableCaptureButtonIfAlert)||!D)&&i.default.createElement(Zv,{onClick:ee,y:"".concat(b,"px")},i.default.createElement("img",{src:C,alt:""})),x&&i.default.createElement(iy,{key:x,className:"message",y:"".concat(y,"px")},x),i.default.createElement(Mh,{open:V},j===my&&i.default.createElement(hy,{onOk:J,maxSessionTime:null==l?void 0:l.idCardSessionTime})))}));ub.propTypes={usePortraitMask:s.default.bool,description:s.default.string,windowAndVideoInfo:s.default.shape({}),refVideo:s.default.shape({}),frontSide:s.default.bool,settings:s.default.shape({}),onCaptureDone:s.default.func,onUISpacingChange:s.default.func,outputEncryptionSettings:s.default.shape({})},ub.defaultProps={usePortraitMask:!1,description:"",windowAndVideoInfo:{},refVideo:{},frontSide:!0,settings:{},onCaptureDone:function(){},onUISpacingChange:function(){},outputEncryptionSettings:null};var db,fb,hb=c.default.div(ob||(ob=k(["\n background: ",";\n backdrop-filter: blur(12px);\n border-radius: 8px;\n top: ",";\n position: absolute;\n z-index: ",";\n color: #fff;\n padding: 10px;\n margin: 0 10px;\n max-width: 275px;\n text-align: center;\n"])),(function(e){return e.background}),(function(e){return e.y}),1020),pb=c.default.div(ib||(ib=k(["\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){return"".concat(e.arrowSize,"px solid ").concat(e.color)}),(function(e){return"".concat(e.top,"px")})),mb=function(e){var r=e.children,t=e.y;return i.default.createElement(hb,{y:t,background:"#00ce78"},i.default.createElement(pb,{arrowSize:10,top:-10,color:"#00ce78"}),r)},gb=c.default.div(sb||(sb=k(["\n text-align: center;\n position: absolute;\n font-size: 18px;\n border-radius: 3px;\n padding: 5px 10px;\n background: #ea3223;\n color: #fff;\n margin: auto;\n top: ",";\n z-index: ",";\n"])),(function(e){return e.y}),1020),vb={QR_INSTRUCTIONS_TEXT:{en:i.default.createElement("span",null,"Please follow the instructions below to scan QR code:",i.default.createElement("br",null),i.default.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:i.default.createElement("span",null,"Vui lòng quét mã QR theo hướng dẫn sau:",i.default.createElement("br",null),i.default.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:i.default.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",i.default.createElement("br",null),i.default.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",i.default.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:i.default.createElement("span",null,"Quá thời gian quét. Vui lòng thực hiện lại.",i.default.createElement("br",null),i.default.createElement("br",null)," Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và"," ",i.default.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"}},yb=function(e){var r=e.children,t=e.mt,n=e.mb,a=e.ml,o=e.mr,s=e.mx,c=e.my,l=e.pt,u=e.pb,d=e.pl,f=e.pr,h=e.px,p=e.py,m=r.props.style||{},g={};return null!==s&&(g.marginLeft=s,g.marginRight=s),null!==c&&(g.marginTop=c,g.marginBottom=c),null!==t&&(g.marginTop=t),null!==n&&(g.marginBottom=n),null!==a&&(g.marginLeft=a),null!==o&&(g.marginRight=o),null!==h&&(g.paddingLeft=h,g.paddingRight=h),null!==p&&(g.paddingTop=p,g.paddingBottom=p),null!==l&&(g.paddingTop=l),null!==u&&(g.paddingBottom=u),null!==d&&(g.paddingLeft=d),null!==f&&(g.paddingRight=f),i.default.cloneElement(r,{style:v(v({},m),g)})};yb.propTypes={mt:s.default.string,ml:s.default.string,mr:s.default.string,mb:s.default.string,mx:s.default.string,my:s.default.string,pt:s.default.string,pl:s.default.string,pr:s.default.string,pb:s.default.string,px:s.default.string,py:s.default.string},yb.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 bb,Cb,wb,kb=c.default.button(db||(db=k(["\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})),Bb=c.default.a(fb||(fb=k(["\n color: ",";\n cursor: pointer;\n"])),(function(e){return e.theme.tsBlue})),Eb=c.default.div(bb||(bb=k(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Sb=c.default.div(Cb||(Cb=k(["\n color: ",";\n font-weight: bold;\n font-size: 16px;\n"])),(function(e){return e.theme.tsSecondary})),_b=c.default.div(wb||(wb=k(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n"])),(function(e){return e.theme.tsSecondary})),Ab=function(e){var r=e.onRetry,t=e.onSkip,n=zt.useSDKSettings().lang;return i.default.createElement(Eb,null,i.default.createElement(yb,{mt:"25px"},i.default.createElement(Sb,null,vb.QR_INVALID_POPUP_TITLE[n])),i.default.createElement(yb,{mt:"30px"},i.default.createElement(_b,null,vb.QR_INVALID_POPUP_DESCRIPTION[n])),i.default.createElement(yb,{mt:"30px"},i.default.createElement(kb,{onClick:r},vb.QR_INVALID_POPUP_RETRY_BUTTON[n])),i.default.createElement(yb,{my:"20px"},i.default.createElement(Bb,{onClick:t},vb.QR_INVALID_POPUP_SKIP_BUTTON[n])))};Ab.propTypes={onRetry:s.default.func,onSkip:s.default.func},Ab.defaultProps={onRetry:function(){},onSkip:function(){}};var Ib,Tb,xb,Pb,Rb,Db,Nb,Lb=["children","ratio","padding"],Ob=c.default.div(Ib||(Ib=k(["\n width: 100%;\n padding-bottom: ","%;\n position: relative;\n"])),(function(e){return 1/e.ratio*100})),Mb=c.default.div(Tb||(Tb=k(["\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})),Ub=function(e){var r=e.children,t=e.ratio,n=e.padding,a=w(e,Lb);return i.default.createElement(Ob,m({ratio:t},a),i.default.createElement(Mb,{padding:n},r))};Ub.propTypes={children:s.default.node,ratio:s.default.number,padding:s.default.string},Ub.defaultProps={children:null,ratio:4/3,padding:"0"};var Fb=c.default.div(xb||(xb=k(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),Vb=c.default.div(Pb||(Pb=k(["\n background: #e7e6e6;\n width: 100%;\n"]))),jb=c.default.img(Rb||(Rb=k(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),zb=c.default.div(Db||(Db=k(["\n color: ",";\n font-weight: normal;\n font-size: 16px;\n text-align: center;\n line-height: 20px;\n"])),(function(e){return e.theme.tsSecondary})),Hb=c.default(zb)(Nb||(Nb=k(["\n white-space: nowrap;\n"]))),qb=function(e){var t=e.onClickStart,n=e.onTimeout,a=e.timeout,o=zt.useSDKSettings().lang,s=Bn.useAsset("qr_code_banner.png"),c=r.useRef(a),l=B(r.useState((function(){return Cf(vb.QR_INSTRUCTIONS_COUNTDOWN[o])({x:a})})),2),u=l[0],d=l[1],f=Cn.useSDKTracking().sendEvent,h=r.useRef(!1);r.useEffect((function(){f({tag:"id_qr",event:"sdk_ui.guideline_show",log:{}})}),[f]),r.useEffect((function(){var e=Cf(vb.QR_INSTRUCTIONS_COUNTDOWN[o]),r=setInterval((function(){c.current--,d(e({x:c.current})),c.current<=0&&(clearInterval(r),h.current||f({tag:"id_qr",event:"sdk_ui.guideline_time_out",log:{}}),n&&n())}),1e3);return function(){clearInterval(r)}}),[o,n]);return i.default.createElement(Fb,null,i.default.createElement(Vb,null,i.default.createElement(Ub,{ratio:1.6},i.default.createElement(jb,{src:s}))),i.default.createElement(yb,{mt:"30px"},i.default.createElement(zb,null,vb.QR_INSTRUCTIONS_TEXT[o])),i.default.createElement(yb,{mt:"30px"},i.default.createElement(kb,{onClick:function(){f({tag:"id_qr",event:"user_activity.click_start",log:{}}),h.current=!0,t()}},vb.QR_INSTRUCTIONS_START_BUTTON[o])),i.default.createElement(yb,{my:"20px"},i.default.createElement(Hb,null,u)))};qb.propTypes={onClickStart:s.default.func,onTimeout:s.default.func,timeout:s.default.number},qb.defaultProps={onClickStart:null,onTimeout:null,timeout:10};var Kb=/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g;function Gb(e){var r=e.canvas,t=e.qrModel,n=window.cv,a=n.imread(r,n.IMREAD_GRAYSCALE);return t.detectAndDecode(a).get(0)}var Wb=function(){var e=f(regeneratorRuntime.mark((function e(r,t){var n,a,o,i,s,c,l,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xy();case 2:if(n=e.sent,a=n.qrModel,!n.noModel){e.next=7;break}return e.abrupt("return",null);case 7:return o=document.createElement("canvas"),i=o.getContext("2d"),e.next=11,new Promise((function(e){var t=URL.createObjectURL(r),n=new Image;n.onload=function(){var r=n.width,a=n.height;o.width=r/2,o.height=a/2,i.drawImage(n,r/2,0,o.width,o.height,0,0,o.width,o.height),URL.revokeObjectURL(t),e()},n.src=t}));case 11:return e.next=13,Gb({canvas:o,qrModel:a});case 13:if(s=e.sent){e.next=16;break}return e.abrupt("return",null);case 16:return e.next=18,ws.writeExif({mode:"",imageData:{blob:r,result:s,type:"qr_from_front_image"},enableExifData:!0});case 18:if(c=e.sent,!t||!t.key){e.next=24;break}return u=t.key,e.next=23,ai.encrypt({imageBlobWithExif:c,key:u});case 23:l=e.sent;case 24:return e.abrupt("return",{result:s,validateResult:{valid:!0},image:{blob:c,encrypted:l}});case 25:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),Qb=xs(Ps((function(e,r){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=3)}([function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,r){this.width=r,this.height=e.length/r,this.data=e}return e.createEmpty=function(r,t){return new e(new Uint8ClampedArray(r*t),r)},e.prototype.get=function(e,r){return!(e<0||e>=this.width||r<0||r>=this.height||!this.data[r*this.width+e])},e.prototype.set=function(e,r,t){this.data[r*this.width+e]=t?1:0},e.prototype.setRegion=function(e,r,t,n,a){for(var o=r;o<r+n;o++)for(var i=e;i<e+t;i++)this.set(i,o,!!a)},e}();r.BitMatrix=n},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(2);r.addOrSubtractGF=function(e,r){return e^r};var a=function(){function e(e,r,t){this.primitive=e,this.size=r,this.generatorBase=t,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var a=1,o=0;o<this.size;o++)this.expTable[o]=a,(a*=2)>=this.size&&(a=(a^this.primitive)&this.size-1);for(o=0;o<this.size-1;o++)this.logTable[this.expTable[o]]=o;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,r){return 0===e||0===r?0:this.expTable[(this.logTable[e]+this.logTable[r])%(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,r){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===r)return this.zero;var t=new Uint8ClampedArray(e+1);return t[0]=r,new n.default(this,t)},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}();r.default=a},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=function(){function e(e,r){if(0===r.length)throw new Error("No coefficients.");this.field=e;var t=r.length;if(t>1&&0===r[0]){for(var n=1;n<t&&0===r[n];)n++;if(n===t)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(t-n);for(var a=0;a<this.coefficients.length;a++)this.coefficients[a]=r[n+a]}}else this.coefficients=r}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(r){var t;if(this.isZero())return r;if(r.isZero())return this;var a=this.coefficients,o=r.coefficients;a.length>o.length&&(a=(t=[o,a])[0],o=t[1]);for(var i=new Uint8ClampedArray(o.length),s=o.length-a.length,c=0;c<s;c++)i[c]=o[c];for(c=s;c<o.length;c++)i[c]=n.addOrSubtractGF(a[c-s],o[c]);return new e(this.field,i)},e.prototype.multiply=function(r){if(0===r)return this.field.zero;if(1===r)return this;for(var t=this.coefficients.length,n=new Uint8ClampedArray(t),a=0;a<t;a++)n[a]=this.field.multiply(this.coefficients[a],r);return new e(this.field,n)},e.prototype.multiplyPoly=function(r){if(this.isZero()||r.isZero())return this.field.zero;for(var t=this.coefficients,a=t.length,o=r.coefficients,i=o.length,s=new Uint8ClampedArray(a+i-1),c=0;c<a;c++)for(var l=t[c],u=0;u<i;u++)s[c+u]=n.addOrSubtractGF(s[c+u],this.field.multiply(l,o[u]));return new e(this.field,s)},e.prototype.multiplyByMonomial=function(r,t){if(r<0)throw new Error("Invalid degree less than 0");if(0===t)return this.field.zero;for(var n=this.coefficients.length,a=new Uint8ClampedArray(n+r),o=0;o<n;o++)a[o]=this.field.multiply(this.coefficients[o],t);return new e(this.field,a)},e.prototype.evaluateAt=function(e){var r=0;if(0===e)return this.getCoefficient(0);var t=this.coefficients.length;if(1===e)return this.coefficients.forEach((function(e){r=n.addOrSubtractGF(r,e)})),r;r=this.coefficients[0];for(var a=1;a<t;a++)r=n.addOrSubtractGF(this.field.multiply(e,r),this.coefficients[a]);return r},e}();r.default=a},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(4),a=t(5),o=t(11),i=t(12);function s(e){var r=i.locate(e);if(!r)return null;for(var t=0,n=r;t<n.length;t++){var s=n[t],c=o.extract(e,s),l=a.decode(c.matrix);if(l)return{binaryData:l.bytes,data:l.text,chunks:l.chunks,version:l.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 l(e,r,t,a){void 0===a&&(a={});var o=c;Object.keys(o||{}).forEach((function(e){o[e]=a[e]||o[e]}));var i="attemptBoth"===o.inversionAttempts||"invertFirst"===o.inversionAttempts,l="onlyInvert"===o.inversionAttempts||"invertFirst"===o.inversionAttempts,u=n.binarize(e,r,t,i),d=u.binarized,f=u.inverted,h=s(l?f:d);return h||"attemptBoth"!==o.inversionAttempts&&"invertFirst"!==o.inversionAttempts||(h=s(l?d:f)),h}l.default=l,r.default=l},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0);function a(e,r,t){return e<r?r:e>t?t:e}var o=function(){function e(e,r){this.width=e,this.data=new Uint8ClampedArray(e*r)}return e.prototype.get=function(e,r){return this.data[r*this.width+e]},e.prototype.set=function(e,r,t){this.data[r*this.width+e]=t},e}();r.binarize=function(e,r,t,i){if(e.length!==r*t*4)throw new Error("Malformed data passed to binarizer.");for(var s=new o(r,t),c=0;c<r;c++)for(var l=0;l<t;l++){var u=e[4*(l*r+c)+0],d=e[4*(l*r+c)+1],f=e[4*(l*r+c)+2];s.set(c,l,.2126*u+.7152*d+.0722*f)}for(var h=Math.ceil(r/8),p=Math.ceil(t/8),m=new o(h,p),g=0;g<p;g++)for(var v=0;v<h;v++){var y=0,b=1/0,C=0;for(l=0;l<8;l++)for(c=0;c<8;c++){var w=s.get(8*v+c,8*g+l);y+=w,b=Math.min(b,w),C=Math.max(C,w)}var k=y/Math.pow(8,2);if(C-b<=24&&(k=b/2,g>0&&v>0)){var B=(m.get(v,g-1)+2*m.get(v-1,g)+m.get(v-1,g-1))/4;b<B&&(k=B)}m.set(v,g,k)}var E=n.BitMatrix.createEmpty(r,t),S=null;for(i&&(S=n.BitMatrix.createEmpty(r,t)),g=0;g<p;g++)for(v=0;v<h;v++){for(var _=a(v,2,h-3),A=a(g,2,p-3),I=(y=0,-2);I<=2;I++)for(var T=-2;T<=2;T++)y+=m.get(_+I,A+T);var x=y/25;for(I=0;I<8;I++)for(T=0;T<8;T++){c=8*v+I,l=8*g+T;var P=s.get(c,l);E.set(c,l,P<=x),i&&S.set(c,l,!(P<=x))}}return i?{binarized:E,inverted:S}:{binarized:E}}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0),a=t(6),o=t(9),i=t(10);function s(e,r){for(var t=e^r,n=0;t;)n++,t&=t-1;return n}function c(e,r){return r<<1|e}var l=[{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}}],u=[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,r,t){for(var a=u[t.dataMask],o=e.height,i=function(e){var r=17+4*e.versionNumber,t=n.BitMatrix.createEmpty(r,r);t.setRegion(0,0,9,9,!0),t.setRegion(r-8,0,8,9,!0),t.setRegion(0,r-8,9,8,!0);for(var a=0,o=e.alignmentPatternCenters;a<o.length;a++)for(var i=o[a],s=0,c=e.alignmentPatternCenters;s<c.length;s++){var l=c[s];6===i&&6===l||6===i&&l===r-7||i===r-7&&6===l||t.setRegion(i-2,l-2,5,5,!0)}return t.setRegion(6,9,1,r-17,!0),t.setRegion(9,6,r-17,1,!0),e.versionNumber>6&&(t.setRegion(r-11,0,3,6,!0),t.setRegion(0,r-11,6,3,!0)),t}(r),s=[],l=0,d=0,f=!0,h=o-1;h>0;h-=2){6===h&&h--;for(var p=0;p<o;p++)for(var m=f?o-1-p:p,g=0;g<2;g++){var v=h-g;if(!i.get(v,m)){d++;var y=e.get(v,m);a({y:m,x:v})&&(y=!y),l=c(y,l),8===d&&(s.push(l),d=0,l=0)}}f=!f}return s}function f(e){var r=function(e){var r=e.height,t=Math.floor((r-17)/4);if(t<=6)return i.VERSIONS[t-1];for(var n=0,a=5;a>=0;a--)for(var o=r-9;o>=r-11;o--)n=c(e.get(o,a),n);var l=0;for(o=5;o>=0;o--)for(a=r-9;a>=r-11;a--)l=c(e.get(o,a),l);for(var u,d=1/0,f=0,h=i.VERSIONS;f<h.length;f++){var p=h[f];if(p.infoBits===n||p.infoBits===l)return p;var m=s(n,p.infoBits);m<d&&(u=p,d=m),(m=s(l,p.infoBits))<d&&(u=p,d=m)}return d<=3?u:void 0}(e);if(!r)return null;var t=function(e){for(var r=0,t=0;t<=8;t++)6!==t&&(r=c(e.get(t,8),r));for(var n=7;n>=0;n--)6!==n&&(r=c(e.get(8,n),r));var a=e.height,o=0;for(n=a-1;n>=a-7;n--)o=c(e.get(8,n),o);for(t=a-8;t<a;t++)o=c(e.get(t,8),o);for(var i=1/0,u=null,d=0,f=l;d<f.length;d++){var h=f[d],p=h.bits,m=h.formatInfo;if(p===r||p===o)return m;var g=s(r,p);g<i&&(u=m,i=g),r!==o&&(g=s(o,p))<i&&(u=m,i=g)}return i<=3?u:null}(e);if(!t)return null;var n=function(e,r,t){var n=r.errorCorrectionLevels[t],a=[],o=0;if(n.ecBlocks.forEach((function(e){for(var r=0;r<e.numBlocks;r++)a.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),o+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock})),e.length<o)return null;e=e.slice(0,o);for(var i=n.ecBlocks[0].dataCodewordsPerBlock,s=0;s<i;s++)for(var c=0,l=a;c<l.length;c++)l[c].codewords.push(e.shift());if(n.ecBlocks.length>1){var u=n.ecBlocks[0].numBlocks,d=n.ecBlocks[1].numBlocks;for(s=0;s<d;s++)a[u+s].codewords.push(e.shift())}for(;e.length>0;)for(var f=0,h=a;f<h.length;f++)h[f].codewords.push(e.shift());return a}(d(e,r,t),r,t.errorCorrectionLevel);if(!n)return null;for(var u=n.reduce((function(e,r){return e+r.numDataCodewords}),0),f=new Uint8ClampedArray(u),h=0,p=0,m=n;p<m.length;p++){var g=m[p],v=o.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)f[h++]=v[y]}try{return a.decode(f,r.versionNumber)}catch(e){return null}}r.decode=function(e){if(null==e)return null;var r=f(e);if(r)return r;for(var t=0;t<e.width;t++)for(var n=t+1;n<e.height;n++)e.get(t,n)!==e.get(n,t)&&(e.set(t,n,!e.get(t,n)),e.set(n,t,!e.get(n,t)));return f(e)}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n,a,o=t(7),i=t(8);function s(e,r){for(var t=[],n="",a=[10,12,14][r],o=e.readBits(a);o>=3;){if((l=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var i=Math.floor(l/100),s=Math.floor(l/10)%10,c=l%10;t.push(48+i,48+s,48+c),n+=i.toString()+s.toString()+c.toString(),o-=3}if(2===o){if((l=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");i=Math.floor(l/10),s=l%10,t.push(48+i,48+s),n+=i.toString()+s.toString()}else if(1===o){var l;if((l=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");t.push(48+l),n+=l.toString()}return{bytes:t,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=r.Mode||(r.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"}(a||(a={}));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 l(e,r){for(var t=[],n="",a=[9,11,13][r],o=e.readBits(a);o>=2;){var i=e.readBits(11),s=Math.floor(i/45),l=i%45;t.push(c[s].charCodeAt(0),c[l].charCodeAt(0)),n+=c[s]+c[l],o-=2}return 1===o&&(s=e.readBits(6),t.push(c[s].charCodeAt(0)),n+=c[s]),{bytes:t,text:n}}function u(e,r){for(var t=[],n="",a=[8,16,16][r],o=e.readBits(a),i=0;i<o;i++){var s=e.readBits(8);t.push(s)}try{n+=decodeURIComponent(t.map((function(e){return"%"+("0"+e.toString(16)).substr(-2)})).join(""))}catch(e){}return{bytes:t,text:n}}function d(e,r){for(var t=[],n="",a=[8,10,12][r],o=e.readBits(a),s=0;s<o;s++){var c=e.readBits(13),l=Math.floor(c/192)<<8|c%192;l+=l<7936?33088:49472,t.push(l>>8,255&l),n+=String.fromCharCode(i.shiftJISTable[l])}return{bytes:t,text:n}}r.decode=function(e,r){for(var t,i,c,f,h=new o.BitStream(e),p=r<=9?0:r<=26?1:2,m={text:"",bytes:[],chunks:[],version:r};h.available()>=4;){var g=h.readBits(4);if(g===a.Terminator)return m;if(g===a.ECI)0===h.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:h.readBits(7)}):0===h.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:h.readBits(14)}):0===h.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:h.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===a.Numeric){var v=s(h,p);m.text+=v.text,(t=m.bytes).push.apply(t,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===a.Alphanumeric){var y=l(h,p);m.text+=y.text,(i=m.bytes).push.apply(i,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===a.Byte){var b=u(h,p);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===a.Kanji){var C=d(h,p);m.text+=C.text,(f=m.bytes).push.apply(f,C.bytes),m.chunks.push({type:n.Kanji,bytes:C.bytes,text:C.text})}}if(0===h.available()||0===h.readBits(h.available()))return m}},function(e,r,t){Object.defineProperty(r,"__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 r=0;if(this.bitOffset>0){var t=8-this.bitOffset,n=e<t?e:t,a=255>>8-n<<(o=t-n);r=(this.bytes[this.byteOffset]&a)>>o,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)r=r<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;var o;if(e>0)a=255>>(o=8-e)<<o,r=r<<e|(this.bytes[this.byteOffset]&a)>>o,this.bitOffset+=e}return r},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();r.BitStream=n},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.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,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(1),a=t(2);r.decode=function(e,r){var t=new Uint8ClampedArray(e.length);t.set(e);for(var o=new n.default(285,256,0),i=new a.default(o,t),s=new Uint8ClampedArray(r),c=!1,l=0;l<r;l++){var u=i.evaluateAt(o.exp(l+o.generatorBase));s[s.length-1-l]=u,0!==u&&(c=!0)}if(!c)return t;var d=new a.default(o,s),f=function(e,r,t,n){var a;r.degree()<t.degree()&&(r=(a=[t,r])[0],t=a[1]);for(var o=r,i=t,s=e.zero,c=e.one;i.degree()>=n/2;){var l=o,u=s;if(s=c,(o=i).isZero())return null;i=l;for(var d=e.zero,f=o.getCoefficient(o.degree()),h=e.inverse(f);i.degree()>=o.degree()&&!i.isZero();){var p=i.degree()-o.degree(),m=e.multiply(i.getCoefficient(i.degree()),h);d=d.addOrSubtract(e.buildMonomial(p,m)),i=i.addOrSubtract(o.multiplyByMonomial(p,m))}if(c=d.multiplyPoly(s).addOrSubtract(u),i.degree()>=o.degree())return null}var g=c.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[c.multiply(v),i.multiply(v)]}(o,o.buildMonomial(r,1),d,r);if(null===f)return null;var h=function(e,r){var t=r.degree();if(1===t)return[r.getCoefficient(1)];for(var n=new Array(t),a=0,o=1;o<e.size&&a<t;o++)0===r.evaluateAt(o)&&(n[a]=e.inverse(o),a++);return a!==t?null:n}(o,f[0]);if(null==h)return null;for(var p=function(e,r,t){for(var a=t.length,o=new Array(a),i=0;i<a;i++){for(var s=e.inverse(t[i]),c=1,l=0;l<a;l++)i!==l&&(c=e.multiply(c,n.addOrSubtractGF(1,e.multiply(t[l],s))));o[i]=e.multiply(r.evaluateAt(s),e.inverse(c)),0!==e.generatorBase&&(o[i]=e.multiply(o[i],s))}return o}(o,f[1],h),m=0;m<h.length;m++){var g=t.length-1-o.log(h[m]);if(g<0)return null;t[g]=n.addOrSubtractGF(t[g],p[m])}return t}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0}),r.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,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=t(0);function a(e,r,t,n){var a=e.x-r.x+t.x-n.x,o=e.y-r.y+t.y-n.y;if(0===a&&0===o)return{a11:r.x-e.x,a12:r.y-e.y,a13:0,a21:t.x-r.x,a22:t.y-r.y,a23:0,a31:e.x,a32:e.y,a33:1};var i=r.x-t.x,s=n.x-t.x,c=r.y-t.y,l=n.y-t.y,u=i*l-s*c,d=(a*l-s*o)/u,f=(i*o-a*c)/u;return{a11:r.x-e.x+d*r.x,a12:r.y-e.y+d*r.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}}r.extract=function(e,r){for(var t=function(e,r,t,n){var o=a(e,r,t,n);return{a11:o.a22*o.a33-o.a23*o.a32,a12:o.a13*o.a32-o.a12*o.a33,a13:o.a12*o.a23-o.a13*o.a22,a21:o.a23*o.a31-o.a21*o.a33,a22:o.a11*o.a33-o.a13*o.a31,a23:o.a13*o.a21-o.a11*o.a23,a31:o.a21*o.a32-o.a22*o.a31,a32:o.a12*o.a31-o.a11*o.a32,a33:o.a11*o.a22-o.a12*o.a21}}({x:3.5,y:3.5},{x:r.dimension-3.5,y:3.5},{x:r.dimension-6.5,y:r.dimension-6.5},{x:3.5,y:r.dimension-3.5}),o=function(e,r){return{a11:e.a11*r.a11+e.a21*r.a12+e.a31*r.a13,a12:e.a12*r.a11+e.a22*r.a12+e.a32*r.a13,a13:e.a13*r.a11+e.a23*r.a12+e.a33*r.a13,a21:e.a11*r.a21+e.a21*r.a22+e.a31*r.a23,a22:e.a12*r.a21+e.a22*r.a22+e.a32*r.a23,a23:e.a13*r.a21+e.a23*r.a22+e.a33*r.a23,a31:e.a11*r.a31+e.a21*r.a32+e.a31*r.a33,a32:e.a12*r.a31+e.a22*r.a32+e.a32*r.a33,a33:e.a13*r.a31+e.a23*r.a32+e.a33*r.a33}}(a(r.topLeft,r.topRight,r.alignmentPattern,r.bottomLeft),t),i=n.BitMatrix.createEmpty(r.dimension,r.dimension),s=function(e,r){var t=o.a13*e+o.a23*r+o.a33;return{x:(o.a11*e+o.a21*r+o.a31)/t,y:(o.a12*e+o.a22*r+o.a32)/t}},c=0;c<r.dimension;c++)for(var l=0;l<r.dimension;l++){var u=s(l+.5,c+.5);i.set(l,c,e.get(Math.floor(u.x),Math.floor(u.y)))}return{matrix:i,mappingFunction:s}}},function(e,r,t){Object.defineProperty(r,"__esModule",{value:!0});var n=function(e,r){return Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2))};function a(e){return e.reduce((function(e,r){return e+r}))}function o(e,r,t,a){var o,i,s,c,l=[{x:Math.floor(e.x),y:Math.floor(e.y)}],u=Math.abs(r.y-e.y)>Math.abs(r.x-e.x);u?(o=Math.floor(e.y),i=Math.floor(e.x),s=Math.floor(r.y),c=Math.floor(r.x)):(o=Math.floor(e.x),i=Math.floor(e.y),s=Math.floor(r.x),c=Math.floor(r.y));for(var d=Math.abs(s-o),f=Math.abs(c-i),h=Math.floor(-d/2),p=o<s?1:-1,m=i<c?1:-1,g=!0,v=o,y=i;v!==s+p;v+=p){var b=u?y:v,C=u?v:y;if(t.get(b,C)!==g&&(g=!g,l.push({x:b,y:C}),l.length===a+1))break;if((h+=f)>0){if(y===c)break;y+=m,h-=d}}for(var w=[],k=0;k<a;k++)l[k]&&l[k+1]?w.push(n(l[k],l[k+1])):w.push(0);return w}function i(e,r,t,n){var a,i=r.y-e.y,s=r.x-e.x,c=o(e,r,t,Math.ceil(n/2)),l=o(e,{x:e.x-s,y:e.y-i},t,Math.ceil(n/2)),u=c.shift()+l.shift()-1;return(a=l.concat(u)).concat.apply(a,c)}function s(e,r){var t=a(e)/a(r),n=0;return r.forEach((function(r,a){n+=Math.pow(e[a]-r*t,2)})),{averageSize:t,error:n}}function c(e,r,t){try{var n=i(e,{x:-1,y:e.y},t,r.length),a=i(e,{x:e.x,y:-1},t,r.length),o=i(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},t,r.length),c=i(e,{x:Math.min(t.width,e.x+e.y)+1,y:Math.min(t.height,e.y+e.x)+1},t,r.length),l=s(n,r),u=s(a,r),d=s(o,r),f=s(c,r),h=Math.sqrt(l.error*l.error+u.error*u.error+d.error*d.error+f.error*f.error),p=(l.averageSize+u.averageSize+d.averageSize+f.averageSize)/4;return h+(Math.pow(l.averageSize-p,2)+Math.pow(u.averageSize-p,2)+Math.pow(d.averageSize-p,2)+Math.pow(f.averageSize-p,2))/p}catch(e){return 1/0}}function l(e,r){for(var t=Math.round(r.x);e.get(t,Math.round(r.y));)t--;for(var n=Math.round(r.x);e.get(n,Math.round(r.y));)n++;for(var a=(t+n)/2,o=Math.round(r.y);e.get(Math.round(a),o);)o--;for(var i=Math.round(r.y);e.get(Math.round(a),i);)i++;return{x:a,y:(o+i)/2}}function u(e,r,t,o,s){var l,u,d;try{l=function(e,r,t,o){var s=(a(i(e,t,o,5))/7+a(i(e,r,o,5))/7+a(i(t,e,o,5))/7+a(i(r,e,o,5))/7)/4;if(s<1)throw new Error("Invalid module size");var c=Math.round(n(e,r)/s),l=Math.round(n(e,t)/s),u=Math.floor((c+l)/2)+7;switch(u%4){case 0:u++;break;case 2:u--}return{dimension:u,moduleSize:s}}(o,t,s,e),u=l.dimension,d=l.moduleSize}catch(e){return null}var f=t.x-o.x+s.x,h=t.y-o.y+s.y,p=(n(o,s)+n(o,t))/2/d,m=1-3/p,g={x:o.x+m*(f-o.x),y:o.y+m*(h-o.y)},v=r.map((function(r){var t=(r.top.startX+r.top.endX+r.bottom.startX+r.bottom.endX)/4,o=(r.top.y+r.bottom.y+1)/2;if(e.get(Math.floor(t),Math.floor(o))){var i=[r.top.endX-r.top.startX,r.bottom.endX-r.bottom.startX,r.bottom.y-r.top.y+1];return a(i),{x:t,y:o,score:c({x:Math.floor(t),y:Math.floor(o)},[1,1,1],e)+n({x:t,y:o},g)}}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score}));return{alignmentPattern:p>=15&&v.length?v[0]:g,dimension:u}}r.locate=function(e){for(var r=[],t=[],o=[],i=[],s=function(n){for(var s=0,c=!1,l=[0,0,0,0,0],u=function(r){var o=e.get(r,n);if(o===c)s++;else{l=[l[1],l[2],l[3],l[4],s],s=1,c=o;var u=a(l)/7,d=Math.abs(l[0]-u)<u&&Math.abs(l[1]-u)<u&&Math.abs(l[2]-3*u)<3*u&&Math.abs(l[3]-u)<u&&Math.abs(l[4]-u)<u&&!o,f=a(l.slice(-3))/3,h=Math.abs(l[2]-f)<f&&Math.abs(l[3]-f)<f&&Math.abs(l[4]-f)<f&&o;if(d){var p=r-l[3]-l[4],m=p-l[2],g={startX:m,endX:p,y:n};(v=t.filter((function(e){return m>=e.bottom.startX&&m<=e.bottom.endX||p>=e.bottom.startX&&m<=e.bottom.endX||m<=e.bottom.startX&&p>=e.bottom.endX&&l[2]/(e.bottom.endX-e.bottom.startX)<1.5&&l[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:t.push({top:g,bottom:g})}if(h){var v,y=r-l[4],b=y-l[3];g={startX:b,y:n,endX:y},(v=i.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&&l[2]/(e.bottom.endX-e.bottom.startX)<1.5&&l[2]/(e.bottom.endX-e.bottom.startX)>.5}))).length>0?v[0].bottom=g:i.push({top:g,bottom:g})}}},d=-1;d<=e.width;d++)u(d);r.push.apply(r,t.filter((function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2}))),t=t.filter((function(e){return e.bottom.y===n})),o.push.apply(o,i.filter((function(e){return e.bottom.y!==n}))),i=i.filter((function(e){return e.bottom.y===n}))},d=0;d<=e.height;d++)s(d);r.push.apply(r,t.filter((function(e){return e.bottom.y-e.top.y>=2}))),o.push.apply(o,i);var f=r.filter((function(e){return e.bottom.y-e.top.y>=2})).map((function(r){var t=(r.top.startX+r.top.endX+r.bottom.startX+r.bottom.endX)/4,n=(r.top.y+r.bottom.y+1)/2;if(e.get(Math.round(t),Math.round(n))){var o=[r.top.endX-r.top.startX,r.bottom.endX-r.bottom.startX,r.bottom.y-r.top.y+1],i=a(o)/o.length;return{score:c({x:Math.round(t),y:Math.round(n)},[1,1,3,1,1],e),x:t,y:n,size:i}}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score})).map((function(e,r,t){if(r>4)return null;var n=t.filter((function(e,t){return r!==t})).map((function(r){return{x:r.x,y:r.y,score:r.score+Math.pow(r.size-e.size,2)/e.size,size:r.size}})).sort((function(e,r){return e.score-r.score}));if(n.length<2)return null;var a=e.score+n[0].score+n[1].score;return{points:[e].concat(n.slice(0,2)),score:a}})).filter((function(e){return!!e})).sort((function(e,r){return e.score-r.score}));if(0===f.length)return null;var h=function(e,r,t){var a,o,i,s,c,l,u,d=n(e,r),f=n(r,t),h=n(e,t);return f>=d&&f>=h?(c=(a=[r,e,t])[0],l=a[1],u=a[2]):h>=f&&h>=d?(c=(o=[e,r,t])[0],l=o[1],u=o[2]):(c=(i=[e,t,r])[0],l=i[1],u=i[2]),(u.x-l.x)*(c.y-l.y)-(u.y-l.y)*(c.x-l.x)<0&&(c=(s=[u,c])[0],u=s[1]),{bottomLeft:c,topLeft:l,topRight:u}}(f[0].points[0],f[0].points[1],f[0].points[2]),p=h.topRight,m=h.topLeft,g=h.bottomLeft,v=u(e,o,p,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:p.x,y:p.y}});var b=l(e,p),C=l(e,m),w=l(e,g),k=u(e,o,b,C,w);return k&&y.push({alignmentPattern:{x:k.alignmentPattern.x,y:k.alignmentPattern.y},bottomLeft:{x:w.x,y:w.y},topLeft:{x:C.x,y:C.y},topRight:{x:b.x,y:b.y},dimension:k.dimension}),0===y.length?null:y}}]).default},e.exports=t()})));function Xb(e){return Yb.apply(this,arguments)}function Yb(){return(Yb=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.imageData,n=r.canvas,(a=t)||(o=n.getContext("2d"),a=o.getImageData(0,0,n.width,n.height)),!(i=Qb(a.data,a.width,a.height,{inversionAttempts:"dontInvert"}))){e.next=6;break}return e.abrupt("return",i.data);case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zb(e){return $b.apply(this,arguments)}function $b(){return($b=f(regeneratorRuntime.mark((function e(r){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.canvas,n=r.qrScannerResources,e.abrupt("return",new Promise((function(e){setTimeout((function(){return e("")}),1e3),zy.scanImage(t,void 0,void 0,n.canvas).then(e).catch((function(){return e("")}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Jb=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.canvas,n=r.blob,a=r.qrScannerResources,o=t,!n){e.next=6;break}return e.next=5,po.blobToCanvas({blob:n});case 5:o=e.sent;case 6:return i=o.getContext("2d"),e.next=9,Xb({imageData:i.getImageData(0,0,o.width,o.height)});case 9:if(s=e.sent){e.next=14;break}return e.next=13,Zb({canvas:o,qrScannerResources:a});case 13:s=e.sent;case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}();var eC,rC,tC,nC,aC,oC,iC=function(e){var t=e.shouldStart,n=e.refVideo,a=e.cropArea,o=e.settings,i=e.onSessionTimeout,s=e.onCaptureDone,c=e.onAboutToTimeout,l=e.outputEncryptionSettings,u=B(r.useState(!1),2),d=u[0],h=u[1],p=r.useRef((function(){})),m=r.useRef((function(){})),g=zt.useSDKSettings().lang,y=r.useCallback((function(){p.current.apply(p,arguments)}),[]),b=function(e){var t=e.refVideo,n=e.shouldStart,a=e.cropArea,o=e.settings,i=e.onResult,s=e.outputEncryptionSettings,c=r.useRef(null);null===c.current&&(c.current=document.createElement("canvas"));var l=r.useRef(!1),u=r.useRef(null),d=B(r.useState(!1),2),h=d[0],p=d[1],m=r.useRef({}),g=zt.useSDKSettings(),v=g.customUrls,y=g.qrSettings;r.useEffect((function(){function e(){return(e=f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h){e.next=5;break}return e.next=3,Xy({modelUrl:null==v?void 0:v.wechatQRModelsUrl});case 3:m.current=e.sent,p(!0);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[h,v]);var b=r.useCallback((function(){!0===l.current&&(l.current=!1)}),[]),C=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,n,a,d,p,g,v,C,w,k,B,E,S;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h&&o&&!l.current){e.next=2;break}return e.abrupt("return");case 2:r=m.current,n=r.qrModel,a=r.qrScannerResources,d=r.noModel,p=u.current,g=t.current,l.current=!0,v=p.cropX,C=p.cropY,w=p.cropWidth,k=p.cropHeight,(B=c.current).width=w,B.height=k,E=B.getContext("2d"),S=function(){var e=f(regeneratorRuntime.mark((function e(){var r,t,o,u,f,h,p,m;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E.drawImage(g,v,C,w,k,0,0,w,k),r=performance.now(),d){e.next=8;break}return e.next=5,Gb({canvas:B,qrModel:n});case 5:t=e.sent,e.next=11;break;case 8:return e.next=10,Jb({canvas:B,qrScannerResources:a});case 10:t=e.sent;case 11:if(r=Math.floor(performance.now()-r),!t){e.next=27;break}return b(),_=void 0,_=t.match(Kb),o={valid:Boolean(_)},e.next=17,Zn.takePicture({canvas:c.current});case 17:return u=e.sent,e.next=20,ws.writeExif({mode:"",imageData:{captureTime:Date.now(),blob:u,result:t,type:"qr"},enableExifData:"boolean"!=typeof(null==y?void 0:y.enableExif)||(null==y?void 0:y.enableExif)});case 20:if(f=e.sent,!s||!s.key){e.next=26;break}return p=s.key,e.next=25,ai.encrypt({blob:f,key:p});case 25:h=e.sent;case 26:i({result:t,validateResult:o,image:{blob:f,encrypted:h}});case 27:return m=180-r>0?180-r:0,e.next=30,new Promise((function(e){return setTimeout(e,m)}));case 30:l.current&&window.requestAnimationFrame(S);case 31:case"end":return e.stop()}var _}),e)})));return function(){return e.apply(this,arguments)}}(),window.requestAnimationFrame(S);case 13:case"end":return e.stop()}}),e)}))),[h,o,t,b,null==y?void 0:y.enableExif,s,i]),w=r.useCallback((function(){b()}),[b]);return r.useEffect((function(){var e=t.current;n||w(),h&&n&&a&&e&&e.videoWidth>0&&(u.current=Zn.analyzeVideoAndWindowSizes(e,a,0),C())}),[n,a,t,b,C,h,w]),r.useEffect((function(){return w}),[w]),{refWorkingCanvas:c,stopCheckFrame:b,checkFrame:C,warmupDone:h}}({refVideo:n,shouldStart:t,cropArea:a,settings:o,onResult:y,outputEncryptionSettings:l}),C=b.stopCheckFrame,w=b.checkFrame,k=b.warmupDone,S=nb({refVideo:n,shouldStart:t&&k,cropArea:a,settings:o}),_=S.stopCheckFrame,A=S.refRecordedVideos,I=S.splitVideos,T=S.resetRecordedVideos,x=S.checkFrame;p.current=r.useCallback((function(e){h(!0),_(),C(),m.current(),s(v(v({},e),null!=o&&o.enableRecording?{recordedVideos:A.current}:{})),h(!1)}),[_,s,A,C,null==o?void 0:o.enableRecording]);var P=r.useCallback((function(){_(),C();var e=E(A.current),r=null!=o&&o.enableRecording?{recordedVideos:e}:null;i(r),T()}),[T,_,C,i,A,o]),R=r.useCallback((function(){I()}),[I]),D=ab({lang:g,onAboutToTimeout:c,onSessionTimeout:P,onVideoTimeLimitReached:R,settings:o,shouldStartTimers:t&&k,sessionTime:null==o?void 0:o.scanQrLimitTimeSecond}),N=D.stopTimers,L=D.startTimers;return m.current=N,{isProcessing:d,restartSession:r.useCallback(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(),e.next=3,Promise.all([x(),w()]);case 3:case"end":return e.stop()}}),e)}))),[x,w,L]),refRecordedVideos:A,warmupDone:k}};function sC(e){var t=e.windowAndVideoInfo,n=e.onUISpacingChange,a=e.refVideo,o=e.settings,s=e.onCaptureDone,c=e.outputEncryptionSettings,l=B(r.useState(null),2),u=l[0],d=l[1],h=Bn.useAsset("qr_capture_cursor.png"),p=B(r.useState({}),2),m=p[0],g=p[1],v=m.yTooltip,y=m.yMessage,b=zt.useSDKSettings().lang,C=Cn.useSDKTracking().sendEvent,w=py(),k=w.showPopup,E=w.popupShown,S=w.popupType,_=B(r.useState(!1),2),A=_[0],I=_[1],T=B(r.useState(null),2),x=T[0],P=T[1],R=Bn.useAsset("ic_loading.png"),D=r.useRef();r.useEffect((function(){C({tag:"id_qr",event:"user_activity.start",log:{}}),D.current=performance.now()}),[C]),r.useEffect((function(){k({popupType:yy})}),[k]),r.useEffect((function(){if(t){var e=t.videoAreaWidth,r=t.lostX,a=t.lostY,o=Rs.isMobile?Math.min(e-6,145):145,i=o,s=a+10,c=s+90,l=c+40,u=l+i+20,f=Math.floor((e-o)/2)+r;d({x:f,y:l,width:o,height:i,surroundStyle:{opacity:.6,background:"#000"}});var h={yTitle:s,yTooltip:u,yMessage:c};g(h),n(h)}}),[t,n]);var N=r.useCallback((function(e){C({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),P(""),s(e)}),[s,C]),L=r.useCallback((function(e){var r=e.validateResult.valid;P("");var t=performance.now();r?(C({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(t-D.current)/1e3}}),s(e)):(k({popupType:vy}),C({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))}),[k,s,C]),O=r.useCallback((function(e){var r=e.curTimeLeft;P(Cf(vb.REMAINING_TIME[b])({x:r}))}),[b]),M=iC({shouldStart:A,refVideo:a,cropArea:u,settings:o,onSessionTimeout:N,onCaptureDone:L,onAboutToTimeout:O,outputEncryptionSettings:c}),U=M.isProcessing,F=M.restartSession,V=M.warmupDone,j=r.useCallback((function(){k({popupType:null})}),[k]),z=r.useCallback(f(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j(),D.current=performance.now(),C({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),e.next=5,F();case 5:case"end":return e.stop()}}),e)}))),[F,j,C]),H=r.useCallback((function(){j(),C({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),s()}),[j,s,C]),q=r.useCallback((function(){j(),setTimeout((function(){I(!0)}),200)}),[j]);return i.default.createElement(i.default.Fragment,null,!V&&i.default.createElement(Vh,{contentStyle:{maxWidth:"300px"}}),u&&i.default.createElement(Lu,{x:"".concat(u.x,"px"),y:"".concat(u.y,"px"),width:"".concat(u.width,"px"),height:"".concat(u.height,"px"),surroundStyle:u.surroundStyle},i.default.createElement("div",null,i.default.createElement("img",{src:h,width:u.width,height:u.height,alt:""}))),i.default.createElement(mb,{y:"".concat(v,"px")},vb.QR_TOOLTIP[b]),x&&i.default.createElement(gb,{key:x,className:"message",y:"".concat(y,"px")},x),U&&i.default.createElement($v,null,i.default.createElement("img",{src:R,alt:"",className:"spin"})),i.default.createElement(Mh,{contentStyle:{maxWidth:"332px"},open:E},S===vy&&i.default.createElement(Ab,{onRetry:z,onSkip:H}),S===yy&&i.default.createElement(qb,{onClickStart:q,onTimeout:q})))}sC.propTypes={windowAndVideoInfo:s.default.shape({}),onUISpacingChange:s.default.func,refVideo:s.default.shape({}),settings:s.default.shape({}),onCaptureDone:s.default.func,outputEncryptionSettings:s.default.shape({})},sC.defaultProps={windowAndVideoInfo:{},onUISpacingChange:function(){},refVideo:{},settings:{},onCaptureDone:function(){},outputEncryptionSettings:null};var cC,lC,uC,dC,fC,hC={SUCCESS:"SUCCESS",WARNING:"WARNING"},pC=(p(eC={},hC.SUCCESS,"52,206,95"),p(eC,hC.WARNING,"255,148,50"),eC),mC=(p(rC={},hC.SUCCESS,"✓"),p(rC,hC.WARNING,"!"),rC),gC=c.default.div(tC||(tC=k(["\n font-weight: normal;\n"]))),vC=c.default.div(nC||(nC=k(["\n height: 2px;\n width: 100%;\n background: ",";\n"])),(function(e){return n.css(["linear-gradient(to right,rgba(",",0),rgba(",",1),rgba(",",0));"],pC[e.type],pC[e.type],pC[e.type])})),yC=c.default.div(aC||(aC=k(["\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){return n.css(["rgb(",")"],pC[e.type])})),bC=c.default.div(oC||(oC=k(["\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 10px 0;\n"]))),CC=function(e){var r=e.children,t=e.type,n=e.className;return i.default.createElement(gC,{className:n},i.default.createElement(vC,{type:t}),i.default.createElement(bC,null,i.default.createElement(yC,{type:t},mC[t]),r),i.default.createElement(vC,{type:t}))};CC.propTypes={children:s.default.node,type:s.default.string,className:s.default.string},CC.defaultProps={children:null,type:hC.SUCCESS,className:""};var wC=c.default.div(cC||(cC=k(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n padding: 10px;\n"]))),kC=c.default.div(lC||(lC=k(["\n text-align: center;\n font-size: 1rem;\n color: #ea3223;\n margin-top: 10px;\n"]))),BC=c.default.button(uC||(uC=k(["\n margin-top: 20px;\n width: 100%;\n max-width: 160px;\n height: 50px;\n background-color: ",";\n border: 0;\n outline: none;\n border-radius: 0.25rem;\n color: #fff;\n font-weight: 400;\n cursor: pointer;\n font-size: 1rem;\n"])),(function(e){return e.theme.tsBlue})),EC=c.default.img(dC||(dC=k(["\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: 5px;\n"]))),SC=c.default.div(fC||(fC=k(["\n margin: 20px 0;\n width: 100%;\n display: flex;\n justify-content: space-evenly;\n gap: 10px;\n"]))),_C=function(e){var t=e.imageTaken,n=e.onConfirm,a=e.onTryAgain,o=e.error,s=e.hasValidQR,c=e.frontSide,l=B(r.useState(null),2),u=l[0],d=l[1],f=zt.useSDKSettings().lang,h=Cn.useSDKTracking().sendEvent;return r.useEffect((function(){h({tag:c?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})}),[c,h]),r.useEffect((function(){var e;return t&&(e=URL.createObjectURL(t.blob),d(e)),function(){URL.revokeObjectURL(e)}}),[t]),i.default.createElement(wC,null,null!==s&&i.default.createElement(yb,{mb:"20px"},i.default.createElement("div",null,i.default.createElement(CC,{type:s?hC.SUCCESS:hC.WARNING},s?cy.CONFIRM_POPUP_VALID_QR[f]:cy.CONFIRM_POPUP_INVALID_QR[f]))),i.default.createElement(Ub,{ratio:1.5},i.default.createElement(EC,{src:u})),o&&i.default.createElement(kC,{className:"confirm-popup-error-message"},o.msg[f]),i.default.createElement(SC,null,i.default.createElement(BC,{onClick:function(){h({tag:c?"id_front":"id_back",event:"user_activity.retry",log:{}}),a()}},cy.BTN_TRY_AGAIN[f]),i.default.createElement(BC,{onClick:function(){h({tag:c?"id_front":"id_back",event:"user_activity.submit",log:{}}),n()}},cy.BTN_USE_THIS_PICTURE[f])))};_C.propTypes={imageTaken:s.default.shape({}),error:s.default.shape({msg:s.default.shape({})}),onConfirm:s.default.func,onTryAgain:s.default.func,hasValidQR:s.default.bool,frontSide:s.default.bool},_C.defaultProps={imageTaken:null,error:null,onConfirm:function(){},onTryAgain:function(){},hasValidQR:null,frontSide:!0};var AC,IC={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},TC=n.createGlobalStyle(AC||(AC=k(["\n .text-primary {\n color: ",";\n }\n"])),(function(e){return e.theme.tsBlue})),xC=["onClose","onError","settings","outputEncryptionSettings","defaultCameraId","globalStyle","styledComponent","frontCamera","scannerTypeCons"];function PC(e){var t=e.onClose,a=e.onError,o=e.settings,s=e.outputEncryptionSettings,c=e.defaultCameraId,l=e.globalStyle,u=e.styledComponent,d=e.frontCamera,f=e.scannerTypeCons,h=w(e,xC),p=h.numberOfCaptures,g=h.stepNumber,v=h.frontSide,y=h.titleIcon,b=h.title,C=h.description,k=h.scannerType,E=h.usePortraitMask,S=h.shouldShowSpinner,_=h.handleQRCaptureDone,A=h.handleIDCardCaptureDone,I=h.handleRestartSession,T=h.refIDCardReader,x=h.handleClickConfirm,P=h.popupType,R=h.popupShown,D=h.popupProps,N=r.useRef(null),L=B(r.useState(null),2),O=L[0],M=L[1],U=B(r.useState(!1),2),F=U[0],V=U[1],j=Bn.useAsset("ic_loading.png"),z=B(r.useState({}),2),H=z[0],q=z[1],K=H.yTitle,G=r.useCallback((function(e){M(e),V(!0)}),[]);r.useEffect((function(){V(!1)}),[d]);var W=Bn.useAsset(y),Q=u.CloseCameraButton;return i.default.createElement(n.ThemeProvider,{theme:IC},i.default.createElement(Xv,null,i.default.createElement(Tu,{key:d,frontCamera:d,onVideoPlayed:G,onClose:t,flipHorizontal:d,ref:N,onError:a,defaultCameraId:c,closeButton:Q||null},F&&i.default.createElement(i.default.Fragment,null,k===f.ID_CARD&&i.default.createElement(ub,{key:g,ref:T,windowAndVideoInfo:O,refVideo:N,settings:o,onCaptureDone:A,onUISpacingChange:q,frontSide:v,description:C,usePortraitMask:E,outputEncryptionSettings:s}),k===f.QR_CODE&&i.default.createElement(sC,{key:g,refVideo:N,windowAndVideoInfo:O,settings:o,onCaptureDone:_,onUISpacingChange:q,outputEncryptionSettings:s})),i.default.createElement(Qv,{keyForTransition:p}),i.default.createElement(ey,{y:"".concat(K,"px")},i.default.createElement(Cp,null,i.default.createElement(fp,{key:b,timeout:{enter:500,exit:500},classNames:"flipY",unmountOnExit:!0},i.default.createElement(ry,null,y&&i.default.createElement(Yv,{src:W,alt:""}),i.default.createElement(ty,{className:"title"},b))))),S&&i.default.createElement($v,null,i.default.createElement("img",{src:j,alt:"",className:"spin"}))),i.default.createElement(Mh,{open:R},P===gy&&i.default.createElement(_C,m({},D,{onConfirm:x,onTryAgain:I,frontSide:v})))),i.default.createElement(l,null))}var RC={settings:s.default.shape({}),onClose:s.default.func,onError:s.default.func,outputEncryptionSettings:s.default.shape({}),defaultCameraId:s.default.string,globalStyle:s.default.shape({}),styledComponent:s.default.shape({CloseCameraButton:s.default.node}),frontCamera:s.default.bool,scannerTypeCons:s.default.shape({}).isRequired},DC={settings:null,onClose:function(){},onError:function(){},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:TC,styledComponent:{CloseCameraButton:null},frontCamera:!1};PC.propTypes=RC,PC.defaultProps=DC;var NC=D.IDCardSide,LC=D.IDCardType,OC=D.Errors,MC={ID_CARD:"id_card",QR_CODE:"qr_code"},UC=[{scannerType:MC.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:D.IDCardSide.FRONT,cardType:LC.VN,enableConfirmPopup:!0},{scannerType:MC.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:D.IDCardSide.BACK,cardType:LC.VN,enableConfirmPopup:!0}],FC={scannerType:MC.QR_CODE,title:"Quét mã QR trên CCCD",titleIcon:""},VC=function(){return Promise.resolve({card_label:""})};var jC=function(){this.__data__=new Ul,this.size=0};var zC=function(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t};var HC=function(e){return this.__data__.get(e)};var qC=function(e){return this.__data__.has(e)};var KC=function(e,r){var t=this.__data__;if(t instanceof Ul){var n=t.__data__;if(!Fl||n.length<199)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new Ql(n)}return t.set(e,r),this.size=t.size,this};function GC(e){var r=this.__data__=new Ul(e);this.size=r.size}GC.prototype.clear=jC,GC.prototype.delete=zC,GC.prototype.get=HC,GC.prototype.has=qC,GC.prototype.set=KC;var WC=GC;var QC=function(e,r,t){(void 0!==t&&!xl(e[r],t)||void 0===t&&!(r in e))&&$u(e,r,t)};var XC=function(e){return function(r,t,n){for(var a=-1,o=Object(r),i=n(r),s=i.length;s--;){var c=i[e?s:++a];if(!1===t(o[c],c,o))break}return r}}(),YC=Ps((function(e,r){var t=r&&!r.nodeType&&r,n=t&&e&&!e.nodeType&&e,a=n&&n.exports===t?Vc.Buffer:void 0,o=a?a.allocUnsafe:void 0;e.exports=function(e,r){if(r)return e.slice();var t=e.length,n=o?o(t):new e.constructor(t);return e.copy(n),n}})),ZC=Vc.Uint8Array;var $C=function(e){var r=new e.constructor(e.byteLength);return new ZC(r).set(new ZC(e)),r};var JC=function(e,r){var t=r?$C(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)};var ew=function(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r},rw=Object.create,tw=function(){function e(){}return function(r){if(!tl(r))return{};if(rw)return rw(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();var nw=function(e){return"function"!=typeof e.constructor||Nd(e)?{}:tw(jd(e))};var aw=function(e){return Zc(e)&&fd(e)};var ow=function(e,r){if(("constructor"!==r||"function"!=typeof e[r])&&"__proto__"!=r)return e[r]};var iw=function(e){return rd(e,Ud(e))};var sw=function(e,r,t,n,a,o,i){var s=ow(e,t),c=ow(r,t),l=i.get(c);if(l)QC(e,t,l);else{var u=o?o(s,c,t+"",e,r,i):void 0,d=void 0===u;if(d){var f=Mc(c),h=!f&&Ed(c),p=!f&&!h&&xd(c);u=c,f||h||p?Mc(s)?u=s:aw(s)?u=ew(s):h?(d=!1,u=YC(c,!0)):p?(d=!1,u=JC(c,!0)):u=[]:Wd(c)||kd(c)?(u=s,kd(s)?u=iw(s):tl(s)&&!al(s)||(u=nw(c))):d=!1}d&&(i.set(c,u),a(u,c,n,o,i),i.delete(c)),QC(e,t,u)}};var cw=function e(r,t,n,a,o){r!==t&&XC(t,(function(i,s){if(o||(o=new WC),tl(i))sw(r,t,s,n,e,a,o);else{var c=a?a(ow(r,s),i,s+"",r,t,o):void 0;void 0===c&&(c=i),QC(r,s,c)}}),Ud)},lw=gd((function(e,r,t){cw(e,r,t)})),uw={data:{settings:{sdk_settings:{id_detection_settings:{auto_capture:{enable:!1,show_capture_button:!0,wait_for_best_image_time_ms_web:1e3},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 dw(e){var t=e.clientSettings,n=B(r.useState(null),2),a=n[0],o=n[1];return r.useEffect((function(){var e=lw(uw,t),r=hu(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.enable"),n=hu(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.frames_interval_ms"),a=hu(e,"data.settings.sdk_settings.id_detection_settings.save_frame_settings.quality_web"),i=hu(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.enable"),s=hu(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.limit_time_second"),c=hu(e,"data.settings.sdk_settings.id_detection_settings.limit_time_settings.video_partial_length_seconds"),l=hu(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.enable"),u=hu(e,"data.settings.sdk_settings.id_detection_settings.auto_capture.wait_for_best_image_time_ms_web"),d=hu(e,"data.settings.sdk_settings.id_detection_settings.blur_check.enable"),f=hu(e,"data.settings.sdk_settings.id_detection_settings.blur_check.threshold_web"),h=hu(e,"data.settings.sdk_settings.id_detection_settings.disable_capture_button_if_alert"),p=hu(e,"data.settings.sdk_settings.id_detection_settings.id_detection.enable"),m=hu(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.enable"),g=hu(e,"data.settings.sdk_settings.id_detection_settings.scan_qr_settings.limit_time_second"),v=hu(e,"data.settings.sdk_settings.id_detection_settings.exif_data_settings.enable"),y=hu(e,"data.settings.sdk_settings.id_detection_settings.virtual_cam_hashes.".concat(Rs.isMobile?"mobile":"web"));o({enableRecording:r,frameCaptureIntervalMs:n,idCardSessionTime:s,maxRecordingTimePerVideo:c,saveFrameQuality:a,enableTimers:i,enableAutoCapture:l,waitForBestImageTimeMs:u,enableBlurCheck:d,blurThreshold:f,disableCaptureButtonIfAlert:h,enableIdDetection:p,enableScanQr:m,scanQrLimitTimeSecond:g,enableExifData:v,enableVirtualCamHashes:y})}),[t]),{settings:a}}function fw(e){var t=e.logCredentials,n=e.clientSettings,a=e.uiOnlyComponent,o=e.onError,s=e.detectIdCard,c=e.outputEncryptionSettings,l=e.steps,u=e.onStepDone,d=dw({clientSettings:n}).settings,h=m({},function(e){var t=e.settings,n=e.onError,a=e.detectIdCard,o=void 0===a?VC:a,i=e.outputEncryptionSettings,s=e.steps,c=void 0===s?UC:s,l=e.onStepDone,u=B(r.useState(0),2),d=u[0],h=u[1],p=B(r.useState(c[d]),2),m=p[0],g=p[1],y=B(r.useState(0),2),b=y[0],C=y[1],w=B(r.useState(!1),2),k=w[0],S=w[1],_=r.useRef({}),A=r.useRef([]),I=r.useRef(null),T=r.useRef(),x=py(),P=x.showPopup,R=x.popupShown,N=x.popupType,L=x.props,O=m.scannerType,M=m.title,U=m.titleIcon,F=m.cardSide,V=m.description,j=m.usePortraitMask,z=m.cardType,H=m.enableConfirmPopup,q=r.useCallback((function(e){e>=c.length||setTimeout((function(){h(e),g(c[e])}),200)}),[c]),K=r.useCallback((function(){q(d+1)}),[q,d]),G=r.useCallback((function(){setTimeout((function(){g((function(e){return v(v({},e),FC)}))}),200)}),[]),W=r.useCallback((function(){P({popupType:null})}),[P]),Q=r.useCallback((function(){W(),I.current=null,O===MC.QR_CODE?q(d):O===MC.ID_CARD&&T.current.restartSession()}),[q,d,W,O]),X=r.useCallback(f(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=v({stepNumber:d,cardSide:F,cardType:z,image:_.current},null!=t&&t.enableRecording?{recordedVideos:A.current}:{}),(O===MC.QR_CODE&&I.current||null!==(r=I.current)&&void 0!==r&&r.result)&&(n.qrScannedResult=I.current),S(!0),e.next=5,l(n);case 5:S(!1),I.current=null,K();case 8:case"end":return e.stop()}}),e)}))),[t,d,l,K,O,S,F,z]),Y=r.useCallback((function(e){var r;if(I.current=e,e&&e.recordedVideos){var t,n=e.recordedVideos;(t=A.current).push.apply(t,E(n))}C((function(e){return e+1}));var a=Boolean(null==e||null===(r=e.validateResult)||void 0===r?void 0:r.valid);H?P({popupType:gy,props:{hasValidQR:a,imageTaken:_.current}}):X()}),[P,H,X]),Z=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var a,s,c,l,u,d,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.image,s=r.error,c=r.recordedVideos,_.current=a,A.current=c,C((function(e){return e+1})),F!==D.IDCardSide.FRONT){e.next=28;break}if(!t.enableScanQr||!Rs.isMobile){e.next=28;break}if(u=null==a||null===(l=a.detectedCard)||void 0===l?void 0:l.label){e.next=20;break}return S(!0),e.prev=9,e.next=12,o({image:a,cardType:z,cardSide:F});case 12:d=e.sent,u=d.card_label,e.next=19;break;case 16:e.prev=16,e.t0=e.catch(9),n(OC.detect_id_card_error);case 19:S(!1);case 20:if(!u||!"vn.cccd_new.front".includes(u)){e.next=28;break}return S(!0),e.next=24,Wb(_.current.blob,i);case 24:return(f=e.sent)?Y(f):G(),S(!1),e.abrupt("return");case 28:H?P({popupType:gy,props:{imageTaken:_.current,error:s}}):X();case 29:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(r){return e.apply(this,arguments)}}(),[H,P,F,t,z,o,X,G,n,Y,i,S]),$=r.useCallback((function(){W(),X()}),[X,W]);return{numberOfCaptures:b,stepNumber:d,titleIcon:U,title:M,description:V,frontSide:F===NC.FRONT,scannerType:O,usePortraitMask:j,shouldShowSpinner:k,handleQRCaptureDone:Y,handleIDCardCaptureDone:Z,handleRestartSession:Q,refIDCardReader:T,handleClickConfirm:$,showPopup:P,popupType:N,popupShown:R,popupProps:L}}({settings:d,onError:o,detectIdCard:s,outputEncryptionSettings:c,steps:l,onStepDone:u}));return i.default.createElement(Am,null,i.default.createElement(Cn.SDKTrackingProvider,{value:{tracking:v({},t)}},i.default.createElement(a,m({},e,{settings:d,scannerTypeCons:MC},h))))}var hw={logCredentials:s.default.shape({}),clientSettings:s.default.shape({}),uiOnlyComponent:s.default.func,onError:s.default.func,onStepDone:s.default.func,steps:s.default.arrayOf(s.default.shape({})),detectIdCard:s.default.func,outputEncryptionSettings:s.default.shape({})};fw.propTypes=hw,fw.defaultProps={logCredentials:void 0,clientSettings:void 0,uiOnlyComponent:PC,onError:function(){},onStepDone:function(){},steps:void 0,detectIdCard:void 0,outputEncryptionSettings:null};var pw=D.IDCardSide,mw=D.Errors;function gw(e){return vw.apply(this,arguments)}function vw(){return(vw=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.image,n=r.cardType,a=r.cardSide,o=r.apiClient,i=r.outputEncryptionSettings,s={label:"id_card.".concat(n,".").concat(a)},!i||!i.key){e.next=4;break}return e.abrupt("return",o.httpClient.post("/v1/images",v({base64:t.encrypted.hex},s),{"X-TV-Key":i.key}));case 4:return e.abrupt("return",o.uploadImage(v({file:t.blob},s)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function yw(e){return bw.apply(this,arguments)}function bw(){return(bw=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.image,n=r.apiClient,a=r.rawString,o=r.outputEncryptionSettings,i={label:"qr_code",metadata:JSON.stringify({raw:a})},!o||!o.key){e.next=4;break}return e.abrupt("return",n.httpClient.post("/v1/images",v({base64:t.encrypted.hex},i),{"X-TV-Key":o.key}));case 4:return e.abrupt("return",n.uploadImage(v({file:t.blob},i)));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Cw(e){return ww.apply(this,arguments)}function ww(){return(ww=f(regeneratorRuntime.mark((function e(r){var t,n,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.imageId,n=r.cardType,a=r.apiClient,e.abrupt("return",a.requestVerifyIDCard({card_type:n,image1:{id:t}}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kw(e){return Bw.apply(this,arguments)}function Bw(){return(Bw=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.apiClient,n=r.cardType,a=r.frontCardId,o=r.isCapturingFrontSide,i=r.backCardId,s=r.recordedVideos,c=void 0===s?[]:s,l=r.qrImageId,u=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 t.fileService.request({frames:e.frames})})));case 5:return f=e.sent,h={card_type:n,image:{id:a},image2:o?void 0:{id:i},videos:[].concat(E(u.map((function(e){return{id:e.id}}))),E(f.map((function(e){return{id:e.data.file_id}}))))},l&&(h.qr1_images=[{id:l}]),e.abrupt("return",t.detectIDTampering(h));case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ew(e){return Sw.apply(this,arguments)}function Sw(){return(Sw=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.cardType,n=r.apiClient,a=r.frontCardId,o=r.backCardId,i=r.isCapturingFrontSide,s=r.qrImageId,c={card_type:t,image1:i?{id:a}:{id:o}},s&&(c.qr1_images=[{id:s}]),e.abrupt("return",n.readIDCard(c));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _w(e){return Aw.apply(this,arguments)}function Aw(){return(Aw=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i,s,c,l,u,d,f,h,p,m,g,y,b,C,w,k,E,S,_,A;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r.image,a=r.frontCardId,o=r.qrImageId,i=r.onError,s=r.recordedVideos,c=r.apiClient,l=r.cardType,u=r.cardSide,d=r.qrScannedResult,f=r.outputEncryptionSettings,u!==pw.BACK||a){e.next=4;break}return i(mw.missing_front_id_card),e.abrupt("return");case 4:return h=[gw({image:n,cardType:l,cardSide:u,apiClient:c,outputEncryptionSettings:f})],d&&d.image&&d.result&&h.push(yw({image:d.image,apiClient:c,rawString:d.result,outputEncryptionSettings:f})),e.next=8,Promise.all(h);case 8:if(p=e.sent,m=B(p,2),g=m[0],y=m[1],!g.errors){e.next=15;break}return i(v(v({},mw.upload_error),{},{details:g.errors})),e.abrupt("return");case 15:return b=g.data.image_id,C=(null==y||null===(t=y.data)||void 0===t?void 0:t.image_id)||o,(E=u===pw.FRONT)?w=b:(w=a,k=b),e.next=21,Cw({imageId:b,cardType:l,apiClient:c});case 21:if(!(S=e.sent).errors){e.next=25;break}return i(v(v({},mw.sanity_check_error),{},{details:S.errors})),e.abrupt("return");case 25:return e.next=27,Ew({cardType:l,apiClient:c,frontCardId:w,backCardId:k,isCapturingFrontSide:E,qrImageId:C});case 27:if(!(_=e.sent).errors){e.next=31;break}return i(v(v({},mw.read_id_card_error),{},{details:_.errors})),e.abrupt("return");case 31:return e.next=33,kw({apiClient:c,cardType:l,frontCardId:w,isCapturingFrontSide:E,backCardId:k,recordedVideos:s,qrImageId:C});case 33:if(!(A=e.sent).errors){e.next=37;break}return i(v(v({},mw.detect_id_tampering_error),{},{details:A.errors})),e.abrupt("return");case 37:return e.abrupt("return",{sanityResult:S.data,tamperingInfo:A.data,cardInfo:_.data,qrImageId:C});case 38:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Iw=["readIDCardUIOnlyComponent"],Tw=["onError","onStepDone","apiCredentials","logCredentials","outputEncryptionSettings"],xw=D.Errors,Pw=function(e){var t=e.readIDCardUIOnlyComponent,n=w(e,Iw),a=n.onError,o=n.onStepDone,s=n.apiCredentials,c=n.logCredentials,l=n.outputEncryptionSettings,u=w(n,Tw),d=B(r.useState(null),2),h=d[0],p=d[1],g=Ao.useApiClient({apiCredentials:s,logCredentials:c}).apiClient,y=r.useRef(""),b=r.useRef("");r.useEffect((function(){function e(){return(e=f(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.clientSettings();case 2:r=e.sent,p(r);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[g]);var C=r.useCallback(function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,i,s,c,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.cardType,n=r.cardSide,i=r.recordedVideos,s=r.qrScannedResult,c=r.image,u=null,e.prev=2,e.next=5,_w({image:c,cardSide:n,frontCardId:y.current,qrImageId:b.current,onError:a,apiClient:g,cardType:t,recordedVideos:i,qrScannedResult:s,outputEncryptionSettings:l});case 5:u=e.sent,n===D.IDCardSide.FRONT&&(y.current=u.cardInfo.image1.id),b.current=u.qrImageId,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),a(v(v({},xw.api_call_error),{},{details:e.t0}));case 13:u&&o(v(v({},r),{},{apiResult:u}));case 14:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(r){return e.apply(this,arguments)}}(),[g,a,o,l]);return h&&i.default.createElement(t,m({logCredentials:c,onError:a,onStepDone:C,outputEncryptionSettings:l},u,{clientSettings:h}))};function Rw(){return(Rw=f(regeneratorRuntime.mark((function e(){var r,t,n,a,o,i,s,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>0&&void 0!==c[0]?c[0]:{},t=r.opencvUrl,n=r.idCardModelUrl,a=r.tfScriptUrls,o=r.blazefaceModelUrl,i=r.closeEyesModelUrl,s=new jy,e.prev=2,ei.loadTensorFlow(a).then((function(){ei.loadBlazefaceModel({modelUrl:o})})),e.next=6,Promise.all([If({closeEyesModelUrl:i}),s.loadResource({modelUrl:n}),Oy({url:t})]);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)}Pw.propTypes={onError:s.default.func,onStepDone:s.default.func,apiCredentials:s.default.shape({accessKey:s.default.string,secretKey:s.default.string,apiUrl:s.default.string}),logCredentials:s.default.shape({}),outputEncryptionSettings:s.default.shape({}),readIDCardUIOnlyComponent:s.default.func},Pw.defaultProps={onError:function(){},onStepDone:function(){},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!0},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:fw};var Dw,Nw,Lw,Ow,Mw,Uw,Fw,Vw=Af((function(){return Rw.apply(this,arguments)})),jw=function(){var e=f(regeneratorRuntime.mark((function e(r){var t,n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.blob,n=r.resultWarmup,a=n.idCardModel,o=n.ableToUseModel){e.next=4;break}return e.abrupt("return",{ableToUseModel:o});case 4:return e.next=6,po.blobToCanvas({blob:t});case 6:return i=e.sent,e.abrupt("return",a.predict(i,{detectThreshold:.3}));case 8:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),zw=ch,Hw=w(gm,["useLivenessDetection"]);function qw(e){var r=e.className;return i.default.createElement("svg",{className:r,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.default.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"}))}qw.propTypes={className:s.default.string},qw.defaultProps={className:""};var Kw,Gw,Ww,Qw,Xw,Yw,Zw,$w,Jw,ek,rk,tk,nk=(p(Dw={},D.FaceDirection.LEFT,90),p(Dw,D.FaceDirection.RIGHT,270),p(Dw,D.FaceDirection.UP,180),p(Dw,D.FaceDirection.DOWN,0),Dw),ak=n.keyframes(["0%{opacity:0.15;}50%{opacity:0.3;}100%{opacity:1;}"]),ok=c.default.div(Nw||(Nw=k(["\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"])),nk[D.FaceDirection.DOWN],nk[D.FaceDirection.LEFT],nk[D.FaceDirection.UP],nk[D.FaceDirection.RIGHT]),ik=c.default.div(Lw||(Lw=k(["\n width: 70px;\n transform: rotate(","deg);\n"])),(function(e){var r,t=e.direction;return null!==(r=nk[t])&&void 0!==r?r:0})),sk=c.default.span(Ow||(Ow=k(["\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"])),ak),ck=c.default(sk)(Mw||(Mw=k(["\n animation-delay: 0s;\n"]))),lk=c.default(sk)(Uw||(Uw=k(["\n animation-delay: 0.5s;\n"]))),uk=c.default(sk)(Fw||(Fw=k(["\n animation-delay: 1s;\n"])));function dk(e){var r=e.type;return r!==D.FaceDirection.FRONTAL?i.default.createElement(ik,{direction:r},i.default.createElement(ck,null),i.default.createElement(lk,null),i.default.createElement(uk,null)):i.default.createElement(ok,null,i.default.createElement(ik,{className:"top"},i.default.createElement(ck,null),i.default.createElement(lk,null),i.default.createElement(uk,null)),i.default.createElement(ik,{className:"right"},i.default.createElement(ck,null),i.default.createElement(lk,null),i.default.createElement(uk,null)),i.default.createElement(ik,{className:"bottom"},i.default.createElement(ck,null),i.default.createElement(lk,null),i.default.createElement(uk,null)),i.default.createElement(ik,{className:"left"},i.default.createElement(ck,null),i.default.createElement(lk,null),i.default.createElement(uk,null)))}dk.propTypes={type:s.default.oneOf([D.FaceDirection.LEFT,D.FaceDirection.RIGHT,D.FaceDirection.UP,D.FaceDirection.FRONTAL])},dk.defaultProps={type:D.FaceDirection.LEFT};var fk=650,hk=750,pk=Ou,mk=Hw.Text,gk=Hw.FaceDetectionError,vk=Hw.FaceVerificationInstructions,yk=Hw.FaceVerificationStepsWrapper,bk=Hw.StepItem,Ck=Hw.BottomButtonsOverlay,wk=Hw.Button,kk=Hw.CountDownOverlay,Bk=Hw.InstructionsOverlay,Ek=c.default(yk)(Kw||(Kw=k(["\n height: 50px;\n"]))),Sk=c.default(mk)(Gw||(Gw=k(["\n position: absolute;\n font-style: normal;\n font-weight: bold;\n font-size: 1.5rem;\n text-align: center;\n padding: 0 1.75rem;\n color: ",";\n\n ","\n\n ",";\n"])),(function(e){return e.color}),(function(e){var r=e.top;return r&&n.css(["top:","px;"],r)}),(function(e){return e.isMobile&&n.css(["font-size:1.125rem;"])})),_k=c.default(gk)(Ww||(Ww=k(["\n position: absolute;\n font-size: 1.125rem;\n text-align: center;\n\n ",";\n"])),(function(e){return e.isMobile&&n.css(["font-size:0.875rem;"])})),Ak=c.default(vk)(Qw||(Qw=k(["\n position: absolute;\n font-size: 1.125rem;\n text-align: center;\n padding: 0 1.75rem;\n color: ",";\n text-shadow: none;\n\n ",";\n"])),(function(e){return e.color}),(function(e){return e.isMobile&&n.css(["font-size:0.875rem;"])})),Ik=c.default(qw)(Xw||(Xw=k(["\n width: 100%;\n height: 100%;\n vertical-align: middle;\n margin: 0;\n color: ",";\n"])),(function(e){var r=e.color;return null!=r?r:"#06243c"})),Tk=c.default.img(Yw||(Yw=k(["\n && {\n width: 20px;\n border-radius: 50%;\n margin: 0;\n\n ","\n }\n"])),(function(e){return"preview"===e.mode&&n.css(["width:42px;"])})),xk=c.default(bk)(Zw||(Zw=k(["\n width: 50px;\n height: 50px;\n border: 1px solid #005993;\n border-radius: 50%;\n\n & + & {\n margin-left: 10px;\n }\n\n ","\n"])),(function(e){return!e.active&&n.css(["border-color:#f2f6f9;opacity:0.3;"])})),Pk=c.default(Bh)($w||($w=k(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"]))),Rk=c.default.div(Jw||(Jw=k(["\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n z-index: -1;\n"]))),Dk=c.default(Rk)(ek||(ek=k(["\n background: rgba(223, 0, 0, 0.2);\n"]))),Nk=n.keyframes(["from{opacity:1;}to{opacity:0;}"]),Lk=c.default(Rk)(rk||(rk=k(["\n background: rgba(255, 255, 255, 0.3);\n animation: "," 1s infinite;\n"])),Nk),Ok=Rs.isMobile?{width:640}:null;function Mk(e){var t=e.className,n=e.apiCheck,a=e.enableInstructionsOverlay,o=e.enableErrorOverlay,s=e.enableCapturingOverlay,c=e.frontalMinSize,l=e.mode,u=e.minPadding,d=e.backgroundColor,f=e.textColor,h=e.progressProps,p=e.title,g=e.description,v=e.customInstructions,y=e.customIcon,b=e.customDirectionIcon,C=e.onLivenessDetectionDone,w=e.onClose,k=e.onError,B=e.captureFrameSettings,E=e.onFramesCaptured,S=e.livenessSettings,_=e.initFirstGestureTimeout,A=r.useCallback((function(e){var r=e.clientWidth,t=e.clientHeight,n=e.videoAreaWidth,a=e.videoAreaHeight,o=e.lostX,i=e.lostY,s=Math.max(80,i),c=Math.max(140,i);t>fk&&(s=Math.max(110,i),c=Math.max(170,i)),t>hk&&(s=Math.max(140,i),c=Math.max(200,i));var l=Math.max(u,o),d=Math.max(u,o),f=Math.min(n,a),h=Math.max(Math.floor(Math.min(r-(l+d),t-(s+c),f)),160);return{x:Math.min(Math.floor(l+(r-d-l)/2-h/2),r-h),y:Math.min(Math.floor(s+(t-c-s)/2-h/2),t-h),width:h,height:h}}),[u]),I=r.useMemo((function(){return{background:d,opacity:1}}),[d]),T=zw({apiCheck:n,frontalMinSize:c,mode:l,bgCameraMask:null,bgCameraMaskRed:null,surroundStyle:I,cropAreaDimension:A,customInstructions:v,customIcon:y,customDirectionIcon:b,onLivenessDetectionDone:C,captureFrameSettings:B,onFramesCaptured:E,livenessSettings:S,initFirstGestureTimeout:_}),x=T.countdownToTakePicture,P=T.cropArea,R=T.curStepIndex,D=T.directionIcon,N=T.faceDetectionError,L=T.handleTriggerPassiveMode,O=T.handleVideoPlayed,M=T.instructions,U=T.isActiveMode,F=T.refVideo,V=T.showCountdown,j=T.steps,z=T.videoPlayed,H=T.activeCapturing,q=T.warmupDone,K=10,G=45,W=2,Q=50,X=12,Y=14;window.innerHeight>fk&&(K=25,G=65,W=3,Q=50,X=24,Y=34),window.innerHeight>hk&&(K=30,G=80,W=5,Q=50,X=32,Y=54);var Z=P.current?P.current.y+P.current.height+W:0,$=Y+Q+X,J=o&&N;return i.default.createElement(Tu,{ref:F,className:t,frontCamera:!0,flipHorizontal:!0,videoSettings:Ok,onVideoPlayed:O,onClose:w,onError:k},!q&&i.default.createElement(Vh,null),z?i.default.createElement(i.default.Fragment,null,i.default.createElement(Sk,{top:K,isMobile:Rs.isMobile,color:f},p),P.current?i.default.createElement(Lu,{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},i.default.createElement(Ik,{color:d}),i.default.createElement(Pk,m({progress:R/j.length*100,hasError:J},h)),V?i.default.createElement(kk,null,x):null,U&&a&&D?i.default.createElement(Bk,null,D):null,U&&s&&H?i.default.createElement(Lk,null):null,J?i.default.createElement(Dk,null):null):null,N?i.default.createElement(_k,{top:Z,isMobile:Rs.isMobile,error:N}):null,U?i.default.createElement(i.default.Fragment,null,i.default.createElement(Ak,{top:G,isMobile:Rs.isMobile,color:f},g),M?i.default.createElement(Ak,{bottom:$,isMobile:Rs.isMobile,color:f},M):null,i.default.createElement(Ek,{bottom:Y},j.map((function(e,r){var t=e.name,n=e.icon,a=e.image.objUrl,o=R>=r;return i.default.createElement(xk,{key:t,active:o},a?i.default.createElement(Tk,{src:a,alt:"",mode:"preview"}):function(e,r){return"string"==typeof e?i.default.createElement(Tk,{src:e,alt:""}):i.default.cloneElement(e,r)}(n,{active:o}))})))):i.default.createElement(i.default.Fragment,null,N?null:i.default.createElement(Ck,null,i.default.createElement(wk,{onClick:L},i.default.createElement(pk,null))))):null)}Mk.propTypes={className:s.default.string,apiCheck:s.default.bool,enableInstructionsOverlay:s.default.bool,enableErrorOverlay:s.default.bool,enableCapturingOverlay:s.default.bool,frontalMinSize:s.default.number,mode:s.default.string,minPadding:s.default.number,backgroundColor:s.default.string,textColor:s.default.string,progressProps:s.default.shape({className:s.default.string,style:s.default.shape({}),radius:s.default.number,strokeWidth:s.default.number,progress:s.default.number,activeColor:s.default.string,innerPadding:s.default.number,outsideRingColor:s.default.string,insideRingColor:s.default.string,insideRingWidth:s.default.number,dashedRingColor:s.default.string,dashedRingWidth:s.default.number,dashedRingLineThick:s.default.number,dashedRingLineSpacing:s.default.number,showOutsideRing:s.default.bool,showDashedRing:s.default.bool,showInsideRing:s.default.bool}),title:s.default.string,description:s.default.string,customInstructions:s.default.shape({}),customIcon:s.default.shape({}),customDirectionIcon:s.default.shape({}),onLivenessDetectionDone:s.default.func,onClose:s.default.func,onError:s.default.func,captureFrameSettings:s.default.shape({}),onFramesCaptured:s.default.func,livenessSettings:s.default.shape({}),initFirstGestureTimeout:s.default.number},Mk.defaultProps={className:"",apiCheck:!1,enableInstructionsOverlay:!1,enableErrorOverlay:!1,enableCapturingOverlay:!1,frontalMinSize:720,mode:null,minPadding:30,backgroundColor:"#06243c",textColor:"#ffffff",progressProps:null,title:"Chụp ảnh chân dung",description:"Xin đưa khuôn mặt vào khung hình. Hình ảnh sẽ tự động được ghi lại.",customInstructions:null,customIcon:null,customDirectionIcon:(tk={},p(tk,D.FaceDirection.LEFT,i.default.createElement(dk,{type:D.FaceDirection.LEFT})),p(tk,D.FaceDirection.RIGHT,i.default.createElement(dk,{type:D.FaceDirection.RIGHT})),p(tk,D.FaceDirection.UP,i.default.createElement(dk,{type:D.FaceDirection.UP})),p(tk,D.FaceDirection.FRONTAL,i.default.createElement(dk,{type:D.FaceDirection.FRONTAL})),tk),onLivenessDetectionDone:null,onClose:null,onError:function(){},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:function(){},livenessSettings:null,initFirstGestureTimeout:2e3},exports.APIUtils=Ao,exports.Animations=Gp,exports.AntiDebugUtils=ri,exports.AssetUtils=Bn,exports.AsyncUtils=Sn,exports.BASE_Z_INDEX=1e3,exports.BaseTVWebSDK=Is,exports.BlurUtils=Xn,exports.Button=kb,exports.ButtonLink=Bb,exports.Camera=Tu,exports.CameraUtils=Zn,exports.CloseButton=bu,exports.CloseEyesDetector=Bs,exports.CommonUtils=Jn,exports.Constants=D,exports.CoordinateUtils=oa,exports.CropAreaOverlayWrapper=Lu,exports.CryptoUtils=ai,exports.DEFAULT_CLOSE_EYE_MODEL=ks,exports.ExifUtils=ws,exports.FaceUtils=ha,exports.FlashLiveness=kv,exports.GlareUtils=yo,exports.HashUtils=fn,exports.HighlightResult=CC,exports.HighlightResultType=hC,exports.Icons=wm,exports.ImageUtils=po,exports.LivenessDetection=Mk,exports.LivenessDetectionComponents=Hw,exports.LoadResourceUtils=Oo,exports.LocalStorageUtils=cn,exports.MobileDetect=Ns,exports.ModelUtils=ei,exports.NativeCamera=bm,exports.NormalCamera=Iu,exports.OrientationDetection=Am,exports.PlacementArea=Nu,exports.Popup=Mh,exports.PredictionUtils=ma,exports.ProgressCircle=Bh,exports.QRCodeScanner=sC,exports.RatioWrapper=Ub,exports.ReadIDCardUIOnly=fw,exports.ReadIDCardWithApiCall=Pw,exports.RectangleMask=_v,exports.RectangleMaskType=Sv,exports.SDKTimer=oi,exports.ScannerType=MC,exports.SettingsContext=zt,exports.Spacing=yb,exports.ThemeUtils=ti,exports.TimeUtils=an,exports.TrackingContext=Cn,exports.UIOnlyDefaultProps=DC,exports.UIOnlyPropTypes=RC,exports.UserAgentUtils=rn,exports.WarmupPopup=Vh,exports.checkCamera=vm,exports.defaultClientSettings=uw,exports.defaultReadIDCardSteps=UC,exports.getBaseSDKComponent=function(){return{checkCamera:vm,LivenessDetection:Ev,NativeCamera:bm,ReadIDCardUIOnly:fw,ReadIDCardWithApiCall:Pw,warmUpReadIdCard:rb,preloadEKYCResources:Vw,getListCamera:Pc,FlashLiveness:kv}},exports.getCustomUrlsBySettings=Mt,exports.getQrScannerWorkerPath=_s,exports.getSDKVersion=function(){return"5.14.12"},exports.handleApiCheckReadIdCard=_w,exports.preloadEKYCResources=Vw,exports.readIdCardFromImage=jw,exports.readQRFromFrontImage=Wb,exports.requestMotionPermission=Es,exports.useDeviceMotion=Ss,exports.useLivenessDetection=zw,exports.useMainProcessQRCodeScanner=iC,exports.useMainProcessReadIdCard=cb,exports.useSettingsReadIdCard=dw,exports.useShowPopup=py,exports.warmUpQRCodeScanner=Xy,exports.warmUpReadIdCard=rb,exports.warmupSelfieActive=Pf;