@tsocial/tvweb-sdk.lotte 0.0.0-beta.1729481098436 → 0.0.0-beta.1729497130610

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.
@@ -34,7 +34,7 @@ function(e){var t=r,n=t.lib,i=n.WordArray,a=n.Hasher,o=t.algo,s=i.create([0,1,2,
34
34
  * derived from CryptoJS.mode.CTR
35
35
  * Jan Hruby jhruby.web@gmail.com
36
36
  */
37
- (r=oW).mode.CTRGladman=function(){var e=r.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function n(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var i=e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),n(o);var s=o.slice(0);r.encryptBlock(s,0);for(var u=0;u<i;u++)e[t+u]^=s[u]}});return e.Decryptor=i,e}(),r.mode.CTRGladman)})),Xx((function(e,t){var r,n,i;e.exports=((i=oW).mode.OFB=(n=(r=i.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,a=this._keystream;i&&(a=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(a,0);for(var o=0;o<n;o++)e[t+o]^=a[o]}}),r.Decryptor=n,r),i.mode.OFB)})),Xx((function(e,t){var r,n;e.exports=((n=oW).mode.ECB=((r=n.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),r.Decryptor=r.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),r),n.mode.ECB)})),Xx((function(e,t){var r;e.exports=((r=oW).pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,a=r+i-1;e.clamp(),e.words[a>>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)})),Xx((function(e,t){var r;e.exports=((r=oW).pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)})),Xx((function(e,t){var r;e.exports=((r=oW).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)})),Xx((function(e,t){var r;e.exports=((r=oW).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},r.pad.ZeroPadding)})),Xx((function(e,t){var r;e.exports=((r=oW).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)})),Xx((function(e,t){var r;e.exports=(r=oW,function(e){var t=r,n=t.lib.CipherParams,i=t.enc.Hex;t.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return n.create({ciphertext:t})}}}(),r.format.Hex)})),Xx((function(e,t){var r;e.exports=(r=oW,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],a=[],o=[],s=[],u=[],c=[],l=[],d=[],p=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var m=n^n<<1^n<<2^n<<3^n<<4;m=m>>>8^255&m^99,i[r]=m,a[m]=r;var h=e[r],v=e[h],b=e[v],y=257*e[m]^16843008*m;o[r]=y<<24|y>>>8,s[r]=y<<16|y>>>16,u[r]=y<<8|y>>>24,c[r]=y,y=16843009*b^65537*v^257*h^16843008*r,l[m]=y<<24|y>>>8,d[m]=y<<16|y>>>16,p[m]=y<<8|y>>>24,f[m]=y,r?(r=h^e[e[e[b^h]]],n^=e[e[n]]):r=n=1}}();var m=[0,1,2,4,8,16,32,64,128,27,54],h=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),a=this._keySchedule=[],o=0;o<n;o++)o<r?a[o]=t[o]:(c=a[o-1],o%r?r>6&&o%r==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=m[o/r|0]<<24),a[o]=a[o-r]^c);for(var s=this._invKeySchedule=[],u=0;u<n;u++){if(o=n-u,u%4)var c=a[o];else c=a[o-4];s[u]=u<4||o<=4?c:l[i[c>>>24]]^d[i[c>>>16&255]]^p[i[c>>>8&255]]^f[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,s,u,c,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,d,p,f,a),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,o,s){for(var u=this._nRounds,c=e[t]^r[0],l=e[t+1]^r[1],d=e[t+2]^r[2],p=e[t+3]^r[3],f=4,m=1;m<u;m++){var h=n[c>>>24]^i[l>>>16&255]^a[d>>>8&255]^o[255&p]^r[f++],v=n[l>>>24]^i[d>>>16&255]^a[p>>>8&255]^o[255&c]^r[f++],b=n[d>>>24]^i[p>>>16&255]^a[c>>>8&255]^o[255&l]^r[f++],y=n[p>>>24]^i[c>>>16&255]^a[l>>>8&255]^o[255&d]^r[f++];c=h,l=v,d=b,p=y}h=(s[c>>>24]<<24|s[l>>>16&255]<<16|s[d>>>8&255]<<8|s[255&p])^r[f++],v=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[p>>>8&255]<<8|s[255&c])^r[f++],b=(s[d>>>24]<<24|s[p>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^r[f++],y=(s[p>>>24]<<24|s[c>>>16&255]<<16|s[l>>>8&255]<<8|s[255&d])^r[f++],e[t]=h,e[t+1]=v,e[t+2]=b,e[t+3]=y},keySize:8});e.AES=t._createHelper(h)}(),r.AES)})),Xx((function(e,t){var r;e.exports=(r=oW,function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,a=e.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=o[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){var c=i[a]=[],l=u[a];for(r=0;r<24;r++)c[r/6|0]|=t[(s[r]-1+l)%28]<<31-r%6,c[4+(r/6|0)]|=t[28+(s[r+24]-1+l)%28]<<31-r%6;for(c[0]=c[0]<<1|c[0]>>>31,r=1;r<7;r++)c[r]=c[r]>>>4*(r-1)+3;c[7]=c[7]<<5|c[7]>>>27}var d=this._invSubKeys=[];for(r=0;r<16;r++)d[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],p.call(this,4,252645135),p.call(this,16,65535),f.call(this,2,858993459),f.call(this,8,16711935),p.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],a=this._lBlock,o=this._rBlock,s=0,u=0;u<8;u++)s|=c[u][((o^i[u])&l[u])>>>0];this._lBlock=o,this._rBlock=a^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,p.call(this,1,1431655765),f.call(this,8,16711935),f.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function p(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function f(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=i._createHelper(d);var m=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(m)}(),r.TripleDES)})),Xx((function(e,t){var r;e.exports=(r=oW,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var a=0;i<256;i++){var o=i%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+n[i]+s)%256;var u=n[i];n[i]=n[a],n[a]=u}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var a=e[t];e[t]=e[r],e[r]=a,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var o=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});e.RC4Drop=t._createHelper(o)}(),r.RC4)})),Xx((function(e,t){var r;e.exports=(r=oW,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],a=[],o=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)u.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=c>>>16|4294901760&l,p=l<<16|65535&c;for(i[0]^=c,i[1]^=d,i[2]^=l,i[3]^=p,i[4]^=c,i[5]^=d,i[6]^=l,i[7]^=p,r=0;r<4;r++)u.call(this)}},_doProcessBlock:function(e,t){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=u^c}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)})),Xx((function(e,t){var r;e.exports=(r=oW,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],a=[],o=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)u.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=c>>>16|4294901760&l,p=l<<16|65535&c;for(n[0]^=c,n[1]^=d,n[2]^=l,n[3]^=p,n[4]^=c,n[5]^=d,n[6]^=l,n[7]^=p,i=0;i<4;i++)u.call(this)}},_doProcessBlock:function(e,t){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=u^c}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)})),Xx((function(e,t){e.exports=oW}))),uW=function(e){var t=e.blob;return new Promise((function(e){var r=new FileReader;r.onload=function(t){var r=t.target.result,n=sW.MD5(sW.lib.WordArray.create(r)).toString();e(n)},r.readAsArrayBuffer(t)}))},cW=Object.freeze({__proto__:null,MD5:uW,base64ToMD5:function(e){var t=e.base64;return sW.MD5(t).toString()}}),lW=["tracking"],dW=JK(),pW=db.createContext(),fW={enable:!1,accessKey:"",secretKey:"",apiUrl:"",userId:""},mW=function(){var e=Mx(qx().mark((function e(t){var r,n,i,a,o,s,u,c,l,d,p,f,m,h;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.tag,n=t.event,i=t.log,a=tW(new Date),o=i,e.t0=n,e.next="sdk_mode.read_id_card_one_side"===e.t0?6:"sdk_mode.liveness"===e.t0?19:36;break;case 6:return o=HK(i),s=i.result_object,e.next=10,uW({blob:s.image.blob});case 10:if(e.t1=e.sent,o.result_object.image={blob:e.t1},delete o.result_object.recordedVideos,!s.qrScannedResult){e.next=18;break}return e.next=16,uW({blob:s.qrScannedResult.image.blob});case 16:o.result_object.qrScannedResult.image.blob=e.sent,delete o.result_object.qrScannedResult.recordedVideos;case 18:return e.abrupt("break",36);case 19:return o=HK(i),u=i.result_object,c=u.steps,l=u.frontalFaces,d=u.frontalScaledImage,p=c.map((function(e){return uW({blob:e.image.blob})})),e.next=24,Promise.all(p);case 24:return f=e.sent,c.forEach((function(e,t){o.result_object.steps[t].image.blob=f[t]})),m=l.map((function(e){return uW({blob:e})})),e.next=29,Promise.all(m);case 29:if(h=e.sent,l.forEach((function(e,t){o.result_object.frontalFaces[t]=h[t]})),!d){e.next=35;break}return e.next=34,uW({blob:d});case 34:o.result_object.frontalScaledImage=e.sent;case 35:return e.abrupt("break",36);case 36:return e.abrupt("return",{tag:r,event:n,log:gx({device_time:a},o)});case 37:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function hW(e){var t,r=e.userId;if(r)t=r;else{var n=iW("tv:user-id");if(n)t=n;else{var i=YK();t=i,nW(i,"tv:user-id")}}return t}function vW(e){var t=e.value,r=e.children,n=t.tracking,i=void 0===n?fW:n,a=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,lW),o=i.enable,s=void 0!==o&&o,u=i.accessKey,c=i.secretKey,l=i.apiUrl,d=i.userId,p=i.logSignature,f=db.useCallback((function(e,t){if(p&&3===Object.keys(p).length){var r=p.timestamp,n=p.signature,i=p.logUrl;return fetch(i,{method:"POST",headers:gx({"X-TV-Timestamp":r,Authorization:n,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}if(s){if(!l||!u||!c)return console.warn("apiUrl, accessKey and secretKey are required when tracking is enabled"),null;var a=new NK(u,c,l).httpClient.authorizer.getHeaders({requestPath:"/v1/log_events",method:"POST"});return fetch("".concat(l,"/v1/log_events"),{method:"POST",headers:gx({"X-TV-Timestamp":a["X-TV-Timestamp"],Authorization:a.Authorization,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}return null}),[p,s,l,u,c]),m=db.useMemo((function(){return{"x-request-id":hW({userId:d})}}),[d]),h=db.useCallback(Mx(qx().mark((function e(){var t,r,n,i,a,o,u=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},r=t.tag,n=t.event,i=t.log,a=void 0===i?{}:i,!s){e.next=11;break}return e.prev=2,e.next=5,mW({tag:r,event:n,log:a});case 5:o=e.sent,f(o,gx(gx({},m),dW)),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:case"end":return e.stop()}}),e,null,[[2,9]])}))),[f,m,s]);return db.createElement(pW.Provider,{value:gx(gx({},a),{},{sendEvent:h})},r)}vW.propTypes={value:Tb.shape({tracking:Tb.shape({enable:Tb.bool,accessKey:Tb.string,secretKey:Tb.string,apiUrl:Tb.string,userId:Tb.string})}).isRequired,children:Tb.node.isRequired};var bW,yW,gW,qW,AW,IW,SW,MW,kW,CW,zW,ZW,wW,xW,EW,OW,KW,WW,VW,TW,LW=Object.freeze({__proto__:null,defaultTrackingConfig:fW,getXRequestId:hW,SDKTrackingProvider:vW,useSDKTracking:function(){var e=db.useContext(pW);return db.useMemo((function(){return void 0===e?(console.warn("useSDKTracking must be used within a SDKTrackingProvider"),{sendEvent:function(){}}):e}),[e])}}),NW=(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(AW={not_supported:"Camera không được hỗ trợ. Vui lòng thử trình duyệt hoặc thiết bị khác.",camera_timeout:"Không thể truy cập camera. Vui lòng kiểm tra quyền truy cập camera, đóng các tab/app khác đang sử dụng camera hoặc thử lại trên trình duyệt/thiết bị khác.",wrong_orientation:"Bạn đang sử dụng chế độ màn hình xoay ngang. Vui lòng quay màn hình theo chiều dọc và thực hiện lại.",unable_to_load_model:"Không thể load model. Vui lòng thử trình duyệt hoặc thiết bị khác.",no_permission:"Vui lòng cấp quyền để truy cập camera.",no_face:"Không tìm thấy khuôn mặt",partial_face:"Không tìm thấy toàn bộ khuôn mặt",multiple_faces:"Quá nhiều khuôn mặt",face_too_small:"Khuôn mặt quá nhỏ",face_too_large:"Khuôn mặt quá to",face_out_of_box:"Khuôn mặt không nằm trọn vẹn trong khung ảnh",liveness_too_fast:"Vui lòng quay CHẬM lại",liveness_terminated:"Vui lòng thực hiện lại.",liveness_terminated_face_tracking:"Bạn cần quay CHẬM lại.\nVui lòng thực hiện lại.",liveness_terminated_no_face:"Khuôn mặt không nằm trong khung hình.\nXin vui lòng thử lại.",liveness_terminated_time_out:"Bạn cần hoàn thành động tác theo chỉ dẫn trong <%= x %> giây.\nXin vui lòng thử lại.",card_sanity_not_good:"Card sanity chưa đạt",api_call_error:"Lỗi call api",upload_error:"Lỗi upload",sanity_check_error:"Lỗi check sanity",read_id_card_error:"Lỗi read id card",detect_id_tampering_error:"Lỗi detect id tampering",detect_id_card_error:"Không thể detect id card type",missing_front_id_card:"Không tìm thấy front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Vui lòng đặt giấy tờ thẳng, không bị nghiêng khi chụp",id_detector_no_cards:"Vui lòng chụp mặt <%= side %> của giấy tờ\n (chiếm 50-95% khung hình)",id_detector_card_too_small:"Vui lòng đưa giấy tờ lại GẦN hơn\n (chiếm 50-95% khung hình)",id_detector_error_incomplete:"Vui lòng đưa giấy tờ ra XA hơn\n (chiếm 50-95% khung hình)",glare_detected:"Ảnh bị chói / lóa. Vui lòng điều chỉnh góc chụp.",id_detector_error_front_side_no_faces:"Vui lòng chụp mặt trước của giấy tờ",id_detector_error_front_side_multiple_faces:"Vui lòng chụp mặt trước 1 giấy tờ duy nhất",id_detector_error_back_side_has_faces:"Vui lòng chụp mặt sau của giấy tờ",id_detector_error_blur:"Ảnh bị mờ. Vui lòng chụp lại để có ảnh rõ nét hơn",not_frontal_face:"Vui lòng nhìn thẳng vào camera.",not_readable:"Camera đang được sử dụng bởi ứng dụng/tab khác.",close_eye:"Vui lòng mở to mắt",front_card_title:"Mặt trước CMND/CCCD",back_card_title:"Mặt sau CMND/CCCD",qr_title:"Quét mã QR trên CCCD",front_card_description:"Vui lòng đặt CMND mặt trước vào trong khung",back_card_description:"Vui lòng đặt CMND mặt sau vào trong khung",btn_ok:"Tôi đã hiểu",front:"trước",back:"sau",btn_use_this_picture:"Dùng ảnh này",btn_try_again:"Thử lại",confirm_popup_valid_qr:"Đã quét được mã QR",confirm_popup_invalid_qr:"Không quét được mã QR",remaining_time:"Thời gian còn lại: <%= x %> giây",timeout_instruction:"Bạn cần hoàn thành việc chụp giấy tờ trong <%= x %> giây.\nVui lòng thử lại.",warmup_intro:"Đang khởi động, vui lòng chờ trong giây lát..."},null==bx||null===(bW=hx)||void 0===bW?void 0:bW.LEFT,"Quay mặt chậm qua trái"),null==bx||null===(yW=hx)||void 0===yW?void 0:yW.RIGHT,"Quay mặt chậm qua phải"),null==bx||null===(gW=hx)||void 0===gW?void 0:gW.UP,"Ngước mặt chậm lên trên"),null==bx||null===(qW=hx)||void 0===qW?void 0:qW.FRONTAL,"Nhìn thẳng camera"),"qr_instructions_text","Vui lòng quét mã QR theo hướng dẫn sau:\n Đư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","Tiến hành quét mã QR"),"qr_instructions_countdown","Bắt đầu trong <%= x %> giây"),"qr_invalid_popup_title","QR không hợp lệ"),"qr_invalid_popup_description","Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR code trên CCCD thật"),"qr_invalid_popup_retry_button","Quét lại QR (trên CCCD)"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(AW,"qr_invalid_popup_skip_button","Bỏ qua"),"qr_tooltip","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"),"session_timeout_popup_description","Quá thời gian quét. Vui lòng thực hiện lại.\n Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và 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","Thử lại"),"session_timeout_popup_skip_button","Bỏ qua"),"flash_liveness.title","Xác thực khuôn mặt"),"flash_liveness.instruction.far_step","Đưa mặt vào khung"),"flash_liveness.instruction.close_step","Đưa mặt lại gần"),"flash_liveness.instruction.flash_step","Giữ yên"),"flash_liveness.error.no_face","Không tìm thấy khuôn mặt"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(AW,"flash_liveness.processing","Đang xử lý kết quả"),"flash_liveness.error.partial_face","Đưa khuôn mặt vào giữa hình oval"),"flash_liveness.error.face_too_small","Đưa khuôn mặt lại gần một chút"),"flash_liveness.error.face_too_large","Đưa khuôn mặt ra xa một chút"),"flash_liveness.error.close_eye","Vui lòng mở to mắt"),"flash_liveness.error.face_not_frontal","Vui lòng đưa thiết bị ngang tầm mắt"),"flash_liveness.error.multiple_faces","Có nhiều mặt trong khung hình"),"flash_liveness.error.face_too_high","Đưa khuôn mặt xuống một chút"),"flash_liveness.error.face_too_blurry","Ảnh bị mờ, vui lòng giữ yên điện thoại"),"flash_liveness.error.face_not_qualified","Vui lòng không đeo kiếng, khẩu trang, hay để mặt bị che"),Zx(Zx(Zx(Zx(AW,"flash_liveness.timeout.remaining","Thời gian còn lại: <%= remain %> giây"),"flash_liveness.timeout.expired","Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại."),"flash_liveness.error.face_too_bright","Khuôn mặt quá sáng. Vui lòng điều chỉnh để có ánh sáng phù hợp."),"flash_liveness.error.face_too_dark","Khuôn mặt quá tối. Vui lòng điều chỉnh để có ánh sáng tốt hơn.")),PW=(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(CW={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",qr_title:"Scan QR code on ID card",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bx||null===(IW=hx)||void 0===IW?void 0:IW.LEFT,"Turn your face to the left"),null==bx||null===(SW=hx)||void 0===SW?void 0:SW.RIGHT,"Turn your face to the right"),null==bx||null===(MW=hx)||void 0===MW?void 0:MW.UP,"Turn your face up"),null==bx||null===(kW=hx)||void 0===kW?void 0:kW.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(CW,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(CW,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),Zx(Zx(Zx(Zx(CW,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),jW=(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(EW={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",qr_title:"Scan QR code on ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bx||null===(zW=hx)||void 0===zW?void 0:zW.LEFT,"Turn your face to the left"),null==bx||null===(ZW=hx)||void 0===ZW?void 0:ZW.RIGHT,"Turn your face to the right"),null==bx||null===(wW=hx)||void 0===wW?void 0:wW.UP,"Turn your face up"),null==bx||null===(xW=hx)||void 0===xW?void 0:xW.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(EW,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(EW,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),Zx(Zx(Zx(Zx(EW,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),RW=(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(TW={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",qr_title:"Scan QR code on ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bx||null===(OW=hx)||void 0===OW?void 0:OW.LEFT,"Turn your face to the left"),null==bx||null===(KW=hx)||void 0===KW?void 0:KW.RIGHT,"Turn your face to the right"),null==bx||null===(WW=hx)||void 0===WW?void 0:WW.UP,"Turn your face up"),null==bx||null===(VW=hx)||void 0===VW?void 0:VW.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(TW,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(TW,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),Zx(Zx(Zx(Zx(TW,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),XW=db.createContext(NW),BW=function(e){var t=e.value,r=e.children,n=t.lang,i=void 0===n?"vi":n,a=t.country,o=void 0===a?"vn":a,s=t.customTexts,u=void 0===s?{}:s,c=db.useMemo((function(){var e=Object.assign({},function(e,t){return"vn"===t?"vi"===e?NW:PW:"ph"===t?jW:"in"===t?RW:NW}(i,o));return Object.keys(u).length>0&&Object.keys(u).forEach((function(t){var r,n,a,o=(null===(n=null===(r=null==u?void 0:u[t])||void 0===r?void 0:r.msg)||void 0===n?void 0:n[i])||(null===(a=null==u?void 0:u[t])||void 0===a?void 0:a[i])||(null==u?void 0:u[t]);e[t]=o})),e}),[o,u,i]);return db.createElement(XW.Provider,{value:c},r)},GW={};function YW(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:GW,t=db.useContext(XW);return void 0===t&&console.error("useSDKLocale must be used within a SDKLocaleProvider"),db.useMemo((function(){return Object.assign(Object.assign({},t),e)}),[t,e])}var HW=Object.freeze({__proto__:null,SDKLocaleProvider:BW,useSDKLocale:YW});function FW(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))}function UW(e,t){return e&&!e.endsWith("/")?[e,"/",t].join(""):[e,t].join("")}function DW(){var e=WK();return null==e?void 0:e.assetRoot}function JW(e){return UW(DW(),e)}var QW=Object.freeze({__proto__:null,getAsset:UW,useAssetRoot:DW,useAsset:JW}),_W=db.createContext({}),$W=function(e){var t=e.children,r=e.mode,n=WK(),i=n.enableVoice,a=function(e,t){var r=JW("audio/".concat(t,"/move_face_into_frame.mp3")),n=JW("audio/".concat(t,"/move_face_closer.mp3")),i=JW("audio/".concat(t,"/please_hold_still.mp3")),a=JW("audio/".concat(t,"/keep_front_id_fit_border.mp3")),o=JW("audio/".concat(t,"/keep_back_id_fit_border.mp3"));return db.useMemo((function(){switch(e){case"flash":return{move_face_into_frame:r,move_face_closer:n,please_hold_still:i};case"id_card":return{keep_front_id_fit_border:a,keep_back_id_fit_border:o};default:return{}}}),[i,o,a,e,n,r])}(r,n.lang),o=xx(db.useState({}),2),s=o[0],u=o[1];return db.useEffect((function(){var e;i&&(e=a,FW(void 0,void 0,void 0,qx().mark((function t(){var r,n;return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("object"===Ix(e)&&0!==Object.values(e).length){t.next=2;break}return t.abrupt("return",{});case 2:return r=Object.entries(e).reduce((function(e,t){var r=xx(t,2),n=r[0],i=r[1];return e[n]=new Audio(i),e}),{}),n=Object.values(r).map((function(e){return new Promise((function(t,r){e.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA?t():(e.addEventListener("suspend",(function(){console.warn("Audio loading suspended. Audio might not play smoothly."),t()})),e.addEventListener("canplay",(function(){t()})),e.addEventListener("canplaythrough",(function(){t()})),e.addEventListener("error",(function(t){if(null===e.error)return console.error("An unknown error occurred."),void r(t);switch(e.error.code){case MediaError.MEDIA_ERR_ABORTED:console.error("The fetching process for the media resource was aborted by the user agent at the user's request.");break;case MediaError.MEDIA_ERR_NETWORK:console.error("A network error caused the audio download to fail.");break;case MediaError.MEDIA_ERR_DECODE:console.error("The media data could not be decoded.");break;case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:console.error("The media resource indicated by the src attribute was not suitable.");break;default:console.error("An unknown error occurred.")}r(t)})))}))})),t.next=6,Promise.all(n);case 6:return t.abrupt("return",r);case 7:case"end":return t.stop()}}),t)})))).then(u).catch((function(e){console.error("Error initializing audio:",e)}))}),[i,a]),db.createElement(_W.Provider,{value:s},t)},eV=Object.freeze({__proto__:null,VoiceProvider:$W,useVoicePlayer:function(){var e=db.useContext(_W),t=db.useRef(null);return{playVoice:db.useCallback((function(r){try{if(r===t.current&&!e[r].ended)return;if(t.current){var n=e[t.current];n.pause(),n.currentTime=0}var i=e[r];if(i instanceof HTMLAudioElement==0)return;i.play(),t.current=r}catch(e){console.error("Error playing audio:",e)}}),[e])}}}),tV=db.createContext(null),rV=function(e){var t=e.children,r=db.useRef(null),n=db.useRef(null);return db.useEffect((function(){var e,t;return window.Accelerometer&&((e=new Accelerometer({frequency:10})).addEventListener("reading",(function(){r.current={x:e.x,y:e.y,z:e.z}})),e.start()),window.Gyroscope&&((t=new Gyroscope({frequency:10})).addEventListener("reading",(function(){n.current={x:t.x,y:t.y,z:t.z}})),t.start()),function(){e&&e.stop(),t&&t.stop()}}),[]),db.createElement(tV.Provider,{value:{getAccelerometer:function(){return r.current},getGyroscope:function(){return n.current}}},t)};rV.propTypes={children:Tb.node},rV.defaultProps={children:null};var nV=Object.freeze({__proto__:null,useSensors:function(){return db.useContext(tV)},SensorsProvider:rV});function iV(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))}var aV={401:"invalid_license_exception",400:"invalid_parameter_exception",429:"rate_limit_exception",500:"internal_server_error",unknown:"unknown_license_error",invalid_license:"invalid_license",invalid_app_id:"invalid_app_id",invalid_date:"invalid_date",license_expired:"license_expired",invalid_signature:"invalid_signature",missing_url:"missing_url"};function oV(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function sV(e){var t,r="",n=0,i=0;for(t=0;t<e.length&&"="!==e.charAt(t);++t){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t));a<0||(0===n?(r+=oV(a>>2),i=3&a,n=1):1===n?(r+=oV(i<<2|a>>4),i=15&a,n=2):2===n?(r+=oV(i),r+=oV(a>>2),i=3&a,n=3):(r+=oV(i<<2|a>>4),r+=oV(15&a),n=0))}return 1===n&&(r+=oV(i<<2)),r}function uV(e){for(var t="",r=0;r<e.length;r+=2){var n=e.slice(r,r+2),i=parseInt(n,16);t+=String.fromCharCode(i)}return t}var cV=function(e){var t=xx(uV(sV(e)).split(";;"),4),r=t[1];return{mode:"offline"!==r&&"online"!==r?"offline":r,license:t[2],signature:t[3]}},lV="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function dV(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var pV=function(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}(Object.freeze({__proto__:null,default:{}})),fV=dV((function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==Ix(e)?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:pV.Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o<a;o++){var s=e.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==Ix(e)&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==Ix(e))return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===n)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===n)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=s(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=s(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,c=0,l=r;l<s;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var d=1;for(c=u(e,l,e.length,t),l=0;l<o;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var l=u>>>26,d=67108863&u,p=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=p;f++){var m=c-f|0;l+=(o=(i=0|e.words[m])*(a=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<i|a)).toString(16);n=0!=(a=s>>>24-i&16777215)||o!==this.length-1?c[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var p=l[e],f=d[e];n="";var m=this.clone();for(m.negative=0;!m.isZero();){var h=m.modn(f).toString(e);n=(m=m.idivn(f)).isZero()?h+n:c[p-h.length]+h+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===t,c=new e(a),l=this.clone();if(u){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),c[a-s-1]=o}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o<n.length;o++)a=(t=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,r){var n,i,a,o=e.words,s=t.words,u=r.words,c=0,l=0|o[0],d=8191&l,p=l>>>13,f=0|o[1],m=8191&f,h=f>>>13,v=0|o[2],b=8191&v,y=v>>>13,g=0|o[3],q=8191&g,A=g>>>13,I=0|o[4],S=8191&I,M=I>>>13,k=0|o[5],C=8191&k,z=k>>>13,Z=0|o[6],w=8191&Z,x=Z>>>13,E=0|o[7],O=8191&E,K=E>>>13,W=0|o[8],V=8191&W,T=W>>>13,L=0|o[9],N=8191&L,P=L>>>13,j=0|s[0],R=8191&j,X=j>>>13,B=0|s[1],G=8191&B,Y=B>>>13,H=0|s[2],F=8191&H,U=H>>>13,D=0|s[3],J=8191&D,Q=D>>>13,_=0|s[4],$=8191&_,ee=_>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,pe=le>>>13,fe=0|s[9],me=8191&fe,he=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ve=(c+(n=Math.imul(d,R))|0)+((8191&(i=(i=Math.imul(d,X))+Math.imul(p,R)|0))<<13)|0;c=((a=Math.imul(p,X))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(m,R),i=(i=Math.imul(m,X))+Math.imul(h,R)|0,a=Math.imul(h,X);var be=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(p,G)|0))<<13)|0;c=((a=a+Math.imul(p,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,R),i=(i=Math.imul(b,X))+Math.imul(y,R)|0,a=Math.imul(y,X),n=n+Math.imul(m,G)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(h,G)|0,a=a+Math.imul(h,Y)|0;var ye=(c+(n=n+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,U)|0)+Math.imul(p,F)|0))<<13)|0;c=((a=a+Math.imul(p,U)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(q,R),i=(i=Math.imul(q,X))+Math.imul(A,R)|0,a=Math.imul(A,X),n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(y,G)|0,a=a+Math.imul(y,Y)|0,n=n+Math.imul(m,F)|0,i=(i=i+Math.imul(m,U)|0)+Math.imul(h,F)|0,a=a+Math.imul(h,U)|0;var ge=(c+(n=n+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,Q)|0)+Math.imul(p,J)|0))<<13)|0;c=((a=a+Math.imul(p,Q)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(S,R),i=(i=Math.imul(S,X))+Math.imul(M,R)|0,a=Math.imul(M,X),n=n+Math.imul(q,G)|0,i=(i=i+Math.imul(q,Y)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,Y)|0,n=n+Math.imul(b,F)|0,i=(i=i+Math.imul(b,U)|0)+Math.imul(y,F)|0,a=a+Math.imul(y,U)|0,n=n+Math.imul(m,J)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(h,J)|0,a=a+Math.imul(h,Q)|0;var qe=(c+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(p,$)|0))<<13)|0;c=((a=a+Math.imul(p,ee)|0)+(i>>>13)|0)+(qe>>>26)|0,qe&=67108863,n=Math.imul(C,R),i=(i=Math.imul(C,X))+Math.imul(z,R)|0,a=Math.imul(z,X),n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,G)|0,a=a+Math.imul(M,Y)|0,n=n+Math.imul(q,F)|0,i=(i=i+Math.imul(q,U)|0)+Math.imul(A,F)|0,a=a+Math.imul(A,U)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(h,$)|0,a=a+Math.imul(h,ee)|0;var Ae=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(p,re)|0))<<13)|0;c=((a=a+Math.imul(p,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(w,R),i=(i=Math.imul(w,X))+Math.imul(x,R)|0,a=Math.imul(x,X),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(z,G)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(S,F)|0,i=(i=i+Math.imul(S,U)|0)+Math.imul(M,F)|0,a=a+Math.imul(M,U)|0,n=n+Math.imul(q,J)|0,i=(i=i+Math.imul(q,Q)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Q)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(h,re)|0,a=a+Math.imul(h,ne)|0;var Ie=(c+(n=n+Math.imul(d,ae)|0)|0)+((8191&(i=(i=i+Math.imul(d,oe)|0)+Math.imul(p,ae)|0))<<13)|0;c=((a=a+Math.imul(p,oe)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(O,R),i=(i=Math.imul(O,X))+Math.imul(K,R)|0,a=Math.imul(K,X),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,Y)|0,n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,U)|0)+Math.imul(z,F)|0,a=a+Math.imul(z,U)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Q)|0,n=n+Math.imul(q,$)|0,i=(i=i+Math.imul(q,ee)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0,n=n+Math.imul(m,ae)|0,i=(i=i+Math.imul(m,oe)|0)+Math.imul(h,ae)|0,a=a+Math.imul(h,oe)|0;var Se=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(p,ue)|0))<<13)|0;c=((a=a+Math.imul(p,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(V,R),i=(i=Math.imul(V,X))+Math.imul(T,R)|0,a=Math.imul(T,X),n=n+Math.imul(O,G)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(K,G)|0,a=a+Math.imul(K,Y)|0,n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,U)|0)+Math.imul(x,F)|0,a=a+Math.imul(x,U)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Q)|0)+Math.imul(z,J)|0,a=a+Math.imul(z,Q)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,n=n+Math.imul(q,re)|0,i=(i=i+Math.imul(q,ne)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,oe)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(h,ue)|0,a=a+Math.imul(h,ce)|0;var Me=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,pe)|0)+Math.imul(p,de)|0))<<13)|0;c=((a=a+Math.imul(p,pe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(N,R),i=(i=Math.imul(N,X))+Math.imul(P,R)|0,a=Math.imul(P,X),n=n+Math.imul(V,G)|0,i=(i=i+Math.imul(V,Y)|0)+Math.imul(T,G)|0,a=a+Math.imul(T,Y)|0,n=n+Math.imul(O,F)|0,i=(i=i+Math.imul(O,U)|0)+Math.imul(K,F)|0,a=a+Math.imul(K,U)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Q)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ne)|0,n=n+Math.imul(q,ae)|0,i=(i=i+Math.imul(q,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,ce)|0,n=n+Math.imul(m,de)|0,i=(i=i+Math.imul(m,pe)|0)+Math.imul(h,de)|0,a=a+Math.imul(h,pe)|0;var ke=(c+(n=n+Math.imul(d,me)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(p,me)|0))<<13)|0;c=((a=a+Math.imul(p,he)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,G),i=(i=Math.imul(N,Y))+Math.imul(P,G)|0,a=Math.imul(P,Y),n=n+Math.imul(V,F)|0,i=(i=i+Math.imul(V,U)|0)+Math.imul(T,F)|0,a=a+Math.imul(T,U)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(K,J)|0,a=a+Math.imul(K,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,a=a+Math.imul(x,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ne)|0,n=n+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,n=n+Math.imul(q,ue)|0,i=(i=i+Math.imul(q,ce)|0)+Math.imul(A,ue)|0,a=a+Math.imul(A,ce)|0,n=n+Math.imul(b,de)|0,i=(i=i+Math.imul(b,pe)|0)+Math.imul(y,de)|0,a=a+Math.imul(y,pe)|0;var Ce=(c+(n=n+Math.imul(m,me)|0)|0)+((8191&(i=(i=i+Math.imul(m,he)|0)+Math.imul(h,me)|0))<<13)|0;c=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,U))+Math.imul(P,F)|0,a=Math.imul(P,U),n=n+Math.imul(V,J)|0,i=(i=i+Math.imul(V,Q)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,Q)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(K,$)|0,a=a+Math.imul(K,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(x,re)|0,a=a+Math.imul(x,ne)|0,n=n+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,a=a+Math.imul(M,ce)|0,n=n+Math.imul(q,de)|0,i=(i=i+Math.imul(q,pe)|0)+Math.imul(A,de)|0,a=a+Math.imul(A,pe)|0;var ze=(c+(n=n+Math.imul(b,me)|0)|0)+((8191&(i=(i=i+Math.imul(b,he)|0)+Math.imul(y,me)|0))<<13)|0;c=((a=a+Math.imul(y,he)|0)+(i>>>13)|0)+(ze>>>26)|0,ze&=67108863,n=Math.imul(N,J),i=(i=Math.imul(N,Q))+Math.imul(P,J)|0,a=Math.imul(P,Q),n=n+Math.imul(V,$)|0,i=(i=i+Math.imul(V,ee)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(K,re)|0,a=a+Math.imul(K,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(z,ue)|0,a=a+Math.imul(z,ce)|0,n=n+Math.imul(S,de)|0,i=(i=i+Math.imul(S,pe)|0)+Math.imul(M,de)|0,a=a+Math.imul(M,pe)|0;var Ze=(c+(n=n+Math.imul(q,me)|0)|0)+((8191&(i=(i=i+Math.imul(q,he)|0)+Math.imul(A,me)|0))<<13)|0;c=((a=a+Math.imul(A,he)|0)+(i>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,ee))+Math.imul(P,$)|0,a=Math.imul(P,ee),n=n+Math.imul(V,re)|0,i=(i=i+Math.imul(V,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,oe)|0)+Math.imul(K,ae)|0,a=a+Math.imul(K,oe)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,a=a+Math.imul(x,ce)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,pe)|0)+Math.imul(z,de)|0,a=a+Math.imul(z,pe)|0;var we=(c+(n=n+Math.imul(S,me)|0)|0)+((8191&(i=(i=i+Math.imul(S,he)|0)+Math.imul(M,me)|0))<<13)|0;c=((a=a+Math.imul(M,he)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(N,re),i=(i=Math.imul(N,ne))+Math.imul(P,re)|0,a=Math.imul(P,ne),n=n+Math.imul(V,ae)|0,i=(i=i+Math.imul(V,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(K,ue)|0,a=a+Math.imul(K,ce)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,pe)|0)+Math.imul(x,de)|0,a=a+Math.imul(x,pe)|0;var xe=(c+(n=n+Math.imul(C,me)|0)|0)+((8191&(i=(i=i+Math.imul(C,he)|0)+Math.imul(z,me)|0))<<13)|0;c=((a=a+Math.imul(z,he)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,ae),i=(i=Math.imul(N,oe))+Math.imul(P,ae)|0,a=Math.imul(P,oe),n=n+Math.imul(V,ue)|0,i=(i=i+Math.imul(V,ce)|0)+Math.imul(T,ue)|0,a=a+Math.imul(T,ce)|0,n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,pe)|0)+Math.imul(K,de)|0,a=a+Math.imul(K,pe)|0;var Ee=(c+(n=n+Math.imul(w,me)|0)|0)+((8191&(i=(i=i+Math.imul(w,he)|0)+Math.imul(x,me)|0))<<13)|0;c=((a=a+Math.imul(x,he)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,ue),i=(i=Math.imul(N,ce))+Math.imul(P,ue)|0,a=Math.imul(P,ce),n=n+Math.imul(V,de)|0,i=(i=i+Math.imul(V,pe)|0)+Math.imul(T,de)|0,a=a+Math.imul(T,pe)|0;var Oe=(c+(n=n+Math.imul(O,me)|0)|0)+((8191&(i=(i=i+Math.imul(O,he)|0)+Math.imul(K,me)|0))<<13)|0;c=((a=a+Math.imul(K,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(N,de),i=(i=Math.imul(N,pe))+Math.imul(P,de)|0,a=Math.imul(P,pe);var Ke=(c+(n=n+Math.imul(V,me)|0)|0)+((8191&(i=(i=i+Math.imul(V,he)|0)+Math.imul(T,me)|0))<<13)|0;c=((a=a+Math.imul(T,he)|0)+(i>>>13)|0)+(Ke>>>26)|0,Ke&=67108863;var We=(c+(n=Math.imul(N,me))|0)+((8191&(i=(i=Math.imul(N,he))+Math.imul(P,me)|0))<<13)|0;return c=((a=Math.imul(P,he))+(i>>>13)|0)+(We>>>26)|0,We&=67108863,u[0]=ve,u[1]=be,u[2]=ye,u[3]=ge,u[4]=qe,u[5]=Ae,u[6]=Ie,u[7]=Se,u[8]=Me,u[9]=ke,u[10]=Ce,u[11]=ze,u[12]=Ze,u[13]=we,u[14]=xe,u[15]=Ee,u[16]=Oe,u[17]=Ke,u[18]=We,0!==c&&(u[19]=c,r.length++),r};function m(e,t,r){return(new h).mulp(e,t,r)}function h(e,t){this.x=e,this.y=t}Math.imul||(f=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?f(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,u=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=u;c++){var l=a-c,d=(0|e.words[l])*(0|t.words[c]),p=67108863&d;s=67108863&(p=p+s|0),i+=(o=(o=o+(d/67108864|0)|0)+(p>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):m(this,e,t)},h.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},h.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},h.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o<a;o++)n[o]=t[e[o]],i[o]=r[e[o]]},h.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var d=u,p=c,f=0;f<o;f++){var m=r[l+f],h=n[l+f],v=r[l+f+o],b=n[l+f+o],y=d*v-p*b;b=d*b+p*v,v=y,r[l+f]=m+v,n[l+f]=h+b,r[l+f+o]=m-v,n[l+f+o]=h-b,f!==s&&(y=u*d-c*p,p=u*p+c*d,d=y)}},h.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},h.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},h.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},h.prototype.convert13b=function(e,t,n,i){for(var a=0,o=0;o<t;o++)a+=0|e[o],n[2*o]=8191&a,a>>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<i;++o)n[o]=0;r(0===a),r(0==(-8192&a))},h.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},h.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),d=new Array(n),p=r.words;p.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,c,n),this.transform(o,a,s,u,n,i),this.transform(c,a,l,d,n,i);for(var f=0;f<n;f++){var m=s[f]*l[f]-u[f]*d[f];u[f]=s[f]*d[f]+u[f]*l[f],s[f]=m}return this.conjugate(s,u,n),this.transform(s,u,p,a,n,i),this.conjugate(p,a,n),this.normalize13b(p,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),m(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[n]=67108863&a}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,u=(0|this.words[t])-s<<n;this.words[t]=u|o,o=s>>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,u=n;if(i-=o,i=Math.max(0,i),u){for(var c=0;c<o;c++)u.words[c]=this.words[c];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-a|d>>>a,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,a,o=e.length+n;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&a}for(;i<this.length-n;i++)s=(a=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&a;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,o=0|a.words[a.length-1];0!=(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,u=n.length-a.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=n.clone()._ishlnsubmul(a,1,u);0===l.negative&&(n=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var p=67108864*(0|n.words[a.length+d])+(0|n.words[a.length+d-1]);for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(a,p,d);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=p)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var p=0,f=1;0==(t.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(l),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var m=0,h=1;0==(n.words[0]&h)&&m<26;++m,h<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s),o.isub(u)):(n.isub(t),s.isub(a),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,p=1;0==(n.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var a=i,o=n;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new I(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function q(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},n(y,b),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&r)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(g,b),n(q,b),n(A,b),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new g;else if("p192"===e)t=new q;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return v[e]=t,t},I.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);r(!a.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,a),p=this.pow(e,a.addn(1).iushrn(1)),f=this.pow(e,a),m=o;0!==f.cmp(s);){for(var h=f,v=0;0!==h.cmp(s);v++)h=h.redSqr();r(v<m);var b=this.pow(d,new i(1).iushln(m-v-1));p=p.redMul(b),d=b.redSqr(),f=f.redMul(d),m=v}return p},I.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},I.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4==++s||0===n&&0===l)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}u=26}return a},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,I),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,lV)})),mV=hV;function hV(e,t){if(!e)throw new Error(t||"Assertion failed")}hV.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var vV,bV=dV((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),a=i>>8,o=255&i;a?r.push(a,o):r.push(o)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),yV=dV((function(e,t){var r=t;r.assert=mV,r.toArray=bV.toArray,r.zero2=bV.zero2,r.toHex=bV.toHex,r.encode=bV.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,a=e.clone(),o=0;o<n.length;o++){var s,u=a.andln(i-1);a.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,a.isubn(s)):s=0,n[o]=s,a.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var o,s,u=e.andln(3)+i&3,c=t.andln(3)+a&3;3===u&&(u=-1),3===c&&(c=-1),o=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(o),s=0==(1&c)?0:3!=(n=t.andln(7)+a&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===o+1&&(i=1-i),2*a===s+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new fV(e,"hex","le")}})),gV=function(e){return vV||(vV=new qV(null)),vV.generate(e)};function qV(e){this.rand=e}var AV=qV;if(qV.prototype.generate=function(e){return this._rand(e)},qV.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==("undefined"==typeof self?"undefined":Ix(self)))self.crypto&&self.crypto.getRandomValues?qV.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?qV.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==("undefined"==typeof window?"undefined":Ix(window))&&(qV.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var IV=pV;if("function"!=typeof IV.randomBytes)throw new Error("Not supported");qV.prototype._rand=function(e){return IV.randomBytes(e)}}catch(gZ){}gV.Rand=AV;var SV=yV.getNAF,MV=yV.getJSF,kV=yV.assert;function CV(e,t){this.type=e,this.p=new fV(t.p,16),this.red=t.prime?fV.red(t.prime):fV.mont(this.p),this.zero=new fV(0).toRed(this.red),this.one=new fV(1).toRed(this.red),this.two=new fV(2).toRed(this.red),this.n=t.n&&new fV(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var zV=CV;function ZV(e,t){this.curve=e,this.type=t,this.precomputed=null}CV.prototype.point=function(){throw new Error("Not implemented")},CV.prototype.validate=function(){throw new Error("Not implemented")},CV.prototype._fixedNafMul=function(e,t){kV(e.precomputed);var r=e._getDoubles(),n=SV(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,o,s=[];for(a=0;a<n.length;a+=r.step){o=0;for(var u=a+r.step-1;u>=a;u--)o=(o<<1)+n[u];s.push(o)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(a=0;a<s.length;a++)(o=s[a])===d?l=l.mixedAdd(r.points[a]):o===-d&&(l=l.mixedAdd(r.points[a].neg()));c=c.add(l)}return c.toP()},CV.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=SV(t,r,this._bitLength),o=this.jpoint(null,null,null),s=a.length-1;s>=0;s--){for(var u=0;s>=0&&0===a[s];s--)u++;if(s>=0&&u++,o=o.dblp(u),s<0)break;var c=a[s];kV(0!==c),o="affine"===e.type?c>0?o.mixedAdd(i[c-1>>1]):o.mixedAdd(i[-c-1>>1].neg()):c>0?o.add(i[c-1>>1]):o.add(i[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},CV.prototype._wnafMulAdd=function(e,t,r,n,i){var a,o,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,d=0;for(a=0;a<n;a++){var p=(s=t[a])._getNAFPoints(e);u[a]=p.wnd,c[a]=p.points}for(a=n-1;a>=1;a-=2){var f=a-1,m=a;if(1===u[f]&&1===u[m]){var h=[t[f],null,null,t[m]];0===t[f].y.cmp(t[m].y)?(h[1]=t[f].add(t[m]),h[2]=t[f].toJ().mixedAdd(t[m].neg())):0===t[f].y.cmp(t[m].y.redNeg())?(h[1]=t[f].toJ().mixedAdd(t[m]),h[2]=t[f].add(t[m].neg())):(h[1]=t[f].toJ().mixedAdd(t[m]),h[2]=t[f].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=MV(r[f],r[m]);for(d=Math.max(b[0].length,d),l[f]=new Array(d),l[m]=new Array(d),o=0;o<d;o++){var y=0|b[0][o],g=0|b[1][o];l[f][o]=v[3*(y+1)+(g+1)],l[m][o]=0,c[f]=h}}else l[f]=SV(r[f],u[f],this._bitLength),l[m]=SV(r[m],u[m],this._bitLength),d=Math.max(l[f].length,d),d=Math.max(l[m].length,d)}var q=this.jpoint(null,null,null),A=this._wnafT4;for(a=d;a>=0;a--){for(var I=0;a>=0;){var S=!0;for(o=0;o<n;o++)A[o]=0|l[o][a],0!==A[o]&&(S=!1);if(!S)break;I++,a--}if(a>=0&&I++,q=q.dblp(I),a<0)break;for(o=0;o<n;o++){var M=A[o];0!==M&&(M>0?s=c[o][M-1>>1]:M<0&&(s=c[o][-M-1>>1].neg()),q="affine"===s.type?q.mixedAdd(s):q.add(s))}}for(a=0;a<n;a++)c[a]=null;return i?q:q.toP()},CV.BasePoint=ZV,ZV.prototype.eq=function(){throw new Error("Not implemented")},ZV.prototype.validate=function(){return this.curve.validate(this)},CV.prototype.decodePoint=function(e,t){e=yV.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?kV(e[e.length-1]%2==0):7===e[0]&&kV(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},ZV.prototype.encodeCompressed=function(e){return this.encode(e,!0)},ZV.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},ZV.prototype.encode=function(e,t){return yV.encode(this._encode(t),e)},ZV.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},ZV.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},ZV.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var a=0;a<e;a++)n=n.dbl();r.push(n)}return{step:e,points:r}},ZV.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},ZV.prototype._getBeta=function(){return null},ZV.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var wV=dV((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),xV=yV.assert;function EV(e){zV.call(this,"short",e),this.a=new fV(e.a,16).toRed(this.red),this.b=new fV(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}wV(EV,zV);var OV=EV;function KV(e,t,r,n){zV.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new fV(t,16),this.y=new fV(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function WV(e,t,r,n){zV.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new fV(0)):(this.x=new fV(t,16),this.y=new fV(r,16),this.z=new fV(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function VV(e){zV.call(this,"mont",e),this.a=new fV(e.a,16).toRed(this.red),this.b=new fV(e.b,16).toRed(this.red),this.i4=new fV(4).toRed(this.red).redInvm(),this.two=new fV(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}EV.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new fV(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new fV(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],xV(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new fV(e.a,16),b:new fV(e.b,16)}})):this._getEndoBasis(r)}}},EV.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:fV.mont(e),r=new fV(2).toRed(t).redInvm(),n=r.redNeg(),i=new fV(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},EV.prototype._getEndoBasis=function(e){for(var t,r,n,i,a,o,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,p=this.n.clone(),f=new fV(1),m=new fV(0),h=new fV(0),v=new fV(1),b=0;0!==d.cmpn(0);){var y=p.div(d);u=p.sub(y.mul(d)),c=h.sub(y.mul(f));var g=v.sub(y.mul(m));if(!n&&u.cmp(l)<0)t=s.neg(),r=f,n=u.neg(),i=c;else if(n&&2==++b)break;s=u,p=d,d=u,h=f,f=c,v=m,m=g}a=u.neg(),o=c;var q=n.sqr().add(i.sqr());return a.sqr().add(o.sqr()).cmp(q)>=0&&(a=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:n,b:i},{a:a,b:o}]},EV.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),s=a.mul(n.a),u=i.mul(r.b),c=a.mul(n.b);return{k1:e.sub(o).sub(s),k2:u.add(c).neg()}},EV.prototype.pointFromX=function(e,t){(e=new fV(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},EV.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},EV.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var o=this._endoSplit(t[a]),s=e[a],u=s._getBeta();o.k1.negative&&(o.k1.ineg(),s=s.neg(!0)),o.k2.negative&&(o.k2.ineg(),u=u.neg(!0)),n[2*a]=s,n[2*a+1]=u,i[2*a]=o.k1,i[2*a+1]=o.k2}for(var c=this._wnafMulAdd(1,n,i,2*a,r),l=0;l<2*a;l++)n[l]=null,i[l]=null;return c},wV(KV,zV.BasePoint),EV.prototype.point=function(e,t,r){return new KV(this,e,t,r)},EV.prototype.pointFromJSON=function(e,t){return KV.fromJSON(this,e,t)},KV.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},KV.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},KV.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var a=t[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(i))}},n},KV.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},KV.prototype.isInfinity=function(){return this.inf},KV.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},KV.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},KV.prototype.getX=function(){return this.x.fromRed()},KV.prototype.getY=function(){return this.y.fromRed()},KV.prototype.mul=function(e){return e=new fV(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},KV.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},KV.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},KV.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},KV.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},KV.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},wV(WV,zV.BasePoint),EV.prototype.jpoint=function(e,t,r){return new WV(this,e,t,r)},WV.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},WV.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},WV.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=a.redSub(o);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),d=n.redMul(c),p=u.redSqr().redIAdd(l).redISub(d).redISub(d),f=u.redMul(d.redISub(p)).redISub(a.redMul(l)),m=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(p,f,m)},WV.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=r.redSub(n),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),c=u.redMul(o),l=r.redMul(u),d=s.redSqr().redIAdd(c).redISub(l).redISub(l),p=s.redMul(l.redISub(d)).redISub(i.redMul(c)),f=this.z.redMul(o);return this.curve.jpoint(d,p,f)},WV.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,a=this.x,o=this.y,s=this.z,u=s.redSqr().redSqr(),c=o.redAdd(o);for(t=0;t<e;t++){var l=a.redSqr(),d=c.redSqr(),p=d.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),m=a.redMul(d),h=f.redSqr().redISub(m.redAdd(m)),v=m.redISub(h),b=f.redMul(v);b=b.redIAdd(b).redISub(p);var y=c.redMul(s);t+1<e&&(u=u.redMul(p)),a=h,s=y,c=b}return this.curve.jpoint(a,c.redMul(i),s)},WV.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},WV.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(o).redISub(o),c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(o.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),p=d.redSqr(),f=this.x.redAdd(d).redSqr().redISub(l).redISub(p);f=f.redIAdd(f);var m=l.redAdd(l).redIAdd(l),h=m.redSqr(),v=p.redIAdd(p);v=(v=v.redIAdd(v)).redIAdd(v),e=h.redISub(f).redISub(f),t=m.redMul(f.redISub(e)).redISub(v),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},WV.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(o).redISub(o);e=u;var c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(o.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),p=this.x.redMul(d),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var m=p.redIAdd(p),h=(m=m.redIAdd(m)).redAdd(m);e=f.redSqr().redISub(h),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var v=d.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),t=f.redMul(m.redISub(e)).redISub(v)}return this.curve.jpoint(e,t,r)},WV.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),a=t.redSqr(),o=r.redSqr(),s=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(o),l=s.redSqr().redISub(c.redAdd(c)),d=c.redISub(l),p=o.redSqr();p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p);var f=s.redMul(d).redISub(p),m=r.redAdd(r).redMul(n);return this.curve.jpoint(l,f,m)},WV.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(a)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(o).redSqr().redISub(a).redISub(s).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(s).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var p=this.y.redMul(c.redMul(u.redISub(c)).redISub(o.redMul(s)));p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p);var f=this.z.redAdd(o).redSqr().redISub(r).redISub(s);return this.curve.jpoint(d,p,f)},WV.prototype.mul=function(e,t){return e=new fV(e,t),this.curve._wnafMul(this,e)},WV.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},WV.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},WV.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},WV.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},wV(VV,zV);var TV=VV;function LV(e,t,r){zV.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new fV(t,16),this.z=new fV(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}VV.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},wV(LV,zV.BasePoint),VV.prototype.decodePoint=function(e,t){return this.point(yV.toArray(e,t),1)},VV.prototype.point=function(e,t){return new LV(this,e,t)},VV.prototype.pointFromJSON=function(e){return LV.fromJSON(this,e)},LV.prototype.precompute=function(){},LV.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},LV.fromJSON=function(e,t){return new LV(e,t[0],t[1]||e.one)},LV.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},LV.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},LV.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},LV.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},LV.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=i.redMul(n),s=t.z.redMul(a.redAdd(o).redSqr()),u=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,u)},LV.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},LV.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},LV.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},LV.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},LV.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},LV.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var NV=yV.assert;function PV(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,zV.call(this,"edwards",e),this.a=new fV(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new fV(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new fV(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),NV(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}wV(PV,zV);var jV=PV;function RV(e,t,r,n,i){zV.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new fV(t,16),this.y=new fV(r,16),this.z=n?new fV(n,16):this.curve.one,this.t=i&&new fV(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}PV.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},PV.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},PV.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},PV.prototype.pointFromX=function(e,t){(e=new fV(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var s=o.fromRed().isOdd();return(t&&!s||!t&&s)&&(o=o.redNeg()),this.point(e,o)},PV.prototype.pointFromY=function(e,t){(e=new fV(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return o.fromRed().isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},PV.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},wV(RV,zV.BasePoint),PV.prototype.pointFromJSON=function(e){return RV.fromJSON(this,e)},PV.prototype.point=function(e,t,r,n){return new RV(this,e,t,r,n)},RV.fromJSON=function(e,t){return new RV(e,t[0],t[1],t[2])},RV.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},RV.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},RV.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),o=a.redSub(r),s=n.redSub(t),u=i.redMul(o),c=a.redMul(s),l=i.redMul(s),d=o.redMul(a);return this.curve.point(u,c,d,l)},RV.prototype._projDbl=function(){var e,t,r,n,i,a,o=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=o.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),a=c.redSub(i).redISub(i),e=o.redSub(s).redISub(u).redMul(a),t=c.redMul(n.redSub(u)),r=c.redMul(a))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),a=n.redSub(i).redSub(i),e=this.curve._mulC(o.redISub(n)).redMul(a),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(a);return this.curve.point(e,t,r)},RV.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},RV.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),o=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=a.redMul(o),l=s.redMul(u),d=a.redMul(u),p=o.redMul(s);return this.curve.point(c,l,p,d)},RV.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),u=i.redSub(s),c=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),d=n.redMul(u).redMul(l);return this.curve.twisted?(t=n.redMul(c).redMul(o.redSub(this.curve._mulA(a))),r=u.redMul(c)):(t=n.redMul(c).redMul(o.redSub(a)),r=this.curve._mulC(u).redMul(c)),this.curve.point(d,t,r)},RV.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},RV.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},RV.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},RV.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},RV.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},RV.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},RV.prototype.getX=function(){return this.normalize(),this.x.fromRed()},RV.prototype.getY=function(){return this.normalize(),this.y.fromRed()},RV.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},RV.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},RV.prototype.toP=RV.prototype.normalize,RV.prototype.mixedAdd=RV.prototype.add;var XV=dV((function(e,t){var r=t;r.base=zV,r.short=OV,r.mont=TV,r.edwards=jV}));function BV(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function GV(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function YV(e){return 1===e.length?"0"+e:e}function HV(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var FV={inherits:wV,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):BV(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},toHex:function(e){for(var t="",r=0;r<e.length;r++)t+=YV(e[r].toString(16));return t},htonl:GV,toHex32:function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=GV(i)),r+=HV(i.toString(16))}return r},zero2:YV,zero8:HV,join32:function(e,t,r,n){var i=r-t;mV(i%4==0);for(var a=new Array(i/4),o=0,s=t;o<a.length;o++,s+=4){var u;u="big"===n?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],a[o]=u>>>0}return a},split32:function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var a=e[n];"big"===t?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,o=(a<n?1:0)+r+i;e[t]=o>>>0,e[t+1]=a},sum64_hi:function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,a,o,s){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+a>>>0)<a?1:0,e+r+i+o+(u+=(c=c+s>>>0)<s?1:0)>>>0},sum64_4_lo:function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},sum64_5_hi:function(e,t,r,n,i,a,o,s,u,c){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+a>>>0)<a?1:0,l+=(d=d+s>>>0)<s?1:0,e+r+i+o+u+(l+=(d=d+c>>>0)<c?1:0)>>>0},sum64_5_lo:function(e,t,r,n,i,a,o,s,u,c){return t+n+a+s+c>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function UV(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var DV=UV;UV.prototype.update=function(e,t){if(e=FV.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=FV.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},UV.prototype.digest=function(e){return this.update(this._pad()),mV(null===this.pending),this._digest(e)},UV.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a<this.padLength;a++)n[i++]=0;return n};var JV={BlockHash:DV},QV=FV.rotr32;function _V(e,t,r){return e&t^~e&r}function $V(e,t,r){return e&t^e&r^t&r}var eT=_V,tT=$V,rT=FV.rotl32,nT=FV.sum32,iT=FV.sum32_5,aT=function(e,t,r,n){return 0===e?_V(t,r,n):1===e||3===e?function(e,t,r){return e^t^r}(t,r,n):2===e?$V(t,r,n):void 0},oT=JV.BlockHash,sT=[1518500249,1859775393,2400959708,3395469782];function uT(){if(!(this instanceof uT))return new uT;oT.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}FV.inherits(uT,oT);var cT=uT;uT.blockSize=512,uT.outSize=160,uT.hmacStrength=80,uT.padLength=64,uT.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=rT(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],u=this.h[4];for(n=0;n<r.length;n++){var c=~~(n/20),l=iT(rT(i,5),aT(c,a,o,s),u,r[n],sT[c]);u=s,s=o,o=rT(a,30),a=i,i=l}this.h[0]=nT(this.h[0],i),this.h[1]=nT(this.h[1],a),this.h[2]=nT(this.h[2],o),this.h[3]=nT(this.h[3],s),this.h[4]=nT(this.h[4],u)},uT.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h,"big"):FV.split32(this.h,"big")};var lT=FV.sum32,dT=FV.sum32_4,pT=FV.sum32_5,fT=eT,mT=tT,hT=function(e){return QV(e,2)^QV(e,13)^QV(e,22)},vT=function(e){return QV(e,6)^QV(e,11)^QV(e,25)},bT=function(e){return QV(e,7)^QV(e,18)^e>>>3},yT=function(e){return QV(e,17)^QV(e,19)^e>>>10},gT=JV.BlockHash,qT=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function AT(){if(!(this instanceof AT))return new AT;gT.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=qT,this.W=new Array(64)}FV.inherits(AT,gT);var IT=AT;function ST(){if(!(this instanceof ST))return new ST;IT.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}AT.blockSize=512,AT.outSize=256,AT.hmacStrength=192,AT.padLength=64,AT.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=dT(yT(r[n-2]),r[n-7],bT(r[n-15]),r[n-16]);var i=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],d=this.h[7];for(mV(this.k.length===r.length),n=0;n<r.length;n++){var p=pT(d,vT(u),fT(u,c,l),this.k[n],r[n]),f=lT(hT(i),mT(i,a,o));d=l,l=c,c=u,u=lT(s,p),s=o,o=a,a=i,i=lT(p,f)}this.h[0]=lT(this.h[0],i),this.h[1]=lT(this.h[1],a),this.h[2]=lT(this.h[2],o),this.h[3]=lT(this.h[3],s),this.h[4]=lT(this.h[4],u),this.h[5]=lT(this.h[5],c),this.h[6]=lT(this.h[6],l),this.h[7]=lT(this.h[7],d)},AT.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h,"big"):FV.split32(this.h,"big")},FV.inherits(ST,IT);var MT=ST;ST.blockSize=512,ST.outSize=224,ST.hmacStrength=192,ST.padLength=64,ST.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h.slice(0,7),"big"):FV.split32(this.h.slice(0,7),"big")};var kT=FV.rotr64_hi,CT=FV.rotr64_lo,zT=FV.shr64_hi,ZT=FV.shr64_lo,wT=FV.sum64,xT=FV.sum64_hi,ET=FV.sum64_lo,OT=FV.sum64_4_hi,KT=FV.sum64_4_lo,WT=FV.sum64_5_hi,VT=FV.sum64_5_lo,TT=JV.BlockHash,LT=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function NT(){if(!(this instanceof NT))return new NT;TT.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=LT,this.W=new Array(160)}FV.inherits(NT,TT);var PT=NT;function jT(e,t,r,n,i){var a=e&r^~e&i;return a<0&&(a+=4294967296),a}function RT(e,t,r,n,i,a){var o=t&n^~t&a;return o<0&&(o+=4294967296),o}function XT(e,t,r,n,i){var a=e&r^e&i^r&i;return a<0&&(a+=4294967296),a}function BT(e,t,r,n,i,a){var o=t&n^t&a^n&a;return o<0&&(o+=4294967296),o}function GT(e,t){var r=kT(e,t,28)^kT(t,e,2)^kT(t,e,7);return r<0&&(r+=4294967296),r}function YT(e,t){var r=CT(e,t,28)^CT(t,e,2)^CT(t,e,7);return r<0&&(r+=4294967296),r}function HT(e,t){var r=kT(e,t,14)^kT(e,t,18)^kT(t,e,9);return r<0&&(r+=4294967296),r}function FT(e,t){var r=CT(e,t,14)^CT(e,t,18)^CT(t,e,9);return r<0&&(r+=4294967296),r}function UT(e,t){var r=kT(e,t,1)^kT(e,t,8)^zT(e,t,7);return r<0&&(r+=4294967296),r}function DT(e,t){var r=CT(e,t,1)^CT(e,t,8)^ZT(e,t,7);return r<0&&(r+=4294967296),r}function JT(e,t){var r=kT(e,t,19)^kT(t,e,29)^zT(e,t,6);return r<0&&(r+=4294967296),r}function QT(e,t){var r=CT(e,t,19)^CT(t,e,29)^ZT(e,t,6);return r<0&&(r+=4294967296),r}function _T(){if(!(this instanceof _T))return new _T;PT.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}NT.blockSize=1024,NT.outSize=512,NT.hmacStrength=192,NT.padLength=128,NT.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=JT(r[n-4],r[n-3]),a=QT(r[n-4],r[n-3]),o=r[n-14],s=r[n-13],u=UT(r[n-30],r[n-29]),c=DT(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=OT(i,a,o,s,u,c,l,d),r[n+1]=KT(i,a,o,s,u,c,l,d)}},NT.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],a=this.h[2],o=this.h[3],s=this.h[4],u=this.h[5],c=this.h[6],l=this.h[7],d=this.h[8],p=this.h[9],f=this.h[10],m=this.h[11],h=this.h[12],v=this.h[13],b=this.h[14],y=this.h[15];mV(this.k.length===r.length);for(var g=0;g<r.length;g+=2){var q=b,A=y,I=HT(d,p),S=FT(d,p),M=jT(d,0,f,0,h),k=RT(0,p,0,m,0,v),C=this.k[g],z=this.k[g+1],Z=r[g],w=r[g+1],x=WT(q,A,I,S,M,k,C,z,Z,w),E=VT(q,A,I,S,M,k,C,z,Z,w);q=GT(n,i),A=YT(n,i),I=XT(n,0,a,0,s),S=BT(0,i,0,o,0,u);var O=xT(q,A,I,S),K=ET(q,A,I,S);b=h,y=v,h=f,v=m,f=d,m=p,d=xT(c,l,x,E),p=ET(l,l,x,E),c=s,l=u,s=a,u=o,a=n,o=i,n=xT(x,E,O,K),i=ET(x,E,O,K)}wT(this.h,0,n,i),wT(this.h,2,a,o),wT(this.h,4,s,u),wT(this.h,6,c,l),wT(this.h,8,d,p),wT(this.h,10,f,m),wT(this.h,12,h,v),wT(this.h,14,b,y)},NT.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h,"big"):FV.split32(this.h,"big")},FV.inherits(_T,PT);var $T=_T;_T.blockSize=1024,_T.outSize=384,_T.hmacStrength=192,_T.padLength=128,_T.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h.slice(0,12),"big"):FV.split32(this.h.slice(0,12),"big")};var eL={sha1:cT,sha224:MT,sha256:IT,sha384:$T,sha512:PT},tL=FV.rotl32,rL=FV.sum32,nL=FV.sum32_3,iL=FV.sum32_4,aL=JV.BlockHash;function oL(){if(!(this instanceof oL))return new oL;aL.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}FV.inherits(oL,aL);var sL=oL;function uL(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function cL(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function lL(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}oL.blockSize=512,oL.outSize=160,oL.hmacStrength=192,oL.padLength=64,oL.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],a=this.h[3],o=this.h[4],s=r,u=n,c=i,l=a,d=o,p=0;p<80;p++){var f=rL(tL(iL(r,uL(p,n,i,a),e[dL[p]+t],cL(p)),fL[p]),o);r=o,o=a,a=tL(i,10),i=n,n=f,f=rL(tL(iL(s,uL(79-p,u,c,l),e[pL[p]+t],lL(p)),mL[p]),d),s=d,d=l,l=tL(c,10),c=u,u=f}f=nL(this.h[1],i,l),this.h[1]=nL(this.h[2],a,d),this.h[2]=nL(this.h[3],o,s),this.h[3]=nL(this.h[4],r,u),this.h[4]=nL(this.h[0],n,c),this.h[0]=f},oL.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h,"little"):FV.split32(this.h,"little")};var dL=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],pL=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],fL=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],mL=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],hL={ripemd160:sL};function vL(e,t,r){if(!(this instanceof vL))return new vL(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(FV.toArray(t,r))}var bL=vL;vL.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),mV(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},vL.prototype.update=function(e,t){return this.inner.update(e,t),this},vL.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var yL=dV((function(e,t){var r=t;r.utils=FV,r.common=JV,r.sha=eL,r.ripemd=hL,r.hmac=bL,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160})),gL={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},qL=dV((function(e,t){var r,n=t,i=yV.assert;function a(e){"short"===e.type?this.curve=new XV.short(e):"edwards"===e.type?this.curve=new XV.edwards(e):this.curve=new XV.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new a(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=a,o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:yL.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:yL.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:yL.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:yL.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:yL.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:yL.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:yL.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=gL}catch(e){r=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:yL.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function AL(e){if(!(this instanceof AL))return new AL(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=bV.toArray(e.entropy,e.entropyEnc||"hex"),r=bV.toArray(e.nonce,e.nonceEnc||"hex"),n=bV.toArray(e.pers,e.persEnc||"hex");mV(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var IL=AL;AL.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},AL.prototype._hmac=function(){return new yL.hmac(this.hash,this.K)},AL.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},AL.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=bV.toArray(e,t),r=bV.toArray(r,n),mV(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},AL.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=bV.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var a=i.slice(0,e);return this._update(r),this._reseed++,bV.encode(a,t)};var SL=yV.assert;function ML(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var kL=ML;ML.fromPublic=function(e,t,r){return t instanceof ML?t:new ML(e,{pub:t,pubEnc:r})},ML.fromPrivate=function(e,t,r){return t instanceof ML?t:new ML(e,{priv:t,privEnc:r})},ML.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},ML.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},ML.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},ML.prototype._importPrivate=function(e,t){this.priv=new fV(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},ML.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?SL(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||SL(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},ML.prototype.derive=function(e){return e.validate()||SL(e.validate(),"public point not validated"),e.mul(this.priv).getX()},ML.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},ML.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},ML.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var CL=yV.assert;function zL(e,t){if(e instanceof zL)return e;this._importDER(e,t)||(CL(e.r&&e.s,"Signature without r or s"),this.r=new fV(e.r,16),this.s=new fV(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var ZL=zL;function wL(){this.place=0}function xL(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,a=0,o=t.place;a<n;a++,o++)i<<=8,i|=e[o],i>>>=0;return!(i<=127)&&(t.place=o,i)}function EL(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function OL(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}zL.prototype._importDER=function(e,t){e=yV.toArray(e,t);var r=new wL;if(48!==e[r.place++])return!1;var n=xL(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=xL(e,r);if(!1===i)return!1;var a=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=xL(e,r);if(!1===o)return!1;if(e.length!==o+r.place)return!1;var s=e.slice(r.place,o+r.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new fV(a),this.s=new fV(s),this.recoveryParam=null,!0},zL.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=EL(t),r=EL(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];OL(n,t.length),(n=n.concat(t)).push(2),OL(n,r.length);var i=n.concat(r),a=[48];return OL(a,i.length),a=a.concat(i),yV.encode(a,e)};var KL=yV.assert;function WL(e){if(!(this instanceof WL))return new WL(e);"string"==typeof e&&(KL(Object.prototype.hasOwnProperty.call(qL,e),"Unknown curve "+e),e=qL[e]),e instanceof qL.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var VL=WL;WL.prototype.keyPair=function(e){return new kL(this,e)},WL.prototype.keyFromPrivate=function(e,t){return kL.fromPrivate(this,e,t)},WL.prototype.keyFromPublic=function(e,t){return kL.fromPublic(this,e,t)},WL.prototype.genKeyPair=function(e){e||(e={});for(var t=new IL({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||gV(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new fV(2));;){var i=new fV(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},WL.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},WL.prototype.sign=function(e,t,r,n){"object"==Ix(r)&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new fV(e,16));for(var i=this.n.byteLength(),a=t.getPrivate().toArray("be",i),o=e.toArray("be",i),s=new IL({hash:this.hash,entropy:a,nonce:o,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new fV(1)),c=0;;c++){var l=n.k?n.k(c):new fV(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var d=this.g.mul(l);if(!d.isInfinity()){var p=d.getX(),f=p.umod(this.n);if(0!==f.cmpn(0)){var m=l.invm(this.n).mul(f.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var h=(d.getY().isOdd()?1:0)|(0!==p.cmp(f)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),h^=1),new ZL({r:f,s:m,recoveryParam:h})}}}}}},WL.prototype.verify=function(e,t,r,n){e=this._truncateToN(new fV(e,16)),r=this.keyFromPublic(r,n);var i=(t=new ZL(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var o,s=a.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(u,r.getPublic(),c)).isInfinity()&&o.eqXToP(i):!(o=this.g.mulAdd(u,r.getPublic(),c)).isInfinity()&&0===o.getX().umod(this.n).cmp(i)},WL.prototype.recoverPubKey=function(e,t,r,n){KL((3&r)===r,"The recovery param is more than two bits"),t=new ZL(t,n);var i=this.n,a=new fV(e),o=t.r,s=t.s,u=1&r,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");o=c?this.curve.pointFromX(o.add(this.curve.n),u):this.curve.pointFromX(o,u);var l=t.r.invm(i),d=i.sub(a).mul(l).umod(i),p=s.mul(l).umod(i);return this.g.mulAdd(d,o,p)},WL.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new ZL(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var TL=yV.assert,LL=yV.parseBytes,NL=yV.cachedProperty;function PL(e,t){this.eddsa=e,this._secret=LL(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=LL(t.pub)}PL.fromPublic=function(e,t){return t instanceof PL?t:new PL(e,{pub:t})},PL.fromSecret=function(e,t){return t instanceof PL?t:new PL(e,{secret:t})},PL.prototype.secret=function(){return this._secret},NL(PL,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),NL(PL,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),NL(PL,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),NL(PL,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),NL(PL,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),NL(PL,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),PL.prototype.sign=function(e){return TL(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},PL.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},PL.prototype.getSecret=function(e){return TL(this._secret,"KeyPair is public only"),yV.encode(this.secret(),e)},PL.prototype.getPublic=function(e){return yV.encode(this.pubBytes(),e)};var jL=PL,RL=yV.assert,XL=yV.cachedProperty,BL=yV.parseBytes;function GL(e,t){this.eddsa=e,"object"!=Ix(t)&&(t=BL(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),RL(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof fV&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}XL(GL,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),XL(GL,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),XL(GL,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),XL(GL,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),GL.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},GL.prototype.toHex=function(){return yV.encode(this.toBytes(),"hex").toUpperCase()};var YL=GL,HL=yV.assert,FL=yV.parseBytes;function UL(e){if(HL("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof UL))return new UL(e);e=qL[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=yL.sha512}var DL=UL;UL.prototype.sign=function(e,t){e=FL(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),a=this.encodePoint(i),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:a})},UL.prototype.verify=function(e,t,r){e=FL(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(a)},UL.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return yV.intFromLE(e.digest()).umod(this.curve.n)},UL.prototype.keyFromPublic=function(e){return jL.fromPublic(this,e)},UL.prototype.keyFromSecret=function(e){return jL.fromSecret(this,e)},UL.prototype.makeSignature=function(e){return e instanceof YL?e:new YL(this,e)},UL.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},UL.prototype.decodePoint=function(e){var t=(e=yV.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=yV.intFromLE(r);return this.curve.pointFromY(i,n)},UL.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},UL.prototype.decodeInt=function(e){return yV.intFromLE(e)},UL.prototype.isPoint=function(e){return e instanceof this.pointClass};var JL=dV((function(e,t){var r=t;r.version="6.5.4",r.utils=yV,r.rand=gV,r.curve=XV,r.curves=qL,r.ec=VL,r.eddsa=DL}));function QL(e,t){var r=$L();return(QL=function(e,t){return r[e-=328]})(e,t)}var _L=QL;function $L(){var e=["Mjci1ul8mm","2188593Xclinx","44P0rKKsZK","+faHkP3QC3","49435752zDNrFx","D9EKOWS+U4","ssRdXLZEX8","5taCaWi","112HtQvaP","KA==","519563fhtZhq","KoZIzj0DAQ","13oIMCDS","ytJdcsPxrD","5733052jFPnGP","2292997RniAsr","12pHfASS","MfPrcYTM70","170DvkwlC","000","2a8648ce3d","0301070342","DepBO8t60S","cDQgAE9h6Z","294554LvBncQ","911403nzCtnZ","1ZtAkYC","3059301306"];return($L=function(){return e})()}!function(e,t){for(var r=QL,n=$L();;)try{if(771712==-parseInt(r(349))/1*(parseInt(r(347))/2)+parseInt(r(352))/3+-parseInt(r(337))/4*(-parseInt(r(330))/5)+-parseInt(r(339))/6*(-parseInt(r(338))/7)+-parseInt(r(331))/8*(-parseInt(r(348))/9)+-parseInt(r(341))/10*(-parseInt(r(333))/11)+-parseInt(r(355))/12*(parseInt(r(335))/13))break;n.push(n.shift())}catch(e){n.push(n.shift())}}();var eN,tN=(eN=_L(350)+"072a8648ce3d02010608"+_L(343)+_L(344)+_L(342),sV("MFkwEwYHKoZIzj0CAQYI"+_L(334)+_L(346)+_L(345)+_L(336)+_L(354)+_L(353)+_L(351)+_L(328)+_L(340)+_L(329)+_L(332)).replace(eN,"")),rN=new JL.ec("p256").keyFromPublic(tN,"hex");function nN(e,t){return iV(this,void 0,void 0,qx().mark((function r(){var n,i;return qx().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,function(e){return iV(this,void 0,void 0,qx().mark((function t(){var r,n;return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(new TextEncoder).encode(e),t.next=3,crypto.subtle.digest("SHA-256",r);case 3:return n=t.sent,t.abrupt("return",Array.from(new Uint8Array(n)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""));case 5:case"end":return t.stop()}}),t)})))}(e);case 3:return n=r.sent,i=sV(t),r.abrupt("return",rN.verify(n,i));case 8:return r.prev=8,r.t0=r.catch(0),r.abrupt("return",(console.error(r.t0),!1));case 11:case"end":return r.stop()}}),r,null,[[0,8]])})))}function iN(e,t){return iV(this,void 0,void 0,qx().mark((function r(){var n,i,a,o;return qx().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,nN(e,t);case 2:if(r.sent){r.next=4;break}return r.abrupt("return",{isValid:!1,error:aV.invalid_signature});case 4:if("string"==typeof(n=JSON.parse(e)).app_id&&n.app_id===window.location.hostname){r.next=7;break}return r.abrupt("return",{isValid:!1,error:aV.invalid_app_id});case 7:return i=new Date,a=new Date(n.expired_at),o=new Date(n.created_at),r.abrupt("return","Invalid Date"===a.toString()||"Invalid Date"===o.toString()?{isValid:!1,error:aV.invalid_date}:i<=o||i>=a?{isValid:!1,error:aV.license_expired}:{isValid:!0,error:null});case 9:case"end":return r.stop()}}),r)})))}function aN(e,t){return iV(this,void 0,void 0,qx().mark((function r(){var n,i,a,o,s,u,c,l,d;return qx().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,nN(e,t);case 2:if(r.sent){r.next=4;break}return r.abrupt("return",{isValid:!1,error:aV.invalid_signature});case 4:if((n=JSON.parse(e)).url){r.next=7;break}return r.abrupt("return",{isValid:!1,error:aV.missing_url});case 7:return i=null,r.prev=8,r.next=11,fetch("".concat(n.url,"/v1/verify_license"),{method:"POST",body:JSON.stringify({license_id:n.id,app_id:window.location.hostname}),headers:{"Content-Type":"application/json"}});case 11:i=r.sent,r.next=17;break;case 14:r.prev=14,r.t0=r.catch(8),console.error(r.t0);case 17:if(null!==i){r.next=19;break}return r.abrupt("return",function(){return iV(this,void 0,void 0,qx().mark((function e(){var t,r,n,i;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(t=localStorage.getItem("tv:sdk-license"))){e.next=3;break}return e.abrupt("return",{isValid:!1,error:aV.invalid_license});case 3:return r=cV(t),n=r.license,i=r.signature,e.abrupt("return",iN(uV(sV(n)),i));case 5:case"end":return e.stop()}}),e)})))}());case 19:if(200===(a=i.status)){r.next=23;break}return o=a.toString(),r.abrupt("return",{isValid:!1,error:o in aV?aV[o]:aV.unknown});case 23:return r.next=25,i.json();case 25:if(s=r.sent,!(Array.isArray(s.errors)&&s.errors.length>0)){r.next=28;break}return r.abrupt("return",(console.error(s.errors[0]),{isValid:!1,error:aV.invalid_license}));case 28:return u=cV(s.data.license_key),c=u.license,l=u.signature,d=uV(sV(c)),r.next=31,nN(d,l);case 31:if(!r.sent){r.next=35;break}r.t1=(localStorage.setItem("tv:sdk-license",s.data.license_key),{isValid:!0,error:null}),r.next=36;break;case 35:r.t1={isValid:!1,error:aV.invalid_signature};case 36:return r.abrupt("return",r.t1);case 37:case"end":return r.stop()}}),r,null,[[8,14]])})))}function oN(e){return iV(this,void 0,void 0,qx().mark((function t(){var r,n,i,a,o;return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e){t.next=3;break}return t.abrupt("return",{isValid:!1,error:aV.invalid_license});case 3:if(r=cV(e),n=r.mode,i=r.license,a=r.signature,o=uV(sV(i)),"offline"!==n){t.next=10;break}return t.next=7,iN(o,a);case 7:t.t0=t.sent,t.next=18;break;case 10:if("online"!==n){t.next=16;break}return t.next=13,aN(o,a);case 13:t.t1=t.sent,t.next=17;break;case 16:t.t1={isValid:!1,error:aV.invalid_license};case 17:t.t0=t.t1;case 18:return t.abrupt("return",t.t0);case 21:return t.prev=21,t.t2=t.catch(0),t.abrupt("return",(console.error(t.t2),{isValid:!1,error:aV.unknown}));case 24:case"end":return t.stop()}}),t,null,[[0,21]])})))}var sN=function(e,t,r){var n=null==e?void 0:oK(e,t);return void 0===n?r:n},uN=function(e,t){var r=sN(e,t),n=sN(e,t+"_web");return null!=n?n:r},cN=Object.freeze({__proto__:null,getWebSetting:uN}),lN=db.createContext(!1),dN={invalid_license:"license_invalid",invalid_license_exception:"license_invalid",invalid_parameter_exception:"license_invalid",rate_limit_exception:"license_rate_limit_exceeded",internal_server_error:"license_internal_server_error",unknown_license_error:"license_unknown_error",invalid_app_id:"license_invalid",invalid_date:"license_invalid",license_expired:"license_invalid",invalid_signature:"license_invalid",missing_url:"license_invalid"},pN=function(e){var t=e.children,r=e.clientSettings,n=e.onError,i=xx(db.useState(!1),2),a=i[0],o=i[1],s=!!r,u=s?uN(r,"data.settings.sdk_settings.license_settings.license_key"):null;return db.useEffect((function(){s&&FW(void 0,void 0,void 0,qx().mark((function e(){var t;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,oN(u);case 2:t=e.sent,o(t.isValid),t.isValid||n(fx[dN[t.error]]);case 5:case"end":return e.stop()}}),e)})))}),[s,u,n]),a?db.createElement(lN.Provider,{value:a},t):null},fN=Object.freeze({__proto__:null,LicenseProvider:pN,useLicenseVerifier:function(){return db.useContext(lN)}});function mN(e){return new Promise((function(t){return setTimeout(t,e)}))}var hN=Object.freeze({__proto__:null,sleep:mN}),vN=Symbol("Comlink.proxy"),bN=Symbol("Comlink.endpoint"),yN=Symbol("Comlink.releaseProxy"),gN=Symbol("Comlink.thrown"),qN=function(e){return"object"==rv(e)&&null!==e||"function"==typeof e},AN=new Map([["proxy",{canHandle:function(e){return qN(e)&&e[vN]},serialize:function(e){var t=new MessageChannel,r=t.port1,n=t.port2;return IN(e,r),[n,[n]]},deserialize:function(e){return e.start(),MN(e)}}],["throw",{canHandle:function(e){return qN(e)&&gN in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function IN(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;t.addEventListener("message",(function r(n){if(n&&n.data){var i,a=Object.assign({path:[]},n.data),o=a.id,s=a.type,u=a.path,c=(n.data.argumentList||[]).map(xN);try{var l=u.slice(0,-1).reduce((function(e,t){return e[t]}),e),d=u.reduce((function(e,t){return e[t]}),e);switch(s){case"GET":i=d;break;case"SET":l[u.slice(-1)[0]]=xN(n.data.value),i=!0;break;case"APPLY":i=d.apply(l,c);break;case"CONSTRUCT":i=function(e){return Object.assign(e,uv({},vN,!0))}(Jh(d,hv(c)));break;case"ENDPOINT":var p=new MessageChannel,f=p.port1,m=p.port2;IN(e,m),i=function(e,t){return ZN.set(e,t),e}(f,[f]);break;case"RELEASE":i=void 0;break;default:return}}catch(e){i=uv({value:e},gN,0)}Promise.resolve(i).catch((function(e){return uv({value:e},gN,0)})).then((function(e){var n=mv(wN(e),2),i=n[0],a=n[1];t.postMessage(Object.assign(Object.assign({},i),{id:o}),a),"RELEASE"===s&&(t.removeEventListener("message",r),SN(t))}))}})),t.start&&t.start()}function SN(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function MN(e,t){return CN(e,[],t)}function kN(e){if(e)throw new Error("Proxy has been released and is not useable")}function CN(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=!1,i=new Proxy(r,{get:function(r,a){if(kN(n),a===yN)return function(){return EN(e,{type:"RELEASE",path:t.map((function(e){return e.toString()}))}).then((function(){SN(e),n=!0}))};if("then"===a){if(0===t.length)return{then:function(){return i}};var o=EN(e,{type:"GET",path:t.map((function(e){return e.toString()}))}).then(xN);return o.then.bind(o)}return CN(e,[].concat(hv(t),[a]))},set:function(r,i,a){kN(n);var o=mv(wN(a),2),s=o[0],u=o[1];return EN(e,{type:"SET",path:[].concat(hv(t),[i]).map((function(e){return e.toString()})),value:s},u).then(xN)},apply:function(r,i,a){kN(n);var o=t[t.length-1];if(o===bN)return EN(e,{type:"ENDPOINT"}).then(xN);if("bind"===o)return CN(e,t.slice(0,-1));var s=mv(zN(a),2),u=s[0],c=s[1];return EN(e,{type:"APPLY",path:t.map((function(e){return e.toString()})),argumentList:u},c).then(xN)},construct:function(r,i){kN(n);var a=mv(zN(i),2),o=a[0],s=a[1];return EN(e,{type:"CONSTRUCT",path:t.map((function(e){return e.toString()})),argumentList:o},s).then(xN)}});return i}function zN(e){var t,r=e.map(wN);return[r.map((function(e){return e[0]})),(t=r.map((function(e){return e[1]})),Array.prototype.concat.apply([],t))]}var ZN=new WeakMap;function wN(e){var t,r=Av(AN);try{for(r.s();!(t=r.n()).done;){var n=mv(t.value,2),i=n[0],a=n[1];if(a.canHandle(e)){var o=mv(a.serialize(e),2);return[{type:"HANDLER",name:i,value:o[0]},o[1]]}}}catch(e){r.e(e)}finally{r.f()}return[{type:"RAW",value:e},ZN.get(e)||[]]}function xN(e){switch(e.type){case"HANDLER":return AN.get(e.name).deserialize(e.value);case"RAW":return e.value}}function EN(e,t,r){return new Promise((function(n){var i=new Array(4).fill(0).map((function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)})).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===i&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),r)}))}var ON=function(){if(!window.Worker)return null;var e=new Blob(['const e=Symbol("Comlink.proxy"),t=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),n=Symbol("Comlink.thrown"),a=e=>"object"==typeof e&&null!==e||"function"==typeof e,o=new Map([["proxy",{canHandle:t=>a(t)&&t[e],serialize(e){const{port1:t,port2:r}=new MessageChannel;return i(e,t),[r,[r]]},deserialize(e){return e.start(),l(e,[],t);var t}}],["throw",{canHandle:e=>a(e)&&n in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function i(t,r=self){r.addEventListener("message",(function a(o){if(!o||!o.data)return;const{id:s,type:l,path:d}=Object.assign({path:[]},o.data),h=(o.data.argumentList||[]).map(g);let m;try{const r=d.slice(0,-1).reduce(((e,t)=>e[t]),t),n=d.reduce(((e,t)=>e[t]),t);switch(l){case"GET":m=n;break;case"SET":r[d.slice(-1)[0]]=g(o.data.value),m=!0;break;case"APPLY":m=n.apply(r,h);break;case"CONSTRUCT":m=function(t){return Object.assign(t,{[e]:!0})}(new n(...h));break;case"ENDPOINT":{const{port1:e,port2:r}=new MessageChannel;i(t,r),m=function(e,t){return u.set(e,t),e}(e,[e])}break;case"RELEASE":m=void 0;break;default:return}}catch(e){m={value:e,[n]:0}}Promise.resolve(m).catch((e=>({value:e,[n]:0}))).then((e=>{const[t,n]=_(e);r.postMessage(Object.assign(Object.assign({},t),{id:s}),n),"RELEASE"===l&&(r.removeEventListener("message",a),c(r))}))})),r.start&&r.start()}function c(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function s(e){if(e)throw new Error("Proxy has been released and is not useable")}function l(e,n=[],a=function(){}){let o=!1;const i=new Proxy(a,{get(t,a){if(s(o),a===r)return()=>h(e,{type:"RELEASE",path:n.map((e=>e.toString()))}).then((()=>{c(e),o=!0}));if("then"===a){if(0===n.length)return{then:()=>i};const t=h(e,{type:"GET",path:n.map((e=>e.toString()))}).then(g);return t.then.bind(t)}return l(e,[...n,a])},set(t,r,a){s(o);const[i,c]=_(a);return h(e,{type:"SET",path:[...n,r].map((e=>e.toString())),value:i},c).then(g)},apply(r,a,i){s(o);const c=n[n.length-1];if(c===t)return h(e,{type:"ENDPOINT"}).then(g);if("bind"===c)return l(e,n.slice(0,-1));const[u,_]=d(i);return h(e,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:u},_).then(g)},construct(t,r){s(o);const[a,i]=d(r);return h(e,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:a},i).then(g)}});return i}function d(e){const t=e.map(_);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const u=new WeakMap;function _(e){for(const[t,r]of o)if(r.canHandle(e)){const[n,a]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},a]}return[{type:"RAW",value:e},u.get(e)||[]]}function g(e){switch(e.type){case"HANDLER":return o.get(e.name).deserialize(e.value);case"RAW":return e.value}}function h(e,t,r){return new Promise((n=>{const a=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===a&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),r)}))}var m=[[0,1,0],[1,-4,1],[0,1,0]];function f(e,t,r,n){return e[4*(r*t+n)]}function p(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function v(e,t,r){return(t=p(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,c=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){l=!0,a=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const k="frontal",w="left",P="right",S="up",E="down";var L=0,M=1,C=2,A=0,R=1,O=2,V=function(e,t){var r=y(e,2),n=r[0],a=r[1],o=y(t,2),i=o[0],c=o[1];return n>c||i>a?A:n<=i&&c<=a?O:R};function j(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=y(e,2),a=n[0],o=n[1],i=y(t,2),c=i[0],s=i[1],l=[a[0],o[0]],d=[a[1],o[1]],u=[c[0],s[0]],_=[c[1],s[1]],g=[l[0]+r,l[1]-r],h=[d[0]+r,d[1]-.8*r];return V(g,u)===O&&V(h,_)===O?C:V(l,u)===A||V(d,_)===A?L:M}const x=Object.assign(Object.assign({not_supported:{code:"not_supported",msg:{en:"Camera is not well-supported on this device/browser. Please try another one.",vi:"Camera không được hỗ trợ. Vui lòng thử trình duyệt hoặc thiết bị khác."}},camera_timeout:{code:"camera_timeout",msg:{en:"Can\'t access camera. Please check camera permission, try again or try another browser/device",vi:"Không thể truy cập camera. Vui lòng kiểm tra quyền truy cập camera, đóng các tab/app khác đang sử dụng camera hoặc thử lại trên trình duyệt/thiết bị khác."}},unable_to_load_model:{code:"unable_to_load_model",msg:{en:"Unable to load model on this device/browser. Please try another one.",vi:"Không thể load model. Vui lòng thử trình duyệt hoặc thiết bị khác."}},no_permission:{code:"no_permission",msg:{en:"Please grant the permission to access the camera.",vi:"Vui lòng cấp quyền để truy cập camera."}},api_call_error:{code:"api_call_error",msg:{en:"Api call error",vi:"Lỗi call api"}},upload_error:{code:"upload_error",msg:{en:"Upload error",vi:"Lỗi upload"}},sanity_check_error:{code:"sanity_check_error",msg:{en:"Sanity check error",vi:"Lỗi check sanity"}},read_id_card_error:{code:"read_id_card_error",msg:{en:"Read id card error",vi:"Lỗi read id card"}},detect_id_tampering_error:{code:"detect_id_tampering_error",msg:{en:"Detect id tampering error",vi:"Lỗi detect id tampering"}},detect_id_card_error:{code:"detect_id_card_error",msg:{en:"Can\'t detect id card type",vi:"Không thể detect id card type"}},missing_front_id_card:{code:"missing_front_id_card",msg:{en:"Missing front id",vi:"Không tìm thấy front id"}},server_error:{code:"server_error",msg:"Server error"},not_readable:{code:"CameraInUseError",msg:{vi:"Camera đang được sử dụng bởi ứng dụng/tab khác.",en:"Camera already in use by another app/tab."}}},{wrong_orientation:{code:"wrong_orientation",msg:{en:"You are using landscape mode. Please rotate screen to portrait mode and retry.",vi:"Bạn đang sử dụng chế độ màn hình xoay ngang. Vui lòng quay màn hình theo chiều dọc và thực hiện lại."}},no_face:{code:"no_face",msg:{en:"Face not found",vi:"Không tìm thấy khuôn mặt"}},partial_face:{code:"partial_face",msg:{en:"Face out of the box",vi:"Không tìm thấy toàn bộ khuôn mặt"}},multiple_faces:{code:"multiple_faces",msg:{en:"Too many faces",vi:"Quá nhiều khuôn mặt"}},face_too_small:{code:"face_too_small",msg:{en:"Face too small",vi:"Khuôn mặt quá nhỏ"}},face_too_large:{code:"face_too_large",msg:{en:"Face too large",vi:"Khuôn mặt quá to"}},face_out_of_box:{code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt không nằm trọn vẹn trong khung ảnh"}},liveness_too_fast:{code:"liveness_too_fast",msg:{en:"Please turn your face SLOWLY",vi:"Vui lòng quay CHẬM lại"}},liveness_terminated:{code:"liveness_terminated",msg:{en:"Please try again.",vi:"Vui lòng thực hiện lại."}},liveness_terminated_face_tracking:{code:"liveness_terminated_face_tracking",msg:{en:"You need to turn your face SLOWLY. Please try again.",vi:"Bạn cần quay CHẬM lại. Vui lòng thực hiện lại."}},liveness_terminated_no_face:{code:"liveness_terminated_no_face",msg:{en:"Your face was missing for too long. Please try again.",vi:"Khuôn mặt không nằm trong khung hình. Xin vui lòng thử lại."}},liveness_terminated_time_out:{code:"liveness_terminated_time_out",msg:{en:"You need to complete gestures as instructed within <%= x %> seconds. Please try again.",vi:"Bạn cần hoàn thành động tác theo chỉ dẫn trong <%= x %> giây. Xin vui lòng thử lại."}},liveness_blurry:{code:"liveness_blurry",msg:{en:"Image is too blurry. Please ensure your face is in focus.",vi:"Hình ảnh bị mờ. Vui lòng đảm bảo khuôn mặt của bạn rõ nét."}},card_sanity_not_good:{code:"card_sanity_not_good",msg:{en:"Card sanity not good",vi:"Card sanity chưa đạt"}},id_detector_validate_angle_error:{code:"id_detector_validate_angle_error",msg:{en:"Please place ID card straight, not tilted",vi:"Vui lòng đặt giấy tờ thẳng, không bị nghiêng khi chụp"}},client_web_setting_not_found:{code:"client_web_setting_not_found",msg:"Client Web Setting Not Found"},id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Please capture the <%= side %> side of ID card (occupy 50-95% of the frame)",vi:"Vui lòng chụp mặt <%= side %> của giấy tờ (chiếm 50-95% khung hình)"}},id_detector_card_too_small:{code:"id_detector_card_too_small",msg:{en:"Please move ID card CLOSER (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ lại GẦN hơn (chiếm 50-95% khung hình)"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please move ID card FARTHER (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ ra XA hơn (chiếm 50-95% khung hình)"}},glare_detected:{code:"glare_detected",msg:{en:"Glare is detected. Please adjust the shooting angle",vi:"Ảnh bị chói / lóa. Vui lòng điều chỉnh góc chụp."}},id_detector_error_front_side_no_faces:{code:"id_detector_error_front_side_no_faces",msg:{en:"Please capture the front side of ID card",vi:"Vui lòng chụp mặt trước của giấy tờ"}},id_detector_error_front_side_multiple_faces:{code:"id_detector_error_front_side_multiple_faces",msg:{en:"Please capture the front side of one ID card only (remove other items out of the frame)",vi:"Vui lòng chụp mặt trước 1 giấy tờ duy nhất"}},id_detector_error_back_side_has_faces:{code:"id_detector_error_back_side_has_faces",msg:{en:"Please capture the back side of ID card",vi:"Vui lòng chụp mặt sau của giấy tờ"}},id_detector_error_blur:{code:"id_detector_error_blur",msg:{en:"Blurry photo detected. Please capture again for a clearer image",vi:"Ảnh bị mờ. Vui lòng chụp lại để có ảnh rõ nét hơn"}},not_allowed_card_types:{code:"not_allowed_card_types",msg:{en:"Please use the required ID cards",vi:"Vui lòng sử dụng GTTT được yêu cầu"}},not_frontal_face:{code:"not_frontal_face",msg:{en:"Please look straight to camera.",vi:"Vui lòng nhìn thẳng vào camera."}},close_eye:{code:"close_eye",msg:{vi:"Vui lòng mở to mắt",en:"Open your eyes clearly"}}}),{license_invalid:{code:"license_invalid",msg:{en:"Invalid license",vi:"License không hợp lệ"}},license_rate_limit_exceeded:{code:"license_rate_limit_exceeded",msg:{en:"Invalid license",vi:"Quá số lần thử"}},license_internal_server_error:{code:"license_internal_server_error",msg:{en:"Internal server error",vi:"Lỗi server"}},license_unknown_error:{code:"license_unknown_error",msg:{en:"Unknown error",vi:"Lỗi không xác định"}}});function I(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function T(e,t){return[e[0]-t[0],e[1]-t[1]]}function D(e,t,r,n){var a=r*(4*t)+4*n;return{r:e[a],g:e[a+1],b:e[a+2]}}i({calculateBlurScoreFunc:function(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,a=0;a<t.length;a+=4){var o=(t[a]+t[a+1]+t[a+2])/3;t[a]=o}for(var i=0,c=0,s=n-1,l=r-1,d=1;d<s;d++)for(var u=1;u<l;u++){var _=m[0][0]*f(t,r,u-1,d-1)+m[0][1]*f(t,r,u,d-1)+m[0][2]*f(t,r,u+1,d-1)+m[1][0]*f(t,r,u-1,d)+m[1][1]*f(t,r,u,d)+m[1][2]*f(t,r,u+1,d)+m[2][0]*f(t,r,u-1,d+1)+m[2][1]*f(t,r,u,d+1)+m[2][2]*f(t,r,u+1,d+1);(_=Math.abs(_))>25&&i++,_>15&&_<25&&c++}var g=0;return i+c!==0&&(g=i/(i+c)),g},calculateFaceDirectionFunc:function(e){var t=e.landmarks,r=e.getPerfectFrontal,n=e.upDownBound,a=void 0===n?{lower:.42,upper:.7}:n,o=function(e){var t,r,n,a,o,i,c,s=y(e,4),l=s[0],d=s[1],u=s[2],_=s[3],g=T(d,l),h=I(g),m=(a=d,t=[(n=l)[0]+a[0],n[1]+a[1]],r=2,[t[0]/r,t[1]/r]),f=T(u,m),p=I(T(_,u)),v=T(_,m),b=I(v),k=(f[0]*v[0]+f[1]*v[1])/b,w=p/b;if(h>.5*b)o=(f[0]*g[0]+f[1]*g[1])/h/h;else{var P=I(T(f,function(e,t){return[e[0]*t,e[1]*t]}(v,k/b)));c=v,o=((i=f)[0]*c[1]-c[0]*i[1]>=0?1:-1)*P/h}return{left_right_score:o,up_down_score:w}}(t),i=o.left_right_score,c=o.up_down_score,s=y(t,3),l=s[0],d=s[1],u=s[2],_=d[0]-u[0],g=l[0]-u[0],h=r?.1:.3,m=c>a.upper,f=c<a.lower,p=i>=.35&&i<=.6,v=i<=-.35&&i>=-.6,b=m&&!v&&!p,L=f&&!v&&!p,M=v&&!m&&!f,C=p&&!m&&!f;return c>=a.lower&&c<=a.upper&&i>-h&&i<h&&_*g<0?{gesture:k,leftRightScore:i}:b?{gesture:S,leftRightScore:i}:L?{gesture:E,leftRightScore:i}:C?{gesture:P,leftRightScore:i}:M?{gesture:w,leftRightScore:i}:null},validatePredictionsFunc:function(e){var t,r,n,a,o,i,c,s,l,d,u,_,g,h,m,f,p,b,k,w,P,S,E,A,R,O,V,I,T,D,F,N,H=e.predictions,K=e.width,q=e.height,Y=e.cropAreaCoordinates,G=null!=Y?Y:[[0,0],[K,q]],U=H.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,a=t.probability,o=t.landmarks;a<.9||o.length<6||function(e){var t=e.small,r=t.coords,n=t.area,a=e.big,o=a.coords,i=a.area,c=n;if(!c){var s=y(r,2),l=s[0],d=s[1];c=(d[0]-l[0])*(d[1]-l[1])}var u=i;if(!u){var _=y(o,2),g=_[0],h=_[1];u=(h[0]-g[0])*(h[1]-g[1])}return c/u}({small:{coords:[r,n]},big:{coords:G}})<=.025?e[L].push(t):e[j(G,[r,n])].push(t);return e}),v(v(v({},M,[]),C,[]),L,[])),W=U[C].length,z=U[M].length;if(0===W)t=z>0?x.partial_face:x.no_face;else if(W+z>1)t=x.multiple_faces;else{var B=r=U[C][0],X=B.topLeft,Q=B.bottomRight;E=G,A=y([X,Q],2),R=A[0],O=A[1],V=y(E,2),I=V[0],T=V[1],D=O[0]-R[0],F=O[1]-R[1],N=T[0]-I[0],(n=D/N<F/N?D/N:F/N)<.4&&(t=x.face_too_small),n>.61&&(t=x.face_too_large),j(G,(a=r.landmarks,c=a[0],s=a[1],l=a[2],d=a[3],u=a[4],_=a[5],g=.5*(c[1]+s[1]),h=g+1.5*(g-d[1]),m=d[1]-1.2*(l[1]-d[1]),f=[c[0],s[0],l[0],d[0],u[0],_[0]],p=Math.min.apply(Math,f),b=Math.min(h,m),k=Math.max.apply(Math,f),w=Math.max(h,m),P=Math.abs(d[0]-u[0])/Math.abs(d[0]-_[0]),S=d[0]-u[0]<0&&_[0]-d[0]>.05*(k-p),d[0]-u[0]>0&&_[0]-d[0]<-.05*(k-p)?(o=.2,i=.1):S?(o=.1,i=.2):P>2||P<.5?(o=.15,i=.15):(o=.05,i=.05),[[p-o*(k-p),b],[k+i*(k-p),w]]),.05*K)!==C&&(t=x.face_out_of_box)}return{ratio:n,error:t,fullFace:r,faceRatio:n,faceNotFrontalMinThreshold:.38}},detectGlare:function(e,t,r){return function(e,t,r){for(var n=0,a=r[1],o=r[3],i=r[0],c=r[2],s=a;s<o;s++)for(var l=i;l<c;l++){var d=D(e,t,s,l),u=d.r,_=d.g,g=d.b;u>=245&&g>=245&&_>245&&(n+=1)}return n}(e,t,function(e,t){var r=Math.floor(.025*e),n=e-r,a=Math.floor(.025*t);return[r,a,n,t-a]}(t,r))/(t*r)>=.001}});']),t=URL.createObjectURL(e);return MN(new Worker(t))}(),KN=[[0,1,0],[1,-4,1],[0,1,0]];function WN(e,t,r,n){return e[4*(r*t+n)]}function VN(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,i=0;i<t.length;i+=4){var a=(t[i]+t[i+1]+t[i+2])/3;t[i]=a}for(var o=0,s=0,u=n-1,c=r-1,l=1;l<u;l++)for(var d=1;d<c;d++){var p=KN[0][0]*WN(t,r,d-1,l-1)+KN[0][1]*WN(t,r,d,l-1)+KN[0][2]*WN(t,r,d+1,l-1)+KN[1][0]*WN(t,r,d-1,l)+KN[1][1]*WN(t,r,d,l)+KN[1][2]*WN(t,r,d+1,l)+KN[2][0]*WN(t,r,d-1,l+1)+KN[2][1]*WN(t,r,d,l+1)+KN[2][2]*WN(t,r,d+1,l+1);(p=Math.abs(p))>25&&o++,p>15&&p<25&&s++}var f=0;return o+s!==0&&(f=o/(o+s)),f}function TN(e){var t=e.width,r=e.height,n=e.getContext("2d"),i=Math.floor(t/2.8),a=Math.floor(r/2.8),o=t-i,s=r-a;return{data:n.getImageData(Math.floor(i/2),Math.floor(a/2),o,s).data,reducedWidth:o,reducedHeight:s}}function LN(){return(LN=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=TN(t),ON){e.next=3;break}return e.abrupt("return",VN(r));case 3:return e.abrupt("return",ON.calculateBlurScoreFunc(r));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NN(e,t,r,n){return e[4*(n*t+r)]}var PN=Object.freeze({__proto__:null,calculateBlurScore:function(e){return LN.apply(this,arguments)},hasBetterBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||e-t>r},hasSameBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null!==t&&Math.abs(e-t)<r},hasBetterCardBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||t-e>r},calculateIdCardBlurScore:function(e){var t=e.canvas,r=document.createElement("canvas"),n=r.getContext("2d");r.width=430,r.height=270,n.drawImage(t,0,0,r.width,r.height);var i=Math.floor(129),a=Math.floor(13.5),o=Math.floor(408.5),s=Math.floor(256.5),u=document.createElement("canvas"),c=u.getContext("2d"),l=o-i,d=s-a;u.width=l,u.height=d,c.drawImage(r,i,a,l,d,0,0,l,d);for(var p=c.getImageData(0,0,l,d).data,f=0;f<p.length;f+=4){var m=Math.round(.299*p[f]+.587*p[f+1]+.114*p[f+2]);p[f]=m}for(var h=d-1,v=l-1,b=0,y=[],g=1;g<h;g++)for(var q=1;q<v;q++){var A=4*-NN(p,l,q,g)+NN(p,l,q,g-1)+NN(p,l,q,g+1)+NN(p,l,q-1,g)+NN(p,l,q+1,g);b+=A,y.push(A)}b/=(l-2)*(d-2);for(var I=0,S=0;S<y.length;S++){var M=y[S]-b;I+=Math.pow(M,2)}var k=Math.sqrt(I/y.length);return 1/(1+Math.pow(2,k/2-10))}});function jN(e){var t,r,n,i,a,o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,c=s.x,l=s.y,d=s.width,p=s.height,f=e.videoWidth,m=e.videoHeight,h=window.innerWidth,v=window.innerHeight,b=h/v,y=f/m;b<y?(a=c*(n=f/h),o=(l-(t=(v-h/y)/2))*(i=m/(v-2*t))):(a=(c-(r=(h-v*y)/2))*(n=f/(h-2*r)),o=l*(i=m/v));var g=d*n,q=p*i,A=g,I=q,S=Math.max(g,q)*u;return{lostX:r,lostY:t,cropWidth:g=Math.floor(Math.min(f,g+2*S)),cropHeight:q=Math.floor(Math.min(m,q+2*S)),cropX:a=Math.floor(Math.max(0,a-S)),cropY:o=Math.floor(Math.max(0,o-S)),cropWidthWithoutPadding:A,cropHeightWithoutPadding:I}}var RN=Object.freeze({__proto__:null,analyzeVideoAndWindowSizes:jN,takePicture:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.canvas,n=t.video,i=t.cropArea,a=t.quality,o=void 0===a?1:a;if(r)e=r;else{var s=jN(n,i),u=s.cropWidth,c=s.cropHeight,l=s.cropX,d=s.cropY,p=(e=document.createElement("canvas")).getContext("2d");e.width=u,e.height=c,p.drawImage(n,l,d,u,c,0,0,u,c)}return new Promise((function(t){e.toBlob(t,"image/jpeg",o)}))}}),XN=function(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=[e[r],e[t]];e[t]=n[0],e[r]=n[1]}return e},BN=Object.freeze({__proto__:null,shuffleArray:XN}),GN={NONE:0,PARTIAL:1,FULL:2},YN=function(e,t){var r=xx(e,2),n=r[0],i=r[1],a=xx(t,2),o=a[0],s=a[1];return n>s||o>i?0:n<=o&&s<=i?2:1};function HN(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=xx(e,2),i=n[0],a=n[1],o=xx(t,2),s=o[0],u=o[1],c=[i[0],a[0]],l=[i[1],a[1]],d=[s[0],u[0]],p=[s[1],u[1]],f=[c[0]+r,c[1]-r],m=[l[0]+r,l[1]-.8*r];return 2===YN(f,d)&&2===YN(m,p)?GN.FULL:0===YN(c,d)||0===YN(l,p)?GN.NONE:GN.PARTIAL}function FN(e){var t=e.small,r=t.coords,n=t.area,i=e.big,a=i.coords,o=i.area,s=n;if(!s){var u=xx(r,2),c=u[0],l=u[1];s=(l[0]-c[0])*(l[1]-c[1])}var d=o;if(!d){var p=xx(a,2),f=p[0],m=p[1];d=(m[0]-f[0])*(m[1]-f[1])}return s/d}function UN(e,t){var r=xx(e,2),n=r[0],i=r[1],a=xx(t,2),o=a[0],s=a[1],u=i[0]-n[0],c=i[1]-n[1],l=s[0]-o[0];return u/l<c/l?u/l:c/l}var DN=Object.freeze({__proto__:null,ContainMode:GN,rectContains:HN,rectAreaRatio:FN,rectEdgeRatio:UN,isFaceCenter:function(e,t){var r=xx(e,2),n=r[0],i=r[1],a=xx(t,2),o=a[0],s=a[1],u=i[0]-n[0],c=i[1]-n[1],l=s[0]-o[0],d=Math.abs(n[0]-(l-u)/2)/l<.2,p=Math.abs(n[1]-(l-c)/2)/l<.2;return!(!d||!p)}});function JN(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function QN(e,t){return[e[0]-t[0],e[1]-t[1]]}function _N(e){var t=e.landmarks,r=e.getPerfectFrontal,n=e.upDownBound,i=void 0===n?{lower:.42,upper:.7}:n,a=function(e){var t,r,n,i,a,o,s=xx(e,4),u=s[0],c=s[1],l=s[2],d=s[3],p=QN(c,u),f=JN(p),m=(n=c,2,[(t=[(r=u)[0]+n[0],r[1]+n[1]])[0]/2,t[1]/2]),h=QN(l,m),v=JN(QN(d,l)),b=QN(d,m),y=JN(b),g=(h[0]*b[0]+h[1]*b[1])/y,q=v/y;if(f>.5*y)i=(h[0]*p[0]+h[1]*p[1])/f/f;else{var A=JN(QN(h,function(e,t){return[e[0]*t,e[1]*t]}(b,g/y)));o=b,i=((a=h)[0]*o[1]-o[0]*a[1]>=0?1:-1)*A/f}return{left_right_score:i,up_down_score:q}}(t),o=a.left_right_score,s=a.up_down_score,u=xx(t,3),c=u[0],l=u[1],d=u[2],p=l[0]-d[0],f=c[0]-d[0],m=r?.1:.3,h=s>i.upper,v=s<i.lower,b=o>=.35&&o<=.6,y=o<=-.35&&o>=-.6,g=h&&!y&&!b,q=v&&!y&&!b,A=y&&!h&&!v,I=b&&!h&&!v;return s>=i.lower&&s<=i.upper&&o>-m&&o<m&&p*f<0?{gesture:hx.FRONTAL,leftRightScore:o}:g?{gesture:hx.UP,leftRightScore:o}:q?{gesture:hx.DOWN,leftRightScore:o}:I?{gesture:hx.RIGHT,leftRightScore:o}:A?{gesture:hx.LEFT,leftRightScore:o}:null}function $N(e){var t,r,n,i=e.predictions,a=e.width,o=e.height,s=e.cropAreaCoordinates,u=null!=s?s:[[0,0],[a,o]],c=i.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,i=t.probability,a=t.landmarks;return i<.9||a.length<6||FN({small:{coords:[r,n]},big:{coords:u}})<=.025?e[GN.NONE].push(t):e[HN(u,[r,n])].push(t),e}),Zx(Zx(Zx({},GN.PARTIAL,[]),GN.FULL,[]),GN.NONE,[])),l=c[GN.FULL].length,d=c[GN.PARTIAL].length;if(0===l)t=d>0?mx.partial_face:mx.no_face;else if(l+d>1)t=mx.multiple_faces;else{var p=r=c[GN.FULL][0];(n=UN([p.topLeft,p.bottomRight],u))<.4&&(t=mx.face_too_small),n>.61&&(t=mx.face_too_large),HN(u,function(e){var t,r,n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],c=.5*(n[1]+i[1]),l=c+1.5*(c-o[1]),d=o[1]-1.2*(a[1]-o[1]),p=[n[0],i[0],a[0],o[0],s[0],u[0]],f=Math.min.apply(Math,p),m=Math.min(l,d),h=Math.max.apply(Math,p),v=Math.max(l,d),b=Math.abs(o[0]-s[0])/Math.abs(o[0]-u[0]),y=o[0]-s[0]<0&&u[0]-o[0]>.05*(h-f);return o[0]-s[0]>0&&u[0]-o[0]<-.05*(h-f)?(t=.2,r=.1):y?(t=.1,r=.2):b>2||b<.5?(t=.15,r=.15):(t=.05,r=.05),[[f-t*(h-f),m],[h+r*(h-f),v]]}(r.landmarks),.05*a)!==GN.FULL&&(t=mx.face_out_of_box)}return{ratio:n,error:t,fullFace:r,faceRatio:n,faceNotFrontalMinThreshold:.38}}function eP(e,t){var r=t.customInstructions,n=t.customIcon,i=t.customDirectionIcon,a=t.customStepTimeConstraints,o={};return null!=r&&r[e]&&(o.instructions=r[e]),null!=n&&n[e]&&(o.icon=n[e]),null!=i&&i[e]&&(o.directionIcon=i[e]),null!=a&&a[e]&&(o.stepTimeConstraints=a[e]),o}function tP(){return(tP=Mx(qx().mark((function e(t){return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ON){e.next=2;break}return e.abrupt("return",$N(t));case 2:return e.abrupt("return",ON.validatePredictionsFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rP(){return(rP=Mx(qx().mark((function e(t){return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ON){e.next=2;break}return e.abrupt("return",_N(t));case 2:return e.abrupt("return",ON.calculateFaceDirectionFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var nP=Object.freeze({__proto__:null,cropFaceInsideBox:function(e,t){var r=xx(e,2),n=r[0],i=r[1],a=xx(t,2),o=a[0],s=a[1];return[[Math.max(n[0],o[0]),Math.max(n[1],o[1])],[Math.min(i[0],s[0]),Math.min(i[1],s[1])]]},calculateFaceArea:function(e){var t=e.topLeft,r=e.bottomRight;return(r[0]-t[0])*(r[1]-t[1])},initFaceVerificationData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.assetRoot,r=void 0===t?"/":t,n=e.customInstructions,i=e.customIcon,a=e.customDirectionIcon,o=e.customStepTimeConstraints,s=e.Locale,u=e.lang;return{curStepIndex:0,steps:[].concat(Ex(XN([gx({name:hx.LEFT,instructions:Zx({},u,null==s?void 0:s[null==hx?void 0:hx.LEFT]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:UW(r,"ic_face_left.svg"),directionIcon:UW(r,"arrow_left.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},eP(hx.LEFT,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o})),gx({name:hx.RIGHT,instructions:Zx({},u,null==s?void 0:s[null==hx?void 0:hx.RIGHT]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:UW(r,"ic_face_right.svg"),directionIcon:UW(r,"arrow_right.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},eP(hx.RIGHT,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o})),gx({name:hx.UP,instructions:Zx({},u,null==s?void 0:s[null==hx?void 0:hx.UP]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:UW(r,"ic_face_up.svg"),directionIcon:UW(r,"arrow_up.svg"),directionIconAnimation:"slide-vertical",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},eP(hx.UP,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o}))])),[gx({name:hx.FRONTAL,instructions:Zx({},u,null==s?void 0:s[null==hx?void 0:hx.FRONTAL]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:UW(r,"ic_face_frontal.svg"),directionIcon:UW(r,"frontal.svg"),directionIconAnimation:"blink",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},eP(hx.FRONTAL,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o}))])}},validatePredictions:function(e){return tP.apply(this,arguments)},calculateFaceDirection:function(e){return rP.apply(this,arguments)},faceTracker:function(){var e=[],t=[],r=[],n=[],i=[],a=0,o=0;function s(){o=a,r=Ex(e),n=Ex(t)}return function(u,c){var l=u.topLeft,d=u.bottomRight,p=u.landmarks,f=[],m=xx(l,2);f[0]=m[0],f[1]=m[1];var h=xx(d,2);f[2]=h[0],f[3]=h[1];var v=[],b=[];p.forEach((function(e,t){var r=xx(e,2);v[t]=r[0],b[t]=r[1]})),a=Date.now();var y=f[2]-f[0];if(e=[].concat(v),t=[].concat(b),!r.length&&!n.length||c)return s(),{score:0,time:a};for(var g=0;g<6;g++)i[g]=Math.sqrt((e[g]-r[g])*(e[g]-r[g])+(t[g]-n[g])*(t[g]-n[g]));for(var q=0;q<6;q++)i[q]/=(a-o)*y;for(var A=0,I=0;I<6;I++)A+=i[I];return A/=6,s(),{score:A,time:a}}}}),iP=function(){var e=Mx(qx().mark((function e(t){var r,n;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.model,n=t.sCanvas,e.abrupt("return",r.estimateFaces(n,!1,!1,!0));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),aP=Object.freeze({__proto__:null,SIZE:400,getModelPredictions:iP}),oP=Object.getOwnPropertySymbols,sP=Object.prototype.hasOwnProperty,uP=Object.prototype.propertyIsEnumerable;function cP(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var lP,dP=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,i=cP(e),a=1;a<arguments.length;a++){for(var o in r=Object(arguments[a]))sP.call(r,o)&&(i[o]=r[o]);if(oP){n=oP(r);for(var s=0;s<n.length;s++)uP.call(r,n[s])&&(i[n[s]]=r[n[s]])}}return i},pP=arguments[3],fP=arguments[4],mP=arguments[5],hP=JSON.stringify,vP=function(e,t){for(var r,n=Object.keys(mP),i=0,a=n.length;i<a;i++){var o=n[i],s=mP[o].exports;if(s===e||s&&s.default===e){r=o;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var u={};for(i=0,a=n.length;i<a;i++)u[o=n[i]]=o;fP[r]=["function(require,module,exports){"+e+"(self); }",u]}var c=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[r]=r,fP[c]=["function(require,module,exports){var f = require("+hP(r)+");(f.default ? f.default : f)(self);}",l];var d={};!function e(t){for(var r in d[t]=!0,fP[t][1]){var n=fP[t][1][r];d[n]||e(n)}}(c);var p="("+pP+")({"+Object.keys(d).map((function(e){return hP(e)+":["+fP[e][0]+","+hP(fP[e][1])+"]"})).join(",")+"},{},["+hP(c)+"])",f=window.URL||window.webkitURL||window.mozURL||window.msURL,m=new Blob([p],{type:"text/javascript"});if(t&&t.bare)return m;var h=f.createObjectURL(m),v=new Worker(h);return v.objectURL=h,v},bP=Xx((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),yP={js:!0,wasm:!0};function gP(e){if(!(this instanceof gP))return new gP(e);var t=dP({},yP,e||{});if(this.options=t,this.__cache={},this.__init_promise=null,this.__modules=t.modules||{},this.__memory=null,this.__wasm={},this.__isLE=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0],!this.options.js&&!this.options.wasm)throw new Error('mathlib: at least "js" or "wasm" should be enabled')}gP.prototype.has_wasm=function(){if(void 0!==lP)return lP;if(lP=!1,"undefined"==typeof WebAssembly)return lP;try{var e=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),t=new WebAssembly.Module(e);return 0!==new WebAssembly.Instance(t,{}).exports.test(4)&&(lP=!0),lP}catch(e){}return lP},gP.prototype.use=function(e){return this.__modules[e.name]=e,this.options.wasm&&this.has_wasm()&&e.wasm_fn?this[e.name]=e.wasm_fn:this[e.name]=e.fn,this},gP.prototype.init=function(){if(this.__init_promise)return this.__init_promise;if(!this.options.js&&this.options.wasm&&!this.has_wasm())return Promise.reject(new Error('mathlib: only "wasm" was enabled, but it\'s not supported'));var e=this;return this.__init_promise=Promise.all(Object.keys(e.__modules).map((function(t){var r=e.__modules[t];return e.options.wasm&&e.has_wasm()&&r.wasm_fn?e.__wasm[t]?null:WebAssembly.compile(e.__base64decode(r.wasm_src)).then((function(r){e.__wasm[t]=r})):null}))).then((function(){return e})),this.__init_promise},gP.prototype.__base64decode=function(e){for(var t=e.replace(/[\r\n=]/g,""),r=t.length,n=new Uint8Array(3*r>>2),i=0,a=0,o=0;o<r;o++)o%4==0&&o&&(n[a++]=i>>16&255,n[a++]=i>>8&255,n[a++]=255&i),i=i<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t.charAt(o));var s=r%4*6;return 0===s?(n[a++]=i>>16&255,n[a++]=i>>8&255,n[a++]=255&i):18===s?(n[a++]=i>>10&255,n[a++]=i>>2&255):12===s&&(n[a++]=i>>4&255),n},gP.prototype.__reallocate=function(e){if(!this.__memory)return this.__memory=new WebAssembly.Memory({initial:Math.ceil(e/65536)}),this.__memory;var t=this.__memory.buffer.byteLength;return t<e&&this.__memory.grow(Math.ceil((e-t)/65536)),this.__memory},gP.prototype.__instance=function(e,t,r){if(t&&this.__reallocate(t),!this.__wasm[e]){var n=this.__modules[e];this.__wasm[e]=new WebAssembly.Module(this.__base64decode(n.wasm_src))}if(!this.__cache[e]){var i={memoryBase:0,memory:this.__memory,tableBase:0,table:new WebAssembly.Table({initial:0,element:"anyfunc"})};this.__cache[e]=new WebAssembly.Instance(this.__wasm[e],{env:dP(i,r||{})})}return this.__cache[e]},gP.prototype.__align=function(e,t){var r=e%(t=t||8);return e+(r?t-r:0)};var qP,AP,IP,SP,MP,kP,CP=gP;function zP(e,t,r,n,i,a){var o,s,u,c,l,d,p,f,m,h,v,b,y,g;for(m=0;m<a;m++){for(p=m,f=0,c=l=(o=e[d=m*i])*n[6],v=n[0],b=n[1],y=n[4],g=n[5],h=0;h<i;h++)u=(s=e[d])*v+o*b+c*y+l*g,l=c,c=u,o=s,r[f]=c,f++,d++;for(f--,p+=a*(i-1),c=l=(o=e[--d])*n[7],s=o,v=n[2],b=n[3],h=i-1;h>=0;h--)u=s*v+o*b+c*y+l*g,l=c,c=u,o=s,s=e[d],t[p]=r[f]+c,d--,f--,p-=a}}var ZP={name:"unsharp_mask",fn:function(e,t,r,n,i,a){var o,s,u,c,l,d,p,f,m,h,v,b,y;if(!(0===n||i<.5)){i>2&&(i=2);var g=function(e,t,r){for(var n,i,a,o,s,u=t*r,c=new Uint16Array(u),l=0;l<u;l++)n=e[4*l],i=e[4*l+1],a=e[4*l+2],s=n>=i&&n>=a?n:i>=a&&i>=n?i:a,o=n<=i&&n<=a?n:i<=a&&i<=n?i:a,c[l]=257*(s+o)>>1;return c}(e,t,r),q=new Uint16Array(g);!function(e,t,r,n){if(n){var i=new Uint16Array(e.length),a=new Float32Array(Math.max(t,r)),o=function(e){e<.5&&(e=.5);var t=Math.exp(.527076)/e,r=Math.exp(-t),n=Math.exp(-2*t),i=(1-r)*(1-r)/(1+2*t*r-n);return qP=i,AP=i*(t-1)*r,IP=i*(t+1)*r,SP=-i*n,MP=2*r,kP=-n,new Float32Array([qP,AP,IP,SP,MP,kP,(qP+AP)/(1-MP-kP),(IP+SP)/(1-MP-kP)])}(n);zP(e,i,a,o,t,r),zP(i,e,a,o,r,t)}}(q,t,r,i);for(var A=n/100*4096+.5|0,I=257*a|0,S=t*r,M=0;M<S;M++)b=2*(g[M]-q[M]),Math.abs(b)>=I&&(o=e[y=4*M],s=e[y+1],u=e[y+2],d=257*((f=o>=s&&o>=u?o:s>=o&&s>=u?s:u)+(p=o<=s&&o<=u?o:s<=o&&s<=u?s:u))>>1,p===f?c=l=0:(l=d<=32767?4095*(f-p)/(f+p)|0:4095*(f-p)/(510-f-p)|0,c=o===f?65535*(s-u)/(6*(f-p))|0:s===f?21845+(65535*(u-o)/(6*(f-p))|0):43690+(65535*(o-s)/(6*(f-p))|0)),(d+=A*b+2048>>12)>65535?d=65535:d<0&&(d=0),0===l?o=s=u=d>>8:(m=2*d-(h=d<=32767?d*(4096+l)+2048>>12:d+((65535-d)*l+2048>>12))>>8,h>>=8,o=(v=c+21845&65535)>=43690?m:v>=32767?m+(6*(h-m)*(43690-v)+32768>>16):v>=10922?h:m+(6*(h-m)*v+32768>>16),s=(v=65535&c)>=43690?m:v>=32767?m+(6*(h-m)*(43690-v)+32768>>16):v>=10922?h:m+(6*(h-m)*v+32768>>16),u=(v=c-21845&65535)>=43690?m:v>=32767?m+(6*(h-m)*(43690-v)+32768>>16):v>=10922?h:m+(6*(h-m)*v+32768>>16)),e[y]=o,e[y+1]=s,e[y+2]=u)}},wasm_fn:function(e,t,r,n,i,a){if(!(0===n||i<.5)){i>2&&(i=2);var o=t*r,s=4*o,u=2*o,c=2*o,l=4*Math.max(t,r),d=s,p=d+u,f=p+c,m=f+c,h=m+l,v=this.__instance("unsharp_mask",s+u+2*c+l+32,{exp:Math.exp}),b=new Uint32Array(e.buffer);new Uint32Array(this.__memory.buffer).set(b);var y=v.exports.hsl_l16||v.exports._hsl_l16;y(0,d,t,r),(y=v.exports.blurMono16||v.exports._blurMono16)(d,p,f,m,h,t,r,i),(y=v.exports.unsharp||v.exports._unsharp)(0,0,d,p,t,r,n,a),b.set(new Uint32Array(this.__memory.buffer,0,o))}},wasm_src:"AGFzbQEAAAABMQZgAXwBfGACfX8AYAZ/f39/f38AYAh/f39/f39/fQBgBH9/f38AYAh/f39/f39/fwACGQIDZW52A2V4cAAAA2VudgZtZW1vcnkCAAEDBgUBAgMEBQQEAXAAAAdMBRZfX2J1aWxkX2dhdXNzaWFuX2NvZWZzAAEOX19nYXVzczE2X2xpbmUAAgpibHVyTW9ubzE2AAMHaHNsX2wxNgAEB3Vuc2hhcnAABQkBAAqJEAXZAQEGfAJAIAFE24a6Q4Ia+z8gALujIgOaEAAiBCAEoCIGtjgCECABIANEAAAAAAAAAMCiEAAiBbaMOAIUIAFEAAAAAAAA8D8gBKEiAiACoiAEIAMgA6CiRAAAAAAAAPA/oCAFoaMiArY4AgAgASAEIANEAAAAAAAA8L+gIAKioiIHtjgCBCABIAQgA0QAAAAAAADwP6AgAqKiIgO2OAIIIAEgBSACoiIEtow4AgwgASACIAegIAVEAAAAAAAA8D8gBqGgIgKjtjgCGCABIAMgBKEgAqO2OAIcCwu3AwMDfwR9CHwCQCADKgIUIQkgAyoCECEKIAMqAgwhCyADKgIIIQwCQCAEQX9qIgdBAEgiCA0AIAIgAC8BALgiDSADKgIYu6IiDiAJuyIQoiAOIAq7IhGiIA0gAyoCBLsiEqIgAyoCALsiEyANoqCgoCIPtjgCACACQQRqIQIgAEECaiEAIAdFDQAgBCEGA0AgAiAOIBCiIA8iDiARoiANIBKiIBMgAC8BALgiDaKgoKAiD7Y4AgAgAkEEaiECIABBAmohACAGQX9qIgZBAUoNAAsLAkAgCA0AIAEgByAFbEEBdGogAEF+ai8BACIIuCINIAu7IhGiIA0gDLsiEqKgIA0gAyoCHLuiIg4gCrsiE6KgIA4gCbsiFKKgIg8gAkF8aioCALugqzsBACAHRQ0AIAJBeGohAiAAQXxqIQBBACAFQQF0ayEHIAEgBSAEQQF0QXxqbGohBgNAIAghAyAALwEAIQggBiANIBGiIAO4Ig0gEqKgIA8iECAToqAgDiAUoqAiDyACKgIAu6CrOwEAIAYgB2ohBiAAQX5qIQAgAkF8aiECIBAhDiAEQX9qIgRBAUoNAAsLCwvfAgIDfwZ8AkAgB0MAAAAAWw0AIARE24a6Q4Ia+z8gB0MAAAA/l7ujIgyaEAAiDSANoCIPtjgCECAEIAxEAAAAAAAAAMCiEAAiDraMOAIUIAREAAAAAAAA8D8gDaEiCyALoiANIAwgDKCiRAAAAAAAAPA/oCAOoaMiC7Y4AgAgBCANIAxEAAAAAAAA8L+gIAuioiIQtjgCBCAEIA0gDEQAAAAAAADwP6AgC6KiIgy2OAIIIAQgDiALoiINtow4AgwgBCALIBCgIA5EAAAAAAAA8D8gD6GgIgujtjgCGCAEIAwgDaEgC6O2OAIcIAYEQCAFQQF0IQogBiEJIAIhCANAIAAgCCADIAQgBSAGEAIgACAKaiEAIAhBAmohCCAJQX9qIgkNAAsLIAVFDQAgBkEBdCEIIAUhAANAIAIgASADIAQgBiAFEAIgAiAIaiECIAFBAmohASAAQX9qIgANAAsLC7wBAQV/IAMgAmwiAwRAQQAgA2shBgNAIAAoAgAiBEEIdiIHQf8BcSECAn8gBEH/AXEiAyAEQRB2IgRB/wFxIgVPBEAgAyIIIAMgAk8NARoLIAQgBCAHIAIgA0kbIAIgBUkbQf8BcQshCAJAIAMgAk0EQCADIAVNDQELIAQgByAEIAMgAk8bIAIgBUsbQf8BcSEDCyAAQQRqIQAgASADIAhqQYECbEEBdjsBACABQQJqIQEgBkEBaiIGDQALCwvTBgEKfwJAIAazQwAAgEWUQwAAyEKVu0QAAAAAAADgP6CqIQ0gBSAEbCILBEAgB0GBAmwhDgNAQQAgAi8BACADLwEAayIGQQF0IgdrIAcgBkEASBsgDk8EQCAAQQJqLQAAIQUCfyAALQAAIgYgAEEBai0AACIESSIJRQRAIAYiCCAGIAVPDQEaCyAFIAUgBCAEIAVJGyAGIARLGwshCAJ/IAYgBE0EQCAGIgogBiAFTQ0BGgsgBSAFIAQgBCAFSxsgCRsLIgogCGoiD0GBAmwiEEEBdiERQQAhDAJ/QQAiCSAIIApGDQAaIAggCmsiCUH/H2wgD0H+AyAIayAKayAQQYCABEkbbSEMIAYgCEYEQCAEIAVrQf//A2wgCUEGbG0MAQsgBSAGayAGIARrIAQgCEYiBhtB//8DbCAJQQZsbUHVqgFBqtUCIAYbagshCSARIAcgDWxBgBBqQQx1aiIGQQAgBkEAShsiBkH//wMgBkH//wNIGyEGAkACfwJAIAxB//8DcSIFBEAgBkH//wFKDQEgBUGAIGogBmxBgBBqQQx2DAILIAZBCHYiBiEFIAYhBAwCCyAFIAZB//8Dc2xBgBBqQQx2IAZqCyIFQQh2IQcgBkEBdCAFa0EIdiIGIQQCQCAJQdWqAWpB//8DcSIFQanVAksNACAFQf//AU8EQEGq1QIgBWsgByAGa2xBBmxBgIACakEQdiAGaiEEDAELIAchBCAFQanVAEsNACAFIAcgBmtsQQZsQYCAAmpBEHYgBmohBAsCfyAGIgUgCUH//wNxIghBqdUCSw0AGkGq1QIgCGsgByAGa2xBBmxBgIACakEQdiAGaiAIQf//AU8NABogByIFIAhBqdUASw0AGiAIIAcgBmtsQQZsQYCAAmpBEHYgBmoLIQUgCUGr1QJqQf//A3EiCEGp1QJLDQAgCEH//wFPBEBBqtUCIAhrIAcgBmtsQQZsQYCAAmpBEHYgBmohBgwBCyAIQanVAEsEQCAHIQYMAQsgCCAHIAZrbEEGbEGAgAJqQRB2IAZqIQYLIAEgBDoAACABQQFqIAU6AAAgAUECaiAGOgAACyADQQJqIQMgAkECaiECIABBBGohACABQQRqIQEgC0F/aiILDQALCwsL"},wP=[{win:.5,filter:function(e){return e>=-.5&&e<.5?1:0}},{win:1,filter:function(e){if(e<=-1||e>=1)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*(.54+.46*Math.cos(t/1))}},{win:2,filter:function(e){if(e<=-2||e>=2)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*Math.sin(t/2)/(t/2)}},{win:3,filter:function(e){if(e<=-3||e>=3)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*Math.sin(t/3)/(t/3)}}];function xP(e){return Math.round(16383*e)}var EP=function(e,t,r,n,i){var a,o,s,u,c,l,d,p,f,m,h,v,b,y,g,q,A,I=wP[e].filter,S=1/n,M=Math.min(1,n),k=wP[e].win/M,C=Math.floor(2*(k+1)),z=new Int16Array((C+2)*r),Z=0,w=!z.subarray||!z.set;for(a=0;a<r;a++){for(o=(a+.5)*S+i,s=Math.max(0,Math.floor(o-k)),c=(u=Math.min(t-1,Math.ceil(o+k)))-s+1,l=new Float32Array(c),d=new Int16Array(c),p=0,f=s,m=0;f<=u;f++,m++)p+=h=I((f+.5-o)*M),l[m]=h;for(v=0,m=0;m<l.length;m++)v+=b=l[m]/p,d[m]=xP(b);for(d[r>>1]+=xP(1-v),y=0;y<d.length&&0===d[y];)y++;if(y<d.length){for(g=d.length-1;g>0&&0===d[g];)g--;if(q=s+y,A=g-y+1,z[Z++]=q,z[Z++]=A,w)for(m=y;m<=g;m++)z[Z++]=d[m];else z.set(d.subarray(y,g+1),Z),Z+=A}else z[Z++]=0,z[Z++]=0}return z};function OP(e){return e<0?0:e>255?255:e}var KP=!0;try{KP=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(e){}function WP(e,t,r){if(KP)t.set(function(e){return new Uint8Array(e.buffer,0,e.byteLength)}(e),r);else for(var n=r,i=0;i<e.length;i++){var a=e[i];t[n++]=255&a,t[n++]=a>>8&255}}var VP={name:"resize",fn:function(e){var t=e.src,r=e.width,n=e.height,i=e.toWidth,a=e.toHeight,o=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,u=e.offsetX||0,c=e.offsetY||0,l=e.dest||new Uint8Array(i*a*4),d=void 0===e.quality?3:e.quality,p=e.alpha||!1,f=EP(d,r,i,o,u),m=EP(d,n,a,s,c),h=new Uint8Array(i*n*4);return function(e,t,r,n,i,a){var o,s,u,c,l,d,p,f,m,h,v,b=0,y=0;for(m=0;m<n;m++){for(l=0,h=0;h<i;h++){for(d=a[l++],p=a[l++],f=b+4*d|0,o=s=u=c=0;p>0;p--)c=c+(v=a[l++])*e[f+3]|0,u=u+v*e[f+2]|0,s=s+v*e[f+1]|0,o=o+v*e[f]|0,f=f+4|0;t[y+3]=OP(c+8192>>14),t[y+2]=OP(u+8192>>14),t[y+1]=OP(s+8192>>14),t[y]=OP(o+8192>>14),y=y+4*n|0}y=4*(m+1)|0,b=(m+1)*r*4|0}}(t,h,r,n,i,f),function(e,t,r,n,i,a){var o,s,u,c,l,d,p,f,m,h,v,b=0,y=0;for(m=0;m<n;m++){for(l=0,h=0;h<i;h++){for(d=a[l++],p=a[l++],f=b+4*d|0,o=s=u=c=0;p>0;p--)c=c+(v=a[l++])*e[f+3]|0,u=u+v*e[f+2]|0,s=s+v*e[f+1]|0,o=o+v*e[f]|0,f=f+4|0;t[y+3]=OP(c+8192>>14),t[y+2]=OP(u+8192>>14),t[y+1]=OP(s+8192>>14),t[y]=OP(o+8192>>14),y=y+4*n|0}y=4*(m+1)|0,b=(m+1)*r*4|0}}(h,l,n,i,a,m),p||function(e,t,r){for(var n=3,i=t*r*4|0;n<i;)e[n]=255,n=n+4|0}(l,i,a),l},wasm_fn:function(e){var t=e.src,r=e.width,n=e.height,i=e.toWidth,a=e.toHeight,o=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,u=e.offsetX||0,c=e.offsetY||0,l=e.dest||new Uint8Array(i*a*4),d=void 0===e.quality?3:e.quality,p=e.alpha||!1,f=EP(d,r,i,o,u),m=EP(d,n,a,s,c),h=this.__align(0+Math.max(t.byteLength,l.byteLength)),v=this.__align(h+n*i*4),b=this.__align(v+f.byteLength),y=b+m.byteLength,g=this.__instance("resize",y),q=new Uint8Array(this.__memory.buffer),A=new Uint32Array(this.__memory.buffer),I=new Uint32Array(t.buffer);return A.set(I),WP(f,q,v),WP(m,q,b),(g.exports.convolveHV||g.exports._convolveHV)(v,b,h,r,n,i,a),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,a*i)),p||function(e,t,r){for(var n=3,i=t*r*4|0;n<i;)e[n]=255,n=n+4|0}(l,i,a),l},wasm_src:"AGFzbQEAAAABFAJgBn9/f39/fwBgB39/f39/f38AAg8BA2VudgZtZW1vcnkCAAEDAwIAAQQEAXAAAAcZAghjb252b2x2ZQAACmNvbnZvbHZlSFYAAQkBAArmAwLBAwEQfwJAIANFDQAgBEUNACAFQQRqIRVBACEMQQAhDQNAIA0hDkEAIRFBACEHA0AgB0ECaiESAn8gBSAHQQF0IgdqIgZBAmouAQAiEwRAQQAhCEEAIBNrIRQgFSAHaiEPIAAgDCAGLgEAakECdGohEEEAIQlBACEKQQAhCwNAIBAoAgAiB0EYdiAPLgEAIgZsIAtqIQsgB0H/AXEgBmwgCGohCCAHQRB2Qf8BcSAGbCAKaiEKIAdBCHZB/wFxIAZsIAlqIQkgD0ECaiEPIBBBBGohECAUQQFqIhQNAAsgEiATagwBC0EAIQtBACEKQQAhCUEAIQggEgshByABIA5BAnRqIApBgMAAakEOdSIGQf8BIAZB/wFIG0EQdEGAgPwHcUEAIAZBAEobIAtBgMAAakEOdSIGQf8BIAZB/wFIG0EYdEEAIAZBAEobciAJQYDAAGpBDnUiBkH/ASAGQf8BSBtBCHRBgP4DcUEAIAZBAEobciAIQYDAAGpBDnUiBkH/ASAGQf8BSBtB/wFxQQAgBkEAShtyNgIAIA4gA2ohDiARQQFqIhEgBEcNAAsgDCACaiEMIA1BAWoiDSADRw0ACwsLIQACQEEAIAIgAyAEIAUgABAAIAJBACAEIAUgBiABEAALCw=="};function TP(e){var t=e||[],r={js:t.indexOf("js")>=0,wasm:t.indexOf("wasm")>=0};CP.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(ZP),this.use(VP)}bP(TP,CP),TP.prototype.resizeAndUnsharp=function(e,t){var r=this.resize(e,t);return e.unsharpAmount&&this.unsharp_mask(r,e.toWidth,e.toHeight,e.unsharpAmount,e.unsharpRadius,e.unsharpThreshold),r};var LP=TP;function NP(e,t){this.create=e,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=t||2e3}NP.prototype.acquire=function(){var e,t=this;return 0!==this.available.length?e=this.available.pop():((e=this.create()).id=this.lastId++,e.release=function(){return t.release(e)}),this.acquired[e.id]=e,e},NP.prototype.release=function(e){var t=this;delete this.acquired[e.id],e.lastUsed=Date.now(),this.available.push(e),0===this.timeoutId&&(this.timeoutId=setTimeout((function(){return t.gc()}),100))},NP.prototype.gc=function(){var e=this,t=Date.now();this.available=this.available.filter((function(r){return!(t-r.lastUsed>e.idle&&(r.destroy(),1))})),0!==this.available.length?this.timeoutId=setTimeout((function(){return e.gc()}),100):this.timeoutId=0};var PP=NP;function jP(e){return Object.prototype.toString.call(e)}var RP=function(e){var t=jP(e);return"[object HTMLCanvasElement]"===t||"[object OffscreenCanvas]"===t||"[object Canvas]"===t},XP=function(e){switch(e){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},BP=function(){var e,t=LP;onmessage=function(r){var n=r.data.opts;e||(e=new t(r.data.features));var i=e.resizeAndUnsharp(n);postMessage({result:i},[i.buffer])}};function GP(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.floor(e)}function YP(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.ceil(e)}var HP={},FP=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(FP=navigator.userAgent.indexOf("Safari")>=0)}catch(gZ){}var UP=1;"undefined"!=typeof navigator&&(UP=Math.min(navigator.hardwareConcurrency||1,4));var DP,JP,QP={tile:1024,concurrency:UP,features:["js","wasm","ww"],idle:2e3,createCanvas:function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r}},_P={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0};function $P(){return{value:vP(BP),destroy:function(){if(this.value.terminate(),"undefined"!=typeof window){var e=window.URL||window.webkitURL||window.mozURL||window.msURL;e&&e.revokeObjectURL&&this.value.objectURL&&e.revokeObjectURL(this.value.objectURL)}}}}function ej(e){if(!(this instanceof ej))return new ej(e);this.options=dP({},QP,e||{});var t="lk_".concat(this.options.concurrency);this.__limit=HP[t]||function(e){var t=0,r=[];function n(){t<e&&r.length&&(t++,r.shift()())}return function(e){return new Promise((function(i,a){r.push((function(){e().then((function(e){i(e),t--,n()}),(function(e){a(e),t--,n()}))})),n()}))}}(this.options.concurrency),HP[t]||(HP[t]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}ej.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if(!1!==DP&&!0!==DP&&(DP=!1,"undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray))try{new ImageData(new Uint8ClampedArray(400),10,10),DP=!0}catch(t){}!1!==JP&&!0!==JP&&(JP=!1,"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?JP=!0:this.debug("ImageBitmap does not support .close(), disabled")));var t=this.options.features.slice();if(t.indexOf("all")>=0&&(t=["cib","wasm","js","ww"]),this.__requested_features=t,this.__mathlib=new LP(t),t.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{vP((function(){})).terminate(),this.features.ww=!0;var r="wp_".concat(JSON.stringify(this.options));HP[r]?this.__workersPool=HP[r]:(this.__workersPool=new PP($P,this.options.idle),HP[r]=this.__workersPool)}catch(t){}var n,i=this.__mathlib.init().then((function(t){dP(e.features,t.features)}));return n=JP?function(e){return Promise.resolve().then((function(){if("undefined"==typeof createImageBitmap)return!1;var t=e(100,100);return createImageBitmap(t,0,0,100,100,{resizeWidth:10,resizeHeight:10,resizeQuality:"high"}).then((function(e){var r=10===e.width;return e.close(),t=null,r}))})).catch((function(){return!1}))}(this.options.createCanvas).then((function(r){e.features.cib&&t.indexOf("cib")<0?e.debug("createImageBitmap() resize supported, but disabled by config"):t.indexOf("cib")>=0&&(e.features.cib=r)})):Promise.resolve(!1),this.__initPromise=Promise.all([i,n]).then((function(){return e})),this.__initPromise},ej.prototype.resize=function(e,t,r){var n=this;this.debug("Start resize...");var i=dP({},_P);if(isNaN(r)?r&&(i=dP(i,r)):i=dP(i,{quality:r}),i.toWidth=t.width,i.toHeight=t.height,i.width=e.naturalWidth||e.width,i.height=e.naturalHeight||e.height,0===t.width||0===t.height)return Promise.reject(new Error("Invalid output size: ".concat(t.width,"x").concat(t.height)));i.unsharpRadius>2&&(i.unsharpRadius=2);var a=!1,o=null;i.cancelToken&&(o=i.cancelToken.then((function(e){throw a=!0,e}),(function(e){throw a=!0,e})));var s=Math.ceil(Math.max(3,2.5*i.unsharpRadius|0));return this.init().then((function(){if(a)return o;if(n.features.cib){var r=t.getContext("2d",{alpha:Boolean(i.alpha)});return n.debug("Resize via createImageBitmap()"),createImageBitmap(e,{resizeWidth:i.toWidth,resizeHeight:i.toHeight,resizeQuality:XP(i.quality)}).then((function(e){if(a)return o;if(!i.unsharpAmount)return r.drawImage(e,0,0),e.close(),r=null,n.debug("Finished!"),t;n.debug("Unsharp result");var s=n.options.createCanvas(i.toWidth,i.toHeight),u=s.getContext("2d",{alpha:Boolean(i.alpha)});u.drawImage(e,0,0),e.close();var c=u.getImageData(0,0,i.toWidth,i.toHeight);return n.__mathlib.unsharp_mask(c.data,i.toWidth,i.toHeight,i.unsharpAmount,i.unsharpRadius,i.unsharpThreshold),r.putImageData(c,0,0),s.width=s.height=0,c=u=s=r=null,n.debug("Finished!"),t}))}var u={},c=function(e){return Promise.resolve().then((function(){return n.features.ww?new Promise((function(t,r){var i=n.__workersPool.acquire();o&&o.catch((function(e){return r(e)})),i.value.onmessage=function(e){i.release(),e.data.err?r(e.data.err):t(e.data.result)},i.value.postMessage({opts:e,features:n.__requested_features,preload:{wasm_nodule:n.__mathlib.__}},[e.src.buffer])})):n.__mathlib.resizeAndUnsharp(e,u)}))},l=function(e,t,r){var i,u,l,d=!1,p=function(t){return n.__limit((function(){if(a)return o;var s;if(RP(e))n.debug("Get tile pixel data"),s=i.getImageData(t.x,t.y,t.width,t.height);else{n.debug("Draw tile imageBitmap/image to temporary canvas");var d=n.options.createCanvas(t.width,t.height),p=d.getContext("2d",{alpha:Boolean(r.alpha)});p.globalCompositeOperation="copy",p.drawImage(u||e,t.x,t.y,t.width,t.height,0,0,t.width,t.height),n.debug("Get tile pixel data"),s=p.getImageData(0,0,t.width,t.height),d.width=d.height=0,p=d=null}var f={src:s.data,width:t.width,height:t.height,toWidth:t.toWidth,toHeight:t.toHeight,scaleX:t.scaleX,scaleY:t.scaleY,offsetX:t.offsetX,offsetY:t.offsetY,quality:r.quality,alpha:r.alpha,unsharpAmount:r.unsharpAmount,unsharpRadius:r.unsharpRadius,unsharpThreshold:r.unsharpThreshold};return n.debug("Invoke resize math"),Promise.resolve().then((function(){return c(f)})).then((function(e){if(a)return o;var r;if(s=null,n.debug("Convert raw rgba tile result to ImageData"),DP)r=new ImageData(new Uint8ClampedArray(e),t.toWidth,t.toHeight);else if((r=l.createImageData(t.toWidth,t.toHeight)).data.set)r.data.set(e);else for(var i=r.data.length-1;i>=0;i--)r.data[i]=e[i];return n.debug("Draw tile"),FP?l.putImageData(r,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth+1e-5,t.toInnerHeight+1e-5):l.putImageData(r,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth,t.toInnerHeight),null}))}))};return Promise.resolve().then((function(){if(l=t.getContext("2d",{alpha:Boolean(r.alpha)}),RP(e))return i=e.getContext("2d",{alpha:Boolean(r.alpha)}),null;if(function(e){return"[object ImageBitmap]"===jP(e)}(e))return u=e,d=!0,null;if(function(e){return"[object HTMLImageElement]"===jP(e)}(e))return JP?(n.debug("Decode image via createImageBitmap"),createImageBitmap(e).then((function(e){u=e})).catch((function(e){return null}))):null;throw new Error('Pica: ".from" should be Image, Canvas or ImageBitmap')})).then((function(){if(a)return o;n.debug("Calculate tiles");var e=function(e){var t,r,n,i,a,o,s=e.toWidth/e.width,u=e.toHeight/e.height,c=GP(e.srcTileSize*s)-2*e.destTileBorder,l=GP(e.srcTileSize*u)-2*e.destTileBorder;if(c<1||l<1)throw new Error("Internal error in pica: target tile width/height is too small.");var d,p=[];for(i=0;i<e.toHeight;i+=l)for(n=0;n<e.toWidth;n+=c)(t=n-e.destTileBorder)<0&&(t=0),t+(a=n+c+e.destTileBorder-t)>=e.toWidth&&(a=e.toWidth-t),(r=i-e.destTileBorder)<0&&(r=0),r+(o=i+l+e.destTileBorder-r)>=e.toHeight&&(o=e.toHeight-r),d={toX:t,toY:r,toWidth:a,toHeight:o,toInnerX:n,toInnerY:i,toInnerWidth:c,toInnerHeight:l,offsetX:t/s-GP(t/s),offsetY:r/u-GP(r/u),scaleX:s,scaleY:u,x:GP(t/s),y:GP(r/u),width:YP(a/s),height:YP(o/u)},p.push(d);return p}({width:r.width,height:r.height,srcTileSize:n.options.tile,toWidth:r.toWidth,toHeight:r.toHeight,destTileBorder:s}).map((function(e){return p(e)}));function i(){u&&(d||u.close(),u=null)}return n.debug("Process tiles"),Promise.all(e).then((function(){return n.debug("Finished!"),i(),t}),(function(e){throw i(),e}))}))};return function e(t,r,i,s){if(a)return o;var u,c=mv(t.shift(),2),d=c[0],p=c[1],f=0===t.length;return s=dP({},s,{toWidth:d,toHeight:p,quality:f?s.quality:Math.min(1,s.quality)}),f||(u=n.options.createCanvas(d,p)),l(r,f?i:u,s).then((function(){return f?i:(s.width=d,s.height=p,e(t,u,i,s))})).then((function(e){return u&&(u.width=u.height=0),e}))}(function(e,t,r,n,i,a){var o=r/e,s=n/t,u=(2*a+2+1)/i;if(u>.5)return[[r,n]];var c=Math.ceil(Math.log(Math.min(o,s))/Math.log(u));if(c<=1)return[[r,n]];for(var l=[],d=0;d<c;d++){var p=Math.round(Math.pow(Math.pow(e,c-d-1)*Math.pow(r,d+1),1/c)),f=Math.round(Math.pow(Math.pow(t,c-d-1)*Math.pow(n,d+1),1/c));l.push([p,f])}return l}(i.width,i.height,i.toWidth,i.toHeight,n.options.tile,s),e,t,i)}))},ej.prototype.resizeBuffer=function(e){var t=this,r=dP({},_P,e);return this.init().then((function(){return t.__mathlib.resizeAndUnsharp(r)}))},ej.prototype.toBlob=function(e,t,r){return t=t||"image/png",new Promise((function(n){if(e.toBlob)e.toBlob((function(e){return n(e)}),t,r);else if(e.convertToBlob)n(e.convertToBlob({type:t,quality:r}));else{for(var i=atob(e.toDataURL(t,r).split(",")[1]),a=i.length,o=new Uint8Array(a),s=0;s<a;s++)o[s]=i.charCodeAt(s);n(new Blob([o],{type:t}))}}))},ej.prototype.debug=function(){};var tj=new ej,rj=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.minSize,i=void 0===n?720:n,a=e/t;return e>t?{desW:Math.floor(i*a),desH:i}:{desW:i,desH:Math.floor(i/a)}},nj=Object.freeze({__proto__:null,scaleImage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.minSize,n=void 0===r?720:r;return new Promise((function(t){var r=URL.createObjectURL(e),i=new Image;i.src=r;var a=document.createElement("canvas");i.onload=function(){if(i.width&&i.height&&(i.width<n||i.height<n)){var e=rj(i.width,i.height,{minSize:n}),r=e.desW,o=e.desH;a.width=r,a.height=o,tj.resize(i,a).then((function(e){return tj.toBlob(e,"image/jpeg",1)})).then((function(e){return t(e)}))}else t(null)}}))},createResizer:function(e){var t=e.width,r=e.height,n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=r,{resize:function(e){var t=e.srcCanvas;return i.drawImage(t,0,0,n.width,n.height),n}}},resizeBlobImg:function(e,t,r){var n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=r,new Promise((function(t){var r=URL.createObjectURL(e),a=new Image;a.onload=function(){URL.revokeObjectURL(r),i.drawImage(a,0,0,n.width,n.height),n.toBlob(t,"image/jpeg",1)},a.src=r}))},blobToCanvas:function(e){var t=e.blob;return new Promise((function(e){var r=document.createElement("canvas"),n=r.getContext("2d"),i=new Image;i.onload=function(t){var a=i.width,o=i.height;r.width=a,r.height=o,URL.revokeObjectURL(t.target.src),n.drawImage(t.target,0,0),e(r)},i.src=URL.createObjectURL(t)}))}});function ij(e,t,r,n){var i=r*(4*t)+4*n;return{r:e[i],g:e[i+1],b:e[i+2]}}function aj(e,t,r){return function(e,t,r){for(var n=0,i=r[1],a=r[3],o=r[0],s=r[2],u=i;u<a;u++)for(var c=o;c<s;c++){var l=ij(e,t,u,c),d=l.r,p=l.g,f=l.b;d>=245&&f>=245&&p>245&&(n+=1)}return n}(e,t,function(e,t){var r=Math.floor(.025*e),n=e-r,i=Math.floor(.025*t);return[r,i,n,t-i]}(t,r))/(t*r)>=.001}function oj(){return(oj=Mx(qx().mark((function e(t){var r,n,i;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.getContext("2d"),n=r.getImageData(0,0,t.width,t.height),i=n.data,ON){e.next=5;break}return e.abrupt("return",aj(i,n.width,n.height));case 5:return e.abrupt("return",ON.detectGlare(i,n.width,n.height));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var sj=Object.freeze({__proto__:null,isCardGlare:function(e){return oj.apply(this,arguments)}});function uj(){return new Promise((function(e){navigator.permissions&&"function"==typeof navigator.permissions.query?navigator.permissions.query({name:"geolocation"}).then((function(t){"granted"===t.state?navigator.geolocation.getCurrentPosition((function(t){e({long:t.coords.longitude,lat:t.coords.latitude})}),(function(){return e(null)})):e(null)})).catch((function(){return e(null)})):e(null)}))}var cj=Object.freeze({__proto__:null,getLongAndLat:uj}),lj="internal_server_error",dj="network_error",pj=JK();function fj(e){return 500*Math.pow(1.5,e)}function mj(e){return Array.isArray(null==e?void 0:e.errors)&&e.errors.find((function(e){return e.code===lj}))}function hj(e){return"Failed to fetch"===e.message||!e.response}function vj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,i=t.maxInternalServerErrorRetryTimes,a=void 0===i?1:i,o=t.propertyKey,s=t.onDone;return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var u=this;function c(e,t){return l.apply(this,arguments)}function l(){return(l=Mx(qx().mark((function t(i,l){var d,p,f,m,h,v,b,y,g=arguments;return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v=function(){return(v=Mx(qx().mark((function e(t){var r,n;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=m(t),n=f(t)-r,e.next=4,mN(fj(n));case 4:return e.abrupt("return",c(r,t,n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},h=function(e){return v.apply(this,arguments)},m=function(e){return e===l?Math.max(i-1,0):f(e)-1},f=function(e){return e===dj?n:e===lj?a:0},p=function(e){return i>0||(e===dj?void 0===i&&n>0:e===lj&&void 0===i&&a>0)},d=g.length>2&&void 0!==g[2]?g[2]:0,b=performance.now(),t.prev=7,t.next=10,e.apply(u,r);case 10:if(y=t.sent,s({response:y,retryCount:d,propertyKey:o,timeInMs:performance.now()-b,args:r}),!mj(y)||!p(lj)){t.next=16;break}return t.next=15,h(lj);case 15:return t.abrupt("return",t.sent);case 16:return t.abrupt("return",y);case 19:if(t.prev=19,t.t0=t.catch(7),s({error:t.t0,retryCount:d,propertyKey:o,timeInMs:performance.now()-b,args:r}),!hj(t.t0)||!p(dj)){t.next=24;break}return t.abrupt("return",h(dj));case 24:throw t.t0;case 25:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}return c()}}function bj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,i=t.maxInternalServerErrorRetryTimes,a=void 0===i?1:i,o=t.onDone,s=void 0===o?function(){}:o,u={get:function(e,t){var r=e[t];return"function"==typeof r&&"constructor"!==t?vj(r,{maxNetworkErrorRetryTimes:n,maxInternalServerErrorRetryTimes:a,propertyKey:t,onDone:s}):r}};return new Proxy(e,u)}var yj=Object.freeze({__proto__:null,createRetryAPIClient:bj,useApiClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCredentials,r=void 0===t?{}:t,n=e.tracking,i=void 0===n?{}:n,a=db.useRef(null),o=function(){};if(null===a.current){var s=r.accessKey,u=r.secretKey,c=r.apiUrl,l=i.userId,d=hW({userId:l});a.current=bj(new NK(s,u,c,{httpHeaders:gx(gx({},pj),{},{"x-request-id":d})}),{onDone:o})}return{apiClient:a.current}}}),gj="BFnYsWrH",qj="KbKcY2nb",Aj=function(e){return e.split("").reverse().join("")},Ij=function(e){var t=e.url;return new Promise((function(e){var r=document.createElement("script");r.onload=e,r.src=t,document.head.appendChild(r)}))},Sj=window.fetch.bind(window);function Mj(e){var t,r,n=e.hasOwnProperty("words")?e.words:[],i=e.hasOwnProperty("sigBytes")?e.sigBytes:4*n.length,a=new Uint8Array(i),o=0;for(r=0;r<i;r++)t=n[r],a[o++]=t>>24,a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=255&t;return a}var kj=function(){var e=Mx(qx().mark((function e(){var t,r,n,i,a,o=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(Aj(gj)).concat(Aj(qj)),e.next=3,Sj.apply(void 0,o);case 3:return r=e.sent,e.next=6,r.text();case 6:return n=e.sent,i=sW.AES.decrypt(n,t),a=Mj(i),e.abrupt("return",{u8arr:a});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Cj=function(){var e=Mx(qx().mark((function e(){var t,r,n=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sj.apply(void 0,n);case 2:return t=e.sent,e.next=5,t.text();case 5:return r=e.sent,e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),zj=Object.freeze({__proto__:null,reverseString:Aj,loadExternalScript:Ij,fetchWithDecryption:kj,fetchRawResource:Cj}),Zj=/\s/,wj=/^\s+/,xj=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Zj.test(e.charAt(t)););return t}(e)+1).replace(wj,""):e},Ej=/^[-+]0x[0-9a-f]+$/i,Oj=/^0b[01]+$/i,Kj=/^0o[0-7]+$/i,Wj=parseInt,Vj=function(e){return e?1/0===(e=function(e){if("number"==typeof e)return e;if(HO(e))return NaN;if(tE(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=tE(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=xj(e);var r=Oj.test(e);return r||Kj.test(e)?Wj(e.slice(2),r?2:8):Ej.test(e)?NaN:+e}(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},Tj=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=function(e){var t=Vj(e),r=t%1;return t==t?r?t-r:t:0}(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},Lj=function(e){return Tj(2,e)},Nj=Lj(function(){var e=Mx(qx().mark((function e(){var t,r,n,i,a,o,s,u,c,l,d,p,f=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=f.length>0&&void 0!==f[0]?f[0]:{},r=t.tfUrl,n=void 0===r?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.20.0/dist/tf.min.js":r,i=t.tfBackendWasmUrl,a=void 0===i?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.20.0/dist/tf-backend-wasm.js":i,o=t.tfBackendCpuUrl,s=void 0===o?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@3.20.0":o,u=t.tfLiteUrl,c=void 0===u?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite@0.0.1-alpha.8/dist/tf-tflite.min.js":u,l=t.blazefaceScriptUrl,d=void 0===l?"https://cdn.jsdelivr.net/npm/@tensorflow-models/blazeface@0.0.7":l,e.next=3,Ij({url:n});case 3:return p=[],a&&p.push(a),s&&p.push(s),d&&p.push(d),c&&p.push(c),e.next=10,Promise.all(p.map((function(e){return Ij({url:e})})));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());function Pj(){return(Pj=Mx(qx().mark((function e(){var t,r,n,i,a,o,s,u,c=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.preferredBackends,n=void 0===r?["wasm","cpu"]:r,!window.tv_model_backend_init||window.tv_model_backend_init[0]!==n[0]){e.next=3;break}return e.abrupt("return");case 3:return i=window,a=i.tf,e.next=6,a.enableProdMode();case 6:o=Wx(n),e.prev=7,o.s();case 9:if((s=o.n()).done){e.next=23;break}return u=s.value,e.prev=11,e.next=14,a.setBackend(u);case 14:return e.abrupt("break",23);case 17:if(e.prev=17,e.t0=e.catch(11),u!==n[n.length-1]){e.next=21;break}throw e.t0;case 21:e.next=9;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(7),o.e(e.t1);case 28:return e.prev=28,o.f(),e.finish(28);case 31:return e.next=33,a.ready();case 33:window.tv_model_backend_init=n;case 34:case"end":return e.stop()}}),e,null,[[7,25,28,31],[11,17]])})))).apply(this,arguments)}function jj(){return(jj=Mx(qx().mark((function e(t){var r,n,i,a;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.modelUrl,n=window,i=n.blazeface,!r){e.next=8;break}return e.next=5,i.load({modelUrl:r});case 5:a=e.sent,e.next=11;break;case 8:return e.next=10,i.load();case 10:a=e.sent;case 11:return e.abrupt("return",{blazefaceModel:a});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rj(){return(Rj=Mx(qx().mark((function e(t){var r,n,i;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,e.next=3,Cj(r);case 3:return n=e.sent,i=n.rawData,e.abrupt("return",i);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xj(e){return Bj.apply(this,arguments)}function Bj(){return(Bj=Mx(qx().mark((function e(t){var r,n,i,a,o,s,u;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,n=t.options,i=void 0===n?{}:n,a=window,o=a.tflite,e.next=4,kj(r);case 4:return s=e.sent,u=s.u8arr,e.abrupt("return",o.loadTFLiteModel(u,gx({numThreads:1},i)));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Gj=Object.freeze({__proto__:null,loadTensorFlow:Nj,initTensorFlow:function(){return Pj.apply(this,arguments)},loadBlazefaceModel:function(e){return jj.apply(this,arguments)},preloadResource:function(e){return Rj.apply(this,arguments)},loadTFLiteModel:Xj}),Yj=Object.freeze({__proto__:null,enableAntiDebug:function(){var e,t,r=["action","gger","stateObject","apply","chain","test","input","Hello World!","constructor","counter","length","debu","call"];e=r,t=185,function(t){for(;--t;)e.push(e.shift())}(++t);var n,i,a=function(e,t){return r[e-=0]};function o(e){function t(e){if("string"==typeof e)return function(e){}[a("0x5")]("while (true) {}")[a("0x0")](a("0x6"));1!=="".concat(e/e)[a("0x7")]||e%20==0?function(){return!0}[a("0x5")]("".concat(a("0x8"),"gger"))[a("0x9")](a("0xa")):function(){return!1}.constructor("debu".concat(a("0xb")))[a("0x0")](a("0xc")),t(++e)}try{if(e)return t;t(0)}catch(e){}}setInterval((function(){o()}),4e3),n=!0,i=function(e,t){var r=n?function(){if(t){var r=t[a("0x0")](e,arguments);return t=null,r}}:function(){};return n=!1,r},function(){i(this,(function(){var e=new RegExp("function *\\( *\\)"),t=new RegExp("\\+\\+ *(?:_0x(?:[a-f0-9]){4,6}|(?:\\b|\\d)[a-z0-9]{1,4}(?:\\b|\\d))","i"),r=o("init");e.test(r+a("0x1"))&&t[a("0x2")](r+a("0x3"))?o():r("0")}))()}(),console.log(a("0x4"))}}),Hj=Object.freeze({__proto__:null,useThemeContext:function(){return db.useContext(aq)}});function Fj(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Uj(e,t){return e&t}function Dj(e,t){return e|t}function Jj(e,t){return e^t}function Qj(e,t){return e&~t}function _j(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function $j(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var eR,tR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rR(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=tR.charAt(r>>6)+tR.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=tR.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=tR.charAt(r>>2)+tR.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function nR(e){var t,r="",n=0,i=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var a=tR.indexOf(e.charAt(t));a<0||(0==n?(r+=Fj(a>>2),i=3&a,n=1):1==n?(r+=Fj(i<<2|a>>4),i=15&a,n=2):2==n?(r+=Fj(i),r+=Fj(a>>2),i=3&a,n=3):(r+=Fj(i<<2|a>>4),r+=Fj(15&a),n=0))}return 1==n&&(r+=Fj(i<<2)),r}var iR,aR={decode:function(e){var t;if(void 0===iR){var r="= \f\n\r\t \u2028\u2029";for(iR=Object.create(null),t=0;t<64;++t)iR["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(iR["-"]=62,iR._=63,t=0;t<r.length;++t)iR[r.charAt(t)]=-1}var n=[],i=0,a=0;for(t=0;t<e.length;++t){var o=e.charAt(t);if("="==o)break;if(-1!=(o=iR[o])){if(void 0===o)throw new Error("Illegal character at offset "+t);i|=o,++a>=4?(n[n.length]=i>>16,n[n.length]=i>>8&255,n[n.length]=255&i,i=0,a=0):i<<=6}}switch(a){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=i>>10;break;case 3:n[n.length]=i>>16,n[n.length]=i>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=aR.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return aR.decode(e)}},oR=1e13,sR=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var r,n,i=this.buf,a=i.length;for(r=0;r<a;++r)(n=i[r]*e+t)<oR?t=0:n-=(t=0|n/oR)*oR,i[r]=n;t>0&&(i[r]=t)},e.prototype.sub=function(e){var t,r,n=this.buf,i=n.length;for(t=0;t<i;++t)(r=n[t]-e)<0?(r+=oR,e=1):e=0,n[t]=r;for(;0===n[n.length-1];)n.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,r=t[t.length-1].toString(),n=t.length-2;n>=0;--n)r+=(oR+t[n]).toString().substring(1);return r},e.prototype.valueOf=function(){for(var e=this.buf,t=0,r=e.length-1;r>=0;--r)t=t*oR+e[r];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),uR=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,cR=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function lR(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var dR,pR=function(){function e(t,r){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=r)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,r){for(var n="",i=e;i<t;++i)if(n+=this.hexByte(this.get(i)),!0!==r)switch(15&i){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},e.prototype.isASCII=function(e,t){for(var r=e;r<t;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var r="",n=e;n<t;++n)r+=String.fromCharCode(this.get(n));return r},e.prototype.parseStringUTF=function(e,t){for(var r="",n=e;n<t;){var i=this.get(n++);r+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(n++)):String.fromCharCode((15&i)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},e.prototype.parseStringBMP=function(e,t){for(var r,n,i="",a=e;a<t;)r=this.get(a++),n=this.get(a++),i+=String.fromCharCode(r<<8|n);return i},e.prototype.parseTime=function(e,t,r){var n=this.parseStringISO(e,t),i=(r?uR:cR).exec(n);return i?(r&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),n=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(n+=":"+i[5],i[6]&&(n+=":"+i[6],i[7]&&(n+="."+i[7]))),i[8]&&(n+=" UTC","Z"!=i[8]&&(n+=i[8],i[9]&&(n+=":"+i[9]))),n):"Unrecognized time: "+n},e.prototype.parseInteger=function(e,t){for(var r,n=this.get(e),i=n>127,a=i?255:0,o="";n==a&&++e<t;)n=this.get(e);if(0==(r=t-e))return i?-1:0;if(r>4){for(o=n,r<<=3;0==(128&(+o^a));)o=+o<<1,--r;o="("+r+" bit)\n"}i&&(n-=256);for(var s=new sR(n),u=e+1;u<t;++u)s.mulAdd(256,this.get(u));return o+s.toString()},e.prototype.parseBitString=function(e,t,r){for(var n=this.get(e),i="("+((t-e-1<<3)-n)+" bit)\n",a="",o=e+1;o<t;++o){for(var s=this.get(o),u=o==t-1?n:0,c=7;c>=u;--c)a+=s>>c&1?"1":"0";if(a.length>r)return i+lR(a,r)}return i+a},e.prototype.parseOctetString=function(e,t,r){if(this.isASCII(e,t))return lR(this.parseStringISO(e,t),r);var n=t-e,i="("+n+" byte)\n";n>(r/=2)&&(t=e+r);for(var a=e;a<t;++a)i+=this.hexByte(this.get(a));return n>r&&(i+="…"),i},e.prototype.parseOID=function(e,t,r){for(var n="",i=new sR,a=0,o=e;o<t;++o){var s=this.get(o);if(i.mulAdd(128,127&s),a+=7,!(128&s)){if(""===n)if((i=i.simplify())instanceof sR)i.sub(80),n="2."+i.toString();else{var u=i<80?i<40?0:1:2;n=u+"."+(i-40*u)}else n+="."+i.toString();if(n.length>r)return lR(n,r);i=new sR,a=0}}return a>0&&(n+=".incomplete"),n},e}(),fR=function(){function e(e,t,r,n,i){if(!(n instanceof mR))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=r,this.tag=n,this.sub=i}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+r,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);case 6:return this.stream.parseOID(t,t+r,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return lR(this.stream.parseStringUTF(t,t+r),e);case 18:case 19:case 20:case 21:case 22:case 26:return lR(this.stream.parseStringISO(t,t+r),e);case 30:return lR(this.stream.parseStringBMP(t,t+r),e);case 23:case 24:return this.stream.parseTime(t,t+r,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var r=0,n=this.sub.length;r<n;++r)t+=this.sub[r].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),r=127&t;if(r==t)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===r)return null;t=0;for(var n=0;n<r;++n)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,r=2*this.length;return e.substr(t,r)},e.decode=function(t){var r;r=t instanceof pR?t:new pR(t,0);var n=new pR(r),i=new mR(r),a=e.decodeLength(r),o=r.pos,s=o-n.pos,u=null,c=function(){var t=[];if(null!==a){for(var n=o+a;r.pos<n;)t[t.length]=e.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var i=e.decode(r);if(i.tag.isEOC())break;t[t.length]=i}a=o-r.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(i.tagConstructed)u=c();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=c();for(var l=0;l<u.length;++l)if(u[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){u=null}if(null===u){if(null===a)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);r.pos=o+Math.abs(a)}return new e(n,s,a,i,u)},e}(),mR=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=0!=(32&t),this.tagNumber=31&t,31==this.tagNumber){var r=new sR;do{t=e.get(),r.mulAdd(128,127&t)}while(128&t);this.tagNumber=r.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),hR=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],vR=(1<<26)/hR[hR.length-1],bR=function(){function e(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this[o]>>s)>0&&(i=!0,a=Fj(r));o>=0;)s<t?(r=(this[o]&(1<<s)-1)<<t-s,r|=this[--o]>>(s+=this.DB-t)):(r=this[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=Fj(r));return i?a:"0"},e.prototype.negate=function(){var t=IR();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+xR(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var r=IR();return this.abs().divRemTo(t,null,r),this.s<0&&r.compareTo(e.ZERO)>0&&t.subTo(r,r),r},e.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new gR(t):new qR(t),this.exp(e,r)},e.prototype.clone=function(){var e=IR();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=IR();return this.bitwiseTo(e,Uj,t),t},e.prototype.or=function(e){var t=IR();return this.bitwiseTo(e,Dj,t),t},e.prototype.xor=function(e){var t=IR();return this.bitwiseTo(e,Jj,t),t},e.prototype.andNot=function(e){var t=IR();return this.bitwiseTo(e,Qj,t),t},e.prototype.not=function(){for(var e=IR(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=IR();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=IR();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+_j(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=$j(this[r]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,Dj)},e.prototype.clearBit=function(e){return this.changeBit(e,Qj)},e.prototype.flipBit=function(e){return this.changeBit(e,Jj)},e.prototype.add=function(e){var t=IR();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=IR();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=IR();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=IR();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=IR();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=IR(),r=IR();return this.divRemTo(e,t,r),[t,r]},e.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=wR(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new gR(t):t.isEven()?new AR(t):new qR(t);var o=[],s=3,u=r-1,c=(1<<r)-1;if(o[1]=n.convert(this),r>1){var l=IR();for(n.sqrTo(o[1],l);s<=c;)o[s]=IR(),n.mulTo(l,o[s-2],o[s]),s+=2}var d,p,f=e.t-1,m=!0,h=IR();for(i=xR(e[f])-1;f>=0;){for(i>=u?d=e[f]>>i-u&c:(d=(e[f]&(1<<i+1)-1)<<u-i,f>0&&(d|=e[f-1]>>this.DB+i-u)),s=r;0==(1&d);)d>>=1,--s;if((i-=s)<0&&(i+=this.DB,--f),m)o[d].copyTo(a),m=!1;else{for(;s>1;)n.sqrTo(a,h),n.sqrTo(h,a),s-=2;s>0?n.sqrTo(a,h):(p=a,a=h,h=p),n.mulTo(h,o[d],a)}for(;f>=0&&0==(e[f]&1<<i);)n.sqrTo(a,h),p=a,a=h,h=p,--i<0&&(i=this.DB-1,--f)}return n.revert(a)},e.prototype.modInverse=function(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return e.ZERO;for(var n=t.clone(),i=this.clone(),a=wR(1),o=wR(0),s=wR(0),u=wR(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(a.isEven()&&o.isEven()||(a.addTo(this,a),o.subTo(t,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),r?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(t,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(i)>=0?(n.subTo(i,n),r&&a.subTo(s,a),o.subTo(u,o)):(i.subTo(n,i),r&&s.subTo(a,s),u.subTo(o,u))}return 0!=i.compareTo(e.ONE)?e.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},e.prototype.pow=function(e){return this.exp(e,new yR)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},e.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=hR[hR.length-1]){for(t=0;t<hR.length;++t)if(r[0]==hR[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<hR.length;){for(var n=hR[t],i=t+1;i<hR.length&&n<vR;)n*=hR[i++];for(n=r.modInt(n);t<i;)if(n%hR[t++]==0)return!1}return r.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var i=t.length,a=!1,o=0;--i>=0;){var s=8==n?255&+t[i]:ZR(t,i);s<0?"-"==t.charAt(i)&&(a=!0):(a=!1,0==o?this[this.t++]=s:o+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=n)>=this.DB&&(o-=this.DB))}8==n&&0!=(128&+t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),a&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(e/this.DB),o=this.s<<r&this.DM,s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>n|o,o=(this[s]&i)<<r;for(s=a-1;s>=0;--s)t[s]=0;t[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t[0]=this[r]>>n;for(var o=r+1;o<this.t;++o)t[o-r-1]|=(this[o]&a)<<i,t[o-r]=this[o]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},e.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},e.prototype.multiplyTo=function(t,r){var n=this.abs(),i=t.abs(),a=n.t;for(r.t=a+i.t;--a>=0;)r[a]=0;for(a=0;a<i.t;++a)r[a+n.t]=n.am(0,i[a],r,a,0,n.t);r.s=0,r.clamp(),this.s!=t.s&&e.ZERO.subTo(r,r)},e.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,r,n){var i=t.abs();if(!(i.t<=0)){var a=this.abs();if(a.t<i.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=IR());var o=IR(),s=this.s,u=t.s,c=this.DB-xR(i[i.t-1]);c>0?(i.lShiftTo(c,o),a.lShiftTo(c,n)):(i.copyTo(o),a.copyTo(n));var l=o.t,d=o[l-1];if(0!=d){var p=d*(1<<this.F1)+(l>1?o[l-2]>>this.F2:0),f=this.FV/p,m=(1<<this.F1)/p,h=1<<this.F2,v=n.t,b=v-l,y=null==r?IR():r;for(o.dlShiftTo(b,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),e.ONE.dlShiftTo(l,y),y.subTo(o,o);o.t<l;)o[o.t++]=0;for(;--b>=0;){var g=n[--v]==d?this.DM:Math.floor(n[v]*f+(n[v-1]+h)*m);if((n[v]+=o.am(0,g,n,b,0,l))<g)for(o.dlShiftTo(b,y),n.subTo(y,n);n[v]<--g;)n.subTo(y,n)}null!=r&&(n.drShiftTo(l,r),s!=u&&e.ZERO.subTo(r,r)),n.t=l,n.clamp(),c>0&&n.rShiftTo(c,n),s<0&&e.ZERO.subTo(n,n)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,r){if(t>4294967295||t<1)return e.ONE;var n=IR(),i=IR(),a=r.convert(this),o=xR(t)-1;for(a.copyTo(n);--o>=0;)if(r.sqrTo(n,i),(t&1<<o)>0)r.mulTo(i,a,n);else{var s=n;n=i,i=s}return r.revert(n)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=wR(r),i=IR(),a=IR(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(e)+o},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),i=Math.pow(r,n),a=!1,o=0,s=0,u=0;u<t.length;++u){var c=ZR(t,u);c<0?"-"==t.charAt(u)&&0==this.signum()&&(a=!0):(s=r*s+c,++o>=n&&(this.dMultiply(i),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(r,o)),this.dAddOffset(s,0)),a&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,n){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),Dj,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var i=[],a=7&t;i.length=1+(t>>3),r.nextBytes(i),a>0?i[0]&=(1<<a)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},e.prototype.changeBit=function(t,r){var n=e.ONE.shiftLeft(t);return this.bitwiseTo(n,r,n),n},e.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()},e.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},e.prototype.millerRabin=function(t){var r=this.subtract(e.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var i=r.shiftRight(n);(t=t+1>>1)>hR.length&&(t=hR.length);for(var a=IR(),o=0;o<t;++o){a.fromInt(hR[Math.floor(Math.random()*hR.length)]);var s=a.modPow(i,this);if(0!=s.compareTo(e.ONE)&&0!=s.compareTo(r)){for(var u=1;u++<n&&0!=s.compareTo(r);)if(0==(s=s.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=s.compareTo(r))return!1}}return!0},e.prototype.square=function(){var e=IR();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var r=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(r.compareTo(n)<0){var i=r;r=n,n=i}var a=r.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)t(r);else{a<o&&(o=a),o>0&&(r.rShiftTo(o,r),n.rShiftTo(o,n));setTimeout((function e(){(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),(a=n.getLowestSetBit())>0&&n.rShiftTo(a,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(e,0):(o>0&&n.lShiftTo(o,n),setTimeout((function(){t(n)}),0))}),10)}},e.prototype.fromNumberAsync=function(t,r,n,i){if("number"==typeof r)if(t<2)this.fromInt(1);else{this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),Dj,this),this.isEven()&&this.dAddOffset(1,0);var a=this;setTimeout((function n(){a.dAddOffset(2,0),a.bitLength()>t&&a.subTo(e.ONE.shiftLeft(t-1),a),a.isProbablePrime(r)?setTimeout((function(){i()}),0):setTimeout(n,0)}),0)}else{var o=[],s=7&t;o.length=1+(t>>3),r.nextBytes(o),s>0?o[0]&=(1<<s)-1:o[0]=0,this.fromString(o,256)}},e}(),yR=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),gR=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),qR=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=IR();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(bR.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=IR();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),AR=function(){function e(e){this.m=e,this.r2=IR(),this.q3=IR(),bR.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=IR();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function IR(){return new bR(null)}function SR(e,t){return new bR(e,t)}var MR="undefined"!=typeof navigator;MR&&"Microsoft Internet Explorer"==navigator.appName?(bR.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this[e],c=this[e++]>>15,l=s*u+c*o;i=((u=o*u+((32767&l)<<15)+r[n]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),r[n++]=1073741823&u}return i},dR=30):MR&&"Netscape"!=navigator.appName?(bR.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this[e++]+r[n]+i;i=Math.floor(o/67108864),r[n++]=67108863&o}return i},dR=26):(bR.prototype.am=function(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var u=16383&this[e],c=this[e++]>>14,l=s*u+c*o;i=((u=o*u+((16383&l)<<14)+r[n]+i)>>28)+(l>>14)+s*c,r[n++]=268435455&u}return i},dR=28),bR.prototype.DB=dR,bR.prototype.DM=(1<<dR)-1,bR.prototype.DV=1<<dR,bR.prototype.FV=Math.pow(2,52),bR.prototype.F1=52-dR,bR.prototype.F2=2*dR-52;var kR,CR,zR=[];for(kR="0".charCodeAt(0),CR=0;CR<=9;++CR)zR[kR++]=CR;for(kR="a".charCodeAt(0),CR=10;CR<36;++CR)zR[kR++]=CR;for(kR="A".charCodeAt(0),CR=10;CR<36;++CR)zR[kR++]=CR;function ZR(e,t){var r=zR[e.charCodeAt(t)];return null==r?-1:r}function wR(e){var t=IR();return t.fromInt(e),t}function xR(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}bR.ZERO=wR(0),bR.ONE=wR(1);var ER,OR,KR=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}(),WR=null;if(null==WR){WR=[],OR=0;var VR=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var TR=new Uint32Array(256);for(window.crypto.getRandomValues(TR),VR=0;VR<TR.length;++VR)WR[OR++]=255&TR[VR]}var LR=0,NR=function e(t){if((LR=LR||0)>=256||OR>=256)window.removeEventListener?window.removeEventListener("mousemove",e,!1):window.detachEvent&&window.detachEvent("onmousemove",e);else try{var r=t.x+t.y;WR[OR++]=255&r,LR+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",NR,!1):window.attachEvent&&window.attachEvent("onmousemove",NR))}function PR(){if(null==ER){for(ER=new KR;OR<256;){var e=Math.floor(65536*Math.random());WR[OR++]=255&e}for(ER.init(WR),OR=0;OR<WR.length;++OR)WR[OR]=0;OR=0}return ER.next()}var jR=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=PR()},e}(),RR=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=SR(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=this.n.bitLength()+7>>3,r=function(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=e.length-1;n>=0&&t>0;){var i=e.charCodeAt(n--);i<128?r[--t]=i:i>127&&i<2048?(r[--t]=63&i|128,r[--t]=i>>6|192):(r[--t]=63&i|128,r[--t]=i>>6&63|128,r[--t]=i>>12|224)}r[--t]=0;for(var a=new jR,o=[];t>2;){for(o[0]=0;0==o[0];)a.nextBytes(o);r[--t]=o[0]}return r[--t]=2,r[--t]=0,new bR(r)}(e,t);if(null==r)return null;var n=this.doPublic(r);if(null==n)return null;for(var i=n.toString(16),a=i.length,o=0;o<2*t-a;o++)i="0"+i;return i},e.prototype.setPrivate=function(e,t,r){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=SR(e,16),this.e=parseInt(t,16),this.d=SR(r,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,r,n,i,a,o,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=SR(e,16),this.e=parseInt(t,16),this.d=SR(r,16),this.p=SR(n,16),this.q=SR(i,16),this.dmp1=SR(a,16),this.dmq1=SR(o,16),this.coeff=SR(s,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var r=new jR,n=e>>1;this.e=parseInt(t,16);for(var i=new bR(t,16);;){for(;this.p=new bR(e-n,1,r),0!=this.p.subtract(bR.ONE).gcd(i).compareTo(bR.ONE)||!this.p.isProbablePrime(10););for(;this.q=new bR(n,1,r),0!=this.q.subtract(bR.ONE).gcd(i).compareTo(bR.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var o=this.p.subtract(bR.ONE),s=this.q.subtract(bR.ONE),u=o.multiply(s);if(0==u.gcd(i).compareTo(bR.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(u),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=SR(e,16),r=this.doPrivate(t);return null==r?null:function(e,t){for(var r=e.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=t-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var a=255&r[n];a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((31&a)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&a)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}(r,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,r){var n=new jR,i=e>>1;this.e=parseInt(t,16);var a=new bR(t,16),o=this;setTimeout((function t(){var s=function(){if(o.p.compareTo(o.q)<=0){var e=o.p;o.p=o.q,o.q=e}var n=o.p.subtract(bR.ONE),i=o.q.subtract(bR.ONE),s=n.multiply(i);0==s.gcd(a).compareTo(bR.ONE)?(o.n=o.p.multiply(o.q),o.d=a.modInverse(s),o.dmp1=o.d.mod(n),o.dmq1=o.d.mod(i),o.coeff=o.q.modInverse(o.p),setTimeout((function(){r()}),0)):setTimeout(t,0)},u=function e(){o.q=IR(),o.q.fromNumberAsync(i,1,n,(function(){o.q.subtract(bR.ONE).gcda(a,(function(t){0==t.compareTo(bR.ONE)&&o.q.isProbablePrime(10)?setTimeout(s,0):setTimeout(e,0)}))}))};setTimeout((function t(){o.p=IR(),o.p.fromNumberAsync(e-i,1,n,(function(){o.p.subtract(bR.ONE).gcda(a,(function(e){0==e.compareTo(bR.ONE)&&o.p.isProbablePrime(10)?setTimeout(u,0):setTimeout(t,0)}))}))}),0)}),0)},e.prototype.sign=function(e,t,r){var n=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var r=t-e.length-6,n="",i=0;i<r;i+=2)n+="ff";return SR("0001"+n+"00"+e,16)}((XR[r]||"")+t(e).toString(),this.n.bitLength()/4);if(null==n)return null;var i=this.doPrivate(n);if(null==i)return null;var a=i.toString(16);return 0==(1&a.length)?a:"0"+a},e.prototype.verify=function(e,t,r){var n=SR(t,16),i=this.doPublic(n);return null==i?null:function(e){for(var t in XR)if(XR.hasOwnProperty(t)){var r=XR[t],n=r.length;if(e.substr(0,n)==r)return e.substr(n)}return e}
37
+ (r=oW).mode.CTRGladman=function(){var e=r.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}function n(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var i=e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=this._iv,o=this._counter;a&&(o=this._counter=a.slice(0),this._iv=void 0),n(o);var s=o.slice(0);r.encryptBlock(s,0);for(var u=0;u<i;u++)e[t+u]^=s[u]}});return e.Decryptor=i,e}(),r.mode.CTRGladman)})),Xx((function(e,t){var r,n,i;e.exports=((i=oW).mode.OFB=(n=(r=i.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,a=this._keystream;i&&(a=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(a,0);for(var o=0;o<n;o++)e[t+o]^=a[o]}}),r.Decryptor=n,r),i.mode.OFB)})),Xx((function(e,t){var r,n;e.exports=((n=oW).mode.ECB=((r=n.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),r.Decryptor=r.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),r),n.mode.ECB)})),Xx((function(e,t){var r;e.exports=((r=oW).pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,a=r+i-1;e.clamp(),e.words[a>>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)})),Xx((function(e,t){var r;e.exports=((r=oW).pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)})),Xx((function(e,t){var r;e.exports=((r=oW).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)})),Xx((function(e,t){var r;e.exports=((r=oW).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},r.pad.ZeroPadding)})),Xx((function(e,t){var r;e.exports=((r=oW).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)})),Xx((function(e,t){var r;e.exports=(r=oW,function(e){var t=r,n=t.lib.CipherParams,i=t.enc.Hex;t.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return n.create({ciphertext:t})}}}(),r.format.Hex)})),Xx((function(e,t){var r;e.exports=(r=oW,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],a=[],o=[],s=[],u=[],c=[],l=[],d=[],p=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var m=n^n<<1^n<<2^n<<3^n<<4;m=m>>>8^255&m^99,i[r]=m,a[m]=r;var h=e[r],v=e[h],b=e[v],y=257*e[m]^16843008*m;o[r]=y<<24|y>>>8,s[r]=y<<16|y>>>16,u[r]=y<<8|y>>>24,c[r]=y,y=16843009*b^65537*v^257*h^16843008*r,l[m]=y<<24|y>>>8,d[m]=y<<16|y>>>16,p[m]=y<<8|y>>>24,f[m]=y,r?(r=h^e[e[e[b^h]]],n^=e[e[n]]):r=n=1}}();var m=[0,1,2,4,8,16,32,64,128,27,54],h=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),a=this._keySchedule=[],o=0;o<n;o++)o<r?a[o]=t[o]:(c=a[o-1],o%r?r>6&&o%r==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=m[o/r|0]<<24),a[o]=a[o-r]^c);for(var s=this._invKeySchedule=[],u=0;u<n;u++){if(o=n-u,u%4)var c=a[o];else c=a[o-4];s[u]=u<4||o<=4?c:l[i[c>>>24]]^d[i[c>>>16&255]]^p[i[c>>>8&255]]^f[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,s,u,c,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,d,p,f,a),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,a,o,s){for(var u=this._nRounds,c=e[t]^r[0],l=e[t+1]^r[1],d=e[t+2]^r[2],p=e[t+3]^r[3],f=4,m=1;m<u;m++){var h=n[c>>>24]^i[l>>>16&255]^a[d>>>8&255]^o[255&p]^r[f++],v=n[l>>>24]^i[d>>>16&255]^a[p>>>8&255]^o[255&c]^r[f++],b=n[d>>>24]^i[p>>>16&255]^a[c>>>8&255]^o[255&l]^r[f++],y=n[p>>>24]^i[c>>>16&255]^a[l>>>8&255]^o[255&d]^r[f++];c=h,l=v,d=b,p=y}h=(s[c>>>24]<<24|s[l>>>16&255]<<16|s[d>>>8&255]<<8|s[255&p])^r[f++],v=(s[l>>>24]<<24|s[d>>>16&255]<<16|s[p>>>8&255]<<8|s[255&c])^r[f++],b=(s[d>>>24]<<24|s[p>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^r[f++],y=(s[p>>>24]<<24|s[c>>>16&255]<<16|s[l>>>8&255]<<8|s[255&d])^r[f++],e[t]=h,e[t+1]=v,e[t+2]=b,e[t+3]=y},keySize:8});e.AES=t._createHelper(h)}(),r.AES)})),Xx((function(e,t){var r;e.exports=(r=oW,function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,a=e.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=a.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=o[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){var c=i[a]=[],l=u[a];for(r=0;r<24;r++)c[r/6|0]|=t[(s[r]-1+l)%28]<<31-r%6,c[4+(r/6|0)]|=t[28+(s[r+24]-1+l)%28]<<31-r%6;for(c[0]=c[0]<<1|c[0]>>>31,r=1;r<7;r++)c[r]=c[r]>>>4*(r-1)+3;c[7]=c[7]<<5|c[7]>>>27}var d=this._invSubKeys=[];for(r=0;r<16;r++)d[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],p.call(this,4,252645135),p.call(this,16,65535),f.call(this,2,858993459),f.call(this,8,16711935),p.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],a=this._lBlock,o=this._rBlock,s=0,u=0;u<8;u++)s|=c[u][((o^i[u])&l[u])>>>0];this._lBlock=o,this._rBlock=a^s}var d=this._lBlock;this._lBlock=this._rBlock,this._rBlock=d,p.call(this,1,1431655765),f.call(this,8,16711935),f.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function p(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function f(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=i._createHelper(d);var m=a.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=d.createEncryptor(n.create(t)),this._des2=d.createEncryptor(n.create(r)),this._des3=d.createEncryptor(n.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(m)}(),r.TripleDES)})),Xx((function(e,t){var r;e.exports=(r=oW,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var a=0;i<256;i++){var o=i%r,s=t[o>>>2]>>>24-o%4*8&255;a=(a+n[i]+s)%256;var u=n[i];n[i]=n[a],n[a]=u}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var a=e[t];e[t]=e[r],e[r]=a,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var o=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)a.call(this)}});e.RC4Drop=t._createHelper(o)}(),r.RC4)})),Xx((function(e,t){var r;e.exports=(r=oW,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],a=[],o=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)u.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=c>>>16|4294901760&l,p=l<<16|65535&c;for(i[0]^=c,i[1]^=d,i[2]^=l,i[3]^=p,i[4]^=c,i[5]^=d,i[6]^=l,i[7]^=p,r=0;r<4;r++)u.call(this)}},_doProcessBlock:function(e,t){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=u^c}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)})),Xx((function(e,t){var r;e.exports=(r=oW,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],a=[],o=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)u.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var a=t.words,o=a[0],s=a[1],c=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),d=c>>>16|4294901760&l,p=l<<16|65535&c;for(n[0]^=c,n[1]^=d,n[2]^=l,n[3]^=p,n[4]^=c,n[5]^=d,n[6]^=l,n[7]^=p,i=0;i<4;i++)u.call(this)}},_doProcessBlock:function(e,t){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=u^c}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)})),Xx((function(e,t){e.exports=oW}))),uW=function(e){var t=e.blob;return new Promise((function(e){var r=new FileReader;r.onload=function(t){var r=t.target.result,n=sW.MD5(sW.lib.WordArray.create(r)).toString();e(n)},r.readAsArrayBuffer(t)}))},cW=Object.freeze({__proto__:null,MD5:uW,base64ToMD5:function(e){var t=e.base64;return sW.MD5(t).toString()}}),lW=["tracking"],dW=JK(),pW=db.createContext(),fW={enable:!1,accessKey:"",secretKey:"",apiUrl:"",userId:""},mW=function(){var e=Mx(qx().mark((function e(t){var r,n,i,a,o,s,u,c,l,d,p,f,m,h;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.tag,n=t.event,i=t.log,a=tW(new Date),o=i,e.t0=n,e.next="sdk_mode.read_id_card_one_side"===e.t0?6:"sdk_mode.liveness"===e.t0?19:36;break;case 6:return o=HK(i),s=i.result_object,e.next=10,uW({blob:s.image.blob});case 10:if(e.t1=e.sent,o.result_object.image={blob:e.t1},delete o.result_object.recordedVideos,!s.qrScannedResult){e.next=18;break}return e.next=16,uW({blob:s.qrScannedResult.image.blob});case 16:o.result_object.qrScannedResult.image.blob=e.sent,delete o.result_object.qrScannedResult.recordedVideos;case 18:return e.abrupt("break",36);case 19:return o=HK(i),u=i.result_object,c=u.steps,l=u.frontalFaces,d=u.frontalScaledImage,p=c.map((function(e){return uW({blob:e.image.blob})})),e.next=24,Promise.all(p);case 24:return f=e.sent,c.forEach((function(e,t){o.result_object.steps[t].image.blob=f[t]})),m=l.map((function(e){return uW({blob:e})})),e.next=29,Promise.all(m);case 29:if(h=e.sent,l.forEach((function(e,t){o.result_object.frontalFaces[t]=h[t]})),!d){e.next=35;break}return e.next=34,uW({blob:d});case 34:o.result_object.frontalScaledImage=e.sent;case 35:return e.abrupt("break",36);case 36:return e.abrupt("return",{tag:r,event:n,log:gx({device_time:a},o)});case 37:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function hW(e){var t,r=e.userId;if(r)t=r;else{var n=iW("tv:user-id");if(n)t=n;else{var i=YK();t=i,nW(i,"tv:user-id")}}return t}function vW(e){var t=e.value,r=e.children,n=t.tracking,i=void 0===n?fW:n,a=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,lW),o=i.enable,s=void 0!==o&&o,u=i.accessKey,c=i.secretKey,l=i.apiUrl,d=i.userId,p=i.logSignature,f=db.useCallback((function(e,t){if(p&&3===Object.keys(p).length){var r=p.timestamp,n=p.signature,i=p.logUrl;return fetch(i,{method:"POST",headers:gx({"X-TV-Timestamp":r,Authorization:n,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}if(s){if(!l||!u||!c)return console.warn("apiUrl, accessKey and secretKey are required when tracking is enabled"),null;var a=new NK(u,c,l).httpClient.authorizer.getHeaders({requestPath:"/v1/log_events",method:"POST"});return fetch("".concat(l,"/v1/log_events"),{method:"POST",headers:gx({"X-TV-Timestamp":a["X-TV-Timestamp"],Authorization:a.Authorization,"Content-Type":"application/json"},t),body:JSON.stringify(e)})}return null}),[p,s,l,u,c]),m=db.useMemo((function(){return{"x-request-id":hW({userId:d})}}),[d]),h=db.useCallback(Mx(qx().mark((function e(){var t,r,n,i,a,o,u=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},r=t.tag,n=t.event,i=t.log,a=void 0===i?{}:i,!s){e.next=11;break}return e.prev=2,e.next=5,mW({tag:r,event:n,log:a});case 5:o=e.sent,f(o,gx(gx({},m),dW)),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:case"end":return e.stop()}}),e,null,[[2,9]])}))),[f,m,s]);return db.createElement(pW.Provider,{value:gx(gx({},a),{},{sendEvent:h})},r)}vW.propTypes={value:Tb.shape({tracking:Tb.shape({enable:Tb.bool,accessKey:Tb.string,secretKey:Tb.string,apiUrl:Tb.string,userId:Tb.string})}).isRequired,children:Tb.node.isRequired};var bW,yW,gW,qW,AW,IW,SW,MW,kW,CW,zW,ZW,wW,xW,EW,OW,KW,WW,VW,TW,LW=Object.freeze({__proto__:null,defaultTrackingConfig:fW,getXRequestId:hW,SDKTrackingProvider:vW,useSDKTracking:function(){var e=db.useContext(pW);return db.useMemo((function(){return void 0===e?(console.warn("useSDKTracking must be used within a SDKTrackingProvider"),{sendEvent:function(){}}):e}),[e])}}),NW=(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(AW={not_supported:"Camera không được hỗ trợ. Vui lòng thử trình duyệt hoặc thiết bị khác.",camera_timeout:"Không thể truy cập camera. Vui lòng kiểm tra quyền truy cập camera, đóng các tab/app khác đang sử dụng camera hoặc thử lại trên trình duyệt/thiết bị khác.",wrong_orientation:"Bạn đang sử dụng chế độ màn hình xoay ngang. Vui lòng quay màn hình theo chiều dọc và thực hiện lại.",unable_to_load_model:"Không thể load model. Vui lòng thử trình duyệt hoặc thiết bị khác.",no_permission:"Vui lòng cấp quyền để truy cập camera.",no_face:"Không tìm thấy khuôn mặt",partial_face:"Không tìm thấy toàn bộ khuôn mặt",multiple_faces:"Quá nhiều khuôn mặt",face_too_small:"Khuôn mặt quá nhỏ",face_too_large:"Khuôn mặt quá to",face_out_of_box:"Khuôn mặt không nằm trọn vẹn trong khung ảnh",liveness_too_fast:"Vui lòng quay CHẬM lại",liveness_terminated:"Vui lòng thực hiện lại.",liveness_terminated_face_tracking:"Bạn cần quay CHẬM lại.\nVui lòng thực hiện lại.",liveness_terminated_no_face:"Khuôn mặt không nằm trong khung hình.\nXin vui lòng thử lại.",liveness_terminated_time_out:"Bạn cần hoàn thành động tác theo chỉ dẫn trong <%= x %> giây.\nXin vui lòng thử lại.",card_sanity_not_good:"Card sanity chưa đạt",api_call_error:"Lỗi call api",upload_error:"Lỗi upload",sanity_check_error:"Lỗi check sanity",read_id_card_error:"Lỗi read id card",detect_id_tampering_error:"Lỗi detect id tampering",detect_id_card_error:"Không thể detect id card type",missing_front_id_card:"Không tìm thấy front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Vui lòng đặt giấy tờ thẳng, không bị nghiêng khi chụp",id_detector_no_cards:"Vui lòng chụp mặt <%= side %> của giấy tờ\n (chiếm 50-95% khung hình)",id_detector_card_too_small:"Vui lòng đưa giấy tờ lại GẦN hơn\n (chiếm 50-95% khung hình)",id_detector_error_incomplete:"Vui lòng đưa giấy tờ ra XA hơn\n (chiếm 50-95% khung hình)",glare_detected:"Ảnh bị chói / lóa. Vui lòng điều chỉnh góc chụp.",id_detector_error_front_side_no_faces:"Vui lòng chụp mặt trước của giấy tờ",id_detector_error_front_side_multiple_faces:"Vui lòng chụp mặt trước 1 giấy tờ duy nhất",id_detector_error_back_side_has_faces:"Vui lòng chụp mặt sau của giấy tờ",id_detector_error_blur:"Ảnh bị mờ. Vui lòng chụp lại để có ảnh rõ nét hơn",not_frontal_face:"Vui lòng nhìn thẳng vào camera.",not_readable:"Camera đang được sử dụng bởi ứng dụng/tab khác.",close_eye:"Vui lòng mở to mắt",front_card_title:"Mặt trước CMND/CCCD",back_card_title:"Mặt sau CMND/CCCD",qr_title:"Quét mã QR trên CCCD",front_card_description:"Vui lòng đặt CMND mặt trước vào trong khung",back_card_description:"Vui lòng đặt CMND mặt sau vào trong khung",btn_ok:"Tôi đã hiểu",front:"trước",back:"sau",btn_use_this_picture:"Dùng ảnh này",btn_try_again:"Thử lại",confirm_popup_valid_qr:"Đã quét được mã QR",confirm_popup_invalid_qr:"Không quét được mã QR",remaining_time:"Thời gian còn lại: <%= x %> giây",timeout_instruction:"Bạn cần hoàn thành việc chụp giấy tờ trong <%= x %> giây.\nVui lòng thử lại.",warmup_intro:"Đang khởi động, vui lòng chờ trong giây lát..."},null==bx||null===(bW=hx)||void 0===bW?void 0:bW.LEFT,"Quay mặt chậm qua trái"),null==bx||null===(yW=hx)||void 0===yW?void 0:yW.RIGHT,"Quay mặt chậm qua phải"),null==bx||null===(gW=hx)||void 0===gW?void 0:gW.UP,"Ngước mặt chậm lên trên"),null==bx||null===(qW=hx)||void 0===qW?void 0:qW.FRONTAL,"Nhìn thẳng camera"),"qr_instructions_text","Vui lòng quét mã QR theo hướng dẫn sau:\n Đư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","Tiến hành quét mã QR"),"qr_instructions_countdown","Bắt đầu trong <%= x %> giây"),"qr_invalid_popup_title","QR không hợp lệ"),"qr_invalid_popup_description","Vui lòng kiểm tra và đảm bảo việc thực hiện quét QR code trên CCCD thật"),"qr_invalid_popup_retry_button","Quét lại QR (trên CCCD)"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(AW,"qr_invalid_popup_skip_button","Bỏ qua"),"qr_tooltip","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"),"session_timeout_popup_description","Quá thời gian quét. Vui lòng thực hiện lại.\n Đưa camera vào vị trí mã QR trên thẻ. Canh vừa vào 4 góc và 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","Thử lại"),"session_timeout_popup_skip_button","Bỏ qua"),"flash_liveness.title","Xác thực khuôn mặt"),"flash_liveness.instruction.far_step","Đưa mặt vào khung"),"flash_liveness.instruction.close_step","Đưa mặt lại gần"),"flash_liveness.instruction.flash_step","Giữ yên"),"flash_liveness.error.no_face","Không tìm thấy khuôn mặt"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(AW,"flash_liveness.processing","Đang xử lý kết quả"),"flash_liveness.error.partial_face","Đưa khuôn mặt vào giữa hình oval"),"flash_liveness.error.face_too_small","Đưa khuôn mặt lại gần một chút"),"flash_liveness.error.face_too_large","Đưa khuôn mặt ra xa một chút"),"flash_liveness.error.close_eye","Vui lòng mở to mắt"),"flash_liveness.error.face_not_frontal","Vui lòng đưa thiết bị ngang tầm mắt"),"flash_liveness.error.multiple_faces","Có nhiều mặt trong khung hình"),"flash_liveness.error.face_too_high","Đưa khuôn mặt xuống một chút"),"flash_liveness.error.face_too_blurry","Ảnh bị mờ, vui lòng giữ yên điện thoại"),"flash_liveness.error.face_not_qualified","Vui lòng không đeo kiếng, khẩu trang, hay để mặt bị che"),Zx(Zx(Zx(Zx(AW,"flash_liveness.timeout.remaining","Thời gian còn lại: <%= remain %> giây"),"flash_liveness.timeout.expired","Bạn cần hoàn thành trong <%= timeout %> giây. Xin vui lòng thử lại."),"flash_liveness.error.face_too_bright","Khuôn mặt quá sáng. Vui lòng điều chỉnh để có ánh sáng phù hợp."),"flash_liveness.error.face_too_dark","Khuôn mặt quá tối. Vui lòng điều chỉnh để có ánh sáng tốt hơn.")),PW=(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(CW={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",qr_title:"Scan QR code on ID card",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bx||null===(IW=hx)||void 0===IW?void 0:IW.LEFT,"Turn your face to the left"),null==bx||null===(SW=hx)||void 0===SW?void 0:SW.RIGHT,"Turn your face to the right"),null==bx||null===(MW=hx)||void 0===MW?void 0:MW.UP,"Turn your face up"),null==bx||null===(kW=hx)||void 0===kW?void 0:kW.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(CW,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(CW,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),Zx(Zx(Zx(Zx(CW,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),jW=(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(EW={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",qr_title:"Scan QR code on ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bx||null===(zW=hx)||void 0===zW?void 0:zW.LEFT,"Turn your face to the left"),null==bx||null===(ZW=hx)||void 0===ZW?void 0:ZW.RIGHT,"Turn your face to the right"),null==bx||null===(wW=hx)||void 0===wW?void 0:wW.UP,"Turn your face up"),null==bx||null===(xW=hx)||void 0===xW?void 0:xW.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(EW,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(EW,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),Zx(Zx(Zx(Zx(EW,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),RW=(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(TW={not_supported:"Camera is not well-supported on this device/browser. Please try another one.",camera_timeout:"Can't access camera. Please check camera permission, try again or try another browser/device",wrong_orientation:"You are using landscape mode. Please rotate screen to portrait mode and retry.",unable_to_load_model:"Unable to load model on this device/browser. Please try another one.",no_permission:"Please grant the permission to access the camera.",no_face:"Face not found",partial_face:"Face out of the box",multiple_faces:"Too many faces",face_too_small:"Face too small",face_too_large:"Face too large",face_out_of_box:"Face is out of box",liveness_too_fast:"Please turn your face SLOWLY",liveness_terminated:"Please try again.",liveness_terminated_face_tracking:"You need to turn your face SLOWLY.\nPlease try again.",liveness_terminated_no_face:"Your face was missing for too long.\nPlease try again.",liveness_terminated_time_out:"You need to complete gestures as instructed within <%= x %> seconds.\nPlease try again.",card_sanity_not_good:"Card sanity not good",api_call_error:"Api call error",upload_error:"Upload error",sanity_check_error:"Sanity check error",read_id_card_error:"Read id card error",detect_id_tampering_error:"Detect id tampering error",detect_id_card_error:"Can't detect id card type",missing_front_id_card:"Missing front id",server_error:"Server error",client_web_setting_not_found:"Client Web Setting Not Found",id_detector_validate_angle_error:"Please place ID card straight, not tilted",id_detector_no_cards:"Please capture the <%= side %> side of ID card\n (occupy 50-95% of the frame)",id_detector_card_too_small:"Please move ID card CLOSER\n (occupy 50-95% of the frame)",id_detector_error_incomplete:"Please move ID card FARTHER\n (occupy 50-95% of the frame)",glare_detected:"Glare is detected. Please adjust the shooting angle",id_detector_error_front_side_no_faces:"Please capture the front side of ID card",id_detector_error_front_side_multiple_faces:"Please capture the front side of one ID card only (remove other items out of the frame)",id_detector_error_back_side_has_faces:"Please capture the back side of ID card",id_detector_error_blur:"Blurry photo detected. Please capture again for a clearer image",not_frontal_face:"Please look straight to camera.",not_readable:"Camera already in use by another app/tab.",close_eye:"Open your eyes clearly",front_card_title:"Front side of ID card",back_card_title:"Back side of ID card",qr_title:"Scan QR code on ID card",front_card_description:"Please put the front side of ID card into the frame",back_card_description:"Please put the back side of ID card into the frame",btn_ok:"OK",front:"front",back:"back",btn_use_this_picture:"Use this picture",btn_try_again:"Try again",confirm_popup_valid_qr:"QR code scanned",confirm_popup_invalid_qr:"Could not scan QR code",remaining_time:"Remaining time: <%= x %> seconds",timeout_instruction:"You need to take the picture within <%= x %> seconds.\nPlease try again.",warmup_intro:"Warming up... Please wait a moment"},null==bx||null===(OW=hx)||void 0===OW?void 0:OW.LEFT,"Turn your face to the left"),null==bx||null===(KW=hx)||void 0===KW?void 0:KW.RIGHT,"Turn your face to the right"),null==bx||null===(WW=hx)||void 0===WW?void 0:WW.UP,"Turn your face up"),null==bx||null===(VW=hx)||void 0===VW?void 0:VW.FRONTAL,"Look straight into the camera"),"qr_instructions_text","Please follow the instructions below to scan QR code:\n Move camera to the position of QR code on ID card. Align QR code to fit into camera frame to scan it"),"qr_instructions_start_button","Scan QR code"),"qr_instructions_countdown","Start in <%= x %> s"),"qr_invalid_popup_title","Invalid QR code"),"qr_invalid_popup_description","Please check and make sure scanning QR code on ID card"),"qr_invalid_popup_retry_button","Scan QR (on ID card)"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(TW,"qr_invalid_popup_skip_button","Skip"),"qr_tooltip","Fit QR code to 4 corners of camera frame and try to move camera [in or out] to scan QR code"),"session_timeout_popup_description","Scan time exceeded. Please try again.\n Position the camera at the QR code on the card. Align the four corners and try moving the camera [far - near] so that the phone camera can focus more accurately."),"session_timeout_popup_retry_button","Retry"),"session_timeout_popup_skip_button","Skip"),"flash_liveness.title","Face authentication"),"flash_liveness.instruction.far_step","Fit your face into the oval"),"flash_liveness.instruction.close_step","Move your face closer"),"flash_liveness.instruction.flash_step","Hold still"),"flash_liveness.error.no_face","No face detected"),Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(Zx(TW,"flash_liveness.processing","Processing result"),"flash_liveness.error.partial_face","Please fit your face in the oval"),"flash_liveness.error.face_too_small","Please move your face a bit closer"),"flash_liveness.error.face_too_large","Please move your face a bit further"),"flash_liveness.error.close_eye","Please open your eyes"),"flash_liveness.error.face_not_frontal","Please hold your device at eye level"),"flash_liveness.error.multiple_faces","Multiple faces detected"),"flash_liveness.error.face_too_high","Please move your face down a little"),"flash_liveness.error.face_too_blurry","Image's blurry. Please hold your phone still"),"flash_liveness.error.face_not_qualified","Please do not wear glasses, masks, or cover your face"),Zx(Zx(Zx(Zx(TW,"flash_liveness.timeout.remaining","Remaining time: <%= remain %> seconds"),"flash_liveness.timeout.expired","You need to complete within <%= timeout %> seconds. Please try again."),"flash_liveness.error.face_too_bright","Face too bright. Please adjust for appropriate lighting."),"flash_liveness.error.face_too_dark","Face too dark. Please adjust for better lighting.")),XW=db.createContext(NW),BW=function(e){var t=e.value,r=e.children,n=t.lang,i=void 0===n?"vi":n,a=t.country,o=void 0===a?"vn":a,s=t.customTexts,u=void 0===s?{}:s,c=db.useMemo((function(){var e=Object.assign({},function(e,t){return"vn"===t?"vi"===e?NW:PW:"ph"===t?jW:"in"===t?RW:NW}(i,o));return Object.keys(u).length>0&&Object.keys(u).forEach((function(t){var r,n,a,o=(null===(n=null===(r=null==u?void 0:u[t])||void 0===r?void 0:r.msg)||void 0===n?void 0:n[i])||(null===(a=null==u?void 0:u[t])||void 0===a?void 0:a[i])||(null==u?void 0:u[t]);e[t]=o})),e}),[o,u,i]);return db.createElement(XW.Provider,{value:c},r)},GW={};function YW(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:GW,t=db.useContext(XW);return void 0===t&&console.error("useSDKLocale must be used within a SDKLocaleProvider"),db.useMemo((function(){return Object.assign(Object.assign({},t),e)}),[t,e])}var HW=Object.freeze({__proto__:null,SDKLocaleProvider:BW,useSDKLocale:YW});function FW(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))}function UW(e,t){return e&&!e.endsWith("/")?[e,"/",t].join(""):[e,t].join("")}function DW(){var e=WK();return null==e?void 0:e.assetRoot}function JW(e){return UW(DW(),e)}var QW=Object.freeze({__proto__:null,getAsset:UW,useAssetRoot:DW,useAsset:JW}),_W=db.createContext({}),$W=function(e){var t=e.children,r=e.mode,n=WK(),i=n.enableVoice,a=function(e,t){var r=JW("audio/".concat(t,"/move_face_into_frame.mp3")),n=JW("audio/".concat(t,"/move_face_closer.mp3")),i=JW("audio/".concat(t,"/please_hold_still.mp3")),a=JW("audio/".concat(t,"/keep_front_id_fit_border.mp3")),o=JW("audio/".concat(t,"/keep_back_id_fit_border.mp3"));return db.useMemo((function(){switch(e){case"flash":return{move_face_into_frame:r,move_face_closer:n,please_hold_still:i};case"id_card":return{keep_front_id_fit_border:a,keep_back_id_fit_border:o};default:return{}}}),[i,o,a,e,n,r])}(r,n.lang),o=xx(db.useState({}),2),s=o[0],u=o[1];return db.useEffect((function(){var e;i&&(e=a,FW(void 0,void 0,void 0,qx().mark((function t(){var r,n;return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("object"===Ix(e)&&0!==Object.values(e).length){t.next=2;break}return t.abrupt("return",{});case 2:return r=Object.entries(e).reduce((function(e,t){var r=xx(t,2),n=r[0],i=r[1];return e[n]=new Audio(i),e}),{}),n=Object.values(r).map((function(e){return new Promise((function(t,r){e.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA?t():(e.addEventListener("suspend",(function(){console.warn("Audio loading suspended. Audio might not play smoothly."),t()})),e.addEventListener("canplay",(function(){t()})),e.addEventListener("canplaythrough",(function(){t()})),e.addEventListener("error",(function(t){if(null===e.error)return console.error("An unknown error occurred."),void r(t);switch(e.error.code){case MediaError.MEDIA_ERR_ABORTED:console.error("The fetching process for the media resource was aborted by the user agent at the user's request.");break;case MediaError.MEDIA_ERR_NETWORK:console.error("A network error caused the audio download to fail.");break;case MediaError.MEDIA_ERR_DECODE:console.error("The media data could not be decoded.");break;case MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:console.error("The media resource indicated by the src attribute was not suitable.");break;default:console.error("An unknown error occurred.")}r(t)})))}))})),t.next=6,Promise.all(n);case 6:return t.abrupt("return",r);case 7:case"end":return t.stop()}}),t)})))).then(u).catch((function(e){console.error("Error initializing audio:",e)}))}),[i,a]),db.createElement(_W.Provider,{value:s},t)},eV=Object.freeze({__proto__:null,VoiceProvider:$W,useVoicePlayer:function(){var e=db.useContext(_W),t=db.useRef(null);return{playVoice:db.useCallback((function(r){try{if(r===t.current&&!e[r].ended)return;if(t.current){var n=e[t.current];n.pause(),n.currentTime=0}var i=e[r];if(i instanceof HTMLAudioElement==0)return;i.play(),t.current=r}catch(e){console.error("Error playing audio:",e)}}),[e])}}}),tV=db.createContext(null),rV=function(e){var t=e.children,r=db.useRef(null),n=db.useRef(null);return db.useEffect((function(){var e,t;return window.Accelerometer&&((e=new Accelerometer({frequency:10})).addEventListener("reading",(function(){r.current={x:e.x,y:e.y,z:e.z}})),e.start()),window.Gyroscope&&((t=new Gyroscope({frequency:10})).addEventListener("reading",(function(){n.current={x:t.x,y:t.y,z:t.z}})),t.start()),function(){e&&e.stop(),t&&t.stop()}}),[]),db.createElement(tV.Provider,{value:{getAccelerometer:function(){return r.current},getGyroscope:function(){return n.current}}},t)};rV.propTypes={children:Tb.node},rV.defaultProps={children:null};var nV=Object.freeze({__proto__:null,useSensors:function(){return db.useContext(tV)},SensorsProvider:rV});function iV(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))}var aV={401:"invalid_license_exception",400:"invalid_parameter_exception",429:"rate_limit_exception",500:"internal_server_error",unknown:"unknown_license_error",invalid_license:"invalid_license",invalid_app_id:"invalid_app_id",invalid_date:"invalid_date",license_expired:"license_expired",invalid_signature:"invalid_signature",missing_url:"missing_url"};function oV(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function sV(e){var t,r="",n=0,i=0;for(t=0;t<e.length&&"="!==e.charAt(t);++t){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e.charAt(t));a<0||(0===n?(r+=oV(a>>2),i=3&a,n=1):1===n?(r+=oV(i<<2|a>>4),i=15&a,n=2):2===n?(r+=oV(i),r+=oV(a>>2),i=3&a,n=3):(r+=oV(i<<2|a>>4),r+=oV(15&a),n=0))}return 1===n&&(r+=oV(i<<2)),r}function uV(e){for(var t="",r=0;r<e.length;r+=2){var n=e.slice(r,r+2),i=parseInt(n,16);t+=String.fromCharCode(i)}return t}var cV=function(e){var t=xx(uV(sV(e)).split(";;"),4),r=t[1];return{mode:"offline"!==r&&"online"!==r?"offline":r,license:t[2],signature:t[3]}},lV="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function dV(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var pV=function(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}(Object.freeze({__proto__:null,default:{}})),fV=dV((function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==Ix(e)?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:pV.Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o<a;o++){var s=e.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==Ix(e)&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==Ix(e))return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===n)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===n)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=s(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=s(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,c=0,l=r;l<s;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==o){var d=1;for(c=u(e,l,e.length,t),l=0;l<o;l++)d*=t;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var l=u>>>26,d=67108863&u,p=Math.min(c,t.length-1),f=Math.max(0,c-e.length+1);f<=p;f++){var m=c-f|0;l+=(o=(i=0|e.words[m])*(a=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[c]=0|d,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<i|a)).toString(16);n=0!=(a=s>>>24-i&16777215)||o!==this.length-1?c[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var p=l[e],f=d[e];n="";var m=this.clone();for(m.negative=0;!m.isZero();){var h=m.modn(f).toString(e);n=(m=m.idivn(f)).isZero()?h+n:c[p-h.length]+h+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===t,c=new e(a),l=this.clone();if(u){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),c[a-s-1]=o}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o<n.length;o++)a=(t=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,r){var n,i,a,o=e.words,s=t.words,u=r.words,c=0,l=0|o[0],d=8191&l,p=l>>>13,f=0|o[1],m=8191&f,h=f>>>13,v=0|o[2],b=8191&v,y=v>>>13,g=0|o[3],q=8191&g,A=g>>>13,I=0|o[4],S=8191&I,M=I>>>13,k=0|o[5],C=8191&k,z=k>>>13,Z=0|o[6],w=8191&Z,x=Z>>>13,E=0|o[7],O=8191&E,K=E>>>13,W=0|o[8],V=8191&W,T=W>>>13,L=0|o[9],N=8191&L,P=L>>>13,j=0|s[0],R=8191&j,X=j>>>13,B=0|s[1],G=8191&B,Y=B>>>13,H=0|s[2],F=8191&H,U=H>>>13,D=0|s[3],J=8191&D,Q=D>>>13,_=0|s[4],$=8191&_,ee=_>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],de=8191&le,pe=le>>>13,fe=0|s[9],me=8191&fe,he=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ve=(c+(n=Math.imul(d,R))|0)+((8191&(i=(i=Math.imul(d,X))+Math.imul(p,R)|0))<<13)|0;c=((a=Math.imul(p,X))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(m,R),i=(i=Math.imul(m,X))+Math.imul(h,R)|0,a=Math.imul(h,X);var be=(c+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(p,G)|0))<<13)|0;c=((a=a+Math.imul(p,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,R),i=(i=Math.imul(b,X))+Math.imul(y,R)|0,a=Math.imul(y,X),n=n+Math.imul(m,G)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(h,G)|0,a=a+Math.imul(h,Y)|0;var ye=(c+(n=n+Math.imul(d,F)|0)|0)+((8191&(i=(i=i+Math.imul(d,U)|0)+Math.imul(p,F)|0))<<13)|0;c=((a=a+Math.imul(p,U)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(q,R),i=(i=Math.imul(q,X))+Math.imul(A,R)|0,a=Math.imul(A,X),n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(y,G)|0,a=a+Math.imul(y,Y)|0,n=n+Math.imul(m,F)|0,i=(i=i+Math.imul(m,U)|0)+Math.imul(h,F)|0,a=a+Math.imul(h,U)|0;var ge=(c+(n=n+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,Q)|0)+Math.imul(p,J)|0))<<13)|0;c=((a=a+Math.imul(p,Q)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(S,R),i=(i=Math.imul(S,X))+Math.imul(M,R)|0,a=Math.imul(M,X),n=n+Math.imul(q,G)|0,i=(i=i+Math.imul(q,Y)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,Y)|0,n=n+Math.imul(b,F)|0,i=(i=i+Math.imul(b,U)|0)+Math.imul(y,F)|0,a=a+Math.imul(y,U)|0,n=n+Math.imul(m,J)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(h,J)|0,a=a+Math.imul(h,Q)|0;var qe=(c+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(p,$)|0))<<13)|0;c=((a=a+Math.imul(p,ee)|0)+(i>>>13)|0)+(qe>>>26)|0,qe&=67108863,n=Math.imul(C,R),i=(i=Math.imul(C,X))+Math.imul(z,R)|0,a=Math.imul(z,X),n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(M,G)|0,a=a+Math.imul(M,Y)|0,n=n+Math.imul(q,F)|0,i=(i=i+Math.imul(q,U)|0)+Math.imul(A,F)|0,a=a+Math.imul(A,U)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(h,$)|0,a=a+Math.imul(h,ee)|0;var Ae=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(p,re)|0))<<13)|0;c=((a=a+Math.imul(p,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(w,R),i=(i=Math.imul(w,X))+Math.imul(x,R)|0,a=Math.imul(x,X),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(z,G)|0,a=a+Math.imul(z,Y)|0,n=n+Math.imul(S,F)|0,i=(i=i+Math.imul(S,U)|0)+Math.imul(M,F)|0,a=a+Math.imul(M,U)|0,n=n+Math.imul(q,J)|0,i=(i=i+Math.imul(q,Q)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Q)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(h,re)|0,a=a+Math.imul(h,ne)|0;var Ie=(c+(n=n+Math.imul(d,ae)|0)|0)+((8191&(i=(i=i+Math.imul(d,oe)|0)+Math.imul(p,ae)|0))<<13)|0;c=((a=a+Math.imul(p,oe)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(O,R),i=(i=Math.imul(O,X))+Math.imul(K,R)|0,a=Math.imul(K,X),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,Y)|0,n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,U)|0)+Math.imul(z,F)|0,a=a+Math.imul(z,U)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Q)|0,n=n+Math.imul(q,$)|0,i=(i=i+Math.imul(q,ee)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0,n=n+Math.imul(m,ae)|0,i=(i=i+Math.imul(m,oe)|0)+Math.imul(h,ae)|0,a=a+Math.imul(h,oe)|0;var Se=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(p,ue)|0))<<13)|0;c=((a=a+Math.imul(p,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(V,R),i=(i=Math.imul(V,X))+Math.imul(T,R)|0,a=Math.imul(T,X),n=n+Math.imul(O,G)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(K,G)|0,a=a+Math.imul(K,Y)|0,n=n+Math.imul(w,F)|0,i=(i=i+Math.imul(w,U)|0)+Math.imul(x,F)|0,a=a+Math.imul(x,U)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Q)|0)+Math.imul(z,J)|0,a=a+Math.imul(z,Q)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,ee)|0,n=n+Math.imul(q,re)|0,i=(i=i+Math.imul(q,ne)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,oe)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(h,ue)|0,a=a+Math.imul(h,ce)|0;var Me=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,pe)|0)+Math.imul(p,de)|0))<<13)|0;c=((a=a+Math.imul(p,pe)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(N,R),i=(i=Math.imul(N,X))+Math.imul(P,R)|0,a=Math.imul(P,X),n=n+Math.imul(V,G)|0,i=(i=i+Math.imul(V,Y)|0)+Math.imul(T,G)|0,a=a+Math.imul(T,Y)|0,n=n+Math.imul(O,F)|0,i=(i=i+Math.imul(O,U)|0)+Math.imul(K,F)|0,a=a+Math.imul(K,U)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Q)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ne)|0,n=n+Math.imul(q,ae)|0,i=(i=i+Math.imul(q,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,ce)|0,n=n+Math.imul(m,de)|0,i=(i=i+Math.imul(m,pe)|0)+Math.imul(h,de)|0,a=a+Math.imul(h,pe)|0;var ke=(c+(n=n+Math.imul(d,me)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(p,me)|0))<<13)|0;c=((a=a+Math.imul(p,he)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(N,G),i=(i=Math.imul(N,Y))+Math.imul(P,G)|0,a=Math.imul(P,Y),n=n+Math.imul(V,F)|0,i=(i=i+Math.imul(V,U)|0)+Math.imul(T,F)|0,a=a+Math.imul(T,U)|0,n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(K,J)|0,a=a+Math.imul(K,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,a=a+Math.imul(x,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ne)|0,n=n+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,n=n+Math.imul(q,ue)|0,i=(i=i+Math.imul(q,ce)|0)+Math.imul(A,ue)|0,a=a+Math.imul(A,ce)|0,n=n+Math.imul(b,de)|0,i=(i=i+Math.imul(b,pe)|0)+Math.imul(y,de)|0,a=a+Math.imul(y,pe)|0;var Ce=(c+(n=n+Math.imul(m,me)|0)|0)+((8191&(i=(i=i+Math.imul(m,he)|0)+Math.imul(h,me)|0))<<13)|0;c=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(N,F),i=(i=Math.imul(N,U))+Math.imul(P,F)|0,a=Math.imul(P,U),n=n+Math.imul(V,J)|0,i=(i=i+Math.imul(V,Q)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,Q)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(K,$)|0,a=a+Math.imul(K,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(x,re)|0,a=a+Math.imul(x,ne)|0,n=n+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(M,ue)|0,a=a+Math.imul(M,ce)|0,n=n+Math.imul(q,de)|0,i=(i=i+Math.imul(q,pe)|0)+Math.imul(A,de)|0,a=a+Math.imul(A,pe)|0;var ze=(c+(n=n+Math.imul(b,me)|0)|0)+((8191&(i=(i=i+Math.imul(b,he)|0)+Math.imul(y,me)|0))<<13)|0;c=((a=a+Math.imul(y,he)|0)+(i>>>13)|0)+(ze>>>26)|0,ze&=67108863,n=Math.imul(N,J),i=(i=Math.imul(N,Q))+Math.imul(P,J)|0,a=Math.imul(P,Q),n=n+Math.imul(V,$)|0,i=(i=i+Math.imul(V,ee)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(K,re)|0,a=a+Math.imul(K,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(z,ue)|0,a=a+Math.imul(z,ce)|0,n=n+Math.imul(S,de)|0,i=(i=i+Math.imul(S,pe)|0)+Math.imul(M,de)|0,a=a+Math.imul(M,pe)|0;var Ze=(c+(n=n+Math.imul(q,me)|0)|0)+((8191&(i=(i=i+Math.imul(q,he)|0)+Math.imul(A,me)|0))<<13)|0;c=((a=a+Math.imul(A,he)|0)+(i>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,ee))+Math.imul(P,$)|0,a=Math.imul(P,ee),n=n+Math.imul(V,re)|0,i=(i=i+Math.imul(V,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,oe)|0)+Math.imul(K,ae)|0,a=a+Math.imul(K,oe)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(x,ue)|0,a=a+Math.imul(x,ce)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,pe)|0)+Math.imul(z,de)|0,a=a+Math.imul(z,pe)|0;var we=(c+(n=n+Math.imul(S,me)|0)|0)+((8191&(i=(i=i+Math.imul(S,he)|0)+Math.imul(M,me)|0))<<13)|0;c=((a=a+Math.imul(M,he)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(N,re),i=(i=Math.imul(N,ne))+Math.imul(P,re)|0,a=Math.imul(P,ne),n=n+Math.imul(V,ae)|0,i=(i=i+Math.imul(V,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(K,ue)|0,a=a+Math.imul(K,ce)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,pe)|0)+Math.imul(x,de)|0,a=a+Math.imul(x,pe)|0;var xe=(c+(n=n+Math.imul(C,me)|0)|0)+((8191&(i=(i=i+Math.imul(C,he)|0)+Math.imul(z,me)|0))<<13)|0;c=((a=a+Math.imul(z,he)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(N,ae),i=(i=Math.imul(N,oe))+Math.imul(P,ae)|0,a=Math.imul(P,oe),n=n+Math.imul(V,ue)|0,i=(i=i+Math.imul(V,ce)|0)+Math.imul(T,ue)|0,a=a+Math.imul(T,ce)|0,n=n+Math.imul(O,de)|0,i=(i=i+Math.imul(O,pe)|0)+Math.imul(K,de)|0,a=a+Math.imul(K,pe)|0;var Ee=(c+(n=n+Math.imul(w,me)|0)|0)+((8191&(i=(i=i+Math.imul(w,he)|0)+Math.imul(x,me)|0))<<13)|0;c=((a=a+Math.imul(x,he)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,ue),i=(i=Math.imul(N,ce))+Math.imul(P,ue)|0,a=Math.imul(P,ce),n=n+Math.imul(V,de)|0,i=(i=i+Math.imul(V,pe)|0)+Math.imul(T,de)|0,a=a+Math.imul(T,pe)|0;var Oe=(c+(n=n+Math.imul(O,me)|0)|0)+((8191&(i=(i=i+Math.imul(O,he)|0)+Math.imul(K,me)|0))<<13)|0;c=((a=a+Math.imul(K,he)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(N,de),i=(i=Math.imul(N,pe))+Math.imul(P,de)|0,a=Math.imul(P,pe);var Ke=(c+(n=n+Math.imul(V,me)|0)|0)+((8191&(i=(i=i+Math.imul(V,he)|0)+Math.imul(T,me)|0))<<13)|0;c=((a=a+Math.imul(T,he)|0)+(i>>>13)|0)+(Ke>>>26)|0,Ke&=67108863;var We=(c+(n=Math.imul(N,me))|0)+((8191&(i=(i=Math.imul(N,he))+Math.imul(P,me)|0))<<13)|0;return c=((a=Math.imul(P,he))+(i>>>13)|0)+(We>>>26)|0,We&=67108863,u[0]=ve,u[1]=be,u[2]=ye,u[3]=ge,u[4]=qe,u[5]=Ae,u[6]=Ie,u[7]=Se,u[8]=Me,u[9]=ke,u[10]=Ce,u[11]=ze,u[12]=Ze,u[13]=we,u[14]=xe,u[15]=Ee,u[16]=Oe,u[17]=Ke,u[18]=We,0!==c&&(u[19]=c,r.length++),r};function m(e,t,r){return(new h).mulp(e,t,r)}function h(e,t){this.x=e,this.y=t}Math.imul||(f=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?f(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,u=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=u;c++){var l=a-c,d=(0|e.words[l])*(0|t.words[c]),p=67108863&d;s=67108863&(p=p+s|0),i+=(o=(o=o+(d/67108864|0)|0)+(p>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):m(this,e,t)},h.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},h.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},h.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o<a;o++)n[o]=t[e[o]],i[o]=r[e[o]]},h.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var d=u,p=c,f=0;f<o;f++){var m=r[l+f],h=n[l+f],v=r[l+f+o],b=n[l+f+o],y=d*v-p*b;b=d*b+p*v,v=y,r[l+f]=m+v,n[l+f]=h+b,r[l+f+o]=m-v,n[l+f+o]=h-b,f!==s&&(y=u*d-c*p,p=u*p+c*d,d=y)}},h.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},h.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},h.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},h.prototype.convert13b=function(e,t,n,i){for(var a=0,o=0;o<t;o++)a+=0|e[o],n[2*o]=8191&a,a>>>=13,n[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<i;++o)n[o]=0;r(0===a),r(0==(-8192&a))},h.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},h.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),d=new Array(n),p=r.words;p.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,c,n),this.transform(o,a,s,u,n,i),this.transform(c,a,l,d,n,i);for(var f=0;f<n;f++){var m=s[f]*l[f]-u[f]*d[f];u[f]=s[f]*d[f]+u[f]*l[f],s[f]=m}return this.conjugate(s,u,n),this.transform(s,u,p,a,n,i),this.conjugate(p,a,n),this.normalize13b(p,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),m(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[n]=67108863&a}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,u=(0|this.words[t])-s<<n;this.words[t]=u|o,o=s>>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,u=n;if(i-=o,i=Math.max(0,i),u){for(var c=0;c<o;c++)u.words[c]=this.words[c];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var d=0|this.words[c];this.words[c]=l<<26-a|d>>>a,l=d&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,a,o=e.length+n;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&a}for(;i<this.length-n;i++)s=(a=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&a;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,o=0|a.words[a.length-1];0!=(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,u=n.length-a.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=n.clone()._ishlnsubmul(a,1,u);0===l.negative&&(n=l,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var p=67108864*(0|n.words[a.length+d])+(0|n.words[a.length+d-1]);for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(a,p,d);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(a,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=p)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),u=new i(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var p=0,f=1;0==(t.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(l),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var m=0,h=1;0==(n.words[0]&h)&&m<26;++m,h<<=1);if(m>0)for(n.iushrn(m);m-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s),o.isub(u)):(n.isub(t),s.isub(a),u.isub(o))}return{a:s,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var d=0,p=1;0==(n.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var a=i,o=n;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new I(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function q(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},n(y,b),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&r)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(g,b),n(q,b),n(A,b),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new g;else if("p192"===e)t=new q;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return v[e]=t,t},I.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);r(!a.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,a),p=this.pow(e,a.addn(1).iushrn(1)),f=this.pow(e,a),m=o;0!==f.cmp(s);){for(var h=f,v=0;0!==h.cmp(s);v++)h=h.redSqr();r(v<m);var b=this.pow(d,new i(1).iushln(m-v-1));p=p.redMul(b),d=b.redSqr(),f=f.redMul(d),m=v}return p},I.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},I.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var d=c>>l&1;a!==r[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4==++s||0===n&&0===l)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}u=26}return a},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,I),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,lV)})),mV=hV;function hV(e,t){if(!e)throw new Error(t||"Assertion failed")}hV.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var vV,bV=dV((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),a=i>>8,o=255&i;a?r.push(a,o):r.push(o)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),yV=dV((function(e,t){var r=t;r.assert=mV,r.toArray=bV.toArray,r.zero2=bV.zero2,r.toHex=bV.toHex,r.encode=bV.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,a=e.clone(),o=0;o<n.length;o++){var s,u=a.andln(i-1);a.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,a.isubn(s)):s=0,n[o]=s,a.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var o,s,u=e.andln(3)+i&3,c=t.andln(3)+a&3;3===u&&(u=-1),3===c&&(c=-1),o=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(o),s=0==(1&c)?0:3!=(n=t.andln(7)+a&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===o+1&&(i=1-i),2*a===s+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new fV(e,"hex","le")}})),gV=function(e){return vV||(vV=new qV(null)),vV.generate(e)};function qV(e){this.rand=e}var AV=qV;if(qV.prototype.generate=function(e){return this._rand(e)},qV.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==("undefined"==typeof self?"undefined":Ix(self)))self.crypto&&self.crypto.getRandomValues?qV.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?qV.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==("undefined"==typeof window?"undefined":Ix(window))&&(qV.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var IV=pV;if("function"!=typeof IV.randomBytes)throw new Error("Not supported");qV.prototype._rand=function(e){return IV.randomBytes(e)}}catch(gZ){}gV.Rand=AV;var SV=yV.getNAF,MV=yV.getJSF,kV=yV.assert;function CV(e,t){this.type=e,this.p=new fV(t.p,16),this.red=t.prime?fV.red(t.prime):fV.mont(this.p),this.zero=new fV(0).toRed(this.red),this.one=new fV(1).toRed(this.red),this.two=new fV(2).toRed(this.red),this.n=t.n&&new fV(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var zV=CV;function ZV(e,t){this.curve=e,this.type=t,this.precomputed=null}CV.prototype.point=function(){throw new Error("Not implemented")},CV.prototype.validate=function(){throw new Error("Not implemented")},CV.prototype._fixedNafMul=function(e,t){kV(e.precomputed);var r=e._getDoubles(),n=SV(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,o,s=[];for(a=0;a<n.length;a+=r.step){o=0;for(var u=a+r.step-1;u>=a;u--)o=(o<<1)+n[u];s.push(o)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(a=0;a<s.length;a++)(o=s[a])===d?l=l.mixedAdd(r.points[a]):o===-d&&(l=l.mixedAdd(r.points[a].neg()));c=c.add(l)}return c.toP()},CV.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=SV(t,r,this._bitLength),o=this.jpoint(null,null,null),s=a.length-1;s>=0;s--){for(var u=0;s>=0&&0===a[s];s--)u++;if(s>=0&&u++,o=o.dblp(u),s<0)break;var c=a[s];kV(0!==c),o="affine"===e.type?c>0?o.mixedAdd(i[c-1>>1]):o.mixedAdd(i[-c-1>>1].neg()):c>0?o.add(i[c-1>>1]):o.add(i[-c-1>>1].neg())}return"affine"===e.type?o.toP():o},CV.prototype._wnafMulAdd=function(e,t,r,n,i){var a,o,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,d=0;for(a=0;a<n;a++){var p=(s=t[a])._getNAFPoints(e);u[a]=p.wnd,c[a]=p.points}for(a=n-1;a>=1;a-=2){var f=a-1,m=a;if(1===u[f]&&1===u[m]){var h=[t[f],null,null,t[m]];0===t[f].y.cmp(t[m].y)?(h[1]=t[f].add(t[m]),h[2]=t[f].toJ().mixedAdd(t[m].neg())):0===t[f].y.cmp(t[m].y.redNeg())?(h[1]=t[f].toJ().mixedAdd(t[m]),h[2]=t[f].add(t[m].neg())):(h[1]=t[f].toJ().mixedAdd(t[m]),h[2]=t[f].toJ().mixedAdd(t[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=MV(r[f],r[m]);for(d=Math.max(b[0].length,d),l[f]=new Array(d),l[m]=new Array(d),o=0;o<d;o++){var y=0|b[0][o],g=0|b[1][o];l[f][o]=v[3*(y+1)+(g+1)],l[m][o]=0,c[f]=h}}else l[f]=SV(r[f],u[f],this._bitLength),l[m]=SV(r[m],u[m],this._bitLength),d=Math.max(l[f].length,d),d=Math.max(l[m].length,d)}var q=this.jpoint(null,null,null),A=this._wnafT4;for(a=d;a>=0;a--){for(var I=0;a>=0;){var S=!0;for(o=0;o<n;o++)A[o]=0|l[o][a],0!==A[o]&&(S=!1);if(!S)break;I++,a--}if(a>=0&&I++,q=q.dblp(I),a<0)break;for(o=0;o<n;o++){var M=A[o];0!==M&&(M>0?s=c[o][M-1>>1]:M<0&&(s=c[o][-M-1>>1].neg()),q="affine"===s.type?q.mixedAdd(s):q.add(s))}}for(a=0;a<n;a++)c[a]=null;return i?q:q.toP()},CV.BasePoint=ZV,ZV.prototype.eq=function(){throw new Error("Not implemented")},ZV.prototype.validate=function(){return this.curve.validate(this)},CV.prototype.decodePoint=function(e,t){e=yV.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?kV(e[e.length-1]%2==0):7===e[0]&&kV(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},ZV.prototype.encodeCompressed=function(e){return this.encode(e,!0)},ZV.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},ZV.prototype.encode=function(e,t){return yV.encode(this._encode(t),e)},ZV.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},ZV.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},ZV.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var a=0;a<e;a++)n=n.dbl();r.push(n)}return{step:e,points:r}},ZV.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},ZV.prototype._getBeta=function(){return null},ZV.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var wV=dV((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),xV=yV.assert;function EV(e){zV.call(this,"short",e),this.a=new fV(e.a,16).toRed(this.red),this.b=new fV(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}wV(EV,zV);var OV=EV;function KV(e,t,r,n){zV.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new fV(t,16),this.y=new fV(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function WV(e,t,r,n){zV.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new fV(0)):(this.x=new fV(t,16),this.y=new fV(r,16),this.z=new fV(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function VV(e){zV.call(this,"mont",e),this.a=new fV(e.a,16).toRed(this.red),this.b=new fV(e.b,16).toRed(this.red),this.i4=new fV(4).toRed(this.red).redInvm(),this.two=new fV(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}EV.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new fV(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new fV(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],xV(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new fV(e.a,16),b:new fV(e.b,16)}})):this._getEndoBasis(r)}}},EV.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:fV.mont(e),r=new fV(2).toRed(t).redInvm(),n=r.redNeg(),i=new fV(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},EV.prototype._getEndoBasis=function(e){for(var t,r,n,i,a,o,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,p=this.n.clone(),f=new fV(1),m=new fV(0),h=new fV(0),v=new fV(1),b=0;0!==d.cmpn(0);){var y=p.div(d);u=p.sub(y.mul(d)),c=h.sub(y.mul(f));var g=v.sub(y.mul(m));if(!n&&u.cmp(l)<0)t=s.neg(),r=f,n=u.neg(),i=c;else if(n&&2==++b)break;s=u,p=d,d=u,h=f,f=c,v=m,m=g}a=u.neg(),o=c;var q=n.sqr().add(i.sqr());return a.sqr().add(o.sqr()).cmp(q)>=0&&(a=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:n,b:i},{a:a,b:o}]},EV.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),s=a.mul(n.a),u=i.mul(r.b),c=a.mul(n.b);return{k1:e.sub(o).sub(s),k2:u.add(c).neg()}},EV.prototype.pointFromX=function(e,t){(e=new fV(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},EV.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},EV.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var o=this._endoSplit(t[a]),s=e[a],u=s._getBeta();o.k1.negative&&(o.k1.ineg(),s=s.neg(!0)),o.k2.negative&&(o.k2.ineg(),u=u.neg(!0)),n[2*a]=s,n[2*a+1]=u,i[2*a]=o.k1,i[2*a+1]=o.k2}for(var c=this._wnafMulAdd(1,n,i,2*a,r),l=0;l<2*a;l++)n[l]=null,i[l]=null;return c},wV(KV,zV.BasePoint),EV.prototype.point=function(e,t,r){return new KV(this,e,t,r)},EV.prototype.pointFromJSON=function(e,t){return KV.fromJSON(this,e,t)},KV.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},KV.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},KV.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var a=t[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(i))}},n},KV.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},KV.prototype.isInfinity=function(){return this.inf},KV.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},KV.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},KV.prototype.getX=function(){return this.x.fromRed()},KV.prototype.getY=function(){return this.y.fromRed()},KV.prototype.mul=function(e){return e=new fV(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},KV.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},KV.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},KV.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},KV.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},KV.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},wV(WV,zV.BasePoint),EV.prototype.jpoint=function(e,t,r){return new WV(this,e,t,r)},WV.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},WV.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},WV.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=a.redSub(o);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),d=n.redMul(c),p=u.redSqr().redIAdd(l).redISub(d).redISub(d),f=u.redMul(d.redISub(p)).redISub(a.redMul(l)),m=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(p,f,m)},WV.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=r.redSub(n),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),c=u.redMul(o),l=r.redMul(u),d=s.redSqr().redIAdd(c).redISub(l).redISub(l),p=s.redMul(l.redISub(d)).redISub(i.redMul(c)),f=this.z.redMul(o);return this.curve.jpoint(d,p,f)},WV.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,a=this.x,o=this.y,s=this.z,u=s.redSqr().redSqr(),c=o.redAdd(o);for(t=0;t<e;t++){var l=a.redSqr(),d=c.redSqr(),p=d.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),m=a.redMul(d),h=f.redSqr().redISub(m.redAdd(m)),v=m.redISub(h),b=f.redMul(v);b=b.redIAdd(b).redISub(p);var y=c.redMul(s);t+1<e&&(u=u.redMul(p)),a=h,s=y,c=b}return this.curve.jpoint(a,c.redMul(i),s)},WV.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},WV.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(o).redISub(o),c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(o.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),p=d.redSqr(),f=this.x.redAdd(d).redSqr().redISub(l).redISub(p);f=f.redIAdd(f);var m=l.redAdd(l).redIAdd(l),h=m.redSqr(),v=p.redIAdd(p);v=(v=v.redIAdd(v)).redIAdd(v),e=h.redISub(f).redISub(f),t=m.redMul(f.redISub(e)).redISub(v),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},WV.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(o).redISub(o);e=u;var c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(o.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),p=this.x.redMul(d),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var m=p.redIAdd(p),h=(m=m.redIAdd(m)).redAdd(m);e=f.redSqr().redISub(h),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var v=d.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),t=f.redMul(m.redISub(e)).redISub(v)}return this.curve.jpoint(e,t,r)},WV.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),a=t.redSqr(),o=r.redSqr(),s=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(o),l=s.redSqr().redISub(c.redAdd(c)),d=c.redISub(l),p=o.redSqr();p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p);var f=s.redMul(d).redISub(p),m=r.redAdd(r).redMul(n);return this.curve.jpoint(l,f,m)},WV.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(a)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(o).redSqr().redISub(a).redISub(s).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(s).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var p=this.y.redMul(c.redMul(u.redISub(c)).redISub(o.redMul(s)));p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p);var f=this.z.redAdd(o).redSqr().redISub(r).redISub(s);return this.curve.jpoint(d,p,f)},WV.prototype.mul=function(e,t){return e=new fV(e,t),this.curve._wnafMul(this,e)},WV.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},WV.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},WV.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},WV.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},wV(VV,zV);var TV=VV;function LV(e,t,r){zV.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new fV(t,16),this.z=new fV(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}VV.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},wV(LV,zV.BasePoint),VV.prototype.decodePoint=function(e,t){return this.point(yV.toArray(e,t),1)},VV.prototype.point=function(e,t){return new LV(this,e,t)},VV.prototype.pointFromJSON=function(e){return LV.fromJSON(this,e)},LV.prototype.precompute=function(){},LV.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},LV.fromJSON=function(e,t){return new LV(e,t[0],t[1]||e.one)},LV.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},LV.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},LV.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},LV.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},LV.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=i.redMul(n),s=t.z.redMul(a.redAdd(o).redSqr()),u=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,u)},LV.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},LV.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},LV.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},LV.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},LV.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},LV.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var NV=yV.assert;function PV(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,zV.call(this,"edwards",e),this.a=new fV(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new fV(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new fV(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),NV(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}wV(PV,zV);var jV=PV;function RV(e,t,r,n,i){zV.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new fV(t,16),this.y=new fV(r,16),this.z=n?new fV(n,16):this.curve.one,this.t=i&&new fV(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}PV.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},PV.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},PV.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},PV.prototype.pointFromX=function(e,t){(e=new fV(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var s=o.fromRed().isOdd();return(t&&!s||!t&&s)&&(o=o.redNeg()),this.point(e,o)},PV.prototype.pointFromY=function(e,t){(e=new fV(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=a.redSqrt();if(0!==o.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return o.fromRed().isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},PV.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},wV(RV,zV.BasePoint),PV.prototype.pointFromJSON=function(e){return RV.fromJSON(this,e)},PV.prototype.point=function(e,t,r,n){return new RV(this,e,t,r,n)},RV.fromJSON=function(e,t){return new RV(e,t[0],t[1],t[2])},RV.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},RV.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},RV.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),o=a.redSub(r),s=n.redSub(t),u=i.redMul(o),c=a.redMul(s),l=i.redMul(s),d=o.redMul(a);return this.curve.point(u,c,d,l)},RV.prototype._projDbl=function(){var e,t,r,n,i,a,o=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=o.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),a=c.redSub(i).redISub(i),e=o.redSub(s).redISub(u).redMul(a),t=c.redMul(n.redSub(u)),r=c.redMul(a))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),a=n.redSub(i).redSub(i),e=this.curve._mulC(o.redISub(n)).redMul(a),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(a);return this.curve.point(e,t,r)},RV.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},RV.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),o=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=a.redMul(o),l=s.redMul(u),d=a.redMul(u),p=o.redMul(s);return this.curve.point(c,l,p,d)},RV.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),u=i.redSub(s),c=i.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),d=n.redMul(u).redMul(l);return this.curve.twisted?(t=n.redMul(c).redMul(o.redSub(this.curve._mulA(a))),r=u.redMul(c)):(t=n.redMul(c).redMul(o.redSub(a)),r=this.curve._mulC(u).redMul(c)),this.curve.point(d,t,r)},RV.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},RV.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},RV.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},RV.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},RV.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},RV.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},RV.prototype.getX=function(){return this.normalize(),this.x.fromRed()},RV.prototype.getY=function(){return this.normalize(),this.y.fromRed()},RV.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},RV.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},RV.prototype.toP=RV.prototype.normalize,RV.prototype.mixedAdd=RV.prototype.add;var XV=dV((function(e,t){var r=t;r.base=zV,r.short=OV,r.mont=TV,r.edwards=jV}));function BV(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function GV(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function YV(e){return 1===e.length?"0"+e:e}function HV(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var FV={inherits:wV,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):BV(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},toHex:function(e){for(var t="",r=0;r<e.length;r++)t+=YV(e[r].toString(16));return t},htonl:GV,toHex32:function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=GV(i)),r+=HV(i.toString(16))}return r},zero2:YV,zero8:HV,join32:function(e,t,r,n){var i=r-t;mV(i%4==0);for(var a=new Array(i/4),o=0,s=t;o<a.length;o++,s+=4){var u;u="big"===n?e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],a[o]=u>>>0}return a},split32:function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var a=e[n];"big"===t?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,o=(a<n?1:0)+r+i;e[t]=o>>>0,e[t+1]=a},sum64_hi:function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,a,o,s){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+a>>>0)<a?1:0,e+r+i+o+(u+=(c=c+s>>>0)<s?1:0)>>>0},sum64_4_lo:function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},sum64_5_hi:function(e,t,r,n,i,a,o,s,u,c){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+a>>>0)<a?1:0,l+=(d=d+s>>>0)<s?1:0,e+r+i+o+u+(l+=(d=d+c>>>0)<c?1:0)>>>0},sum64_5_lo:function(e,t,r,n,i,a,o,s,u,c){return t+n+a+s+c>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function UV(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var DV=UV;UV.prototype.update=function(e,t){if(e=FV.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=FV.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},UV.prototype.digest=function(e){return this.update(this._pad()),mV(null===this.pending),this._digest(e)},UV.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a<this.padLength;a++)n[i++]=0;return n};var JV={BlockHash:DV},QV=FV.rotr32;function _V(e,t,r){return e&t^~e&r}function $V(e,t,r){return e&t^e&r^t&r}var eT=_V,tT=$V,rT=FV.rotl32,nT=FV.sum32,iT=FV.sum32_5,aT=function(e,t,r,n){return 0===e?_V(t,r,n):1===e||3===e?function(e,t,r){return e^t^r}(t,r,n):2===e?$V(t,r,n):void 0},oT=JV.BlockHash,sT=[1518500249,1859775393,2400959708,3395469782];function uT(){if(!(this instanceof uT))return new uT;oT.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}FV.inherits(uT,oT);var cT=uT;uT.blockSize=512,uT.outSize=160,uT.hmacStrength=80,uT.padLength=64,uT.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=rT(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],u=this.h[4];for(n=0;n<r.length;n++){var c=~~(n/20),l=iT(rT(i,5),aT(c,a,o,s),u,r[n],sT[c]);u=s,s=o,o=rT(a,30),a=i,i=l}this.h[0]=nT(this.h[0],i),this.h[1]=nT(this.h[1],a),this.h[2]=nT(this.h[2],o),this.h[3]=nT(this.h[3],s),this.h[4]=nT(this.h[4],u)},uT.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h,"big"):FV.split32(this.h,"big")};var lT=FV.sum32,dT=FV.sum32_4,pT=FV.sum32_5,fT=eT,mT=tT,hT=function(e){return QV(e,2)^QV(e,13)^QV(e,22)},vT=function(e){return QV(e,6)^QV(e,11)^QV(e,25)},bT=function(e){return QV(e,7)^QV(e,18)^e>>>3},yT=function(e){return QV(e,17)^QV(e,19)^e>>>10},gT=JV.BlockHash,qT=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function AT(){if(!(this instanceof AT))return new AT;gT.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=qT,this.W=new Array(64)}FV.inherits(AT,gT);var IT=AT;function ST(){if(!(this instanceof ST))return new ST;IT.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}AT.blockSize=512,AT.outSize=256,AT.hmacStrength=192,AT.padLength=64,AT.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=dT(yT(r[n-2]),r[n-7],bT(r[n-15]),r[n-16]);var i=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],d=this.h[7];for(mV(this.k.length===r.length),n=0;n<r.length;n++){var p=pT(d,vT(u),fT(u,c,l),this.k[n],r[n]),f=lT(hT(i),mT(i,a,o));d=l,l=c,c=u,u=lT(s,p),s=o,o=a,a=i,i=lT(p,f)}this.h[0]=lT(this.h[0],i),this.h[1]=lT(this.h[1],a),this.h[2]=lT(this.h[2],o),this.h[3]=lT(this.h[3],s),this.h[4]=lT(this.h[4],u),this.h[5]=lT(this.h[5],c),this.h[6]=lT(this.h[6],l),this.h[7]=lT(this.h[7],d)},AT.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h,"big"):FV.split32(this.h,"big")},FV.inherits(ST,IT);var MT=ST;ST.blockSize=512,ST.outSize=224,ST.hmacStrength=192,ST.padLength=64,ST.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h.slice(0,7),"big"):FV.split32(this.h.slice(0,7),"big")};var kT=FV.rotr64_hi,CT=FV.rotr64_lo,zT=FV.shr64_hi,ZT=FV.shr64_lo,wT=FV.sum64,xT=FV.sum64_hi,ET=FV.sum64_lo,OT=FV.sum64_4_hi,KT=FV.sum64_4_lo,WT=FV.sum64_5_hi,VT=FV.sum64_5_lo,TT=JV.BlockHash,LT=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function NT(){if(!(this instanceof NT))return new NT;TT.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=LT,this.W=new Array(160)}FV.inherits(NT,TT);var PT=NT;function jT(e,t,r,n,i){var a=e&r^~e&i;return a<0&&(a+=4294967296),a}function RT(e,t,r,n,i,a){var o=t&n^~t&a;return o<0&&(o+=4294967296),o}function XT(e,t,r,n,i){var a=e&r^e&i^r&i;return a<0&&(a+=4294967296),a}function BT(e,t,r,n,i,a){var o=t&n^t&a^n&a;return o<0&&(o+=4294967296),o}function GT(e,t){var r=kT(e,t,28)^kT(t,e,2)^kT(t,e,7);return r<0&&(r+=4294967296),r}function YT(e,t){var r=CT(e,t,28)^CT(t,e,2)^CT(t,e,7);return r<0&&(r+=4294967296),r}function HT(e,t){var r=kT(e,t,14)^kT(e,t,18)^kT(t,e,9);return r<0&&(r+=4294967296),r}function FT(e,t){var r=CT(e,t,14)^CT(e,t,18)^CT(t,e,9);return r<0&&(r+=4294967296),r}function UT(e,t){var r=kT(e,t,1)^kT(e,t,8)^zT(e,t,7);return r<0&&(r+=4294967296),r}function DT(e,t){var r=CT(e,t,1)^CT(e,t,8)^ZT(e,t,7);return r<0&&(r+=4294967296),r}function JT(e,t){var r=kT(e,t,19)^kT(t,e,29)^zT(e,t,6);return r<0&&(r+=4294967296),r}function QT(e,t){var r=CT(e,t,19)^CT(t,e,29)^ZT(e,t,6);return r<0&&(r+=4294967296),r}function _T(){if(!(this instanceof _T))return new _T;PT.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}NT.blockSize=1024,NT.outSize=512,NT.hmacStrength=192,NT.padLength=128,NT.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=JT(r[n-4],r[n-3]),a=QT(r[n-4],r[n-3]),o=r[n-14],s=r[n-13],u=UT(r[n-30],r[n-29]),c=DT(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=OT(i,a,o,s,u,c,l,d),r[n+1]=KT(i,a,o,s,u,c,l,d)}},NT.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],a=this.h[2],o=this.h[3],s=this.h[4],u=this.h[5],c=this.h[6],l=this.h[7],d=this.h[8],p=this.h[9],f=this.h[10],m=this.h[11],h=this.h[12],v=this.h[13],b=this.h[14],y=this.h[15];mV(this.k.length===r.length);for(var g=0;g<r.length;g+=2){var q=b,A=y,I=HT(d,p),S=FT(d,p),M=jT(d,0,f,0,h),k=RT(0,p,0,m,0,v),C=this.k[g],z=this.k[g+1],Z=r[g],w=r[g+1],x=WT(q,A,I,S,M,k,C,z,Z,w),E=VT(q,A,I,S,M,k,C,z,Z,w);q=GT(n,i),A=YT(n,i),I=XT(n,0,a,0,s),S=BT(0,i,0,o,0,u);var O=xT(q,A,I,S),K=ET(q,A,I,S);b=h,y=v,h=f,v=m,f=d,m=p,d=xT(c,l,x,E),p=ET(l,l,x,E),c=s,l=u,s=a,u=o,a=n,o=i,n=xT(x,E,O,K),i=ET(x,E,O,K)}wT(this.h,0,n,i),wT(this.h,2,a,o),wT(this.h,4,s,u),wT(this.h,6,c,l),wT(this.h,8,d,p),wT(this.h,10,f,m),wT(this.h,12,h,v),wT(this.h,14,b,y)},NT.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h,"big"):FV.split32(this.h,"big")},FV.inherits(_T,PT);var $T=_T;_T.blockSize=1024,_T.outSize=384,_T.hmacStrength=192,_T.padLength=128,_T.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h.slice(0,12),"big"):FV.split32(this.h.slice(0,12),"big")};var eL={sha1:cT,sha224:MT,sha256:IT,sha384:$T,sha512:PT},tL=FV.rotl32,rL=FV.sum32,nL=FV.sum32_3,iL=FV.sum32_4,aL=JV.BlockHash;function oL(){if(!(this instanceof oL))return new oL;aL.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}FV.inherits(oL,aL);var sL=oL;function uL(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function cL(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function lL(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}oL.blockSize=512,oL.outSize=160,oL.hmacStrength=192,oL.padLength=64,oL.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],a=this.h[3],o=this.h[4],s=r,u=n,c=i,l=a,d=o,p=0;p<80;p++){var f=rL(tL(iL(r,uL(p,n,i,a),e[dL[p]+t],cL(p)),fL[p]),o);r=o,o=a,a=tL(i,10),i=n,n=f,f=rL(tL(iL(s,uL(79-p,u,c,l),e[pL[p]+t],lL(p)),mL[p]),d),s=d,d=l,l=tL(c,10),c=u,u=f}f=nL(this.h[1],i,l),this.h[1]=nL(this.h[2],a,d),this.h[2]=nL(this.h[3],o,s),this.h[3]=nL(this.h[4],r,u),this.h[4]=nL(this.h[0],n,c),this.h[0]=f},oL.prototype._digest=function(e){return"hex"===e?FV.toHex32(this.h,"little"):FV.split32(this.h,"little")};var dL=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],pL=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],fL=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],mL=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],hL={ripemd160:sL};function vL(e,t,r){if(!(this instanceof vL))return new vL(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(FV.toArray(t,r))}var bL=vL;vL.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),mV(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},vL.prototype.update=function(e,t){return this.inner.update(e,t),this},vL.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var yL=dV((function(e,t){var r=t;r.utils=FV,r.common=JV,r.sha=eL,r.ripemd=hL,r.hmac=bL,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160})),gL={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},qL=dV((function(e,t){var r,n=t,i=yV.assert;function a(e){"short"===e.type?this.curve=new XV.short(e):"edwards"===e.type?this.curve=new XV.edwards(e):this.curve=new XV.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new a(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=a,o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:yL.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:yL.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:yL.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:yL.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:yL.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:yL.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:yL.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=gL}catch(e){r=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:yL.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function AL(e){if(!(this instanceof AL))return new AL(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=bV.toArray(e.entropy,e.entropyEnc||"hex"),r=bV.toArray(e.nonce,e.nonceEnc||"hex"),n=bV.toArray(e.pers,e.persEnc||"hex");mV(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var IL=AL;AL.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},AL.prototype._hmac=function(){return new yL.hmac(this.hash,this.K)},AL.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},AL.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=bV.toArray(e,t),r=bV.toArray(r,n),mV(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},AL.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=bV.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var a=i.slice(0,e);return this._update(r),this._reseed++,bV.encode(a,t)};var SL=yV.assert;function ML(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var kL=ML;ML.fromPublic=function(e,t,r){return t instanceof ML?t:new ML(e,{pub:t,pubEnc:r})},ML.fromPrivate=function(e,t,r){return t instanceof ML?t:new ML(e,{priv:t,privEnc:r})},ML.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},ML.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},ML.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},ML.prototype._importPrivate=function(e,t){this.priv=new fV(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},ML.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?SL(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||SL(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},ML.prototype.derive=function(e){return e.validate()||SL(e.validate(),"public point not validated"),e.mul(this.priv).getX()},ML.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},ML.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},ML.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var CL=yV.assert;function zL(e,t){if(e instanceof zL)return e;this._importDER(e,t)||(CL(e.r&&e.s,"Signature without r or s"),this.r=new fV(e.r,16),this.s=new fV(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var ZL=zL;function wL(){this.place=0}function xL(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,a=0,o=t.place;a<n;a++,o++)i<<=8,i|=e[o],i>>>=0;return!(i<=127)&&(t.place=o,i)}function EL(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function OL(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}zL.prototype._importDER=function(e,t){e=yV.toArray(e,t);var r=new wL;if(48!==e[r.place++])return!1;var n=xL(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=xL(e,r);if(!1===i)return!1;var a=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=xL(e,r);if(!1===o)return!1;if(e.length!==o+r.place)return!1;var s=e.slice(r.place,o+r.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new fV(a),this.s=new fV(s),this.recoveryParam=null,!0},zL.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=EL(t),r=EL(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];OL(n,t.length),(n=n.concat(t)).push(2),OL(n,r.length);var i=n.concat(r),a=[48];return OL(a,i.length),a=a.concat(i),yV.encode(a,e)};var KL=yV.assert;function WL(e){if(!(this instanceof WL))return new WL(e);"string"==typeof e&&(KL(Object.prototype.hasOwnProperty.call(qL,e),"Unknown curve "+e),e=qL[e]),e instanceof qL.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var VL=WL;WL.prototype.keyPair=function(e){return new kL(this,e)},WL.prototype.keyFromPrivate=function(e,t){return kL.fromPrivate(this,e,t)},WL.prototype.keyFromPublic=function(e,t){return kL.fromPublic(this,e,t)},WL.prototype.genKeyPair=function(e){e||(e={});for(var t=new IL({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||gV(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new fV(2));;){var i=new fV(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},WL.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},WL.prototype.sign=function(e,t,r,n){"object"==Ix(r)&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new fV(e,16));for(var i=this.n.byteLength(),a=t.getPrivate().toArray("be",i),o=e.toArray("be",i),s=new IL({hash:this.hash,entropy:a,nonce:o,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new fV(1)),c=0;;c++){var l=n.k?n.k(c):new fV(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var d=this.g.mul(l);if(!d.isInfinity()){var p=d.getX(),f=p.umod(this.n);if(0!==f.cmpn(0)){var m=l.invm(this.n).mul(f.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var h=(d.getY().isOdd()?1:0)|(0!==p.cmp(f)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),h^=1),new ZL({r:f,s:m,recoveryParam:h})}}}}}},WL.prototype.verify=function(e,t,r,n){e=this._truncateToN(new fV(e,16)),r=this.keyFromPublic(r,n);var i=(t=new ZL(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var o,s=a.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(u,r.getPublic(),c)).isInfinity()&&o.eqXToP(i):!(o=this.g.mulAdd(u,r.getPublic(),c)).isInfinity()&&0===o.getX().umod(this.n).cmp(i)},WL.prototype.recoverPubKey=function(e,t,r,n){KL((3&r)===r,"The recovery param is more than two bits"),t=new ZL(t,n);var i=this.n,a=new fV(e),o=t.r,s=t.s,u=1&r,c=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");o=c?this.curve.pointFromX(o.add(this.curve.n),u):this.curve.pointFromX(o,u);var l=t.r.invm(i),d=i.sub(a).mul(l).umod(i),p=s.mul(l).umod(i);return this.g.mulAdd(d,o,p)},WL.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new ZL(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var TL=yV.assert,LL=yV.parseBytes,NL=yV.cachedProperty;function PL(e,t){this.eddsa=e,this._secret=LL(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=LL(t.pub)}PL.fromPublic=function(e,t){return t instanceof PL?t:new PL(e,{pub:t})},PL.fromSecret=function(e,t){return t instanceof PL?t:new PL(e,{secret:t})},PL.prototype.secret=function(){return this._secret},NL(PL,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),NL(PL,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),NL(PL,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),NL(PL,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),NL(PL,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),NL(PL,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),PL.prototype.sign=function(e){return TL(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},PL.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},PL.prototype.getSecret=function(e){return TL(this._secret,"KeyPair is public only"),yV.encode(this.secret(),e)},PL.prototype.getPublic=function(e){return yV.encode(this.pubBytes(),e)};var jL=PL,RL=yV.assert,XL=yV.cachedProperty,BL=yV.parseBytes;function GL(e,t){this.eddsa=e,"object"!=Ix(t)&&(t=BL(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),RL(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof fV&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}XL(GL,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),XL(GL,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),XL(GL,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),XL(GL,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),GL.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},GL.prototype.toHex=function(){return yV.encode(this.toBytes(),"hex").toUpperCase()};var YL=GL,HL=yV.assert,FL=yV.parseBytes;function UL(e){if(HL("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof UL))return new UL(e);e=qL[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=yL.sha512}var DL=UL;UL.prototype.sign=function(e,t){e=FL(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),a=this.encodePoint(i),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),s=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:a})},UL.prototype.verify=function(e,t,r){e=FL(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(a)},UL.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return yV.intFromLE(e.digest()).umod(this.curve.n)},UL.prototype.keyFromPublic=function(e){return jL.fromPublic(this,e)},UL.prototype.keyFromSecret=function(e){return jL.fromSecret(this,e)},UL.prototype.makeSignature=function(e){return e instanceof YL?e:new YL(this,e)},UL.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},UL.prototype.decodePoint=function(e){var t=(e=yV.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=yV.intFromLE(r);return this.curve.pointFromY(i,n)},UL.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},UL.prototype.decodeInt=function(e){return yV.intFromLE(e)},UL.prototype.isPoint=function(e){return e instanceof this.pointClass};var JL=dV((function(e,t){var r=t;r.version="6.5.4",r.utils=yV,r.rand=gV,r.curve=XV,r.curves=qL,r.ec=VL,r.eddsa=DL}));function QL(e,t){var r=$L();return(QL=function(e,t){return r[e-=312]})(e,t)}var _L=QL;function $L(){var e=["92mZhTFU","3d02010608","ssRdXLZEX8","6887UKyrmr","7433076mDDyYZ","000","KoZIzj0DAQ","0301070342","Mjci1ul8mm","072a8648ce","ZIzj0CAQYI","3059301306","4215408xtrKqx","14522016QCDTgd","+faHkP3QC3","2a8648ce3d","DepBO8t60S","MfPrcYTM70","3173228IhaAyQ","1010664CbFTIv","44P0rKKsZK","879130oVflWy","KA=="];return($L=function(){return e})()}!function(e,t){for(var r=QL,n=$L();;)try{if(586751==parseInt(r(319))/1*(-parseInt(r(316))/2)+parseInt(r(312))/3+parseInt(r(334))/4+-parseInt(r(314))/5+parseInt(r(328))/6+parseInt(r(320))/7+-parseInt(r(329))/8)break;n.push(n.shift())}catch(e){n.push(n.shift())}}();var eN,tN=(eN=_L(327)+_L(325)+_L(317)+_L(331)+_L(323)+_L(321),sV("MFkwEwYHKo"+_L(326)+_L(322)+"cDQgAE9h6Z"+_L(332)+"ytJdcsPxrD"+_L(330)+_L(313)+_L(324)+"D9EKOWS+U4"+_L(333)+_L(318)+_L(315)).replace(eN,"")),rN=new JL.ec("p256").keyFromPublic(tN,"hex");function nN(e,t){return iV(this,void 0,void 0,qx().mark((function r(){var n,i;return qx().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,function(e){return iV(this,void 0,void 0,qx().mark((function t(){var r,n;return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(new TextEncoder).encode(e),t.next=3,crypto.subtle.digest("SHA-256",r);case 3:return n=t.sent,t.abrupt("return",Array.from(new Uint8Array(n)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""));case 5:case"end":return t.stop()}}),t)})))}(e);case 3:return n=r.sent,i=sV(t),r.abrupt("return",rN.verify(n,i));case 8:return r.prev=8,r.t0=r.catch(0),r.abrupt("return",(console.error(r.t0),!1));case 11:case"end":return r.stop()}}),r,null,[[0,8]])})))}function iN(e,t){return iV(this,void 0,void 0,qx().mark((function r(){var n,i,a,o;return qx().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,nN(e,t);case 2:if(r.sent){r.next=4;break}return r.abrupt("return",{isValid:!1,error:aV.invalid_signature});case 4:if("string"==typeof(n=JSON.parse(e)).app_id&&n.app_id===window.location.hostname){r.next=7;break}return r.abrupt("return",{isValid:!1,error:aV.invalid_app_id});case 7:return i=new Date,a=new Date(n.expired_at),o=new Date(n.created_at),r.abrupt("return","Invalid Date"===a.toString()||"Invalid Date"===o.toString()?{isValid:!1,error:aV.invalid_date}:i<=o||i>=a?{isValid:!1,error:aV.license_expired}:{isValid:!0,error:null});case 9:case"end":return r.stop()}}),r)})))}function aN(e,t){return iV(this,void 0,void 0,qx().mark((function r(){var n,i,a,o,s,u,c,l,d;return qx().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,nN(e,t);case 2:if(r.sent){r.next=4;break}return r.abrupt("return",{isValid:!1,error:aV.invalid_signature});case 4:if((n=JSON.parse(e)).url){r.next=7;break}return r.abrupt("return",{isValid:!1,error:aV.missing_url});case 7:return i=null,r.prev=8,r.next=11,fetch("".concat(n.url,"/v1/verify_license"),{method:"POST",body:JSON.stringify({license_id:n.id,app_id:window.location.hostname}),headers:{"Content-Type":"application/json"}});case 11:i=r.sent,r.next=17;break;case 14:r.prev=14,r.t0=r.catch(8),console.error(r.t0);case 17:if(null!==i){r.next=19;break}return r.abrupt("return",function(){return iV(this,void 0,void 0,qx().mark((function e(){var t,r,n,i;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(t=localStorage.getItem("tv:sdk-license"))){e.next=3;break}return e.abrupt("return",{isValid:!1,error:aV.invalid_license});case 3:return r=cV(t),n=r.license,i=r.signature,e.abrupt("return",iN(uV(sV(n)),i));case 5:case"end":return e.stop()}}),e)})))}());case 19:if(200===(a=i.status)){r.next=23;break}return o=a.toString(),r.abrupt("return",{isValid:!1,error:o in aV?aV[o]:aV.unknown});case 23:return r.next=25,i.json();case 25:if(s=r.sent,!(Array.isArray(s.errors)&&s.errors.length>0)){r.next=28;break}return r.abrupt("return",(console.error(s.errors[0]),{isValid:!1,error:aV.invalid_license}));case 28:return u=cV(s.data.license_key),c=u.license,l=u.signature,d=uV(sV(c)),r.next=31,nN(d,l);case 31:if(!r.sent){r.next=35;break}r.t1=(localStorage.setItem("tv:sdk-license",s.data.license_key),{isValid:!0,error:null}),r.next=36;break;case 35:r.t1={isValid:!1,error:aV.invalid_signature};case 36:return r.abrupt("return",r.t1);case 37:case"end":return r.stop()}}),r,null,[[8,14]])})))}function oN(e){return iV(this,void 0,void 0,qx().mark((function t(){var r,n,i,a,o;return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e){t.next=3;break}return t.abrupt("return",{isValid:!1,error:aV.invalid_license});case 3:if(r=cV(e),n=r.mode,i=r.license,a=r.signature,o=uV(sV(i)),"offline"!==n){t.next=10;break}return t.next=7,iN(o,a);case 7:t.t0=t.sent,t.next=18;break;case 10:if("online"!==n){t.next=16;break}return t.next=13,aN(o,a);case 13:t.t1=t.sent,t.next=17;break;case 16:t.t1={isValid:!1,error:aV.invalid_license};case 17:t.t0=t.t1;case 18:return t.abrupt("return",t.t0);case 21:return t.prev=21,t.t2=t.catch(0),t.abrupt("return",(console.error(t.t2),{isValid:!1,error:aV.unknown}));case 24:case"end":return t.stop()}}),t,null,[[0,21]])})))}var sN=function(e,t,r){var n=null==e?void 0:oK(e,t);return void 0===n?r:n},uN=function(e,t){var r=sN(e,t),n=sN(e,t+"_web");return null!=n?n:r},cN=Object.freeze({__proto__:null,getWebSetting:uN}),lN=db.createContext(!1),dN={invalid_license:"license_invalid",invalid_license_exception:"license_invalid",invalid_parameter_exception:"license_invalid",rate_limit_exception:"license_rate_limit_exceeded",internal_server_error:"license_internal_server_error",unknown_license_error:"license_unknown_error",invalid_app_id:"license_invalid",invalid_date:"license_invalid",license_expired:"license_invalid",invalid_signature:"license_invalid",missing_url:"license_invalid"},pN=function(e){var t=e.children,r=e.clientSettings,n=e.onError,i=xx(db.useState(!1),2),a=i[0],o=i[1],s=!!r,u=s?uN(r,"data.settings.sdk_settings.license_settings.license_key"):null;return db.useEffect((function(){s&&FW(void 0,void 0,void 0,qx().mark((function e(){var t;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,oN(u);case 2:t=e.sent,o(t.isValid),t.isValid||n(fx[dN[t.error]]);case 5:case"end":return e.stop()}}),e)})))}),[s,u,n]),a?db.createElement(lN.Provider,{value:a},t):null},fN=Object.freeze({__proto__:null,LicenseProvider:pN,useLicenseVerifier:function(){return db.useContext(lN)}});function mN(e){return new Promise((function(t){return setTimeout(t,e)}))}var hN=Object.freeze({__proto__:null,sleep:mN}),vN=Symbol("Comlink.proxy"),bN=Symbol("Comlink.endpoint"),yN=Symbol("Comlink.releaseProxy"),gN=Symbol("Comlink.thrown"),qN=function(e){return"object"==rv(e)&&null!==e||"function"==typeof e},AN=new Map([["proxy",{canHandle:function(e){return qN(e)&&e[vN]},serialize:function(e){var t=new MessageChannel,r=t.port1,n=t.port2;return IN(e,r),[n,[n]]},deserialize:function(e){return e.start(),MN(e)}}],["throw",{canHandle:function(e){return qN(e)&&gN in e},serialize:function(e){var t=e.value;return[t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[]]},deserialize:function(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function IN(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:self;t.addEventListener("message",(function r(n){if(n&&n.data){var i,a=Object.assign({path:[]},n.data),o=a.id,s=a.type,u=a.path,c=(n.data.argumentList||[]).map(xN);try{var l=u.slice(0,-1).reduce((function(e,t){return e[t]}),e),d=u.reduce((function(e,t){return e[t]}),e);switch(s){case"GET":i=d;break;case"SET":l[u.slice(-1)[0]]=xN(n.data.value),i=!0;break;case"APPLY":i=d.apply(l,c);break;case"CONSTRUCT":i=function(e){return Object.assign(e,uv({},vN,!0))}(Jh(d,hv(c)));break;case"ENDPOINT":var p=new MessageChannel,f=p.port1,m=p.port2;IN(e,m),i=function(e,t){return ZN.set(e,t),e}(f,[f]);break;case"RELEASE":i=void 0;break;default:return}}catch(e){i=uv({value:e},gN,0)}Promise.resolve(i).catch((function(e){return uv({value:e},gN,0)})).then((function(e){var n=mv(wN(e),2),i=n[0],a=n[1];t.postMessage(Object.assign(Object.assign({},i),{id:o}),a),"RELEASE"===s&&(t.removeEventListener("message",r),SN(t))}))}})),t.start&&t.start()}function SN(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function MN(e,t){return CN(e,[],t)}function kN(e){if(e)throw new Error("Proxy has been released and is not useable")}function CN(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},n=!1,i=new Proxy(r,{get:function(r,a){if(kN(n),a===yN)return function(){return EN(e,{type:"RELEASE",path:t.map((function(e){return e.toString()}))}).then((function(){SN(e),n=!0}))};if("then"===a){if(0===t.length)return{then:function(){return i}};var o=EN(e,{type:"GET",path:t.map((function(e){return e.toString()}))}).then(xN);return o.then.bind(o)}return CN(e,[].concat(hv(t),[a]))},set:function(r,i,a){kN(n);var o=mv(wN(a),2),s=o[0],u=o[1];return EN(e,{type:"SET",path:[].concat(hv(t),[i]).map((function(e){return e.toString()})),value:s},u).then(xN)},apply:function(r,i,a){kN(n);var o=t[t.length-1];if(o===bN)return EN(e,{type:"ENDPOINT"}).then(xN);if("bind"===o)return CN(e,t.slice(0,-1));var s=mv(zN(a),2),u=s[0],c=s[1];return EN(e,{type:"APPLY",path:t.map((function(e){return e.toString()})),argumentList:u},c).then(xN)},construct:function(r,i){kN(n);var a=mv(zN(i),2),o=a[0],s=a[1];return EN(e,{type:"CONSTRUCT",path:t.map((function(e){return e.toString()})),argumentList:o},s).then(xN)}});return i}function zN(e){var t,r=e.map(wN);return[r.map((function(e){return e[0]})),(t=r.map((function(e){return e[1]})),Array.prototype.concat.apply([],t))]}var ZN=new WeakMap;function wN(e){var t,r=Av(AN);try{for(r.s();!(t=r.n()).done;){var n=mv(t.value,2),i=n[0],a=n[1];if(a.canHandle(e)){var o=mv(a.serialize(e),2);return[{type:"HANDLER",name:i,value:o[0]},o[1]]}}}catch(e){r.e(e)}finally{r.f()}return[{type:"RAW",value:e},ZN.get(e)||[]]}function xN(e){switch(e.type){case"HANDLER":return AN.get(e.name).deserialize(e.value);case"RAW":return e.value}}function EN(e,t,r){return new Promise((function(n){var i=new Array(4).fill(0).map((function(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)})).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===i&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:i},t),r)}))}var ON=function(){if(!window.Worker)return null;var e=new Blob(['const e=Symbol("Comlink.proxy"),t=Symbol("Comlink.endpoint"),r=Symbol("Comlink.releaseProxy"),n=Symbol("Comlink.thrown"),a=e=>"object"==typeof e&&null!==e||"function"==typeof e,o=new Map([["proxy",{canHandle:t=>a(t)&&t[e],serialize(e){const{port1:t,port2:r}=new MessageChannel;return i(e,t),[r,[r]]},deserialize(e){return e.start(),l(e,[],t);var t}}],["throw",{canHandle:e=>a(e)&&n in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function i(t,r=self){r.addEventListener("message",(function a(o){if(!o||!o.data)return;const{id:s,type:l,path:d}=Object.assign({path:[]},o.data),h=(o.data.argumentList||[]).map(g);let m;try{const r=d.slice(0,-1).reduce(((e,t)=>e[t]),t),n=d.reduce(((e,t)=>e[t]),t);switch(l){case"GET":m=n;break;case"SET":r[d.slice(-1)[0]]=g(o.data.value),m=!0;break;case"APPLY":m=n.apply(r,h);break;case"CONSTRUCT":m=function(t){return Object.assign(t,{[e]:!0})}(new n(...h));break;case"ENDPOINT":{const{port1:e,port2:r}=new MessageChannel;i(t,r),m=function(e,t){return u.set(e,t),e}(e,[e])}break;case"RELEASE":m=void 0;break;default:return}}catch(e){m={value:e,[n]:0}}Promise.resolve(m).catch((e=>({value:e,[n]:0}))).then((e=>{const[t,n]=_(e);r.postMessage(Object.assign(Object.assign({},t),{id:s}),n),"RELEASE"===l&&(r.removeEventListener("message",a),c(r))}))})),r.start&&r.start()}function c(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function s(e){if(e)throw new Error("Proxy has been released and is not useable")}function l(e,n=[],a=function(){}){let o=!1;const i=new Proxy(a,{get(t,a){if(s(o),a===r)return()=>h(e,{type:"RELEASE",path:n.map((e=>e.toString()))}).then((()=>{c(e),o=!0}));if("then"===a){if(0===n.length)return{then:()=>i};const t=h(e,{type:"GET",path:n.map((e=>e.toString()))}).then(g);return t.then.bind(t)}return l(e,[...n,a])},set(t,r,a){s(o);const[i,c]=_(a);return h(e,{type:"SET",path:[...n,r].map((e=>e.toString())),value:i},c).then(g)},apply(r,a,i){s(o);const c=n[n.length-1];if(c===t)return h(e,{type:"ENDPOINT"}).then(g);if("bind"===c)return l(e,n.slice(0,-1));const[u,_]=d(i);return h(e,{type:"APPLY",path:n.map((e=>e.toString())),argumentList:u},_).then(g)},construct(t,r){s(o);const[a,i]=d(r);return h(e,{type:"CONSTRUCT",path:n.map((e=>e.toString())),argumentList:a},i).then(g)}});return i}function d(e){const t=e.map(_);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const u=new WeakMap;function _(e){for(const[t,r]of o)if(r.canHandle(e)){const[n,a]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},a]}return[{type:"RAW",value:e},u.get(e)||[]]}function g(e){switch(e.type){case"HANDLER":return o.get(e.name).deserialize(e.value);case"RAW":return e.value}}function h(e,t,r){return new Promise((n=>{const a=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===a&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),r)}))}var m=[[0,1,0],[1,-4,1],[0,1,0]];function f(e,t,r,n){return e[4*(r*t+n)]}function p(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function v(e,t,r){return(t=p(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,i,c=[],s=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){l=!0,a=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const k="frontal",w="left",P="right",S="up",E="down";var L=0,M=1,C=2,A=0,R=1,O=2,V=function(e,t){var r=y(e,2),n=r[0],a=r[1],o=y(t,2),i=o[0],c=o[1];return n>c||i>a?A:n<=i&&c<=a?O:R};function j(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=y(e,2),a=n[0],o=n[1],i=y(t,2),c=i[0],s=i[1],l=[a[0],o[0]],d=[a[1],o[1]],u=[c[0],s[0]],_=[c[1],s[1]],g=[l[0]+r,l[1]-r],h=[d[0]+r,d[1]-.8*r];return V(g,u)===O&&V(h,_)===O?C:V(l,u)===A||V(d,_)===A?L:M}const x=Object.assign(Object.assign({not_supported:{code:"not_supported",msg:{en:"Camera is not well-supported on this device/browser. Please try another one.",vi:"Camera không được hỗ trợ. Vui lòng thử trình duyệt hoặc thiết bị khác."}},camera_timeout:{code:"camera_timeout",msg:{en:"Can\'t access camera. Please check camera permission, try again or try another browser/device",vi:"Không thể truy cập camera. Vui lòng kiểm tra quyền truy cập camera, đóng các tab/app khác đang sử dụng camera hoặc thử lại trên trình duyệt/thiết bị khác."}},unable_to_load_model:{code:"unable_to_load_model",msg:{en:"Unable to load model on this device/browser. Please try another one.",vi:"Không thể load model. Vui lòng thử trình duyệt hoặc thiết bị khác."}},no_permission:{code:"no_permission",msg:{en:"Please grant the permission to access the camera.",vi:"Vui lòng cấp quyền để truy cập camera."}},api_call_error:{code:"api_call_error",msg:{en:"Api call error",vi:"Lỗi call api"}},upload_error:{code:"upload_error",msg:{en:"Upload error",vi:"Lỗi upload"}},sanity_check_error:{code:"sanity_check_error",msg:{en:"Sanity check error",vi:"Lỗi check sanity"}},read_id_card_error:{code:"read_id_card_error",msg:{en:"Read id card error",vi:"Lỗi read id card"}},detect_id_tampering_error:{code:"detect_id_tampering_error",msg:{en:"Detect id tampering error",vi:"Lỗi detect id tampering"}},detect_id_card_error:{code:"detect_id_card_error",msg:{en:"Can\'t detect id card type",vi:"Không thể detect id card type"}},missing_front_id_card:{code:"missing_front_id_card",msg:{en:"Missing front id",vi:"Không tìm thấy front id"}},server_error:{code:"server_error",msg:"Server error"},not_readable:{code:"CameraInUseError",msg:{vi:"Camera đang được sử dụng bởi ứng dụng/tab khác.",en:"Camera already in use by another app/tab."}}},{wrong_orientation:{code:"wrong_orientation",msg:{en:"You are using landscape mode. Please rotate screen to portrait mode and retry.",vi:"Bạn đang sử dụng chế độ màn hình xoay ngang. Vui lòng quay màn hình theo chiều dọc và thực hiện lại."}},no_face:{code:"no_face",msg:{en:"Face not found",vi:"Không tìm thấy khuôn mặt"}},partial_face:{code:"partial_face",msg:{en:"Face out of the box",vi:"Không tìm thấy toàn bộ khuôn mặt"}},multiple_faces:{code:"multiple_faces",msg:{en:"Too many faces",vi:"Quá nhiều khuôn mặt"}},face_too_small:{code:"face_too_small",msg:{en:"Face too small",vi:"Khuôn mặt quá nhỏ"}},face_too_large:{code:"face_too_large",msg:{en:"Face too large",vi:"Khuôn mặt quá to"}},face_out_of_box:{code:"face_out_of_box",msg:{en:"Face is out of box",vi:"Khuôn mặt không nằm trọn vẹn trong khung ảnh"}},liveness_too_fast:{code:"liveness_too_fast",msg:{en:"Please turn your face SLOWLY",vi:"Vui lòng quay CHẬM lại"}},liveness_terminated:{code:"liveness_terminated",msg:{en:"Please try again.",vi:"Vui lòng thực hiện lại."}},liveness_terminated_face_tracking:{code:"liveness_terminated_face_tracking",msg:{en:"You need to turn your face SLOWLY. Please try again.",vi:"Bạn cần quay CHẬM lại. Vui lòng thực hiện lại."}},liveness_terminated_no_face:{code:"liveness_terminated_no_face",msg:{en:"Your face was missing for too long. Please try again.",vi:"Khuôn mặt không nằm trong khung hình. Xin vui lòng thử lại."}},liveness_terminated_time_out:{code:"liveness_terminated_time_out",msg:{en:"You need to complete gestures as instructed within <%= x %> seconds. Please try again.",vi:"Bạn cần hoàn thành động tác theo chỉ dẫn trong <%= x %> giây. Xin vui lòng thử lại."}},liveness_blurry:{code:"liveness_blurry",msg:{en:"Image is too blurry. Please ensure your face is in focus.",vi:"Hình ảnh bị mờ. Vui lòng đảm bảo khuôn mặt của bạn rõ nét."}},card_sanity_not_good:{code:"card_sanity_not_good",msg:{en:"Card sanity not good",vi:"Card sanity chưa đạt"}},id_detector_validate_angle_error:{code:"id_detector_validate_angle_error",msg:{en:"Please place ID card straight, not tilted",vi:"Vui lòng đặt giấy tờ thẳng, không bị nghiêng khi chụp"}},client_web_setting_not_found:{code:"client_web_setting_not_found",msg:"Client Web Setting Not Found"},id_detector_no_cards:{code:"id_detector_no_cards",msg:{en:"Please capture the <%= side %> side of ID card (occupy 50-95% of the frame)",vi:"Vui lòng chụp mặt <%= side %> của giấy tờ (chiếm 50-95% khung hình)"}},id_detector_card_too_small:{code:"id_detector_card_too_small",msg:{en:"Please move ID card CLOSER (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ lại GẦN hơn (chiếm 50-95% khung hình)"}},id_detector_error_incomplete:{code:"id_detector_error_incomplete",msg:{en:"Please move ID card FARTHER (occupy 50-95% of the frame)",vi:"Vui lòng đưa giấy tờ ra XA hơn (chiếm 50-95% khung hình)"}},glare_detected:{code:"glare_detected",msg:{en:"Glare is detected. Please adjust the shooting angle",vi:"Ảnh bị chói / lóa. Vui lòng điều chỉnh góc chụp."}},id_detector_error_front_side_no_faces:{code:"id_detector_error_front_side_no_faces",msg:{en:"Please capture the front side of ID card",vi:"Vui lòng chụp mặt trước của giấy tờ"}},id_detector_error_front_side_multiple_faces:{code:"id_detector_error_front_side_multiple_faces",msg:{en:"Please capture the front side of one ID card only (remove other items out of the frame)",vi:"Vui lòng chụp mặt trước 1 giấy tờ duy nhất"}},id_detector_error_back_side_has_faces:{code:"id_detector_error_back_side_has_faces",msg:{en:"Please capture the back side of ID card",vi:"Vui lòng chụp mặt sau của giấy tờ"}},id_detector_error_blur:{code:"id_detector_error_blur",msg:{en:"Blurry photo detected. Please capture again for a clearer image",vi:"Ảnh bị mờ. Vui lòng chụp lại để có ảnh rõ nét hơn"}},not_allowed_card_types:{code:"not_allowed_card_types",msg:{en:"Please use the required ID cards",vi:"Vui lòng sử dụng GTTT được yêu cầu"}},not_frontal_face:{code:"not_frontal_face",msg:{en:"Please look straight to camera.",vi:"Vui lòng nhìn thẳng vào camera."}},close_eye:{code:"close_eye",msg:{vi:"Vui lòng mở to mắt",en:"Open your eyes clearly"}}}),{license_invalid:{code:"license_invalid",msg:{en:"Invalid license",vi:"License không hợp lệ"}},license_rate_limit_exceeded:{code:"license_rate_limit_exceeded",msg:{en:"Invalid license",vi:"Quá số lần thử"}},license_internal_server_error:{code:"license_internal_server_error",msg:{en:"Internal server error",vi:"Lỗi server"}},license_unknown_error:{code:"license_unknown_error",msg:{en:"Unknown error",vi:"Lỗi không xác định"}}});function I(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function T(e,t){return[e[0]-t[0],e[1]-t[1]]}function D(e,t,r,n){var a=r*(4*t)+4*n;return{r:e[a],g:e[a+1],b:e[a+2]}}i({calculateBlurScoreFunc:function(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,a=0;a<t.length;a+=4){var o=(t[a]+t[a+1]+t[a+2])/3;t[a]=o}for(var i=0,c=0,s=n-1,l=r-1,d=1;d<s;d++)for(var u=1;u<l;u++){var _=m[0][0]*f(t,r,u-1,d-1)+m[0][1]*f(t,r,u,d-1)+m[0][2]*f(t,r,u+1,d-1)+m[1][0]*f(t,r,u-1,d)+m[1][1]*f(t,r,u,d)+m[1][2]*f(t,r,u+1,d)+m[2][0]*f(t,r,u-1,d+1)+m[2][1]*f(t,r,u,d+1)+m[2][2]*f(t,r,u+1,d+1);(_=Math.abs(_))>25&&i++,_>15&&_<25&&c++}var g=0;return i+c!==0&&(g=i/(i+c)),g},calculateFaceDirectionFunc:function(e){var t=e.landmarks,r=e.getPerfectFrontal,n=e.upDownBound,a=void 0===n?{lower:.42,upper:.7}:n,o=function(e){var t,r,n,a,o,i,c,s=y(e,4),l=s[0],d=s[1],u=s[2],_=s[3],g=T(d,l),h=I(g),m=(a=d,t=[(n=l)[0]+a[0],n[1]+a[1]],r=2,[t[0]/r,t[1]/r]),f=T(u,m),p=I(T(_,u)),v=T(_,m),b=I(v),k=(f[0]*v[0]+f[1]*v[1])/b,w=p/b;if(h>.5*b)o=(f[0]*g[0]+f[1]*g[1])/h/h;else{var P=I(T(f,function(e,t){return[e[0]*t,e[1]*t]}(v,k/b)));c=v,o=((i=f)[0]*c[1]-c[0]*i[1]>=0?1:-1)*P/h}return{left_right_score:o,up_down_score:w}}(t),i=o.left_right_score,c=o.up_down_score,s=y(t,3),l=s[0],d=s[1],u=s[2],_=d[0]-u[0],g=l[0]-u[0],h=r?.1:.3,m=c>a.upper,f=c<a.lower,p=i>=.35&&i<=.6,v=i<=-.35&&i>=-.6,b=m&&!v&&!p,L=f&&!v&&!p,M=v&&!m&&!f,C=p&&!m&&!f;return c>=a.lower&&c<=a.upper&&i>-h&&i<h&&_*g<0?{gesture:k,leftRightScore:i}:b?{gesture:S,leftRightScore:i}:L?{gesture:E,leftRightScore:i}:C?{gesture:P,leftRightScore:i}:M?{gesture:w,leftRightScore:i}:null},validatePredictionsFunc:function(e){var t,r,n,a,o,i,c,s,l,d,u,_,g,h,m,f,p,b,k,w,P,S,E,A,R,O,V,I,T,D,F,N,H=e.predictions,K=e.width,q=e.height,Y=e.cropAreaCoordinates,G=null!=Y?Y:[[0,0],[K,q]],U=H.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,a=t.probability,o=t.landmarks;a<.9||o.length<6||function(e){var t=e.small,r=t.coords,n=t.area,a=e.big,o=a.coords,i=a.area,c=n;if(!c){var s=y(r,2),l=s[0],d=s[1];c=(d[0]-l[0])*(d[1]-l[1])}var u=i;if(!u){var _=y(o,2),g=_[0],h=_[1];u=(h[0]-g[0])*(h[1]-g[1])}return c/u}({small:{coords:[r,n]},big:{coords:G}})<=.025?e[L].push(t):e[j(G,[r,n])].push(t);return e}),v(v(v({},M,[]),C,[]),L,[])),W=U[C].length,z=U[M].length;if(0===W)t=z>0?x.partial_face:x.no_face;else if(W+z>1)t=x.multiple_faces;else{var B=r=U[C][0],X=B.topLeft,Q=B.bottomRight;E=G,A=y([X,Q],2),R=A[0],O=A[1],V=y(E,2),I=V[0],T=V[1],D=O[0]-R[0],F=O[1]-R[1],N=T[0]-I[0],(n=D/N<F/N?D/N:F/N)<.4&&(t=x.face_too_small),n>.61&&(t=x.face_too_large),j(G,(a=r.landmarks,c=a[0],s=a[1],l=a[2],d=a[3],u=a[4],_=a[5],g=.5*(c[1]+s[1]),h=g+1.5*(g-d[1]),m=d[1]-1.2*(l[1]-d[1]),f=[c[0],s[0],l[0],d[0],u[0],_[0]],p=Math.min.apply(Math,f),b=Math.min(h,m),k=Math.max.apply(Math,f),w=Math.max(h,m),P=Math.abs(d[0]-u[0])/Math.abs(d[0]-_[0]),S=d[0]-u[0]<0&&_[0]-d[0]>.05*(k-p),d[0]-u[0]>0&&_[0]-d[0]<-.05*(k-p)?(o=.2,i=.1):S?(o=.1,i=.2):P>2||P<.5?(o=.15,i=.15):(o=.05,i=.05),[[p-o*(k-p),b],[k+i*(k-p),w]]),.05*K)!==C&&(t=x.face_out_of_box)}return{ratio:n,error:t,fullFace:r,faceRatio:n,faceNotFrontalMinThreshold:.38}},detectGlare:function(e,t,r){return function(e,t,r){for(var n=0,a=r[1],o=r[3],i=r[0],c=r[2],s=a;s<o;s++)for(var l=i;l<c;l++){var d=D(e,t,s,l),u=d.r,_=d.g,g=d.b;u>=245&&g>=245&&_>245&&(n+=1)}return n}(e,t,function(e,t){var r=Math.floor(.025*e),n=e-r,a=Math.floor(.025*t);return[r,a,n,t-a]}(t,r))/(t*r)>=.001}});']),t=URL.createObjectURL(e);return MN(new Worker(t))}(),KN=[[0,1,0],[1,-4,1],[0,1,0]];function WN(e,t,r,n){return e[4*(r*t+n)]}function VN(e){for(var t=e.data,r=e.reducedWidth,n=e.reducedHeight,i=0;i<t.length;i+=4){var a=(t[i]+t[i+1]+t[i+2])/3;t[i]=a}for(var o=0,s=0,u=n-1,c=r-1,l=1;l<u;l++)for(var d=1;d<c;d++){var p=KN[0][0]*WN(t,r,d-1,l-1)+KN[0][1]*WN(t,r,d,l-1)+KN[0][2]*WN(t,r,d+1,l-1)+KN[1][0]*WN(t,r,d-1,l)+KN[1][1]*WN(t,r,d,l)+KN[1][2]*WN(t,r,d+1,l)+KN[2][0]*WN(t,r,d-1,l+1)+KN[2][1]*WN(t,r,d,l+1)+KN[2][2]*WN(t,r,d+1,l+1);(p=Math.abs(p))>25&&o++,p>15&&p<25&&s++}var f=0;return o+s!==0&&(f=o/(o+s)),f}function TN(e){var t=e.width,r=e.height,n=e.getContext("2d"),i=Math.floor(t/2.8),a=Math.floor(r/2.8),o=t-i,s=r-a;return{data:n.getImageData(Math.floor(i/2),Math.floor(a/2),o,s).data,reducedWidth:o,reducedHeight:s}}function LN(){return(LN=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=TN(t),ON){e.next=3;break}return e.abrupt("return",VN(r));case 3:return e.abrupt("return",ON.calculateBlurScoreFunc(r));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NN(e,t,r,n){return e[4*(n*t+r)]}var PN=Object.freeze({__proto__:null,calculateBlurScore:function(e){return LN.apply(this,arguments)},hasBetterBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||e-t>r},hasSameBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null!==t&&Math.abs(e-t)<r},hasBetterCardBlurScore:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||t-e>r},calculateIdCardBlurScore:function(e){var t=e.canvas,r=document.createElement("canvas"),n=r.getContext("2d");r.width=430,r.height=270,n.drawImage(t,0,0,r.width,r.height);var i=Math.floor(129),a=Math.floor(13.5),o=Math.floor(408.5),s=Math.floor(256.5),u=document.createElement("canvas"),c=u.getContext("2d"),l=o-i,d=s-a;u.width=l,u.height=d,c.drawImage(r,i,a,l,d,0,0,l,d);for(var p=c.getImageData(0,0,l,d).data,f=0;f<p.length;f+=4){var m=Math.round(.299*p[f]+.587*p[f+1]+.114*p[f+2]);p[f]=m}for(var h=d-1,v=l-1,b=0,y=[],g=1;g<h;g++)for(var q=1;q<v;q++){var A=4*-NN(p,l,q,g)+NN(p,l,q,g-1)+NN(p,l,q,g+1)+NN(p,l,q-1,g)+NN(p,l,q+1,g);b+=A,y.push(A)}b/=(l-2)*(d-2);for(var I=0,S=0;S<y.length;S++){var M=y[S]-b;I+=Math.pow(M,2)}var k=Math.sqrt(I/y.length);return 1/(1+Math.pow(2,k/2-10))}});function jN(e){var t,r,n,i,a,o,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,c=s.x,l=s.y,d=s.width,p=s.height,f=e.videoWidth,m=e.videoHeight,h=window.innerWidth,v=window.innerHeight,b=h/v,y=f/m;b<y?(a=c*(n=f/h),o=(l-(t=(v-h/y)/2))*(i=m/(v-2*t))):(a=(c-(r=(h-v*y)/2))*(n=f/(h-2*r)),o=l*(i=m/v));var g=d*n,q=p*i,A=g,I=q,S=Math.max(g,q)*u;return{lostX:r,lostY:t,cropWidth:g=Math.floor(Math.min(f,g+2*S)),cropHeight:q=Math.floor(Math.min(m,q+2*S)),cropX:a=Math.floor(Math.max(0,a-S)),cropY:o=Math.floor(Math.max(0,o-S)),cropWidthWithoutPadding:A,cropHeightWithoutPadding:I}}var RN=Object.freeze({__proto__:null,analyzeVideoAndWindowSizes:jN,takePicture:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.canvas,n=t.video,i=t.cropArea,a=t.quality,o=void 0===a?1:a;if(r)e=r;else{var s=jN(n,i),u=s.cropWidth,c=s.cropHeight,l=s.cropX,d=s.cropY,p=(e=document.createElement("canvas")).getContext("2d");e.width=u,e.height=c,p.drawImage(n,l,d,u,c,0,0,u,c)}return new Promise((function(t){e.toBlob(t,"image/jpeg",o)}))}}),XN=function(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=[e[r],e[t]];e[t]=n[0],e[r]=n[1]}return e},BN=Object.freeze({__proto__:null,shuffleArray:XN}),GN={NONE:0,PARTIAL:1,FULL:2},YN=function(e,t){var r=xx(e,2),n=r[0],i=r[1],a=xx(t,2),o=a[0],s=a[1];return n>s||o>i?0:n<=o&&s<=i?2:1};function HN(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=xx(e,2),i=n[0],a=n[1],o=xx(t,2),s=o[0],u=o[1],c=[i[0],a[0]],l=[i[1],a[1]],d=[s[0],u[0]],p=[s[1],u[1]],f=[c[0]+r,c[1]-r],m=[l[0]+r,l[1]-.8*r];return 2===YN(f,d)&&2===YN(m,p)?GN.FULL:0===YN(c,d)||0===YN(l,p)?GN.NONE:GN.PARTIAL}function FN(e){var t=e.small,r=t.coords,n=t.area,i=e.big,a=i.coords,o=i.area,s=n;if(!s){var u=xx(r,2),c=u[0],l=u[1];s=(l[0]-c[0])*(l[1]-c[1])}var d=o;if(!d){var p=xx(a,2),f=p[0],m=p[1];d=(m[0]-f[0])*(m[1]-f[1])}return s/d}function UN(e,t){var r=xx(e,2),n=r[0],i=r[1],a=xx(t,2),o=a[0],s=a[1],u=i[0]-n[0],c=i[1]-n[1],l=s[0]-o[0];return u/l<c/l?u/l:c/l}var DN=Object.freeze({__proto__:null,ContainMode:GN,rectContains:HN,rectAreaRatio:FN,rectEdgeRatio:UN,isFaceCenter:function(e,t){var r=xx(e,2),n=r[0],i=r[1],a=xx(t,2),o=a[0],s=a[1],u=i[0]-n[0],c=i[1]-n[1],l=s[0]-o[0],d=Math.abs(n[0]-(l-u)/2)/l<.2,p=Math.abs(n[1]-(l-c)/2)/l<.2;return!(!d||!p)}});function JN(e){return Math.pow(Math.pow(e[0],2)+Math.pow(e[1],2),.5)}function QN(e,t){return[e[0]-t[0],e[1]-t[1]]}function _N(e){var t=e.landmarks,r=e.getPerfectFrontal,n=e.upDownBound,i=void 0===n?{lower:.42,upper:.7}:n,a=function(e){var t,r,n,i,a,o,s=xx(e,4),u=s[0],c=s[1],l=s[2],d=s[3],p=QN(c,u),f=JN(p),m=(n=c,2,[(t=[(r=u)[0]+n[0],r[1]+n[1]])[0]/2,t[1]/2]),h=QN(l,m),v=JN(QN(d,l)),b=QN(d,m),y=JN(b),g=(h[0]*b[0]+h[1]*b[1])/y,q=v/y;if(f>.5*y)i=(h[0]*p[0]+h[1]*p[1])/f/f;else{var A=JN(QN(h,function(e,t){return[e[0]*t,e[1]*t]}(b,g/y)));o=b,i=((a=h)[0]*o[1]-o[0]*a[1]>=0?1:-1)*A/f}return{left_right_score:i,up_down_score:q}}(t),o=a.left_right_score,s=a.up_down_score,u=xx(t,3),c=u[0],l=u[1],d=u[2],p=l[0]-d[0],f=c[0]-d[0],m=r?.1:.3,h=s>i.upper,v=s<i.lower,b=o>=.35&&o<=.6,y=o<=-.35&&o>=-.6,g=h&&!y&&!b,q=v&&!y&&!b,A=y&&!h&&!v,I=b&&!h&&!v;return s>=i.lower&&s<=i.upper&&o>-m&&o<m&&p*f<0?{gesture:hx.FRONTAL,leftRightScore:o}:g?{gesture:hx.UP,leftRightScore:o}:q?{gesture:hx.DOWN,leftRightScore:o}:I?{gesture:hx.RIGHT,leftRightScore:o}:A?{gesture:hx.LEFT,leftRightScore:o}:null}function $N(e){var t,r,n,i=e.predictions,a=e.width,o=e.height,s=e.cropAreaCoordinates,u=null!=s?s:[[0,0],[a,o]],c=i.reduce((function(e,t){var r=t.topLeft,n=t.bottomRight,i=t.probability,a=t.landmarks;return i<.9||a.length<6||FN({small:{coords:[r,n]},big:{coords:u}})<=.025?e[GN.NONE].push(t):e[HN(u,[r,n])].push(t),e}),Zx(Zx(Zx({},GN.PARTIAL,[]),GN.FULL,[]),GN.NONE,[])),l=c[GN.FULL].length,d=c[GN.PARTIAL].length;if(0===l)t=d>0?mx.partial_face:mx.no_face;else if(l+d>1)t=mx.multiple_faces;else{var p=r=c[GN.FULL][0];(n=UN([p.topLeft,p.bottomRight],u))<.4&&(t=mx.face_too_small),n>.61&&(t=mx.face_too_large),HN(u,function(e){var t,r,n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],c=.5*(n[1]+i[1]),l=c+1.5*(c-o[1]),d=o[1]-1.2*(a[1]-o[1]),p=[n[0],i[0],a[0],o[0],s[0],u[0]],f=Math.min.apply(Math,p),m=Math.min(l,d),h=Math.max.apply(Math,p),v=Math.max(l,d),b=Math.abs(o[0]-s[0])/Math.abs(o[0]-u[0]),y=o[0]-s[0]<0&&u[0]-o[0]>.05*(h-f);return o[0]-s[0]>0&&u[0]-o[0]<-.05*(h-f)?(t=.2,r=.1):y?(t=.1,r=.2):b>2||b<.5?(t=.15,r=.15):(t=.05,r=.05),[[f-t*(h-f),m],[h+r*(h-f),v]]}(r.landmarks),.05*a)!==GN.FULL&&(t=mx.face_out_of_box)}return{ratio:n,error:t,fullFace:r,faceRatio:n,faceNotFrontalMinThreshold:.38}}function eP(e,t){var r=t.customInstructions,n=t.customIcon,i=t.customDirectionIcon,a=t.customStepTimeConstraints,o={};return null!=r&&r[e]&&(o.instructions=r[e]),null!=n&&n[e]&&(o.icon=n[e]),null!=i&&i[e]&&(o.directionIcon=i[e]),null!=a&&a[e]&&(o.stepTimeConstraints=a[e]),o}function tP(){return(tP=Mx(qx().mark((function e(t){return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ON){e.next=2;break}return e.abrupt("return",$N(t));case 2:return e.abrupt("return",ON.validatePredictionsFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rP(){return(rP=Mx(qx().mark((function e(t){return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ON){e.next=2;break}return e.abrupt("return",_N(t));case 2:return e.abrupt("return",ON.calculateFaceDirectionFunc(t));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var nP=Object.freeze({__proto__:null,cropFaceInsideBox:function(e,t){var r=xx(e,2),n=r[0],i=r[1],a=xx(t,2),o=a[0],s=a[1];return[[Math.max(n[0],o[0]),Math.max(n[1],o[1])],[Math.min(i[0],s[0]),Math.min(i[1],s[1])]]},calculateFaceArea:function(e){var t=e.topLeft,r=e.bottomRight;return(r[0]-t[0])*(r[1]-t[1])},initFaceVerificationData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.assetRoot,r=void 0===t?"/":t,n=e.customInstructions,i=e.customIcon,a=e.customDirectionIcon,o=e.customStepTimeConstraints,s=e.Locale,u=e.lang;return{curStepIndex:0,steps:[].concat(Ex(XN([gx({name:hx.LEFT,instructions:Zx({},u,null==s?void 0:s[null==hx?void 0:hx.LEFT]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:UW(r,"ic_face_left.svg"),directionIcon:UW(r,"arrow_left.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},eP(hx.LEFT,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o})),gx({name:hx.RIGHT,instructions:Zx({},u,null==s?void 0:s[null==hx?void 0:hx.RIGHT]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:UW(r,"ic_face_right.svg"),directionIcon:UW(r,"arrow_right.svg"),directionIconAnimation:"slide-horizontal",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},eP(hx.RIGHT,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o})),gx({name:hx.UP,instructions:Zx({},u,null==s?void 0:s[null==hx?void 0:hx.UP]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:UW(r,"ic_face_up.svg"),directionIcon:UW(r,"arrow_up.svg"),directionIconAnimation:"slide-vertical",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},eP(hx.UP,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o}))])),[gx({name:hx.FRONTAL,instructions:Zx({},u,null==s?void 0:s[null==hx?void 0:hx.FRONTAL]),image:{blob:null,imageId:null,objUrl:null,blurScore:null,leftRightScore:null},frontalFaceImage:{blob:null,imageId:null,blurScore:null,leftRightScore:null},icon:UW(r,"ic_face_frontal.svg"),directionIcon:UW(r,"frontal.svg"),directionIconAnimation:"blink",firstFrameSpottedAt:null,stepTimeConstraints:{delayTime:null}},eP(hx.FRONTAL,{customInstructions:n,customIcon:i,customDirectionIcon:a,customStepTimeConstraints:o}))])}},validatePredictions:function(e){return tP.apply(this,arguments)},calculateFaceDirection:function(e){return rP.apply(this,arguments)},faceTracker:function(){var e=[],t=[],r=[],n=[],i=[],a=0,o=0;function s(){o=a,r=Ex(e),n=Ex(t)}return function(u,c){var l=u.topLeft,d=u.bottomRight,p=u.landmarks,f=[],m=xx(l,2);f[0]=m[0],f[1]=m[1];var h=xx(d,2);f[2]=h[0],f[3]=h[1];var v=[],b=[];p.forEach((function(e,t){var r=xx(e,2);v[t]=r[0],b[t]=r[1]})),a=Date.now();var y=f[2]-f[0];if(e=[].concat(v),t=[].concat(b),!r.length&&!n.length||c)return s(),{score:0,time:a};for(var g=0;g<6;g++)i[g]=Math.sqrt((e[g]-r[g])*(e[g]-r[g])+(t[g]-n[g])*(t[g]-n[g]));for(var q=0;q<6;q++)i[q]/=(a-o)*y;for(var A=0,I=0;I<6;I++)A+=i[I];return A/=6,s(),{score:A,time:a}}}}),iP=function(){var e=Mx(qx().mark((function e(t){var r,n;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.model,n=t.sCanvas,e.abrupt("return",r.estimateFaces(n,!1,!1,!0));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),aP=Object.freeze({__proto__:null,SIZE:400,getModelPredictions:iP}),oP=Object.getOwnPropertySymbols,sP=Object.prototype.hasOwnProperty,uP=Object.prototype.propertyIsEnumerable;function cP(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var lP,dP=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,i=cP(e),a=1;a<arguments.length;a++){for(var o in r=Object(arguments[a]))sP.call(r,o)&&(i[o]=r[o]);if(oP){n=oP(r);for(var s=0;s<n.length;s++)uP.call(r,n[s])&&(i[n[s]]=r[n[s]])}}return i},pP=arguments[3],fP=arguments[4],mP=arguments[5],hP=JSON.stringify,vP=function(e,t){for(var r,n=Object.keys(mP),i=0,a=n.length;i<a;i++){var o=n[i],s=mP[o].exports;if(s===e||s&&s.default===e){r=o;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var u={};for(i=0,a=n.length;i<a;i++)u[o=n[i]]=o;fP[r]=["function(require,module,exports){"+e+"(self); }",u]}var c=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[r]=r,fP[c]=["function(require,module,exports){var f = require("+hP(r)+");(f.default ? f.default : f)(self);}",l];var d={};!function e(t){for(var r in d[t]=!0,fP[t][1]){var n=fP[t][1][r];d[n]||e(n)}}(c);var p="("+pP+")({"+Object.keys(d).map((function(e){return hP(e)+":["+fP[e][0]+","+hP(fP[e][1])+"]"})).join(",")+"},{},["+hP(c)+"])",f=window.URL||window.webkitURL||window.mozURL||window.msURL,m=new Blob([p],{type:"text/javascript"});if(t&&t.bare)return m;var h=f.createObjectURL(m),v=new Worker(h);return v.objectURL=h,v},bP=Xx((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),yP={js:!0,wasm:!0};function gP(e){if(!(this instanceof gP))return new gP(e);var t=dP({},yP,e||{});if(this.options=t,this.__cache={},this.__init_promise=null,this.__modules=t.modules||{},this.__memory=null,this.__wasm={},this.__isLE=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0],!this.options.js&&!this.options.wasm)throw new Error('mathlib: at least "js" or "wasm" should be enabled')}gP.prototype.has_wasm=function(){if(void 0!==lP)return lP;if(lP=!1,"undefined"==typeof WebAssembly)return lP;try{var e=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),t=new WebAssembly.Module(e);return 0!==new WebAssembly.Instance(t,{}).exports.test(4)&&(lP=!0),lP}catch(e){}return lP},gP.prototype.use=function(e){return this.__modules[e.name]=e,this.options.wasm&&this.has_wasm()&&e.wasm_fn?this[e.name]=e.wasm_fn:this[e.name]=e.fn,this},gP.prototype.init=function(){if(this.__init_promise)return this.__init_promise;if(!this.options.js&&this.options.wasm&&!this.has_wasm())return Promise.reject(new Error('mathlib: only "wasm" was enabled, but it\'s not supported'));var e=this;return this.__init_promise=Promise.all(Object.keys(e.__modules).map((function(t){var r=e.__modules[t];return e.options.wasm&&e.has_wasm()&&r.wasm_fn?e.__wasm[t]?null:WebAssembly.compile(e.__base64decode(r.wasm_src)).then((function(r){e.__wasm[t]=r})):null}))).then((function(){return e})),this.__init_promise},gP.prototype.__base64decode=function(e){for(var t=e.replace(/[\r\n=]/g,""),r=t.length,n=new Uint8Array(3*r>>2),i=0,a=0,o=0;o<r;o++)o%4==0&&o&&(n[a++]=i>>16&255,n[a++]=i>>8&255,n[a++]=255&i),i=i<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(t.charAt(o));var s=r%4*6;return 0===s?(n[a++]=i>>16&255,n[a++]=i>>8&255,n[a++]=255&i):18===s?(n[a++]=i>>10&255,n[a++]=i>>2&255):12===s&&(n[a++]=i>>4&255),n},gP.prototype.__reallocate=function(e){if(!this.__memory)return this.__memory=new WebAssembly.Memory({initial:Math.ceil(e/65536)}),this.__memory;var t=this.__memory.buffer.byteLength;return t<e&&this.__memory.grow(Math.ceil((e-t)/65536)),this.__memory},gP.prototype.__instance=function(e,t,r){if(t&&this.__reallocate(t),!this.__wasm[e]){var n=this.__modules[e];this.__wasm[e]=new WebAssembly.Module(this.__base64decode(n.wasm_src))}if(!this.__cache[e]){var i={memoryBase:0,memory:this.__memory,tableBase:0,table:new WebAssembly.Table({initial:0,element:"anyfunc"})};this.__cache[e]=new WebAssembly.Instance(this.__wasm[e],{env:dP(i,r||{})})}return this.__cache[e]},gP.prototype.__align=function(e,t){var r=e%(t=t||8);return e+(r?t-r:0)};var qP,AP,IP,SP,MP,kP,CP=gP;function zP(e,t,r,n,i,a){var o,s,u,c,l,d,p,f,m,h,v,b,y,g;for(m=0;m<a;m++){for(p=m,f=0,c=l=(o=e[d=m*i])*n[6],v=n[0],b=n[1],y=n[4],g=n[5],h=0;h<i;h++)u=(s=e[d])*v+o*b+c*y+l*g,l=c,c=u,o=s,r[f]=c,f++,d++;for(f--,p+=a*(i-1),c=l=(o=e[--d])*n[7],s=o,v=n[2],b=n[3],h=i-1;h>=0;h--)u=s*v+o*b+c*y+l*g,l=c,c=u,o=s,s=e[d],t[p]=r[f]+c,d--,f--,p-=a}}var ZP={name:"unsharp_mask",fn:function(e,t,r,n,i,a){var o,s,u,c,l,d,p,f,m,h,v,b,y;if(!(0===n||i<.5)){i>2&&(i=2);var g=function(e,t,r){for(var n,i,a,o,s,u=t*r,c=new Uint16Array(u),l=0;l<u;l++)n=e[4*l],i=e[4*l+1],a=e[4*l+2],s=n>=i&&n>=a?n:i>=a&&i>=n?i:a,o=n<=i&&n<=a?n:i<=a&&i<=n?i:a,c[l]=257*(s+o)>>1;return c}(e,t,r),q=new Uint16Array(g);!function(e,t,r,n){if(n){var i=new Uint16Array(e.length),a=new Float32Array(Math.max(t,r)),o=function(e){e<.5&&(e=.5);var t=Math.exp(.527076)/e,r=Math.exp(-t),n=Math.exp(-2*t),i=(1-r)*(1-r)/(1+2*t*r-n);return qP=i,AP=i*(t-1)*r,IP=i*(t+1)*r,SP=-i*n,MP=2*r,kP=-n,new Float32Array([qP,AP,IP,SP,MP,kP,(qP+AP)/(1-MP-kP),(IP+SP)/(1-MP-kP)])}(n);zP(e,i,a,o,t,r),zP(i,e,a,o,r,t)}}(q,t,r,i);for(var A=n/100*4096+.5|0,I=257*a|0,S=t*r,M=0;M<S;M++)b=2*(g[M]-q[M]),Math.abs(b)>=I&&(o=e[y=4*M],s=e[y+1],u=e[y+2],d=257*((f=o>=s&&o>=u?o:s>=o&&s>=u?s:u)+(p=o<=s&&o<=u?o:s<=o&&s<=u?s:u))>>1,p===f?c=l=0:(l=d<=32767?4095*(f-p)/(f+p)|0:4095*(f-p)/(510-f-p)|0,c=o===f?65535*(s-u)/(6*(f-p))|0:s===f?21845+(65535*(u-o)/(6*(f-p))|0):43690+(65535*(o-s)/(6*(f-p))|0)),(d+=A*b+2048>>12)>65535?d=65535:d<0&&(d=0),0===l?o=s=u=d>>8:(m=2*d-(h=d<=32767?d*(4096+l)+2048>>12:d+((65535-d)*l+2048>>12))>>8,h>>=8,o=(v=c+21845&65535)>=43690?m:v>=32767?m+(6*(h-m)*(43690-v)+32768>>16):v>=10922?h:m+(6*(h-m)*v+32768>>16),s=(v=65535&c)>=43690?m:v>=32767?m+(6*(h-m)*(43690-v)+32768>>16):v>=10922?h:m+(6*(h-m)*v+32768>>16),u=(v=c-21845&65535)>=43690?m:v>=32767?m+(6*(h-m)*(43690-v)+32768>>16):v>=10922?h:m+(6*(h-m)*v+32768>>16)),e[y]=o,e[y+1]=s,e[y+2]=u)}},wasm_fn:function(e,t,r,n,i,a){if(!(0===n||i<.5)){i>2&&(i=2);var o=t*r,s=4*o,u=2*o,c=2*o,l=4*Math.max(t,r),d=s,p=d+u,f=p+c,m=f+c,h=m+l,v=this.__instance("unsharp_mask",s+u+2*c+l+32,{exp:Math.exp}),b=new Uint32Array(e.buffer);new Uint32Array(this.__memory.buffer).set(b);var y=v.exports.hsl_l16||v.exports._hsl_l16;y(0,d,t,r),(y=v.exports.blurMono16||v.exports._blurMono16)(d,p,f,m,h,t,r,i),(y=v.exports.unsharp||v.exports._unsharp)(0,0,d,p,t,r,n,a),b.set(new Uint32Array(this.__memory.buffer,0,o))}},wasm_src:"AGFzbQEAAAABMQZgAXwBfGACfX8AYAZ/f39/f38AYAh/f39/f39/fQBgBH9/f38AYAh/f39/f39/fwACGQIDZW52A2V4cAAAA2VudgZtZW1vcnkCAAEDBgUBAgMEBQQEAXAAAAdMBRZfX2J1aWxkX2dhdXNzaWFuX2NvZWZzAAEOX19nYXVzczE2X2xpbmUAAgpibHVyTW9ubzE2AAMHaHNsX2wxNgAEB3Vuc2hhcnAABQkBAAqJEAXZAQEGfAJAIAFE24a6Q4Ia+z8gALujIgOaEAAiBCAEoCIGtjgCECABIANEAAAAAAAAAMCiEAAiBbaMOAIUIAFEAAAAAAAA8D8gBKEiAiACoiAEIAMgA6CiRAAAAAAAAPA/oCAFoaMiArY4AgAgASAEIANEAAAAAAAA8L+gIAKioiIHtjgCBCABIAQgA0QAAAAAAADwP6AgAqKiIgO2OAIIIAEgBSACoiIEtow4AgwgASACIAegIAVEAAAAAAAA8D8gBqGgIgKjtjgCGCABIAMgBKEgAqO2OAIcCwu3AwMDfwR9CHwCQCADKgIUIQkgAyoCECEKIAMqAgwhCyADKgIIIQwCQCAEQX9qIgdBAEgiCA0AIAIgAC8BALgiDSADKgIYu6IiDiAJuyIQoiAOIAq7IhGiIA0gAyoCBLsiEqIgAyoCALsiEyANoqCgoCIPtjgCACACQQRqIQIgAEECaiEAIAdFDQAgBCEGA0AgAiAOIBCiIA8iDiARoiANIBKiIBMgAC8BALgiDaKgoKAiD7Y4AgAgAkEEaiECIABBAmohACAGQX9qIgZBAUoNAAsLAkAgCA0AIAEgByAFbEEBdGogAEF+ai8BACIIuCINIAu7IhGiIA0gDLsiEqKgIA0gAyoCHLuiIg4gCrsiE6KgIA4gCbsiFKKgIg8gAkF8aioCALugqzsBACAHRQ0AIAJBeGohAiAAQXxqIQBBACAFQQF0ayEHIAEgBSAEQQF0QXxqbGohBgNAIAghAyAALwEAIQggBiANIBGiIAO4Ig0gEqKgIA8iECAToqAgDiAUoqAiDyACKgIAu6CrOwEAIAYgB2ohBiAAQX5qIQAgAkF8aiECIBAhDiAEQX9qIgRBAUoNAAsLCwvfAgIDfwZ8AkAgB0MAAAAAWw0AIARE24a6Q4Ia+z8gB0MAAAA/l7ujIgyaEAAiDSANoCIPtjgCECAEIAxEAAAAAAAAAMCiEAAiDraMOAIUIAREAAAAAAAA8D8gDaEiCyALoiANIAwgDKCiRAAAAAAAAPA/oCAOoaMiC7Y4AgAgBCANIAxEAAAAAAAA8L+gIAuioiIQtjgCBCAEIA0gDEQAAAAAAADwP6AgC6KiIgy2OAIIIAQgDiALoiINtow4AgwgBCALIBCgIA5EAAAAAAAA8D8gD6GgIgujtjgCGCAEIAwgDaEgC6O2OAIcIAYEQCAFQQF0IQogBiEJIAIhCANAIAAgCCADIAQgBSAGEAIgACAKaiEAIAhBAmohCCAJQX9qIgkNAAsLIAVFDQAgBkEBdCEIIAUhAANAIAIgASADIAQgBiAFEAIgAiAIaiECIAFBAmohASAAQX9qIgANAAsLC7wBAQV/IAMgAmwiAwRAQQAgA2shBgNAIAAoAgAiBEEIdiIHQf8BcSECAn8gBEH/AXEiAyAEQRB2IgRB/wFxIgVPBEAgAyIIIAMgAk8NARoLIAQgBCAHIAIgA0kbIAIgBUkbQf8BcQshCAJAIAMgAk0EQCADIAVNDQELIAQgByAEIAMgAk8bIAIgBUsbQf8BcSEDCyAAQQRqIQAgASADIAhqQYECbEEBdjsBACABQQJqIQEgBkEBaiIGDQALCwvTBgEKfwJAIAazQwAAgEWUQwAAyEKVu0QAAAAAAADgP6CqIQ0gBSAEbCILBEAgB0GBAmwhDgNAQQAgAi8BACADLwEAayIGQQF0IgdrIAcgBkEASBsgDk8EQCAAQQJqLQAAIQUCfyAALQAAIgYgAEEBai0AACIESSIJRQRAIAYiCCAGIAVPDQEaCyAFIAUgBCAEIAVJGyAGIARLGwshCAJ/IAYgBE0EQCAGIgogBiAFTQ0BGgsgBSAFIAQgBCAFSxsgCRsLIgogCGoiD0GBAmwiEEEBdiERQQAhDAJ/QQAiCSAIIApGDQAaIAggCmsiCUH/H2wgD0H+AyAIayAKayAQQYCABEkbbSEMIAYgCEYEQCAEIAVrQf//A2wgCUEGbG0MAQsgBSAGayAGIARrIAQgCEYiBhtB//8DbCAJQQZsbUHVqgFBqtUCIAYbagshCSARIAcgDWxBgBBqQQx1aiIGQQAgBkEAShsiBkH//wMgBkH//wNIGyEGAkACfwJAIAxB//8DcSIFBEAgBkH//wFKDQEgBUGAIGogBmxBgBBqQQx2DAILIAZBCHYiBiEFIAYhBAwCCyAFIAZB//8Dc2xBgBBqQQx2IAZqCyIFQQh2IQcgBkEBdCAFa0EIdiIGIQQCQCAJQdWqAWpB//8DcSIFQanVAksNACAFQf//AU8EQEGq1QIgBWsgByAGa2xBBmxBgIACakEQdiAGaiEEDAELIAchBCAFQanVAEsNACAFIAcgBmtsQQZsQYCAAmpBEHYgBmohBAsCfyAGIgUgCUH//wNxIghBqdUCSw0AGkGq1QIgCGsgByAGa2xBBmxBgIACakEQdiAGaiAIQf//AU8NABogByIFIAhBqdUASw0AGiAIIAcgBmtsQQZsQYCAAmpBEHYgBmoLIQUgCUGr1QJqQf//A3EiCEGp1QJLDQAgCEH//wFPBEBBqtUCIAhrIAcgBmtsQQZsQYCAAmpBEHYgBmohBgwBCyAIQanVAEsEQCAHIQYMAQsgCCAHIAZrbEEGbEGAgAJqQRB2IAZqIQYLIAEgBDoAACABQQFqIAU6AAAgAUECaiAGOgAACyADQQJqIQMgAkECaiECIABBBGohACABQQRqIQEgC0F/aiILDQALCwsL"},wP=[{win:.5,filter:function(e){return e>=-.5&&e<.5?1:0}},{win:1,filter:function(e){if(e<=-1||e>=1)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*(.54+.46*Math.cos(t/1))}},{win:2,filter:function(e){if(e<=-2||e>=2)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*Math.sin(t/2)/(t/2)}},{win:3,filter:function(e){if(e<=-3||e>=3)return 0;if(e>-1.1920929e-7&&e<1.1920929e-7)return 1;var t=e*Math.PI;return Math.sin(t)/t*Math.sin(t/3)/(t/3)}}];function xP(e){return Math.round(16383*e)}var EP=function(e,t,r,n,i){var a,o,s,u,c,l,d,p,f,m,h,v,b,y,g,q,A,I=wP[e].filter,S=1/n,M=Math.min(1,n),k=wP[e].win/M,C=Math.floor(2*(k+1)),z=new Int16Array((C+2)*r),Z=0,w=!z.subarray||!z.set;for(a=0;a<r;a++){for(o=(a+.5)*S+i,s=Math.max(0,Math.floor(o-k)),c=(u=Math.min(t-1,Math.ceil(o+k)))-s+1,l=new Float32Array(c),d=new Int16Array(c),p=0,f=s,m=0;f<=u;f++,m++)p+=h=I((f+.5-o)*M),l[m]=h;for(v=0,m=0;m<l.length;m++)v+=b=l[m]/p,d[m]=xP(b);for(d[r>>1]+=xP(1-v),y=0;y<d.length&&0===d[y];)y++;if(y<d.length){for(g=d.length-1;g>0&&0===d[g];)g--;if(q=s+y,A=g-y+1,z[Z++]=q,z[Z++]=A,w)for(m=y;m<=g;m++)z[Z++]=d[m];else z.set(d.subarray(y,g+1),Z),Z+=A}else z[Z++]=0,z[Z++]=0}return z};function OP(e){return e<0?0:e>255?255:e}var KP=!0;try{KP=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(e){}function WP(e,t,r){if(KP)t.set(function(e){return new Uint8Array(e.buffer,0,e.byteLength)}(e),r);else for(var n=r,i=0;i<e.length;i++){var a=e[i];t[n++]=255&a,t[n++]=a>>8&255}}var VP={name:"resize",fn:function(e){var t=e.src,r=e.width,n=e.height,i=e.toWidth,a=e.toHeight,o=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,u=e.offsetX||0,c=e.offsetY||0,l=e.dest||new Uint8Array(i*a*4),d=void 0===e.quality?3:e.quality,p=e.alpha||!1,f=EP(d,r,i,o,u),m=EP(d,n,a,s,c),h=new Uint8Array(i*n*4);return function(e,t,r,n,i,a){var o,s,u,c,l,d,p,f,m,h,v,b=0,y=0;for(m=0;m<n;m++){for(l=0,h=0;h<i;h++){for(d=a[l++],p=a[l++],f=b+4*d|0,o=s=u=c=0;p>0;p--)c=c+(v=a[l++])*e[f+3]|0,u=u+v*e[f+2]|0,s=s+v*e[f+1]|0,o=o+v*e[f]|0,f=f+4|0;t[y+3]=OP(c+8192>>14),t[y+2]=OP(u+8192>>14),t[y+1]=OP(s+8192>>14),t[y]=OP(o+8192>>14),y=y+4*n|0}y=4*(m+1)|0,b=(m+1)*r*4|0}}(t,h,r,n,i,f),function(e,t,r,n,i,a){var o,s,u,c,l,d,p,f,m,h,v,b=0,y=0;for(m=0;m<n;m++){for(l=0,h=0;h<i;h++){for(d=a[l++],p=a[l++],f=b+4*d|0,o=s=u=c=0;p>0;p--)c=c+(v=a[l++])*e[f+3]|0,u=u+v*e[f+2]|0,s=s+v*e[f+1]|0,o=o+v*e[f]|0,f=f+4|0;t[y+3]=OP(c+8192>>14),t[y+2]=OP(u+8192>>14),t[y+1]=OP(s+8192>>14),t[y]=OP(o+8192>>14),y=y+4*n|0}y=4*(m+1)|0,b=(m+1)*r*4|0}}(h,l,n,i,a,m),p||function(e,t,r){for(var n=3,i=t*r*4|0;n<i;)e[n]=255,n=n+4|0}(l,i,a),l},wasm_fn:function(e){var t=e.src,r=e.width,n=e.height,i=e.toWidth,a=e.toHeight,o=e.scaleX||e.toWidth/e.width,s=e.scaleY||e.toHeight/e.height,u=e.offsetX||0,c=e.offsetY||0,l=e.dest||new Uint8Array(i*a*4),d=void 0===e.quality?3:e.quality,p=e.alpha||!1,f=EP(d,r,i,o,u),m=EP(d,n,a,s,c),h=this.__align(0+Math.max(t.byteLength,l.byteLength)),v=this.__align(h+n*i*4),b=this.__align(v+f.byteLength),y=b+m.byteLength,g=this.__instance("resize",y),q=new Uint8Array(this.__memory.buffer),A=new Uint32Array(this.__memory.buffer),I=new Uint32Array(t.buffer);return A.set(I),WP(f,q,v),WP(m,q,b),(g.exports.convolveHV||g.exports._convolveHV)(v,b,h,r,n,i,a),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,a*i)),p||function(e,t,r){for(var n=3,i=t*r*4|0;n<i;)e[n]=255,n=n+4|0}(l,i,a),l},wasm_src:"AGFzbQEAAAABFAJgBn9/f39/fwBgB39/f39/f38AAg8BA2VudgZtZW1vcnkCAAEDAwIAAQQEAXAAAAcZAghjb252b2x2ZQAACmNvbnZvbHZlSFYAAQkBAArmAwLBAwEQfwJAIANFDQAgBEUNACAFQQRqIRVBACEMQQAhDQNAIA0hDkEAIRFBACEHA0AgB0ECaiESAn8gBSAHQQF0IgdqIgZBAmouAQAiEwRAQQAhCEEAIBNrIRQgFSAHaiEPIAAgDCAGLgEAakECdGohEEEAIQlBACEKQQAhCwNAIBAoAgAiB0EYdiAPLgEAIgZsIAtqIQsgB0H/AXEgBmwgCGohCCAHQRB2Qf8BcSAGbCAKaiEKIAdBCHZB/wFxIAZsIAlqIQkgD0ECaiEPIBBBBGohECAUQQFqIhQNAAsgEiATagwBC0EAIQtBACEKQQAhCUEAIQggEgshByABIA5BAnRqIApBgMAAakEOdSIGQf8BIAZB/wFIG0EQdEGAgPwHcUEAIAZBAEobIAtBgMAAakEOdSIGQf8BIAZB/wFIG0EYdEEAIAZBAEobciAJQYDAAGpBDnUiBkH/ASAGQf8BSBtBCHRBgP4DcUEAIAZBAEobciAIQYDAAGpBDnUiBkH/ASAGQf8BSBtB/wFxQQAgBkEAShtyNgIAIA4gA2ohDiARQQFqIhEgBEcNAAsgDCACaiEMIA1BAWoiDSADRw0ACwsLIQACQEEAIAIgAyAEIAUgABAAIAJBACAEIAUgBiABEAALCw=="};function TP(e){var t=e||[],r={js:t.indexOf("js")>=0,wasm:t.indexOf("wasm")>=0};CP.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(ZP),this.use(VP)}bP(TP,CP),TP.prototype.resizeAndUnsharp=function(e,t){var r=this.resize(e,t);return e.unsharpAmount&&this.unsharp_mask(r,e.toWidth,e.toHeight,e.unsharpAmount,e.unsharpRadius,e.unsharpThreshold),r};var LP=TP;function NP(e,t){this.create=e,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=t||2e3}NP.prototype.acquire=function(){var e,t=this;return 0!==this.available.length?e=this.available.pop():((e=this.create()).id=this.lastId++,e.release=function(){return t.release(e)}),this.acquired[e.id]=e,e},NP.prototype.release=function(e){var t=this;delete this.acquired[e.id],e.lastUsed=Date.now(),this.available.push(e),0===this.timeoutId&&(this.timeoutId=setTimeout((function(){return t.gc()}),100))},NP.prototype.gc=function(){var e=this,t=Date.now();this.available=this.available.filter((function(r){return!(t-r.lastUsed>e.idle&&(r.destroy(),1))})),0!==this.available.length?this.timeoutId=setTimeout((function(){return e.gc()}),100):this.timeoutId=0};var PP=NP;function jP(e){return Object.prototype.toString.call(e)}var RP=function(e){var t=jP(e);return"[object HTMLCanvasElement]"===t||"[object OffscreenCanvas]"===t||"[object Canvas]"===t},XP=function(e){switch(e){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},BP=function(){var e,t=LP;onmessage=function(r){var n=r.data.opts;e||(e=new t(r.data.features));var i=e.resizeAndUnsharp(n);postMessage({result:i},[i.buffer])}};function GP(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.floor(e)}function YP(e){var t=Math.round(e);return Math.abs(e-t)<1e-5?t:Math.ceil(e)}var HP={},FP=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(FP=navigator.userAgent.indexOf("Safari")>=0)}catch(gZ){}var UP=1;"undefined"!=typeof navigator&&(UP=Math.min(navigator.hardwareConcurrency||1,4));var DP,JP,QP={tile:1024,concurrency:UP,features:["js","wasm","ww"],idle:2e3,createCanvas:function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r}},_P={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0};function $P(){return{value:vP(BP),destroy:function(){if(this.value.terminate(),"undefined"!=typeof window){var e=window.URL||window.webkitURL||window.mozURL||window.msURL;e&&e.revokeObjectURL&&this.value.objectURL&&e.revokeObjectURL(this.value.objectURL)}}}}function ej(e){if(!(this instanceof ej))return new ej(e);this.options=dP({},QP,e||{});var t="lk_".concat(this.options.concurrency);this.__limit=HP[t]||function(e){var t=0,r=[];function n(){t<e&&r.length&&(t++,r.shift()())}return function(e){return new Promise((function(i,a){r.push((function(){e().then((function(e){i(e),t--,n()}),(function(e){a(e),t--,n()}))})),n()}))}}(this.options.concurrency),HP[t]||(HP[t]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}ej.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if(!1!==DP&&!0!==DP&&(DP=!1,"undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray))try{new ImageData(new Uint8ClampedArray(400),10,10),DP=!0}catch(t){}!1!==JP&&!0!==JP&&(JP=!1,"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?JP=!0:this.debug("ImageBitmap does not support .close(), disabled")));var t=this.options.features.slice();if(t.indexOf("all")>=0&&(t=["cib","wasm","js","ww"]),this.__requested_features=t,this.__mathlib=new LP(t),t.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{vP((function(){})).terminate(),this.features.ww=!0;var r="wp_".concat(JSON.stringify(this.options));HP[r]?this.__workersPool=HP[r]:(this.__workersPool=new PP($P,this.options.idle),HP[r]=this.__workersPool)}catch(t){}var n,i=this.__mathlib.init().then((function(t){dP(e.features,t.features)}));return n=JP?function(e){return Promise.resolve().then((function(){if("undefined"==typeof createImageBitmap)return!1;var t=e(100,100);return createImageBitmap(t,0,0,100,100,{resizeWidth:10,resizeHeight:10,resizeQuality:"high"}).then((function(e){var r=10===e.width;return e.close(),t=null,r}))})).catch((function(){return!1}))}(this.options.createCanvas).then((function(r){e.features.cib&&t.indexOf("cib")<0?e.debug("createImageBitmap() resize supported, but disabled by config"):t.indexOf("cib")>=0&&(e.features.cib=r)})):Promise.resolve(!1),this.__initPromise=Promise.all([i,n]).then((function(){return e})),this.__initPromise},ej.prototype.resize=function(e,t,r){var n=this;this.debug("Start resize...");var i=dP({},_P);if(isNaN(r)?r&&(i=dP(i,r)):i=dP(i,{quality:r}),i.toWidth=t.width,i.toHeight=t.height,i.width=e.naturalWidth||e.width,i.height=e.naturalHeight||e.height,0===t.width||0===t.height)return Promise.reject(new Error("Invalid output size: ".concat(t.width,"x").concat(t.height)));i.unsharpRadius>2&&(i.unsharpRadius=2);var a=!1,o=null;i.cancelToken&&(o=i.cancelToken.then((function(e){throw a=!0,e}),(function(e){throw a=!0,e})));var s=Math.ceil(Math.max(3,2.5*i.unsharpRadius|0));return this.init().then((function(){if(a)return o;if(n.features.cib){var r=t.getContext("2d",{alpha:Boolean(i.alpha)});return n.debug("Resize via createImageBitmap()"),createImageBitmap(e,{resizeWidth:i.toWidth,resizeHeight:i.toHeight,resizeQuality:XP(i.quality)}).then((function(e){if(a)return o;if(!i.unsharpAmount)return r.drawImage(e,0,0),e.close(),r=null,n.debug("Finished!"),t;n.debug("Unsharp result");var s=n.options.createCanvas(i.toWidth,i.toHeight),u=s.getContext("2d",{alpha:Boolean(i.alpha)});u.drawImage(e,0,0),e.close();var c=u.getImageData(0,0,i.toWidth,i.toHeight);return n.__mathlib.unsharp_mask(c.data,i.toWidth,i.toHeight,i.unsharpAmount,i.unsharpRadius,i.unsharpThreshold),r.putImageData(c,0,0),s.width=s.height=0,c=u=s=r=null,n.debug("Finished!"),t}))}var u={},c=function(e){return Promise.resolve().then((function(){return n.features.ww?new Promise((function(t,r){var i=n.__workersPool.acquire();o&&o.catch((function(e){return r(e)})),i.value.onmessage=function(e){i.release(),e.data.err?r(e.data.err):t(e.data.result)},i.value.postMessage({opts:e,features:n.__requested_features,preload:{wasm_nodule:n.__mathlib.__}},[e.src.buffer])})):n.__mathlib.resizeAndUnsharp(e,u)}))},l=function(e,t,r){var i,u,l,d=!1,p=function(t){return n.__limit((function(){if(a)return o;var s;if(RP(e))n.debug("Get tile pixel data"),s=i.getImageData(t.x,t.y,t.width,t.height);else{n.debug("Draw tile imageBitmap/image to temporary canvas");var d=n.options.createCanvas(t.width,t.height),p=d.getContext("2d",{alpha:Boolean(r.alpha)});p.globalCompositeOperation="copy",p.drawImage(u||e,t.x,t.y,t.width,t.height,0,0,t.width,t.height),n.debug("Get tile pixel data"),s=p.getImageData(0,0,t.width,t.height),d.width=d.height=0,p=d=null}var f={src:s.data,width:t.width,height:t.height,toWidth:t.toWidth,toHeight:t.toHeight,scaleX:t.scaleX,scaleY:t.scaleY,offsetX:t.offsetX,offsetY:t.offsetY,quality:r.quality,alpha:r.alpha,unsharpAmount:r.unsharpAmount,unsharpRadius:r.unsharpRadius,unsharpThreshold:r.unsharpThreshold};return n.debug("Invoke resize math"),Promise.resolve().then((function(){return c(f)})).then((function(e){if(a)return o;var r;if(s=null,n.debug("Convert raw rgba tile result to ImageData"),DP)r=new ImageData(new Uint8ClampedArray(e),t.toWidth,t.toHeight);else if((r=l.createImageData(t.toWidth,t.toHeight)).data.set)r.data.set(e);else for(var i=r.data.length-1;i>=0;i--)r.data[i]=e[i];return n.debug("Draw tile"),FP?l.putImageData(r,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth+1e-5,t.toInnerHeight+1e-5):l.putImageData(r,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth,t.toInnerHeight),null}))}))};return Promise.resolve().then((function(){if(l=t.getContext("2d",{alpha:Boolean(r.alpha)}),RP(e))return i=e.getContext("2d",{alpha:Boolean(r.alpha)}),null;if(function(e){return"[object ImageBitmap]"===jP(e)}(e))return u=e,d=!0,null;if(function(e){return"[object HTMLImageElement]"===jP(e)}(e))return JP?(n.debug("Decode image via createImageBitmap"),createImageBitmap(e).then((function(e){u=e})).catch((function(e){return null}))):null;throw new Error('Pica: ".from" should be Image, Canvas or ImageBitmap')})).then((function(){if(a)return o;n.debug("Calculate tiles");var e=function(e){var t,r,n,i,a,o,s=e.toWidth/e.width,u=e.toHeight/e.height,c=GP(e.srcTileSize*s)-2*e.destTileBorder,l=GP(e.srcTileSize*u)-2*e.destTileBorder;if(c<1||l<1)throw new Error("Internal error in pica: target tile width/height is too small.");var d,p=[];for(i=0;i<e.toHeight;i+=l)for(n=0;n<e.toWidth;n+=c)(t=n-e.destTileBorder)<0&&(t=0),t+(a=n+c+e.destTileBorder-t)>=e.toWidth&&(a=e.toWidth-t),(r=i-e.destTileBorder)<0&&(r=0),r+(o=i+l+e.destTileBorder-r)>=e.toHeight&&(o=e.toHeight-r),d={toX:t,toY:r,toWidth:a,toHeight:o,toInnerX:n,toInnerY:i,toInnerWidth:c,toInnerHeight:l,offsetX:t/s-GP(t/s),offsetY:r/u-GP(r/u),scaleX:s,scaleY:u,x:GP(t/s),y:GP(r/u),width:YP(a/s),height:YP(o/u)},p.push(d);return p}({width:r.width,height:r.height,srcTileSize:n.options.tile,toWidth:r.toWidth,toHeight:r.toHeight,destTileBorder:s}).map((function(e){return p(e)}));function i(){u&&(d||u.close(),u=null)}return n.debug("Process tiles"),Promise.all(e).then((function(){return n.debug("Finished!"),i(),t}),(function(e){throw i(),e}))}))};return function e(t,r,i,s){if(a)return o;var u,c=mv(t.shift(),2),d=c[0],p=c[1],f=0===t.length;return s=dP({},s,{toWidth:d,toHeight:p,quality:f?s.quality:Math.min(1,s.quality)}),f||(u=n.options.createCanvas(d,p)),l(r,f?i:u,s).then((function(){return f?i:(s.width=d,s.height=p,e(t,u,i,s))})).then((function(e){return u&&(u.width=u.height=0),e}))}(function(e,t,r,n,i,a){var o=r/e,s=n/t,u=(2*a+2+1)/i;if(u>.5)return[[r,n]];var c=Math.ceil(Math.log(Math.min(o,s))/Math.log(u));if(c<=1)return[[r,n]];for(var l=[],d=0;d<c;d++){var p=Math.round(Math.pow(Math.pow(e,c-d-1)*Math.pow(r,d+1),1/c)),f=Math.round(Math.pow(Math.pow(t,c-d-1)*Math.pow(n,d+1),1/c));l.push([p,f])}return l}(i.width,i.height,i.toWidth,i.toHeight,n.options.tile,s),e,t,i)}))},ej.prototype.resizeBuffer=function(e){var t=this,r=dP({},_P,e);return this.init().then((function(){return t.__mathlib.resizeAndUnsharp(r)}))},ej.prototype.toBlob=function(e,t,r){return t=t||"image/png",new Promise((function(n){if(e.toBlob)e.toBlob((function(e){return n(e)}),t,r);else if(e.convertToBlob)n(e.convertToBlob({type:t,quality:r}));else{for(var i=atob(e.toDataURL(t,r).split(",")[1]),a=i.length,o=new Uint8Array(a),s=0;s<a;s++)o[s]=i.charCodeAt(s);n(new Blob([o],{type:t}))}}))},ej.prototype.debug=function(){};var tj=new ej,rj=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.minSize,i=void 0===n?720:n,a=e/t;return e>t?{desW:Math.floor(i*a),desH:i}:{desW:i,desH:Math.floor(i/a)}},nj=Object.freeze({__proto__:null,scaleImage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.minSize,n=void 0===r?720:r;return new Promise((function(t){var r=URL.createObjectURL(e),i=new Image;i.src=r;var a=document.createElement("canvas");i.onload=function(){if(i.width&&i.height&&(i.width<n||i.height<n)){var e=rj(i.width,i.height,{minSize:n}),r=e.desW,o=e.desH;a.width=r,a.height=o,tj.resize(i,a).then((function(e){return tj.toBlob(e,"image/jpeg",1)})).then((function(e){return t(e)}))}else t(null)}}))},createResizer:function(e){var t=e.width,r=e.height,n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=r,{resize:function(e){var t=e.srcCanvas;return i.drawImage(t,0,0,n.width,n.height),n}}},resizeBlobImg:function(e,t,r){var n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=r,new Promise((function(t){var r=URL.createObjectURL(e),a=new Image;a.onload=function(){URL.revokeObjectURL(r),i.drawImage(a,0,0,n.width,n.height),n.toBlob(t,"image/jpeg",1)},a.src=r}))},blobToCanvas:function(e){var t=e.blob;return new Promise((function(e){var r=document.createElement("canvas"),n=r.getContext("2d"),i=new Image;i.onload=function(t){var a=i.width,o=i.height;r.width=a,r.height=o,URL.revokeObjectURL(t.target.src),n.drawImage(t.target,0,0),e(r)},i.src=URL.createObjectURL(t)}))}});function ij(e,t,r,n){var i=r*(4*t)+4*n;return{r:e[i],g:e[i+1],b:e[i+2]}}function aj(e,t,r){return function(e,t,r){for(var n=0,i=r[1],a=r[3],o=r[0],s=r[2],u=i;u<a;u++)for(var c=o;c<s;c++){var l=ij(e,t,u,c),d=l.r,p=l.g,f=l.b;d>=245&&f>=245&&p>245&&(n+=1)}return n}(e,t,function(e,t){var r=Math.floor(.025*e),n=e-r,i=Math.floor(.025*t);return[r,i,n,t-i]}(t,r))/(t*r)>=.001}function oj(){return(oj=Mx(qx().mark((function e(t){var r,n,i;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.getContext("2d"),n=r.getImageData(0,0,t.width,t.height),i=n.data,ON){e.next=5;break}return e.abrupt("return",aj(i,n.width,n.height));case 5:return e.abrupt("return",ON.detectGlare(i,n.width,n.height));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var sj=Object.freeze({__proto__:null,isCardGlare:function(e){return oj.apply(this,arguments)}});function uj(){return new Promise((function(e){navigator.permissions&&"function"==typeof navigator.permissions.query?navigator.permissions.query({name:"geolocation"}).then((function(t){"granted"===t.state?navigator.geolocation.getCurrentPosition((function(t){e({long:t.coords.longitude,lat:t.coords.latitude})}),(function(){return e(null)})):e(null)})).catch((function(){return e(null)})):e(null)}))}var cj=Object.freeze({__proto__:null,getLongAndLat:uj}),lj="internal_server_error",dj="network_error",pj=JK();function fj(e){return 500*Math.pow(1.5,e)}function mj(e){return Array.isArray(null==e?void 0:e.errors)&&e.errors.find((function(e){return e.code===lj}))}function hj(e){return"Failed to fetch"===e.message||!e.response}function vj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,i=t.maxInternalServerErrorRetryTimes,a=void 0===i?1:i,o=t.propertyKey,s=t.onDone;return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var u=this;function c(e,t){return l.apply(this,arguments)}function l(){return(l=Mx(qx().mark((function t(i,l){var d,p,f,m,h,v,b,y,g=arguments;return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return v=function(){return(v=Mx(qx().mark((function e(t){var r,n;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=m(t),n=f(t)-r,e.next=4,mN(fj(n));case 4:return e.abrupt("return",c(r,t,n));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)},h=function(e){return v.apply(this,arguments)},m=function(e){return e===l?Math.max(i-1,0):f(e)-1},f=function(e){return e===dj?n:e===lj?a:0},p=function(e){return i>0||(e===dj?void 0===i&&n>0:e===lj&&void 0===i&&a>0)},d=g.length>2&&void 0!==g[2]?g[2]:0,b=performance.now(),t.prev=7,t.next=10,e.apply(u,r);case 10:if(y=t.sent,s({response:y,retryCount:d,propertyKey:o,timeInMs:performance.now()-b,args:r}),!mj(y)||!p(lj)){t.next=16;break}return t.next=15,h(lj);case 15:return t.abrupt("return",t.sent);case 16:return t.abrupt("return",y);case 19:if(t.prev=19,t.t0=t.catch(7),s({error:t.t0,retryCount:d,propertyKey:o,timeInMs:performance.now()-b,args:r}),!hj(t.t0)||!p(dj)){t.next=24;break}return t.abrupt("return",h(dj));case 24:throw t.t0;case 25:case"end":return t.stop()}}),t,null,[[7,19]])})))).apply(this,arguments)}return c()}}function bj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.maxNetworkErrorRetryTimes,n=void 0===r?3:r,i=t.maxInternalServerErrorRetryTimes,a=void 0===i?1:i,o=t.onDone,s=void 0===o?function(){}:o,u={get:function(e,t){var r=e[t];return"function"==typeof r&&"constructor"!==t?vj(r,{maxNetworkErrorRetryTimes:n,maxInternalServerErrorRetryTimes:a,propertyKey:t,onDone:s}):r}};return new Proxy(e,u)}var yj=Object.freeze({__proto__:null,createRetryAPIClient:bj,useApiClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.apiCredentials,r=void 0===t?{}:t,n=e.tracking,i=void 0===n?{}:n,a=db.useRef(null),o=function(){};if(null===a.current){var s=r.accessKey,u=r.secretKey,c=r.apiUrl,l=i.userId,d=hW({userId:l});a.current=bj(new NK(s,u,c,{httpHeaders:gx(gx({},pj),{},{"x-request-id":d})}),{onDone:o})}return{apiClient:a.current}}}),gj="BFnYsWrH",qj="KbKcY2nb",Aj=function(e){return e.split("").reverse().join("")},Ij=function(e){var t=e.url;return new Promise((function(e){var r=document.createElement("script");r.onload=e,r.src=t,document.head.appendChild(r)}))},Sj=window.fetch.bind(window);function Mj(e){var t,r,n=e.hasOwnProperty("words")?e.words:[],i=e.hasOwnProperty("sigBytes")?e.sigBytes:4*n.length,a=new Uint8Array(i),o=0;for(r=0;r<i;r++)t=n[r],a[o++]=t>>24,a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=255&t;return a}var kj=function(){var e=Mx(qx().mark((function e(){var t,r,n,i,a,o=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="".concat(Aj(gj)).concat(Aj(qj)),e.next=3,Sj.apply(void 0,o);case 3:return r=e.sent,e.next=6,r.text();case 6:return n=e.sent,i=sW.AES.decrypt(n,t),a=Mj(i),e.abrupt("return",{u8arr:a});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Cj=function(){var e=Mx(qx().mark((function e(){var t,r,n=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Sj.apply(void 0,n);case 2:return t=e.sent,e.next=5,t.text();case 5:return r=e.sent,e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),zj=Object.freeze({__proto__:null,reverseString:Aj,loadExternalScript:Ij,fetchWithDecryption:kj,fetchRawResource:Cj}),Zj=/\s/,wj=/^\s+/,xj=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Zj.test(e.charAt(t)););return t}(e)+1).replace(wj,""):e},Ej=/^[-+]0x[0-9a-f]+$/i,Oj=/^0b[01]+$/i,Kj=/^0o[0-7]+$/i,Wj=parseInt,Vj=function(e){return e?1/0===(e=function(e){if("number"==typeof e)return e;if(HO(e))return NaN;if(tE(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=tE(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=xj(e);var r=Oj.test(e);return r||Kj.test(e)?Wj(e.slice(2),r?2:8):Ej.test(e)?NaN:+e}(e))||-1/0===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},Tj=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=function(e){var t=Vj(e),r=t%1;return t==t?r?t-r:t:0}(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}},Lj=function(e){return Tj(2,e)},Nj=Lj(function(){var e=Mx(qx().mark((function e(){var t,r,n,i,a,o,s,u,c,l,d,p,f=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=f.length>0&&void 0!==f[0]?f[0]:{},r=t.tfUrl,n=void 0===r?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@3.20.0/dist/tf.min.js":r,i=t.tfBackendWasmUrl,a=void 0===i?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@3.20.0/dist/tf-backend-wasm.js":i,o=t.tfBackendCpuUrl,s=void 0===o?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-cpu@3.20.0":o,u=t.tfLiteUrl,c=void 0===u?"https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-tflite@0.0.1-alpha.8/dist/tf-tflite.min.js":u,l=t.blazefaceScriptUrl,d=void 0===l?"https://cdn.jsdelivr.net/npm/@tensorflow-models/blazeface@0.0.7":l,e.next=3,Ij({url:n});case 3:return p=[],a&&p.push(a),s&&p.push(s),d&&p.push(d),c&&p.push(c),e.next=10,Promise.all(p.map((function(e){return Ij({url:e})})));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());function Pj(){return(Pj=Mx(qx().mark((function e(){var t,r,n,i,a,o,s,u,c=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},r=t.preferredBackends,n=void 0===r?["wasm","cpu"]:r,!window.tv_model_backend_init||window.tv_model_backend_init[0]!==n[0]){e.next=3;break}return e.abrupt("return");case 3:return i=window,a=i.tf,e.next=6,a.enableProdMode();case 6:o=Wx(n),e.prev=7,o.s();case 9:if((s=o.n()).done){e.next=23;break}return u=s.value,e.prev=11,e.next=14,a.setBackend(u);case 14:return e.abrupt("break",23);case 17:if(e.prev=17,e.t0=e.catch(11),u!==n[n.length-1]){e.next=21;break}throw e.t0;case 21:e.next=9;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(7),o.e(e.t1);case 28:return e.prev=28,o.f(),e.finish(28);case 31:return e.next=33,a.ready();case 33:window.tv_model_backend_init=n;case 34:case"end":return e.stop()}}),e,null,[[7,25,28,31],[11,17]])})))).apply(this,arguments)}function jj(){return(jj=Mx(qx().mark((function e(t){var r,n,i,a;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.modelUrl,n=window,i=n.blazeface,!r){e.next=8;break}return e.next=5,i.load({modelUrl:r});case 5:a=e.sent,e.next=11;break;case 8:return e.next=10,i.load();case 10:a=e.sent;case 11:return e.abrupt("return",{blazefaceModel:a});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Rj(){return(Rj=Mx(qx().mark((function e(t){var r,n,i;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,e.next=3,Cj(r);case 3:return n=e.sent,i=n.rawData,e.abrupt("return",i);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xj(e){return Bj.apply(this,arguments)}function Bj(){return(Bj=Mx(qx().mark((function e(t){var r,n,i,a,o,s,u;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.modelUrl,n=t.options,i=void 0===n?{}:n,a=window,o=a.tflite,e.next=4,kj(r);case 4:return s=e.sent,u=s.u8arr,e.abrupt("return",o.loadTFLiteModel(u,gx({numThreads:1},i)));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Gj=Object.freeze({__proto__:null,loadTensorFlow:Nj,initTensorFlow:function(){return Pj.apply(this,arguments)},loadBlazefaceModel:function(e){return jj.apply(this,arguments)},preloadResource:function(e){return Rj.apply(this,arguments)},loadTFLiteModel:Xj}),Yj=Object.freeze({__proto__:null,enableAntiDebug:function(){var e,t,r=["action","gger","stateObject","apply","chain","test","input","Hello World!","constructor","counter","length","debu","call"];e=r,t=185,function(t){for(;--t;)e.push(e.shift())}(++t);var n,i,a=function(e,t){return r[e-=0]};function o(e){function t(e){if("string"==typeof e)return function(e){}[a("0x5")]("while (true) {}")[a("0x0")](a("0x6"));1!=="".concat(e/e)[a("0x7")]||e%20==0?function(){return!0}[a("0x5")]("".concat(a("0x8"),"gger"))[a("0x9")](a("0xa")):function(){return!1}.constructor("debu".concat(a("0xb")))[a("0x0")](a("0xc")),t(++e)}try{if(e)return t;t(0)}catch(e){}}setInterval((function(){o()}),4e3),n=!0,i=function(e,t){var r=n?function(){if(t){var r=t[a("0x0")](e,arguments);return t=null,r}}:function(){};return n=!1,r},function(){i(this,(function(){var e=new RegExp("function *\\( *\\)"),t=new RegExp("\\+\\+ *(?:_0x(?:[a-f0-9]){4,6}|(?:\\b|\\d)[a-z0-9]{1,4}(?:\\b|\\d))","i"),r=o("init");e.test(r+a("0x1"))&&t[a("0x2")](r+a("0x3"))?o():r("0")}))()}(),console.log(a("0x4"))}}),Hj=Object.freeze({__proto__:null,useThemeContext:function(){return db.useContext(aq)}});function Fj(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Uj(e,t){return e&t}function Dj(e,t){return e|t}function Jj(e,t){return e^t}function Qj(e,t){return e&~t}function _j(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function $j(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var eR,tR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rR(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=tR.charAt(r>>6)+tR.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=tR.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=tR.charAt(r>>2)+tR.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function nR(e){var t,r="",n=0,i=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var a=tR.indexOf(e.charAt(t));a<0||(0==n?(r+=Fj(a>>2),i=3&a,n=1):1==n?(r+=Fj(i<<2|a>>4),i=15&a,n=2):2==n?(r+=Fj(i),r+=Fj(a>>2),i=3&a,n=3):(r+=Fj(i<<2|a>>4),r+=Fj(15&a),n=0))}return 1==n&&(r+=Fj(i<<2)),r}var iR,aR={decode:function(e){var t;if(void 0===iR){var r="= \f\n\r\t \u2028\u2029";for(iR=Object.create(null),t=0;t<64;++t)iR["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(iR["-"]=62,iR._=63,t=0;t<r.length;++t)iR[r.charAt(t)]=-1}var n=[],i=0,a=0;for(t=0;t<e.length;++t){var o=e.charAt(t);if("="==o)break;if(-1!=(o=iR[o])){if(void 0===o)throw new Error("Illegal character at offset "+t);i|=o,++a>=4?(n[n.length]=i>>16,n[n.length]=i>>8&255,n[n.length]=255&i,i=0,a=0):i<<=6}}switch(a){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=i>>10;break;case 3:n[n.length]=i>>16,n[n.length]=i>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=aR.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return aR.decode(e)}},oR=1e13,sR=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var r,n,i=this.buf,a=i.length;for(r=0;r<a;++r)(n=i[r]*e+t)<oR?t=0:n-=(t=0|n/oR)*oR,i[r]=n;t>0&&(i[r]=t)},e.prototype.sub=function(e){var t,r,n=this.buf,i=n.length;for(t=0;t<i;++t)(r=n[t]-e)<0?(r+=oR,e=1):e=0,n[t]=r;for(;0===n[n.length-1];)n.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,r=t[t.length-1].toString(),n=t.length-2;n>=0;--n)r+=(oR+t[n]).toString().substring(1);return r},e.prototype.valueOf=function(){for(var e=this.buf,t=0,r=e.length-1;r>=0;--r)t=t*oR+e[r];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),uR=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,cR=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function lR(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var dR,pR=function(){function e(t,r){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=r)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,r){for(var n="",i=e;i<t;++i)if(n+=this.hexByte(this.get(i)),!0!==r)switch(15&i){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},e.prototype.isASCII=function(e,t){for(var r=e;r<t;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var r="",n=e;n<t;++n)r+=String.fromCharCode(this.get(n));return r},e.prototype.parseStringUTF=function(e,t){for(var r="",n=e;n<t;){var i=this.get(n++);r+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(n++)):String.fromCharCode((15&i)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},e.prototype.parseStringBMP=function(e,t){for(var r,n,i="",a=e;a<t;)r=this.get(a++),n=this.get(a++),i+=String.fromCharCode(r<<8|n);return i},e.prototype.parseTime=function(e,t,r){var n=this.parseStringISO(e,t),i=(r?uR:cR).exec(n);return i?(r&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),n=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(n+=":"+i[5],i[6]&&(n+=":"+i[6],i[7]&&(n+="."+i[7]))),i[8]&&(n+=" UTC","Z"!=i[8]&&(n+=i[8],i[9]&&(n+=":"+i[9]))),n):"Unrecognized time: "+n},e.prototype.parseInteger=function(e,t){for(var r,n=this.get(e),i=n>127,a=i?255:0,o="";n==a&&++e<t;)n=this.get(e);if(0==(r=t-e))return i?-1:0;if(r>4){for(o=n,r<<=3;0==(128&(+o^a));)o=+o<<1,--r;o="("+r+" bit)\n"}i&&(n-=256);for(var s=new sR(n),u=e+1;u<t;++u)s.mulAdd(256,this.get(u));return o+s.toString()},e.prototype.parseBitString=function(e,t,r){for(var n=this.get(e),i="("+((t-e-1<<3)-n)+" bit)\n",a="",o=e+1;o<t;++o){for(var s=this.get(o),u=o==t-1?n:0,c=7;c>=u;--c)a+=s>>c&1?"1":"0";if(a.length>r)return i+lR(a,r)}return i+a},e.prototype.parseOctetString=function(e,t,r){if(this.isASCII(e,t))return lR(this.parseStringISO(e,t),r);var n=t-e,i="("+n+" byte)\n";n>(r/=2)&&(t=e+r);for(var a=e;a<t;++a)i+=this.hexByte(this.get(a));return n>r&&(i+="…"),i},e.prototype.parseOID=function(e,t,r){for(var n="",i=new sR,a=0,o=e;o<t;++o){var s=this.get(o);if(i.mulAdd(128,127&s),a+=7,!(128&s)){if(""===n)if((i=i.simplify())instanceof sR)i.sub(80),n="2."+i.toString();else{var u=i<80?i<40?0:1:2;n=u+"."+(i-40*u)}else n+="."+i.toString();if(n.length>r)return lR(n,r);i=new sR,a=0}}return a>0&&(n+=".incomplete"),n},e}(),fR=function(){function e(e,t,r,n,i){if(!(n instanceof mR))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=r,this.tag=n,this.sub=i}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+r,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);case 6:return this.stream.parseOID(t,t+r,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return lR(this.stream.parseStringUTF(t,t+r),e);case 18:case 19:case 20:case 21:case 22:case 26:return lR(this.stream.parseStringISO(t,t+r),e);case 30:return lR(this.stream.parseStringBMP(t,t+r),e);case 23:case 24:return this.stream.parseTime(t,t+r,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var r=0,n=this.sub.length;r<n;++r)t+=this.sub[r].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),r=127&t;if(r==t)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===r)return null;t=0;for(var n=0;n<r;++n)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,r=2*this.length;return e.substr(t,r)},e.decode=function(t){var r;r=t instanceof pR?t:new pR(t,0);var n=new pR(r),i=new mR(r),a=e.decodeLength(r),o=r.pos,s=o-n.pos,u=null,c=function(){var t=[];if(null!==a){for(var n=o+a;r.pos<n;)t[t.length]=e.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var i=e.decode(r);if(i.tag.isEOC())break;t[t.length]=i}a=o-r.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(i.tagConstructed)u=c();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=c();for(var l=0;l<u.length;++l)if(u[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){u=null}if(null===u){if(null===a)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);r.pos=o+Math.abs(a)}return new e(n,s,a,i,u)},e}(),mR=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=0!=(32&t),this.tagNumber=31&t,31==this.tagNumber){var r=new sR;do{t=e.get(),r.mulAdd(128,127&t)}while(128&t);this.tagNumber=r.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),hR=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],vR=(1<<26)/hR[hR.length-1],bR=function(){function e(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this[o]>>s)>0&&(i=!0,a=Fj(r));o>=0;)s<t?(r=(this[o]&(1<<s)-1)<<t-s,r|=this[--o]>>(s+=this.DB-t)):(r=this[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=Fj(r));return i?a:"0"},e.prototype.negate=function(){var t=IR();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+xR(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var r=IR();return this.abs().divRemTo(t,null,r),this.s<0&&r.compareTo(e.ZERO)>0&&t.subTo(r,r),r},e.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new gR(t):new qR(t),this.exp(e,r)},e.prototype.clone=function(){var e=IR();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=IR();return this.bitwiseTo(e,Uj,t),t},e.prototype.or=function(e){var t=IR();return this.bitwiseTo(e,Dj,t),t},e.prototype.xor=function(e){var t=IR();return this.bitwiseTo(e,Jj,t),t},e.prototype.andNot=function(e){var t=IR();return this.bitwiseTo(e,Qj,t),t},e.prototype.not=function(){for(var e=IR(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=IR();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=IR();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+_j(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=$j(this[r]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,Dj)},e.prototype.clearBit=function(e){return this.changeBit(e,Qj)},e.prototype.flipBit=function(e){return this.changeBit(e,Jj)},e.prototype.add=function(e){var t=IR();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=IR();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=IR();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=IR();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=IR();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=IR(),r=IR();return this.divRemTo(e,t,r),[t,r]},e.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=wR(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new gR(t):t.isEven()?new AR(t):new qR(t);var o=[],s=3,u=r-1,c=(1<<r)-1;if(o[1]=n.convert(this),r>1){var l=IR();for(n.sqrTo(o[1],l);s<=c;)o[s]=IR(),n.mulTo(l,o[s-2],o[s]),s+=2}var d,p,f=e.t-1,m=!0,h=IR();for(i=xR(e[f])-1;f>=0;){for(i>=u?d=e[f]>>i-u&c:(d=(e[f]&(1<<i+1)-1)<<u-i,f>0&&(d|=e[f-1]>>this.DB+i-u)),s=r;0==(1&d);)d>>=1,--s;if((i-=s)<0&&(i+=this.DB,--f),m)o[d].copyTo(a),m=!1;else{for(;s>1;)n.sqrTo(a,h),n.sqrTo(h,a),s-=2;s>0?n.sqrTo(a,h):(p=a,a=h,h=p),n.mulTo(h,o[d],a)}for(;f>=0&&0==(e[f]&1<<i);)n.sqrTo(a,h),p=a,a=h,h=p,--i<0&&(i=this.DB-1,--f)}return n.revert(a)},e.prototype.modInverse=function(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return e.ZERO;for(var n=t.clone(),i=this.clone(),a=wR(1),o=wR(0),s=wR(0),u=wR(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(a.isEven()&&o.isEven()||(a.addTo(this,a),o.subTo(t,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),r?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(t,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(i)>=0?(n.subTo(i,n),r&&a.subTo(s,a),o.subTo(u,o)):(i.subTo(n,i),r&&s.subTo(a,s),u.subTo(o,u))}return 0!=i.compareTo(e.ONE)?e.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},e.prototype.pow=function(e){return this.exp(e,new yR)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},e.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=hR[hR.length-1]){for(t=0;t<hR.length;++t)if(r[0]==hR[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<hR.length;){for(var n=hR[t],i=t+1;i<hR.length&&n<vR;)n*=hR[i++];for(n=r.modInt(n);t<i;)if(n%hR[t++]==0)return!1}return r.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var i=t.length,a=!1,o=0;--i>=0;){var s=8==n?255&+t[i]:ZR(t,i);s<0?"-"==t.charAt(i)&&(a=!0):(a=!1,0==o?this[this.t++]=s:o+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=n)>=this.DB&&(o-=this.DB))}8==n&&0!=(128&+t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),a&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(e/this.DB),o=this.s<<r&this.DM,s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>n|o,o=(this[s]&i)<<r;for(s=a-1;s>=0;--s)t[s]=0;t[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t[0]=this[r]>>n;for(var o=r+1;o<this.t;++o)t[o-r-1]|=(this[o]&a)<<i,t[o-r]=this[o]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},e.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},e.prototype.multiplyTo=function(t,r){var n=this.abs(),i=t.abs(),a=n.t;for(r.t=a+i.t;--a>=0;)r[a]=0;for(a=0;a<i.t;++a)r[a+n.t]=n.am(0,i[a],r,a,0,n.t);r.s=0,r.clamp(),this.s!=t.s&&e.ZERO.subTo(r,r)},e.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,r,n){var i=t.abs();if(!(i.t<=0)){var a=this.abs();if(a.t<i.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=IR());var o=IR(),s=this.s,u=t.s,c=this.DB-xR(i[i.t-1]);c>0?(i.lShiftTo(c,o),a.lShiftTo(c,n)):(i.copyTo(o),a.copyTo(n));var l=o.t,d=o[l-1];if(0!=d){var p=d*(1<<this.F1)+(l>1?o[l-2]>>this.F2:0),f=this.FV/p,m=(1<<this.F1)/p,h=1<<this.F2,v=n.t,b=v-l,y=null==r?IR():r;for(o.dlShiftTo(b,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),e.ONE.dlShiftTo(l,y),y.subTo(o,o);o.t<l;)o[o.t++]=0;for(;--b>=0;){var g=n[--v]==d?this.DM:Math.floor(n[v]*f+(n[v-1]+h)*m);if((n[v]+=o.am(0,g,n,b,0,l))<g)for(o.dlShiftTo(b,y),n.subTo(y,n);n[v]<--g;)n.subTo(y,n)}null!=r&&(n.drShiftTo(l,r),s!=u&&e.ZERO.subTo(r,r)),n.t=l,n.clamp(),c>0&&n.rShiftTo(c,n),s<0&&e.ZERO.subTo(n,n)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,r){if(t>4294967295||t<1)return e.ONE;var n=IR(),i=IR(),a=r.convert(this),o=xR(t)-1;for(a.copyTo(n);--o>=0;)if(r.sqrTo(n,i),(t&1<<o)>0)r.mulTo(i,a,n);else{var s=n;n=i,i=s}return r.revert(n)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=wR(r),i=IR(),a=IR(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(e)+o},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),i=Math.pow(r,n),a=!1,o=0,s=0,u=0;u<t.length;++u){var c=ZR(t,u);c<0?"-"==t.charAt(u)&&0==this.signum()&&(a=!0):(s=r*s+c,++o>=n&&(this.dMultiply(i),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(r,o)),this.dAddOffset(s,0)),a&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,n){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),Dj,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var i=[],a=7&t;i.length=1+(t>>3),r.nextBytes(i),a>0?i[0]&=(1<<a)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},e.prototype.changeBit=function(t,r){var n=e.ONE.shiftLeft(t);return this.bitwiseTo(n,r,n),n},e.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()},e.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},e.prototype.millerRabin=function(t){var r=this.subtract(e.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var i=r.shiftRight(n);(t=t+1>>1)>hR.length&&(t=hR.length);for(var a=IR(),o=0;o<t;++o){a.fromInt(hR[Math.floor(Math.random()*hR.length)]);var s=a.modPow(i,this);if(0!=s.compareTo(e.ONE)&&0!=s.compareTo(r)){for(var u=1;u++<n&&0!=s.compareTo(r);)if(0==(s=s.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=s.compareTo(r))return!1}}return!0},e.prototype.square=function(){var e=IR();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var r=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(r.compareTo(n)<0){var i=r;r=n,n=i}var a=r.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)t(r);else{a<o&&(o=a),o>0&&(r.rShiftTo(o,r),n.rShiftTo(o,n));setTimeout((function e(){(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),(a=n.getLowestSetBit())>0&&n.rShiftTo(a,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(e,0):(o>0&&n.lShiftTo(o,n),setTimeout((function(){t(n)}),0))}),10)}},e.prototype.fromNumberAsync=function(t,r,n,i){if("number"==typeof r)if(t<2)this.fromInt(1);else{this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),Dj,this),this.isEven()&&this.dAddOffset(1,0);var a=this;setTimeout((function n(){a.dAddOffset(2,0),a.bitLength()>t&&a.subTo(e.ONE.shiftLeft(t-1),a),a.isProbablePrime(r)?setTimeout((function(){i()}),0):setTimeout(n,0)}),0)}else{var o=[],s=7&t;o.length=1+(t>>3),r.nextBytes(o),s>0?o[0]&=(1<<s)-1:o[0]=0,this.fromString(o,256)}},e}(),yR=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),gR=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),qR=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=IR();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(bR.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=IR();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),AR=function(){function e(e){this.m=e,this.r2=IR(),this.q3=IR(),bR.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=IR();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function IR(){return new bR(null)}function SR(e,t){return new bR(e,t)}var MR="undefined"!=typeof navigator;MR&&"Microsoft Internet Explorer"==navigator.appName?(bR.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this[e],c=this[e++]>>15,l=s*u+c*o;i=((u=o*u+((32767&l)<<15)+r[n]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),r[n++]=1073741823&u}return i},dR=30):MR&&"Netscape"!=navigator.appName?(bR.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this[e++]+r[n]+i;i=Math.floor(o/67108864),r[n++]=67108863&o}return i},dR=26):(bR.prototype.am=function(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var u=16383&this[e],c=this[e++]>>14,l=s*u+c*o;i=((u=o*u+((16383&l)<<14)+r[n]+i)>>28)+(l>>14)+s*c,r[n++]=268435455&u}return i},dR=28),bR.prototype.DB=dR,bR.prototype.DM=(1<<dR)-1,bR.prototype.DV=1<<dR,bR.prototype.FV=Math.pow(2,52),bR.prototype.F1=52-dR,bR.prototype.F2=2*dR-52;var kR,CR,zR=[];for(kR="0".charCodeAt(0),CR=0;CR<=9;++CR)zR[kR++]=CR;for(kR="a".charCodeAt(0),CR=10;CR<36;++CR)zR[kR++]=CR;for(kR="A".charCodeAt(0),CR=10;CR<36;++CR)zR[kR++]=CR;function ZR(e,t){var r=zR[e.charCodeAt(t)];return null==r?-1:r}function wR(e){var t=IR();return t.fromInt(e),t}function xR(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}bR.ZERO=wR(0),bR.ONE=wR(1);var ER,OR,KR=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}(),WR=null;if(null==WR){WR=[],OR=0;var VR=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var TR=new Uint32Array(256);for(window.crypto.getRandomValues(TR),VR=0;VR<TR.length;++VR)WR[OR++]=255&TR[VR]}var LR=0,NR=function e(t){if((LR=LR||0)>=256||OR>=256)window.removeEventListener?window.removeEventListener("mousemove",e,!1):window.detachEvent&&window.detachEvent("onmousemove",e);else try{var r=t.x+t.y;WR[OR++]=255&r,LR+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",NR,!1):window.attachEvent&&window.attachEvent("onmousemove",NR))}function PR(){if(null==ER){for(ER=new KR;OR<256;){var e=Math.floor(65536*Math.random());WR[OR++]=255&e}for(ER.init(WR),OR=0;OR<WR.length;++OR)WR[OR]=0;OR=0}return ER.next()}var jR=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=PR()},e}(),RR=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=SR(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=this.n.bitLength()+7>>3,r=function(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=e.length-1;n>=0&&t>0;){var i=e.charCodeAt(n--);i<128?r[--t]=i:i>127&&i<2048?(r[--t]=63&i|128,r[--t]=i>>6|192):(r[--t]=63&i|128,r[--t]=i>>6&63|128,r[--t]=i>>12|224)}r[--t]=0;for(var a=new jR,o=[];t>2;){for(o[0]=0;0==o[0];)a.nextBytes(o);r[--t]=o[0]}return r[--t]=2,r[--t]=0,new bR(r)}(e,t);if(null==r)return null;var n=this.doPublic(r);if(null==n)return null;for(var i=n.toString(16),a=i.length,o=0;o<2*t-a;o++)i="0"+i;return i},e.prototype.setPrivate=function(e,t,r){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=SR(e,16),this.e=parseInt(t,16),this.d=SR(r,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,r,n,i,a,o,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=SR(e,16),this.e=parseInt(t,16),this.d=SR(r,16),this.p=SR(n,16),this.q=SR(i,16),this.dmp1=SR(a,16),this.dmq1=SR(o,16),this.coeff=SR(s,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var r=new jR,n=e>>1;this.e=parseInt(t,16);for(var i=new bR(t,16);;){for(;this.p=new bR(e-n,1,r),0!=this.p.subtract(bR.ONE).gcd(i).compareTo(bR.ONE)||!this.p.isProbablePrime(10););for(;this.q=new bR(n,1,r),0!=this.q.subtract(bR.ONE).gcd(i).compareTo(bR.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var o=this.p.subtract(bR.ONE),s=this.q.subtract(bR.ONE),u=o.multiply(s);if(0==u.gcd(i).compareTo(bR.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(u),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=SR(e,16),r=this.doPrivate(t);return null==r?null:function(e,t){for(var r=e.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=t-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var a=255&r[n];a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((31&a)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&a)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}(r,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,r){var n=new jR,i=e>>1;this.e=parseInt(t,16);var a=new bR(t,16),o=this;setTimeout((function t(){var s=function(){if(o.p.compareTo(o.q)<=0){var e=o.p;o.p=o.q,o.q=e}var n=o.p.subtract(bR.ONE),i=o.q.subtract(bR.ONE),s=n.multiply(i);0==s.gcd(a).compareTo(bR.ONE)?(o.n=o.p.multiply(o.q),o.d=a.modInverse(s),o.dmp1=o.d.mod(n),o.dmq1=o.d.mod(i),o.coeff=o.q.modInverse(o.p),setTimeout((function(){r()}),0)):setTimeout(t,0)},u=function e(){o.q=IR(),o.q.fromNumberAsync(i,1,n,(function(){o.q.subtract(bR.ONE).gcda(a,(function(t){0==t.compareTo(bR.ONE)&&o.q.isProbablePrime(10)?setTimeout(s,0):setTimeout(e,0)}))}))};setTimeout((function t(){o.p=IR(),o.p.fromNumberAsync(e-i,1,n,(function(){o.p.subtract(bR.ONE).gcda(a,(function(e){0==e.compareTo(bR.ONE)&&o.p.isProbablePrime(10)?setTimeout(u,0):setTimeout(t,0)}))}))}),0)}),0)},e.prototype.sign=function(e,t,r){var n=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var r=t-e.length-6,n="",i=0;i<r;i+=2)n+="ff";return SR("0001"+n+"00"+e,16)}((XR[r]||"")+t(e).toString(),this.n.bitLength()/4);if(null==n)return null;var i=this.doPrivate(n);if(null==i)return null;var a=i.toString(16);return 0==(1&a.length)?a:"0"+a},e.prototype.verify=function(e,t,r){var n=SR(t,16),i=this.doPublic(n);return null==i?null:function(e){for(var t in XR)if(XR.hasOwnProperty(t)){var r=XR[t],n=r.length;if(e.substr(0,n)==r)return e.substr(n)}return e}
38
38
  /*!
39
39
  Copyright (c) 2011, Yahoo! Inc. All rights reserved.
40
40
  Code licensed under the BSD License:
@@ -49,7 +49,7 @@ function(e){var t=r,n=t.lib,i=n.WordArray,a=n.Hasher,o=t.algo,s=i.create([0,1,2,
49
49
  * @since jsrsasign 2.1
50
50
  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
51
51
  */
52
- var GR={};void 0!==GR.asn1&&GR.asn1||(GR.asn1={}),GR.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";t=new bR(n,16).xor(e).add(bR.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=GR.asn1,r=t.DERBoolean,n=t.DERInteger,i=t.DERBitString,a=t.DEROctetString,o=t.DERNull,s=t.DERObjectIdentifier,u=t.DEREnumerated,c=t.DERUTF8String,l=t.DERNumericString,d=t.DERPrintableString,p=t.DERTeletexString,f=t.DERIA5String,m=t.DERUTCTime,h=t.DERGeneralizedTime,v=t.DERSequence,b=t.DERSet,y=t.DERTaggedObject,g=t.ASN1Util.newObject,q=Object.keys(e);if(1!=q.length)throw"key of param shall be only one.";var A=q[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+A+":"))throw"undefined key: "+A;if("bool"==A)return new r(e[A]);if("int"==A)return new n(e[A]);if("bitstr"==A)return new i(e[A]);if("octstr"==A)return new a(e[A]);if("null"==A)return new o(e[A]);if("oid"==A)return new s(e[A]);if("enum"==A)return new u(e[A]);if("utf8str"==A)return new c(e[A]);if("numstr"==A)return new l(e[A]);if("prnstr"==A)return new d(e[A]);if("telstr"==A)return new p(e[A]);if("ia5str"==A)return new f(e[A]);if("utctime"==A)return new m(e[A]);if("gentime"==A)return new h(e[A]);if("seq"==A){for(var I=e[A],S=[],M=0;M<I.length;M++){var k=g(I[M]);S.push(k)}return new v({array:S})}if("set"==A){for(I=e[A],S=[],M=0;M<I.length;M++)k=g(I[M]),S.push(k);return new b({array:S})}if("tag"==A){var C=e[A];if("[object Array]"===Object.prototype.toString.call(C)&&3==C.length){var z=g(C[2]);return new y({tag:C[0],explicit:C[1],obj:z})}var Z={};if(void 0!==C.explicit&&(Z.explicit=C.explicit),void 0!==C.tag&&(Z.tag=C.tag),void 0===C.obj)throw"obj shall be specified for 'tag'.";return Z.obj=g(C.obj),new y(Z)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},GR.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<e.length;i+=2){var a=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);n+=a.substr(1,7),"0"==a.substr(0,1)&&(t=t+"."+new bR(n,2).toString(10),n="")}return t},GR.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new bR(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";for(n=a+n,o=0;o<n.length-1;o+=7){var s=n.substr(o,7);o!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=t(a),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);return n},GR.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},GR.asn1.DERAbstractString=function(e){GR.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))},BR.lang.extend(GR.asn1.DERAbstractString,GR.asn1.ASN1Object),GR.asn1.DERAbstractTime=function(e){GR.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,r){var n=this.zeroPadding,i=this.localDateToUTC(e),a=String(i.getFullYear());"utc"==t&&(a=a.substr(2,2));var o=a+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var s=i.getMilliseconds();if(0!=s){var u=n(String(s),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,r,n,i,a){var o=new Date(Date.UTC(e,t-1,r,n,i,a,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},BR.lang.extend(GR.asn1.DERAbstractTime,GR.asn1.ASN1Object),GR.asn1.DERAbstractStructured=function(e){GR.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)},BR.lang.extend(GR.asn1.DERAbstractStructured,GR.asn1.ASN1Object),GR.asn1.DERBoolean=function(){GR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},BR.lang.extend(GR.asn1.DERBoolean,GR.asn1.ASN1Object),GR.asn1.DERInteger=function(e){GR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=GR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bR(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},BR.lang.extend(GR.asn1.DERInteger,GR.asn1.ASN1Object),GR.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=GR.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}GR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var i=e.substr(r,8),a=parseInt(i,2).toString(16);1==a.length&&(a="0"+a),n+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},BR.lang.extend(GR.asn1.DERBitString,GR.asn1.ASN1Object),GR.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=GR.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}GR.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},BR.lang.extend(GR.asn1.DEROctetString,GR.asn1.DERAbstractString),GR.asn1.DERNull=function(){GR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},BR.lang.extend(GR.asn1.DERNull,GR.asn1.ASN1Object),GR.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new bR(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";for(n=a+n,o=0;o<n.length-1;o+=7){var s=n.substr(o,7);o!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};GR.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="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=t(a),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var t=GR.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},BR.lang.extend(GR.asn1.DERObjectIdentifier,GR.asn1.ASN1Object),GR.asn1.DEREnumerated=function(e){GR.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=GR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bR(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},BR.lang.extend(GR.asn1.DEREnumerated,GR.asn1.ASN1Object),GR.asn1.DERUTF8String=function(e){GR.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},BR.lang.extend(GR.asn1.DERUTF8String,GR.asn1.DERAbstractString),GR.asn1.DERNumericString=function(e){GR.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},BR.lang.extend(GR.asn1.DERNumericString,GR.asn1.DERAbstractString),GR.asn1.DERPrintableString=function(e){GR.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},BR.lang.extend(GR.asn1.DERPrintableString,GR.asn1.DERAbstractString),GR.asn1.DERTeletexString=function(e){GR.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},BR.lang.extend(GR.asn1.DERTeletexString,GR.asn1.DERAbstractString),GR.asn1.DERIA5String=function(e){GR.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},BR.lang.extend(GR.asn1.DERIA5String,GR.asn1.DERAbstractString),GR.asn1.DERUTCTime=function(e){GR.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))},BR.lang.extend(GR.asn1.DERUTCTime,GR.asn1.DERAbstractTime),GR.asn1.DERGeneralizedTime=function(e){GR.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))},BR.lang.extend(GR.asn1.DERGeneralizedTime,GR.asn1.DERAbstractTime),GR.asn1.DERSequence=function(e){GR.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},BR.lang.extend(GR.asn1.DERSequence,GR.asn1.DERAbstractStructured),GR.asn1.DERSet=function(e){GR.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},BR.lang.extend(GR.asn1.DERSet,GR.asn1.DERAbstractStructured),GR.asn1.DERTaggedObject=function(e){GR.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},BR.lang.extend(GR.asn1.DERTaggedObject,GR.asn1.ASN1Object);var YR,HR=(YR=function(e,t){return(YR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}YR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),FR=function(e){function t(r){var n=e.call(this)||this;return r&&("string"==typeof r?n.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&n.parsePropertiesFrom(r)),n}return HR(t,e),t.prototype.parseKey=function(e){try{var t=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?function(e){var t;if(void 0===eR){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(eR={},t=0;t<16;++t)eR[r.charAt(t)]=t;for(r=r.toLowerCase(),t=10;t<16;++t)eR[r.charAt(t)]=t;for(t=0;t<n.length;++t)eR[n.charAt(t)]=-1}var i=[],a=0,o=0;for(t=0;t<e.length;++t){var s=e.charAt(t);if("="==s)break;if(-1!=(s=eR[s])){if(void 0===s)throw new Error("Illegal character at offset "+t);a|=s,++o>=2?(i[i.length]=a,a=0,o=0):a<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return i}(e):aR.unarmor(e),i=fR.decode(n);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=SR(t,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var a=i.sub[3].getHexStringValue();this.d=SR(a,16);var o=i.sub[4].getHexStringValue();this.p=SR(o,16);var s=i.sub[5].getHexStringValue();this.q=SR(s,16);var u=i.sub[6].getHexStringValue();this.dmp1=SR(u,16);var c=i.sub[7].getHexStringValue();this.dmq1=SR(c,16);var l=i.sub[8].getHexStringValue();this.coeff=SR(l,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var d=i.sub[1].sub[0];t=d.sub[0].getHexStringValue(),this.n=SR(t,16),r=d.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=i.sub[0].getHexStringValue(),this.n=SR(t,16),r=i.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new GR.asn1.DERInteger({int:0}),new GR.asn1.DERInteger({bigint:this.n}),new GR.asn1.DERInteger({int:this.e}),new GR.asn1.DERInteger({bigint:this.d}),new GR.asn1.DERInteger({bigint:this.p}),new GR.asn1.DERInteger({bigint:this.q}),new GR.asn1.DERInteger({bigint:this.dmp1}),new GR.asn1.DERInteger({bigint:this.dmq1}),new GR.asn1.DERInteger({bigint:this.coeff})]};return new GR.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return rR(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new GR.asn1.DERSequence({array:[new GR.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new GR.asn1.DERNull]}),t=new GR.asn1.DERSequence({array:[new GR.asn1.DERInteger({bigint:this.n}),new GR.asn1.DERInteger({int:this.e})]}),r=new GR.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new GR.asn1.DERSequence({array:[e,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return rR(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return(e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return(e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(RR),UR=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 FR(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(nR(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return rR(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,t,r){try{return rR(this.getKey().sign(e,t,r))}catch(e){return!1}},e.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,nR(t),r)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new FR,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}(),DR=["-","-","-","-","-","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","-","-","-","-","-"];function JR(e){return QR.apply(this,arguments)}function QR(){return(QR=Mx(qx().mark((function e(t){var r,n,i;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.key,n=new TextEncoder,(i=n.encode(r)).reverse(),e.abrupt("return",crypto.subtle.digest("SHA-256",i));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _R(e){return Ex(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}var $R=function(e){var t=e.base64,r=e.key;return new Promise((function(e){JR({key:r}).then((function(r){var n=function(e){return Uint8Array.from(atob(e),(function(e){return e.charCodeAt(0)})).buffer}(t);window.crypto.subtle.importKey("raw",r,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(t){e({hex:_R(t)})}))}))})).catch((function(t){console.error("EncryptBase64 error: ",t),e(t)}))}))},eX=function(e){var t=new UR,r=DR.join("");return t.setPublicKey(r),nR(t.encrypt(e))},tX=function(e,t){return new Promise((function(r){var n=(new TextEncoder).encode(e);window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(e){r({hex:_R(e)})})).catch((function(t){console.error("EncryptString error: ",t),r(e)}))}))};function rX(e,t){return nX.apply(this,arguments)}function nX(){return(nX=Mx(qx().mark((function e(t,r){var n,i,a;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.slice(0,16),i=r.slice(-16),(a=new Uint8Array(32)).set(new Uint8Array(n),0),a.set(new Uint8Array(i),n.byteLength),e.abrupt("return",window.crypto.subtle.importKey("raw",a,"AES-GCM",!0,["encrypt","decrypt"]));case 9:return e.prev=9,e.t0=e.catch(0),console.error("combineKeys error: ",e.t0),e.abrupt("return",null);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}var iX,aX,oX,sX=Object.freeze({__proto__:null,processKey:JR,encryptBase64:$R,encrypt:function(e){var t=e.blob,r=e.key;return new Promise((function(e){var n=new FileReader;n.onload=function(t){var n=t.target.result;JR({key:r}).then((function(t){window.crypto.subtle.importKey("raw",t,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(t){e({hex:_R(t)})}))}))}))},n.readAsArrayBuffer(t)}))},encryptWithRSAPublicKey:eX,encryptString:tX,combineKeys:rX}),uX=function(){var e=Mx(qx().mark((function e(t,r){var n,i,a,o,s,u,c,l,d;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",new Promise((function(e){return e(null)})));case 2:return e.prev=2,e.next=5,JR({key:r});case 5:return n=e.sent,e.next=8,window.crypto.subtle.importKey("raw",n,"AES-GCM",!0,["encrypt","decrypt"]);case 8:return i=e.sent,e.next=11,window.crypto.subtle.exportKey("raw",i);case 11:return a=e.sent,o=YK().replace(/-/g,""),s=new TextEncoder,u=s.encode(o),e.next=17,rX(a,u);case 17:return c=e.sent,e.next=20,tX(t,c);case 20:return l=e.sent,e.next=23,eX(o);case 23:return d=e.sent,e.abrupt("return","".concat(l.hex,"::").concat(d));case 27:return e.prev=27,e.t0=e.catch(2),console.error("encryptFrameMetadata error: ",e.t0),e.abrupt("return",t);case 31:case"end":return e.stop()}}),e,null,[[2,27]])})));return function(t,r){return e.apply(this,arguments)}}(),cX=Object.freeze({__proto__:null,encryptFrameBase64:function(e,t){return new Promise(e?function(r){$R({base64:e,key:t}).then((function(e){r(e.hex)})).catch((function(t){console.error("encryptFrameBase64 error: ",t),r(e)}))}:function(e){return e(null)})},encryptFrameMetadata:uX}),lX=zx((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;kx(this,e),this.interval=t,this.second=0,this.timeStone={origin:0},this.callbacks={}}),[{key:"duration",value:function(e){return Object.prototype.hasOwnProperty.call(this.timeStone,e)?this.second-this.timeStone[e]:-1}},{key:"start",value:function(e,t){var r=this;e||this.timerID||(this.callbacks.origin=t,this.timerID=setInterval((function(){r.second++,Object.keys(r.timeStone).map((function(e){return"function"==typeof r.callbacks[e]&&r.callbacks[e](r.duration(e)),0}))}),this.interval)),Object.prototype.hasOwnProperty.call(this.timeStone,e)||e&&(this.timeStone[e]=this.second,this.callbacks[e]=t)}},{key:"stop",value:function(){clearInterval(this.timerID),this.timerID=void 0,this.second=0,this.timeStone={origin:0},this.callbacks={}}}]),dX=Xx((function(e,t){!function(){var r={};function n(e){return d(">"+f("B",e.length),e)}function i(e){return d(">"+f("H",e.length),e)}function a(e){return d(">"+f("L",e.length),e)}function o(e,t,r){var o,s,u,c,l="",p="";if("Byte"==t)(o=e.length)<=4?p=n(e)+f("\0",4-o):(p=d(">L",[r]),l=n(e));else if("Short"==t)(o=e.length)<=2?p=i(e)+f("\0\0",2-o):(p=d(">L",[r]),l=i(e));else if("Long"==t)(o=e.length)<=1?p=a(e):(p=d(">L",[r]),l=a(e));else if("Ascii"==t)(o=(s=e+"\0").length)>4?(p=d(">L",[r]),l=s):p=s+f("\0",4-o);else if("Rational"==t){if("number"==typeof e[0])o=1,u=e[0],c=e[1],s=d(">L",[u])+d(">L",[c]);else{o=e.length,s="";for(var m=0;m<o;m++)u=e[m][0],c=e[m][1],s+=d(">L",[u])+d(">L",[c])}p=d(">L",[r]),l=s}else if("SRational"==t){if("number"==typeof e[0])o=1,u=e[0],c=e[1],s=d(">l",[u])+d(">l",[c]);else for(o=e.length,s="",m=0;m<o;m++)u=e[m][0],c=e[m][1],s+=d(">l",[u])+d(">l",[c]);p=d(">L",[r]),l=s}else"Undefined"==t&&((o=e.length)>4?(p=d(">L",[r]),l=e):p=e+f("\0",4-o));return[d(">L",[o]),p,l]}function s(e,t,r){var n,i=Object.keys(e).length,a=d(">H",[i]);n=["0th","1st"].indexOf(t)>-1?2+12*i+4:2+12*i;var s="",u="";for(var c in e)if("string"==typeof c&&(c=parseInt(c)),!("0th"==t&&[34665,34853].indexOf(c)>-1||"Exif"==t&&40965==c||"1st"==t&&[513,514].indexOf(c)>-1)){var l=e[c],p=d(">H",[c]),f=v[t][c].type,m=d(">H",[h[f]]);"number"==typeof l&&(l=[l]);var b=o(l,f,8+n+r+u.length);s+=p+m+b[0]+b[1],u+=b[2]}return[a+s,u]}function u(e){var t;if("ÿØ"==e.slice(0,2))t=function(e){for(var t,r=0;r<e.length;r++)if("ÿá"==(t=e[r]).slice(0,2)&&"Exif\0\0"==t.slice(4,10))return t;return null}(m(e)),this.tiftag=t?t.slice(10):null;else if(["II","MM"].indexOf(e.slice(0,2))>-1)this.tiftag=e;else{if("Exif"!=e.slice(0,4))throw new Error("Given file is neither JPEG nor TIFF.");this.tiftag=e.slice(6)}}if(r.version="1.0.4",r.remove=function(e){var t=!1;if("ÿØ"==e.slice(0,2));else{if("data:image/jpeg;base64,"!=e.slice(0,23)&&"data:image/jpg;base64,"!=e.slice(0,22))throw new Error("Given data is not jpeg.");e=l(e.split(",")[1]),t=!0}var r=m(e).filter((function(e){return!("ÿá"==e.slice(0,2)&&"Exif\0\0"==e.slice(4,10))})).join("");return t&&(r="data:image/jpeg;base64,"+c(r)),r},r.insert=function(e,t){var r=!1;if("Exif\0\0"!=e.slice(0,6))throw new Error("Given data is not exif.");if("ÿØ"==t.slice(0,2));else{if("data:image/jpeg;base64,"!=t.slice(0,23)&&"data:image/jpg;base64,"!=t.slice(0,22))throw new Error("Given data is not jpeg.");t=l(t.split(",")[1]),r=!0}var n="ÿá"+d(">H",[e.length+2])+e,i=function(e,t){var r=!1,n=[];return e.forEach((function(i,a){"ÿá"==i.slice(0,2)&&"Exif\0\0"==i.slice(4,10)&&(r?n.unshift(a):(e[a]=t,r=!0))})),n.forEach((function(t){e.splice(t,1)})),!r&&t&&(e=[e[0],t].concat(e.slice(1))),e.join("")}(m(t),n);return r&&(i="data:image/jpeg;base64,"+c(i)),i},r.load=function(e){var t;if("string"!=typeof e)throw new Error("'load' gots invalid type argument.");if("ÿØ"==e.slice(0,2))t=e;else if("data:image/jpeg;base64,"==e.slice(0,23)||"data:image/jpg;base64,"==e.slice(0,22))t=l(e.split(",")[1]);else{if("Exif"!=e.slice(0,4))throw new Error("'load' gots invalid file data.");t=e.slice(6)}var r={"0th":{},Exif:{},GPS:{},Interop:{},"1st":{},thumbnail:null},n=new u(t);if(null===n.tiftag)return r;"II"==n.tiftag.slice(0,2)?n.endian_mark="<":n.endian_mark=">";var i=p(n.endian_mark+"L",n.tiftag.slice(4,8))[0];r["0th"]=n.get_ifd(i,"0th");var a=r["0th"].first_ifd_pointer;if(delete r["0th"].first_ifd_pointer,34665 in r["0th"]&&(i=r["0th"][34665],r.Exif=n.get_ifd(i,"Exif")),34853 in r["0th"]&&(i=r["0th"][34853],r.GPS=n.get_ifd(i,"GPS")),40965 in r.Exif&&(i=r.Exif[40965],r.Interop=n.get_ifd(i,"Interop")),"\0\0\0\0"!=a&&(i=p(n.endian_mark+"L",a)[0],r["1st"]=n.get_ifd(i,"1st"),513 in r["1st"]&&514 in r["1st"])){var o=r["1st"][513]+r["1st"][514],s=n.tiftag.slice(r["1st"][513],o);r.thumbnail=s}return r},r.dump=function(e){var t,n,i,a,o,u,c=(t=e,JSON.parse(JSON.stringify(t))),l=!1,p=!1,f=!1,v=!1;n="0th"in c?c["0th"]:{},"Exif"in c&&Object.keys(c.Exif).length||"Interop"in c&&Object.keys(c.Interop).length?(n[34665]=1,l=!0,i=c.Exif,"Interop"in c&&Object.keys(c.Interop).length?(i[40965]=1,f=!0,a=c.Interop):Object.keys(i).indexOf(r.ExifIFD.InteroperabilityTag.toString())>-1&&delete i[40965]):Object.keys(n).indexOf(r.ImageIFD.ExifTag.toString())>-1&&delete n[34665],"GPS"in c&&Object.keys(c.GPS).length?(n[r.ImageIFD.GPSTag]=1,p=!0,o=c.GPS):Object.keys(n).indexOf(r.ImageIFD.GPSTag.toString())>-1&&delete n[r.ImageIFD.GPSTag],"1st"in c&&"thumbnail"in c&&null!=c.thumbnail&&(v=!0,c["1st"][513]=1,c["1st"][514]=1,u=c["1st"]);var b,y,g,q=s(n,"0th",0),A=q[0].length+12*l+12*p+4+q[1].length,I="",S=0,M="",k=0,C="",z=0,Z="";if(l&&(S=(b=s(i,"Exif",A))[0].length+12*f+b[1].length),p&&(k=(M=s(o,"GPS",A+S).join("")).length),f&&(z=(C=s(a,"Interop",A+S+k).join("")).length),v&&(y=s(u,"1st",A+S+k+z),(g=function(e){for(var t=m(e);"ÿà"<=t[1].slice(0,2)&&t[1].slice(0,2)<="ÿï";)t=[t[0]].concat(t.slice(2));return t.join("")}(c.thumbnail)).length>64e3))throw new Error("Given thumbnail is too large. max 64kB");var w="",x="",E="",O="\0\0\0\0";if(l){var K=d(">L",[W=8+A]);w=d(">H",[34665])+d(">H",[h.Long])+d(">L",[1])+K}if(p&&(K=d(">L",[W=8+A+S]),x=d(">H",[34853])+d(">H",[h.Long])+d(">L",[1])+K),f&&(K=d(">L",[W=8+A+S+k]),E=d(">H",[40965])+d(">H",[h.Long])+d(">L",[1])+K),v){var W;O=d(">L",[W=8+A+S+k+z]);var V="\0\0\0\0"+d(">L",[W+y[0].length+24+4+y[1].length]),T="\0\0\0\0"+d(">L",[g.length]);Z=y[0]+V+T+"\0\0\0\0"+y[1]+g}var L=q[0]+w+x+O+q[1];return l&&(I=b[0]+E+b[1]),"Exif\0\0MM\0*\0\0\0\b"+L+I+M+C+Z},u.prototype={get_ifd:function(e,t){var r,n={},i=p(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],a=e+2;r=["0th","1st"].indexOf(t)>-1?"Image":t;for(var o=0;o<i;o++){e=a+12*o;var s=p(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],u=[p(this.endian_mark+"H",this.tiftag.slice(e+2,e+4))[0],p(this.endian_mark+"L",this.tiftag.slice(e+4,e+8))[0],this.tiftag.slice(e+8,e+12)];s in v[r]&&(n[s]=this.convert_value(u))}return"0th"==t&&(e=a+12*i,n.first_ifd_pointer=this.tiftag.slice(e,e+4)),n},convert_value:function(e){var t,r=null,n=e[0],i=e[1],a=e[2];if(1==n)i>4?(t=p(this.endian_mark+"L",a)[0],r=p(this.endian_mark+f("B",i),this.tiftag.slice(t,t+i))):r=p(this.endian_mark+f("B",i),a.slice(0,i));else if(2==n)i>4?(t=p(this.endian_mark+"L",a)[0],r=this.tiftag.slice(t,t+i-1)):r=a.slice(0,i-1);else if(3==n)i>2?(t=p(this.endian_mark+"L",a)[0],r=p(this.endian_mark+f("H",i),this.tiftag.slice(t,t+2*i))):r=p(this.endian_mark+f("H",i),a.slice(0,2*i));else if(4==n)i>1?(t=p(this.endian_mark+"L",a)[0],r=p(this.endian_mark+f("L",i),this.tiftag.slice(t,t+4*i))):r=p(this.endian_mark+f("L",i),a);else if(5==n)if(t=p(this.endian_mark+"L",a)[0],i>1){r=[];for(var o=0;o<i;o++)r.push([p(this.endian_mark+"L",this.tiftag.slice(t+8*o,t+4+8*o))[0],p(this.endian_mark+"L",this.tiftag.slice(t+4+8*o,t+8+8*o))[0]])}else r=[p(this.endian_mark+"L",this.tiftag.slice(t,t+4))[0],p(this.endian_mark+"L",this.tiftag.slice(t+4,t+8))[0]];else if(7==n)i>4?(t=p(this.endian_mark+"L",a)[0],r=this.tiftag.slice(t,t+i)):r=a.slice(0,i);else if(9==n)i>1?(t=p(this.endian_mark+"L",a)[0],r=p(this.endian_mark+f("l",i),this.tiftag.slice(t,t+4*i))):r=p(this.endian_mark+f("l",i),a);else{if(10!=n)throw new Error("Exif might be wrong. Got incorrect value type to decode. type:"+n);if(t=p(this.endian_mark+"L",a)[0],i>1)for(r=[],o=0;o<i;o++)r.push([p(this.endian_mark+"l",this.tiftag.slice(t+8*o,t+4+8*o))[0],p(this.endian_mark+"l",this.tiftag.slice(t+4+8*o,t+8+8*o))[0]]);else r=[p(this.endian_mark+"l",this.tiftag.slice(t,t+4))[0],p(this.endian_mark+"l",this.tiftag.slice(t+4,t+8))[0]]}return r instanceof Array&&1==r.length?r[0]:r}},"undefined"!=typeof window&&"function"==typeof window.btoa)var c=window.btoa;if(void 0===c&&(c=function(e){for(var t,r,n,i,a,o,s,u="",c=0,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";c<e.length;)i=(t=e.charCodeAt(c++))>>2,a=(3&t)<<4|(r=e.charCodeAt(c++))>>4,o=(15&r)<<2|(n=e.charCodeAt(c++))>>6,s=63&n,isNaN(r)?o=s=64:isNaN(n)&&(s=64),u=u+l.charAt(i)+l.charAt(a)+l.charAt(o)+l.charAt(s);return u}),"undefined"!=typeof window&&"function"==typeof window.atob)var l=window.atob;function d(e,t){if(!(t instanceof Array))throw new Error("'pack' error. Got invalid type argument.");if(e.length-1!=t.length)throw new Error("'pack' error. "+(e.length-1)+" marks, "+t.length+" elements.");var r;if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("");r=!1}for(var n="",i=1,a=null,o=null,s=null;o=e[i];){if("b"==o.toLowerCase()){if(a=t[i-1],"b"==o&&a<0&&(a+=256),a>255||a<0)throw new Error("'pack' error.");s=String.fromCharCode(a)}else if("H"==o){if((a=t[i-1])>65535||a<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(a%65536/256))+String.fromCharCode(a%256),r&&(s=s.split("").reverse().join(""))}else{if("l"!=o.toLowerCase())throw new Error("'pack' error.");if(a=t[i-1],"l"==o&&a<0&&(a+=4294967296),a>4294967295||a<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(a/16777216))+String.fromCharCode(Math.floor(a%16777216/65536))+String.fromCharCode(Math.floor(a%65536/256))+String.fromCharCode(a%256),r&&(s=s.split("").reverse().join(""))}n+=s,i+=1}return n}function p(e,t){if("string"!=typeof t)throw new Error("'unpack' error. Got invalid type argument.");for(var r,n=0,i=1;i<e.length;i++)if("b"==e[i].toLowerCase())n+=1;else if("h"==e[i].toLowerCase())n+=2;else{if("l"!=e[i].toLowerCase())throw new Error("'unpack' error. Got invalid mark.");n+=4}if(n!=t.length)throw new Error("'unpack' error. Mismatch between symbol and string length. "+n+":"+t.length);if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("'unpack' error.");r=!1}for(var a=[],o=0,s=1,u=null,c=null,l=null,d="";c=e[s];){if("b"==c.toLowerCase())l=1,u=(d=t.slice(o,o+l)).charCodeAt(0),"b"==c&&u>=128&&(u-=256);else if("H"==c)l=2,d=t.slice(o,o+l),r&&(d=d.split("").reverse().join("")),u=256*d.charCodeAt(0)+d.charCodeAt(1);else{if("l"!=c.toLowerCase())throw new Error("'unpack' error. "+c);l=4,d=t.slice(o,o+l),r&&(d=d.split("").reverse().join("")),u=16777216*d.charCodeAt(0)+65536*d.charCodeAt(1)+256*d.charCodeAt(2)+d.charCodeAt(3),"l"==c&&u>=2147483648&&(u-=4294967296)}a.push(u),o+=l,s+=1}return a}function f(e,t){for(var r="",n=0;n<t;n++)r+=e;return r}function m(e){if("ÿØ"!=e.slice(0,2))throw new Error("Given data isn't JPEG.");for(var t=2,r=["ÿØ"];;){if("ÿÚ"==e.slice(t,t+2)){r.push(e.slice(t));break}var n=t+p(">H",e.slice(t+2,t+4))[0]+2;if(r.push(e.slice(t,n)),(t=n)>=e.length)throw new Error("Wrong JPEG data.")}return r}void 0===l&&(l=function(e){var t,r,n,i,a,o,s="",u=0,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)t=c.indexOf(e.charAt(u++))<<2|(i=c.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(a=c.indexOf(e.charAt(u++)))>>2,n=(3&a)<<6|(o=c.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!=a&&(s+=String.fromCharCode(r)),64!=o&&(s+=String.fromCharCode(n));return s});var h={Byte:1,Ascii:2,Short:3,Long:4,Rational:5,Undefined:7,SLong:9,SRational:10},v={Image:{11:{name:"ProcessingSoftware",type:"Ascii"},254:{name:"NewSubfileType",type:"Long"},255:{name:"SubfileType",type:"Short"},256:{name:"ImageWidth",type:"Long"},257:{name:"ImageLength",type:"Long"},258:{name:"BitsPerSample",type:"Short"},259:{name:"Compression",type:"Short"},262:{name:"PhotometricInterpretation",type:"Short"},263:{name:"Threshholding",type:"Short"},264:{name:"CellWidth",type:"Short"},265:{name:"CellLength",type:"Short"},266:{name:"FillOrder",type:"Short"},269:{name:"DocumentName",type:"Ascii"},270:{name:"ImageDescription",type:"Ascii"},271:{name:"Make",type:"Ascii"},272:{name:"Model",type:"Ascii"},273:{name:"StripOffsets",type:"Long"},274:{name:"Orientation",type:"Short"},277:{name:"SamplesPerPixel",type:"Short"},278:{name:"RowsPerStrip",type:"Long"},279:{name:"StripByteCounts",type:"Long"},282:{name:"XResolution",type:"Rational"},283:{name:"YResolution",type:"Rational"},284:{name:"PlanarConfiguration",type:"Short"},290:{name:"GrayResponseUnit",type:"Short"},291:{name:"GrayResponseCurve",type:"Short"},292:{name:"T4Options",type:"Long"},293:{name:"T6Options",type:"Long"},296:{name:"ResolutionUnit",type:"Short"},301:{name:"TransferFunction",type:"Short"},305:{name:"Software",type:"Ascii"},306:{name:"DateTime",type:"Ascii"},315:{name:"Artist",type:"Ascii"},316:{name:"HostComputer",type:"Ascii"},317:{name:"Predictor",type:"Short"},318:{name:"WhitePoint",type:"Rational"},319:{name:"PrimaryChromaticities",type:"Rational"},320:{name:"ColorMap",type:"Short"},321:{name:"HalftoneHints",type:"Short"},322:{name:"TileWidth",type:"Short"},323:{name:"TileLength",type:"Short"},324:{name:"TileOffsets",type:"Short"},325:{name:"TileByteCounts",type:"Short"},330:{name:"SubIFDs",type:"Long"},332:{name:"InkSet",type:"Short"},333:{name:"InkNames",type:"Ascii"},334:{name:"NumberOfInks",type:"Short"},336:{name:"DotRange",type:"Byte"},337:{name:"TargetPrinter",type:"Ascii"},338:{name:"ExtraSamples",type:"Short"},339:{name:"SampleFormat",type:"Short"},340:{name:"SMinSampleValue",type:"Short"},341:{name:"SMaxSampleValue",type:"Short"},342:{name:"TransferRange",type:"Short"},343:{name:"ClipPath",type:"Byte"},344:{name:"XClipPathUnits",type:"Long"},345:{name:"YClipPathUnits",type:"Long"},346:{name:"Indexed",type:"Short"},347:{name:"JPEGTables",type:"Undefined"},351:{name:"OPIProxy",type:"Short"},512:{name:"JPEGProc",type:"Long"},513:{name:"JPEGInterchangeFormat",type:"Long"},514:{name:"JPEGInterchangeFormatLength",type:"Long"},515:{name:"JPEGRestartInterval",type:"Short"},517:{name:"JPEGLosslessPredictors",type:"Short"},518:{name:"JPEGPointTransforms",type:"Short"},519:{name:"JPEGQTables",type:"Long"},520:{name:"JPEGDCTables",type:"Long"},521:{name:"JPEGACTables",type:"Long"},529:{name:"YCbCrCoefficients",type:"Rational"},530:{name:"YCbCrSubSampling",type:"Short"},531:{name:"YCbCrPositioning",type:"Short"},532:{name:"ReferenceBlackWhite",type:"Rational"},700:{name:"XMLPacket",type:"Byte"},18246:{name:"Rating",type:"Short"},18249:{name:"RatingPercent",type:"Short"},32781:{name:"ImageID",type:"Ascii"},33421:{name:"CFARepeatPatternDim",type:"Short"},33422:{name:"CFAPattern",type:"Byte"},33423:{name:"BatteryLevel",type:"Rational"},33432:{name:"Copyright",type:"Ascii"},33434:{name:"ExposureTime",type:"Rational"},34377:{name:"ImageResources",type:"Byte"},34665:{name:"ExifTag",type:"Long"},34675:{name:"InterColorProfile",type:"Undefined"},34853:{name:"GPSTag",type:"Long"},34857:{name:"Interlace",type:"Short"},34858:{name:"TimeZoneOffset",type:"Long"},34859:{name:"SelfTimerMode",type:"Short"},37387:{name:"FlashEnergy",type:"Rational"},37388:{name:"SpatialFrequencyResponse",type:"Undefined"},37389:{name:"Noise",type:"Undefined"},37390:{name:"FocalPlaneXResolution",type:"Rational"},37391:{name:"FocalPlaneYResolution",type:"Rational"},37392:{name:"FocalPlaneResolutionUnit",type:"Short"},37393:{name:"ImageNumber",type:"Long"},37394:{name:"SecurityClassification",type:"Ascii"},37395:{name:"ImageHistory",type:"Ascii"},37397:{name:"ExposureIndex",type:"Rational"},37398:{name:"TIFFEPStandardID",type:"Byte"},37399:{name:"SensingMethod",type:"Short"},40091:{name:"XPTitle",type:"Byte"},40092:{name:"XPComment",type:"Byte"},40093:{name:"XPAuthor",type:"Byte"},40094:{name:"XPKeywords",type:"Byte"},40095:{name:"XPSubject",type:"Byte"},50341:{name:"PrintImageMatching",type:"Undefined"},50706:{name:"DNGVersion",type:"Byte"},50707:{name:"DNGBackwardVersion",type:"Byte"},50708:{name:"UniqueCameraModel",type:"Ascii"},50709:{name:"LocalizedCameraModel",type:"Byte"},50710:{name:"CFAPlaneColor",type:"Byte"},50711:{name:"CFALayout",type:"Short"},50712:{name:"LinearizationTable",type:"Short"},50713:{name:"BlackLevelRepeatDim",type:"Short"},50714:{name:"BlackLevel",type:"Rational"},50715:{name:"BlackLevelDeltaH",type:"SRational"},50716:{name:"BlackLevelDeltaV",type:"SRational"},50717:{name:"WhiteLevel",type:"Short"},50718:{name:"DefaultScale",type:"Rational"},50719:{name:"DefaultCropOrigin",type:"Short"},50720:{name:"DefaultCropSize",type:"Short"},50721:{name:"ColorMatrix1",type:"SRational"},50722:{name:"ColorMatrix2",type:"SRational"},50723:{name:"CameraCalibration1",type:"SRational"},50724:{name:"CameraCalibration2",type:"SRational"},50725:{name:"ReductionMatrix1",type:"SRational"},50726:{name:"ReductionMatrix2",type:"SRational"},50727:{name:"AnalogBalance",type:"Rational"},50728:{name:"AsShotNeutral",type:"Short"},50729:{name:"AsShotWhiteXY",type:"Rational"},50730:{name:"BaselineExposure",type:"SRational"},50731:{name:"BaselineNoise",type:"Rational"},50732:{name:"BaselineSharpness",type:"Rational"},50733:{name:"BayerGreenSplit",type:"Long"},50734:{name:"LinearResponseLimit",type:"Rational"},50735:{name:"CameraSerialNumber",type:"Ascii"},50736:{name:"LensInfo",type:"Rational"},50737:{name:"ChromaBlurRadius",type:"Rational"},50738:{name:"AntiAliasStrength",type:"Rational"},50739:{name:"ShadowScale",type:"SRational"},50740:{name:"DNGPrivateData",type:"Byte"},50741:{name:"MakerNoteSafety",type:"Short"},50778:{name:"CalibrationIlluminant1",type:"Short"},50779:{name:"CalibrationIlluminant2",type:"Short"},50780:{name:"BestQualityScale",type:"Rational"},50781:{name:"RawDataUniqueID",type:"Byte"},50827:{name:"OriginalRawFileName",type:"Byte"},50828:{name:"OriginalRawFileData",type:"Undefined"},50829:{name:"ActiveArea",type:"Short"},50830:{name:"MaskedAreas",type:"Short"},50831:{name:"AsShotICCProfile",type:"Undefined"},50832:{name:"AsShotPreProfileMatrix",type:"SRational"},50833:{name:"CurrentICCProfile",type:"Undefined"},50834:{name:"CurrentPreProfileMatrix",type:"SRational"},50879:{name:"ColorimetricReference",type:"Short"},50931:{name:"CameraCalibrationSignature",type:"Byte"},50932:{name:"ProfileCalibrationSignature",type:"Byte"},50934:{name:"AsShotProfileName",type:"Byte"},50935:{name:"NoiseReductionApplied",type:"Rational"},50936:{name:"ProfileName",type:"Byte"},50937:{name:"ProfileHueSatMapDims",type:"Long"},50938:{name:"ProfileHueSatMapData1",type:"Float"},50939:{name:"ProfileHueSatMapData2",type:"Float"},50940:{name:"ProfileToneCurve",type:"Float"},50941:{name:"ProfileEmbedPolicy",type:"Long"},50942:{name:"ProfileCopyright",type:"Byte"},50964:{name:"ForwardMatrix1",type:"SRational"},50965:{name:"ForwardMatrix2",type:"SRational"},50966:{name:"PreviewApplicationName",type:"Byte"},50967:{name:"PreviewApplicationVersion",type:"Byte"},50968:{name:"PreviewSettingsName",type:"Byte"},50969:{name:"PreviewSettingsDigest",type:"Byte"},50970:{name:"PreviewColorSpace",type:"Long"},50971:{name:"PreviewDateTime",type:"Ascii"},50972:{name:"RawImageDigest",type:"Undefined"},50973:{name:"OriginalRawFileDigest",type:"Undefined"},50974:{name:"SubTileBlockSize",type:"Long"},50975:{name:"RowInterleaveFactor",type:"Long"},50981:{name:"ProfileLookTableDims",type:"Long"},50982:{name:"ProfileLookTableData",type:"Float"},51008:{name:"OpcodeList1",type:"Undefined"},51009:{name:"OpcodeList2",type:"Undefined"},51022:{name:"OpcodeList3",type:"Undefined"}},Exif:{33434:{name:"ExposureTime",type:"Rational"},33437:{name:"FNumber",type:"Rational"},34850:{name:"ExposureProgram",type:"Short"},34852:{name:"SpectralSensitivity",type:"Ascii"},34855:{name:"ISOSpeedRatings",type:"Short"},34856:{name:"OECF",type:"Undefined"},34864:{name:"SensitivityType",type:"Short"},34865:{name:"StandardOutputSensitivity",type:"Long"},34866:{name:"RecommendedExposureIndex",type:"Long"},34867:{name:"ISOSpeed",type:"Long"},34868:{name:"ISOSpeedLatitudeyyy",type:"Long"},34869:{name:"ISOSpeedLatitudezzz",type:"Long"},36864:{name:"ExifVersion",type:"Undefined"},36867:{name:"DateTimeOriginal",type:"Ascii"},36868:{name:"DateTimeDigitized",type:"Ascii"},37121:{name:"ComponentsConfiguration",type:"Undefined"},37122:{name:"CompressedBitsPerPixel",type:"Rational"},37377:{name:"ShutterSpeedValue",type:"SRational"},37378:{name:"ApertureValue",type:"Rational"},37379:{name:"BrightnessValue",type:"SRational"},37380:{name:"ExposureBiasValue",type:"SRational"},37381:{name:"MaxApertureValue",type:"Rational"},37382:{name:"SubjectDistance",type:"Rational"},37383:{name:"MeteringMode",type:"Short"},37384:{name:"LightSource",type:"Short"},37385:{name:"Flash",type:"Short"},37386:{name:"FocalLength",type:"Rational"},37396:{name:"SubjectArea",type:"Short"},37500:{name:"MakerNote",type:"Undefined"},37510:{name:"UserComment",type:"Ascii"},37520:{name:"SubSecTime",type:"Ascii"},37521:{name:"SubSecTimeOriginal",type:"Ascii"},37522:{name:"SubSecTimeDigitized",type:"Ascii"},40960:{name:"FlashpixVersion",type:"Undefined"},40961:{name:"ColorSpace",type:"Short"},40962:{name:"PixelXDimension",type:"Long"},40963:{name:"PixelYDimension",type:"Long"},40964:{name:"RelatedSoundFile",type:"Ascii"},40965:{name:"InteroperabilityTag",type:"Long"},41483:{name:"FlashEnergy",type:"Rational"},41484:{name:"SpatialFrequencyResponse",type:"Undefined"},41486:{name:"FocalPlaneXResolution",type:"Rational"},41487:{name:"FocalPlaneYResolution",type:"Rational"},41488:{name:"FocalPlaneResolutionUnit",type:"Short"},41492:{name:"SubjectLocation",type:"Short"},41493:{name:"ExposureIndex",type:"Rational"},41495:{name:"SensingMethod",type:"Short"},41728:{name:"FileSource",type:"Undefined"},41729:{name:"SceneType",type:"Undefined"},41730:{name:"CFAPattern",type:"Undefined"},41985:{name:"CustomRendered",type:"Short"},41986:{name:"ExposureMode",type:"Short"},41987:{name:"WhiteBalance",type:"Short"},41988:{name:"DigitalZoomRatio",type:"Rational"},41989:{name:"FocalLengthIn35mmFilm",type:"Short"},41990:{name:"SceneCaptureType",type:"Short"},41991:{name:"GainControl",type:"Short"},41992:{name:"Contrast",type:"Short"},41993:{name:"Saturation",type:"Short"},41994:{name:"Sharpness",type:"Short"},41995:{name:"DeviceSettingDescription",type:"Undefined"},41996:{name:"SubjectDistanceRange",type:"Short"},42016:{name:"ImageUniqueID",type:"Ascii"},42032:{name:"CameraOwnerName",type:"Ascii"},42033:{name:"BodySerialNumber",type:"Ascii"},42034:{name:"LensSpecification",type:"Rational"},42035:{name:"LensMake",type:"Ascii"},42036:{name:"LensModel",type:"Ascii"},42037:{name:"LensSerialNumber",type:"Ascii"},42240:{name:"Gamma",type:"Rational"}},GPS:{0:{name:"GPSVersionID",type:"Byte"},1:{name:"GPSLatitudeRef",type:"Ascii"},2:{name:"GPSLatitude",type:"Rational"},3:{name:"GPSLongitudeRef",type:"Ascii"},4:{name:"GPSLongitude",type:"Rational"},5:{name:"GPSAltitudeRef",type:"Byte"},6:{name:"GPSAltitude",type:"Rational"},7:{name:"GPSTimeStamp",type:"Rational"},8:{name:"GPSSatellites",type:"Ascii"},9:{name:"GPSStatus",type:"Ascii"},10:{name:"GPSMeasureMode",type:"Ascii"},11:{name:"GPSDOP",type:"Rational"},12:{name:"GPSSpeedRef",type:"Ascii"},13:{name:"GPSSpeed",type:"Rational"},14:{name:"GPSTrackRef",type:"Ascii"},15:{name:"GPSTrack",type:"Rational"},16:{name:"GPSImgDirectionRef",type:"Ascii"},17:{name:"GPSImgDirection",type:"Rational"},18:{name:"GPSMapDatum",type:"Ascii"},19:{name:"GPSDestLatitudeRef",type:"Ascii"},20:{name:"GPSDestLatitude",type:"Rational"},21:{name:"GPSDestLongitudeRef",type:"Ascii"},22:{name:"GPSDestLongitude",type:"Rational"},23:{name:"GPSDestBearingRef",type:"Ascii"},24:{name:"GPSDestBearing",type:"Rational"},25:{name:"GPSDestDistanceRef",type:"Ascii"},26:{name:"GPSDestDistance",type:"Rational"},27:{name:"GPSProcessingMethod",type:"Undefined"},28:{name:"GPSAreaInformation",type:"Undefined"},29:{name:"GPSDateStamp",type:"Ascii"},30:{name:"GPSDifferential",type:"Short"},31:{name:"GPSHPositioningError",type:"Rational"}},Interop:{1:{name:"InteroperabilityIndex",type:"Ascii"}}};v["0th"]=v.Image,v["1st"]=v.Image,r.TAGS=v,r.ImageIFD={ProcessingSoftware:11,NewSubfileType:254,SubfileType:255,ImageWidth:256,ImageLength:257,BitsPerSample:258,Compression:259,PhotometricInterpretation:262,Threshholding:263,CellWidth:264,CellLength:265,FillOrder:266,DocumentName:269,ImageDescription:270,Make:271,Model:272,StripOffsets:273,Orientation:274,SamplesPerPixel:277,RowsPerStrip:278,StripByteCounts:279,XResolution:282,YResolution:283,PlanarConfiguration:284,GrayResponseUnit:290,GrayResponseCurve:291,T4Options:292,T6Options:293,ResolutionUnit:296,TransferFunction:301,Software:305,DateTime:306,Artist:315,HostComputer:316,Predictor:317,WhitePoint:318,PrimaryChromaticities:319,ColorMap:320,HalftoneHints:321,TileWidth:322,TileLength:323,TileOffsets:324,TileByteCounts:325,SubIFDs:330,InkSet:332,InkNames:333,NumberOfInks:334,DotRange:336,TargetPrinter:337,ExtraSamples:338,SampleFormat:339,SMinSampleValue:340,SMaxSampleValue:341,TransferRange:342,ClipPath:343,XClipPathUnits:344,YClipPathUnits:345,Indexed:346,JPEGTables:347,OPIProxy:351,JPEGProc:512,JPEGInterchangeFormat:513,JPEGInterchangeFormatLength:514,JPEGRestartInterval:515,JPEGLosslessPredictors:517,JPEGPointTransforms:518,JPEGQTables:519,JPEGDCTables:520,JPEGACTables:521,YCbCrCoefficients:529,YCbCrSubSampling:530,YCbCrPositioning:531,ReferenceBlackWhite:532,XMLPacket:700,Rating:18246,RatingPercent:18249,ImageID:32781,CFARepeatPatternDim:33421,CFAPattern:33422,BatteryLevel:33423,Copyright:33432,ExposureTime:33434,ImageResources:34377,ExifTag:34665,InterColorProfile:34675,GPSTag:34853,Interlace:34857,TimeZoneOffset:34858,SelfTimerMode:34859,FlashEnergy:37387,SpatialFrequencyResponse:37388,Noise:37389,FocalPlaneXResolution:37390,FocalPlaneYResolution:37391,FocalPlaneResolutionUnit:37392,ImageNumber:37393,SecurityClassification:37394,ImageHistory:37395,ExposureIndex:37397,TIFFEPStandardID:37398,SensingMethod:37399,XPTitle:40091,XPComment:40092,XPAuthor:40093,XPKeywords:40094,XPSubject:40095,PrintImageMatching:50341,DNGVersion:50706,DNGBackwardVersion:50707,UniqueCameraModel:50708,LocalizedCameraModel:50709,CFAPlaneColor:50710,CFALayout:50711,LinearizationTable:50712,BlackLevelRepeatDim:50713,BlackLevel:50714,BlackLevelDeltaH:50715,BlackLevelDeltaV:50716,WhiteLevel:50717,DefaultScale:50718,DefaultCropOrigin:50719,DefaultCropSize:50720,ColorMatrix1:50721,ColorMatrix2:50722,CameraCalibration1:50723,CameraCalibration2:50724,ReductionMatrix1:50725,ReductionMatrix2:50726,AnalogBalance:50727,AsShotNeutral:50728,AsShotWhiteXY:50729,BaselineExposure:50730,BaselineNoise:50731,BaselineSharpness:50732,BayerGreenSplit:50733,LinearResponseLimit:50734,CameraSerialNumber:50735,LensInfo:50736,ChromaBlurRadius:50737,AntiAliasStrength:50738,ShadowScale:50739,DNGPrivateData:50740,MakerNoteSafety:50741,CalibrationIlluminant1:50778,CalibrationIlluminant2:50779,BestQualityScale:50780,RawDataUniqueID:50781,OriginalRawFileName:50827,OriginalRawFileData:50828,ActiveArea:50829,MaskedAreas:50830,AsShotICCProfile:50831,AsShotPreProfileMatrix:50832,CurrentICCProfile:50833,CurrentPreProfileMatrix:50834,ColorimetricReference:50879,CameraCalibrationSignature:50931,ProfileCalibrationSignature:50932,AsShotProfileName:50934,NoiseReductionApplied:50935,ProfileName:50936,ProfileHueSatMapDims:50937,ProfileHueSatMapData1:50938,ProfileHueSatMapData2:50939,ProfileToneCurve:50940,ProfileEmbedPolicy:50941,ProfileCopyright:50942,ForwardMatrix1:50964,ForwardMatrix2:50965,PreviewApplicationName:50966,PreviewApplicationVersion:50967,PreviewSettingsName:50968,PreviewSettingsDigest:50969,PreviewColorSpace:50970,PreviewDateTime:50971,RawImageDigest:50972,OriginalRawFileDigest:50973,SubTileBlockSize:50974,RowInterleaveFactor:50975,ProfileLookTableDims:50981,ProfileLookTableData:50982,OpcodeList1:51008,OpcodeList2:51009,OpcodeList3:51022,NoiseProfile:51041},r.ExifIFD={ExposureTime:33434,FNumber:33437,ExposureProgram:34850,SpectralSensitivity:34852,ISOSpeedRatings:34855,OECF:34856,SensitivityType:34864,StandardOutputSensitivity:34865,RecommendedExposureIndex:34866,ISOSpeed:34867,ISOSpeedLatitudeyyy:34868,ISOSpeedLatitudezzz:34869,ExifVersion:36864,DateTimeOriginal:36867,DateTimeDigitized:36868,ComponentsConfiguration:37121,CompressedBitsPerPixel:37122,ShutterSpeedValue:37377,ApertureValue:37378,BrightnessValue:37379,ExposureBiasValue:37380,MaxApertureValue:37381,SubjectDistance:37382,MeteringMode:37383,LightSource:37384,Flash:37385,FocalLength:37386,SubjectArea:37396,MakerNote:37500,UserComment:37510,SubSecTime:37520,SubSecTimeOriginal:37521,SubSecTimeDigitized:37522,FlashpixVersion:40960,ColorSpace:40961,PixelXDimension:40962,PixelYDimension:40963,RelatedSoundFile:40964,InteroperabilityTag:40965,FlashEnergy:41483,SpatialFrequencyResponse:41484,FocalPlaneXResolution:41486,FocalPlaneYResolution:41487,FocalPlaneResolutionUnit:41488,SubjectLocation:41492,ExposureIndex:41493,SensingMethod:41495,FileSource:41728,SceneType:41729,CFAPattern:41730,CustomRendered:41985,ExposureMode:41986,WhiteBalance:41987,DigitalZoomRatio:41988,FocalLengthIn35mmFilm:41989,SceneCaptureType:41990,GainControl:41991,Contrast:41992,Saturation:41993,Sharpness:41994,DeviceSettingDescription:41995,SubjectDistanceRange:41996,ImageUniqueID:42016,CameraOwnerName:42032,BodySerialNumber:42033,LensSpecification:42034,LensMake:42035,LensModel:42036,LensSerialNumber:42037,Gamma:42240},r.GPSIFD={GPSVersionID:0,GPSLatitudeRef:1,GPSLatitude:2,GPSLongitudeRef:3,GPSLongitude:4,GPSAltitudeRef:5,GPSAltitude:6,GPSTimeStamp:7,GPSSatellites:8,GPSStatus:9,GPSMeasureMode:10,GPSDOP:11,GPSSpeedRef:12,GPSSpeed:13,GPSTrackRef:14,GPSTrack:15,GPSImgDirectionRef:16,GPSImgDirection:17,GPSMapDatum:18,GPSDestLatitudeRef:19,GPSDestLatitude:20,GPSDestLongitudeRef:21,GPSDestLongitude:22,GPSDestBearingRef:23,GPSDestBearing:24,GPSDestDistanceRef:25,GPSDestDistance:26,GPSProcessingMethod:27,GPSAreaInformation:28,GPSDateStamp:29,GPSDifferential:30,GPSHPositioningError:31},r.InteropIFD={InteroperabilityIndex:1},r.GPSHelper={degToDmsRational:function(e){var t=Math.abs(e),r=t%1*60,n=r%1*60;return[[Math.floor(t),1],[Math.floor(r),1],[Math.round(100*n),100]]},dmsRationalToDeg:function(e,t){var r="S"===t||"W"===t?-1:1;return(e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600)*r}},e.exports&&(t=e.exports=r),t.piexif=r}()})),pX=function(e,t,r){return null==e?e:function(e,t,r,n){if(!tE(e))return e;for(var i=-1,a=(t=iK(t,e)).length,o=a-1,s=e;null!=s&&++i<a;){var u=aK(t[i]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=o){var l=s[u];void 0===(c=n?n(l,u,s):void 0)&&(c=tE(l)?l:RE(t[i+1])?[]:{})}wE(s,u,c),s=s[u]}return e}(e,t,r)},fX={},mX={SELFIE:"selfie",ID_CARD:"id_card"},hX=Lj((function(e){var t=new UR,r=e||DR.join("");return t.setPublicKey(r),t})),vX=function(e){var t=e.gesture,r=e.captureTime,n=e.frames,i=e.blurScore,a=e.selfieLabel,o=e.brightnessScore,s=e.accelerometer,u=e.gyroscope;return{capture_time:r,type:t,frames:n,blur_score:i,selfie_label:a,qualify_score:e.qualifyScore,accelerometer:s,gyroscope:u,brightness_score:o}},bX=function(e){var t=e.detectedCard,r=e.captureTime,n=e.vCam,i=e.captureCount,a=e.captureDuration,o=e.captureType,s=e.cardTracking;return{capture_time:r,type:null==t?void 0:t.label,v_cam:n,capture_count:i,capture_duration:a,capture_type:o,card_tracking:s}},yX=function(){var e=Mx(qx().mark((function e(t,r){var n;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return Ex(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},e.abrupt("return",new Promise((function(e){var i=new TextEncoder,a=i.encode(t),o=i.encode(r);window.crypto.subtle.importKey("raw",o,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,a).then((function(t){e("".concat(oX,".").concat(n(t)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),gX=function(){var e=Mx(qx().mark((function e(t){var r,n,i,a,o,s,u,c,l;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.mode,i=t.imageData,t.enableExifData){e.next=3;break}return e.abrupt("return",new Promise((function(e){return e(i.blob)})));case 3:return a=gx(gx({},fX),n===mX.SELFIE?vX(i):bX(i)),o=gx(gx({},a),{},{sensor_data:"sensor data exceed 64KB"}),null!=i&&null!==(r=i.type)&&void 0!==r&&r.includes("qr")&&(a={capture_time:null==i?void 0:i.captureTime,type:null==i?void 0:i.type,qr_string:null==i?void 0:i.result}),e.next=8,yX(JSON.stringify(o),aX);case 8:return s=e.sent,e.next=11,yX(JSON.stringify(a),aX);case 11:return u=e.sent,c=dX.dump({Exif:Zx({},dX.ExifIFD.MakerNote,u)}),l=dX.dump({Exif:Zx({},dX.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var t=new FileReader;t.onload=function(){var t=Mx(qx().mark((function t(r){var n,a,o;return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{n=dX.insert(c,r.target.result)}catch(t){try{n=dX.insert(l,r.target.result)}catch(t){e(i.blob)}}return t.prev=1,t.next=4,fetch(n);case 4:return a=t.sent,t.next=7,a.blob();case 7:o=t.sent,URL.revokeObjectURL(n),e(o),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(1),e(i.blob);case 15:case"end":return t.stop()}}),t,null,[[1,12]])})));return function(e){return t.apply(this,arguments)}}(),t.readAsDataURL(i.blob)})));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),qX=Object.freeze({__proto__:null,MODE:mX,initExifData:function(){fX={device_info:{device_brand_name:"".concat("none"===UK.mobileVendor?"null":UK.mobileVendor),device_model:"".concat("none"===UK.mobileModel?"null":UK.mobileModel),browser_version:"".concat(UK.browserName," ").concat(UK.browserVersion),browser_userAgent:"".concat(UK.getUA),os:UK.osName,os_version:UK.osVersion},sdk_version:"5.23.1",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,t){pX(fX,e,t)},preWriteExif:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mode,r=(e.motionData,e.orientationData,e.startTime),n=e.endTime,i=e.exifKey,a=void 0===i?"":i;fX.user_action=gx({},t===mX.SELFIE?{start_selfie:r,end_selfie:n}:{start_id_card:r,end_id_card:n}),aX=YK().replace(/-/g,""),iX||(iX=hX(a)),oX=nR(iX.encrypt(aX))},writeExif:gX}),AX=function(e,t,r){(void 0!==r&&!Tx(e[t],r)||void 0===r&&!(t in e))&&zE(e,t,r)},IX=function(e,t,r){for(var n=-1,i=Object(e),a=r(e),o=a.length;o--;){var s=a[++n];if(!1===t(i[s],s,i))break}return e},SX=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},MX=function(e,t,r,n,i,a,o){var s=SX(e,r),u=SX(t,r),c=o.get(u);if(c)AX(e,r,c);else{var l=a?a(s,u,r+"",e,t,o):void 0,d=void 0===l;if(d){var p=LE(u),f=!p&&PE(u),m=!p&&!f&&FE(u);l=u,p||f||m?LE(s)?l=s:function(e){return EE(e)&&tO(e)}(s)?l=sO(s):f?(d=!1,l=oO(u,!0)):m?(d=!1,l=VO(u,!0)):l=[]:mK(u)||TE(u)?(l=s,TE(s)?l=function(e){return xE(e,aO(e))}(s):tE(s)&&!rE(s)||(l=PO(u))):d=!1}d&&(o.set(u,l),i(l,u,n,a,o),o.delete(u)),AX(e,r,l)}},kX=function e(t,r,n,i,a){t!==r&&IX(r,(function(o,s){if(a||(a=new kE),tE(o))MX(t,r,s,n,e,i,a);else{var u=i?i(SX(t,s),o,s+"",t,r,a):void 0;void 0===u&&(u=o),AX(t,s,u)}}),aO)},CX=function(e,t){return zK(IK(e,t,MK),e+"")},zX=function(e,t,r){if(!tE(r))return!1;var n=rv(t);return!!("number"==n?tO(r)&&RE(t,r.length):"string"==n&&t in r)&&Tx(r[t],e)},ZX=function(e){return CX((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&zX(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t}))},wX=ZX((function(e,t,r,n){kX(e,t,r,n)})),xX={enableGetClientSettings:!0,enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:!0,enableVerifySanityIDCard:!0,enableVerifyFaceLiveness:!0,enableDetectIDCardTampering:!0,enableReadIDCardInfo:!0,enableRegisterFace:!0,enableAuthenticateFace:!0},EX=Object.freeze({__proto__:null,getEnabledServices:function(e,t){var r=function(e){if(!e)return xX;var t=e.enableUploadFrames,r=e.enableUploadImages,n=void 0===r||r,i=e.enableGetClientSettings,a=n&&e.enableVerifySanityPortrait,o=n&&e.enableVerifySanityIDCard,s=n&&e.enableDetectIDCardTampering,u=n&&e.enableReadIDCardInfo;return{enableGetClientSettings:i,enableUploadFrames:t,enableUploadImages:n,enableVerifySanityPortrait:a,enableVerifySanityIDCard:o,enableVerifyFaceLiveness:n&&e.enableVerifyFaceLiveness,enableDetectIDCardTampering:s,enableReadIDCardInfo:u,enableRegisterFace:n&&e.enableRegisterFace,enableAuthenticateFace:n&&e.enableAuthenticateFace}}(e),n=function(e){return{enableGetClientSettings:!0,enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:sN(e,"data.settings.enable_verify_portrait_sanity",!0),enableVerifySanityIDCard:sN(e,"data.settings.enable_verify_id_card_sanity",!0),enableVerifyFaceLiveness:sN(e,"data.settings.enable_verify_face_liveness",!0),enableDetectIDCardTampering:sN(e,"data.settings.enable_detect_id_card_tampering",!0),enableReadIDCardInfo:sN(e,"data.settings.enable_read_id_card_info",!0),enableRegisterFace:sN(e,"data.settings.enable_face_registration",!0),enableAuthenticateFace:sN(e,"data.settings.enable_face_authentication",!0)}}(t),i=gx({},xX);return wX(i,r,n,(function(e,t){return(null==e||e)&&(null==t||t)}))}}),OX=function(e){var t=e.slice(0,2),r=e.slice(2,4),n=e.slice(4,8);return new Date("".concat(n,"-").concat(r,"-").concat(t))},KX=function(e){return!Number.isNaN(e.getTime())&&e<=new Date},WX={CCCD:{validate:function(e){var t=e.split("|"),r=OX(t[3]),n=OX(t[6]);return 7===t.length&&Boolean(e.match(/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g))&&KX(r)&&KX(n)&&r<n}},TCC:{validate:function(e){var t=e.split("|"),r=OX(t[3]),n=OX(t[6]);return 11===t.length&&Boolean(e.match(/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}/g))&&KX(r)&&KX(n)&&r<n}}},VX=Object.freeze({__proto__:null,validateIdQRContent:function(e){var t=function(e){var t=e[6];if(!t||8!==t.length)return null;var r=OX(t);return KX(r)?r>=new Date("2024-07-01")?WX.TCC:WX.CCCD:null}(e.split("|"));return t?{valid:t.validate(e)}:{valid:!1}}}),TX=function(e){return e===vx.ACTIVE?"active":e===vx.PASSIVE?"passive":"string"==typeof e&&e.startsWith("flash")?"flash":"active"},LX=Object.freeze({__proto__:null,getLivenessMode:TX}),NX="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",PX=function(){return zx((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NX,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.342,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:368,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;kx(this,e),this.model_path=t,this.threshold=r,this.size=Math.round(n/2),this.enable_profiling=i,this.num_threads=a}),[{key:"load",value:(t=Mx(qx().mark((function e(){var t,r,n,i=this;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,e.next=3,Xj({modelUrl:this.model_path,options:{numThreads:this.num_threads,enableProfiling:this.enable_profiling}});case 3:this.model=e.sent,n=this.model.inputs[0],this.input_width=n.shape[1],this.input_height=n.shape[2],r.tidy((function(){var e=r.randomNormal([1,i.input_width,i.input_height,3]);i.model.predict(e)}));case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"crop_eyes",value:function(e,t){var r=this,n=window.tf,i=t[0].map((function(e){return Math.round(e)})),a=t[1].map((function(e){return Math.round(e)}));i[0]>a[0]&&(i=t[1].map((function(e){return Math.round(e)})),a=t[0].map((function(e){return Math.round(e)})));var o=Math.round((i[0]+a[0])/2),s=o-i[0],u=a[0]-o;s>=this.size&&(s=this.size),u>=this.size&&(u=this.size);var c=Math.max(i[0]-s,0),l=Math.max(i[1]-s,0),d=Math.max(a[0]-u,0),p=Math.max(a[1]-u,0);return n.tidy((function(){var t=e.slice([l,c,0],[2*s,2*s,3]),i=e.slice([p,d,0],[2*u,2*u,3]);return{l_img:t=n.expandDims(n.image.resizeBilinear(t,[r.input_width,r.input_height])),r_img:i=n.expandDims(n.image.resizeBilinear(i,[r.input_width,r.input_height]))}}))}},{key:"predict",value:(e=Mx(qx().mark((function e(t,r){var n,i,a,o,s,u,c,l,d,p=this,f=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=f.length>2&&void 0!==f[2]?f[2]:this.threshold,i=window,a=i.tf,o=t.getContext("2d"),s=o.getImageData(0,0,t.height,t.width),u=a.tidy((function(){var e=a.browser.fromPixels(s),t=p.crop_eyes(e,r),i=t.l_img,o=t.r_img,u=p.model.predict(i).arraySync()[0],c=p.model.predict(o).arraySync()[0];return[u>n,c>n]})),c=xx(u,2),l=c[0],d=c[1],e.abrupt("return",{isEyeClose:l||d});case 6:case"end":return e.stop()}}),e,this)}))),function(t,r){return e.apply(this,arguments)})}]);var e,t}(),jX="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.1.0/libs/opencv-4.9.0.js",RX=Lj(function(){var e=Mx(qx().mark((function e(){var t,r,n,i=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:{},r=t.url,n=void 0===r?jX:r,e.abrupt("return",new Promise((function(e,t){try{if(window.cv)return void e();var r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("type","text/javascript"),r.setAttribute("id","opencvjs"),r.addEventListener("load",Mx(qx().mark((function t(){return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!window.cv||!window.cv.getBuildInformation){t.next=4;break}e(),t.next=12;break;case 4:if(!(window.cv instanceof Promise)){t.next=11;break}return t.next=7,window.cv;case 7:window.cv=t.sent,e(),t.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return t.stop()}}),t)})))),r.addEventListener("error",(function(){t()})),r.src=n;var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(r,i)}catch(e){console.error(e)}})));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),XX=zx((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.02,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:127.5,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.3855;kx(this,e),this.c1=t,this.c2=r,this.maxDiffThreshold=n}),[{key:"sigMoid",value:function(e){var t=window.cv;e.convertTo(e,t.CV_32FC3);var r=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(this.c2,this.c2,this.c2)),n=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(-this.c1,-this.c1,-this.c1)),i=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(1,1,1));return t.subtract(e,r,e),t.multiply(e,n,e),t.exp(e,e),t.add(e,i,e),t.divide(i,e,e),r.delete(),n.delete(),i.delete(),e}},{key:"faceResize",value:function(e,t){var r=window.cv,n=new r.Mat,i=e.rows<t.height?r.INTER_CUBIC:r.INTER_AREA;return r.resize(e,n,t,0,0,i),n}},{key:"checkValidFaceSide",value:function(e){return e.every((function(e){return!e.empty()}))}},{key:"divideFace",value:function(e,t){var r=window.cv;if(0===t.length)return[!1,[null,null,null,null,null]];var n=t[0],i=n[0],a=n[1],o=n[2],s=n[3],u=e.roi(new r.Rect(s,i,a-s,o-i)),c=e.roi(new r.Rect(s,i,(a-s)/2,(o-i)/2)),l=e.roi(new r.Rect(s,i+(o-i)/2,(a-s)/2,(o-i)/2)),d=e.roi(new r.Rect(s+(a-s)/2,i,(a-s)/2,(o-i)/2)),p=e.roi(new r.Rect((a+s)/2,(o+i)/2,(a-s)/2,(o-i)/2));if(!this.checkValidFaceSide([u,c,l,d,p]))return u.delete(),c.delete(),l.delete(),d.delete(),p.delete(),[!1,[null,null,null,null,null]];var f=this.faceResize(c,new r.Size(80,128)),m=this.faceResize(l,new r.Size(80,128)),h=this.faceResize(d,new r.Size(80,128)),v=this.faceResize(p,new r.Size(80,128)),b=this.faceResize(u,new r.Size(320,512));return u.delete(),c.delete(),l.delete(),d.delete(),p.delete(),[!0,[f,m,h,v,b]]}},{key:"measureBrightness",value:function(e,t){if("hls"!==t&&"arithmetic"!==t)return-1;var r=window.cv;if("arithmetic"===t){var n=this.sigMoid(e);r.multiply(n,n,n);var i=new r.MatVector;r.split(n,i);for(var a=i.get(0),o=1;o<i.size();o+=1){var s=i.get(o);r.add(a,s,a),s.delete()}r.sqrt(a,a);var u=new r.Mat(a.rows,a.cols,a.type(),new r.Scalar(Math.sqrt(3)));r.divide(a,u,a);var c=r.mean(a);return u.delete(),i.delete(),a.delete(),c[0]}if("hls"===t){var l=new r.Mat;r.cvtColor(e,l,r.COLOR_RGB2HLS);var d=new r.MatVector;r.split(l,d);var p=d.get(1);p=this.sigMoid(p);var f=r.mean(p);return l.delete(),d.delete(),p.delete(),f[0]}return-1}},{key:"predict",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"hls",n=null;try{var i=window,a=i.cv;n=a.imread(e);var o=this.divideFace(n,t),s=o[0],u=o[1],c=[],l=null;if(!s)return n.delete(),l;var d,p=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY,m=Wx(u);try{for(m.s();!(d=m.n()).done;){var h=d.value,v=this.measureBrightness(h,r);c.push(v),p=Math.max(p,v),f=Math.min(f,v),h.delete()}}catch(e){m.e(e)}finally{m.f()}var b=p-f;return l=b>this.maxDiffThreshold?f:c[c.length-1],n.delete(),l}catch(e){return n&&n.delete(),console.error(e),null}}},{key:"score",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,a=this.predict(e,t,i);return null===a?{score:1,message:"good"}:a<r?{score:a,message:"face_too_dark"}:a>n?{score:a,message:"face_too_bright"}:{score:a,message:"good"}}}],[{key:"hasBetterBrightnessScore",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||e-t>r}},{key:"hasSameBrightnessScore",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null!==t&&Math.abs(e-t)<r}},{key:"METHOD",get:function(){return{HLS:"hls",ARITHMETIC:"arithmetic"}}},{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.opencvUrl;return FW(this,void 0,void 0,qx().mark((function e(){return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,RX({url:t});case 2:case"end":return e.stop()}}),e)})))}},{key:"log",value:function(){var e=window.cv;console.log("build info",e.getBuildInformation())}}]),BX="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.2.0/models/qualify/qualify_model.tflite",GX=[.50612009,.42543493,.38282761],YX=[.26589054,.24521921,.24127836],HX=["normal","beard","mask_chin"],FX={0:"normal",1:"beard",2:"mask",3:"object",4:"mask_chin"},UX={beard:.3689,mask:.6337,mask_chin:.2315,object:.3942,normal:.5541};function DX(e,t,r){return Math.max(t,Math.min(e,r))}function JX(e){for(var t=0,r=1;r<e.length;r++)e[r]>e[t]&&(t=r);return t}var QX=function(){return zx((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:BX;kx(this,e),this.modelPath=t}),[{key:"init",value:(t=Mx(qx().mark((function e(){var t,r,n=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},r=t.opencvUrl,e.next=3,RX({url:r});case 3:return e.next=5,Xj({modelUrl:this.modelPath});case 5:this.model=e.sent;case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"normalize",value:function(e){var t=window.cv,r=255;e.convertTo(e,t.CV_32FC3);var n=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(r*GX[0],r*GX[1],r*GX[2])),i=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(r*YX[0],r*YX[1],r*YX[2]));return t.subtract(e,n,e),t.divide(e,i,e),n.delete(),i.delete(),e}},{key:"transform",value:function(e){var t=window.cv,r=new t.Mat;return t.resize(e,r,new t.Size(224,224)),e.delete(),this.normalize(r)}},{key:"forward",value:function(e){var t=window,r=t.tf,n=t.cv;n.cvtColor(e,e,n.COLOR_RGBA2RGB);var i=r.tensor(e.data32F,[e.rows,e.cols,e.channels()]);e.delete();var a=r.transpose(i,[2,0,1]),o=r.expandDims(a,0),s=this.model.predict(o);return i.dispose(),a.dispose(),o.dispose(),Array.from(s.dataSync())}},{key:"process",value:function(e){e=this.transform(e);var t=this.forward(e),r=Math.log(function(e){for(var t=0,r=0;r<e.length;r++)t+=e[r];return t}(function(e){for(var t=[],r=0;r<e.length;r++)t[r]=Math.exp(e[r]);return t}(t))),n=function(e){for(var t=[],r=0,n=Math.max.apply(Math,Ex(e)),i=0;i<e.length;i++)e[i]=Math.exp(e[i]-n),r+=e[i];for(var a=0;a<e.length;a++)t[a]=e[a]/r;return t}(t);return[r,Math.max.apply(Math,Ex(n)),n]}},{key:"cropFace",value:function(e,t){var r=t[0],n=t[1],i=t[3],a=Math.floor(n[0]-r[0]),o=Math.max(0,Math.floor(r[0]-1*a)),s=Math.max(0,Math.floor(r[1]-1.3*a)),u=Math.min(Math.floor(n[0]+1*a),e.cols),c=Math.min(Math.floor(i[1]+.9*a),e.rows),l=window.cv;return e.roi(new l.Rect(o,s,u-o,c-s))}},{key:"predict",value:(e=Mx(qx().mark((function e(t,r){var n,i,a,o,s,u,c,l,d,p,f,m,h,v,b,y,g=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=g.length>2&&void 0!==g[2]?g[2]:.11,i=g.length>3&&void 0!==g[3]?g[3]:HX,e.prev=2,a=window,o=a.cv,s=o.imread(t),u=this.cropFace(s,r),s.delete(),c=this.process(u),l=xx(c,3),d=l[0],p=l[1],f=l[2],m=DX(d,5,23),h=1-(m-5)/18,v=JX(f),b=FX[v],!(h>n)){e.next=15;break}return e.abrupt("return",[!1,h]);case 15:y=0;case 16:if(!(y<i.length)){e.next=22;break}if(b!==i[y]){e.next=19;break}return e.abrupt("return",[!0,0]);case 19:y++,e.next=16;break;case 22:if(!(p<UX[b])){e.next=24;break}return e.abrupt("return",[!0,0]);case 24:return e.abrupt("return",[!1,1]);case 27:return e.prev=27,e.t0=e.catch(2),console.error("NotQualifiedDetector error",e.t0),e.abrupt("return",[!0,0]);case 31:case"end":return e.stop()}}),e,this,[[2,27]])}))),function(t,r){return e.apply(this,arguments)})}]);var e,t}(),_X=function(){var e=Mx(qx().mark((function e(){return qx().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 $X(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,r=void 0===t?100:t,n=db.useRef([]),i=db.useRef([]),a=(db.useRef(!1),db.useRef({})),o=db.useCallback((function(e){var t=Date.now(),n=e.type;return!!(a.current[n]&&t-a.current[n]<r)||(a.current[n]=t,!1)}),[r]),s=db.useCallback((function(e){o(e)||i.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})}),[o]),u=db.useCallback((function(e){var t,r,i,a,s,u;o(e)||n.current.push({time:Date.now(),Accelerometer:{x:null==e||null===(t=e.acceleration)||void 0===t?void 0:t.x,y:null==e||null===(r=e.acceleration)||void 0===r?void 0:r.y,z:null==e||null===(i=e.acceleration)||void 0===i?void 0:i.z},Gyroscope:{z:null==e||null===(a=e.rotationRate)||void 0===a?void 0:a.alpha,x:null==e||null===(s=e.rotationRate)||void 0===s?void 0:s.beta,y:null==e||null===(u=e.rotationRate)||void 0===u?void 0:u.gamma}})}),[o]),c=db.useCallback((function(){}),[u,s]),l=db.useCallback((function(){}),[u,s]);return db.useEffect((function(){return function(){l()}}),[l]),{motionData:n.current,orientationData:i.current,startMotion:c,stopMotion:l}}var eB=ZX((function(e,t,r,n){xE(t,aO(t),e,n)})),tB=function(e){if(!EE(e))return!1;var t=eE(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!mK(e)},rB=CX((function(e,t){try{return qK(e,void 0,t)}catch(e){return tB(e)?e:new Error(e)}})),nB=Object.prototype,iB=nB.hasOwnProperty,aB=function(e,t,r,n){return void 0===e||Tx(e,nB[r])&&!iB.call(n,r)?t:e},oB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},sB=function(e){return"\\"+oB[e]},uB=/<%=([\s\S]+?)%>/g,cB=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),lB=/[&<>"']/g,dB=RegExp(lB.source),pB={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:uB,variable:"",imports:{_:{escape:function(e){return(e=nK(e))&&dB.test(e)?e.replace(lB,cB):e}}}},fB=/\b__p \+= '';/g,mB=/\b(__p \+=) '' \+/g,hB=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vB=/[()=,{}\[\]\/\s]/,bB=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yB=/($^)/,gB=/['\n\r\u2028\u2029\\]/g,qB=Object.prototype.hasOwnProperty,AB=function(e,t,r){var n=pB.imports._.templateSettings||pB;r&&zX(e,t,r)&&(t=void 0),e=nK(e),t=eB({},t,n,aB);var i,a,o=eB({},t.imports,n.imports,aB),s=rO(o),u=function(e,t){return Vx(t,(function(t){return e[t]}))}(o,s),c=0,l=t.interpolate||yB,d="__p += '",p=RegExp((t.escape||yB).source+"|"+l.source+"|"+(l===uB?bB:yB).source+"|"+(t.evaluate||yB).source+"|$","g"),f=qB.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(p,(function(t,r,n,o,s,u){return n||(n=o),d+=e.slice(c,u).replace(gB,sB),r&&(i=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=u+t.length,t})),d+="';\n";var m=qB.call(t,"variable")&&t.variable;if(m){if(vB.test(m))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(fB,""):d).replace(mB,"$1").replace(hB,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var h=rB((function(){return Function(s,f+"return "+d).apply(void 0,u)}));if(h.source=d,tB(h))throw h;return h},IB=function(){var e=YW();return db.useCallback((function(t,r){var n,i;return r?AB(null!==(i=e[t])&&void 0!==i?i:t)(r):null!==(n=e[t])&&void 0!==n?n:t}),[e])},SB=function(e){db.useEffect((function(){!function(e){new Promise((function(t,r){var n=new Image;n.onload=t,n.onerror=r,n.src=e}))}(e)}),[e])},MB=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']))},kB=ZX((function(e,t,r){kX(e,t,r)})),CB=JK(),zB=zx((function e(t){var r=this,n=t.container,i=t.lang,a=void 0===i?"vi":i,o=t.assetRoot,s=t.resourceRoot,u=t.customUrls,c=void 0===u?{}:u,l=t.enableAntiDebug,d=void 0===l||l,p=t.warmupMessage,f=t.baseComponent,m=t.component,h=void 0===m?{}:m,v=t.country,b=void 0===v?"vn":v,y=t.idCardContext,g=t.exifKey,q=void 0===g?"":g,A=t.themeVersion,I=void 0===A?"v2":A,S=t.enableVoice,M=void 0!==S&&S;kx(this,e),Zx(this,"getDeviceInfo",Mx(qx().mark((function e(){var t,r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={id:null,udid:null,sn:null,imei:null,manufacturer:QK(),deviceName:_K(),wlanMac:null,phoneNumber:null,location:{latitude:null,longitude:null}},e.next=3,uj();case 3:return r=e.sent,t.location.latitude=(null==r?void 0:r.lat)||null,t.location.longitude=(null==r?void 0:r.long)||null,e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})))),Zx(this,"initNativeCamera",(function(e){var t=document.createElement("div");document.body.appendChild(t);var n=db.createRef(),i=r.component.NativeCamera;return dx.render(db.createElement(i,wx({},e,{ref:n})),t),{openCamera:function(){n.current.click()}}})),Zx(this,"runWarmUpReadIDCard",Mx(qx().mark((function e(){var t;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.commonSettings.customUrls,e.abrupt("return",r.component.warmUpReadIdCard(t));case 2:case"end":return e.stop()}}),e)})))),Zx(this,"runPreloadEKYCResources",Mx(qx().mark((function e(){var t;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=r.commonSettings.customUrls,r.component.preloadEKYCResources(t);case 2:case"end":return e.stop()}}),e)})))),Zx(this,"destroyView",(function(){dx.unmountComponentAtNode(r.container)})),function(e,t,r,n,i,a,o,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,a,o,s],l=0;(u=new Error(t.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var k=EK({resourceRoot:s,initCustomUrls:c,country:b});this.commonSettings=gx({lang:a,assetRoot:o,customUrls:k,enableAntiDebug:d,debug:!1,warmupMessage:p,country:b,exifKey:q,themeVersion:I,enableVoice:M},y),this.component=kB({},f,h)}),[{key:"checkCamera",value:function(){return(0,this.component.checkCamera)()}},{key:"getListCamera",value:function(){return(0,this.component.getListCamera)()}},{key:"readIDCardWithApiCall",value:function(e){var t=this.component.ReadIDCardWithApiCall,r=gx(gx({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{});dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(BW,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:r}},db.createElement($W,{mode:"id_card"},db.createElement(t,wx({onClose:this.destroyView},e))))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var t=this.component.ReadIDCardUIOnly,r=gx(gx({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{});dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(BW,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:r}},db.createElement(pN,{clientSettings:null==e?void 0:e.clientSettings,onError:null==e?void 0:e.onError},db.createElement($W,{mode:"id_card"},db.createElement(t,wx({onClose:this.destroyView},e)))))),this.container)}},{key:"livenessDetection",value:function(e){var t=this.component,r=t.LivenessDetection,n=t.CustomComponent,i=gx(gx(gx(gx({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{}),(null==e?void 0:e.customInstructions)||{}),(null==e?void 0:e.customMessages)||{});dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(BW,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:i}},db.createElement($W,{mode:TX(e.mode)},db.createElement(r,wx({onClose:this.destroyView},e,{customComponent:n}))))),this.container)}},{key:"ekycFlow",value:function(e){var t=this.component.EkycFlow,r=(null==e?void 0:e.customTexts)||{};dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(BW,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:r}},db.createElement(t,wx({onClose:this.destroyView},e)))),this.container)}},{key:"flashLiveness",value:function(e){var t=this.component.FlashLiveness;dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(t,wx({onClose:this.destroyView},e))),this.container)}},{key:"faceAuthentication",value:function(e){var t=this.component,r=t.FaceAuthentication,n=t.LivenessDetection,i=t.CustomComponent,a=gx(gx(gx(gx({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{}),(null==e?void 0:e.customInstructions)||{}),(null==e?void 0:e.customMessages)||{});dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(BW,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:a}},db.createElement($W,{mode:TX(e.authMethod)},db.createElement(r,wx({onClose:this.destroyView},e,{livenessDetectionComponent:n,customComponent:i}))))),this.container)}},{key:"compareFaces",value:function(e){var t=e.accessKey,r=e.secretKey,n=e.apiUrl,i=e.image1,a=e.image2,o=e.onSuccess,s=e.onError;bj(new NK(t,r,n,{httpHeaders:CB})).compareFaces({image1:{id:i},image2:{id:a}}).then((function(e){o(e)})).catch((function(e){s(e)}))}}]),ZB=JK(),wB=function(){return zx((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(kx(this,e),t&&r&&n){var i=hW({userId:""});this.apiClient=bj(new NK(t,r,n,{httpHeaders:gx(gx({},ZB),{},{"x-request-id":i})}))}else this.apiClient=null;this.clientSettings=this.clientSettings.bind(this),this.uploadImage=this.uploadImage.bind(this),this.uploadFiles=this.uploadFiles.bind(this),this.requestVerifyIDCard=this.requestVerifyIDCard.bind(this),this.detectIDTampering=this.detectIDTampering.bind(this),this.readIDCard=this.readIDCard.bind(this),this.requestVerifyPortrait=this.requestVerifyPortrait.bind(this),this.verifyFaceLiveness=this.verifyFaceLiveness.bind(this),this.compareFaces=this.compareFaces.bind(this),this.searchFaces=this.searchFaces.bind(this),this.indexFaces=this.indexFaces.bind(this)}),[{key:"clientSettings",value:(l=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.clientSettings(t);case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"uploadImage",value:(c=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.uploadImage(t);case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"uploadFiles",value:(u=Mx(qx().mark((function e(t){var r,n,i=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i.length>1&&void 0!==i[1]?i[1]:{},!this.apiClient){e.next=6;break}return e.next=4,this.apiClient.httpClient.post("/v1/files",t,r);case 4:return n=e.sent,e.abrupt("return",n);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"requestVerifyIDCard",value:(s=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.requestVerifyIDCard(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"detectIDTampering",value:(o=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.detectIDTampering(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"readIDCard",value:(a=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.readIDCard(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"requestVerifyPortrait",value:(i=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.requestVerifyPortrait(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"verifyFaceLiveness",value:(n=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.verifyFaceLiveness(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"compareFaces",value:(r=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.compareFaces(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"searchFaces",value:(t=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.searchFaces(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"indexFaces",value:(e=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.indexFaces(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})}]);var e,t,r,n,i,a,o,s,u,c,l}();function xB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function EB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xB(Object(r),!0).forEach((function(t){LB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function OB(){OB=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,o=Object.create(a.prototype),s=new w(n||[]);return i(o,"_invoke",{value:k(e,r,s)}),o}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",f="executing",m="completed",h={};function v(){}function b(){}function y(){}var g={};c(g,o,(function(){return this}));var q=Object.getPrototypeOf,A=q&&q(q(x([])));A&&A!==r&&n.call(A,o)&&(g=A);var I=y.prototype=v.prototype=Object.create(g);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function M(e,t){function r(i,a,o,s){var u=d(e[i],e,a);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==rv(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(l).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return a=a?a.then(i,i):i()}})}function k(t,r,n){var i=p;return function(a,o){if(i===f)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:e,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=f;var c=d(t,r,n);if("normal"===c.type){if(i=n.done?m:"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var a=d(i,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,h;var o=a.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function z(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function Z(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(z,this),this.reset(!0)}function x(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(rv(t)+" is not iterable")}return b.prototype=y,i(I,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:b,configurable:!0}),b.displayName=c(y,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,u,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},S(M.prototype),c(M.prototype,s,(function(){return this})),t.AsyncIterator=M,t.async=function(e,r,n,i,a){void 0===a&&(a=Promise);var o=new M(l(e,r,n,i),a);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(I),c(I,u,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=x,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(Z),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),Z(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;Z(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function KB(e){var t=function(e,t){if("object"!=rv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=rv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==rv(t)?t:t+""}function WB(e){return(WB="function"==typeof Symbol&&"symbol"==rv(Symbol.iterator)?function(e){return rv(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":rv(e)})(e)}function VB(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function TB(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){VB(a,n,i,o,s,"next",e)}function s(e){VB(a,n,i,o,s,"throw",e)}o(void 0)}))}}function LB(e,t,r){return(t=KB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NB(){return(NB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function PB(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function jB(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||XB(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function RB(e){return function(e){if(Array.isArray(e))return BB(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||XB(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function XB(e,t){if(e){if("string"==typeof e)return BB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?BB(e,t):void 0}}function BB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var GB=Array.isArray,YB="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function HB(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var FB,UB="object"==rv(YB)&&YB&&YB.Object===Object&&YB,DB="object"==("undefined"==typeof self?"undefined":rv(self))&&self&&self.Object===Object&&self,JB=UB||DB||Function("return this")(),QB=JB.Symbol,_B=Object.prototype,$B=_B.hasOwnProperty,eG=_B.toString,tG=QB?QB.toStringTag:void 0,rG=Object.prototype.toString,nG=QB?QB.toStringTag:void 0,iG=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":nG&&nG in Object(e)?function(e){var t=$B.call(e,tG),r=e[tG];try{e[tG]=void 0;var n=!0}catch(e){}var i=eG.call(e);return n&&(t?e[tG]=r:delete e[tG]),i}(e):function(e){return rG.call(e)}(e)},aG=function(e){return null!=e&&"object"==rv(e)},oG=function(e){return"symbol"==rv(e)||aG(e)&&"[object Symbol]"==iG(e)},sG=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uG=/^\w*$/,cG=function(e){var t=rv(e);return null!=e&&("object"==t||"function"==t)},lG=function(e){if(!cG(e))return!1;var t=iG(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},dG=JB["__core-js_shared__"],pG=(FB=/[^.]+$/.exec(dG&&dG.keys&&dG.keys.IE_PROTO||""))?"Symbol(src)_1."+FB:"",fG=Function.prototype.toString,mG=/^\[object .+?Constructor\]$/,hG=Function.prototype,vG=Object.prototype,bG=hG.toString,yG=vG.hasOwnProperty,gG=RegExp("^"+bG.call(yG).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qG=function(e){return!(!cG(e)||function(e){return!!pG&&pG in e}(e))&&(lG(e)?gG:mG).test(function(e){if(null!=e){try{return fG.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))},AG=function(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return qG(r)?r:void 0},IG=AG(Object,"create"),SG=Object.prototype.hasOwnProperty,MG=Object.prototype.hasOwnProperty;function kG(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}kG.prototype.clear=function(){this.__data__=IG?IG(null):{},this.size=0},kG.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},kG.prototype.get=function(e){var t=this.__data__;if(IG){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return SG.call(t,e)?t[e]:void 0},kG.prototype.has=function(e){var t=this.__data__;return IG?void 0!==t[e]:MG.call(t,e)},kG.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=IG&&void 0===t?"__lodash_hash_undefined__":t,this};var CG=kG,zG=function(e,t){return e===t||e!=e&&t!=t},ZG=function(e,t){for(var r=e.length;r--;)if(zG(e[r][0],t))return r;return-1},wG=Array.prototype.splice;function xG(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}xG.prototype.clear=function(){this.__data__=[],this.size=0},xG.prototype.delete=function(e){var t=this.__data__,r=ZG(t,e);return!(r<0||(r==t.length-1?t.pop():wG.call(t,r,1),--this.size,0))},xG.prototype.get=function(e){var t=this.__data__,r=ZG(t,e);return r<0?void 0:t[r][1]},xG.prototype.has=function(e){return ZG(this.__data__,e)>-1},xG.prototype.set=function(e,t){var r=this.__data__,n=ZG(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var EG=xG,OG=AG(JB,"Map"),KG=function(e,t){var r=e.__data__;return function(e){var t=rv(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map};function WG(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}WG.prototype.clear=function(){this.size=0,this.__data__={hash:new CG,map:new(OG||EG),string:new CG}},WG.prototype.delete=function(e){var t=KG(this,e).delete(e);return this.size-=t?1:0,t},WG.prototype.get=function(e){return KG(this,e).get(e)},WG.prototype.has=function(e){return KG(this,e).has(e)},WG.prototype.set=function(e,t){var r=KG(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};var VG=WG;function TG(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function r(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(TG.Cache||VG),r}TG.Cache=VG;var LG=TG,NG=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,PG=/\\(\\)?/g,jG=function(e){var t=LG((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(NG,(function(e,r,n,i){t.push(n?i.replace(PG,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),RG=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i},XG=QB?QB.prototype:void 0,BG=XG?XG.toString:void 0,GG=function e(t){if("string"==typeof t)return t;if(GB(t))return RG(t,e)+"";if(oG(t))return BG?BG.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},YG=function(e){return null==e?"":GG(e)},HG=function(e,t){return GB(e)?e:function(e,t){if(GB(e))return!1;var r=rv(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!oG(e))||uG.test(e)||!sG.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:jG(YG(e))},FG=function(e){if("string"==typeof e||oG(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},UG=function(e,t,r){var n=null==e?void 0:function(e,t){for(var r=0,n=(t=HG(t,e)).length;null!=e&&r<n;)e=e[FG(t[r++])];return r&&r==n?e:void 0}(e,t);return void 0===n?r:n},DG=HB((function(e,t){!function(r,n){var i="function",a="undefined",o="object",s="string",u="model",c="name",l="type",d="vendor",p="version",f="architecture",m="console",h="mobile",v="tablet",b="smarttv",y="wearable",g="embedded",q="Amazon",A="Apple",I="ASUS",S="BlackBerry",M="Google",k="Huawei",C="LG",z="Microsoft",Z="Motorola",w="Samsung",x="Sharp",E="Sony",O="Xiaomi",K="Zebra",W="Facebook",V="Chromium OS",T="Mac OS",L=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},N=function(e,t){return rv(e)===s&&-1!==P(t).indexOf(P(e))},P=function(e){return e.toLowerCase()},j=function(e,t){if(rv(e)===s)return e=e.replace(/^\s\s*/,""),rv(t)===a?e:e.substring(0,500)},R=function(e,t){for(var r,a,s,u,c,l,d=0;d<t.length&&!c;){var p=t[d],f=t[d+1];for(r=a=0;r<p.length&&!c&&p[r];)if(c=p[r++].exec(e))for(s=0;s<f.length;s++)l=c[++a],rv(u=f[s])===o&&u.length>0?2===u.length?rv(u[1])==i?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?rv(u[1])!==i||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):n:this[u[0]]=l?u[1].call(this,l,u[2]):n:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):n):this[u]=l||n;d+=2}},X=function(e,t){for(var r in t)if(rv(t[r])===o&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(N(t[r][i],e))return"?"===r?n:r}else if(N(t[r],e))return"?"===r?n:r;return e},B={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"},G={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[p,[c,"Opera"]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[c,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[c,"Smart Lenovo Browser"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure Browser"],p],[/\bfocus\/([\w\.]+)/i],[p,[c,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[p,[c,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 Browser"]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 Browser"],p],[/samsungbrowser\/([\w\.]+)/i],[p,[c,"Samsung Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/metasr[\/ ]?([\d\.]+)/i],[p,[c,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,W],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,"Chrome WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,X,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[c,p],[/(cobalt)\/([\w\.]+)/i],[c,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,P]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",P]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,P]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,w],[l,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,w],[l,h]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[d,A],[l,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,A],[l,v]],[/(macintosh);/i],[u,[d,A]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,x],[l,h]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,k],[l,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,k],[l,h]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[d,O],[l,h]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,O],[l,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[d,"OPPO"],[l,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[l,h]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[l,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,Z],[l,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,Z],[l,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,C],[l,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,C],[l,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[l,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[l,h]],[/(pixel c)\b/i],[u,[d,M],[l,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,M],[l,h]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,E],[l,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,E],[l,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[l,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,q],[l,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,q],[l,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[l,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,S],[l,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,I],[l,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,I],[l,h]],[/(nexus 9)/i],[u,[d,"HTC"],[l,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[l,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[l,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[l,h]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[d,"Ulefone"],[l,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[l,h]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[l,v]],[/(surface duo)/i],[u,[d,z],[l,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[l,h]],[/(u304aa)/i],[u,[d,"AT&T"],[l,h]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[l,h]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[l,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[l,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[l,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[l,v]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[l,v]],[/\b(k88) b/i],[u,[d,"ZTE"],[l,v]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[l,h]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[l,h]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[l,v]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[l,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[l,v]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[l,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[l,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[l,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[l,h]],[/\b(ph-1) /i],[u,[d,"Essential"],[l,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[l,v]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[l,v]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[l,v]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[l,v]],[/(sprint) (\w+)/i],[d,u,[l,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,z],[l,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,K],[l,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,K],[l,h]],[/smart-tv.+(samsung)/i],[d,[l,b]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,w],[l,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,C],[l,b]],[/(apple) ?tv/i],[d,[u,"Apple TV"],[l,b]],[/crkey/i],[[u,"Chromecast"],[d,M],[l,b]],[/droid.+aft(\w+)( bui|\))/i],[u,[d,q],[l,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[d,x],[l,b]],[/(bravia[\w ]+)( bui|\))/i],[u,[d,E],[l,b]],[/(mitv-\w{5}) bui/i],[u,[d,O],[l,b]],[/Hbbtv.*(technisat) (.*);/i],[d,u,[l,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,j],[u,j],[l,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[l,m]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[l,m]],[/(playstation [345portablevi]+)/i],[u,[d,E],[l,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,z],[l,m]],[/((pebble))app/i],[d,u,[l,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[d,A],[l,y]],[/droid.+; (glass) \d/i],[u,[d,M],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,K],[l,y]],[/(quest( 2| pro)?)/i],[u,[d,W],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,g]],[/(aeobc)\b/i],[u,[d,q],[l,g]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[l,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[l,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,h]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[c,[p,X,B]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,X,B],[c,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,T],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[c,"Chromecast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,V],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,p]]},Y=function e(t,u){if(rv(t)===o&&(u=t,t=n),!(this instanceof e))return new e(t,u).getResult();var c=rv(r)!==a&&r.navigator?r.navigator:n,l=t||(c&&c.userAgent?c.userAgent:""),d=c&&c.userAgentData?c.userAgentData:n,p=u?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(G,u):G,f=c&&c.userAgent==l;return this.getBrowser=function(){var e,t={};return t.name=n,t.version=n,R.call(t,l,p.browser),t.major=rv(e=t.version)===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n,f&&c&&c.brave&&rv(c.brave.isBrave)==i&&(t.name="Brave"),t},this.getCPU=function(){var e={};return e.architecture=n,R.call(e,l,p.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,R.call(e,l,p.device),f&&!e.type&&d&&d.mobile&&(e.type=h),f&&"Macintosh"==e.model&&c&&rv(c.standalone)!==a&&c.maxTouchPoints&&c.maxTouchPoints>2&&(e.model="iPad",e.type=v),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,R.call(e,l,p.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,R.call(e,l,p.os),f&&!e.name&&d&&"Unknown"!=d.platform&&(e.name=d.platform.replace(/chrome os/i,V).replace(/macos/i,T)),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 l},this.setUA=function(e){return l=rv(e)===s&&e.length>500?j(e,500):e,this},this.setUA(l),this};Y.VERSION="1.0.37",Y.BROWSER=L([c,p,"major"]),Y.CPU=L([f]),Y.DEVICE=L([u,d,l,m,h,b,v,y,g]),Y.ENGINE=Y.OS=L([c,p]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var H=rv(r)!==a&&(r.jQuery||r.Zepto);if(H&&!H.ua){var F=new Y;H.ua=F.getResult(),H.ua.get=function(){return F.getUA()},H.ua.set=function(e){F.setUA(e);var t=F.getResult();for(var r in t)H.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":rv(window))?window:YB)})),JG=HB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r,n=(r=db)&&"object"==rv(r)&&"default"in r?r.default:r,i=new DG,a=i.getBrowser(),o=i.getCPU(),s=i.getDevice(),u=i.getEngine(),c=i.getOS(),l=i.getUA(),d=function(e){return i.setUA(e)},p=function(e){if(e){var t=new DG(e);return{UA:t,browser:t.getBrowser(),cpu:t.getCPU(),device:t.getDevice(),engine:t.getEngine(),os:t.getOS(),ua:t.getUA(),setUserAgent:function(e){return t.setUA(e)}}}console.error("No userAgent string was provided")},f=Object.freeze({ClientUAInstance:i,browser:a,cpu:o,device:s,engine:u,os:c,ua:l,setUa:d,parseUserAgent:p});function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){return(h="function"==typeof Symbol&&"symbol"==rv(Symbol.iterator)?function(e){return rv(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":rv(e)})(e)}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function q(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var S="mobile",M="tablet",k="smarttv",C="console",z="wearable",Z="embedded",w=void 0,x={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},E={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},O={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},K=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";return e||t},W=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},V=function(e){var t=W();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},T=function(e,t,r,n){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){v(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{vendor:K(t.vendor),model:K(t.model),os:K(r.name),osVersion:K(r.version),ua:K(n)})},L=function(e){return e.type===S},N=function(e){return e.type===M},P=function(e){var t=e.type;return t===S||t===M},j=function(e){return e.type===k},R=function(e){return e.type===w},X=function(e){return e.type===z},B=function(e){return e.type===C},G=function(e){return e.type===Z},Y=function(e){var t=e.vendor;return K(t)},H=function(e){var t=e.model;return K(t)},F=function(e){var t=e.type;return K(t,"browser")},U=function(e){return e.name===E.Android},D=function(e){return e.name===E.Windows},J=function(e){return e.name===E.MAC_OS},Q=function(e){return e.name===E.WindowsPhone},_=function(e){return e.name===E.IOS},$=function(e){var t=e.version;return K(t)},ee=function(e){var t=e.name;return K(t)},te=function(e){return e.name===x.Chrome},re=function(e){return e.name===x.Firefox},ne=function(e){return e.name===x.Chromium},ie=function(e){return e.name===x.Edge},ae=function(e){return e.name===x.Yandex},oe=function(e){var t=e.name;return t===x.Safari||t===x.MobileSafari},se=function(e){return e.name===x.MobileSafari},ue=function(e){return e.name===x.Opera},ce=function(e){var t=e.name;return t===x.InternetExplorer||t===x.Ie},le=function(e){return e.name===x.MIUI},de=function(e){return e.name===x.SamsungBrowser},pe=function(e){var t=e.version;return K(t)},fe=function(e){var t=e.major;return K(t)},me=function(e){var t=e.name;return K(t)},he=function(e){var t=e.name;return K(t)},ve=function(e){var t=e.version;return K(t)},be=function(){var e=W(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)},ye=function(e){return"string"==typeof e&&-1!==e.indexOf("Edg/")},ge=function(){var e=W();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream},qe=function(){return V("iPad")},Ae=function(){return V("iPhone")},Ie=function(){return V("iPod")},Se=function(e){return K(e)};function Me(e){var t=e||f,r=t.device,n=t.browser,i=t.os,a=t.engine,o=t.ua;return{isSmartTV:j(r),isConsole:B(r),isWearable:X(r),isEmbedded:G(r),isMobileSafari:se(n)||qe(),isChromium:ne(n),isMobile:P(r)||qe(),isMobileOnly:L(r),isTablet:N(r)||qe(),isBrowser:R(r),isDesktop:R(r),isAndroid:U(i),isWinPhone:Q(i),isIOS:_(i)||qe(),isChrome:te(n),isFirefox:re(n),isSafari:oe(n),isOpera:ue(n),isIE:ce(n),osVersion:$(i),osName:ee(i),fullBrowserVersion:pe(n),browserVersion:fe(n),browserName:me(n),mobileVendor:Y(r),mobileModel:H(r),engineName:he(a),engineVersion:ve(a),getUA:Se(o),isEdge:ie(n)||ye(o),isYandex:ae(n),deviceType:F(r),isIOS13:ge(),isIPad13:qe(),isIPhone13:Ae(),isIPod13:Ie(),isElectron:be(),isEdgeChromium:ye(o),isLegacyEdge:ie(n)&&!ye(o),isWindows:D(i),isMacOs:J(i),isMIUI:le(n),isSamsungBrowser:de(n)}}var ke=j(s),Ce=B(s),ze=X(s),Ze=G(s),we=se(a)||qe(),xe=ne(a),Ee=P(s)||qe(),Oe=L(s),Ke=N(s)||qe(),We=R(s),Ve=R(s),Te=U(c),Le=Q(c),Ne=_(c)||qe(),Pe=te(a),je=re(a),Re=oe(a),Xe=ue(a),Be=ce(a),Ge=$(c),Ye=ee(c),He=pe(a),Fe=fe(a),Ue=me(a),De=Y(s),Je=H(s),Qe=he(u),_e=ve(u),$e=Se(l),et=ie(a)||ye(l),tt=ae(a),rt=F(s),nt=ge(),it=qe(),at=Ae(),ot=Ie(),st=be(),ut=ye(l),ct=ie(a)&&!ye(l),lt=D(c),dt=J(c),pt=le(a),ft=de(a);function mt(e){var t=e||window.navigator.userAgent;return p(t)}t.AndroidView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Te?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.BrowserTypes=x,t.BrowserView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return We?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.ConsoleView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Ce?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.CustomView=function(e){var t=e.renderWithFragment,r=e.children,i=(e.viewClassName,e.style,e.condition),a=q(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?t?n.createElement(db.Fragment,null,r):n.createElement("div",a,r):null},t.IEView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Be?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.IOSView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Ne?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.MobileOnlyView=function(e){var t=e.renderWithFragment,r=e.children,i=(e.viewClassName,e.style,q(e,["renderWithFragment","children","viewClassName","style"]));return Oe?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.MobileView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Ee?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.OsTypes=E,t.SmartTVView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return ke?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.TabletView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Ke?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.WearableView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return ze?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.WinPhoneView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Le?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.browserName=Ue,t.browserVersion=Fe,t.deviceDetect=function(e){var t=e?p(e):f,r=t.device,n=t.browser,i=t.engine,a=t.os,o=t.ua,s=function(e){switch(e){case S:return{isMobile:!0};case M:return{isTablet:!0};case k:return{isSmartTV:!0};case C:return{isConsole:!0};case z:return{isWearable:!0};case w:return{isBrowser:!0};case Z:return{isEmbedded:!0};default:return O}}(r.type),u=s.isBrowser,c=s.isMobile,l=s.isTablet,d=s.isSmartTV,m=s.isConsole,h=s.isWearable,v=s.isEmbedded;return u?function(e,t,r,n,i){return{isBrowser:e,browserMajorVersion:K(t.major),browserFullVersion:K(t.version),browserName:K(t.name),engineName:K(r.name),engineVersion:K(r.version),osName:K(n.name),osVersion:K(n.version),userAgent:K(i)}}(u,n,i,a,o):d?function(e,t,r,n){return{isSmartTV:e,engineName:K(t.name),engineVersion:K(t.version),osName:K(r.name),osVersion:K(r.version),userAgent:K(n)}}(d,i,a,o):m?function(e,t,r,n){return{isConsole:e,engineName:K(t.name),engineVersion:K(t.version),osName:K(r.name),osVersion:K(r.version),userAgent:K(n)}}(m,i,a,o):c||l?T(s,r,a,o):h?function(e,t,r,n){return{isWearable:e,engineName:K(t.name),engineVersion:K(t.version),osName:K(r.name),osVersion:K(r.version),userAgent:K(n)}}(h,i,a,o):v?function(e,t,r,n,i){return{isEmbedded:e,vendor:K(t.vendor),model:K(t.model),engineName:K(r.name),engineVersion:K(r.version),osName:K(n.name),osVersion:K(n.version),userAgent:K(i)}}(v,r,i,a,o):void 0},t.deviceType=rt,t.engineName=Qe,t.engineVersion=_e,t.fullBrowserVersion=He,t.getSelectorsByUserAgent=function(e){if(e&&"string"==typeof e){var t=p(e);return Me({device:t.device,browser:t.browser,os:t.os,engine:t.engine,ua:t.ua})}console.error("No valid user agent string was provided")},t.getUA=$e,t.isAndroid=Te,t.isBrowser=We,t.isChrome=Pe,t.isChromium=xe,t.isConsole=Ce,t.isDesktop=Ve,t.isEdge=et,t.isEdgeChromium=ut,t.isElectron=st,t.isEmbedded=Ze,t.isFirefox=je,t.isIE=Be,t.isIOS=Ne,t.isIOS13=nt,t.isIPad13=it,t.isIPhone13=at,t.isIPod13=ot,t.isLegacyEdge=ct,t.isMIUI=pt,t.isMacOs=dt,t.isMobile=Ee,t.isMobileOnly=Oe,t.isMobileSafari=we,t.isOpera=Xe,t.isSafari=Re,t.isSamsungBrowser=ft,t.isSmartTV=ke,t.isTablet=Ke,t.isWearable=ze,t.isWinPhone=Le,t.isWindows=lt,t.isYandex=tt,t.mobileModel=Je,t.mobileVendor=De,t.osName=Ye,t.osVersion=Ge,t.parseUserAgent=p,t.setUserAgent=function(e){return d(e)},t.useDeviceData=mt,t.useDeviceSelectors=function(e){var t=mt(e||window.navigator.userAgent);return[Me(t),t]},t.useMobileOrientation=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(db.useState((function(){var e=window.innerWidth>window.innerHeight?90:0;return{isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"}})),2),t=e[0],r=e[1],n=db.useCallback((function(){var e=window.innerWidth>window.innerHeight?90:0,n={isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"};t.orientation!==n.orientation&&r(n)}),[t.orientation]);return db.useEffect((function(){return void 0!==("undefined"==typeof window?"undefined":h(window))&&Ee&&(n(),window.addEventListener("load",n,!1),window.addEventListener("resize",n,!1)),function(){window.removeEventListener("resize",n,!1),window.removeEventListener("load",n,!1)}}),[n]),t},t.withOrientationChange=function(e){return function(t){function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=function(e,t){if(t&&("object"==rv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return A(e)}(this,y(r).call(this,e))).isEventListenerAdded=!1,t.handleOrientationChange=t.handleOrientationChange.bind(A(t)),t.onOrientationChange=t.onOrientationChange.bind(A(t)),t.onPageLoad=t.onPageLoad.bind(A(t)),t.state={isLandscape:!1,isPortrait:!1},t}var i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(r,t),(i=[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var e=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:0===e,isLandscape:90===e})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){void 0!==("undefined"==typeof window?"undefined":h(window))&&Ee&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return n.createElement(e,b({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,i),r}(n.Component)}})),QG=function(){try{var e=AG(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),_G=function(e,t,r){"__proto__"==t&&QG?QG(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},$G=Object.prototype.hasOwnProperty,eY=function(e,t,r){var n=e[t];$G.call(e,t)&&zG(n,r)&&(void 0!==r||t in e)||_G(e,t,r)},tY=function(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],u=n?n(r[s],e[s],s,r,e):void 0;void 0===u&&(u=e[s]),i?_G(r,s,u):eY(r,s,u)}return r},rY=function(e){return e},nY=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},iY=Math.max,aY=function(e){return function(){return e}},oY=QG?function(e,t){return QG(e,"toString",{configurable:!0,enumerable:!1,value:aY(t),writable:!0})}:rY,sY=Date.now,uY=function(e){var t=0,r=0;return function(){var n=sY(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(oY),cY=function(e,t){return uY(function(e,t,r){return t=iY(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=iY(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),nY(e,this,s)}}(e,t,rY),e+"")},lY=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},dY=function(e){return null!=e&&lY(e.length)&&!lG(e)},pY=/^(?:0|[1-9]\d*)$/,fY=function(e,t){var r=rv(e);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&pY.test(e))&&e>-1&&e%1==0&&e<t},mY=function(e,t,r){if(!cG(r))return!1;var n=rv(t);return!!("number"==n?dY(r)&&fY(t,r.length):"string"==n&&t in r)&&zG(r[t],e)},hY=function(e){return cY((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&mY(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t}))},vY=function(e){return aG(e)&&"[object Arguments]"==iG(e)},bY=Object.prototype,yY=bY.hasOwnProperty,gY=bY.propertyIsEnumerable,qY=vY(function(){return arguments}())?vY:function(e){return aG(e)&&yY.call(e,"callee")&&!gY.call(e,"callee")},AY=function(){return!1},IY=HB((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r?JB.Buffer:void 0,a=(i?i.isBuffer:void 0)||AY;e.exports=a})),SY={};SY["[object Float32Array]"]=SY["[object Float64Array]"]=SY["[object Int8Array]"]=SY["[object Int16Array]"]=SY["[object Int32Array]"]=SY["[object Uint8Array]"]=SY["[object Uint8ClampedArray]"]=SY["[object Uint16Array]"]=SY["[object Uint32Array]"]=!0,SY["[object Arguments]"]=SY["[object Array]"]=SY["[object ArrayBuffer]"]=SY["[object Boolean]"]=SY["[object DataView]"]=SY["[object Date]"]=SY["[object Error]"]=SY["[object Function]"]=SY["[object Map]"]=SY["[object Number]"]=SY["[object Object]"]=SY["[object RegExp]"]=SY["[object Set]"]=SY["[object String]"]=SY["[object WeakMap]"]=!1;var MY=HB((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r&&UB.process,a=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a})),kY=MY&&MY.isTypedArray,CY=kY?function(e){return function(t){return e(t)}}(kY):function(e){return aG(e)&&lY(e.length)&&!!SY[iG(e)]},zY=Object.prototype.hasOwnProperty,ZY=function(e,t){var r=GB(e),n=!r&&qY(e),i=!r&&!n&&IY(e),a=!r&&!n&&!i&&CY(e),o=r||n||i||a,s=o?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=s.length;for(var c in e)!t&&!zY.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||fY(c,u))||s.push(c);return s},wY=Object.prototype,xY=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||wY)},EY=Object.prototype.hasOwnProperty,OY=function(e){if(!cG(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=xY(e),r=[];for(var n in e)("constructor"!=n||!t&&EY.call(e,n))&&r.push(n);return r},KY=function(e){return dY(e)?ZY(e,!0):OY(e)},WY=hY((function(e,t,r,n){tY(t,KY(t),e,n)})),VY=function(e,t){return function(r){return e(t(r))}},TY=VY(Object.getPrototypeOf,Object),LY=Function.prototype,NY=Object.prototype,PY=LY.toString,jY=NY.hasOwnProperty,RY=PY.call(Object),XY=function(e){if(!aG(e)||"[object Object]"!=iG(e))return!1;var t=TY(e);if(null===t)return!0;var r=jY.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&PY.call(r)==RY},BY=function(e){if(!aG(e))return!1;var t=iG(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!XY(e)},GY=cY((function(e,t){try{return nY(e,void 0,t)}catch(e){return BY(e)?e:new Error(e)}})),YY=Object.prototype,HY=YY.hasOwnProperty,FY=function(e,t,r,n){return void 0===e||zG(e,YY[r])&&!HY.call(n,r)?t:e},UY={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},DY=function(e){return"\\"+UY[e]},JY=VY(Object.keys,Object),QY=Object.prototype.hasOwnProperty,_Y=function(e){return dY(e)?ZY(e):function(e){if(!xY(e))return JY(e);var t=[];for(var r in Object(e))QY.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)},$Y=/<%=([\s\S]+?)%>/g,eH=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),tH=/[&<>"']/g,rH=RegExp(tH.source),nH={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:$Y,variable:"",imports:{_:{escape:function(e){return(e=YG(e))&&rH.test(e)?e.replace(tH,eH):e}}}},iH=/\b__p \+= '';/g,aH=/\b(__p \+=) '' \+/g,oH=/(__e\(.*?\)|\b__t\)) \+\n'';/g,sH=/[()=,{}\[\]\/\s]/,uH=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cH=/($^)/,lH=/['\n\r\u2028\u2029\\]/g,dH=Object.prototype.hasOwnProperty,pH=function(e,t,r){var n=nH.imports._.templateSettings||nH;r&&mY(e,t,r)&&(t=void 0),e=YG(e),t=WY({},t,n,FY);var i,a,o=WY({},t.imports,n.imports,FY),s=_Y(o),u=function(e,t){return RG(t,(function(t){return e[t]}))}(o,s),c=0,l=t.interpolate||cH,d="__p += '",p=RegExp((t.escape||cH).source+"|"+l.source+"|"+(l===$Y?uH:cH).source+"|"+(t.evaluate||cH).source+"|$","g"),f=dH.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(p,(function(t,r,n,o,s,u){return n||(n=o),d+=e.slice(c,u).replace(lH,DY),r&&(i=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=u+t.length,t})),d+="';\n";var m=dH.call(t,"variable")&&t.variable;if(m){if(sH.test(m))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(iH,""):d).replace(aH,"$1").replace(oH,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var h=GY((function(){return Function(s,f+"return "+d).apply(void 0,u)}));if(h.source=d,BY(h))throw h;return h},fH=hq.table.withConfig({displayName:"PlacementArea__Table",componentId:"sc-111697v-0"})(["width:100%;height:100%;td{text-align:center;vertical-align:middle;padding:0;border:0;}border-spacing:0;table-layout:auto;border-collapse:collapse;"]),mH=hq.div.withConfig({displayName:"PlacementArea__ChildrenWrapper",componentId:"sc-111697v-1"})(["position:relative;"]),hH=Array.from(Array(3).keys()),vH=Array.from(Array(3).keys());function bH(e){var t=e.children,r=e.x,n=e.y,i=e.width,a=e.height,o=e.className,s=e.surroundStyle;return db.createElement(fH,{className:o},db.createElement("tbody",null,hH.map((function(e,o){return db.createElement("tr",{key:e,style:{height:0===o?n:"auto"},"data-testid":"row"},vH.map((function(e,n){var u=1===o&&1===n,c="auto";return u?c=i:0===n&&(c=r),db.createElement("td",{"data-testid":u?"centeredCell":"cell",key:e,style:EB({width:c,height:u?a:"auto"},u?{}:s)},u?db.createElement(mH,{style:{width:c,height:a}},t):null)})))}))))}bH.propTypes={children:Tb.node,x:Tb.string,y:Tb.string,width:Tb.string,height:Tb.string,className:Tb.string,surroundStyle:Tb.object},bH.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var yH=/^\s+|\s+$/g,gH=/^[-+]0x[0-9a-f]+$/i,qH=/^0b[01]+$/i,AH=/^0o[0-7]+$/i,IH=parseInt,SH="object"==rv(YB)&&YB&&YB.Object===Object&&YB,MH="object"==("undefined"==typeof self?"undefined":rv(self))&&self&&self.Object===Object&&self,kH=SH||MH||Function("return this")(),CH=Object.prototype.toString,zH=Math.max,ZH=Math.min,wH=function(){return kH.Date.now()};function xH(e){var t=rv(e);return!!e&&("object"==t||"function"==t)}function EH(e){if("number"==typeof e)return e;if(function(e){return"symbol"==rv(e)||function(e){return!!e&&"object"==rv(e)}(e)&&"[object Symbol]"==CH.call(e)}(e))return NaN;if(xH(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=xH(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(yH,"");var r=qH.test(e);return r||AH.test(e)?IH(e.slice(2),r?2:8):gH.test(e)?NaN:+e}var OH=function(e,t,r){var n,i,a,o,s,u,c=0,l=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var r=n,a=i;return n=i=void 0,c=t,o=e.apply(a,r)}function m(e){return c=e,s=setTimeout(v,t),l?f(e):o}function h(e){var r=e-u;return void 0===u||r>=t||r<0||d&&e-c>=a}function v(){var e=wH();if(h(e))return b(e);s=setTimeout(v,function(e){var r=t-(e-u);return d?ZH(r,a-(e-c)):r}(e))}function b(e){return s=void 0,p&&n?f(e):(n=i=void 0,o)}function y(){var e=wH(),r=h(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return m(u);if(d)return s=setTimeout(v,t),f(u)}return void 0===s&&(s=setTimeout(v,t)),o}return t=EH(t)||0,xH(r)&&(l=!!r.leading,a=(d="maxWait"in r)?zH(EH(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=u=i=s=void 0},y.flush=function(){return void 0===s?o:b(wH())},y},KH="function"==typeof Symbol&&Symbol.for,WH=KH?Symbol.for("react.element"):60103,VH=KH?Symbol.for("react.portal"):60106,TH=KH?Symbol.for("react.fragment"):60107,LH=KH?Symbol.for("react.strict_mode"):60108,NH=KH?Symbol.for("react.profiler"):60114,PH=KH?Symbol.for("react.provider"):60109,jH=KH?Symbol.for("react.context"):60110,RH=KH?Symbol.for("react.async_mode"):60111,XH=KH?Symbol.for("react.concurrent_mode"):60111,BH=KH?Symbol.for("react.forward_ref"):60112,GH=KH?Symbol.for("react.suspense"):60113,YH=KH?Symbol.for("react.suspense_list"):60120,HH=KH?Symbol.for("react.memo"):60115,FH=KH?Symbol.for("react.lazy"):60116,UH=KH?Symbol.for("react.block"):60121,DH=KH?Symbol.for("react.fundamental"):60117,JH=KH?Symbol.for("react.responder"):60118,QH=KH?Symbol.for("react.scope"):60119;
52
+ var GR={};void 0!==GR.asn1&&GR.asn1||(GR.asn1={}),GR.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";t=new bR(n,16).xor(e).add(bR.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=GR.asn1,r=t.DERBoolean,n=t.DERInteger,i=t.DERBitString,a=t.DEROctetString,o=t.DERNull,s=t.DERObjectIdentifier,u=t.DEREnumerated,c=t.DERUTF8String,l=t.DERNumericString,d=t.DERPrintableString,p=t.DERTeletexString,f=t.DERIA5String,m=t.DERUTCTime,h=t.DERGeneralizedTime,v=t.DERSequence,b=t.DERSet,y=t.DERTaggedObject,g=t.ASN1Util.newObject,q=Object.keys(e);if(1!=q.length)throw"key of param shall be only one.";var A=q[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+A+":"))throw"undefined key: "+A;if("bool"==A)return new r(e[A]);if("int"==A)return new n(e[A]);if("bitstr"==A)return new i(e[A]);if("octstr"==A)return new a(e[A]);if("null"==A)return new o(e[A]);if("oid"==A)return new s(e[A]);if("enum"==A)return new u(e[A]);if("utf8str"==A)return new c(e[A]);if("numstr"==A)return new l(e[A]);if("prnstr"==A)return new d(e[A]);if("telstr"==A)return new p(e[A]);if("ia5str"==A)return new f(e[A]);if("utctime"==A)return new m(e[A]);if("gentime"==A)return new h(e[A]);if("seq"==A){for(var I=e[A],S=[],M=0;M<I.length;M++){var k=g(I[M]);S.push(k)}return new v({array:S})}if("set"==A){for(I=e[A],S=[],M=0;M<I.length;M++)k=g(I[M]),S.push(k);return new b({array:S})}if("tag"==A){var C=e[A];if("[object Array]"===Object.prototype.toString.call(C)&&3==C.length){var z=g(C[2]);return new y({tag:C[0],explicit:C[1],obj:z})}var Z={};if(void 0!==C.explicit&&(Z.explicit=C.explicit),void 0!==C.tag&&(Z.tag=C.tag),void 0===C.obj)throw"obj shall be specified for 'tag'.";return Z.obj=g(C.obj),new y(Z)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},GR.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<e.length;i+=2){var a=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);n+=a.substr(1,7),"0"==a.substr(0,1)&&(t=t+"."+new bR(n,2).toString(10),n="")}return t},GR.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new bR(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";for(n=a+n,o=0;o<n.length-1;o+=7){var s=n.substr(o,7);o!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=t(a),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);return n},GR.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},GR.asn1.DERAbstractString=function(e){GR.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))},BR.lang.extend(GR.asn1.DERAbstractString,GR.asn1.ASN1Object),GR.asn1.DERAbstractTime=function(e){GR.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,r){var n=this.zeroPadding,i=this.localDateToUTC(e),a=String(i.getFullYear());"utc"==t&&(a=a.substr(2,2));var o=a+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var s=i.getMilliseconds();if(0!=s){var u=n(String(s),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,r,n,i,a){var o=new Date(Date.UTC(e,t-1,r,n,i,a,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},BR.lang.extend(GR.asn1.DERAbstractTime,GR.asn1.ASN1Object),GR.asn1.DERAbstractStructured=function(e){GR.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)},BR.lang.extend(GR.asn1.DERAbstractStructured,GR.asn1.ASN1Object),GR.asn1.DERBoolean=function(){GR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},BR.lang.extend(GR.asn1.DERBoolean,GR.asn1.ASN1Object),GR.asn1.DERInteger=function(e){GR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=GR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bR(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},BR.lang.extend(GR.asn1.DERInteger,GR.asn1.ASN1Object),GR.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=GR.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}GR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var i=e.substr(r,8),a=parseInt(i,2).toString(16);1==a.length&&(a="0"+a),n+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},BR.lang.extend(GR.asn1.DERBitString,GR.asn1.ASN1Object),GR.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=GR.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}GR.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},BR.lang.extend(GR.asn1.DEROctetString,GR.asn1.DERAbstractString),GR.asn1.DERNull=function(){GR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},BR.lang.extend(GR.asn1.DERNull,GR.asn1.ASN1Object),GR.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new bR(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";for(n=a+n,o=0;o<n.length-1;o+=7){var s=n.substr(o,7);o!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};GR.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="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=t(a),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var t=GR.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},BR.lang.extend(GR.asn1.DERObjectIdentifier,GR.asn1.ASN1Object),GR.asn1.DEREnumerated=function(e){GR.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=GR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new bR(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},BR.lang.extend(GR.asn1.DEREnumerated,GR.asn1.ASN1Object),GR.asn1.DERUTF8String=function(e){GR.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},BR.lang.extend(GR.asn1.DERUTF8String,GR.asn1.DERAbstractString),GR.asn1.DERNumericString=function(e){GR.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},BR.lang.extend(GR.asn1.DERNumericString,GR.asn1.DERAbstractString),GR.asn1.DERPrintableString=function(e){GR.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},BR.lang.extend(GR.asn1.DERPrintableString,GR.asn1.DERAbstractString),GR.asn1.DERTeletexString=function(e){GR.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},BR.lang.extend(GR.asn1.DERTeletexString,GR.asn1.DERAbstractString),GR.asn1.DERIA5String=function(e){GR.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},BR.lang.extend(GR.asn1.DERIA5String,GR.asn1.DERAbstractString),GR.asn1.DERUTCTime=function(e){GR.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))},BR.lang.extend(GR.asn1.DERUTCTime,GR.asn1.DERAbstractTime),GR.asn1.DERGeneralizedTime=function(e){GR.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))},BR.lang.extend(GR.asn1.DERGeneralizedTime,GR.asn1.DERAbstractTime),GR.asn1.DERSequence=function(e){GR.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},BR.lang.extend(GR.asn1.DERSequence,GR.asn1.DERAbstractStructured),GR.asn1.DERSet=function(e){GR.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},BR.lang.extend(GR.asn1.DERSet,GR.asn1.DERAbstractStructured),GR.asn1.DERTaggedObject=function(e){GR.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},BR.lang.extend(GR.asn1.DERTaggedObject,GR.asn1.ASN1Object);var YR,HR=(YR=function(e,t){return(YR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}YR(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),FR=function(e){function t(r){var n=e.call(this)||this;return r&&("string"==typeof r?n.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&n.parsePropertiesFrom(r)),n}return HR(t,e),t.prototype.parseKey=function(e){try{var t=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?function(e){var t;if(void 0===eR){var r="0123456789ABCDEF",n=" \f\n\r\t \u2028\u2029";for(eR={},t=0;t<16;++t)eR[r.charAt(t)]=t;for(r=r.toLowerCase(),t=10;t<16;++t)eR[r.charAt(t)]=t;for(t=0;t<n.length;++t)eR[n.charAt(t)]=-1}var i=[],a=0,o=0;for(t=0;t<e.length;++t){var s=e.charAt(t);if("="==s)break;if(-1!=(s=eR[s])){if(void 0===s)throw new Error("Illegal character at offset "+t);a|=s,++o>=2?(i[i.length]=a,a=0,o=0):a<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return i}(e):aR.unarmor(e),i=fR.decode(n);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=SR(t,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var a=i.sub[3].getHexStringValue();this.d=SR(a,16);var o=i.sub[4].getHexStringValue();this.p=SR(o,16);var s=i.sub[5].getHexStringValue();this.q=SR(s,16);var u=i.sub[6].getHexStringValue();this.dmp1=SR(u,16);var c=i.sub[7].getHexStringValue();this.dmq1=SR(c,16);var l=i.sub[8].getHexStringValue();this.coeff=SR(l,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var d=i.sub[1].sub[0];t=d.sub[0].getHexStringValue(),this.n=SR(t,16),r=d.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=i.sub[0].getHexStringValue(),this.n=SR(t,16),r=i.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new GR.asn1.DERInteger({int:0}),new GR.asn1.DERInteger({bigint:this.n}),new GR.asn1.DERInteger({int:this.e}),new GR.asn1.DERInteger({bigint:this.d}),new GR.asn1.DERInteger({bigint:this.p}),new GR.asn1.DERInteger({bigint:this.q}),new GR.asn1.DERInteger({bigint:this.dmp1}),new GR.asn1.DERInteger({bigint:this.dmq1}),new GR.asn1.DERInteger({bigint:this.coeff})]};return new GR.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return rR(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new GR.asn1.DERSequence({array:[new GR.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new GR.asn1.DERNull]}),t=new GR.asn1.DERSequence({array:[new GR.asn1.DERInteger({bigint:this.n}),new GR.asn1.DERInteger({int:this.e})]}),r=new GR.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new GR.asn1.DERSequence({array:[e,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return rR(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return(e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return(e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(RR),UR=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 FR(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(nR(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return rR(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,t,r){try{return rR(this.getKey().sign(e,t,r))}catch(e){return!1}},e.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,nR(t),r)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new FR,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}(),DR=["-","-","-","-","-","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","-","-","-","-","-"];function JR(e){return QR.apply(this,arguments)}function QR(){return(QR=Mx(qx().mark((function e(t){var r,n,i;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.key,n=new TextEncoder,(i=n.encode(r)).reverse(),e.abrupt("return",crypto.subtle.digest("SHA-256",i));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _R(e){return Ex(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}var $R=function(e){var t=e.base64,r=e.key;return new Promise((function(e){JR({key:r}).then((function(r){var n=function(e){return Uint8Array.from(atob(e),(function(e){return e.charCodeAt(0)})).buffer}(t);window.crypto.subtle.importKey("raw",r,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(t){e({hex:_R(t)})}))}))})).catch((function(t){console.error("EncryptBase64 error: ",t),e(t)}))}))},eX=function(e){var t=new UR,r=DR.join("");return t.setPublicKey(r),nR(t.encrypt(e))},tX=function(e,t){return new Promise((function(r){var n=(new TextEncoder).encode(e);window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(e){r({hex:_R(e)})})).catch((function(t){console.error("EncryptString error: ",t),r(e)}))}))};function rX(e,t){return nX.apply(this,arguments)}function nX(){return(nX=Mx(qx().mark((function e(t,r){var n,i,a;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=t.slice(0,16),i=r.slice(-16),(a=new Uint8Array(32)).set(new Uint8Array(n),0),a.set(new Uint8Array(i),n.byteLength),e.abrupt("return",window.crypto.subtle.importKey("raw",a,"AES-GCM",!0,["encrypt","decrypt"]));case 9:return e.prev=9,e.t0=e.catch(0),console.error("combineKeys error: ",e.t0),e.abrupt("return",null);case 13:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}var iX,aX,oX,sX=Object.freeze({__proto__:null,processKey:JR,encryptBase64:$R,encrypt:function(e){var t=e.blob,r=e.key;return new Promise((function(e){var n=new FileReader;n.onload=function(t){var n=t.target.result;JR({key:r}).then((function(t){window.crypto.subtle.importKey("raw",t,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,n).then((function(t){e({hex:_R(t)})}))}))}))},n.readAsArrayBuffer(t)}))},encryptWithRSAPublicKey:eX,encryptString:tX,combineKeys:rX}),uX=function(){var e=Mx(qx().mark((function e(t,r){var n,i,a,o,s,u,c,l,d;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",new Promise((function(e){return e(null)})));case 2:return e.prev=2,e.next=5,JR({key:r});case 5:return n=e.sent,e.next=8,window.crypto.subtle.importKey("raw",n,"AES-GCM",!0,["encrypt","decrypt"]);case 8:return i=e.sent,e.next=11,window.crypto.subtle.exportKey("raw",i);case 11:return a=e.sent,o=YK().replace(/-/g,""),s=new TextEncoder,u=s.encode(o),e.next=17,rX(a,u);case 17:return c=e.sent,e.next=20,tX(t,c);case 20:return l=e.sent,e.next=23,eX(o);case 23:return d=e.sent,e.abrupt("return","".concat(l.hex,"::").concat(d));case 27:return e.prev=27,e.t0=e.catch(2),console.error("encryptFrameMetadata error: ",e.t0),e.abrupt("return",t);case 31:case"end":return e.stop()}}),e,null,[[2,27]])})));return function(t,r){return e.apply(this,arguments)}}(),cX=Object.freeze({__proto__:null,encryptFrameBase64:function(e,t){return new Promise(e?function(r){$R({base64:e,key:t}).then((function(e){r(e.hex)})).catch((function(t){console.error("encryptFrameBase64 error: ",t),r(e)}))}:function(e){return e(null)})},encryptFrameMetadata:uX}),lX=zx((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;kx(this,e),this.interval=t,this.second=0,this.timeStone={origin:0},this.callbacks={}}),[{key:"duration",value:function(e){return Object.prototype.hasOwnProperty.call(this.timeStone,e)?this.second-this.timeStone[e]:-1}},{key:"start",value:function(e,t){var r=this;e||this.timerID||(this.callbacks.origin=t,this.timerID=setInterval((function(){r.second++,Object.keys(r.timeStone).map((function(e){return"function"==typeof r.callbacks[e]&&r.callbacks[e](r.duration(e)),0}))}),this.interval)),Object.prototype.hasOwnProperty.call(this.timeStone,e)||e&&(this.timeStone[e]=this.second,this.callbacks[e]=t)}},{key:"stop",value:function(){clearInterval(this.timerID),this.timerID=void 0,this.second=0,this.timeStone={origin:0},this.callbacks={}}}]),dX=Xx((function(e,t){!function(){var r={};function n(e){return d(">"+f("B",e.length),e)}function i(e){return d(">"+f("H",e.length),e)}function a(e){return d(">"+f("L",e.length),e)}function o(e,t,r){var o,s,u,c,l="",p="";if("Byte"==t)(o=e.length)<=4?p=n(e)+f("\0",4-o):(p=d(">L",[r]),l=n(e));else if("Short"==t)(o=e.length)<=2?p=i(e)+f("\0\0",2-o):(p=d(">L",[r]),l=i(e));else if("Long"==t)(o=e.length)<=1?p=a(e):(p=d(">L",[r]),l=a(e));else if("Ascii"==t)(o=(s=e+"\0").length)>4?(p=d(">L",[r]),l=s):p=s+f("\0",4-o);else if("Rational"==t){if("number"==typeof e[0])o=1,u=e[0],c=e[1],s=d(">L",[u])+d(">L",[c]);else{o=e.length,s="";for(var m=0;m<o;m++)u=e[m][0],c=e[m][1],s+=d(">L",[u])+d(">L",[c])}p=d(">L",[r]),l=s}else if("SRational"==t){if("number"==typeof e[0])o=1,u=e[0],c=e[1],s=d(">l",[u])+d(">l",[c]);else for(o=e.length,s="",m=0;m<o;m++)u=e[m][0],c=e[m][1],s+=d(">l",[u])+d(">l",[c]);p=d(">L",[r]),l=s}else"Undefined"==t&&((o=e.length)>4?(p=d(">L",[r]),l=e):p=e+f("\0",4-o));return[d(">L",[o]),p,l]}function s(e,t,r){var n,i=Object.keys(e).length,a=d(">H",[i]);n=["0th","1st"].indexOf(t)>-1?2+12*i+4:2+12*i;var s="",u="";for(var c in e)if("string"==typeof c&&(c=parseInt(c)),!("0th"==t&&[34665,34853].indexOf(c)>-1||"Exif"==t&&40965==c||"1st"==t&&[513,514].indexOf(c)>-1)){var l=e[c],p=d(">H",[c]),f=v[t][c].type,m=d(">H",[h[f]]);"number"==typeof l&&(l=[l]);var b=o(l,f,8+n+r+u.length);s+=p+m+b[0]+b[1],u+=b[2]}return[a+s,u]}function u(e){var t;if("ÿØ"==e.slice(0,2))t=function(e){for(var t,r=0;r<e.length;r++)if("ÿá"==(t=e[r]).slice(0,2)&&"Exif\0\0"==t.slice(4,10))return t;return null}(m(e)),this.tiftag=t?t.slice(10):null;else if(["II","MM"].indexOf(e.slice(0,2))>-1)this.tiftag=e;else{if("Exif"!=e.slice(0,4))throw new Error("Given file is neither JPEG nor TIFF.");this.tiftag=e.slice(6)}}if(r.version="1.0.4",r.remove=function(e){var t=!1;if("ÿØ"==e.slice(0,2));else{if("data:image/jpeg;base64,"!=e.slice(0,23)&&"data:image/jpg;base64,"!=e.slice(0,22))throw new Error("Given data is not jpeg.");e=l(e.split(",")[1]),t=!0}var r=m(e).filter((function(e){return!("ÿá"==e.slice(0,2)&&"Exif\0\0"==e.slice(4,10))})).join("");return t&&(r="data:image/jpeg;base64,"+c(r)),r},r.insert=function(e,t){var r=!1;if("Exif\0\0"!=e.slice(0,6))throw new Error("Given data is not exif.");if("ÿØ"==t.slice(0,2));else{if("data:image/jpeg;base64,"!=t.slice(0,23)&&"data:image/jpg;base64,"!=t.slice(0,22))throw new Error("Given data is not jpeg.");t=l(t.split(",")[1]),r=!0}var n="ÿá"+d(">H",[e.length+2])+e,i=function(e,t){var r=!1,n=[];return e.forEach((function(i,a){"ÿá"==i.slice(0,2)&&"Exif\0\0"==i.slice(4,10)&&(r?n.unshift(a):(e[a]=t,r=!0))})),n.forEach((function(t){e.splice(t,1)})),!r&&t&&(e=[e[0],t].concat(e.slice(1))),e.join("")}(m(t),n);return r&&(i="data:image/jpeg;base64,"+c(i)),i},r.load=function(e){var t;if("string"!=typeof e)throw new Error("'load' gots invalid type argument.");if("ÿØ"==e.slice(0,2))t=e;else if("data:image/jpeg;base64,"==e.slice(0,23)||"data:image/jpg;base64,"==e.slice(0,22))t=l(e.split(",")[1]);else{if("Exif"!=e.slice(0,4))throw new Error("'load' gots invalid file data.");t=e.slice(6)}var r={"0th":{},Exif:{},GPS:{},Interop:{},"1st":{},thumbnail:null},n=new u(t);if(null===n.tiftag)return r;"II"==n.tiftag.slice(0,2)?n.endian_mark="<":n.endian_mark=">";var i=p(n.endian_mark+"L",n.tiftag.slice(4,8))[0];r["0th"]=n.get_ifd(i,"0th");var a=r["0th"].first_ifd_pointer;if(delete r["0th"].first_ifd_pointer,34665 in r["0th"]&&(i=r["0th"][34665],r.Exif=n.get_ifd(i,"Exif")),34853 in r["0th"]&&(i=r["0th"][34853],r.GPS=n.get_ifd(i,"GPS")),40965 in r.Exif&&(i=r.Exif[40965],r.Interop=n.get_ifd(i,"Interop")),"\0\0\0\0"!=a&&(i=p(n.endian_mark+"L",a)[0],r["1st"]=n.get_ifd(i,"1st"),513 in r["1st"]&&514 in r["1st"])){var o=r["1st"][513]+r["1st"][514],s=n.tiftag.slice(r["1st"][513],o);r.thumbnail=s}return r},r.dump=function(e){var t,n,i,a,o,u,c=(t=e,JSON.parse(JSON.stringify(t))),l=!1,p=!1,f=!1,v=!1;n="0th"in c?c["0th"]:{},"Exif"in c&&Object.keys(c.Exif).length||"Interop"in c&&Object.keys(c.Interop).length?(n[34665]=1,l=!0,i=c.Exif,"Interop"in c&&Object.keys(c.Interop).length?(i[40965]=1,f=!0,a=c.Interop):Object.keys(i).indexOf(r.ExifIFD.InteroperabilityTag.toString())>-1&&delete i[40965]):Object.keys(n).indexOf(r.ImageIFD.ExifTag.toString())>-1&&delete n[34665],"GPS"in c&&Object.keys(c.GPS).length?(n[r.ImageIFD.GPSTag]=1,p=!0,o=c.GPS):Object.keys(n).indexOf(r.ImageIFD.GPSTag.toString())>-1&&delete n[r.ImageIFD.GPSTag],"1st"in c&&"thumbnail"in c&&null!=c.thumbnail&&(v=!0,c["1st"][513]=1,c["1st"][514]=1,u=c["1st"]);var b,y,g,q=s(n,"0th",0),A=q[0].length+12*l+12*p+4+q[1].length,I="",S=0,M="",k=0,C="",z=0,Z="";if(l&&(S=(b=s(i,"Exif",A))[0].length+12*f+b[1].length),p&&(k=(M=s(o,"GPS",A+S).join("")).length),f&&(z=(C=s(a,"Interop",A+S+k).join("")).length),v&&(y=s(u,"1st",A+S+k+z),(g=function(e){for(var t=m(e);"ÿà"<=t[1].slice(0,2)&&t[1].slice(0,2)<="ÿï";)t=[t[0]].concat(t.slice(2));return t.join("")}(c.thumbnail)).length>64e3))throw new Error("Given thumbnail is too large. max 64kB");var w="",x="",E="",O="\0\0\0\0";if(l){var K=d(">L",[W=8+A]);w=d(">H",[34665])+d(">H",[h.Long])+d(">L",[1])+K}if(p&&(K=d(">L",[W=8+A+S]),x=d(">H",[34853])+d(">H",[h.Long])+d(">L",[1])+K),f&&(K=d(">L",[W=8+A+S+k]),E=d(">H",[40965])+d(">H",[h.Long])+d(">L",[1])+K),v){var W;O=d(">L",[W=8+A+S+k+z]);var V="\0\0\0\0"+d(">L",[W+y[0].length+24+4+y[1].length]),T="\0\0\0\0"+d(">L",[g.length]);Z=y[0]+V+T+"\0\0\0\0"+y[1]+g}var L=q[0]+w+x+O+q[1];return l&&(I=b[0]+E+b[1]),"Exif\0\0MM\0*\0\0\0\b"+L+I+M+C+Z},u.prototype={get_ifd:function(e,t){var r,n={},i=p(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],a=e+2;r=["0th","1st"].indexOf(t)>-1?"Image":t;for(var o=0;o<i;o++){e=a+12*o;var s=p(this.endian_mark+"H",this.tiftag.slice(e,e+2))[0],u=[p(this.endian_mark+"H",this.tiftag.slice(e+2,e+4))[0],p(this.endian_mark+"L",this.tiftag.slice(e+4,e+8))[0],this.tiftag.slice(e+8,e+12)];s in v[r]&&(n[s]=this.convert_value(u))}return"0th"==t&&(e=a+12*i,n.first_ifd_pointer=this.tiftag.slice(e,e+4)),n},convert_value:function(e){var t,r=null,n=e[0],i=e[1],a=e[2];if(1==n)i>4?(t=p(this.endian_mark+"L",a)[0],r=p(this.endian_mark+f("B",i),this.tiftag.slice(t,t+i))):r=p(this.endian_mark+f("B",i),a.slice(0,i));else if(2==n)i>4?(t=p(this.endian_mark+"L",a)[0],r=this.tiftag.slice(t,t+i-1)):r=a.slice(0,i-1);else if(3==n)i>2?(t=p(this.endian_mark+"L",a)[0],r=p(this.endian_mark+f("H",i),this.tiftag.slice(t,t+2*i))):r=p(this.endian_mark+f("H",i),a.slice(0,2*i));else if(4==n)i>1?(t=p(this.endian_mark+"L",a)[0],r=p(this.endian_mark+f("L",i),this.tiftag.slice(t,t+4*i))):r=p(this.endian_mark+f("L",i),a);else if(5==n)if(t=p(this.endian_mark+"L",a)[0],i>1){r=[];for(var o=0;o<i;o++)r.push([p(this.endian_mark+"L",this.tiftag.slice(t+8*o,t+4+8*o))[0],p(this.endian_mark+"L",this.tiftag.slice(t+4+8*o,t+8+8*o))[0]])}else r=[p(this.endian_mark+"L",this.tiftag.slice(t,t+4))[0],p(this.endian_mark+"L",this.tiftag.slice(t+4,t+8))[0]];else if(7==n)i>4?(t=p(this.endian_mark+"L",a)[0],r=this.tiftag.slice(t,t+i)):r=a.slice(0,i);else if(9==n)i>1?(t=p(this.endian_mark+"L",a)[0],r=p(this.endian_mark+f("l",i),this.tiftag.slice(t,t+4*i))):r=p(this.endian_mark+f("l",i),a);else{if(10!=n)throw new Error("Exif might be wrong. Got incorrect value type to decode. type:"+n);if(t=p(this.endian_mark+"L",a)[0],i>1)for(r=[],o=0;o<i;o++)r.push([p(this.endian_mark+"l",this.tiftag.slice(t+8*o,t+4+8*o))[0],p(this.endian_mark+"l",this.tiftag.slice(t+4+8*o,t+8+8*o))[0]]);else r=[p(this.endian_mark+"l",this.tiftag.slice(t,t+4))[0],p(this.endian_mark+"l",this.tiftag.slice(t+4,t+8))[0]]}return r instanceof Array&&1==r.length?r[0]:r}},"undefined"!=typeof window&&"function"==typeof window.btoa)var c=window.btoa;if(void 0===c&&(c=function(e){for(var t,r,n,i,a,o,s,u="",c=0,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";c<e.length;)i=(t=e.charCodeAt(c++))>>2,a=(3&t)<<4|(r=e.charCodeAt(c++))>>4,o=(15&r)<<2|(n=e.charCodeAt(c++))>>6,s=63&n,isNaN(r)?o=s=64:isNaN(n)&&(s=64),u=u+l.charAt(i)+l.charAt(a)+l.charAt(o)+l.charAt(s);return u}),"undefined"!=typeof window&&"function"==typeof window.atob)var l=window.atob;function d(e,t){if(!(t instanceof Array))throw new Error("'pack' error. Got invalid type argument.");if(e.length-1!=t.length)throw new Error("'pack' error. "+(e.length-1)+" marks, "+t.length+" elements.");var r;if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("");r=!1}for(var n="",i=1,a=null,o=null,s=null;o=e[i];){if("b"==o.toLowerCase()){if(a=t[i-1],"b"==o&&a<0&&(a+=256),a>255||a<0)throw new Error("'pack' error.");s=String.fromCharCode(a)}else if("H"==o){if((a=t[i-1])>65535||a<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(a%65536/256))+String.fromCharCode(a%256),r&&(s=s.split("").reverse().join(""))}else{if("l"!=o.toLowerCase())throw new Error("'pack' error.");if(a=t[i-1],"l"==o&&a<0&&(a+=4294967296),a>4294967295||a<0)throw new Error("'pack' error.");s=String.fromCharCode(Math.floor(a/16777216))+String.fromCharCode(Math.floor(a%16777216/65536))+String.fromCharCode(Math.floor(a%65536/256))+String.fromCharCode(a%256),r&&(s=s.split("").reverse().join(""))}n+=s,i+=1}return n}function p(e,t){if("string"!=typeof t)throw new Error("'unpack' error. Got invalid type argument.");for(var r,n=0,i=1;i<e.length;i++)if("b"==e[i].toLowerCase())n+=1;else if("h"==e[i].toLowerCase())n+=2;else{if("l"!=e[i].toLowerCase())throw new Error("'unpack' error. Got invalid mark.");n+=4}if(n!=t.length)throw new Error("'unpack' error. Mismatch between symbol and string length. "+n+":"+t.length);if("<"==e[0])r=!0;else{if(">"!=e[0])throw new Error("'unpack' error.");r=!1}for(var a=[],o=0,s=1,u=null,c=null,l=null,d="";c=e[s];){if("b"==c.toLowerCase())l=1,u=(d=t.slice(o,o+l)).charCodeAt(0),"b"==c&&u>=128&&(u-=256);else if("H"==c)l=2,d=t.slice(o,o+l),r&&(d=d.split("").reverse().join("")),u=256*d.charCodeAt(0)+d.charCodeAt(1);else{if("l"!=c.toLowerCase())throw new Error("'unpack' error. "+c);l=4,d=t.slice(o,o+l),r&&(d=d.split("").reverse().join("")),u=16777216*d.charCodeAt(0)+65536*d.charCodeAt(1)+256*d.charCodeAt(2)+d.charCodeAt(3),"l"==c&&u>=2147483648&&(u-=4294967296)}a.push(u),o+=l,s+=1}return a}function f(e,t){for(var r="",n=0;n<t;n++)r+=e;return r}function m(e){if("ÿØ"!=e.slice(0,2))throw new Error("Given data isn't JPEG.");for(var t=2,r=["ÿØ"];;){if("ÿÚ"==e.slice(t,t+2)){r.push(e.slice(t));break}var n=t+p(">H",e.slice(t+2,t+4))[0]+2;if(r.push(e.slice(t,n)),(t=n)>=e.length)throw new Error("Wrong JPEG data.")}return r}void 0===l&&(l=function(e){var t,r,n,i,a,o,s="",u=0,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)t=c.indexOf(e.charAt(u++))<<2|(i=c.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(a=c.indexOf(e.charAt(u++)))>>2,n=(3&a)<<6|(o=c.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!=a&&(s+=String.fromCharCode(r)),64!=o&&(s+=String.fromCharCode(n));return s});var h={Byte:1,Ascii:2,Short:3,Long:4,Rational:5,Undefined:7,SLong:9,SRational:10},v={Image:{11:{name:"ProcessingSoftware",type:"Ascii"},254:{name:"NewSubfileType",type:"Long"},255:{name:"SubfileType",type:"Short"},256:{name:"ImageWidth",type:"Long"},257:{name:"ImageLength",type:"Long"},258:{name:"BitsPerSample",type:"Short"},259:{name:"Compression",type:"Short"},262:{name:"PhotometricInterpretation",type:"Short"},263:{name:"Threshholding",type:"Short"},264:{name:"CellWidth",type:"Short"},265:{name:"CellLength",type:"Short"},266:{name:"FillOrder",type:"Short"},269:{name:"DocumentName",type:"Ascii"},270:{name:"ImageDescription",type:"Ascii"},271:{name:"Make",type:"Ascii"},272:{name:"Model",type:"Ascii"},273:{name:"StripOffsets",type:"Long"},274:{name:"Orientation",type:"Short"},277:{name:"SamplesPerPixel",type:"Short"},278:{name:"RowsPerStrip",type:"Long"},279:{name:"StripByteCounts",type:"Long"},282:{name:"XResolution",type:"Rational"},283:{name:"YResolution",type:"Rational"},284:{name:"PlanarConfiguration",type:"Short"},290:{name:"GrayResponseUnit",type:"Short"},291:{name:"GrayResponseCurve",type:"Short"},292:{name:"T4Options",type:"Long"},293:{name:"T6Options",type:"Long"},296:{name:"ResolutionUnit",type:"Short"},301:{name:"TransferFunction",type:"Short"},305:{name:"Software",type:"Ascii"},306:{name:"DateTime",type:"Ascii"},315:{name:"Artist",type:"Ascii"},316:{name:"HostComputer",type:"Ascii"},317:{name:"Predictor",type:"Short"},318:{name:"WhitePoint",type:"Rational"},319:{name:"PrimaryChromaticities",type:"Rational"},320:{name:"ColorMap",type:"Short"},321:{name:"HalftoneHints",type:"Short"},322:{name:"TileWidth",type:"Short"},323:{name:"TileLength",type:"Short"},324:{name:"TileOffsets",type:"Short"},325:{name:"TileByteCounts",type:"Short"},330:{name:"SubIFDs",type:"Long"},332:{name:"InkSet",type:"Short"},333:{name:"InkNames",type:"Ascii"},334:{name:"NumberOfInks",type:"Short"},336:{name:"DotRange",type:"Byte"},337:{name:"TargetPrinter",type:"Ascii"},338:{name:"ExtraSamples",type:"Short"},339:{name:"SampleFormat",type:"Short"},340:{name:"SMinSampleValue",type:"Short"},341:{name:"SMaxSampleValue",type:"Short"},342:{name:"TransferRange",type:"Short"},343:{name:"ClipPath",type:"Byte"},344:{name:"XClipPathUnits",type:"Long"},345:{name:"YClipPathUnits",type:"Long"},346:{name:"Indexed",type:"Short"},347:{name:"JPEGTables",type:"Undefined"},351:{name:"OPIProxy",type:"Short"},512:{name:"JPEGProc",type:"Long"},513:{name:"JPEGInterchangeFormat",type:"Long"},514:{name:"JPEGInterchangeFormatLength",type:"Long"},515:{name:"JPEGRestartInterval",type:"Short"},517:{name:"JPEGLosslessPredictors",type:"Short"},518:{name:"JPEGPointTransforms",type:"Short"},519:{name:"JPEGQTables",type:"Long"},520:{name:"JPEGDCTables",type:"Long"},521:{name:"JPEGACTables",type:"Long"},529:{name:"YCbCrCoefficients",type:"Rational"},530:{name:"YCbCrSubSampling",type:"Short"},531:{name:"YCbCrPositioning",type:"Short"},532:{name:"ReferenceBlackWhite",type:"Rational"},700:{name:"XMLPacket",type:"Byte"},18246:{name:"Rating",type:"Short"},18249:{name:"RatingPercent",type:"Short"},32781:{name:"ImageID",type:"Ascii"},33421:{name:"CFARepeatPatternDim",type:"Short"},33422:{name:"CFAPattern",type:"Byte"},33423:{name:"BatteryLevel",type:"Rational"},33432:{name:"Copyright",type:"Ascii"},33434:{name:"ExposureTime",type:"Rational"},34377:{name:"ImageResources",type:"Byte"},34665:{name:"ExifTag",type:"Long"},34675:{name:"InterColorProfile",type:"Undefined"},34853:{name:"GPSTag",type:"Long"},34857:{name:"Interlace",type:"Short"},34858:{name:"TimeZoneOffset",type:"Long"},34859:{name:"SelfTimerMode",type:"Short"},37387:{name:"FlashEnergy",type:"Rational"},37388:{name:"SpatialFrequencyResponse",type:"Undefined"},37389:{name:"Noise",type:"Undefined"},37390:{name:"FocalPlaneXResolution",type:"Rational"},37391:{name:"FocalPlaneYResolution",type:"Rational"},37392:{name:"FocalPlaneResolutionUnit",type:"Short"},37393:{name:"ImageNumber",type:"Long"},37394:{name:"SecurityClassification",type:"Ascii"},37395:{name:"ImageHistory",type:"Ascii"},37397:{name:"ExposureIndex",type:"Rational"},37398:{name:"TIFFEPStandardID",type:"Byte"},37399:{name:"SensingMethod",type:"Short"},40091:{name:"XPTitle",type:"Byte"},40092:{name:"XPComment",type:"Byte"},40093:{name:"XPAuthor",type:"Byte"},40094:{name:"XPKeywords",type:"Byte"},40095:{name:"XPSubject",type:"Byte"},50341:{name:"PrintImageMatching",type:"Undefined"},50706:{name:"DNGVersion",type:"Byte"},50707:{name:"DNGBackwardVersion",type:"Byte"},50708:{name:"UniqueCameraModel",type:"Ascii"},50709:{name:"LocalizedCameraModel",type:"Byte"},50710:{name:"CFAPlaneColor",type:"Byte"},50711:{name:"CFALayout",type:"Short"},50712:{name:"LinearizationTable",type:"Short"},50713:{name:"BlackLevelRepeatDim",type:"Short"},50714:{name:"BlackLevel",type:"Rational"},50715:{name:"BlackLevelDeltaH",type:"SRational"},50716:{name:"BlackLevelDeltaV",type:"SRational"},50717:{name:"WhiteLevel",type:"Short"},50718:{name:"DefaultScale",type:"Rational"},50719:{name:"DefaultCropOrigin",type:"Short"},50720:{name:"DefaultCropSize",type:"Short"},50721:{name:"ColorMatrix1",type:"SRational"},50722:{name:"ColorMatrix2",type:"SRational"},50723:{name:"CameraCalibration1",type:"SRational"},50724:{name:"CameraCalibration2",type:"SRational"},50725:{name:"ReductionMatrix1",type:"SRational"},50726:{name:"ReductionMatrix2",type:"SRational"},50727:{name:"AnalogBalance",type:"Rational"},50728:{name:"AsShotNeutral",type:"Short"},50729:{name:"AsShotWhiteXY",type:"Rational"},50730:{name:"BaselineExposure",type:"SRational"},50731:{name:"BaselineNoise",type:"Rational"},50732:{name:"BaselineSharpness",type:"Rational"},50733:{name:"BayerGreenSplit",type:"Long"},50734:{name:"LinearResponseLimit",type:"Rational"},50735:{name:"CameraSerialNumber",type:"Ascii"},50736:{name:"LensInfo",type:"Rational"},50737:{name:"ChromaBlurRadius",type:"Rational"},50738:{name:"AntiAliasStrength",type:"Rational"},50739:{name:"ShadowScale",type:"SRational"},50740:{name:"DNGPrivateData",type:"Byte"},50741:{name:"MakerNoteSafety",type:"Short"},50778:{name:"CalibrationIlluminant1",type:"Short"},50779:{name:"CalibrationIlluminant2",type:"Short"},50780:{name:"BestQualityScale",type:"Rational"},50781:{name:"RawDataUniqueID",type:"Byte"},50827:{name:"OriginalRawFileName",type:"Byte"},50828:{name:"OriginalRawFileData",type:"Undefined"},50829:{name:"ActiveArea",type:"Short"},50830:{name:"MaskedAreas",type:"Short"},50831:{name:"AsShotICCProfile",type:"Undefined"},50832:{name:"AsShotPreProfileMatrix",type:"SRational"},50833:{name:"CurrentICCProfile",type:"Undefined"},50834:{name:"CurrentPreProfileMatrix",type:"SRational"},50879:{name:"ColorimetricReference",type:"Short"},50931:{name:"CameraCalibrationSignature",type:"Byte"},50932:{name:"ProfileCalibrationSignature",type:"Byte"},50934:{name:"AsShotProfileName",type:"Byte"},50935:{name:"NoiseReductionApplied",type:"Rational"},50936:{name:"ProfileName",type:"Byte"},50937:{name:"ProfileHueSatMapDims",type:"Long"},50938:{name:"ProfileHueSatMapData1",type:"Float"},50939:{name:"ProfileHueSatMapData2",type:"Float"},50940:{name:"ProfileToneCurve",type:"Float"},50941:{name:"ProfileEmbedPolicy",type:"Long"},50942:{name:"ProfileCopyright",type:"Byte"},50964:{name:"ForwardMatrix1",type:"SRational"},50965:{name:"ForwardMatrix2",type:"SRational"},50966:{name:"PreviewApplicationName",type:"Byte"},50967:{name:"PreviewApplicationVersion",type:"Byte"},50968:{name:"PreviewSettingsName",type:"Byte"},50969:{name:"PreviewSettingsDigest",type:"Byte"},50970:{name:"PreviewColorSpace",type:"Long"},50971:{name:"PreviewDateTime",type:"Ascii"},50972:{name:"RawImageDigest",type:"Undefined"},50973:{name:"OriginalRawFileDigest",type:"Undefined"},50974:{name:"SubTileBlockSize",type:"Long"},50975:{name:"RowInterleaveFactor",type:"Long"},50981:{name:"ProfileLookTableDims",type:"Long"},50982:{name:"ProfileLookTableData",type:"Float"},51008:{name:"OpcodeList1",type:"Undefined"},51009:{name:"OpcodeList2",type:"Undefined"},51022:{name:"OpcodeList3",type:"Undefined"}},Exif:{33434:{name:"ExposureTime",type:"Rational"},33437:{name:"FNumber",type:"Rational"},34850:{name:"ExposureProgram",type:"Short"},34852:{name:"SpectralSensitivity",type:"Ascii"},34855:{name:"ISOSpeedRatings",type:"Short"},34856:{name:"OECF",type:"Undefined"},34864:{name:"SensitivityType",type:"Short"},34865:{name:"StandardOutputSensitivity",type:"Long"},34866:{name:"RecommendedExposureIndex",type:"Long"},34867:{name:"ISOSpeed",type:"Long"},34868:{name:"ISOSpeedLatitudeyyy",type:"Long"},34869:{name:"ISOSpeedLatitudezzz",type:"Long"},36864:{name:"ExifVersion",type:"Undefined"},36867:{name:"DateTimeOriginal",type:"Ascii"},36868:{name:"DateTimeDigitized",type:"Ascii"},37121:{name:"ComponentsConfiguration",type:"Undefined"},37122:{name:"CompressedBitsPerPixel",type:"Rational"},37377:{name:"ShutterSpeedValue",type:"SRational"},37378:{name:"ApertureValue",type:"Rational"},37379:{name:"BrightnessValue",type:"SRational"},37380:{name:"ExposureBiasValue",type:"SRational"},37381:{name:"MaxApertureValue",type:"Rational"},37382:{name:"SubjectDistance",type:"Rational"},37383:{name:"MeteringMode",type:"Short"},37384:{name:"LightSource",type:"Short"},37385:{name:"Flash",type:"Short"},37386:{name:"FocalLength",type:"Rational"},37396:{name:"SubjectArea",type:"Short"},37500:{name:"MakerNote",type:"Undefined"},37510:{name:"UserComment",type:"Ascii"},37520:{name:"SubSecTime",type:"Ascii"},37521:{name:"SubSecTimeOriginal",type:"Ascii"},37522:{name:"SubSecTimeDigitized",type:"Ascii"},40960:{name:"FlashpixVersion",type:"Undefined"},40961:{name:"ColorSpace",type:"Short"},40962:{name:"PixelXDimension",type:"Long"},40963:{name:"PixelYDimension",type:"Long"},40964:{name:"RelatedSoundFile",type:"Ascii"},40965:{name:"InteroperabilityTag",type:"Long"},41483:{name:"FlashEnergy",type:"Rational"},41484:{name:"SpatialFrequencyResponse",type:"Undefined"},41486:{name:"FocalPlaneXResolution",type:"Rational"},41487:{name:"FocalPlaneYResolution",type:"Rational"},41488:{name:"FocalPlaneResolutionUnit",type:"Short"},41492:{name:"SubjectLocation",type:"Short"},41493:{name:"ExposureIndex",type:"Rational"},41495:{name:"SensingMethod",type:"Short"},41728:{name:"FileSource",type:"Undefined"},41729:{name:"SceneType",type:"Undefined"},41730:{name:"CFAPattern",type:"Undefined"},41985:{name:"CustomRendered",type:"Short"},41986:{name:"ExposureMode",type:"Short"},41987:{name:"WhiteBalance",type:"Short"},41988:{name:"DigitalZoomRatio",type:"Rational"},41989:{name:"FocalLengthIn35mmFilm",type:"Short"},41990:{name:"SceneCaptureType",type:"Short"},41991:{name:"GainControl",type:"Short"},41992:{name:"Contrast",type:"Short"},41993:{name:"Saturation",type:"Short"},41994:{name:"Sharpness",type:"Short"},41995:{name:"DeviceSettingDescription",type:"Undefined"},41996:{name:"SubjectDistanceRange",type:"Short"},42016:{name:"ImageUniqueID",type:"Ascii"},42032:{name:"CameraOwnerName",type:"Ascii"},42033:{name:"BodySerialNumber",type:"Ascii"},42034:{name:"LensSpecification",type:"Rational"},42035:{name:"LensMake",type:"Ascii"},42036:{name:"LensModel",type:"Ascii"},42037:{name:"LensSerialNumber",type:"Ascii"},42240:{name:"Gamma",type:"Rational"}},GPS:{0:{name:"GPSVersionID",type:"Byte"},1:{name:"GPSLatitudeRef",type:"Ascii"},2:{name:"GPSLatitude",type:"Rational"},3:{name:"GPSLongitudeRef",type:"Ascii"},4:{name:"GPSLongitude",type:"Rational"},5:{name:"GPSAltitudeRef",type:"Byte"},6:{name:"GPSAltitude",type:"Rational"},7:{name:"GPSTimeStamp",type:"Rational"},8:{name:"GPSSatellites",type:"Ascii"},9:{name:"GPSStatus",type:"Ascii"},10:{name:"GPSMeasureMode",type:"Ascii"},11:{name:"GPSDOP",type:"Rational"},12:{name:"GPSSpeedRef",type:"Ascii"},13:{name:"GPSSpeed",type:"Rational"},14:{name:"GPSTrackRef",type:"Ascii"},15:{name:"GPSTrack",type:"Rational"},16:{name:"GPSImgDirectionRef",type:"Ascii"},17:{name:"GPSImgDirection",type:"Rational"},18:{name:"GPSMapDatum",type:"Ascii"},19:{name:"GPSDestLatitudeRef",type:"Ascii"},20:{name:"GPSDestLatitude",type:"Rational"},21:{name:"GPSDestLongitudeRef",type:"Ascii"},22:{name:"GPSDestLongitude",type:"Rational"},23:{name:"GPSDestBearingRef",type:"Ascii"},24:{name:"GPSDestBearing",type:"Rational"},25:{name:"GPSDestDistanceRef",type:"Ascii"},26:{name:"GPSDestDistance",type:"Rational"},27:{name:"GPSProcessingMethod",type:"Undefined"},28:{name:"GPSAreaInformation",type:"Undefined"},29:{name:"GPSDateStamp",type:"Ascii"},30:{name:"GPSDifferential",type:"Short"},31:{name:"GPSHPositioningError",type:"Rational"}},Interop:{1:{name:"InteroperabilityIndex",type:"Ascii"}}};v["0th"]=v.Image,v["1st"]=v.Image,r.TAGS=v,r.ImageIFD={ProcessingSoftware:11,NewSubfileType:254,SubfileType:255,ImageWidth:256,ImageLength:257,BitsPerSample:258,Compression:259,PhotometricInterpretation:262,Threshholding:263,CellWidth:264,CellLength:265,FillOrder:266,DocumentName:269,ImageDescription:270,Make:271,Model:272,StripOffsets:273,Orientation:274,SamplesPerPixel:277,RowsPerStrip:278,StripByteCounts:279,XResolution:282,YResolution:283,PlanarConfiguration:284,GrayResponseUnit:290,GrayResponseCurve:291,T4Options:292,T6Options:293,ResolutionUnit:296,TransferFunction:301,Software:305,DateTime:306,Artist:315,HostComputer:316,Predictor:317,WhitePoint:318,PrimaryChromaticities:319,ColorMap:320,HalftoneHints:321,TileWidth:322,TileLength:323,TileOffsets:324,TileByteCounts:325,SubIFDs:330,InkSet:332,InkNames:333,NumberOfInks:334,DotRange:336,TargetPrinter:337,ExtraSamples:338,SampleFormat:339,SMinSampleValue:340,SMaxSampleValue:341,TransferRange:342,ClipPath:343,XClipPathUnits:344,YClipPathUnits:345,Indexed:346,JPEGTables:347,OPIProxy:351,JPEGProc:512,JPEGInterchangeFormat:513,JPEGInterchangeFormatLength:514,JPEGRestartInterval:515,JPEGLosslessPredictors:517,JPEGPointTransforms:518,JPEGQTables:519,JPEGDCTables:520,JPEGACTables:521,YCbCrCoefficients:529,YCbCrSubSampling:530,YCbCrPositioning:531,ReferenceBlackWhite:532,XMLPacket:700,Rating:18246,RatingPercent:18249,ImageID:32781,CFARepeatPatternDim:33421,CFAPattern:33422,BatteryLevel:33423,Copyright:33432,ExposureTime:33434,ImageResources:34377,ExifTag:34665,InterColorProfile:34675,GPSTag:34853,Interlace:34857,TimeZoneOffset:34858,SelfTimerMode:34859,FlashEnergy:37387,SpatialFrequencyResponse:37388,Noise:37389,FocalPlaneXResolution:37390,FocalPlaneYResolution:37391,FocalPlaneResolutionUnit:37392,ImageNumber:37393,SecurityClassification:37394,ImageHistory:37395,ExposureIndex:37397,TIFFEPStandardID:37398,SensingMethod:37399,XPTitle:40091,XPComment:40092,XPAuthor:40093,XPKeywords:40094,XPSubject:40095,PrintImageMatching:50341,DNGVersion:50706,DNGBackwardVersion:50707,UniqueCameraModel:50708,LocalizedCameraModel:50709,CFAPlaneColor:50710,CFALayout:50711,LinearizationTable:50712,BlackLevelRepeatDim:50713,BlackLevel:50714,BlackLevelDeltaH:50715,BlackLevelDeltaV:50716,WhiteLevel:50717,DefaultScale:50718,DefaultCropOrigin:50719,DefaultCropSize:50720,ColorMatrix1:50721,ColorMatrix2:50722,CameraCalibration1:50723,CameraCalibration2:50724,ReductionMatrix1:50725,ReductionMatrix2:50726,AnalogBalance:50727,AsShotNeutral:50728,AsShotWhiteXY:50729,BaselineExposure:50730,BaselineNoise:50731,BaselineSharpness:50732,BayerGreenSplit:50733,LinearResponseLimit:50734,CameraSerialNumber:50735,LensInfo:50736,ChromaBlurRadius:50737,AntiAliasStrength:50738,ShadowScale:50739,DNGPrivateData:50740,MakerNoteSafety:50741,CalibrationIlluminant1:50778,CalibrationIlluminant2:50779,BestQualityScale:50780,RawDataUniqueID:50781,OriginalRawFileName:50827,OriginalRawFileData:50828,ActiveArea:50829,MaskedAreas:50830,AsShotICCProfile:50831,AsShotPreProfileMatrix:50832,CurrentICCProfile:50833,CurrentPreProfileMatrix:50834,ColorimetricReference:50879,CameraCalibrationSignature:50931,ProfileCalibrationSignature:50932,AsShotProfileName:50934,NoiseReductionApplied:50935,ProfileName:50936,ProfileHueSatMapDims:50937,ProfileHueSatMapData1:50938,ProfileHueSatMapData2:50939,ProfileToneCurve:50940,ProfileEmbedPolicy:50941,ProfileCopyright:50942,ForwardMatrix1:50964,ForwardMatrix2:50965,PreviewApplicationName:50966,PreviewApplicationVersion:50967,PreviewSettingsName:50968,PreviewSettingsDigest:50969,PreviewColorSpace:50970,PreviewDateTime:50971,RawImageDigest:50972,OriginalRawFileDigest:50973,SubTileBlockSize:50974,RowInterleaveFactor:50975,ProfileLookTableDims:50981,ProfileLookTableData:50982,OpcodeList1:51008,OpcodeList2:51009,OpcodeList3:51022,NoiseProfile:51041},r.ExifIFD={ExposureTime:33434,FNumber:33437,ExposureProgram:34850,SpectralSensitivity:34852,ISOSpeedRatings:34855,OECF:34856,SensitivityType:34864,StandardOutputSensitivity:34865,RecommendedExposureIndex:34866,ISOSpeed:34867,ISOSpeedLatitudeyyy:34868,ISOSpeedLatitudezzz:34869,ExifVersion:36864,DateTimeOriginal:36867,DateTimeDigitized:36868,ComponentsConfiguration:37121,CompressedBitsPerPixel:37122,ShutterSpeedValue:37377,ApertureValue:37378,BrightnessValue:37379,ExposureBiasValue:37380,MaxApertureValue:37381,SubjectDistance:37382,MeteringMode:37383,LightSource:37384,Flash:37385,FocalLength:37386,SubjectArea:37396,MakerNote:37500,UserComment:37510,SubSecTime:37520,SubSecTimeOriginal:37521,SubSecTimeDigitized:37522,FlashpixVersion:40960,ColorSpace:40961,PixelXDimension:40962,PixelYDimension:40963,RelatedSoundFile:40964,InteroperabilityTag:40965,FlashEnergy:41483,SpatialFrequencyResponse:41484,FocalPlaneXResolution:41486,FocalPlaneYResolution:41487,FocalPlaneResolutionUnit:41488,SubjectLocation:41492,ExposureIndex:41493,SensingMethod:41495,FileSource:41728,SceneType:41729,CFAPattern:41730,CustomRendered:41985,ExposureMode:41986,WhiteBalance:41987,DigitalZoomRatio:41988,FocalLengthIn35mmFilm:41989,SceneCaptureType:41990,GainControl:41991,Contrast:41992,Saturation:41993,Sharpness:41994,DeviceSettingDescription:41995,SubjectDistanceRange:41996,ImageUniqueID:42016,CameraOwnerName:42032,BodySerialNumber:42033,LensSpecification:42034,LensMake:42035,LensModel:42036,LensSerialNumber:42037,Gamma:42240},r.GPSIFD={GPSVersionID:0,GPSLatitudeRef:1,GPSLatitude:2,GPSLongitudeRef:3,GPSLongitude:4,GPSAltitudeRef:5,GPSAltitude:6,GPSTimeStamp:7,GPSSatellites:8,GPSStatus:9,GPSMeasureMode:10,GPSDOP:11,GPSSpeedRef:12,GPSSpeed:13,GPSTrackRef:14,GPSTrack:15,GPSImgDirectionRef:16,GPSImgDirection:17,GPSMapDatum:18,GPSDestLatitudeRef:19,GPSDestLatitude:20,GPSDestLongitudeRef:21,GPSDestLongitude:22,GPSDestBearingRef:23,GPSDestBearing:24,GPSDestDistanceRef:25,GPSDestDistance:26,GPSProcessingMethod:27,GPSAreaInformation:28,GPSDateStamp:29,GPSDifferential:30,GPSHPositioningError:31},r.InteropIFD={InteroperabilityIndex:1},r.GPSHelper={degToDmsRational:function(e){var t=Math.abs(e),r=t%1*60,n=r%1*60;return[[Math.floor(t),1],[Math.floor(r),1],[Math.round(100*n),100]]},dmsRationalToDeg:function(e,t){var r="S"===t||"W"===t?-1:1;return(e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600)*r}},e.exports&&(t=e.exports=r),t.piexif=r}()})),pX=function(e,t,r){return null==e?e:function(e,t,r,n){if(!tE(e))return e;for(var i=-1,a=(t=iK(t,e)).length,o=a-1,s=e;null!=s&&++i<a;){var u=aK(t[i]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=o){var l=s[u];void 0===(c=n?n(l,u,s):void 0)&&(c=tE(l)?l:RE(t[i+1])?[]:{})}wE(s,u,c),s=s[u]}return e}(e,t,r)},fX={},mX={SELFIE:"selfie",ID_CARD:"id_card"},hX=Lj((function(e){var t=new UR,r=e||DR.join("");return t.setPublicKey(r),t})),vX=function(e){var t=e.gesture,r=e.captureTime,n=e.frames,i=e.blurScore,a=e.selfieLabel,o=e.brightnessScore,s=e.accelerometer,u=e.gyroscope;return{capture_time:r,type:t,frames:n,blur_score:i,selfie_label:a,qualify_score:e.qualifyScore,accelerometer:s,gyroscope:u,brightness_score:o}},bX=function(e){var t=e.detectedCard,r=e.captureTime,n=e.vCam,i=e.captureCount,a=e.captureDuration,o=e.captureType,s=e.cardTracking;return{capture_time:r,type:null==t?void 0:t.label,v_cam:n,capture_count:i,capture_duration:a,capture_type:o,card_tracking:s}},yX=function(){var e=Mx(qx().mark((function e(t,r){var n;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return Ex(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},e.abrupt("return",new Promise((function(e){var i=new TextEncoder,a=i.encode(t),o=i.encode(r);window.crypto.subtle.importKey("raw",o,"AES-GCM",!0,["encrypt","decrypt"]).then((function(t){window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(12),tagLength:128},t,a).then((function(t){e("".concat(oX,".").concat(n(t)))}))}))})));case 2:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),gX=function(){var e=Mx(qx().mark((function e(t){var r,n,i,a,o,s,u,c,l;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.mode,i=t.imageData,t.enableExifData){e.next=3;break}return e.abrupt("return",new Promise((function(e){return e(i.blob)})));case 3:return a=gx(gx({},fX),n===mX.SELFIE?vX(i):bX(i)),o=gx(gx({},a),{},{sensor_data:"sensor data exceed 64KB"}),null!=i&&null!==(r=i.type)&&void 0!==r&&r.includes("qr")&&(a={capture_time:null==i?void 0:i.captureTime,type:null==i?void 0:i.type,qr_string:null==i?void 0:i.result}),e.next=8,yX(JSON.stringify(o),aX);case 8:return s=e.sent,e.next=11,yX(JSON.stringify(a),aX);case 11:return u=e.sent,c=dX.dump({Exif:Zx({},dX.ExifIFD.MakerNote,u)}),l=dX.dump({Exif:Zx({},dX.ExifIFD.MakerNote,s)}),e.abrupt("return",new Promise((function(e){var t=new FileReader;t.onload=function(){var t=Mx(qx().mark((function t(r){var n,a,o;return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{n=dX.insert(c,r.target.result)}catch(t){try{n=dX.insert(l,r.target.result)}catch(t){e(i.blob)}}return t.prev=1,t.next=4,fetch(n);case 4:return a=t.sent,t.next=7,a.blob();case 7:o=t.sent,URL.revokeObjectURL(n),e(o),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(1),e(i.blob);case 15:case"end":return t.stop()}}),t,null,[[1,12]])})));return function(e){return t.apply(this,arguments)}}(),t.readAsDataURL(i.blob)})));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),qX=Object.freeze({__proto__:null,MODE:mX,initExifData:function(){fX={device_info:{device_brand_name:"".concat("none"===UK.mobileVendor?"null":UK.mobileVendor),device_model:"".concat("none"===UK.mobileModel?"null":UK.mobileModel),browser_version:"".concat(UK.browserName," ").concat(UK.browserVersion),browser_userAgent:"".concat(UK.getUA),os:UK.osName,os_version:UK.osVersion},sdk_version:"5.23.1",model_score:{id_blurry_score:"null",id_glare_score:"null"},user_action:{}}},addExifData:function(e,t){pX(fX,e,t)},preWriteExif:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mode,r=(e.motionData,e.orientationData,e.startTime),n=e.endTime,i=e.exifKey,a=void 0===i?"":i;fX.user_action=gx({},t===mX.SELFIE?{start_selfie:r,end_selfie:n}:{start_id_card:r,end_id_card:n}),aX=YK().replace(/-/g,""),iX||(iX=hX(a)),oX=nR(iX.encrypt(aX))},writeExif:gX}),AX=function(e,t,r){(void 0!==r&&!Tx(e[t],r)||void 0===r&&!(t in e))&&zE(e,t,r)},IX=function(e,t,r){for(var n=-1,i=Object(e),a=r(e),o=a.length;o--;){var s=a[++n];if(!1===t(i[s],s,i))break}return e},SX=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},MX=function(e,t,r,n,i,a,o){var s=SX(e,r),u=SX(t,r),c=o.get(u);if(c)AX(e,r,c);else{var l=a?a(s,u,r+"",e,t,o):void 0,d=void 0===l;if(d){var p=LE(u),f=!p&&PE(u),m=!p&&!f&&FE(u);l=u,p||f||m?LE(s)?l=s:function(e){return EE(e)&&tO(e)}(s)?l=sO(s):f?(d=!1,l=oO(u,!0)):m?(d=!1,l=VO(u,!0)):l=[]:mK(u)||TE(u)?(l=s,TE(s)?l=function(e){return xE(e,aO(e))}(s):tE(s)&&!rE(s)||(l=PO(u))):d=!1}d&&(o.set(u,l),i(l,u,n,a,o),o.delete(u)),AX(e,r,l)}},kX=function e(t,r,n,i,a){t!==r&&IX(r,(function(o,s){if(a||(a=new kE),tE(o))MX(t,r,s,n,e,i,a);else{var u=i?i(SX(t,s),o,s+"",t,r,a):void 0;void 0===u&&(u=o),AX(t,s,u)}}),aO)},CX=function(e,t){return zK(IK(e,t,MK),e+"")},zX=function(e,t,r){if(!tE(r))return!1;var n=rv(t);return!!("number"==n?tO(r)&&RE(t,r.length):"string"==n&&t in r)&&Tx(r[t],e)},ZX=function(e){return CX((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&zX(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t}))},wX=ZX((function(e,t,r,n){kX(e,t,r,n)})),xX={enableGetClientSettings:!0,enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:!0,enableVerifySanityIDCard:!0,enableVerifyFaceLiveness:!0,enableDetectIDCardTampering:!0,enableReadIDCardInfo:!0,enableRegisterFace:!0,enableAuthenticateFace:!0},EX=Object.freeze({__proto__:null,getEnabledServices:function(e,t){var r=function(e){if(!e)return xX;var t=e.enableUploadFrames,r=e.enableUploadImages,n=void 0===r||r,i=e.enableGetClientSettings,a=n&&e.enableVerifySanityPortrait,o=n&&e.enableVerifySanityIDCard,s=n&&e.enableDetectIDCardTampering,u=n&&e.enableReadIDCardInfo;return{enableGetClientSettings:i,enableUploadFrames:t,enableUploadImages:n,enableVerifySanityPortrait:a,enableVerifySanityIDCard:o,enableVerifyFaceLiveness:n&&e.enableVerifyFaceLiveness,enableDetectIDCardTampering:s,enableReadIDCardInfo:u,enableRegisterFace:n&&e.enableRegisterFace,enableAuthenticateFace:n&&e.enableAuthenticateFace}}(e),n=function(e){return{enableGetClientSettings:!0,enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:sN(e,"data.settings.enable_verify_portrait_sanity",!0),enableVerifySanityIDCard:sN(e,"data.settings.enable_verify_id_card_sanity",!0),enableVerifyFaceLiveness:sN(e,"data.settings.enable_verify_face_liveness",!0),enableDetectIDCardTampering:sN(e,"data.settings.enable_detect_id_card_tampering",!0),enableReadIDCardInfo:sN(e,"data.settings.enable_read_id_card_info",!0),enableRegisterFace:sN(e,"data.settings.enable_face_registration",!0),enableAuthenticateFace:sN(e,"data.settings.enable_face_authentication",!0)}}(t),i=gx({},xX);return wX(i,r,n,(function(e,t){return(null==e||e)&&(null==t||t)}))}}),OX=function(e){var t=e.slice(0,2),r=e.slice(2,4),n=e.slice(4,8);return new Date("".concat(n,"-").concat(r,"-").concat(t))},KX=function(e){return!Number.isNaN(e.getTime())&&e<=new Date},WX={CCCD:{validate:function(e){var t=e.split("|"),r=OX(t[3]),n=OX(t[6]);return 7===t.length&&Boolean(e.match(/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}$/g))&&KX(r)&&KX(n)&&r<n}},TCC:{validate:function(e){var t=e.split("|"),r=OX(t[3]),n=OX(t[6]);return 11===t.length&&Boolean(e.match(/^\d{12}\|(\d{9})?\|.+\|\d{8}\|((Nam)|(Nữ))\|.+\|\d{8}/g))&&KX(r)&&KX(n)&&r<n}}},VX=Object.freeze({__proto__:null,validateIdQRContent:function(e){var t=function(e){var t=e[6];if(!t||8!==t.length)return null;var r=OX(t);return KX(r)?r>=new Date("2024-07-01")?WX.TCC:WX.CCCD:null}(e.split("|"));return t?{valid:t.validate(e)}:{valid:!1}}}),TX=function(e){return e===vx.ACTIVE?"active":e===vx.PASSIVE?"passive":"string"==typeof e&&e.startsWith("flash")?"flash":"active"},LX=Object.freeze({__proto__:null,getLivenessMode:TX}),NX="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.0.2/models/close-eyes/closed_eye_detector.tflite",PX=function(){return zx((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NX,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.342,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:368,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;kx(this,e),this.model_path=t,this.threshold=r,this.size=Math.round(n/2),this.enable_profiling=i,this.num_threads=a}),[{key:"load",value:(t=Mx(qx().mark((function e(){var t,r,n,i=this;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window,r=t.tf,e.next=3,Xj({modelUrl:this.model_path,options:{numThreads:this.num_threads,enableProfiling:this.enable_profiling}});case 3:this.model=e.sent,n=this.model.inputs[0],this.input_width=n.shape[1],this.input_height=n.shape[2],r.tidy((function(){var e=r.randomNormal([1,i.input_width,i.input_height,3]);i.model.predict(e)}));case 8:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"crop_eyes",value:function(e,t){var r=this,n=window.tf,i=t[0].map((function(e){return Math.round(e)})),a=t[1].map((function(e){return Math.round(e)}));i[0]>a[0]&&(i=t[1].map((function(e){return Math.round(e)})),a=t[0].map((function(e){return Math.round(e)})));var o=Math.round((i[0]+a[0])/2),s=o-i[0],u=a[0]-o;s>=this.size&&(s=this.size),u>=this.size&&(u=this.size);var c=Math.max(i[0]-s,0),l=Math.max(i[1]-s,0),d=Math.max(a[0]-u,0),p=Math.max(a[1]-u,0);return n.tidy((function(){var t=e.slice([l,c,0],[2*s,2*s,3]),i=e.slice([p,d,0],[2*u,2*u,3]);return{l_img:t=n.expandDims(n.image.resizeBilinear(t,[r.input_width,r.input_height])),r_img:i=n.expandDims(n.image.resizeBilinear(i,[r.input_width,r.input_height]))}}))}},{key:"predict",value:(e=Mx(qx().mark((function e(t,r){var n,i,a,o,s,u,c,l,d,p=this,f=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=f.length>2&&void 0!==f[2]?f[2]:this.threshold,i=window,a=i.tf,o=t.getContext("2d"),s=o.getImageData(0,0,t.height,t.width),u=a.tidy((function(){var e=a.browser.fromPixels(s),t=p.crop_eyes(e,r),i=t.l_img,o=t.r_img,u=p.model.predict(i).arraySync()[0],c=p.model.predict(o).arraySync()[0];return[u>n,c>n]})),c=xx(u,2),l=c[0],d=c[1],e.abrupt("return",{isEyeClose:l||d});case 6:case"end":return e.stop()}}),e,this)}))),function(t,r){return e.apply(this,arguments)})}]);var e,t}(),jX="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.1.0/libs/opencv-4.9.0.js",RX=Lj(function(){var e=Mx(qx().mark((function e(){var t,r,n,i=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:{},r=t.url,n=void 0===r?jX:r,e.abrupt("return",new Promise((function(e,t){try{if(window.cv)return void e();var r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("type","text/javascript"),r.setAttribute("id","opencvjs"),r.addEventListener("load",Mx(qx().mark((function t(){return qx().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!window.cv||!window.cv.getBuildInformation){t.next=4;break}e(),t.next=12;break;case 4:if(!(window.cv instanceof Promise)){t.next=11;break}return t.next=7,window.cv;case 7:window.cv=t.sent,e(),t.next=12;break;case 11:window.cv.onRuntimeInitialized=function(){e()};case 12:case"end":return t.stop()}}),t)})))),r.addEventListener("error",(function(){t()})),r.src=n;var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(r,i)}catch(e){console.error(e)}})));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()),XX=zx((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.02,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:127.5,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.3855;kx(this,e),this.c1=t,this.c2=r,this.maxDiffThreshold=n}),[{key:"sigMoid",value:function(e){var t=window.cv;e.convertTo(e,t.CV_32FC3);var r=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(this.c2,this.c2,this.c2)),n=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(-this.c1,-this.c1,-this.c1)),i=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(1,1,1));return t.subtract(e,r,e),t.multiply(e,n,e),t.exp(e,e),t.add(e,i,e),t.divide(i,e,e),r.delete(),n.delete(),i.delete(),e}},{key:"faceResize",value:function(e,t){var r=window.cv,n=new r.Mat,i=e.rows<t.height?r.INTER_CUBIC:r.INTER_AREA;return r.resize(e,n,t,0,0,i),n}},{key:"checkValidFaceSide",value:function(e){return e.every((function(e){return!e.empty()}))}},{key:"divideFace",value:function(e,t){var r=window.cv;if(0===t.length)return[!1,[null,null,null,null,null]];var n=t[0],i=n[0],a=n[1],o=n[2],s=n[3],u=e.roi(new r.Rect(s,i,a-s,o-i)),c=e.roi(new r.Rect(s,i,(a-s)/2,(o-i)/2)),l=e.roi(new r.Rect(s,i+(o-i)/2,(a-s)/2,(o-i)/2)),d=e.roi(new r.Rect(s+(a-s)/2,i,(a-s)/2,(o-i)/2)),p=e.roi(new r.Rect((a+s)/2,(o+i)/2,(a-s)/2,(o-i)/2));if(!this.checkValidFaceSide([u,c,l,d,p]))return u.delete(),c.delete(),l.delete(),d.delete(),p.delete(),[!1,[null,null,null,null,null]];var f=this.faceResize(c,new r.Size(80,128)),m=this.faceResize(l,new r.Size(80,128)),h=this.faceResize(d,new r.Size(80,128)),v=this.faceResize(p,new r.Size(80,128)),b=this.faceResize(u,new r.Size(320,512));return u.delete(),c.delete(),l.delete(),d.delete(),p.delete(),[!0,[f,m,h,v,b]]}},{key:"measureBrightness",value:function(e,t){if("hls"!==t&&"arithmetic"!==t)return-1;var r=window.cv;if("arithmetic"===t){var n=this.sigMoid(e);r.multiply(n,n,n);var i=new r.MatVector;r.split(n,i);for(var a=i.get(0),o=1;o<i.size();o+=1){var s=i.get(o);r.add(a,s,a),s.delete()}r.sqrt(a,a);var u=new r.Mat(a.rows,a.cols,a.type(),new r.Scalar(Math.sqrt(3)));r.divide(a,u,a);var c=r.mean(a);return u.delete(),i.delete(),a.delete(),c[0]}if("hls"===t){var l=new r.Mat;r.cvtColor(e,l,r.COLOR_RGB2HLS);var d=new r.MatVector;r.split(l,d);var p=d.get(1);p=this.sigMoid(p);var f=r.mean(p);return l.delete(),d.delete(),p.delete(),f[0]}return-1}},{key:"predict",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"hls",n=null;try{var i=window,a=i.cv;n=a.imread(e);var o=this.divideFace(n,t),s=o[0],u=o[1],c=[],l=null;if(!s)return n.delete(),l;var d,p=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY,m=Wx(u);try{for(m.s();!(d=m.n()).done;){var h=d.value,v=this.measureBrightness(h,r);c.push(v),p=Math.max(p,v),f=Math.min(f,v),h.delete()}}catch(e){m.e(e)}finally{m.f()}var b=p-f;return l=b>this.maxDiffThreshold?f:c[c.length-1],n.delete(),l}catch(e){return n&&n.delete(),console.error(e),null}}},{key:"score",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,a=this.predict(e,t,i);return null===a?{score:1,message:"good"}:a<r?{score:a,message:"face_too_dark"}:a>n?{score:a,message:"face_too_bright"}:{score:a,message:"good"}}}],[{key:"hasBetterBrightnessScore",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null===t||e-t>r}},{key:"hasSameBrightnessScore",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return null!==t&&Math.abs(e-t)<r}},{key:"METHOD",get:function(){return{HLS:"hls",ARITHMETIC:"arithmetic"}}},{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.opencvUrl;return FW(this,void 0,void 0,qx().mark((function e(){return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,RX({url:t});case 2:case"end":return e.stop()}}),e)})))}},{key:"log",value:function(){var e=window.cv;console.log("build info",e.getBuildInformation())}}]),BX="https://cdn.jsdelivr.net/npm/@tsocial/tv_web_sdk_resources@2.2.0/models/qualify/qualify_model.tflite",GX=[.50612009,.42543493,.38282761],YX=[.26589054,.24521921,.24127836],HX=["normal","beard","mask_chin"],FX={0:"normal",1:"beard",2:"mask",3:"object",4:"mask_chin"},UX={beard:.3689,mask:.6337,mask_chin:.2315,object:.3942,normal:.5541};function DX(e,t,r){return Math.max(t,Math.min(e,r))}function JX(e){for(var t=0,r=1;r<e.length;r++)e[r]>e[t]&&(t=r);return t}var QX=function(){return zx((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:BX;kx(this,e),this.modelPath=t}),[{key:"init",value:(t=Mx(qx().mark((function e(){var t,r,n=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},r=t.opencvUrl,e.next=3,RX({url:r});case 3:return e.next=5,Xj({modelUrl:this.modelPath});case 5:this.model=e.sent;case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"normalize",value:function(e){var t=window.cv,r=255;e.convertTo(e,t.CV_32FC3);var n=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(r*GX[0],r*GX[1],r*GX[2])),i=new t.Mat(e.rows,e.cols,e.type(),new t.Scalar(r*YX[0],r*YX[1],r*YX[2]));return t.subtract(e,n,e),t.divide(e,i,e),n.delete(),i.delete(),e}},{key:"transform",value:function(e){var t=window.cv,r=new t.Mat;return t.resize(e,r,new t.Size(224,224)),e.delete(),this.normalize(r)}},{key:"forward",value:function(e){var t=window,r=t.tf,n=t.cv;n.cvtColor(e,e,n.COLOR_RGBA2RGB);var i=r.tensor(e.data32F,[e.rows,e.cols,e.channels()]);e.delete();var a=r.transpose(i,[2,0,1]),o=r.expandDims(a,0),s=this.model.predict(o);return i.dispose(),a.dispose(),o.dispose(),Array.from(s.dataSync())}},{key:"process",value:function(e){e=this.transform(e);var t=this.forward(e),r=Math.log(function(e){for(var t=0,r=0;r<e.length;r++)t+=e[r];return t}(function(e){for(var t=[],r=0;r<e.length;r++)t[r]=Math.exp(e[r]);return t}(t))),n=function(e){for(var t=[],r=0,n=Math.max.apply(Math,Ex(e)),i=0;i<e.length;i++)e[i]=Math.exp(e[i]-n),r+=e[i];for(var a=0;a<e.length;a++)t[a]=e[a]/r;return t}(t);return[r,Math.max.apply(Math,Ex(n)),n]}},{key:"cropFace",value:function(e,t){var r=t[0],n=t[1],i=t[3],a=Math.floor(n[0]-r[0]),o=Math.max(0,Math.floor(r[0]-1*a)),s=Math.max(0,Math.floor(r[1]-1.3*a)),u=Math.min(Math.floor(n[0]+1*a),e.cols),c=Math.min(Math.floor(i[1]+.9*a),e.rows),l=window.cv;return e.roi(new l.Rect(o,s,u-o,c-s))}},{key:"predict",value:(e=Mx(qx().mark((function e(t,r){var n,i,a,o,s,u,c,l,d,p,f,m,h,v,b,y,g=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=g.length>2&&void 0!==g[2]?g[2]:.11,i=g.length>3&&void 0!==g[3]?g[3]:HX,e.prev=2,a=window,o=a.cv,s=o.imread(t),u=this.cropFace(s,r),s.delete(),c=this.process(u),l=xx(c,3),d=l[0],p=l[1],f=l[2],m=DX(d,5,23),h=1-(m-5)/18,v=JX(f),b=FX[v],!(h>n)){e.next=15;break}return e.abrupt("return",[!1,h]);case 15:y=0;case 16:if(!(y<i.length)){e.next=22;break}if(b!==i[y]){e.next=19;break}return e.abrupt("return",[!0,0]);case 19:y++,e.next=16;break;case 22:if(!(p<UX[b])){e.next=24;break}return e.abrupt("return",[!0,0]);case 24:return e.abrupt("return",[!1,1]);case 27:return e.prev=27,e.t0=e.catch(2),console.error("NotQualifiedDetector error",e.t0),e.abrupt("return",[!0,0]);case 31:case"end":return e.stop()}}),e,this,[[2,27]])}))),function(t,r){return e.apply(this,arguments)})}]);var e,t}(),_X=function(){var e=Mx(qx().mark((function e(){return qx().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 $X(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.dataRate,r=void 0===t?100:t,n=db.useRef([]),i=db.useRef([]),a=(db.useRef(!1),db.useRef({})),o=db.useCallback((function(e){var t=Date.now(),n=e.type;return!!(a.current[n]&&t-a.current[n]<r)||(a.current[n]=t,!1)}),[r]),s=db.useCallback((function(e){o(e)||i.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})}),[o]),u=db.useCallback((function(e){var t,r,i,a,s,u;o(e)||n.current.push({time:Date.now(),Accelerometer:{x:null==e||null===(t=e.acceleration)||void 0===t?void 0:t.x,y:null==e||null===(r=e.acceleration)||void 0===r?void 0:r.y,z:null==e||null===(i=e.acceleration)||void 0===i?void 0:i.z},Gyroscope:{z:null==e||null===(a=e.rotationRate)||void 0===a?void 0:a.alpha,x:null==e||null===(s=e.rotationRate)||void 0===s?void 0:s.beta,y:null==e||null===(u=e.rotationRate)||void 0===u?void 0:u.gamma}})}),[o]),c=db.useCallback((function(){}),[u,s]),l=db.useCallback((function(){}),[u,s]);return db.useEffect((function(){return function(){l()}}),[l]),{motionData:n.current,orientationData:i.current,startMotion:c,stopMotion:l}}var eB=ZX((function(e,t,r,n){xE(t,aO(t),e,n)})),tB=function(e){if(!EE(e))return!1;var t=eE(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!mK(e)},rB=CX((function(e,t){try{return qK(e,void 0,t)}catch(e){return tB(e)?e:new Error(e)}})),nB=Object.prototype,iB=nB.hasOwnProperty,aB=function(e,t,r,n){return void 0===e||Tx(e,nB[r])&&!iB.call(n,r)?t:e},oB={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},sB=function(e){return"\\"+oB[e]},uB=/<%=([\s\S]+?)%>/g,cB=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),lB=/[&<>"']/g,dB=RegExp(lB.source),pB={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:uB,variable:"",imports:{_:{escape:function(e){return(e=nK(e))&&dB.test(e)?e.replace(lB,cB):e}}}},fB=/\b__p \+= '';/g,mB=/\b(__p \+=) '' \+/g,hB=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vB=/[()=,{}\[\]\/\s]/,bB=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yB=/($^)/,gB=/['\n\r\u2028\u2029\\]/g,qB=Object.prototype.hasOwnProperty,AB=function(e,t,r){var n=pB.imports._.templateSettings||pB;r&&zX(e,t,r)&&(t=void 0),e=nK(e),t=eB({},t,n,aB);var i,a,o=eB({},t.imports,n.imports,aB),s=rO(o),u=function(e,t){return Vx(t,(function(t){return e[t]}))}(o,s),c=0,l=t.interpolate||yB,d="__p += '",p=RegExp((t.escape||yB).source+"|"+l.source+"|"+(l===uB?bB:yB).source+"|"+(t.evaluate||yB).source+"|$","g"),f=qB.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(p,(function(t,r,n,o,s,u){return n||(n=o),d+=e.slice(c,u).replace(gB,sB),r&&(i=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=u+t.length,t})),d+="';\n";var m=qB.call(t,"variable")&&t.variable;if(m){if(vB.test(m))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(fB,""):d).replace(mB,"$1").replace(hB,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var h=rB((function(){return Function(s,f+"return "+d).apply(void 0,u)}));if(h.source=d,tB(h))throw h;return h},IB=function(){var e=YW();return db.useCallback((function(t,r){var n,i;return r?AB(null!==(i=e[t])&&void 0!==i?i:t)(r):null!==(n=e[t])&&void 0!==n?n:t}),[e])},SB=function(e){db.useEffect((function(){!function(e){new Promise((function(t,r){var n=new Image;n.onload=t,n.onerror=r,n.src=e}))}(e)}),[e])},MB=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']))},kB=ZX((function(e,t,r){kX(e,t,r)})),CB=JK(),zB=zx((function e(t){var r=this,n=t.container,i=t.lang,a=void 0===i?"vi":i,o=t.assetRoot,s=t.resourceRoot,u=t.customUrls,c=void 0===u?{}:u,l=t.enableAntiDebug,d=void 0===l||l,p=t.warmupMessage,f=t.baseComponent,m=t.component,h=void 0===m?{}:m,v=t.country,b=void 0===v?"vn":v,y=t.idCardContext,g=t.exifKey,q=void 0===g?"":g,A=t.themeVersion,I=void 0===A?"v2":A,S=t.enableVoice,M=void 0!==S&&S;kx(this,e),Zx(this,"getDeviceInfo",Mx(qx().mark((function e(){var t,r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={id:null,udid:null,sn:null,imei:null,manufacturer:QK(),deviceName:_K(),wlanMac:null,phoneNumber:null,location:{latitude:null,longitude:null}},e.next=3,uj();case 3:return r=e.sent,t.location.latitude=(null==r?void 0:r.lat)||null,t.location.longitude=(null==r?void 0:r.long)||null,e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})))),Zx(this,"initNativeCamera",(function(e){var t=document.createElement("div");document.body.appendChild(t);var n=db.createRef(),i=r.component.NativeCamera;return dx.render(db.createElement(i,wx({},e,{ref:n})),t),{openCamera:function(){n.current.click()}}})),Zx(this,"runWarmUpReadIDCard",Mx(qx().mark((function e(){var t;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.commonSettings.customUrls,e.abrupt("return",r.component.warmUpReadIdCard(t));case 2:case"end":return e.stop()}}),e)})))),Zx(this,"runPreloadEKYCResources",Mx(qx().mark((function e(){var t;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=r.commonSettings.customUrls,r.component.preloadEKYCResources(t);case 2:case"end":return e.stop()}}),e)})))),Zx(this,"destroyView",(function(){dx.unmountComponentAtNode(r.container)})),function(e,t,r,n,i,a,o,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,i,a,o,s],l=0;(u=new Error(t.replace(/%s/g,(function(){return c[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}(n,"container is a required parameter"),this.container=n,this.container.style="touch-action: none; -ms-touch-action: none;";var k=EK({resourceRoot:s,initCustomUrls:c,country:b});this.commonSettings=gx({lang:a,assetRoot:o,customUrls:k,enableAntiDebug:d,debug:!1,warmupMessage:p,country:b,exifKey:q,themeVersion:I,enableVoice:M},y),this.component=kB({},f,h)}),[{key:"checkCamera",value:function(){return(0,this.component.checkCamera)()}},{key:"getListCamera",value:function(){return(0,this.component.getListCamera)()}},{key:"readIDCardWithApiCall",value:function(e){var t=this.component.ReadIDCardWithApiCall,r=gx(gx({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{});dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(BW,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:r}},db.createElement($W,{mode:"id_card"},db.createElement(t,wx({onClose:this.destroyView},e))))),this.container)}},{key:"readIDCardUIOnly",value:function(e){var t,r=this.component.ReadIDCardUIOnly,n=gx(gx({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{});dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(BW,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:n}},db.createElement(pN,{clientSettings:null!==(t=null==e?void 0:e.clientSettings)&&void 0!==t?t:{},onError:null==e?void 0:e.onError},db.createElement($W,{mode:"id_card"},db.createElement(r,wx({onClose:this.destroyView},e)))))),this.container)}},{key:"livenessDetection",value:function(e){var t=this.component,r=t.LivenessDetection,n=t.CustomComponent,i=gx(gx(gx(gx({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{}),(null==e?void 0:e.customInstructions)||{}),(null==e?void 0:e.customMessages)||{});dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(BW,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:i}},db.createElement($W,{mode:TX(e.mode)},db.createElement(r,wx({onClose:this.destroyView},e,{customComponent:n}))))),this.container)}},{key:"ekycFlow",value:function(e){var t=this.component.EkycFlow,r=(null==e?void 0:e.customTexts)||{};dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(BW,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:r}},db.createElement(t,wx({onClose:this.destroyView},e)))),this.container)}},{key:"flashLiveness",value:function(e){var t=this.component.FlashLiveness;dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(t,wx({onClose:this.destroyView},e))),this.container)}},{key:"faceAuthentication",value:function(e){var t=this.component,r=t.FaceAuthentication,n=t.LivenessDetection,i=t.CustomComponent,a=gx(gx(gx(gx({},(null==e?void 0:e.customTexts)||{}),(null==e?void 0:e.customErrors)||{}),(null==e?void 0:e.customInstructions)||{}),(null==e?void 0:e.customMessages)||{});dx.render(db.createElement(KK,{value:this.commonSettings},db.createElement(BW,{value:{lang:this.commonSettings.lang,country:this.commonSettings.country,customTexts:a}},db.createElement($W,{mode:TX(e.authMethod)},db.createElement(r,wx({onClose:this.destroyView},e,{livenessDetectionComponent:n,customComponent:i}))))),this.container)}},{key:"compareFaces",value:function(e){var t=e.accessKey,r=e.secretKey,n=e.apiUrl,i=e.image1,a=e.image2,o=e.onSuccess,s=e.onError;bj(new NK(t,r,n,{httpHeaders:CB})).compareFaces({image1:{id:i},image2:{id:a}}).then((function(e){o(e)})).catch((function(e){s(e)}))}}]),ZB=JK(),wB=function(){return zx((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(kx(this,e),t&&r&&n){var i=hW({userId:""});this.apiClient=bj(new NK(t,r,n,{httpHeaders:gx(gx({},ZB),{},{"x-request-id":i})}))}else this.apiClient=null;this.clientSettings=this.clientSettings.bind(this),this.uploadImage=this.uploadImage.bind(this),this.uploadFiles=this.uploadFiles.bind(this),this.requestVerifyIDCard=this.requestVerifyIDCard.bind(this),this.detectIDTampering=this.detectIDTampering.bind(this),this.readIDCard=this.readIDCard.bind(this),this.requestVerifyPortrait=this.requestVerifyPortrait.bind(this),this.verifyFaceLiveness=this.verifyFaceLiveness.bind(this),this.compareFaces=this.compareFaces.bind(this),this.searchFaces=this.searchFaces.bind(this),this.indexFaces=this.indexFaces.bind(this)}),[{key:"clientSettings",value:(l=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.clientSettings(t);case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"uploadImage",value:(c=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.uploadImage(t);case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"uploadFiles",value:(u=Mx(qx().mark((function e(t){var r,n,i=arguments;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i.length>1&&void 0!==i[1]?i[1]:{},!this.apiClient){e.next=6;break}return e.next=4,this.apiClient.httpClient.post("/v1/files",t,r);case 4:return n=e.sent,e.abrupt("return",n);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"requestVerifyIDCard",value:(s=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.requestVerifyIDCard(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"detectIDTampering",value:(o=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.detectIDTampering(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"readIDCard",value:(a=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.readIDCard(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"requestVerifyPortrait",value:(i=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.requestVerifyPortrait(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"verifyFaceLiveness",value:(n=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.verifyFaceLiveness(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"compareFaces",value:(r=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.compareFaces(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"searchFaces",value:(t=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.searchFaces(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"indexFaces",value:(e=Mx(qx().mark((function e(t){var r;return qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apiClient){e.next=5;break}return e.next=3,this.apiClient.indexFaces(t);case 3:return r=e.sent,e.abrupt("return",{result:r});case 5:case"end":return e.stop()}}),e,this)}))),function(t){return e.apply(this,arguments)})}]);var e,t,r,n,i,a,o,s,u,c,l}();function xB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function EB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xB(Object(r),!0).forEach((function(t){LB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function OB(){OB=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof v?t:v,o=Object.create(a.prototype),s=new w(n||[]);return i(o,"_invoke",{value:k(e,r,s)}),o}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",f="executing",m="completed",h={};function v(){}function b(){}function y(){}var g={};c(g,o,(function(){return this}));var q=Object.getPrototypeOf,A=q&&q(q(x([])));A&&A!==r&&n.call(A,o)&&(g=A);var I=y.prototype=v.prototype=Object.create(g);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function M(e,t){function r(i,a,o,s){var u=d(e[i],e,a);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==rv(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(l).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return a=a?a.then(i,i):i()}})}function k(t,r,n){var i=p;return function(a,o){if(i===f)throw Error("Generator is already running");if(i===m){if("throw"===a)throw o;return{value:e,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=f;var c=d(t,r,n);if("normal"===c.type){if(i=n.done?m:"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function C(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var a=d(i,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,h;var o=a.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function z(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function Z(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(z,this),this.reset(!0)}function x(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function r(){for(;++i<t.length;)if(n.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(rv(t)+" is not iterable")}return b.prototype=y,i(I,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:b,configurable:!0}),b.displayName=c(y,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,u,"GeneratorFunction")),e.prototype=Object.create(I),e},t.awrap=function(e){return{__await:e}},S(M.prototype),c(M.prototype,s,(function(){return this})),t.AsyncIterator=M,t.async=function(e,r,n,i,a){void 0===a&&(a=Promise);var o=new M(l(e,r,n,i),a);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(I),c(I,u,"Generator"),c(I,o,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=x,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(Z),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function i(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),Z(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;Z(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function KB(e){var t=function(e,t){if("object"!=rv(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=rv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==rv(t)?t:t+""}function WB(e){return(WB="function"==typeof Symbol&&"symbol"==rv(Symbol.iterator)?function(e){return rv(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":rv(e)})(e)}function VB(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function TB(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){VB(a,n,i,o,s,"next",e)}function s(e){VB(a,n,i,o,s,"throw",e)}o(void 0)}))}}function LB(e,t,r){return(t=KB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NB(){return(NB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function PB(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function jB(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||XB(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function RB(e){return function(e){if(Array.isArray(e))return BB(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||XB(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function XB(e,t){if(e){if("string"==typeof e)return BB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?BB(e,t):void 0}}function BB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var GB=Array.isArray,YB="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function HB(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var FB,UB="object"==rv(YB)&&YB&&YB.Object===Object&&YB,DB="object"==("undefined"==typeof self?"undefined":rv(self))&&self&&self.Object===Object&&self,JB=UB||DB||Function("return this")(),QB=JB.Symbol,_B=Object.prototype,$B=_B.hasOwnProperty,eG=_B.toString,tG=QB?QB.toStringTag:void 0,rG=Object.prototype.toString,nG=QB?QB.toStringTag:void 0,iG=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":nG&&nG in Object(e)?function(e){var t=$B.call(e,tG),r=e[tG];try{e[tG]=void 0;var n=!0}catch(e){}var i=eG.call(e);return n&&(t?e[tG]=r:delete e[tG]),i}(e):function(e){return rG.call(e)}(e)},aG=function(e){return null!=e&&"object"==rv(e)},oG=function(e){return"symbol"==rv(e)||aG(e)&&"[object Symbol]"==iG(e)},sG=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uG=/^\w*$/,cG=function(e){var t=rv(e);return null!=e&&("object"==t||"function"==t)},lG=function(e){if(!cG(e))return!1;var t=iG(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},dG=JB["__core-js_shared__"],pG=(FB=/[^.]+$/.exec(dG&&dG.keys&&dG.keys.IE_PROTO||""))?"Symbol(src)_1."+FB:"",fG=Function.prototype.toString,mG=/^\[object .+?Constructor\]$/,hG=Function.prototype,vG=Object.prototype,bG=hG.toString,yG=vG.hasOwnProperty,gG=RegExp("^"+bG.call(yG).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qG=function(e){return!(!cG(e)||function(e){return!!pG&&pG in e}(e))&&(lG(e)?gG:mG).test(function(e){if(null!=e){try{return fG.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))},AG=function(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return qG(r)?r:void 0},IG=AG(Object,"create"),SG=Object.prototype.hasOwnProperty,MG=Object.prototype.hasOwnProperty;function kG(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}kG.prototype.clear=function(){this.__data__=IG?IG(null):{},this.size=0},kG.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},kG.prototype.get=function(e){var t=this.__data__;if(IG){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return SG.call(t,e)?t[e]:void 0},kG.prototype.has=function(e){var t=this.__data__;return IG?void 0!==t[e]:MG.call(t,e)},kG.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=IG&&void 0===t?"__lodash_hash_undefined__":t,this};var CG=kG,zG=function(e,t){return e===t||e!=e&&t!=t},ZG=function(e,t){for(var r=e.length;r--;)if(zG(e[r][0],t))return r;return-1},wG=Array.prototype.splice;function xG(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}xG.prototype.clear=function(){this.__data__=[],this.size=0},xG.prototype.delete=function(e){var t=this.__data__,r=ZG(t,e);return!(r<0||(r==t.length-1?t.pop():wG.call(t,r,1),--this.size,0))},xG.prototype.get=function(e){var t=this.__data__,r=ZG(t,e);return r<0?void 0:t[r][1]},xG.prototype.has=function(e){return ZG(this.__data__,e)>-1},xG.prototype.set=function(e,t){var r=this.__data__,n=ZG(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var EG=xG,OG=AG(JB,"Map"),KG=function(e,t){var r=e.__data__;return function(e){var t=rv(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map};function WG(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}WG.prototype.clear=function(){this.size=0,this.__data__={hash:new CG,map:new(OG||EG),string:new CG}},WG.prototype.delete=function(e){var t=KG(this,e).delete(e);return this.size-=t?1:0,t},WG.prototype.get=function(e){return KG(this,e).get(e)},WG.prototype.has=function(e){return KG(this,e).has(e)},WG.prototype.set=function(e,t){var r=KG(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};var VG=WG;function TG(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function r(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(TG.Cache||VG),r}TG.Cache=VG;var LG=TG,NG=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,PG=/\\(\\)?/g,jG=function(e){var t=LG((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(NG,(function(e,r,n,i){t.push(n?i.replace(PG,"$1"):r||e)})),t}),(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}(),RG=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i},XG=QB?QB.prototype:void 0,BG=XG?XG.toString:void 0,GG=function e(t){if("string"==typeof t)return t;if(GB(t))return RG(t,e)+"";if(oG(t))return BG?BG.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},YG=function(e){return null==e?"":GG(e)},HG=function(e,t){return GB(e)?e:function(e,t){if(GB(e))return!1;var r=rv(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!oG(e))||uG.test(e)||!sG.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:jG(YG(e))},FG=function(e){if("string"==typeof e||oG(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},UG=function(e,t,r){var n=null==e?void 0:function(e,t){for(var r=0,n=(t=HG(t,e)).length;null!=e&&r<n;)e=e[FG(t[r++])];return r&&r==n?e:void 0}(e,t);return void 0===n?r:n},DG=HB((function(e,t){!function(r,n){var i="function",a="undefined",o="object",s="string",u="model",c="name",l="type",d="vendor",p="version",f="architecture",m="console",h="mobile",v="tablet",b="smarttv",y="wearable",g="embedded",q="Amazon",A="Apple",I="ASUS",S="BlackBerry",M="Google",k="Huawei",C="LG",z="Microsoft",Z="Motorola",w="Samsung",x="Sharp",E="Sony",O="Xiaomi",K="Zebra",W="Facebook",V="Chromium OS",T="Mac OS",L=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},N=function(e,t){return rv(e)===s&&-1!==P(t).indexOf(P(e))},P=function(e){return e.toLowerCase()},j=function(e,t){if(rv(e)===s)return e=e.replace(/^\s\s*/,""),rv(t)===a?e:e.substring(0,500)},R=function(e,t){for(var r,a,s,u,c,l,d=0;d<t.length&&!c;){var p=t[d],f=t[d+1];for(r=a=0;r<p.length&&!c&&p[r];)if(c=p[r++].exec(e))for(s=0;s<f.length;s++)l=c[++a],rv(u=f[s])===o&&u.length>0?2===u.length?rv(u[1])==i?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?rv(u[1])!==i||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):n:this[u[0]]=l?u[1].call(this,l,u[2]):n:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):n):this[u]=l||n;d+=2}},X=function(e,t){for(var r in t)if(rv(t[r])===o&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(N(t[r][i],e))return"?"===r?n:r}else if(N(t[r],e))return"?"===r?n:r;return e},B={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"},G={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[p,[c,"Opera"]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[c,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[c,"Smart Lenovo Browser"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure Browser"],p],[/\bfocus\/([\w\.]+)/i],[p,[c,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[p,[c,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 Browser"]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 Browser"],p],[/samsungbrowser\/([\w\.]+)/i],[p,[c,"Samsung Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/metasr[\/ ]?([\d\.]+)/i],[p,[c,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,W],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,"Chrome WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,X,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[c,p],[/(cobalt)\/([\w\.]+)/i],[c,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,P]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",P]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,P]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,w],[l,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,w],[l,h]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[d,A],[l,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,A],[l,v]],[/(macintosh);/i],[u,[d,A]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,x],[l,h]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,k],[l,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,k],[l,h]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[d,O],[l,h]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,O],[l,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[d,"OPPO"],[l,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[l,h]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[l,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,Z],[l,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,Z],[l,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,C],[l,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,C],[l,h]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[l,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[l,h]],[/(pixel c)\b/i],[u,[d,M],[l,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,M],[l,h]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,E],[l,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,E],[l,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[l,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,q],[l,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,q],[l,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[l,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,S],[l,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,I],[l,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,I],[l,h]],[/(nexus 9)/i],[u,[d,"HTC"],[l,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[l,h]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[l,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[l,h]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[d,"Ulefone"],[l,h]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[l,h]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[l,v]],[/(surface duo)/i],[u,[d,z],[l,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[l,h]],[/(u304aa)/i],[u,[d,"AT&T"],[l,h]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[l,h]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[l,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[l,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[l,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[l,v]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[l,v]],[/\b(k88) b/i],[u,[d,"ZTE"],[l,v]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[l,h]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[l,h]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[l,v]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[l,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[l,v]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[l,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[l,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[l,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[l,h]],[/\b(ph-1) /i],[u,[d,"Essential"],[l,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[l,v]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[l,v]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[l,v]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[l,v]],[/(sprint) (\w+)/i],[d,u,[l,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,z],[l,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,K],[l,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,K],[l,h]],[/smart-tv.+(samsung)/i],[d,[l,b]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,w],[l,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,C],[l,b]],[/(apple) ?tv/i],[d,[u,"Apple TV"],[l,b]],[/crkey/i],[[u,"Chromecast"],[d,M],[l,b]],[/droid.+aft(\w+)( bui|\))/i],[u,[d,q],[l,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[d,x],[l,b]],[/(bravia[\w ]+)( bui|\))/i],[u,[d,E],[l,b]],[/(mitv-\w{5}) bui/i],[u,[d,O],[l,b]],[/Hbbtv.*(technisat) (.*);/i],[d,u,[l,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,j],[u,j],[l,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[l,m]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[l,m]],[/(playstation [345portablevi]+)/i],[u,[d,E],[l,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,z],[l,m]],[/((pebble))app/i],[d,u,[l,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[d,A],[l,y]],[/droid.+; (glass) \d/i],[u,[d,M],[l,y]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,K],[l,y]],[/(quest( 2| pro)?)/i],[u,[d,W],[l,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,g]],[/(aeobc)\b/i],[u,[d,q],[l,g]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[l,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[l,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,h]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[c,[p,X,B]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,X,B],[c,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,T],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[c,"Chromecast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,V],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,p]]},Y=function e(t,u){if(rv(t)===o&&(u=t,t=n),!(this instanceof e))return new e(t,u).getResult();var c=rv(r)!==a&&r.navigator?r.navigator:n,l=t||(c&&c.userAgent?c.userAgent:""),d=c&&c.userAgentData?c.userAgentData:n,p=u?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(G,u):G,f=c&&c.userAgent==l;return this.getBrowser=function(){var e,t={};return t.name=n,t.version=n,R.call(t,l,p.browser),t.major=rv(e=t.version)===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n,f&&c&&c.brave&&rv(c.brave.isBrave)==i&&(t.name="Brave"),t},this.getCPU=function(){var e={};return e.architecture=n,R.call(e,l,p.cpu),e},this.getDevice=function(){var e={};return e.vendor=n,e.model=n,e.type=n,R.call(e,l,p.device),f&&!e.type&&d&&d.mobile&&(e.type=h),f&&"Macintosh"==e.model&&c&&rv(c.standalone)!==a&&c.maxTouchPoints&&c.maxTouchPoints>2&&(e.model="iPad",e.type=v),e},this.getEngine=function(){var e={};return e.name=n,e.version=n,R.call(e,l,p.engine),e},this.getOS=function(){var e={};return e.name=n,e.version=n,R.call(e,l,p.os),f&&!e.name&&d&&"Unknown"!=d.platform&&(e.name=d.platform.replace(/chrome os/i,V).replace(/macos/i,T)),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 l},this.setUA=function(e){return l=rv(e)===s&&e.length>500?j(e,500):e,this},this.setUA(l),this};Y.VERSION="1.0.37",Y.BROWSER=L([c,p,"major"]),Y.CPU=L([f]),Y.DEVICE=L([u,d,l,m,h,b,v,y,g]),Y.ENGINE=Y.OS=L([c,p]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var H=rv(r)!==a&&(r.jQuery||r.Zepto);if(H&&!H.ua){var F=new Y;H.ua=F.getResult(),H.ua.get=function(){return F.getUA()},H.ua.set=function(e){F.setUA(e);var t=F.getResult();for(var r in t)H.ua[r]=t[r]}}}("object"==("undefined"==typeof window?"undefined":rv(window))?window:YB)})),JG=HB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r,n=(r=db)&&"object"==rv(r)&&"default"in r?r.default:r,i=new DG,a=i.getBrowser(),o=i.getCPU(),s=i.getDevice(),u=i.getEngine(),c=i.getOS(),l=i.getUA(),d=function(e){return i.setUA(e)},p=function(e){if(e){var t=new DG(e);return{UA:t,browser:t.getBrowser(),cpu:t.getCPU(),device:t.getDevice(),engine:t.getEngine(),os:t.getOS(),ua:t.getUA(),setUserAgent:function(e){return t.setUA(e)}}}console.error("No userAgent string was provided")},f=Object.freeze({ClientUAInstance:i,browser:a,cpu:o,device:s,engine:u,os:c,ua:l,setUa:d,parseUserAgent:p});function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){return(h="function"==typeof Symbol&&"symbol"==rv(Symbol.iterator)?function(e){return rv(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":rv(e)})(e)}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function q(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function A(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var S="mobile",M="tablet",k="smarttv",C="console",z="wearable",Z="embedded",w=void 0,x={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},E={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},O={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},K=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";return e||t},W=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},V=function(e){var t=W();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},T=function(e,t,r,n){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){v(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{vendor:K(t.vendor),model:K(t.model),os:K(r.name),osVersion:K(r.version),ua:K(n)})},L=function(e){return e.type===S},N=function(e){return e.type===M},P=function(e){var t=e.type;return t===S||t===M},j=function(e){return e.type===k},R=function(e){return e.type===w},X=function(e){return e.type===z},B=function(e){return e.type===C},G=function(e){return e.type===Z},Y=function(e){var t=e.vendor;return K(t)},H=function(e){var t=e.model;return K(t)},F=function(e){var t=e.type;return K(t,"browser")},U=function(e){return e.name===E.Android},D=function(e){return e.name===E.Windows},J=function(e){return e.name===E.MAC_OS},Q=function(e){return e.name===E.WindowsPhone},_=function(e){return e.name===E.IOS},$=function(e){var t=e.version;return K(t)},ee=function(e){var t=e.name;return K(t)},te=function(e){return e.name===x.Chrome},re=function(e){return e.name===x.Firefox},ne=function(e){return e.name===x.Chromium},ie=function(e){return e.name===x.Edge},ae=function(e){return e.name===x.Yandex},oe=function(e){var t=e.name;return t===x.Safari||t===x.MobileSafari},se=function(e){return e.name===x.MobileSafari},ue=function(e){return e.name===x.Opera},ce=function(e){var t=e.name;return t===x.InternetExplorer||t===x.Ie},le=function(e){return e.name===x.MIUI},de=function(e){return e.name===x.SamsungBrowser},pe=function(e){var t=e.version;return K(t)},fe=function(e){var t=e.major;return K(t)},me=function(e){var t=e.name;return K(t)},he=function(e){var t=e.name;return K(t)},ve=function(e){var t=e.version;return K(t)},be=function(){var e=W(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)},ye=function(e){return"string"==typeof e&&-1!==e.indexOf("Edg/")},ge=function(){var e=W();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream},qe=function(){return V("iPad")},Ae=function(){return V("iPhone")},Ie=function(){return V("iPod")},Se=function(e){return K(e)};function Me(e){var t=e||f,r=t.device,n=t.browser,i=t.os,a=t.engine,o=t.ua;return{isSmartTV:j(r),isConsole:B(r),isWearable:X(r),isEmbedded:G(r),isMobileSafari:se(n)||qe(),isChromium:ne(n),isMobile:P(r)||qe(),isMobileOnly:L(r),isTablet:N(r)||qe(),isBrowser:R(r),isDesktop:R(r),isAndroid:U(i),isWinPhone:Q(i),isIOS:_(i)||qe(),isChrome:te(n),isFirefox:re(n),isSafari:oe(n),isOpera:ue(n),isIE:ce(n),osVersion:$(i),osName:ee(i),fullBrowserVersion:pe(n),browserVersion:fe(n),browserName:me(n),mobileVendor:Y(r),mobileModel:H(r),engineName:he(a),engineVersion:ve(a),getUA:Se(o),isEdge:ie(n)||ye(o),isYandex:ae(n),deviceType:F(r),isIOS13:ge(),isIPad13:qe(),isIPhone13:Ae(),isIPod13:Ie(),isElectron:be(),isEdgeChromium:ye(o),isLegacyEdge:ie(n)&&!ye(o),isWindows:D(i),isMacOs:J(i),isMIUI:le(n),isSamsungBrowser:de(n)}}var ke=j(s),Ce=B(s),ze=X(s),Ze=G(s),we=se(a)||qe(),xe=ne(a),Ee=P(s)||qe(),Oe=L(s),Ke=N(s)||qe(),We=R(s),Ve=R(s),Te=U(c),Le=Q(c),Ne=_(c)||qe(),Pe=te(a),je=re(a),Re=oe(a),Xe=ue(a),Be=ce(a),Ge=$(c),Ye=ee(c),He=pe(a),Fe=fe(a),Ue=me(a),De=Y(s),Je=H(s),Qe=he(u),_e=ve(u),$e=Se(l),et=ie(a)||ye(l),tt=ae(a),rt=F(s),nt=ge(),it=qe(),at=Ae(),ot=Ie(),st=be(),ut=ye(l),ct=ie(a)&&!ye(l),lt=D(c),dt=J(c),pt=le(a),ft=de(a);function mt(e){var t=e||window.navigator.userAgent;return p(t)}t.AndroidView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Te?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.BrowserTypes=x,t.BrowserView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return We?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.ConsoleView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Ce?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.CustomView=function(e){var t=e.renderWithFragment,r=e.children,i=(e.viewClassName,e.style,e.condition),a=q(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?t?n.createElement(db.Fragment,null,r):n.createElement("div",a,r):null},t.IEView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Be?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.IOSView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Ne?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.MobileOnlyView=function(e){var t=e.renderWithFragment,r=e.children,i=(e.viewClassName,e.style,q(e,["renderWithFragment","children","viewClassName","style"]));return Oe?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.MobileView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Ee?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.OsTypes=E,t.SmartTVView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return ke?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.TabletView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Ke?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.WearableView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return ze?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.WinPhoneView=function(e){var t=e.renderWithFragment,r=e.children,i=q(e,["renderWithFragment","children"]);return Le?t?n.createElement(db.Fragment,null,r):n.createElement("div",i,r):null},t.browserName=Ue,t.browserVersion=Fe,t.deviceDetect=function(e){var t=e?p(e):f,r=t.device,n=t.browser,i=t.engine,a=t.os,o=t.ua,s=function(e){switch(e){case S:return{isMobile:!0};case M:return{isTablet:!0};case k:return{isSmartTV:!0};case C:return{isConsole:!0};case z:return{isWearable:!0};case w:return{isBrowser:!0};case Z:return{isEmbedded:!0};default:return O}}(r.type),u=s.isBrowser,c=s.isMobile,l=s.isTablet,d=s.isSmartTV,m=s.isConsole,h=s.isWearable,v=s.isEmbedded;return u?function(e,t,r,n,i){return{isBrowser:e,browserMajorVersion:K(t.major),browserFullVersion:K(t.version),browserName:K(t.name),engineName:K(r.name),engineVersion:K(r.version),osName:K(n.name),osVersion:K(n.version),userAgent:K(i)}}(u,n,i,a,o):d?function(e,t,r,n){return{isSmartTV:e,engineName:K(t.name),engineVersion:K(t.version),osName:K(r.name),osVersion:K(r.version),userAgent:K(n)}}(d,i,a,o):m?function(e,t,r,n){return{isConsole:e,engineName:K(t.name),engineVersion:K(t.version),osName:K(r.name),osVersion:K(r.version),userAgent:K(n)}}(m,i,a,o):c||l?T(s,r,a,o):h?function(e,t,r,n){return{isWearable:e,engineName:K(t.name),engineVersion:K(t.version),osName:K(r.name),osVersion:K(r.version),userAgent:K(n)}}(h,i,a,o):v?function(e,t,r,n,i){return{isEmbedded:e,vendor:K(t.vendor),model:K(t.model),engineName:K(r.name),engineVersion:K(r.version),osName:K(n.name),osVersion:K(n.version),userAgent:K(i)}}(v,r,i,a,o):void 0},t.deviceType=rt,t.engineName=Qe,t.engineVersion=_e,t.fullBrowserVersion=He,t.getSelectorsByUserAgent=function(e){if(e&&"string"==typeof e){var t=p(e);return Me({device:t.device,browser:t.browser,os:t.os,engine:t.engine,ua:t.ua})}console.error("No valid user agent string was provided")},t.getUA=$e,t.isAndroid=Te,t.isBrowser=We,t.isChrome=Pe,t.isChromium=xe,t.isConsole=Ce,t.isDesktop=Ve,t.isEdge=et,t.isEdgeChromium=ut,t.isElectron=st,t.isEmbedded=Ze,t.isFirefox=je,t.isIE=Be,t.isIOS=Ne,t.isIOS13=nt,t.isIPad13=it,t.isIPhone13=at,t.isIPod13=ot,t.isLegacyEdge=ct,t.isMIUI=pt,t.isMacOs=dt,t.isMobile=Ee,t.isMobileOnly=Oe,t.isMobileSafari=we,t.isOpera=Xe,t.isSafari=Re,t.isSamsungBrowser=ft,t.isSmartTV=ke,t.isTablet=Ke,t.isWearable=ze,t.isWinPhone=Le,t.isWindows=lt,t.isYandex=tt,t.mobileModel=Je,t.mobileVendor=De,t.osName=Ye,t.osVersion=Ge,t.parseUserAgent=p,t.setUserAgent=function(e){return d(e)},t.useDeviceData=mt,t.useDeviceSelectors=function(e){var t=mt(e||window.navigator.userAgent);return[Me(t),t]},t.useMobileOrientation=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){s=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(db.useState((function(){var e=window.innerWidth>window.innerHeight?90:0;return{isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"}})),2),t=e[0],r=e[1],n=db.useCallback((function(){var e=window.innerWidth>window.innerHeight?90:0,n={isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"};t.orientation!==n.orientation&&r(n)}),[t.orientation]);return db.useEffect((function(){return void 0!==("undefined"==typeof window?"undefined":h(window))&&Ee&&(n(),window.addEventListener("load",n,!1),window.addEventListener("resize",n,!1)),function(){window.removeEventListener("resize",n,!1),window.removeEventListener("load",n,!1)}}),[n]),t},t.withOrientationChange=function(e){return function(t){function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=function(e,t){if(t&&("object"==rv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return A(e)}(this,y(r).call(this,e))).isEventListenerAdded=!1,t.handleOrientationChange=t.handleOrientationChange.bind(A(t)),t.onOrientationChange=t.onOrientationChange.bind(A(t)),t.onPageLoad=t.onPageLoad.bind(A(t)),t.state={isLandscape:!1,isPortrait:!1},t}var i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(r,t),(i=[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var e=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:0===e,isLandscape:90===e})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){void 0!==("undefined"==typeof window?"undefined":h(window))&&Ee&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return n.createElement(e,b({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,i),r}(n.Component)}})),QG=function(){try{var e=AG(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),_G=function(e,t,r){"__proto__"==t&&QG?QG(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r},$G=Object.prototype.hasOwnProperty,eY=function(e,t,r){var n=e[t];$G.call(e,t)&&zG(n,r)&&(void 0!==r||t in e)||_G(e,t,r)},tY=function(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],u=n?n(r[s],e[s],s,r,e):void 0;void 0===u&&(u=e[s]),i?_G(r,s,u):eY(r,s,u)}return r},rY=function(e){return e},nY=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)},iY=Math.max,aY=function(e){return function(){return e}},oY=QG?function(e,t){return QG(e,"toString",{configurable:!0,enumerable:!1,value:aY(t),writable:!0})}:rY,sY=Date.now,uY=function(e){var t=0,r=0;return function(){var n=sY(),i=16-(n-r);if(r=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(oY),cY=function(e,t){return uY(function(e,t,r){return t=iY(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=iY(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),nY(e,this,s)}}(e,t,rY),e+"")},lY=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},dY=function(e){return null!=e&&lY(e.length)&&!lG(e)},pY=/^(?:0|[1-9]\d*)$/,fY=function(e,t){var r=rv(e);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&pY.test(e))&&e>-1&&e%1==0&&e<t},mY=function(e,t,r){if(!cG(r))return!1;var n=rv(t);return!!("number"==n?dY(r)&&fY(t,r.length):"string"==n&&t in r)&&zG(r[t],e)},hY=function(e){return cY((function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&mY(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t}))},vY=function(e){return aG(e)&&"[object Arguments]"==iG(e)},bY=Object.prototype,yY=bY.hasOwnProperty,gY=bY.propertyIsEnumerable,qY=vY(function(){return arguments}())?vY:function(e){return aG(e)&&yY.call(e,"callee")&&!gY.call(e,"callee")},AY=function(){return!1},IY=HB((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r?JB.Buffer:void 0,a=(i?i.isBuffer:void 0)||AY;e.exports=a})),SY={};SY["[object Float32Array]"]=SY["[object Float64Array]"]=SY["[object Int8Array]"]=SY["[object Int16Array]"]=SY["[object Int32Array]"]=SY["[object Uint8Array]"]=SY["[object Uint8ClampedArray]"]=SY["[object Uint16Array]"]=SY["[object Uint32Array]"]=!0,SY["[object Arguments]"]=SY["[object Array]"]=SY["[object ArrayBuffer]"]=SY["[object Boolean]"]=SY["[object DataView]"]=SY["[object Date]"]=SY["[object Error]"]=SY["[object Function]"]=SY["[object Map]"]=SY["[object Number]"]=SY["[object Object]"]=SY["[object RegExp]"]=SY["[object Set]"]=SY["[object String]"]=SY["[object WeakMap]"]=!1;var MY=HB((function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,i=n&&n.exports===r&&UB.process,a=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a})),kY=MY&&MY.isTypedArray,CY=kY?function(e){return function(t){return e(t)}}(kY):function(e){return aG(e)&&lY(e.length)&&!!SY[iG(e)]},zY=Object.prototype.hasOwnProperty,ZY=function(e,t){var r=GB(e),n=!r&&qY(e),i=!r&&!n&&IY(e),a=!r&&!n&&!i&&CY(e),o=r||n||i||a,s=o?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=s.length;for(var c in e)!t&&!zY.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||fY(c,u))||s.push(c);return s},wY=Object.prototype,xY=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||wY)},EY=Object.prototype.hasOwnProperty,OY=function(e){if(!cG(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=xY(e),r=[];for(var n in e)("constructor"!=n||!t&&EY.call(e,n))&&r.push(n);return r},KY=function(e){return dY(e)?ZY(e,!0):OY(e)},WY=hY((function(e,t,r,n){tY(t,KY(t),e,n)})),VY=function(e,t){return function(r){return e(t(r))}},TY=VY(Object.getPrototypeOf,Object),LY=Function.prototype,NY=Object.prototype,PY=LY.toString,jY=NY.hasOwnProperty,RY=PY.call(Object),XY=function(e){if(!aG(e)||"[object Object]"!=iG(e))return!1;var t=TY(e);if(null===t)return!0;var r=jY.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&PY.call(r)==RY},BY=function(e){if(!aG(e))return!1;var t=iG(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!XY(e)},GY=cY((function(e,t){try{return nY(e,void 0,t)}catch(e){return BY(e)?e:new Error(e)}})),YY=Object.prototype,HY=YY.hasOwnProperty,FY=function(e,t,r,n){return void 0===e||zG(e,YY[r])&&!HY.call(n,r)?t:e},UY={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},DY=function(e){return"\\"+UY[e]},JY=VY(Object.keys,Object),QY=Object.prototype.hasOwnProperty,_Y=function(e){return dY(e)?ZY(e):function(e){if(!xY(e))return JY(e);var t=[];for(var r in Object(e))QY.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)},$Y=/<%=([\s\S]+?)%>/g,eH=function(e){return function(t){return null==e?void 0:e[t]}}({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),tH=/[&<>"']/g,rH=RegExp(tH.source),nH={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:$Y,variable:"",imports:{_:{escape:function(e){return(e=YG(e))&&rH.test(e)?e.replace(tH,eH):e}}}},iH=/\b__p \+= '';/g,aH=/\b(__p \+=) '' \+/g,oH=/(__e\(.*?\)|\b__t\)) \+\n'';/g,sH=/[()=,{}\[\]\/\s]/,uH=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cH=/($^)/,lH=/['\n\r\u2028\u2029\\]/g,dH=Object.prototype.hasOwnProperty,pH=function(e,t,r){var n=nH.imports._.templateSettings||nH;r&&mY(e,t,r)&&(t=void 0),e=YG(e),t=WY({},t,n,FY);var i,a,o=WY({},t.imports,n.imports,FY),s=_Y(o),u=function(e,t){return RG(t,(function(t){return e[t]}))}(o,s),c=0,l=t.interpolate||cH,d="__p += '",p=RegExp((t.escape||cH).source+"|"+l.source+"|"+(l===$Y?uH:cH).source+"|"+(t.evaluate||cH).source+"|$","g"),f=dH.call(t,"sourceURL")?"//# sourceURL="+(t.sourceURL+"").replace(/\s/g," ")+"\n":"";e.replace(p,(function(t,r,n,o,s,u){return n||(n=o),d+=e.slice(c,u).replace(lH,DY),r&&(i=!0,d+="' +\n__e("+r+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),n&&(d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=u+t.length,t})),d+="';\n";var m=dH.call(t,"variable")&&t.variable;if(m){if(sH.test(m))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(iH,""):d).replace(aH,"$1").replace(oH,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var h=GY((function(){return Function(s,f+"return "+d).apply(void 0,u)}));if(h.source=d,BY(h))throw h;return h},fH=hq.table.withConfig({displayName:"PlacementArea__Table",componentId:"sc-111697v-0"})(["width:100%;height:100%;td{text-align:center;vertical-align:middle;padding:0;border:0;}border-spacing:0;table-layout:auto;border-collapse:collapse;"]),mH=hq.div.withConfig({displayName:"PlacementArea__ChildrenWrapper",componentId:"sc-111697v-1"})(["position:relative;"]),hH=Array.from(Array(3).keys()),vH=Array.from(Array(3).keys());function bH(e){var t=e.children,r=e.x,n=e.y,i=e.width,a=e.height,o=e.className,s=e.surroundStyle;return db.createElement(fH,{className:o},db.createElement("tbody",null,hH.map((function(e,o){return db.createElement("tr",{key:e,style:{height:0===o?n:"auto"},"data-testid":"row"},vH.map((function(e,n){var u=1===o&&1===n,c="auto";return u?c=i:0===n&&(c=r),db.createElement("td",{"data-testid":u?"centeredCell":"cell",key:e,style:EB({width:c,height:u?a:"auto"},u?{}:s)},u?db.createElement(mH,{style:{width:c,height:a}},t):null)})))}))))}bH.propTypes={children:Tb.node,x:Tb.string,y:Tb.string,width:Tb.string,height:Tb.string,className:Tb.string,surroundStyle:Tb.object},bH.defaultProps={children:null,x:"auto",y:"auto",width:"auto",height:"auto",className:"",surroundStyle:{}};var yH=/^\s+|\s+$/g,gH=/^[-+]0x[0-9a-f]+$/i,qH=/^0b[01]+$/i,AH=/^0o[0-7]+$/i,IH=parseInt,SH="object"==rv(YB)&&YB&&YB.Object===Object&&YB,MH="object"==("undefined"==typeof self?"undefined":rv(self))&&self&&self.Object===Object&&self,kH=SH||MH||Function("return this")(),CH=Object.prototype.toString,zH=Math.max,ZH=Math.min,wH=function(){return kH.Date.now()};function xH(e){var t=rv(e);return!!e&&("object"==t||"function"==t)}function EH(e){if("number"==typeof e)return e;if(function(e){return"symbol"==rv(e)||function(e){return!!e&&"object"==rv(e)}(e)&&"[object Symbol]"==CH.call(e)}(e))return NaN;if(xH(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=xH(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(yH,"");var r=qH.test(e);return r||AH.test(e)?IH(e.slice(2),r?2:8):gH.test(e)?NaN:+e}var OH=function(e,t,r){var n,i,a,o,s,u,c=0,l=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var r=n,a=i;return n=i=void 0,c=t,o=e.apply(a,r)}function m(e){return c=e,s=setTimeout(v,t),l?f(e):o}function h(e){var r=e-u;return void 0===u||r>=t||r<0||d&&e-c>=a}function v(){var e=wH();if(h(e))return b(e);s=setTimeout(v,function(e){var r=t-(e-u);return d?ZH(r,a-(e-c)):r}(e))}function b(e){return s=void 0,p&&n?f(e):(n=i=void 0,o)}function y(){var e=wH(),r=h(e);if(n=arguments,i=this,u=e,r){if(void 0===s)return m(u);if(d)return s=setTimeout(v,t),f(u)}return void 0===s&&(s=setTimeout(v,t)),o}return t=EH(t)||0,xH(r)&&(l=!!r.leading,a=(d="maxWait"in r)?zH(EH(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=u=i=s=void 0},y.flush=function(){return void 0===s?o:b(wH())},y},KH="function"==typeof Symbol&&Symbol.for,WH=KH?Symbol.for("react.element"):60103,VH=KH?Symbol.for("react.portal"):60106,TH=KH?Symbol.for("react.fragment"):60107,LH=KH?Symbol.for("react.strict_mode"):60108,NH=KH?Symbol.for("react.profiler"):60114,PH=KH?Symbol.for("react.provider"):60109,jH=KH?Symbol.for("react.context"):60110,RH=KH?Symbol.for("react.async_mode"):60111,XH=KH?Symbol.for("react.concurrent_mode"):60111,BH=KH?Symbol.for("react.forward_ref"):60112,GH=KH?Symbol.for("react.suspense"):60113,YH=KH?Symbol.for("react.suspense_list"):60120,HH=KH?Symbol.for("react.memo"):60115,FH=KH?Symbol.for("react.lazy"):60116,UH=KH?Symbol.for("react.block"):60121,DH=KH?Symbol.for("react.fundamental"):60117,JH=KH?Symbol.for("react.responder"):60118,QH=KH?Symbol.for("react.scope"):60119;
53
53
  /** @license React v16.13.1
54
54
  * react-is.production.min.js
55
55
  *