ethers.js/dist/ethers.min.js
2018-06-22 02:18:19 -04:00

3 lines
266 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).ethers=t()}}(function(){return function o(s,a,u){function h(e,t){if(!a[e]){if(!s[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(l)return l(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var i=a[e]={exports:{}};s[e][0].call(i.exports,function(t){return h(s[e][1][t]||t)},i,i.exports,o,s,a,u)}return a[e].exports}for(var l="function"==typeof require&&require,t=0;t<u.length;t++)h(u[t]);return h}({1:[function(t,C,B){"use strict";!function(t){function r(t){return parseInt(t)===t}function n(t){if(!r(t.length))return!1;for(var e=0;e<t.length;e++)if(!r(t[e])||t[e]<0||255<t[e])return!1;return!0}function o(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!n(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&n(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function u(t){return new Uint8Array(t)}function s(t,e,r,n,i){null==n&&null==i||(t=t.slice?t.slice(n,i):Array.prototype.slice.call(t,n,i)),e.set(t,r)}var i,e={toBytes:function(t){var e=[],r=0;for(t=encodeURI(t);r<t.length;){var n=t.charCodeAt(r++);37===n?(e.push(parseInt(t.substr(r,2),16)),r+=2):e.push(n)}return o(e)},fromBytes:function(t){for(var e=[],r=0;r<t.length;){var n=t[r];n<128?(e.push(String.fromCharCode(n)),r++):191<n&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&n)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}},a=(i="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},fromBytes:function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push(i[(240&n)>>4]+i[15&n])}return e.join("")}}),f={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],l=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],m=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],g=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],b=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],_=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],M=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],A=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],k=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function S(t){for(var e=[],r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}var E=function(t){if(!(this instanceof E))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:o(t,!0)}),this._prepare()};E.prototype._prepare=function(){var t=f[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(t+1),i=this.key.length/4,o=S(this.key);for(e=0;e<i;e++)r=e>>2,this._Ke[r][e%4]=o[e],this._Kd[t-r][e%4]=o[e];for(var s,a=0,u=i;u<n;){if(s=o[i-1],o[0]^=d[s>>16&255]<<24^d[s>>8&255]<<16^d[255&s]<<8^d[s>>24&255]^c[a]<<24,a+=1,8!=i)for(e=1;e<i;e++)o[e]^=o[e-1];else{for(e=1;e<i/2;e++)o[e]^=o[e-1];s=o[i/2-1],o[i/2]^=d[255&s]^d[s>>8&255]<<8^d[s>>16&255]<<16^d[s>>24&255]<<24;for(e=i/2+1;e<i;e++)o[e]^=o[e-1]}for(e=0;e<i&&u<n;)h=u>>2,l=u%4,this._Ke[h][l]=o[e],this._Kd[t-h][l]=o[e++],u++}for(var h=1;h<t;h++)for(var l=0;l<4;l++)s=this._Kd[h][l],this._Kd[h][l]=_[s>>24&255]^M[s>>16&255]^A[s>>8&255]^k[255&s]},E.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=S(t),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var o=1;o<e;o++){for(i=0;i<4;i++)r[i]=l[n[i]>>24&255]^p[n[(i+1)%4]>>16&255]^v[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[o][i];n=r.slice()}var s,a=u(16);for(i=0;i<4;i++)s=this._Ke[e][i],a[4*i]=255&(d[n[i]>>24&255]^s>>24),a[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^s>>16),a[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),a[4*i+3]=255&(d[255&n[(i+3)%4]]^s);return a},E.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=S(t),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var o=1;o<e;o++){for(i=0;i<4;i++)r[i]=m[n[i]>>24&255]^g[n[(i+3)%4]>>16&255]^b[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[o][i];n=r.slice()}var s,a=u(16);for(i=0;i<4;i++)s=this._Kd[e][i],a[4*i]=255&(h[n[i]>>24&255]^s>>24),a[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),a[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),a[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return a};var P=function(t){if(!(this instanceof P))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new E(t)};P.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=u(t.length),r=u(16),n=0;n<t.length;n+=16)s(t,r,0,n,n+16),s(r=this._aes.encrypt(r),e,n);return e},P.prototype.decrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=u(t.length),r=u(16),n=0;n<t.length;n+=16)s(t,r,0,n,n+16),s(r=this._aes.decrypt(r),e,n);return e};var N=function(t,e){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else e=u(16);this._lastCipherblock=o(e,!0),this._aes=new E(t)};N.prototype.encrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=u(t.length),r=u(16),n=0;n<t.length;n+=16){s(t,r,0,n,n+16);for(var i=0;i<16;i++)r[i]^=this._lastCipherblock[i];this._lastCipherblock=this._aes.encrypt(r),s(this._lastCipherblock,e,n)}return e},N.prototype.decrypt=function(t){if((t=o(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=u(t.length),r=u(16),n=0;n<t.length;n+=16){s(t,r,0,n,n+16),r=this._aes.decrypt(r);for(var i=0;i<16;i++)e[n+i]=r[i]^this._lastCipherblock[i];s(t,this._lastCipherblock,0,n,n+16)}return e};var x=function(t,e,r){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 size)")}else e=u(16);r||(r=1),this.segmentSize=r,this._shiftRegister=o(e,!0),this._aes=new E(t)};x.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,r=o(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=e[i];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},x.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,r=o(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=e[i];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(t,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var I=function(t,e){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else e=u(16);this._lastPrecipher=o(e,!0),this._lastPrecipherIndex=16,this._aes=new E(t)};I.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r<e.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},I.prototype.decrypt=I.prototype.encrypt;var T=function(t){if(!(this instanceof T))throw Error("Counter must be instanitated with `new`");0===t||t||(t=1),"number"==typeof t?(this._counter=u(16),this.setValue(t)):this.setBytes(t)};T.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");for(var e=15;0<=e;--e)this._counter[e]=t%256,t>>=8},T.prototype.setBytes=function(t){if(16!=(t=o(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},T.prototype.increment=function(){for(var t=15;0<=t;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var R=function(t,e){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",e instanceof T||(e=new T(e)),this._counter=e,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new E(t)};R.prototype.encrypt=function(t){for(var e=o(t,!0),r=0;r<e.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[r]^=this._remainingCounter[this._remainingCounterIndex++];return e},R.prototype.decrypt=R.prototype.encrypt;var O={AES:E,Counter:T,ModeOfOperation:{ecb:P,cbc:N,cfb:x,ofb:I,ctr:R},utils:{hex:a,utf8:e},padding:{pkcs7:{pad:function(t){var e=16-(t=o(t,!0)).length%16,r=u(t.length+e);s(t,r);for(var n=t.length;n<r.length;n++)r[n]=e;return r},strip:function(t){if((t=o(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(16<e)throw new Error("PKCS#7 padding byte out of range");for(var r=t.length-e,n=0;n<e;n++)if(t[r+n]!==e)throw new Error("PKCS#7 invalid padding byte");var i=u(r);return s(t,i,0,0,r),i}}},_arrayTest:{coerceArray:o,createArray:u,copyArray:s}};void 0!==B?C.exports=O:(t.aesjs&&(O._aesjs=t.aesjs),t.aesjs=O)}(this)},{}],2:[function(A,t,e){!function(t,e){"use strict";function y(t,e){if(!t)throw new Error(e||"Assertion failed")}function r(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function m(t,e,r){if(m.isBN(t))return t;this.negative=0,this.words=null,this.length=0,(this.red=null)!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var n;"object"==typeof t?t.exports=m:e.BN=m,(m.BN=m).wordSize=26;try{n=A("buffer").Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=49<=s&&s<=54?s-49+10:17<=s&&s<=22?s-17+10:15&s}return n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=49<=a?a-49+10:17<=a?a-17+10:a}return i}m.isBN=function(t){return t instanceof m||null!==t&&"object"==typeof t&&t.constructor.wordSize===m.wordSize&&Array.isArray(t.words)},m.max=function(t,e){return 0<t.cmp(e)?t:e},m.min=function(t,e){return t.cmp(e)<0?t:e},m.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),y(e===(0|e)&&2<=e&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},m.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(y(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},m.prototype._initArray=function(t,e,r){if(y("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o,s=0;if("be"===r)for(n=t.length-1,i=0;0<=n;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);else if("le"===r)for(i=n=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[i]|=o<<s&67108863,this.words[i+1]=o>>>26-s&67108863,26<=(s+=24)&&(s-=26,i++);return this.strip()},m.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;e<=r;r-=6)i=s(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,26<=(o+=24)&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},m.prototype._parseBase=function(t,e,r){this.words=[0];for(var n=0,i=this.length=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)l*=e;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},m.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},m.prototype.clone=function(){var t=new m(null);return this.copy(t),t},m.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},m.prototype.strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},m.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},m.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"],d=[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],p=[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 i(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;n=(r.length=n)-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var l=u>>>26,f=67108863&u,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}m.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,i=0,o=0;o<this.length;o++){var s=this.words[o],a=(16777215&(s<<n|i)).toString(16);r=0!==(i=s>>>24-n&16777215)||o!==this.length-1?c[6-a.length]+a+r:a+r,26<=(n+=2)&&(n-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&2<=t&&t<=36){var u=d[t],h=p[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var f=l.modn(h).toString(t);r=(l=l.idivn(h)).isZero()?f+r:c[u-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}y(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:2<this.length&&y(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},m.prototype.toJSON=function(){return this.toString(16)},m.prototype.toBuffer=function(t,e){return y(void 0!==n),this.toArrayLike(n,t,e)},m.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},m.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),i=r||Math.max(1,n);y(n<=i,"byte array longer than desired length"),y(0<i,"Requested array length <= 0"),this.strip();var o,s,a="le"===e,u=new t(i),h=this.clone();if(a){for(s=0;!h.isZero();s++)o=h.andln(255),h.iushrn(8),u[s]=o;for(;s<i;s++)u[s]=0}else{for(s=0;s<i-n;s++)u[s]=0;for(s=0;!h.isZero();s++)o=h.andln(255),h.iushrn(8),u[i-s-1]=o}return u},m.prototype._countBits=Math.clz32?function(t){return 32-Math.clz32(t)}:function(t){var e=t,r=0;return 4096<=e&&(r+=13,e>>>=13),64<=e&&(r+=7,e>>>=7),8<=e&&(r+=4,e>>>=4),2<=e&&(r+=2,e>>>=2),r+e},m.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},m.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},m.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},m.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},m.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},m.prototype.isNeg=function(){return 0!==this.negative},m.prototype.neg=function(){return this.clone().ineg()},m.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},m.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},m.prototype.ior=function(t){return y(0==(this.negative|t.negative)),this.iuor(t)},m.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},m.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},m.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},m.prototype.iand=function(t){return y(0==(this.negative|t.negative)),this.iuand(t)},m.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},m.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},m.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},m.prototype.ixor=function(t){return y(0==(this.negative|t.negative)),this.iuxor(t)},m.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},m.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},m.prototype.inotn=function(t){y("number"==typeof t&&0<=t);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),0<r&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return 0<r&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},m.prototype.notn=function(t){return this.clone().inotn(t)},m.prototype.setn=function(t,e){y("number"==typeof t&&0<=t);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},m.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},m.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},m.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;0<i?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},m.prototype.sub=function(t){return this.clone().isub(t)};var o=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,l=0|s[0],f=8191&l,c=l>>>13,d=0|s[1],p=8191&d,v=d>>>13,y=0|s[2],m=8191&y,g=y>>>13,b=0|s[3],w=8191&b,_=b>>>13,M=0|s[4],A=8191&M,k=M>>>13,S=0|s[5],E=8191&S,P=S>>>13,N=0|s[6],x=8191&N,I=N>>>13,T=0|s[7],R=8191&T,O=T>>>13,C=0|s[8],B=8191&C,L=C>>>13,D=0|s[9],U=8191&D,j=D>>>13,F=0|a[0],G=8191&F,z=F>>>13,H=0|a[1],V=8191&H,q=H>>>13,K=0|a[2],W=8191&K,J=K>>>13,Z=0|a[3],$=8191&Z,X=Z>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],ft=8191&lt,ct=lt>>>13,dt=0|a[9],pt=8191&dt,vt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(h+(n=Math.imul(f,G))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(c,G)|0))<<13)|0;h=((o=Math.imul(c,z))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,G),i=(i=Math.imul(p,z))+Math.imul(v,G)|0,o=Math.imul(v,z);var mt=(h+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(c,V)|0))<<13)|0;h=((o=o+Math.imul(c,q)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,G),i=(i=Math.imul(m,z))+Math.imul(g,G)|0,o=Math.imul(g,z),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0;var gt=(h+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,J)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(w,G),i=(i=Math.imul(w,z))+Math.imul(_,G)|0,o=Math.imul(_,z),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,J)|0;var bt=(h+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(c,$)|0))<<13)|0;h=((o=o+Math.imul(c,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,G),i=(i=Math.imul(A,z))+Math.imul(k,G)|0,o=Math.imul(k,z),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,X)|0;var wt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,G),i=(i=Math.imul(E,z))+Math.imul(P,G)|0,o=Math.imul(P,z),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var _t=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(x,G),i=(i=Math.imul(x,z))+Math.imul(I,G)|0,o=Math.imul(I,z),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0;var Mt=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,G),i=(i=Math.imul(R,z))+Math.imul(O,G)|0,o=Math.imul(O,z),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,J)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var At=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,G),i=(i=Math.imul(B,z))+Math.imul(L,G)|0,o=Math.imul(L,z),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0;var kt=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(c,ft)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,G),i=(i=Math.imul(U,z))+Math.imul(j,G)|0,o=Math.imul(j,z),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,q)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,ct)|0;var St=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,vt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,q))+Math.imul(j,V)|0,o=Math.imul(j,q),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(m,ft)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(g,ft)|0,o=o+Math.imul(g,ct)|0;var Et=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,W),i=(i=Math.imul(U,J))+Math.imul(j,W)|0,o=Math.imul(j,J),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ct)|0;var Pt=(h+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,X))+Math.imul(j,$)|0,o=Math.imul(j,X),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,ct)|0;var Nt=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,vt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,vt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(E,ft)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ct)|0;var xt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,vt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,vt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(x,ft)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(I,ft)|0,o=o+Math.imul(I,ct)|0;var It=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,vt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,vt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(R,ft)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,ct)|0;var Tt=(h+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,vt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ht))+Math.imul(j,ut)|0,o=Math.imul(j,ht),n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ct)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,vt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ft),i=(i=Math.imul(U,ct))+Math.imul(j,ft)|0,o=Math.imul(j,ct);var Ot=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,vt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Ct=(h+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,vt))+Math.imul(j,pt)|0))<<13)|0;return h=((o=Math.imul(j,vt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=yt,u[1]=mt,u[2]=gt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=At,u[8]=kt,u[9]=St,u[10]=Et,u[11]=Pt,u[12]=Nt,u[13]=xt,u[14]=It,u[15]=Tt,u[16]=Rt,u[17]=Ot,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function a(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}Math.imul||(o=i),m.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?o(this,t,e):r<63?i(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var l=o-h,f=(0|t.words[l])*(0|e.words[h]),c=67108863&f;a=67108863&(c=c+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):a(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=m.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},u.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},u.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},u.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var f=u,c=h,d=0;d<s;d++){var p=r[l+d],v=n[l+d],y=r[l+d+s],m=n[l+d+s],g=f*y-c*m;m=f*m+c*y,y=g,r[l+d]=p+y,n[l+d]=v+m,r[l+d+s]=p-y,n[l+d+s]=v-m,d!==a&&(g=u*f-h*c,c=u*c+h*f,f=g)}},u.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},u.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},u.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},u.prototype.convert13b=function(t,e,r,n){for(var i=0,o=0;o<e;o++)i+=0|t[o],r[2*o]=8191&i,i>>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*e;o<n;++o)r[o]=0;y(0===i),y(0==(-8192&i))},u.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},u.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),l=new Array(n),f=new Array(n),c=r.words;c.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,l,f,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,c,o,n,i),this.conjugate(c,o,n),this.normalize13b(c,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},m.prototype.mul=function(t){var e=new m(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},m.prototype.mulf=function(t){var e=new m(null);return e.words=new Array(this.length+t.length),a(this,t,e)},m.prototype.imul=function(t){return this.clone().mulTo(t,this)},m.prototype.imuln=function(t){y("number"==typeof t),y(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,i=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=i>>>26,this.words[r]=67108863&i}return 0!==e&&(this.words[r]=e,this.length++),this},m.prototype.muln=function(t){return this.clone().imuln(t)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new m(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},m.prototype.iushln=function(t){y("number"==typeof t&&0<=t);var e,r=t%26,n=(t-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&i,a=(0|this.words[e])-s<<r;this.words[e]=a|o,o=s>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;0<=e;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},m.prototype.ishln=function(t){return y(0===this.negative),this.iushln(t)},m.prototype.iushrn=function(t,e,r){var n;y("number"==typeof t&&0<=t),n=e?(e-e%26)/26:0;var i=t%26,o=Math.min((t-i)/26,this.length),s=67108863^67108863>>>i<<i,a=r;if(n-=o,n=Math.max(0,n),a){for(var u=0;u<o;u++)a.words[u]=this.words[u];a.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var h=0;for(u=this.length-1;0<=u&&(0!==h||n<=u);u--){var l=0|this.words[u];this.words[u]=h<<26-i|l>>>i,h=l&s}return a&&0!==h&&(a.words[a.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},m.prototype.ishrn=function(t,e,r){return y(0===this.negative),this.iushrn(t,e,r)},m.prototype.shln=function(t){return this.clone().ishln(t)},m.prototype.ushln=function(t){return this.clone().iushln(t)},m.prototype.shrn=function(t){return this.clone().ishrn(t)},m.prototype.ushrn=function(t){return this.clone().iushrn(t)},m.prototype.testn=function(t){y("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},m.prototype.imaskn=function(t){y("number"==typeof t&&0<=t);var e=t%26,r=(t-e)/26;if(y(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},m.prototype.maskn=function(t){return this.clone().imaskn(t)},m.prototype.iaddn=function(t){return y("number"==typeof t),y(t<67108864),t<0?this.isubn(-t):0!==this.negative?(1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(t),this.negative=1),this):this._iaddn(t)},m.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&67108864<=this.words[e];e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},m.prototype.isubn=function(t){if(y("number"==typeof t),y(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},m.prototype.addn=function(t){return this.clone().iaddn(t)},m.prototype.subn=function(t){return this.clone().isubn(t)},m.prototype.iabs=function(){return this.negative=0,this},m.prototype.abs=function(){return this.clone().iabs()},m.prototype._ishlnsubmul=function(t,e,r){var n,i,o=t.length+r;this._expand(o);var s=0;for(n=0;n<t.length;n++){i=(0|this.words[n+r])+s;var a=(0|t.words[n])*e;s=((i-=67108863&a)>>26)-(a/67108864|0),this.words[n+r]=67108863&i}for(;n<this.length-r;n++)s=(i=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&i;if(0===s)return this.strip();for(y(-1===s),n=s=0;n<this.length;n++)s=(i=-(0|this.words[n])+s)>>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},m.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,a=n.length-i.length;if("mod"!==e){(s=new m(null)).length=a+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var h=n.clone()._ishlnsubmul(i,1,a);0===h.negative&&(n=h,s&&(s.words[a]=1));for(var l=a-1;0<=l;l--){var f=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,l);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=f)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},m.prototype.divmod=function(t,e,r){return y(!t.isZero()),this.isZero()?{div:new m(0),mod:new m(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(n=o.div.neg()),"div"!==e&&(i=o.mod.neg(),r&&0!==i.negative&&i.iadd(t)),{div:n,mod:i}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(n=o.div.neg()),{div:n,mod:o.mod}):0!=(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(i=o.mod.neg(),r&&0!==i.negative&&i.isub(t)),{div:o.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new m(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new m(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new m(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,i,o},m.prototype.div=function(t){return this.divmod(t,"div",!1).div},m.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},m.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},m.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},m.prototype.modn=function(t){y(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;0<=n;n--)r=(e*r+(0|this.words[n]))%t;return r},m.prototype.idivn=function(t){y(t<=67108863);for(var e=0,r=this.length-1;0<=r;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},m.prototype.divn=function(t){return this.clone().idivn(t)},m.prototype.egcd=function(t){y(0===t.negative),y(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new m(1),i=new m(0),o=new m(0),s=new m(1),a=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++a;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var l=0,f=1;0==(e.words[0]&f)&&l<26;++l,f<<=1);if(0<l)for(e.iushrn(l);0<l--;)(n.isOdd()||i.isOdd())&&(n.iadd(u),i.isub(h)),n.iushrn(1),i.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(0<c)for(r.iushrn(c);0<c--;)(o.isOdd()||s.isOdd())&&(o.iadd(u),s.isub(h)),o.iushrn(1),s.iushrn(1);0<=e.cmp(r)?(e.isub(r),n.isub(o),i.isub(s)):(r.isub(e),o.isub(n),s.isub(i))}return{a:o,b:s,gcd:r.iushln(a)}},m.prototype._invmp=function(t){y(0===t.negative),y(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,i=new m(1),o=new m(0),s=r.clone();0<e.cmpn(1)&&0<r.cmpn(1);){for(var a=0,u=1;0==(e.words[0]&u)&&a<26;++a,u<<=1);if(0<a)for(e.iushrn(a);0<a--;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(0<h)for(r.iushrn(h);0<h--;)o.isOdd()&&o.iadd(s),o.iushrn(1);0<=e.cmp(r)?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}return(n=0===e.cmpn(1)?i:o).cmpn(0)<0&&n.iadd(t),n},m.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0;for(var n=r.negative=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},m.prototype.invm=function(t){return this.egcd(t).a.umod(t)},m.prototype.isEven=function(){return 0==(1&this.words[0])},m.prototype.isOdd=function(){return 1==(1&this.words[0])},m.prototype.andln=function(t){return this.words[0]&t},m.prototype.bincn=function(t){y("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var i=n,o=r;0!==i&&o<this.length;o++){var s=0|this.words[o];i=(s+=i)>>>26,s&=67108863,this.words[o]=s}return 0!==i&&(this.words[o]=i,this.length++),this},m.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},m.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1<this.length)e=1;else{r&&(t=-t),y(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},m.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},m.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;0<=r;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:i<n&&(e=1);break}}return e},m.prototype.gtn=function(t){return 1===this.cmpn(t)},m.prototype.gt=function(t){return 1===this.cmp(t)},m.prototype.gten=function(t){return 0<=this.cmpn(t)},m.prototype.gte=function(t){return 0<=this.cmp(t)},m.prototype.ltn=function(t){return-1===this.cmpn(t)},m.prototype.lt=function(t){return-1===this.cmp(t)},m.prototype.lten=function(t){return this.cmpn(t)<=0},m.prototype.lte=function(t){return this.cmp(t)<=0},m.prototype.eqn=function(t){return 0===this.cmpn(t)},m.prototype.eq=function(t){return 0===this.cmp(t)},m.red=function(t){return new _(t)},m.prototype.toRed=function(t){return y(!this.red,"Already a number in reduction context"),y(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},m.prototype.fromRed=function(){return y(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},m.prototype._forceRed=function(t){return this.red=t,this},m.prototype.forceRed=function(t){return y(!this.red,"Already a number in reduction context"),this._forceRed(t)},m.prototype.redAdd=function(t){return y(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},m.prototype.redIAdd=function(t){return y(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},m.prototype.redSub=function(t){return y(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},m.prototype.redISub=function(t){return y(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},m.prototype.redShl=function(t){return y(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},m.prototype.redMul=function(t){return y(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},m.prototype.redIMul=function(t){return y(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},m.prototype.redSqr=function(){return y(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},m.prototype.redISqr=function(){return y(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},m.prototype.redSqrt=function(){return y(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},m.prototype.redInvm=function(){return y(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},m.prototype.redNeg=function(){return y(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},m.prototype.redPow=function(t){return y(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var h={k256:null,p224:null,p192:null,p25519:null};function l(t,e){this.name=t,this.p=new m(e,16),this.n=this.p.bitLength(),this.k=new m(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){l.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){l.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){l.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){l.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=m._prime(t);this.m=e.p,this.prime=e}else y(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new m(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)}l.prototype._tmp=function(){var t=new m(null);return t.words=new Array(Math.ceil(this.n/13)),t},l.prototype.ireduce=function(t){for(var e,r=t;this.split(r,this.tmp),(e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):0<n?r.isub(this.p):r.strip(),r},l.prototype.split=function(t,e){t.iushrn(this.n,0,e)},l.prototype.imulK=function(t){return t.imul(this.k)},r(v,l),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,0===(t.words[n-10]=i)&&10<t.length?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},r(g,l),r(b,l),r(w,l),w.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},m._prime=function(t){if(h[t])return h[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new g;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return h[t]=e},_.prototype._verify1=function(t){y(0===t.negative,"red works only with positives"),y(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){y(0==(t.negative|e.negative),"red works only with positives"),y(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(y(e%2==1),3===e){var r=this.m.add(new m(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);y(!n.isZero());var o=new m(1).toRed(this),s=o.redNeg(),a=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new m(2*u*u).toRed(this);0!==this.pow(u,a).cmp(s);)u.redIAdd(s);for(var h=this.pow(u,n),l=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),c=i;0!==f.cmp(o);){for(var d=f,p=0;0!==d.cmp(o);p++)d=d.redSqr();y(p<c);var v=this.pow(h,new m(1).iushln(c-p-1));l=l.redMul(v),h=v.redSqr(),f=f.redMul(h),c=p}return l},_.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},_.prototype.pow=function(t,e){if(e.isZero())return new m(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new m(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],o=0,s=0,a=e.bitLength()%26;for(0===a&&(a=26),n=e.length-1;0<=n;n--){for(var u=e.words[n],h=a-1;0<=h;h--){var l=u>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==o?(o<<=1,o|=l,(4===++s||0===n&&0===h)&&(i=this.mul(i,r[o]),o=s=0)):s=0}a=26}return i},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},m.mont=function(t){return new M(t)},r(M,_),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new m(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:4}],3:[function(t,e,r){var n=t("../../src.ts/utils").randomBytes;e.exports=function(t){return n(t)}},{"../../src.ts/utils":65}],4:[function(t,e,r){},{}],5:[function(t,e,r){"use strict";var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.hmacDRBG=t("./elliptic/hmac-drbg"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":19,"./elliptic/curve":8,"./elliptic/curves":11,"./elliptic/ec":12,"./elliptic/eddsa":15,"./elliptic/hmac-drbg":16,"./elliptic/utils":18,brorand:3}],6:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../../elliptic").utils,S=i.getNAF,E=i.getJSF,f=i.assert;function o(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0<r.cmpn(100)?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(t,e){this.curve=t,this.type=e,this.precomputed=null}(e.exports=o).prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(t,e){f(t.precomputed);var r=t._getDoubles(),n=S(e,1),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var o=[],s=0;s<n.length;s+=r.step){var a=0;for(e=s+r.step-1;s<=e;e--)a=(a<<1)+n[e];o.push(a)}for(var u=this.jpoint(null,null,null),h=this.jpoint(null,null,null),l=i;0<l;l--){for(s=0;s<o.length;s++){(a=o[s])===l?h=h.mixedAdd(r.points[s]):a===-l&&(h=h.mixedAdd(r.points[s].neg()))}u=u.add(h)}return u.toP()},o.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=S(e,r),s=this.jpoint(null,null,null),a=o.length-1;0<=a;a--){for(e=0;0<=a&&0===o[a];a--)e++;if(0<=a&&e++,s=s.dblp(e),a<0)break;var u=o[a];f(0!==u),s="affine"===t.type?0<u?s.mixedAdd(i[u-1>>1]):s.mixedAdd(i[-u-1>>1].neg()):0<u?s.add(i[u-1>>1]):s.add(i[-u-1>>1].neg())}return"affine"===t.type?s.toP():s},o.prototype._wnafMulAdd=function(t,e,r,n,i){for(var o=this._wnafT1,s=this._wnafT2,a=this._wnafT3,u=0,h=0;h<n;h++){var l=(A=e[h])._getNAFPoints(t);o[h]=l.wnd,s[h]=l.points}for(h=n-1;1<=h;h-=2){var f=h-1,c=h;if(1===o[f]&&1===o[c]){var d=[e[f],null,null,e[c]];0===e[f].y.cmp(e[c].y)?(d[1]=e[f].add(e[c]),d[2]=e[f].toJ().mixedAdd(e[c].neg())):0===e[f].y.cmp(e[c].y.redNeg())?(d[1]=e[f].toJ().mixedAdd(e[c]),d[2]=e[f].add(e[c].neg())):(d[1]=e[f].toJ().mixedAdd(e[c]),d[2]=e[f].toJ().mixedAdd(e[c].neg()));var p=[-3,-1,-5,-7,0,7,5,1,3],v=E(r[f],r[c]);u=Math.max(v[0].length,u),a[f]=new Array(u),a[c]=new Array(u);for(var y=0;y<u;y++){var m=0|v[0][y],g=0|v[1][y];a[f][y]=p[3*(m+1)+(g+1)],a[c][y]=0,s[f]=d}}else a[f]=S(r[f],o[f]),a[c]=S(r[c],o[c]),u=Math.max(a[f].length,u),u=Math.max(a[c].length,u)}var b=this.jpoint(null,null,null),w=this._wnafT4;for(h=u;0<=h;h--){for(var _=0;0<=h;){var M=!0;for(y=0;y<n;y++)w[y]=0|a[y][h],0!==w[y]&&(M=!1);if(!M)break;_++,h--}if(0<=h&&_++,b=b.dblp(_),h<0)break;for(y=0;y<n;y++){var A,k=w[y];0!==k&&(0<k?A=s[y][k-1>>1]:k<0&&(A=s[y][-k-1>>1].neg()),b="affine"===A.type?b.mixedAdd(A):b.add(A))}}for(h=0;h<n;h++)s[h]=null;return i?b:b.toP()},(o.BasePoint=s).prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?f(t[t.length-1]%2==0):7===t[0]&&f(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(t){return this.encode(t,!0)},s.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},s.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},s.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},s.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},s.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},s.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},{"../../elliptic":5,"bn.js":2}],7:[function(t,e,r){e.exports={}},{}],8:[function(t,e,r){"use strict";var n=r;n.base=t("./base"),n.short=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":6,"./edwards":7,"./mont":9,"./short":10}],9:[function(t,e,r){arguments[4][7][0].apply(r,arguments)},{dup:7}],10:[function(t,e,r){"use strict";var n=t("../curve"),i=t("../../elliptic"),_=t("bn.js"),o=t("inherits"),s=n.base,a=i.utils.assert;function u(t){s.call(this,"short",t),this.a=new _(t.a,16).toRed(this.red),this.b=new _(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function h(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new _(e,16),this.y=new _(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 l(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new _(0)):(this.x=new _(e,16),this.y=new _(r,16),this.z=new _(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}o(u,s),(e.exports=u).prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new _(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new _(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map(function(t){return{a:new _(t.a,16),b:new _(t.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:_.mont(t),r=new _(2).toRed(e).redInvm(),n=r.redNeg(),i=new _(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,i,o,s,a,u,h,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=t,c=this.n.clone(),d=new _(1),p=new _(0),v=new _(0),y=new _(1),m=0;0!==f.cmpn(0);){var g=c.div(f);u=c.sub(g.mul(f)),h=v.sub(g.mul(d));var b=y.sub(g.mul(p));if(!n&&u.cmp(l)<0)e=a.neg(),r=d,n=u.neg(),i=h;else if(n&&2==++m)break;c=f,f=a=u,v=d,d=h,y=p,p=b}o=u.neg(),s=h;var w=n.sqr().add(i.sqr());return 0<=o.sqr().add(s.sqr()).cmp(w)&&(o=e,s=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:i},{a:o,b:s}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),h=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(h).neg()}},u.prototype.pointFromX=function(t,e){(t=new _(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.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(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return h},o(h,s.BasePoint),u.prototype.point=function(t,e,r){return new h(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return h.fromJSON(this,t,e)},h.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};(t.beta=e).precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},h.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]},h.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 o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},h.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)+">"},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},h.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(t){return t=new _(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},h.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},h.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},h.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.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 e},h.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new l(this,t,e,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),l=h.redMul(a),f=n.redMul(h),c=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(c)).redISub(o.redMul(l)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(c,d,p)},l.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),l=r.redMul(u),f=a.redSqr().redIAdd(h).redISub(l).redISub(l),c=a.redMul(l.redISub(f)).redISub(i.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(f,c,d)},l.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),h=s.redAdd(s);for(r=0;r<t;r++){var l=o.redSqr(),f=h.redSqr(),c=f.redSqr(),d=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),p=o.redMul(f),v=d.redSqr().redISub(p.redAdd(p)),y=p.redISub(v),m=d.redMul(y);m=m.redIAdd(m).redISub(c);var g=h.redMul(a);r+1<t&&(u=u.redMul(c)),o=v,a=g,h=m}return this.curve.jpoint(o,h.redMul(i),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=u,e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(l).redISub(c);d=d.redIAdd(d);var p=l.redAdd(l).redIAdd(l),v=p.redSqr(),y=c.redIAdd(c);y=(y=y.redIAdd(y)).redIAdd(y),t=v.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},l.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),c=this.x.redMul(f),d=this.x.redSub(l).redMul(this.x.redAdd(l));d=d.redAdd(d).redIAdd(d);var p=c.redIAdd(c),v=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(v),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var y=f.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),e=d.redMul(p.redISub(t)).redISub(y)}return this.curve.jpoint(t,e,r)},l.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),h=(u=u.redIAdd(u)).redMul(s),l=a.redSqr().redISub(h.redAdd(h)),f=h.redISub(l),c=s.redSqr();c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=a.redMul(f).redISub(c),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,d,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),l=e.redMul(h);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(a).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var c=this.y.redMul(h.redMul(u.redISub(h)).redISub(s.redMul(a)));c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,c,d)},l.prototype.mul=function(t,e){return t=new _(t,e),this.curve._wnafMul(this,t)},l.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},l.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),0<=n.cmp(this.curve.p))return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}return!1},l.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)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":5,"../curve":8,"bn.js":2,inherits:32}],11:[function(t,e,r){"use strict";var n,i=r,o=t("hash.js"),s=t("../elliptic"),a=s.utils.assert;function u(t){"short"===t.type?this.curve=new s.curve.short(t):"edwards"===t.type?this.curve=new s.curve.edwards(t):this.curve=new s.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(e,r){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var t=new u(r);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:t}),t}})}i.PresetCurve=u,h("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("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:o.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"]}),h("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:o.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"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),h("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}h("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"../elliptic":5,"./precomputed/secp256k1":17,"hash.js":20}],12:[function(t,e,r){"use strict";var y=t("bn.js"),m=t("../../elliptic"),d=m.utils.assert,n=t("./key"),g=t("./signature");function i(t){if(!(this instanceof i))return new i(t);"string"==typeof t&&(d(m.curves.hasOwnProperty(t),"Unknown curve "+t),t=m.curves[t]),t instanceof m.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}(e.exports=i).prototype.keyPair=function(t){return new n(this,t)},i.prototype.keyFromPrivate=function(t,e){return n.fromPrivate(this,t,e)},i.prototype.keyFromPublic=function(t,e){return n.fromPublic(this,t,e)},i.prototype.genKeyPair=function(t){t||(t={});for(var e=new m.hmacDRBG({hash:this.hash,pers:t.pers,entropy:t.entropy||m.rand(this.hash.hmacStrength),nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new y(2));;){var i=new y(e.generate(r));if(!(0<i.cmp(n)))return i.iaddn(1),this.keyFromPrivate(i)}},i.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return 0<r&&(t=t.ushrn(r)),!e&&0<=t.cmp(this.n)?t.sub(this.n):t},i.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new y(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),s=t.toArray("be",i),a=new m.hmacDRBG({hash:this.hash,entropy:o,nonce:s,pers:n.pers,persEnc:n.persEnc}),u=this.n.sub(new y(1)),h=0;;h++){var l=n.k?n.k(h):new y(a.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||0<=l.cmp(u))){var f=this.g.mul(l);if(!f.isInfinity()){var c=f.getX(),d=c.umod(this.n);if(0!==d.cmpn(0)){var p=l.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var v=(f.getY().isOdd()?1:0)|(0!==c.cmp(d)?2:0);return n.canonical&&0<p.cmp(this.nh)&&(p=this.n.sub(p),v^=1),new g({r:d,s:p,recoveryParam:v})}}}}}},i.prototype.verify=function(t,e,r,n){t=this._truncateToN(new y(t,16)),r=this.keyFromPublic(r,n);var i=(e=new g(e,"hex")).r,o=e.s;if(i.cmpn(1)<0||0<=i.cmp(this.n))return!1;if(o.cmpn(1)<0||0<=o.cmp(this.n))return!1;var s,a=o.invm(this.n),u=a.mul(t).umod(this.n),h=a.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),h)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(u,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},i.prototype.recoverPubKey=function(t,e,r,n){d((3&r)===r,"The recovery param is more than two bits"),e=new g(e,n);var i=this.n,o=new y(t),s=e.r,a=e.s,u=1&r,h=r>>1;if(0<=s.cmp(this.curve.p.umod(this.curve.n))&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var l=e.r.invm(i),f=i.sub(o).mul(l).umod(i),c=a.mul(l).umod(i);return this.g.mulAdd(f,s,c)},i.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new g(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":5,"./key":13,"./signature":14,"bn.js":2}],13:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../../elliptic").utils.assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}(e.exports=o).fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":5,"bn.js":2}],14:[function(t,e,r){"use strict";var a=t("bn.js"),u=t("../../elliptic").utils,n=u.assert;function i(t,e){if(t instanceof i)return t;this._importDER(t,e)||(n(t.r&&t.s,"Signature without r or s"),this.r=new a(t.r,16),this.s=new a(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function h(){this.place=0}function l(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s];return e.place=s,i}function s(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function f(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}(e.exports=i).prototype._importDER=function(t,e){t=u.toArray(t,e);var r=new h;if(48!==t[r.place++])return!1;if(l(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var n=l(t,r),i=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var o=l(t,r);if(t.length!==o+r.place)return!1;var s=t.slice(r.place,o+r.place);return 0===i[0]&&128&i[1]&&(i=i.slice(1)),0===s[0]&&128&s[1]&&(s=s.slice(1)),this.r=new a(i),this.s=new a(s),!(this.recoveryParam=null)},i.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=s(e),r=s(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var i=n.concat(r),o=[48];return f(o,i.length),o=o.concat(i),u.encode(o,t)}},{"../../elliptic":5,"bn.js":2}],15:[function(t,e,r){arguments[4][7][0].apply(r,arguments)},{dup:7}],16:[function(t,e,r){"use strict";var n=t("hash.js"),s=t("../elliptic").utils,i=s.assert;function o(t){if(!(this instanceof o))return new o(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=s.toArray(t.entropy,t.entropyEnc),r=s.toArray(t.nonce,t.nonceEnc),n=s.toArray(t.pers,t.persEnc);i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}(e.exports=o).prototype._init=function(t,e,r){var n=t.concat(e).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},o.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},o.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=s.toBuffer(t,e),r=s.toBuffer(r,n),i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this.reseed=1},o.prototype.generate=function(t,e,r,n){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=s.toArray(r,n),this._update(r));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,t);return this._update(r),this.reseed++,s.encode(o,e)}},{"../elliptic":5,"hash.js":20}],17:[function(t,e,r){e.exports=void 0},{}],18:[function(t,e,r){"use strict";var n=r,i=t("bn.js");function o(t){return 1===t.length?"0"+t:t}function s(t){for(var e="",r=0;r<t.length;r++)e+=o(t[r].toString(16));return e}n.assert=function(t,e){if(!t)throw new Error(e||"Assertion failed")},n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},n.zero2=o,n.toHex=s,n.encode=function(t,e){return"hex"===e?s(t):t},n.getNAF=function(t,e){for(var r=[],n=1<<e+1,i=t.clone();0<=i.cmpn(1);){var o;if(i.isOdd()){var s=i.andln(n-1);o=(n>>1)-1<s?(n>>1)-s:s,i.isubn(o)}else o=0;r.push(o);for(var a=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,u=1;u<a;u++)r.push(0);i.iushrn(a)}return r},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;0<t.cmpn(-n)||0<e.cmpn(-i);){var o,s,a,u=t.andln(3)+n&3,h=e.andln(3)+i&3;3===u&&(u=-1),3===h&&(h=-1),o=0==(1&u)?0:3!=(a=t.andln(7)+n&7)&&5!==a||2!==h?u:-u,r[0].push(o),s=0==(1&h)?0:3!=(a=e.andln(7)+i&7)&&5!==a||2!==u?h:-h,r[1].push(s),2*n===o+1&&(n=1-n),2*i===s+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},{"bn.js":2}],19:[function(t,e,r){e.exports={version:"6.3.3"}},{}],20:[function(t,e,r){var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":21,"./hash/hmac":22,"./hash/ripemd":23,"./hash/sha":24,"./hash/utils":31}],21:[function(t,e,r){"use strict";var i=t("./utils"),n=t("minimalistic-assert");function o(){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}(r.BlockHash=o).prototype.update=function(t,e){if(t=i.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),n(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},{"./utils":31,"minimalistic-assert":34}],22:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}(e.exports=o).prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"./utils":31,"minimalistic-assert":34}],23:[function(t,e,r){e.exports={ripemd160:null}},{}],24:[function(t,e,r){"use strict";r.sha1=t("./sha/1"),r.sha224=t("./sha/224"),r.sha256=t("./sha/256"),r.sha384=t("./sha/384"),r.sha512=t("./sha/512")},{"./sha/1":25,"./sha/224":26,"./sha/256":27,"./sha/384":28,"./sha/512":29}],25:[function(t,e,r){arguments[4][7][0].apply(r,arguments)},{dup:7}],26:[function(t,e,r){arguments[4][7][0].apply(r,arguments)},{dup:7}],27:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("./common"),p=t("minimalistic-assert"),v=n.sum32,y=n.sum32_4,m=n.sum32_5,g=o.ch32,b=o.maj32,w=o.s0_256,_=o.s1_256,M=o.g0_256,A=o.g1_256,s=i.BlockHash,a=[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 u(){if(!(this instanceof u))return new u;s.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=a,this.W=new Array(64)}n.inherits(u,s),(e.exports=u).blockSize=512,u.outSize=256,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=y(A(r[n-2]),r[n-7],M(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],h=this.h[5],l=this.h[6],f=this.h[7];for(p(this.k.length===r.length),n=0;n<r.length;n++){var c=m(f,_(u),g(u,h,l),this.k[n],r[n]),d=v(w(i),b(i,o,s));f=l,l=h,h=u,u=v(a,c),a=s,s=o,o=i,i=v(c,d)}this.h[0]=v(this.h[0],i),this.h[1]=v(this.h[1],o),this.h[2]=v(this.h[2],s),this.h[3]=v(this.h[3],a),this.h[4]=v(this.h[4],u),this.h[5]=v(this.h[5],h),this.h[6]=v(this.h[6],l),this.h[7]=v(this.h[7],f)},u.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":21,"../utils":31,"./common":30,"minimalistic-assert":34}],28:[function(t,e,r){arguments[4][7][0].apply(r,arguments)},{dup:7}],29:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),C=t("minimalistic-assert"),o=n.rotr64_hi,s=n.rotr64_lo,a=n.shr64_hi,u=n.shr64_lo,B=n.sum64,L=n.sum64_hi,D=n.sum64_lo,c=n.sum64_4_hi,d=n.sum64_4_lo,U=n.sum64_5_hi,j=n.sum64_5_lo,h=i.BlockHash,l=[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 f(){if(!(this instanceof f))return new f;h.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=l,this.W=new Array(160)}function F(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function G(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function z(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function H(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function V(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function q(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function K(t,e){var r=o(t,e,14)^o(t,e,18)^o(e,t,9);return r<0&&(r+=4294967296),r}function W(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function p(t,e){var r=o(t,e,1)^o(t,e,8)^a(t,e,7);return r<0&&(r+=4294967296),r}function v(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function y(t,e){var r=o(t,e,19)^o(e,t,29)^a(t,e,6);return r<0&&(r+=4294967296),r}function m(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(f,h),(e.exports=f).blockSize=1024,f.outSize=512,f.hmacStrength=192,f.padLength=128,f.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=y(r[n-4],r[n-3]),o=m(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=p(r[n-30],r[n-29]),h=v(r[n-30],r[n-29]),l=r[n-32],f=r[n-31];r[n]=c(i,o,s,a,u,h,l,f),r[n+1]=d(i,o,s,a,u,h,l,f)}},f.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],u=this.h[5],h=this.h[6],l=this.h[7],f=this.h[8],c=this.h[9],d=this.h[10],p=this.h[11],v=this.h[12],y=this.h[13],m=this.h[14],g=this.h[15];C(this.k.length===r.length);for(var b=0;b<r.length;b+=2){var w=m,_=g,M=K(f,c),A=W(f,c),k=F(f,c,d,p,v),S=G(f,c,d,p,v,y),E=this.k[b],P=this.k[b+1],N=r[b],x=r[b+1],I=U(w,_,M,A,k,S,E,P,N,x),T=j(w,_,M,A,k,S,E,P,N,x);w=V(n,i),_=q(n,i),M=z(n,i,o,s,a),A=H(n,i,o,s,a,u);var R=L(w,_,M,A),O=D(w,_,M,A);m=v,g=y,v=d,y=p,d=f,p=c,f=L(h,l,I,T),c=D(l,l,I,T),h=a,l=u,a=o,u=s,o=n,s=i,n=L(I,T,R,O),i=D(I,T,R,O)}B(this.h,0,n,i),B(this.h,2,o,s),B(this.h,4,a,u),B(this.h,6,h,l),B(this.h,8,f,c),B(this.h,10,d,p),B(this.h,12,v,y),B(this.h,14,m,g)},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":21,"../utils":31,"minimalistic-assert":34}],30:[function(t,e,r){"use strict";var n=t("../utils").rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}r.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},r.ch32=i,r.maj32=o,r.p32=s,r.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},r.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},r.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":31}],31:[function(t,e,r){"use strict";var h=t("minimalistic-assert"),n=t("inherits");function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function i(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=n,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}else for(n=0;n<t.length;n++)r[n]=0|t[n];return r},r.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e},r.htonl=o,r.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=o(i)),r+=s(i.toString(16))}return r},r.zero2=i,r.zero8=s,r.join32=function(t,e,r,n){var i=r-e;h(i%4==0);for(var o=new Array(i/4),s=0,a=e;s<o.length;s++,a+=4){var u;u="big"===n?t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],o[s]=u>>>0}return o},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<<e|t>>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,h=e;return u+=(h=h+n>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,t+r+i+s+(u+=(h=h+a>>>0)<a?1:0)>>>0},r.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,h){var l=0,f=e;return l+=(f=f+n>>>0)<e?1:0,l+=(f=f+o>>>0)<o?1:0,l+=(f=f+a>>>0)<a?1:0,t+r+i+s+u+(l+=(f=f+h>>>0)<h?1:0)>>>0},r.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,h){return e+n+o+a+h>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:32,"minimalistic-assert":34}],32:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],33:[function(t,_,e){(function(b,w){!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof b&&b.versions&&b.versions.node&&(t=w);for(var e=!t.JS_SHA3_NO_COMMON_JS&&"object"==typeof _&&_.exports,u="0123456789abcdef".split(""),l=[0,8,16,24],lt=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],r=[224,256,384,512],o=["hex","buffer","arrayBuffer","array"],s=function(e,r,n){return function(t){return new m(e,r,e).update(t)[n]()}},a=function(r,n,i){return function(t,e){return new m(r,n,e).update(t)[i]()}},n=function(t,e){var r=s(t,e,"hex");r.create=function(){return new m(t,e,t)},r.update=function(t){return r.create().update(t)};for(var n=0;n<o.length;++n){var i=o[n];r[i]=s(t,e,i)}return r},i=[{name:"keccak",padding:[1,256,65536,16777216],bits:r,createMethod:n},{name:"sha3",padding:[6,1536,393216,100663296],bits:r,createMethod:n},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(e,r){var n=a(e,r,"hex");n.create=function(t){return new m(e,r,t)},n.update=function(t,e){return n.create(e).update(t)};for(var t=0;t<o.length;++t){var i=o[t];n[i]=a(e,r,i)}return n}}],h={},f=[],c=0;c<i.length;++c)for(var d=i[c],p=d.bits,v=0;v<p.length;++v){var y=d.name+"_"+p[v];f.push(y),h[y]=d.createMethod(p[v],d.padding)}function m(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}m.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,s=this.byteCount,a=this.blockCount,u=0,h=this.s;u<i;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<a+1;++r)o[r]=0;if(e)for(r=this.start;u<i&&r<s;++u)o[r>>2]|=t[u]<<l[3&r++];else for(r=this.start;u<i&&r<s;++u)(n=t.charCodeAt(u))<128?o[r>>2]|=n<<l[3&r++]:(n<2048?o[r>>2]|=(192|n>>6)<<l[3&r++]:(n<55296||57344<=n?o[r>>2]|=(224|n>>12)<<l[3&r++]:(n=65536+((1023&n)<<10|1023&t.charCodeAt(++u)),o[r>>2]|=(240|n>>18)<<l[3&r++],o[r>>2]|=(128|n>>12&63)<<l[3&r++]),o[r>>2]|=(128|n>>6&63)<<l[3&r++]),o[r>>2]|=(128|63&n)<<l[3&r++]);if(s<=(this.lastByteIndex=r)){for(this.start=r-s,this.block=o[a],r=0;r<a;++r)h[r]^=o[r];g(h),this.reset=!0}else this.start=r}return this},m.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];g(n)},m.prototype.toString=m.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<e&&s<n;++o,++s)t=r[o],a+=u[t>>4&15]+u[15&t]+u[t>>12&15]+u[t>>8&15]+u[t>>20&15]+u[t>>16&15]+u[t>>28&15]+u[t>>24&15];s%e==0&&(g(r),o=0)}return i&&(t=r[o],0<i&&(a+=u[t>>4&15]+u[15&t]),1<i&&(a+=u[t>>12&15]+u[t>>8&15]),2<i&&(a+=u[t>>20&15]+u[t>>16&15])),a},m.prototype.buffer=m.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e==0&&g(r)}return i&&(u[o]=r[o],t=t.slice(0,a)),t},m.prototype.digest=m.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)t=a<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&g(n)}return o&&(t=a<<2,e=n[s],0<o&&(u[t]=255&e),1<o&&(u[t+1]=e>>8&255),2<o&&(u[t+2]=e>>16&255)),u};var g=function(t){var e,r,n,i,o,s,a,u,h,l,f,c,d,p,v,y,m,g,b,w,_,M,A,k,S,E,P,N,x,I,T,R,O,C,B,L,D,U,j,F,G,z,H,V,q,K,W,J,Z,$,X,Y,Q,tt,et,rt,nt,it,ot,st,at,ut,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(c=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|h>>>31),r=o^(h<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|f>>>31),r=a^(f<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(c<<1|d>>>31),r=h^(d<<1|c>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],v=t[1],K=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,N=t[20]<<3|t[21]>>>29,x=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,H=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,B=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Z=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,et=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,_=t[37]<<21|t[36]>>>11,Y=t[47]<<24|t[46]>>>8,Q=t[46]<<24|t[47]>>>8,V=t[8]<<27|t[9]>>>5,q=t[9]<<27|t[8]>>>5,E=t[18]<<20|t[19]>>>12,P=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=p^~y&g,t[1]=v^~m&b,t[10]=k^~E&N,t[11]=S^~P&x,t[20]=C^~L&U,t[21]=B^~D&j,t[30]=V^~K&J,t[31]=q^~W&Z,t[40]=tt^~rt&it,t[41]=et^~nt&ot,t[2]=y^~g&w,t[3]=m^~b&_,t[12]=E^~N&I,t[13]=P^~x&T,t[22]=L^~U&F,t[23]=D^~j&G,t[32]=K^~J&$,t[33]=W^~Z&X,t[42]=rt^~it&st,t[43]=nt^~ot&at,t[4]=g^~w&M,t[5]=b^~_&A,t[14]=N^~I&R,t[15]=x^~T&O,t[24]=U^~F&z,t[25]=j^~G&H,t[34]=J^~$&Y,t[35]=Z^~X&Q,t[44]=it^~st&ut,t[45]=ot^~at&ht,t[6]=w^~M&p,t[7]=_^~A&v,t[16]=I^~R&k,t[17]=T^~O&S,t[26]=F^~z&C,t[27]=G^~H&B,t[36]=$^~Y&V,t[37]=X^~Q&q,t[46]=st^~ut&tt,t[47]=at^~ht&et,t[8]=M^~p&y,t[9]=A^~v&m,t[18]=R^~k&E,t[19]=O^~S&P,t[28]=z^~C&L,t[29]=H^~B&D,t[38]=Y^~V&K,t[39]=Q^~q&W,t[48]=ut^~tt&rt,t[49]=ht^~et&nt,t[0]^=lt[n],t[1]^=lt[n+1]};if(e)_.exports=h;else for(c=0;c<f.length;++c)t[f[c]]=h[f[c]]}()}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:35}],34:[function(t,e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}(e.exports=n).equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},{}],35:[function(t,e,r){e.exports={}},{}],36:[function(t,r,o){(function(B){"use strict";!function(t){var n=2147483647;function h(t){var y=[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],m=1779033703,g=3144134277,b=1013904242,w=2773480762,_=1359893119,M=2600822924,A=528734635,k=1541459225,S=new Array(64);function e(t){for(var e=0,r=t.length;64<=r;){var n,i,o,s,a,u=m,h=g,l=b,f=w,c=_,d=M,p=A,v=k;for(i=0;i<16;i++)o=e+4*i,S[i]=(255&t[o])<<24|(255&t[o+1])<<16|(255&t[o+2])<<8|255&t[o+3];for(i=16;i<64;i++)s=((n=S[i-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,a=((n=S[i-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,S[i]=(s+S[i-7]|0)+(a+S[i-16]|0)|0;for(i=0;i<64;i++)s=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&d^~c&p)|0)+(v+(y[i]+S[i]|0)|0)|0,a=((u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10))+(u&h^u&l^h&l)|0,v=p,p=d,d=c,c=f+s|0,f=l,l=h,h=u,u=s+a|0;m=m+u|0,g=g+h|0,b=b+l|0,w=w+f|0,_=_+c|0,M=M+d|0,A=A+p|0,k=k+v|0,e+=64,r-=64}}e(t);var r,n=t.length%64,i=t.length/536870912|0,o=t.length<<3,s=n<56?56:120,a=t.slice(t.length-n,t.length);for(a.push(128),r=n+1;r<s;r++)a.push(0);return a.push(i>>>24&255),a.push(i>>>16&255),a.push(i>>>8&255),a.push(i>>>0&255),a.push(o>>>24&255),a.push(o>>>16&255),a.push(o>>>8&255),a.push(o>>>0&255),e(a),[m>>>24&255,m>>>16&255,m>>>8&255,m>>>0&255,g>>>24&255,g>>>16&255,g>>>8&255,g>>>0&255,b>>>24&255,b>>>16&255,b>>>8&255,b>>>0&255,w>>>24&255,w>>>16&255,w>>>8&255,w>>>0&255,_>>>24&255,_>>>16&255,_>>>8&255,_>>>0&255,M>>>24&255,M>>>16&255,M>>>8&255,M>>>0&255,A>>>24&255,A>>>16&255,A>>>8&255,A>>>0&255,k>>>24&255,k>>>16&255,k>>>8&255,k>>>0&255]}function x(t,e,r){var n;t=t.length<=64?t:h(t);var i=64+e.length+4,o=new Array(i),s=new Array(64),a=[];for(n=0;n<64;n++)o[n]=54;for(n=0;n<t.length;n++)o[n]^=t[n];for(n=0;n<e.length;n++)o[64+n]=e[n];for(n=i-4;n<i;n++)o[n]=0;for(n=0;n<64;n++)s[n]=92;for(n=0;n<t.length;n++)s[n]^=t[n];function u(){for(var t=i-1;i-4<=t;t--){if(o[t]++,o[t]<=255)return;o[t]=0}}for(;32<=r;)u(),a=a.concat(h(s.concat(h(o)))),r-=32;return 0<r&&(u(),a=a.concat(h(s.concat(h(o))).slice(0,r))),a}function I(t,e,r,n,i){var o;for(R(t,16*(2*r-1),i,0,16),o=0;o<2*r;o++)T(t,16*o,i,16),s(i,n),R(i,0,t,e+16*o,16);for(o=0;o<r;o++)R(t,e+2*o*16,t,16*o,16);for(o=0;o<r;o++)R(t,e+16*(2*o+1),t,16*(o+r),16)}function i(t,e){return t<<e|t>>>32-e}function s(t,e){R(t,0,e,0,16);for(var r=8;0<r;r-=2)e[4]^=i(e[0]+e[12],7),e[8]^=i(e[4]+e[0],9),e[12]^=i(e[8]+e[4],13),e[0]^=i(e[12]+e[8],18),e[9]^=i(e[5]+e[1],7),e[13]^=i(e[9]+e[5],9),e[1]^=i(e[13]+e[9],13),e[5]^=i(e[1]+e[13],18),e[14]^=i(e[10]+e[6],7),e[2]^=i(e[14]+e[10],9),e[6]^=i(e[2]+e[14],13),e[10]^=i(e[6]+e[2],18),e[3]^=i(e[15]+e[11],7),e[7]^=i(e[3]+e[15],9),e[11]^=i(e[7]+e[3],13),e[15]^=i(e[11]+e[7],18),e[1]^=i(e[0]+e[3],7),e[2]^=i(e[1]+e[0],9),e[3]^=i(e[2]+e[1],13),e[0]^=i(e[3]+e[2],18),e[6]^=i(e[5]+e[4],7),e[7]^=i(e[6]+e[5],9),e[4]^=i(e[7]+e[6],13),e[5]^=i(e[4]+e[7],18),e[11]^=i(e[10]+e[9],7),e[8]^=i(e[11]+e[10],9),e[9]^=i(e[8]+e[11],13),e[10]^=i(e[9]+e[8],18),e[12]^=i(e[15]+e[14],7),e[13]^=i(e[12]+e[15],9),e[14]^=i(e[13]+e[12],13),e[15]^=i(e[14]+e[13],18);for(r=0;r<16;++r)t[r]+=e[r]}function T(t,e,r,n){for(var i=0;i<n;i++)r[i]^=t[e+i]}function R(t,e,r,n,i){for(;i--;)r[n++]=t[e++]}function O(t){if(!t||"number"!=typeof t.length)return!1;for(var e=0;e<t.length;e++){if("number"!=typeof t[e])return!1;var r=parseInt(t[e]);if(r!=t[e]||r<0||256<=r)return!1}return!0}function C(t,e){var r=parseInt(t);if(t!=r)throw new Error("invalid "+e);return r}function e(o,t,s,a,u,h,l){if(!l)throw new Error("missing callback");if(s=C(s,"N"),a=C(a,"r"),u=C(u,"p"),h=C(h,"dkLen"),0===s||0!=(s&s-1))throw new Error("N must be power of 2");if(n/128/a<s)throw new Error("N too large");if(n/128/u<a)throw new Error("r too large");if(!O(o))throw new Error("password must be an array or buffer");if(!O(t))throw new Error("salt must be an array or buffer");for(var f=x(o,t,128*u*a),c=new Uint32Array(32*u*a),e=0;e<c.length;e++){var r=4*e;c[e]=(255&f[r+3])<<24|(255&f[r+2])<<16|(255&f[r+1])<<8|(255&f[r+0])<<0}var d,p,v=new Uint32Array(64*a),y=new Uint32Array(32*a*s),m=32*a,g=new Uint32Array(16),b=new Uint32Array(16),w=u*s*2,_=0,M=null,A=!1,k=0,S=0,E=parseInt(1e3/a);console.log("SS2",typeof B,window);var P=void 0!==B?B:setTimeout,N=function(){if(A)return l(new Error("cancelled"),_/w);switch(k){case 0:R(c,p=32*S*a,v,0,m),k=1,d=0;case 1:E<(e=s-d)&&(e=E);for(var t=0;t<e;t++)R(v,0,y,(d+t)*m,m),I(v,m,a,g,b);if(d+=e,_+=e,(r=parseInt(1e3*_/w))!==M){if(A=l(null,_/w))break;M=r}if(d<s)break;d=0,k=2;case 2:var e,r;E<(e=s-d)&&(e=E);for(t=0;t<e;t++){var n=v[16*(2*a-1)]&s-1;T(y,n*m,v,m),I(v,m,a,g,b)}if(d+=e,_+=e,(r=parseInt(1e3*_/w))!==M){if(A=l(null,_/w))break;M=r}if(d<s)break;if(R(v,0,c,p,m),++S<u){k=0;break}f=[];for(t=0;t<c.length;t++)f.push(c[t]>>0&255),f.push(c[t]>>8&255),f.push(c[t]>>16&255),f.push(c[t]>>24&255);var i=x(o,f,h);return l(null,1,i)}P(N)};N()}void 0!==o?r.exports=e:t&&(t.scrypt&&(t._scrypt=t.scrypt),t.scrypt=e)}(this)}).call(this,t("timers").setImmediate)},{timers:38}],37:[function(t,e,r){(function(y,t){!function(r,n){"use strict";if(!r.setImmediate){var t,i,e,o,s,a=1,u={},h=!1,l=r.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(r);f=f&&f.setTimeout?f:r,"[object process]"==={}.toString.call(r.process)?t=function(){var t=c(arguments);return y.nextTick(d(p,t)),t}:!function(){if(r.postMessage&&!r.importScripts){var t=!0,e=r.onmessage;return r.onmessage=function(){t=!1},r.postMessage("","*"),r.onmessage=e,t}}()?r.MessageChannel?((e=new MessageChannel).port1.onmessage=function(t){p(t.data)},t=function(){var t=c(arguments);return e.port2.postMessage(t),t}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,t=function(){var t=c(arguments),e=l.createElement("script");return e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e),t}):t=function(){var t=c(arguments);return setTimeout(d(p,t),0),t}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===r&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},r.addEventListener?r.addEventListener("message",s,!1):r.attachEvent("onmessage",s),t=function(){var t=c(arguments);return r.postMessage(o+t,"*"),t}),f.setImmediate=t,f.clearImmediate=v}function c(t){return u[a]=d.apply(n,t),a++}function d(t){var e=[].slice.call(arguments,1);return function(){"function"==typeof t?t.apply(n,e):new Function(""+t)()}}function p(t){if(h)setTimeout(d(p,t),0);else{var e=u[t];if(e){h=!0;try{e()}finally{v(t),h=!1}}}}function v(t){delete u[t]}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:35}],38:[function(t,e,r){(function(t){e.exports={setImmediate:t.setImmediate}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],39:[function(t,i,e){(function(t){var e;if(t.crypto&&crypto.getRandomValues){var r=new Uint8Array(16);e=function(){return crypto.getRandomValues(r),r}}if(!e){var n=new Array(16);e=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),n[e]=t>>>((3&e)<<3)&255;return n}}i.exports=e}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],40:[function(t,e,r){for(var s=t("./rng"),i=[],o={},n=0;n<256;n++)i[n]=(n+256).toString(16).substr(1),o[i[n]]=n;function d(t,e){var r=e||0,n=i;return n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+"-"+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]+n[t[r++]]}var a=s(),p=[1|a[0],a[1],a[2],a[3],a[4],a[5]],v=16383&(a[6]<<8|a[7]),y=0,m=0;function u(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"==t?new Array(16):null,t=null);var i=(t=t||{}).random||(t.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e)for(var o=0;o<16;o++)e[n+o]=i[o];return e||d(i)}var h=u;h.v1=function(t,e,r){var n=e&&r||0,i=e||[],o=void 0!==(t=t||{}).clockseq?t.clockseq:v,s=void 0!==t.msecs?t.msecs:(new Date).getTime(),a=void 0!==t.nsecs?t.nsecs:m+1,u=s-y+(a-m)/1e4;if(u<0&&void 0===t.clockseq&&(o=o+1&16383),(u<0||y<s)&&void 0===t.nsecs&&(a=0),1e4<=a)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");y=s,v=o;var h=(1e4*(268435455&(s+=122192928e5))+(m=a))%4294967296;i[n++]=h>>>24&255,i[n++]=h>>>16&255,i[n++]=h>>>8&255,i[n++]=255&h;var l=s/4294967296*1e4&268435455;i[n++]=l>>>8&255,i[n++]=255&l,i[n++]=l>>>24&15|16,i[n++]=l>>>16&255,i[n++]=o>>>8|128,i[n++]=255&o;for(var f=t.node||p,c=0;c<6;c++)i[n+c]=f[c];return e||d(i)},h.v4=u,h.parse=function(t,e,r){var n=e&&r||0,i=0;for(e=e||[],t.toLowerCase().replace(/[0-9a-f]{2}/g,function(t){i<16&&(e[n+i++]=o[t])});i<16;)e[n+i++]=0;return e},h.unparse=d,e.exports=h},{"./rng":39}],41:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../src.ts/utils/bytes");e.exports={decode:function(t){t=atob(t);for(var e=[],r=0;r<t.length;r++)e.push(t.charCodeAt(r));return n.arrayify(e)},encode:function(t){t=n.arrayify(t);for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}}},{"../src.ts/utils/bytes":62}],42:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],43:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("hash.js")),o=t("../src.ts/utils/bytes"),s=n(t("../src.ts/utils/errors")),a=i.hmac,u={sha256:!0,sha512:!0};r.computeHmac=function(t,e,r){return u[t]||s.throwError("unsupported algorithm "+t,s.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),o.arrayify(a(i[t],o.arrayify(e)).update(o.arrayify(r)).digest())}},{"../src.ts/utils/bytes":62,"../src.ts/utils/errors":63,"hash.js":20}],44:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var m=t("../src.ts/utils/bytes"),g=t("../src.ts/utils/hmac");r.pbkdf2=function(t,e,r,n,i){var o;t=m.arrayify(t),e=m.arrayify(e);var s,a,u=1,h=new Uint8Array(n),l=new Uint8Array(e.length+4);l.set(e);for(var f=1;f<=u;f++){l[e.length]=f>>24&255,l[e.length+1]=f>>16&255,l[e.length+2]=f>>8&255,l[e.length+3]=255&f;var c=g.computeHmac(i,t,l);o||(o=c.length,a=new Uint8Array(o),s=n-((u=Math.ceil(n/o))-1)*o),a.set(c);for(var d=1;d<r;d++){c=g.computeHmac(i,t,c);for(var p=0;p<o;p++)a[p]^=c[p]}var v=(f-1)*o,y=f===u?s:o;h.set(m.arrayify(a).slice(0,y),v)}return m.arrayify(h)}},{"../src.ts/utils/bytes":62,"../src.ts/utils/hmac":43}],45:[function(o,t,s){(function(t){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r=o("../src.ts/utils/bytes"),e=o("../src.ts/utils/properties"),n=t.crypto||t.msCrypto;function i(t){if(t<=0||1024<t||parseInt(t)!=t)throw new Error("invalid length");var e=new Uint8Array(t);return n.getRandomValues(e),r.arrayify(e)}n&&n.getRandomValues||(console.log("WARNING: Missing strong random number source; using weak randomBytes"),n={getRandomValues:function(t){for(var e=0;e<20;e++)for(var r=0;r<t.length;r++)e?t[r]^=Math.trunc(256*Math.random()):t[r]=Math.trunc(256*Math.random());return t},_weakCrypto:!0}),s.randomBytes=i,!0===n._weakCrypto&&e.defineReadOnly(i,"_weakCrypto",!0)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../src.ts/utils/bytes":62,"../src.ts/utils/properties":67}],46:[function(t,e,r){t("setimmediate")},{setimmediate:37}],47:[function(t,e,r){"use strict";try{e.exports.XMLHttpRequest=XMLHttpRequest}catch(t){console.log("Warning: XMLHttpRequest is not defined"),e.exports.XMLHttpRequest=null}},{}],48:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=t("./interface"),s=t("../providers/provider"),a=t("../wallet/wallet"),u=t("../utils/address"),h=t("../utils/bytes"),l=t("../utils/bignumber"),f=t("../utils/properties"),c=n(t("../utils/errors")),d={data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};function p(i,t,o){var s=i.interface.functions[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n={};if(t.length===s.inputs.length+1&&"object"==typeof t[t.length-1])for(var r in n=f.shallowCopy(t.pop()))if(!d[r])throw new Error("unknown transaction override "+r);if(t.length!=s.inputs.length)throw new Error("incorrect number of arguments");return["data","to"].forEach(function(t){null!=n[t]&&c.throwError("cannot override "+t,c.UNSUPPORTED_OPERATION,{operation:t})}),n.to=i.addressPromise,function n(i,o,t){if(Array.isArray(t)){var s=[];return t.forEach(function(t,e){var r=null;r=Array.isArray(o)?o[e]:o[t.name],s.push(n(i,r,t))}),Promise.all(s)}return"address"===t.type?i.resolveName(o):t.components?n(i,o,t.components):Promise.resolve(o)}(i.provider,t,s.inputs).then(function(r){if(n.data=s.encode(r),"call"===s.type)return o?Promise.resolve(l.ConstantZero):(i.provider||c.throwError("call (constant functions) require a provider or a signer with a provider",c.UNSUPPORTED_OPERATION,{operation:"call"}),["gasLimit","gasPrice","value"].forEach(function(t){if(null!=n[t])throw new Error("call cannot override "+t)}),null==n.from&&i.signer&&(n.from=i.signer.getAddress()),i.provider.call(n).then(function(e){try{var t=s.decode(e);return 1===s.outputs.length&&(t=t[0]),t}catch(t){throw"0x"===e&&0<s.outputs.length&&c.throwError("call exception",c.CALL_EXCEPTION,{address:i.address,method:s.signature,value:r}),t}}));if("transaction"===s.type)return o?(i.provider||c.throwError("estimate gas require a provider or a signer with a provider",c.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),null==n.from&&i.signer&&(n.from=i.signer.getAddress()),i.provider.estimateGas(n)):(i.signer||c.throwError("sending a transaction require a signer",c.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=n.from&&c.throwError("cannot override from in a transaction",c.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),i.signer.sendTransaction(n));throw new Error("invalid type - "+s.type)})}}var i=function(){function i(t,e,r){var u=this;if(c.checkNew(this,i),e instanceof o.Interface?f.defineReadOnly(this,"interface",e):f.defineReadOnly(this,"interface",new o.Interface(e)),r instanceof a.Signer?(f.defineReadOnly(this,"provider",r.provider),f.defineReadOnly(this,"signer",r)):r instanceof s.Provider?(f.defineReadOnly(this,"provider",r),f.defineReadOnly(this,"signer",null)):c.throwError("invalid signer or provider",c.INVALID_ARGUMENT,{arg:"signerOrProvider",value:r}),f.defineReadOnly(this,"estimate",{}),f.defineReadOnly(this,"events",{}),f.defineReadOnly(this,"functions",{}),!t)return f.defineReadOnly(this,"address",null),void f.defineReadOnly(this,"addressPromise",Promise.resolve(null));f.defineReadOnly(this,"address",t),f.defineReadOnly(this,"addressPromise",this.provider.resolveName(t)),Object.keys(this.interface.functions).forEach(function(t){var e=p(u,t,!1);null==u[t]?f.defineReadOnly(u,t,e):console.log("WARNING: Multiple definitions for "+t),null==u.functions[t]&&(f.defineReadOnly(u.functions,t,e),f.defineReadOnly(u.estimate,t,p(u,t,!0)))}),Object.keys(this.interface.events).forEach(function(n){var i=u.interface.events[n],o=null,s=u;function a(r){s.addressPromise.then(function(t){if(t==r.address)try{var e=i.decode(r.data,r.topics);r.args=e,r.event=n,r.parse=i.parse,r.removeListener=function(){s.provider.removeListener([i.topic],a)},r.getBlock=function(){return s.provider.getBlock(r.blockHash)},r.getTransaction=function(){return s.provider.getTransaction(r.transactionHash)},r.getTransactionReceipt=function(){return s.provider.getTransactionReceipt(r.transactionHash)},r.eventSignature=i.signature,o.apply(r,Array.prototype.slice.call(e))}catch(t){console.log(t)}})}var t={enumerable:!0,get:function(){return o},set:function(t){t||(t=null),s.provider||c.throwError("events require a provider or a signer with a provider",c.UNSUPPORTED_OPERATION,{operation:"events"}),!t&&o?s.provider.removeListener([i.topic],a):t&&!o&&s.provider.on([i.topic],a),o=t}},e="on"+n.toLowerCase();null==u[e]&&Object.defineProperty(u,e,t),Object.defineProperty(u.events,n,t)},this)}return i.prototype.fallback=function(t){this.signer||c.throwError("sending a transaction require a signer",c.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var e=f.shallowCopy(t||{});return["from","to"].forEach(function(t){null!=e.to&&c.throwError("cannot override "+t,c.UNSUPPORTED_OPERATION,{operation:t})}),e.to=this.addressPromise,this.signer.sendTransaction(e)},i.prototype.callFallback=function(t){this.provider||c.throwError("call (constant functions) require a provider or a signer with a provider",c.UNSUPPORTED_OPERATION,{operation:"call(fallback)"});var e=f.shallowCopy(t||{});return["to","value"].forEach(function(t){null!=e.to&&c.throwError("cannot override "+t,c.UNSUPPORTED_OPERATION,{operation:t})}),e.to=this.addressPromise,this.provider.call(e)},i.prototype.connect=function(t){return new i(this.address,this.interface,t)},i.prototype.deploy=function(t){for(var r=this,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(null==this.signer)throw new Error("missing signer");return"string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&t.length%2==0&&(t="0x"+t),h.isHexString(t)||c.throwError("bytecode must be a valid hex string",c.INVALID_ARGUMENT,{arg:"bytecode",value:t}),t.length%2!=0&&c.throwError("bytecode must be valid data (even length)",c.INVALID_ARGUMENT,{arg:"bytecode",value:t}),this.signer.sendTransaction({data:this.interface.deployFunction.encode(t,e)}).then(function(t){var e=new i(u.getContractAddress(t),r.interface,r.signer||r.provider);return f.defineReadOnly(e,"deployTransaction",t),e})},i}();r.Contract=i},{"../providers/provider":57,"../utils/address":60,"../utils/bignumber":61,"../utils/bytes":62,"../utils/errors":63,"../utils/properties":67,"../wallet/wallet":80,"./interface":50}],49:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./contract");r.Contract=n.Contract;var i=t("./interface");r.Interface=i.Interface},{"./contract":48,"./interface":50}],50:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var f=t("../utils/abi-coder"),s=t("../utils/bignumber"),c=t("../utils/bytes"),a=t("../utils/keccak256"),u=t("../utils/utf8"),h=t("../utils/properties"),l=o(t("../utils/errors"));function d(t){var i=[],o=[];return t.forEach(function(t){if(null!=t.components){if("tuple"!==t.type.substring(0,5))throw new Error("internal error; report on GitHub");var e="",r=t.type.indexOf("[");0<=r&&(e=t.type.substring(r));var n=d(t.components);i.push({name:t.name||null,names:n.names}),o.push("tuple("+n.types.join(",")+")"+e)}else i.push(t.name||null),o.push(t.type)}),{names:i,types:o}}var p=function(t){for(var e in t){var r=t[e];null!=r&&"object"==typeof r?h.defineFrozen(this,e,t[e]):h.defineReadOnly(this,e,t[e])}},v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(r.Description=p);r.Indexed=v;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.encode=function(t,e){c.isHexString(t)||l.throwError("invalid contract bytecode",l.INVALID_ARGUMENT,{arg:"bytecode",type:typeof t,value:t}),e.length<this.inputs.length?l.throwError("missing constructor argument",l.MISSING_ARGUMENT,{arg:this.inputs[e.length].name||"unknown",count:e.length,expectedCount:this.inputs.length}):e.length>this.inputs.length&&l.throwError("too many constructor arguments",l.UNEXPECTED_ARGUMENT,{count:e.length,expectedCount:this.inputs.length});try{return t+f.defaultAbiCoder.encode(this.inputs,e).substring(2)}catch(t){l.throwError("invalid constructor argument",l.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},e}(p);r.DeployDescription=y;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.encode=function(t){t.length<this.inputs.length?l.throwError("missing input argument",l.MISSING_ARGUMENT,{arg:this.inputs[t.length].name||"unknown",count:t.length,expectedCount:this.inputs.length,name:this.name}):t.length>this.inputs.length&&l.throwError("too many input arguments",l.UNEXPECTED_ARGUMENT,{count:t.length,expectedCount:this.inputs.length});try{return this.sighash+f.defaultAbiCoder.encode(this.inputs,t).substring(2)}catch(t){l.throwError("invalid input argument",l.INVALID_ARGUMENT,{arg:t.arg,reason:t.reason,value:t.value})}return null},e.prototype.decode=function(e){try{return f.defaultAbiCoder.decode(this.outputs,c.arrayify(e))}catch(t){l.throwError("invalid data for function output",l.INVALID_ARGUMENT,{arg:"data",errorArg:t.arg,errorValue:t.value,value:e,reason:t.reason})}},e}(p);r.FunctionDescription=m;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(p),b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.decode=function(t,r){null==r||this.anonymous||(r=r.slice(1));var n=[],i=[],o=[];if(this.inputs.forEach(function(t,e){t.indexed?"string"===t.type||"bytes"===t.type||0<=t.type.indexOf("[")||"tuple"===t.type.substring(0,5)?(n.push({type:"bytes32",name:t.name||""}),o.push(!0)):(n.push(t),o.push(!1)):(i.push(t),o.push(!1))}),null!=r)var s=f.defaultAbiCoder.decode(n,c.concat(r));var a=f.defaultAbiCoder.decode(i,c.arrayify(t)),u=new g({}),h=0,l=0;return this.inputs.forEach(function(t,e){t.indexed?null==r?u[e]=new v({type:"indexed",hash:null}):o[e]?u[e]=new v({type:"indexed",hash:s[l++]}):u[e]=s[l++]:u[e]=a[h++],t.name&&(u[t.name]=u[e])}),u.length=this.inputs.length,u},e}(p);r.EventDescription=b;var w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(p),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(p);function M(t){switch(t.type){case"constructor":var e=new y({inputs:t.inputs,payable:null==t.payable||!!t.payable,type:"deploy"});this.deployFunction||(this.deployFunction=e);break;case"function":n=(n="("+d(t.inputs).types.join(",")+")").replace(/tuple/g,""),n=t.name+n;var r=a.keccak256(u.toUtf8Bytes(n)).substring(0,10);e=new m({inputs:t.inputs,outputs:t.outputs,payable:null==t.payable||!!t.payable,type:t.constant?"call":"transaction",signature:n,sighash:r});t.name&&null==this.functions[t.name]&&h.defineReadOnly(this.functions,t.name,e),null==this.functions[e.signature]&&h.defineReadOnly(this.functions,e.signature,e);break;case"event":var n;n=(n="("+d(t.inputs).types.join(",")+")").replace(/tuple/g,""),n=t.name+n;e=new b({name:t.name,signature:n,inputs:t.inputs,topic:a.keccak256(u.toUtf8Bytes(n)),anonymous:!!t.anonymous,type:"event"});t.name&&null==this.events[t.name]&&h.defineReadOnly(this.events,t.name,e),null==this.events[e.signature]&&h.defineReadOnly(this.events,e.signature,e);break;case"fallback":break;default:console.log("WARNING: unsupported ABI type - "+t.type)}}var A=function(){function t(e){if(l.checkNew(this,t),"string"==typeof e){try{e=JSON.parse(e)}catch(t){l.throwError("could not parse ABI JSON",l.INVALID_ARGUMENT,{arg:"abi",errorMessage:t.message,value:e})}if(!Array.isArray(e))return l.throwError("invalid abi",l.INVALID_ARGUMENT,{arg:"abi",value:e}),null}h.defineReadOnly(this,"functions",{}),h.defineReadOnly(this,"events",{});var r=[];e.forEach(function(t){"string"==typeof t&&(t=f.parseSignature(t)),r.push(t)}),h.defineFrozen(this,"abi",r),r.forEach(M,this),this.deployFunction||M.call(this,{type:"constructor",inputs:[]})}return t.prototype.parseTransaction=function(t){var e=t.data.substring(0,10).toLowerCase();for(var r in this.functions)if(-1!==r.indexOf("(")){var n=this.functions[r];if(n.sighash===e){var i=f.defaultAbiCoder.decode(n.inputs,"0x"+t.data.substring(10));return new w({args:i,decode:n.decode,name:r,signature:n.signature,sighash:n.sighash,type:"transaction",value:s.bigNumberify(t.value||0)})}}return null},t.prototype.parseLog=function(t){for(var e in this.events)if(-1!==e.indexOf("(")){var r=this.events[e];if(!r.anonymous&&r.topic===t.topics[0])return new _({name:r.name,signature:r.signature,topic:r.topic,type:"log",values:r.decode(t.data,t.topics)})}return null},t}();r.Interface=A},{"../utils/abi-coder":59,"../utils/bignumber":61,"../utils/bytes":62,"../utils/errors":63,"../utils/keccak256":66,"../utils/properties":67,"../utils/utf8":74}],51:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("./provider"),a=t("../utils/bytes"),u=t("../utils/properties"),h=t("../utils/web"),l=o(t("../utils/errors"));function f(t){var e=[];for(var r in t)if(null!=t[r]){var n=a.hexlify(t[r]);({gasLimit:!0,gasPrice:!0,nonce:!0,value:!0})[r]&&(n=a.hexStripZeros(n)),e.push(r+"="+n)}return e.join("&")}function c(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"OK"!=t.message){var e=new Error("invalid response");throw e.result=JSON.stringify(t),e}return t.result}function d(t){if("2.0"!=t.jsonrpc)throw(e=new Error("invalid response")).result=JSON.stringify(t),e;if(t.error){var e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function p(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}var v=function(a){function o(t,e){var r=a.call(this,t)||this;l.checkNew(r,o);var n="invalid";r.network&&(n=r.network.name);var i=null;switch(n){case"homestead":i="https://api.etherscan.io";break;case"ropsten":i="https://api-ropsten.etherscan.io";break;case"rinkeby":i="https://api-rinkeby.etherscan.io";break;case"kovan":i="https://api-kovan.etherscan.io";break;default:throw new Error("unsupported network")}return u.defineReadOnly(r,"baseUrl",i),u.defineReadOnly(r,"apiKey",e),r}return i(o,a),o.prototype.perform=function(t,e){var r=this.baseUrl,n="";switch(this.apiKey&&(n+="&apikey="+this.apiKey),t){case"getBlockNumber":return r+="/api?module=proxy&action=eth_blockNumber"+n,h.fetchJson(r,null,d);case"getGasPrice":return r+="/api?module=proxy&action=eth_gasPrice"+n,h.fetchJson(r,null,d);case"getBalance":return r+="/api?module=account&action=balance&address="+e.address,r+="&tag="+e.blockTag+n,h.fetchJson(r,null,c);case"getTransactionCount":return r+="/api?module=proxy&action=eth_getTransactionCount&address="+e.address,r+="&tag="+e.blockTag+n,h.fetchJson(r,null,d);case"getCode":return r+="/api?module=proxy&action=eth_getCode&address="+e.address,r+="&tag="+e.blockTag+n,h.fetchJson(r,null,d);case"getStorageAt":return r+="/api?module=proxy&action=eth_getStorageAt&address="+e.address,r+="&position="+e.position,r+="&tag="+e.blockTag+n,h.fetchJson(r,null,d);case"sendTransaction":return r+="/api?module=proxy&action=eth_sendRawTransaction&hex="+e.signedTransaction,r+=n,h.fetchJson(r,null,d);case"getBlock":if(e.blockTag)return r+="/api?module=proxy&action=eth_getBlockByNumber&tag="+e.blockTag,r+="&boolean=false",r+=n,h.fetchJson(r,null,d);throw new Error("getBlock by blockHash not implmeneted");case"getTransaction":return r+="/api?module=proxy&action=eth_getTransactionByHash&txhash="+e.transactionHash,r+=n,h.fetchJson(r,null,d);case"getTransactionReceipt":return r+="/api?module=proxy&action=eth_getTransactionReceipt&txhash="+e.transactionHash,r+=n,h.fetchJson(r,null,d);case"call":return(i=f(e.transaction))&&(i="&"+i),r+="/api?module=proxy&action=eth_call"+i,r+=n,h.fetchJson(r,null,d);case"estimateGas":var i;return(i=f(e.transaction))&&(i="&"+i),r+="/api?module=proxy&action=eth_estimateGas&"+i,r+=n,h.fetchJson(r,null,d);case"getLogs":r+="/api?module=logs&action=getLogs";try{if(e.filter.fromBlock&&(r+="&fromBlock="+p(e.filter.fromBlock)),e.filter.toBlock&&(r+="&toBlock="+p(e.filter.toBlock)),e.filter.address&&(r+="&address="+e.filter.address),e.filter.topics&&0<e.filter.topics.length){if(1<e.filter.topics.length)throw new Error("unsupported topic format");var o=e.filter.topics[0];if("string"!=typeof o||66!==o.length)throw new Error("unsupported topic0 format");r+="&topic0="+o}}catch(t){return Promise.reject(t)}r+=n;var s=this;return h.fetchJson(r,null,c).then(function(t){var r={},n=Promise.resolve();return t.forEach(function(e){n=n.then(function(){return null!=e.blockHash?null:(e.blockHash=r[e.transactionHash],null==e.blockHash?s.getTransaction(e.transactionHash).then(function(t){r[e.transactionHash]=t.blockHash,e.blockHash=t.blockHash}):null)})}),n.then(function(){return t})});case"getEtherPrice":return"homestead"!==this.network.name?Promise.resolve(0):(r+="/api?module=stats&action=ethprice",r+=n,h.fetchJson(r,null,c).then(function(t){return parseFloat(t.ethusd)}))}return a.prototype.perform.call(this,t,e)},o.prototype.getHistory=function(t,e,r){var n=this.baseUrl,i="";return this.apiKey&&(i+="&apikey="+this.apiKey),null==e&&(e=0),null==r&&(r=99999999),this.resolveName(t).then(function(t){return n+="/api?module=account&action=txlist&address="+t,n+="&startblock="+e,n+="&endblock="+r,n+="&sort=asc"+i,h.fetchJson(n,null,c).then(function(t){var r=[];return t.forEach(function(e){["contractAddress","to"].forEach(function(t){""==e[t]&&delete e[t]}),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);var t=s.checkTransactionResponse(e);e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),r.push(t)}),r})})},o}(s.Provider);r.EtherscanProvider=v},{"../utils/bytes":62,"../utils/errors":63,"../utils/properties":67,"../utils/web":75,"./provider":57}],52:[function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("./provider"),a=i(t("../utils/errors"));function u(e){var r=!0,n=null;return e.forEach(function(t){null!=t?null!=n?n.name===t.name&&n.chainId===t.chainId&&n.ensAddress===t.ensAddress||a.throwError("provider mismatch",a.INVALID_ARGUMENT,{arg:"providers",networks:e}):n=t:r=!1}),r}var h=function(n){function i(t){var e=this;if(0===t.length)throw new Error("no providers");if(u(t.map(function(t){return t.network})))e=n.call(this,t[0].network)||this;else{var r=Promise.all(t.map(function(t){return t.getNetwork()})).then(function(t){return u(t)||a.throwError("getNetwork returned null",a.UNKNOWN_ERROR,{}),t[0]});e=n.call(this,r)||this}return a.checkNew(e,i),e._providers=t.slice(0),e}return o(i,n),Object.defineProperty(i.prototype,"providers",{get:function(){return this._providers.slice(0)},enumerable:!0,configurable:!0}),i.prototype.perform=function(i,o){var s=this.providers;return new Promise(function(r,t){var n=null;!function e(){s.length?s.shift().perform(i,o).then(function(t){r(t)},function(t){n||(n=t),e()}):t(n)}()})},i}(s.Provider);r.FallbackProvider=h},{"../utils/errors":63,"./provider":57}],53:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./provider");r.Provider=n.Provider,r.ProviderSigner=n.ProviderSigner;var i=t("./etherscan-provider");r.EtherscanProvider=i.EtherscanProvider;var o=t("./fallback-provider");r.FallbackProvider=o.FallbackProvider;var s=t("./ipc-provider");r.IpcProvider=s.IpcProvider;var a=t("./infura-provider");r.InfuraProvider=a.InfuraProvider;var u=t("./json-rpc-provider");r.JsonRpcProvider=u.JsonRpcProvider;var h=t("./web3-provider");r.Web3Provider=h.Web3Provider,r.getDefaultProvider=function(t){return new o.FallbackProvider([new a.InfuraProvider(t),new i.EtherscanProvider(t)])}},{"./etherscan-provider":51,"./fallback-provider":52,"./infura-provider":54,"./ipc-provider":42,"./json-rpc-provider":55,"./provider":57,"./web3-provider":58}],54:[function(t,e,r){"use strict";var n,s=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=t("./json-rpc-provider"),a=t("./networks"),u=t("../utils/properties"),h=i(t("../utils/errors")),l=function(i){function o(t,e){var r,n=null;switch((t=a.getNetwork(null==t?"homestead":t)).name){case"homestead":n="mainnet.infura.io";break;case"ropsten":n="ropsten.infura.io";break;case"rinkeby":n="rinkeby.infura.io";break;case"kovan":n="kovan.infura.io";break;default:throw new Error("unsupported network")}return r=i.call(this,"https://"+n+"/"+(e||""),t)||this,h.checkNew(r,o),u.defineReadOnly(r,"apiAccessToken",e||null),r}return s(o,i),o.prototype._startPending=function(){console.log("WARNING: INFURA does not support pending filters")},o.prototype.getSigner=function(t){return h.throwError("INFURA does not support signing",h.UNSUPPORTED_OPERATION,{operation:"getSigner"}),null},o.prototype.listAccounts=function(){return Promise.resolve([])},o}(o.JsonRpcProvider);r.InfuraProvider=l},{"../utils/errors":63,"../utils/properties":67,"./json-rpc-provider":55,"./networks":56}],55:[function(t,e,r){"use strict";var n,s=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var a=t("./networks"),o=t("./provider"),u=t("../wallet/wallet"),h=t("../utils/address"),l=t("../utils/bytes"),f=t("../utils/properties"),c=t("../utils/utf8"),d=t("../utils/web"),p=i(t("../utils/errors"));function v(t){if(t.error){var e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function y(r){var n={};return["gasLimit","gasPrice","nonce","value"].forEach(function(t){if(null!=r[t]){var e=l.hexStripZeros(l.hexlify(r[t]));"gasLimit"===t&&(t="gas"),n[t]=e}}),["from","to","data"].forEach(function(t){null!=r[t]&&(n[t]=l.hexlify(r[t]))}),n}function m(t){return t?t.toLowerCase():t}r.hexlifyTransaction=y;var g=function(n){function i(t,e){var r=n.call(this)||this;return p.checkNew(r,i),f.defineReadOnly(r,"provider",t),e&&f.defineReadOnly(r,"_address",e),r}return s(i,n),Object.defineProperty(i.prototype,"address",{get:function(){return this._address||p.throwError("no sync sync address available; use getAddress",p.UNSUPPORTED_OPERATION,{operation:"address"}),this._address},enumerable:!0,configurable:!0}),i.prototype.getAddress=function(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(function(t){return 0===t.length&&p.throwError("no accounts",p.UNSUPPORTED_OPERATION,{operation:"getAddress"}),h.getAddress(t[0])})},i.prototype.getBalance=function(t){return this.provider.getBalance(this.getAddress(),t)},i.prototype.getTransactionCount=function(t){return this.provider.getTransactionCount(this.getAddress(),t)},i.prototype.sendTransaction=function(e){var r=this,t=y(e);return null==t.from&&(t.from=this.getAddress().then(function(t){return t?t.toLowerCase():null})),f.resolveProperties(t).then(function(t){return r.provider.send("eth_sendTransaction",[e])})},i.prototype.signMessage=function(t){var e=this,r="string"==typeof t?c.toUtf8Bytes(t):t;return this.getAddress().then(function(t){return e.provider.send("eth_sign",[t.toLowerCase(),l.hexlify(r)])})},i.prototype.unlock=function(e){var r=this.provider;return this.getAddress().then(function(t){return r.send("personal_unlockAccount",[t.toLowerCase(),e,null])})},i}(u.Signer);r.JsonRpcSigner=g;var b=function(i){function o(t,e){var n=this;if("string"==typeof t&&null===e&&a.getNetwork(t)&&(e=t,t=null),e)n=i.call(this,e)||this;else{var r=new Promise(function(r,t){setTimeout(function(){n.send("net_version",[]).then(function(t){var e=parseInt(t);r(a.getNetwork(e))})})});n=i.call(this,r)||this}return p.checkNew(n,o),t||(t="http://localhost:8545"),n.connection="string"==typeof t?{url:t}:t,n}return s(o,i),o.prototype.getSigner=function(t){return new g(this,t)},o.prototype.listAccounts=function(){return this.send("eth_accounts",[]).then(function(t){return t.map(function(t){return h.getAddress(t)})})},o.prototype.send=function(t,e){var r={method:t,params:e,id:42,jsonrpc:"2.0"};return d.fetchJson(this.connection,JSON.stringify(r),v)},o.prototype.perform=function(t,e){switch(t){case"getBlockNumber":return this.send("eth_blockNumber",[]);case"getGasPrice":return this.send("eth_gasPrice",[]);case"getBalance":return this.send("eth_getBalance",[m(e.address),e.blockTag]);case"getTransactionCount":return this.send("eth_getTransactionCount",[m(e.address),e.blockTag]);case"getCode":return this.send("eth_getCode",[m(e.address),e.blockTag]);case"getStorageAt":return this.send("eth_getStorageAt",[m(e.address),e.position,e.blockTag]);case"sendTransaction":return this.send("eth_sendRawTransaction",[e.signedTransaction]);case"getBlock":return e.blockTag?this.send("eth_getBlockByNumber",[e.blockTag,!1]):e.blockHash?this.send("eth_getBlockByHash",[e.blockHash,!1]):Promise.reject(new Error("invalid block tag or block hash"));case"getTransaction":return this.send("eth_getTransactionByHash",[e.transactionHash]);case"getTransactionReceipt":return this.send("eth_getTransactionReceipt",[e.transactionHash]);case"call":return this.send("eth_call",[y(e.transaction),"latest"]);case"estimateGas":return this.send("eth_estimateGas",[y(e.transaction)]);case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=m(e.filter.address)),this.send("eth_getLogs",[e.filter])}return p.throwError(t+" not implemented",p.NOT_IMPLEMENTED,{operation:t}),null},o.prototype._startPending=function(){if(null==this._pendingFilter){var r=this,n=this.send("eth_newPendingTransactionFilter",[]);(this._pendingFilter=n).then(function(e){return function t(){r.send("eth_getFilterChanges",[e]).then(function(t){if(r._pendingFilter!=n)return null;var e=Promise.resolve();return t.forEach(function(t){r._emitted["t:"+t.toLowerCase()]="pending",e=e.then(function(){return r.getTransaction(t).then(function(t){r.emit("pending",t)})})}),e.then(function(){return e=1e3,new Promise(function(t){setTimeout(function(){t()},e)});var e})}).then(function(){r._pendingFilter==n?setTimeout(function(){t()},0):r.send("eth_uninstallFilter",[e])})}(),e})}},o.prototype._stopPending=function(){this._pendingFilter=null},o}(o.Provider);r.JsonRpcProvider=b},{"../utils/address":60,"../utils/bytes":62,"../utils/errors":63,"../utils/properties":67,"../utils/utf8":74,"../utils/web":75,"../wallet/wallet":80,"./networks":56,"./provider":57}],56:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=n(t("../utils/errors")),i={chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},s={chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},a={unspecified:{chainId:0},homestead:i,mainnet:i,morden:{chainId:2},ropsten:s,testnet:s,rinkeby:{chainId:4,ensAddress:"0xe7410170f87102DF0055eB195163A03B7F2Bff4A"},kovan:{chainId:42},classic:{chainId:61}};r.getNetwork=function(t){if(!t)return null;if("number"==typeof t){for(var e in a){var r=a[e];if(r.chainId===t)return{name:e,chainId:r.chainId,ensAddress:r.ensAddress}}return{chainId:t,name:"unknown"}}if("string"==typeof t){var n=a[t];return null==n?null:{name:t,chainId:n.chainId,ensAddress:n.ensAddress}}var i=a[t.name];return i?(0!==t.chainId&&t.chainId!==i.chainId&&o.throwError("network chainId mismatch",o.INVALID_ARGUMENT,{name:"network",value:t}),{name:t.name,chainId:i.chainId,ensAddress:i.ensAddress}):("number"!=typeof i.chainId&&o.throwError("invalid network chainId",o.INVALID_ARGUMENT,{name:"network",value:t}),t)}},{"../utils/errors":63}],57:[function(t,e,r){"use strict";var n,s=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=t("../wallet/wallet"),a=t("../utils/address"),u=t("../utils/bignumber"),h=t("../utils/bytes"),l=t("../utils/utf8"),f=t("../utils/rlp"),c=t("../utils/hash"),d=t("./networks"),p=t("../utils/properties"),v=t("../utils/transaction"),y=i(t("../utils/errors"));function m(t,e){var r={};for(var n in t)try{var i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}function g(e,r){return function(t){return null==t?r:e(t)}}function b(r){return function(t){if(!Array.isArray(t))throw new Error("not an array");var e=[];return t.forEach(function(t){e.push(r(t))}),e}}function w(t){return"string"==typeof t&&32===h.hexDataLength(t)?t:(y.throwError("invalid hash",y.INVALID_ARGUMENT,{arg:"hash",value:t}),null)}function _(t){return u.bigNumberify(t).toNumber()}function M(t){if(!h.isHexString(t))throw new Error("invalid uint256");for(;t.length<66;)t="0x0"+t.substring(2);return t}function A(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t)return h.hexStripZeros(h.hexlify(t));if(h.isHexString(t))return h.hexStripZeros(t);throw new Error("invalid blockTag")}var k={hash:w,parentHash:w,number:_,timestamp:_,nonce:g(h.hexlify),difficulty:function(t){var e=u.bigNumberify(t);try{return e.toNumber()}catch(t){}return null},gasLimit:u.bigNumberify,gasUsed:u.bigNumberify,miner:a.getAddress,extraData:h.hexlify,transactions:g(b(w))};function S(t){return null!=t.author&&null==t.miner&&(t.miner=t.author),m(k,t)}var E={hash:w,blockHash:g(w,null),blockNumber:g(_,null),transactionIndex:g(_,null),from:a.getAddress,gasPrice:u.bigNumberify,gasLimit:u.bigNumberify,to:g(a.getAddress,null),value:u.bigNumberify,nonce:_,data:h.hexlify,r:g(M),s:g(M),v:g(_),creates:g(a.getAddress,null),raw:g(h.hexlify)};function P(t){if(null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&u.bigNumberify(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=a.getContractAddress(t)),!t.raw&&t.v&&t.r&&t.s){var e=[h.stripZeros(h.hexlify(t.nonce)),h.stripZeros(h.hexlify(t.gasPrice)),h.stripZeros(h.hexlify(t.gasLimit)),t.to||"0x",h.stripZeros(h.hexlify(t.value||"0x")),h.hexlify(t.data||"0x"),h.stripZeros(h.hexlify(t.v||"0x")),h.stripZeros(h.hexlify(t.r)),h.stripZeros(h.hexlify(t.s))];t.raw=f.encode(e)}var r=m(E,t),n=t.networkId;return h.isHexString(n)&&(n=u.bigNumberify(n).toNumber()),"number"!=typeof n&&null!=r.v&&((n=(r.v-35)/2)<0&&(n=0),n=parseInt(n)),"number"!=typeof n&&(n=0),r.networkId=n,r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}r.checkTransactionResponse=P;var N={from:g(a.getAddress),nonce:g(_),gasLimit:g(u.bigNumberify),gasPrice:g(u.bigNumberify),to:g(a.getAddress),value:g(u.bigNumberify),data:g(h.hexlify)};function x(t){return m(N,t)}var I={transactionLogIndex:g(_),transactionIndex:_,blockNumber:_,transactionHash:w,address:a.getAddress,topics:b(w),data:h.hexlify,logIndex:_,blockHash:w};var T={contractAddress:g(a.getAddress,null),transactionIndex:_,root:g(w),gasUsed:u.bigNumberify,logsBloom:g(h.hexlify),blockHash:w,transactionHash:w,logs:b(function(t){return m(I,t)}),blockNumber:_,cumulativeGasUsed:u.bigNumberify,status:g(_)};var R={fromBlock:g(A,void 0),toBlock:g(A,void 0),address:g(a.getAddress,void 0),topics:g(function e(t){return Array.isArray(t)?t.forEach(function(t){e(t)}):null!=t&&w(t),t},void 0)};var O,C,B={blockNumber:g(_),blockHash:g(w),transactionIndex:_,removed:g(function(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===t)return!0;if("false"===t)return!1}throw new Error("invaid boolean - "+t)}),address:a.getAddress,data:(O=h.hexlify,C="0x",function(t){return t?O(t):C}),topics:b(w),transactionHash:w,logIndex:_};function L(t){return m(B,t)}function D(o,t){return new Promise(function(n,e){var i=0;!function r(){t().then(function(t){if(t||o())n(t);else{i++;var e=500+250*Math.trunc(Math.random()*(1<<i));1e4<e&&(e=1e4),setTimeout(r,e)}},function(t){e(t)})}()})}function U(t,e){if(Array.isArray(t)){var r=[];return t.forEach(function(t){r.push(U(t,e))}),r}return e(t)}function j(t){try{return"address:"+a.getAddress(t)}catch(t){}if("block"===t)return"block";if("pending"===t)return"pending";if(32===h.hexDataLength(t))return"tx:"+t;if(Array.isArray(t)){t=U(t,function(t){return null==t&&(t="0x"),t});try{return"topic:"+f.encode(t)}catch(t){console.log(t)}}try{throw new Error}catch(t){console.log(t.stack)}throw new Error("invalid event - "+t)}var F=function(i){function o(t,e,r){var n=i.call(this)||this;return y.checkNew(n,o),p.defineReadOnly(n,"_addressPromise",Promise.resolve(t)),p.defineReadOnly(n,"signDigest",e),p.defineReadOnly(n,"provider",r),n}return s(o,i),o.prototype.getAddress=function(){return this._addressPromise},o.prototype.signMessage=function(t){return Promise.resolve(h.joinSignature(this.signDigest(c.hashMessage(t))))},o.prototype.sendTransaction=function(t){var r=this;return null==(t=p.shallowCopy(t)).chainId&&(t.chainId=this.provider.getNetwork().then(function(t){return t.chainId})),null==t.from&&(t.from=this.getAddress()),null==t.gasLimit&&(t.gasLimit=this.provider.estimateGas(t)),null==t.gasPrice&&(t.gasPrice=this.provider.getGasPrice()),p.resolveProperties(t).then(function(t){var e=v.sign(t,r.signDigest);return r._addressPromise.then(function(t){return v.parse(e).from!==t&&y.throwError("signing address does not match expected address",y.UNKNOWN_ERROR,{address:v.parse(e).from,expectedAddress:t,signedTransaction:e}),r.provider.sendTransaction(e)})})},o}(o.Signer);r.ProviderSigner=F;var G=function(){function n(t){var e=this;if(y.checkNew(this,n),t instanceof Promise)p.defineReadOnly(this,"ready",t.then(function(t){return p.defineReadOnly(e,"_network",t),t}));else{var r=d.getNetwork(null==t?"homestead":t);r?(p.defineReadOnly(this,"_network",r),p.defineReadOnly(this,"ready",Promise.resolve(this._network))):y.throwError("invalid network",y.INVALID_ARGUMENT,{arg:"network",value:t})}this._lastBlockNumber=-2,this._balances={},this._events={},this._pollingInterval=4e3,this._emitted={block:this._lastBlockNumber}}return n.prototype._doPoll=function(){var i=this;this.getBlockNumber().then(function(e){if(e!==i._lastBlockNumber){-2===i._lastBlockNumber&&(i._lastBlockNumber=e-1);for(var r=i._lastBlockNumber+1;r<=e;r++)i._emitted.block<r&&(i._emitted.block=r,Object.keys(i._emitted).forEach(function(t){"block"!==t&&i._emitted[t]>r+12&&delete i._emitted[t]})),i.emit("block",r);var n={};Object.keys(i._events).forEach(function(t){var r=function(t){if("tx:"===t.substring(0,3))return{type:"transaction",hash:t.substring(3)};if("block"===t)return{type:"block"};if("pending"===t)return{type:"pending"};if("address:"===t.substring(0,8))return{type:"address",address:t.substring(8)};if("topic:"===t.substring(0,6))try{var e=f.decode(t.substring(6));return{type:"topic",topic:e=U(e,function(t){return"0x"===t&&(t=null),t})}}catch(t){console.log(t)}throw new Error("invalid event string")}(t);"transaction"===r.type?i.getTransaction(r.hash).then(function(t){t&&null!=t.blockNumber&&(i._emitted["t:"+t.hash.toLowerCase()]=t.blockNumber,i.emit(r.hash,t))}):"address"===r.type?(i._balances[r.address]&&(n[r.address]=i._balances[r.address]),i.getBalance(r.address,"latest").then(function(t){var e=this._balances[r.address];e&&t.eq(e)||(this._balances[r.address]=t,this.emit(r.address,t))})):"topic"===r.type&&i.getLogs({fromBlock:i._lastBlockNumber+1,toBlock:e,topics:r.topic}).then(function(t){0!==t.length&&t.forEach(function(t){i._emitted["b:"+t.blockHash.toLowerCase()]=t.blockNumber,i._emitted["t:"+t.transactionHash.toLowerCase()]=t.blockNumber,i.emit(r.topic,t)})})}),i._lastBlockNumber=e,i._balances=n}}),this.doPoll()},n.prototype.resetEventsBlock=function(t){this._lastBlockNumber=this.blockNumber,this._doPoll()},Object.defineProperty(n.prototype,"network",{get:function(){return this._network},enumerable:!0,configurable:!0}),n.prototype.getNetwork=function(){return this.ready},Object.defineProperty(n.prototype,"blockNumber",{get:function(){return this._lastBlockNumber<0?null:this._lastBlockNumber},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"polling",{get:function(){return null!=this._poller},set:function(t){var e=this;setTimeout(function(){t&&!e._poller?e._poller=setInterval(e._doPoll.bind(e),e.pollingInterval):!t&&e._poller&&(clearInterval(e._poller),e._poller=null)},0)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pollingInterval",{get:function(){return this._pollingInterval},set:function(t){var e=this;if("number"!=typeof t||t<=0||Math.trunc(t)!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval(function(){e._doPoll()},this._pollingInterval))},enumerable:!0,configurable:!0}),n.prototype.waitForTransaction=function(i,o){var s=this;return new Promise(function(e,t){var r=null;function n(t){r&&clearTimeout(r),e(t)}s.once(i,n),"number"==typeof o&&0<o&&(r=setTimeout(function(){s.removeListener(i,n),t(new Error("timeout"))},o))})},n.prototype.getBlockNumber=function(){var t=this;return this.ready.then(function(){return t.perform("getBlockNumber",{}).then(function(t){var e=Math.trunc(t);if(e!=t)throw new Error("invalid response - getBlockNumber");return e})})},n.prototype.getGasPrice=function(){var t=this;return this.ready.then(function(){return t.perform("getGasPrice",{}).then(function(t){return u.bigNumberify(t)})})},n.prototype.getBalance=function(t,e){var n=this;return this.ready.then(function(){return p.resolveProperties({addressOrName:t,blockTag:e}).then(function(t){var e=t.addressOrName,r=t.blockTag;return n.resolveName(e).then(function(t){var e={address:t,blockTag:A(r)};return n.perform("getBalance",e).then(function(t){return u.bigNumberify(t)})})})})},n.prototype.getTransactionCount=function(t,e){var n=this;return this.ready.then(function(){return p.resolveProperties({addressOrName:t,blockTag:e}).then(function(t){var e=t.addressOrName,r=t.blockTag;return n.resolveName(e).then(function(t){var e={address:t,blockTag:A(r)};return n.perform("getTransactionCount",e).then(function(t){var e=parseInt(t);if(e!=t)throw new Error("invalid response - getTransactionCount");return e})})})})},n.prototype.getCode=function(t,e){var n=this;return this.ready.then(function(){return p.resolveProperties({addressOrName:t,blockTag:e}).then(function(t){var e=t.addressOrName,r=t.blockTag;return n.resolveName(e).then(function(t){var e={address:t,blockTag:A(r)};return n.perform("getCode",e).then(function(t){return h.hexlify(t)})})})})},n.prototype.getStorageAt=function(t,e,r){var i=this;return this.ready.then(function(){return p.resolveProperties({addressOrName:t,position:e,blockTag:r}).then(function(t){var e=t.addressOrName,r=t.position,n=t.blockTag;return i.resolveName(e).then(function(t){var e={address:t,blockTag:A(n),position:h.hexStripZeros(h.hexlify(r))};return i.perform("getStorageAt",e).then(function(t){return h.hexlify(t)})})})})},n.prototype.sendTransaction=function(t){var n=this;return this.ready.then(function(){return p.resolveProperties({signedTransaction:t}).then(function(t){var r=t.signedTransaction,e={signedTransaction:h.hexlify(r)};return n.perform("sendTransaction",e).then(function(e){if(32!==h.hexDataLength(e))throw new Error("invalid response - sendTransaction");var t=v.parse(r);return t.hash!==e&&y.throwError("Transaction hash mismatch from Proivder.sendTransaction.",y.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n._emitted["t:"+t.hash.toLowerCase()]="pending",t.wait=function(t){return n.waitForTransaction(e,t)},t})})})},n.prototype.call=function(t){var r=this;return this.ready.then(function(){return p.resolveProperties(t).then(function(t){return r._resolveNames(t,["to","from"]).then(function(t){var e={transaction:x(t)};return r.perform("call",e).then(function(t){return h.hexlify(t)})})})})},n.prototype.estimateGas=function(t){var r=this;return this.ready.then(function(){return p.resolveProperties(t).then(function(t){return r._resolveNames(t,["to","from"]).then(function(t){var e={transaction:x(t)};return r.perform("estimateGas",e).then(function(t){return u.bigNumberify(t)})})})})},n.prototype.getBlock=function(t){var i=this;return this.ready.then(function(){return p.resolveProperties({blockHashOrBlockTag:t}).then(function(t){var e=t.blockHashOrBlockTag;try{var r=h.hexlify(e);if(32===h.hexDataLength(r))return D(function(){return null==i._emitted["b:"+r.toLowerCase()]},function(){return i.perform("getBlock",{blockHash:r}).then(function(t){return null==t?null:S(t)})})}catch(t){}try{var n=A(e);return D(function(){return!h.isHexString(n)||parseInt(n.substring(2),16)>i._emitted.block},function(){return i.perform("getBlock",{blockTag:n}).then(function(t){return null==t?null:S(t)})})}catch(t){}throw new Error("invalid block hash or block tag")})})},n.prototype.getTransaction=function(t){var n=this;return this.ready.then(function(){return p.resolveProperties({transactionHash:t}).then(function(t){var e=t.transactionHash,r={transactionHash:w(e)};return D(function(){return null==n._emitted["t:"+e.toLowerCase()]},function(){return n.perform("getTransaction",r).then(function(t){return null!=t&&(t=P(t)),t})})})})},n.prototype.getTransactionReceipt=function(t){var n=this;return this.ready.then(function(){return p.resolveProperties({transactionHash:t}).then(function(t){var e=t.transactionHash,r={transactionHash:w(e)};return D(function(){return null==n._emitted["t:"+e.toLowerCase()]},function(){return n.perform("getTransactionReceipt",r).then(function(t){var e,r;return null!=t&&((r=m(T,e=t)).logs.forEach(function(t,e){null==t.transactionLogIndex&&(t.transactionLogIndex=e)}),null!=e.status&&(r.byzantium=!0),t=r),t})})})})},n.prototype.getLogs=function(t){var n=this;return this.ready.then(function(){return p.resolveProperties(t).then(function(t){return n._resolveNames(t,["address"]).then(function(t){var e,r={filter:(e=t,m(R,e))};return n.perform("getLogs",r).then(function(t){return b(L)(t)})})})})},n.prototype.getEtherPrice=function(){var t=this;return this.ready.then(function(){return t.perform("getEtherPrice",{}).then(function(t){return t})})},n.prototype._resolveNames=function(t,e){var r=[],n=function(t){var e={};for(var r in t)e[r]=t[r];return e}(t);return e.forEach(function(e){void 0!==n[e]&&r.push(this.resolveName(n[e]).then(function(t){n[e]=t}))},this),Promise.all(r).then(function(){return n})},n.prototype._getResolver=function(n){var i=this;return this.getNetwork().then(function(t){t.ensAddress||y.throwError("network does support ENS",y.UNSUPPORTED_OPERATION,{operation:"ENS",network:t.name});var e="0x0178b8bf"+c.namehash(n).substring(2),r={to:t.ensAddress,data:e};return i.call(r).then(function(t){return 32!==h.hexDataLength(t)?null:a.getAddress(h.hexDataSlice(t,12))})})},n.prototype.resolveName=function(t){var e=this;if(t instanceof Promise)return t.then(function(t){return e.resolveName(t)});try{return Promise.resolve(a.getAddress(t))}catch(t){}var r=this,n=c.namehash(t);return this._getResolver(t).then(function(t){var e={to:t,data:"0x3b3b57de"+n.substring(2)};return r.call(e)}).then(function(t){if(32!==h.hexDataLength(t))return null;var e=a.getAddress(h.hexDataSlice(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e})},n.prototype.lookupAddress=function(n){var e=this;if(n instanceof Promise)return n.then(function(t){return e.lookupAddress(t)});var t=(n=a.getAddress(n)).substring(2)+".addr.reverse",r=c.namehash(t),i=this;return this._getResolver(t).then(function(t){if(!t)return null;var e={to:t,data:"0x691f3431"+r.substring(2)};return i.call(e)}).then(function(t){if((t=t.substring(2)).length<64)return null;if((t=t.substring(64)).length<64)return null;var e=u.bigNumberify("0x"+t.substring(0,64)).toNumber();if(2*e>(t=t.substring(64)).length)return null;var r=l.toUtf8String("0x"+t.substring(0,2*e));return i.resolveName(r).then(function(t){return t!=n?null:r})})},n.prototype.doPoll=function(){},n.prototype.perform=function(t,e){return y.throwError(t+" not implemented",y.NOT_IMPLEMENTED,{operation:t}),null},n.prototype._startPending=function(){console.log("WARNING: this provider does not support pending events")},n.prototype._stopPending=function(){},n.prototype.on=function(t,e){var r=j(t);return this._events[r]||(this._events[r]=[]),this._events[r].push({eventName:t,listener:e,type:"on"}),"pending"===r&&this._startPending(),this.polling=!0,this},n.prototype.once=function(t,e){var r=j(t);return this._events[r]||(this._events[r]=[]),this._events[r].push({eventName:t,listener:e,type:"once"}),"pending"===r&&this._startPending(),this.polling=!0,this},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=!1,i=j(t),o=this._events[i];if(!o)return n;for(var s=0;s<o.length;s++){var a=o[s];"once"===a.type&&(o.splice(s,1),s--);try{a.listener.apply(this,e),n=!0}catch(t){console.log("Event Listener Error: "+t.message)}}return 0===o.length&&(delete this._events[i],"pending"===i&&this._stopPending()),0===this.listenerCount()&&(this.polling=!1),n},n.prototype.listenerCount=function(t){if(!t){var e=0;for(var r in this._events)e+=this._events[r].length;return e}var n=this._events[j(t)];return n?n.length:0},n.prototype.listeners=function(t){var e=this._events[j(t)];if(!e)return[];for(var r=[],n=0;n<e.length;n++)r.push(e[n].listener);return r},n.prototype.removeAllListeners=function(t){return delete this._events[j(t)],0===this.listenerCount()&&(this.polling=!1),this},n.prototype.removeListener=function(t,e){var r=j(t),n=this._events[r];if(!n)return this;for(var i=0;i<n.length;i++)if(n[i].listener===e){n.splice(i,1);break}return 0===n.length&&this.removeAllListeners(t),this},n}();r.Provider=G},{"../utils/address":60,"../utils/bignumber":61,"../utils/bytes":62,"../utils/errors":63,"../utils/hash":64,"../utils/properties":67,"../utils/rlp":68,"../utils/transaction":72,"../utils/utf8":74,"../wallet/wallet":80,"./networks":56}],58:[function(t,e,r){"use strict";var n,s=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var o=t("./json-rpc-provider"),a=t("../utils/properties"),u=i(t("../utils/errors")),h=function(i){function o(t,e){var r;t&&t.sendAsync||u.throwError("invalid web3Provider",u.INVALID_ARGUMENT,{arg:"web3Provider",value:t});var n=t.host||t.path||"unknown";return r=i.call(this,n,e)||this,u.checkNew(r,o),a.defineReadOnly(r,"_web3Provider",t),r}return s(o,i),o.prototype.send=function(e,i){var o=this;return"eth_sign"==e&&this._web3Provider.isMetaMask&&(e="personal_sign",i=[i[1],i[0]]),new Promise(function(r,n){var t={method:e,params:i,id:42,jsonrpc:"2.0"};o._web3Provider.sendAsync(t,function(t,e){if(t)n(t);else{if(e.error)return(t=new Error(e.error.message)).code=e.error.code,t.data=e.error.data,void n(t);r(e.result)}})})},o}(o.JsonRpcProvider);r.Web3Provider=h},{"../utils/errors":63,"../utils/properties":67,"./json-rpc-provider":55}],59:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("./address"),a=t("./bignumber"),u=t("./bytes"),h=t("./utf8"),l=t("./properties"),f=o(t("./errors")),c=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);r.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),y=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function m(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(e,t){function r(t){throw new Error('unexpected character "'+e[t]+'" at position '+t+' in "'+e+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o<e.length;o++){var s=e[o];switch(s){case"(":i.state.allowParams||r(o),i.state.allowType=!1,i.type=m(i.type),i.components=[{type:"",name:"",parent:i,state:{allowType:!0}}],i=i.components[0];break;case")":delete i.state,i.type=m(i.type);var a=i;(i=i.parent)||r(o),delete a.parent,i.state.allowParams=!1,i.state.allowName=!0,i.state.allowArray=!0;break;case",":delete i.state,i.type=m(i.type);var u={type:"",name:"",parent:i.parent,state:{allowType:!0}};i.parent.components.push(u),delete i.parent,i=u;break;case" ":i.state.allowType&&""!==i.type&&(i.type=m(i.type),delete i.state.allowType,i.state.allowName=!0,i.state.allowParams=!0),i.state.allowName&&""!==i.name&&(t&&"indexed"===i.name?(i.indexed=!0,i.name=""):i.state.allowName=!1);break;case"[":i.state.allowArray||r(o),i.type+=s,i.state.allowArray=!1,i.state.allowName=!1,i.state.readArray=!0;break;case"]":i.state.readArray||r(o),i.type+=s,i.state.readArray=!1,i.state.allowArray=!0,i.state.allowName=!0;break;default:i.state.allowType?(i.type+=s,i.state.allowParams=!0,i.state.allowArray=!0):i.state.allowName?(i.name+=s,delete i.state.allowArray):i.state.readArray?i.type+=s:r(o)}}if(i.parent)throw new Error("unexpected eof");return delete n.state,n.type=m(n.type),n}r.parseParamType=function(t){return g(t,!0)},r.parseSignature=function(t){if("string"==typeof t)return"event "===(t=(t=t.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).substring(0,6)?function(t){var e={anonymous:!1,inputs:[],name:"",type:"event"},r=t.match(v);if(!r)throw new Error("invalid event: "+t);if(e.name=r[1].trim(),B(r[2]).forEach(function(t){(t=g(t,!0)).indexed=!!t.indexed,e.inputs.push(t)}),r[3].split(" ").forEach(function(t){switch(t){case"anonymous":e.anonymous=!0;break;case"":break;default:console.log("unknown modifier: "+t)}}),e.name&&!e.name.match(y))throw new Error('invalid identifier: "'+e.name+'"');return e}(t.substring(6).trim()):("function "===t.substring(0,9)&&(t=t.substring(9)),function(t){var e={constant:!1,inputs:[],name:"",outputs:[],payable:!1,stateMutability:null,type:"function"},r=t.split(" returns "),n=r[0].match(v);if(!n)throw new Error("invalid signature");if(e.name=n[1].trim(),!e.name.match(y))throw new Error('invalid identifier: "'+n[1]+'"');if(B(n[2]).forEach(function(t){e.inputs.push(g(t))}),n[3].split(" ").forEach(function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0;break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"":break;default:console.log("unknown modifier: "+t)}}),1<r.length){var i=r[1].match(v);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");B(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var b=function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i},w=function(r){function t(t,e){return r.call(this,t,"null","",e,!1)||this}return i(t,r),t.prototype.encode=function(t){return u.arrayify([])},t.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(b),_=function(s){function t(t,e,r,n){var i=this,o=(r?"int":"uint")+8*e;return(i=s.call(this,t,o,o,n,!1)||this).size=e,i.signed=r,i}return i(t,s),t.prototype.encode=function(e){try{var t=a.bigNumberify(e);return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),u.padZeros(u.arrayify(t),32)}catch(t){f.throwError("invalid number value",f.INVALID_ARGUMENT,{arg:this.localName,type:typeof e,value:e})}return null},t.prototype.decode=function(t,e){t.length<e+32&&f.throwError("insufficient data for "+this.name+" type",f.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:u.hexlify(t.slice(e,e+32))});var r=32-this.size,n=a.bigNumberify(t.slice(e+r,e+32));return n=this.signed?n.fromTwos(8*this.size):n.maskn(8*this.size),{consumed:32,value:this.coerceFunc(this.name,n)}},t}(b),M=new _(function(t,e){return e},32,!1,"none"),A=function(r){function t(t,e){return r.call(this,t,"bool","bool",e,!1)||this}return i(t,r),t.prototype.encode=function(t){return M.encode(t?1:0)},t.prototype.decode=function(t,e){try{var r=M.decode(t,e)}catch(t){throw"insufficient data for uint256 type"===t.reason&&f.throwError("insufficient data for boolean type",f.INVALID_ARGUMENT,{arg:this.localName,coderType:"boolean",value:t.value}),t}return{consumed:r.consumed,value:this.coerceFunc("bool",!r.value.isZero())}},t}(b),k=function(o){function t(t,e,r){var n=this,i="bytes"+e;return(n=o.call(this,t,i,i,r,!1)||this).length=e,n}return i(t,o),t.prototype.encode=function(e){var t=new Uint8Array(32);try{var r=u.arrayify(e);if(32<r.length)throw new Error;t.set(r)}catch(t){f.throwError("invalid "+this.name+" value",f.INVALID_ARGUMENT,{arg:this.localName,type:typeof e,value:t.value||e})}return t},t.prototype.decode=function(t,e){return t.length<e+32&&f.throwError("insufficient data for "+name+" type",f.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:u.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc(this.name,u.hexlify(t.slice(e,e+this.length)))}},t}(b),S=function(r){function t(t,e){return r.call(this,t,"address","address",e,!1)||this}return i(t,r),t.prototype.encode=function(e){var t=new Uint8Array(32);try{t.set(u.arrayify(s.getAddress(e)),12)}catch(t){f.throwError("invalid address",f.INVALID_ARGUMENT,{arg:this.localName,type:typeof e,value:e})}return t},t.prototype.decode=function(t,e){return t.length<e+32&&f.throwError("insufficuent data for address type",f.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:u.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc("address",s.getAddress(u.hexlify(t.slice(e+12,e+32))))}},t}(b);function E(t){var e=Math.trunc(32*Math.ceil(t.length/32)),r=new Uint8Array(e-t.length);return u.concat([M.encode(t.length),t,r])}function P(t,e,r){t.length<e+32&&f.throwError("insufficient data for dynamicBytes length",f.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:u.hexlify(t.slice(e,e+32))});var n=M.decode(t,e).value;try{n=n.toNumber()}catch(t){f.throwError("dynamic bytes count too large",f.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:n.toString()})}return t.length<e+32+n&&f.throwError("insufficient data for dynamicBytes type",f.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:u.hexlify(t.slice(e,e+32+n))}),{consumed:Math.trunc(32+32*Math.ceil(n/32)),value:t.slice(e+32,e+32+n)}}var N=function(r){function t(t,e){return r.call(this,t,"bytes","bytes",e,!0)||this}return i(t,r),t.prototype.encode=function(e){try{return E(u.arrayify(e))}catch(t){f.throwError("invalid bytes value",f.INVALID_ARGUMENT,{arg:this.localName,type:typeof e,value:t.value})}return null},t.prototype.decode=function(t,e){var r=P(t,e,this.localName);return r.value=this.coerceFunc("bytes",u.hexlify(r.value)),r},t}(b),x=function(r){function t(t,e){return r.call(this,t,"string","string",e,!0)||this}return i(t,r),t.prototype.encode=function(t){return"string"!=typeof t&&f.throwError("invalid string value",f.INVALID_ARGUMENT,{arg:this.localName,type:typeof t,value:t}),E(h.toUtf8Bytes(t))},t.prototype.decode=function(t,e){var r=P(t,e,this.localName);return r.value=this.coerceFunc("string",h.toUtf8String(r.value)),r},t}(b);function I(t){return Math.trunc(32*Math.ceil(t/32))}function T(t,r){if(Array.isArray(r));else if(r&&"object"==typeof r){var e=[];t.forEach(function(t){e.push(r[t.localName])}),r=e}else f.throwError("invalid tuple value",f.INVALID_ARGUMENT,{coderType:"tuple",type:typeof r,value:r});t.length!==r.length&&f.throwError("types/value length mismatch",f.INVALID_ARGUMENT,{coderType:"tuple",value:r});var n=[];t.forEach(function(t,e){n.push({dynamic:t.dynamic,value:t.encode(r[e])})});var i=0,o=0;n.forEach(function(t){t.dynamic?(i+=32,o+=I(t.value.length)):i+=I(t.value.length)});var s=0,a=i,u=new Uint8Array(i+o);return n.forEach(function(t){t.dynamic?(u.set(M.encode(a),s),s+=32,u.set(t.value,a),a+=I(t.value.length)):(u.set(t.value,s),s+=I(t.value.length))}),u}function R(t,n,i){var o=i,s=0,a=[];return t.forEach(function(t){if(t.dynamic){var e=M.decode(n,i);(r=t.decode(n,o+e.value.toNumber())).consumed=e.consumed}else var r=t.decode(n,i);null!=r.value&&a.push(r.value),i+=r.consumed,s+=r.consumed}),t.forEach(function(t,e){var r=t.localName;r&&("length"===r&&(r="_length"),null==a[r]&&(a[r]=a[e]))}),{value:a,consumed:s}}var O=function(a){function t(t,e,r,n){var i=this,o=e.type+"["+(0<=r?r:"")+"]",s=-1===r||e.dynamic;return(i=a.call(this,t,"array",o,n,s)||this).coder=e,i.length=r,i}return i(t,a),t.prototype.encode=function(t){Array.isArray(t)||f.throwError("expected array value",f.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",type:typeof t,value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=M.encode(e)),e!==t.length&&f.throwError("array value length mismatch",f.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",count:t.length,expectedCount:e,value:t});for(var n=[],i=0;i<t.length;i++)n.push(this.coder);return u.concat([r,T(n,t)])},t.prototype.decode=function(t,e){var r=0,n=this.length;if(-1===n){try{var i=M.decode(t,e)}catch(t){f.throwError("insufficient data for dynamic array length",f.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t.value})}try{n=i.value.toNumber()}catch(t){f.throwError("array count too large",f.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:i.value.toString()})}r+=i.consumed,e+=i.consumed}for(var o=[],s=0;s<n;s++)o.push(this.coder);var a=R(o,t,e);return a.consumed+=r,a.value=this.coerceFunc(this.type,a.value),a},t}(b),C=function(a){function t(t,e,r){var n=this,i=!1,o=[];e.forEach(function(t){t.dynamic&&(i=!0),o.push(t.type)});var s="tuple("+o.join(",")+")";return(n=a.call(this,t,"tuple",s,r,i)||this).coders=e,n}return i(t,a),t.prototype.encode=function(t){return T(this.coders,t)},t.prototype.decode=function(t,e){var r=R(this.coders,t,e);return r.value=this.coerceFunc(this.type,r.value),r},t}(b);function B(t){for(var e=[],r="",n=0,i=0;i<t.length;i++){var o=t[i];if(","===o&&0===n)e.push(r),r="";else if(r+=o,"("===o)n++;else if(")"===o&&-1===--n)throw new Error("unbalanced parenthsis")}return e.push(r),e}var L={address:S,bool:A,string:x,bytes:N};function D(t,e){var r,n=L[e.type];if(n)return new n(t,e.name);if(r=e.type.match(d))return(0===(i=parseInt(r[2]||"256"))||256<i||i%8!=0)&&f.throwError("invalid "+r[1]+" bit length",f.INVALID_ARGUMENT,{arg:"param",value:e}),new _(t,i/8,"int"===r[1],e.name);if(r=e.type.match(c))return(0===(i=parseInt(r[1]))||32<i)&&f.throwError("invalid bytes length",f.INVALID_ARGUMENT,{arg:"param",value:e}),new k(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return e.type=r[1],new O(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach(function(t){n.push(D(e,t))}),new C(e,n,r)}(t,e.components,e.name):""===e.type?new w(t,e.name):(f.throwError("invalid type",f.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var U=function(){function e(t){f.checkNew(this,e),t||(t=r.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",t)}return e.prototype.encode=function(t,e){t.length!==e.length&&f.throwError("types/values length mismatch",f.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),u.hexlify(new C(this.coerceFunc,r,"_").encode(e))},e.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new C(this.coerceFunc,r,"_").decode(u.arrayify(e),0).value},e}();r.AbiCoder=U,r.defaultAbiCoder=new U},{"./address":60,"./bignumber":61,"./bytes":62,"./errors":63,"./properties":67,"./utf8":74}],60:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("bn.js"),o=t("./bytes"),s=t("./keccak256"),i=t("./rlp"),a=t("./errors");function u(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)8<=r[i>>1]>>4&&(e[i]=e[i].toUpperCase()),8<=(15&r[i>>1])&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var h={},l=0;l<10;l++)h[String(l)]=String(l);for(l=0;l<26;l++)h[String.fromCharCode(65+l)]=String(10+l);var f,c=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/Math.LN10));function d(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach(function(t){e+=h[t]});e.length>=c;){var r=e.substring(0,c);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function p(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=u(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&a.throwError("bad address checksum",a.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==d(t)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=u("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}r.getAddress=p,r.getIcapAddress=function(t){for(var e=new n(p(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+d("XE00"+e)+e},r.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return p("0x"+s.keccak256(i.encode([p(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},{"./bytes":62,"./errors":63,"./keccak256":66,"./rlp":68,"bn.js":2}],61:[function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(n,"__esModule",{value:!0});var o=r(t("bn.js")),s=t("./bytes"),a=t("./properties"),u=i(t("../utils/errors"));function h(t){return f(t)}var l=function(){function r(t){if(u.checkNew(this,r),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_bn",new o.default.BN(t.substring(2),16))):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_bn",new o.default.BN(t.substring(3),16).mul(n.ConstantNegativeOne._bn)):t.match(/^-?[0-9]*$/)&&(""==t&&(t="0"),a.defineReadOnly(this,"_bn",new o.default.BN(t)));else if("number"==typeof t){Math.trunc(t)!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:Math.trunc(t)});try{a.defineReadOnly(this,"_bn",new o.default.BN(t))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else o.default.BN.isBN(t)?a.defineReadOnly(this,"_bn",t):h(t)?a.defineReadOnly(this,"_bn",t._bn):s.isArrayish(t)?a.defineReadOnly(this,"_bn",new o.default.BN(s.hexlify(t).substring(2),16)):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}return r.prototype.fromTwos=function(t){return new r(this._bn.fromTwos(t))},r.prototype.toTwos=function(t){return new r(this._bn.toTwos(t))},r.prototype.add=function(t){return new r(this._bn.add(c(t)._bn))},r.prototype.sub=function(t){return new r(this._bn.sub(c(t)._bn))},r.prototype.div=function(t){var e=c(t)._bn;return e.isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),new r(this._bn.div(e))},r.prototype.mul=function(t){return new r(this._bn.mul(c(t)._bn))},r.prototype.mod=function(t){return new r(this._bn.mod(c(t)._bn))},r.prototype.pow=function(t){return new r(this._bn.pow(c(t)._bn))},r.prototype.maskn=function(t){return new r(this._bn.maskn(t))},r.prototype.eq=function(t){return this._bn.eq(c(t)._bn)},r.prototype.lt=function(t){return this._bn.lt(c(t)._bn)},r.prototype.lte=function(t){return this._bn.lte(c(t)._bn)},r.prototype.gt=function(t){return this._bn.gt(c(t)._bn)},r.prototype.gte=function(t){return this._bn.gte(c(t)._bn)},r.prototype.isZero=function(){return this._bn.isZero()},r.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},r.prototype.toString=function(){return this._bn.toString(10)},r.prototype.toHexString=function(){var t=this._bn.toString(16);return t.length%2&&(t="0"+t),"0x"+t},r}();function f(t){return t._bn&&t._bn.mod}function c(t){return h(t)?t:new l(t)}n.BigNumber=l,n.isBigNumber=f,n.bigNumberify=c,n.ConstantNegativeOne=c(-1),n.ConstantZero=c(0),n.ConstantOne=c(1),n.ConstantTwo=c(2),n.ConstantWeiPerEther=c(new o.default.BN("1000000000000000000"))},{"../utils/errors":63,"./bytes":62,"./properties":67,"bn.js":2}],62:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=t("./errors");function a(t){return!!t._bn}function u(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(e,t))}),e}function h(t){if(!t||parseInt(t.length)!=t.length||"string"==typeof t)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(r<0||256<=r||parseInt(r)!=r)return!1}return!0}function l(t){if(null==t&&s.throwError("cannot convert null value to array",s.INVALID_ARGUMENT,{arg:"value",value:t}),a(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||s.throwError("invalid hexidecimal string",s.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&s.throwError("hex string must have 0x prefix",s.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],n=0;n<t.length;n+=2)r.push(parseInt(t.substr(n,2),16));return u(new Uint8Array(r))}return h(t)?u(new Uint8Array(t)):(s.throwError("invalid arrayify value",null,{arg:"value",value:t,type:typeof t}),null)}function n(t){for(var e=[],r=0,n=0;n<t.length;n++){var i=l(t[n]);e.push(i),r+=i.length}var o=new Uint8Array(r),s=0;for(n=0;n<e.length;n++)o.set(e[n],s),s+=e[n].length;return u(o)}function i(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}r.isArrayish=h,r.arrayify=l,r.concat=n,r.stripZeros=function(t){var e=l(t);if(0===e.length)return e;for(var r=0;0===e[r];)r++;return r&&(e=e.slice(r)),e},r.padZeros=function(t,e){if(e<(t=l(t)).length)throw new Error("cannot pad");var r=new Uint8Array(e);return r.set(t,e-t.length),u(r)},r.isHexString=i;var f="0123456789abcdef";function o(t){if(a(t))return t.toHexString();if("number"==typeof t){t<0&&s.throwError("cannot hexlify negative value",s.INVALID_ARGUMENT,{arg:"value",value:t});for(var e="";t;)e=f[15&t]+e,t=Math.trunc(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||s.throwError("invalid hexidecimal string",s.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&s.throwError("hex string must have 0x prefix",s.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(h(t)){for(var n=[],i=0;i<t.length;i++){var o=t[i];n.push(f[(240&o)>>4]+f[15&o])}return"0x"+n.join("")}return s.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function c(t,e){for(i(t)||s.throwError("invalid hex string",s.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}r.hexlify=o,r.hexDataLength=function(t){return i(t)&&t.length%2==0?(t.length-2)/2:null},r.hexDataSlice=function(t,e,r){return i(t)||s.throwError("invalid hex data",s.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&s.throwError("hex data length must be even",s.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,e+2*r):"0x"+t.substring(e)},r.hexStripZeros=function(t){for(i(t)||s.throwError("invalid hex string",s.INVALID_ARGUMENT,{arg:"value",value:t});3<t.length&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},r.hexZeroPad=c,r.splitSignature=function(t){var e=l(t);if(65!==e.length)throw new Error("invalid signature");var r=e[64];return 27!==r&&28!==r&&(r=27+r%2),{r:o(e.slice(0,32)),s:o(e.slice(32,64)),recoveryParam:r-27,v:r}},r.joinSignature=function(t){return o(n([c(t.r,32),c(t.s,32),t.recoveryParam?"0x1c":"0x1b"]))}},{"./errors":63}],63:[function(t,e,s){"use strict";function r(t,e,r){e||(e=s.UNKNOWN_ERROR),r||(r={});var n=[];Object.keys(r).forEach(function(e){try{n.push(e+"="+JSON.stringify(r[e]))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}});var i=t;n.length&&(t+=" ("+n.join(", ")+")");var o=new Error(t);throw o.reason=i,o.code=e,Object.keys(r).forEach(function(t){o[t]=r[t]}),o}Object.defineProperty(s,"__esModule",{value:!0}),s.UNKNOWN_ERROR="UNKNOWN_ERROR",s.NOT_IMPLEMENTED="NOT_IMPLEMENTED",s.MISSING_NEW="MISSING_NEW",s.CALL_EXCEPTION="CALL_EXCEPTION",s.INVALID_ARGUMENT="INVALID_ARGUMENT",s.MISSING_ARGUMENT="MISSING_ARGUMENT",s.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",s.NUMERIC_FAULT="NUMERIC_FAULT",s.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",s.throwError=r,s.checkNew=function(t,e){t instanceof e||r("missing new",s.MISSING_NEW,{name:e.name})}},{}],64:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("./bytes"),o=t("./utf8"),s=t("./keccak256"),a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),u=new RegExp("^((.*)\\.)?([^.]+)$"),h=new RegExp("^[a-z0-9.-]*$");r.namehash=function(t){if(!(t=t.toLowerCase()).match(h))throw new Error("contains invalid UseSTD3ASCIIRules characters");for(var e=a;t.length;){var r=t.match(u),n=o.toUtf8Bytes(r[3]);e=s.keccak256(i.concat([e,s.keccak256(n)])),t=r[2]||""}return i.hexlify(e)},r.id=function(t){return s.keccak256(o.toUtf8Bytes(t))},r.hashMessage=function(t){var e=i.concat([o.toUtf8Bytes("Ethereum Signed Message:\n"),o.toUtf8Bytes(String(t.length)),"string"==typeof t?o.toUtf8Bytes(t):t]);return s.keccak256(e)}},{"./bytes":62,"./keccak256":66,"./utf8":74}],65:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./address");r.getAddress=i.getAddress,r.getContractAddress=i.getContractAddress,r.getIcapAddress=i.getIcapAddress;var o=t("./abi-coder");r.AbiCoder=o.AbiCoder,r.defaultAbiCoder=o.defaultAbiCoder,r.parseSignature=o.parseSignature,r.parseParamType=o.parseParamType;var s=n(t("./base64"));r.base64=s;var a=t("./bignumber");r.BigNumber=a.BigNumber,r.bigNumberify=a.bigNumberify;var u=t("./bytes");r.arrayify=u.arrayify,r.concat=u.concat,r.hexlify=u.hexlify,r.joinSignature=u.joinSignature,r.padZeros=u.padZeros,r.splitSignature=u.splitSignature,r.stripZeros=u.stripZeros;var h=t("./hash");r.hashMessage=h.hashMessage,r.id=h.id,r.namehash=h.namehash;var l=t("./keccak256");r.keccak256=l.keccak256;var f=t("./sha2");r.sha256=f.sha256;var c=t("./solidity");r.solidityKeccak256=c.keccak256,r.solidityPack=c.pack,r.soliditySha256=c.sha256;var d=t("./random-bytes");r.randomBytes=d.randomBytes;var p=t("./properties");r.defineFrozen=p.defineFrozen,r.defineReadOnly=p.defineReadOnly,r.resolveProperties=p.resolveProperties,r.shallowCopy=p.shallowCopy;var v=n(t("./rlp"));r.RLP=v;var y=t("./utf8");r.toUtf8Bytes=y.toUtf8Bytes,r.toUtf8String=y.toUtf8String;var m=t("./units");r.formatEther=m.formatEther,r.parseEther=m.parseEther,r.formatUnits=m.formatUnits,r.parseUnits=m.parseUnits;var g=t("./web");r.fetchJson=g.fetchJson;var b=t("./transaction");r.parseTransaction=b.parse;var w=n(t("./errors"));r.errors=w;r.etherSymbol="Ξ"},{"./abi-coder":59,"./address":60,"./base64":41,"./bignumber":61,"./bytes":62,"./errors":63,"./hash":64,"./keccak256":66,"./properties":67,"./random-bytes":45,"./rlp":68,"./sha2":70,"./solidity":71,"./transaction":72,"./units":73,"./utf8":74,"./web":75}],66:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("js-sha3"),i=t("./bytes");r.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},{"./bytes":62,"js-sha3":33}],67:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},r.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},r.resolveProperties=function(r){var n={},i=[];return Object.keys(r).forEach(function(e){var t=r[e];t instanceof Promise?i.push(t.then(function(t){n[e]=t})):n[e]=t}),Promise.all(i).then(function(){return n})},r.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},r.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},{}],68:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o=t("./bytes");function s(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function i(t,e,r){for(var n=0,i=0;i<r;i++)n=256*n+t[e+i];return n}function a(t,e,r,n){for(var i=[];r<e+1+n;){var o=u(t,r);if(i.push(o.result),e+1+n<(r+=o.consumed))throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(248<=t[e]){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=i(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(192<=t[e]){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(184<=t[e]){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=i(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:o.hexlify(t.slice(e+1+r,e+1+r+n))}}if(128<=t[e]){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+n,result:o.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:o.hexlify(t[e])}}r.encode=function(t){return o.hexlify(function e(t){if(Array.isArray(t)){var r=[];return t.forEach(function(t){r=r.concat(e(t))}),r.length<=55?(r.unshift(192+r.length),r):((n=s(r.length)).unshift(247+n.length),n.concat(r))}var n,i=Array.prototype.slice.call(o.arrayify(t));return 1===i.length&&i[0]<=127?i:i.length<=55?(i.unshift(128+i.length),i):((n=s(i.length)).unshift(183+n.length),n.concat(i))}(t))},r.decode=function(t){var e=o.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},{"./bytes":62}],69:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./address"),o=t("./bytes"),s=t("./keccak256"),a=t("./properties"),u=n(t("./errors")),h=new(n(t("elliptic")).ec)("secp256k1");r.N="0x"+h.n.toString(16);var l=function(){function t(t){var e=h.keyFromPrivate(o.arrayify(t));a.defineReadOnly(this,"privateKey",o.hexlify(e.priv.toArray("be",32))),a.defineReadOnly(this,"publicKey","0x"+e.getPublic(!1,"hex")),a.defineReadOnly(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),a.defineReadOnly(this,"publicKeyBytes",e.getPublic().encode(null,!0))}return t.prototype.sign=function(t){var e=h.keyFromPrivate(o.arrayify(this.privateKey)).sign(o.arrayify(t),{canonical:!0});return{recoveryParam:e.recoveryParam,r:o.hexZeroPad("0x"+e.r.toString(16),32),s:o.hexZeroPad("0x"+e.s.toString(16),32),v:27+e.recoveryParam}},t}();function f(t,e){var r={r:o.arrayify(e.r),s:o.arrayify(e.s)};return"0x"+h.recoverPubKey(o.arrayify(t),r,e.recoveryParam).encode("hex",!1)}function c(t,e){var r=o.arrayify(t);if(32===r.length){var n=new l(r);return e?n.compressedPublicKey:n.publicKey}return 33===r.length?e?o.hexlify(r):"0x"+h.keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+h.keyFromPublic(r).getPublic(!0,"hex"):o.hexlify(r):(u.throwError("invalid public or private key",u.INVALID_ARGUMENT,{arg:"key",value:"[REDACTED]"}),null)}function d(t){var e="0x"+c(t).slice(4);return i.getAddress("0x"+s.keccak256(e).substring(26))}r.KeyPair=l,r.recoverPublicKey=f,r.computePublicKey=c,r.recoverAddress=function(t,e){return d(f(t,e))},r.computeAddress=d},{"./address":60,"./bytes":62,"./errors":63,"./keccak256":66,"./properties":67,elliptic:5}],70:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=n(t("hash.js")),o=t("./bytes"),s=i.sha256,a=i.sha512;r.sha256=function(t){return"0x"+s().update(o.arrayify(t)).digest("hex")},r.sha512=function(t){return"0x"+a().update(o.arrayify(t)).digest("hex")}},{"./bytes":62,"hash.js":20}],71:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var u=t("./bignumber"),h=t("./bytes"),l=t("./utf8"),n=t("./keccak256"),i=t("./sha2"),f=new RegExp("^bytes([0-9]+)$"),c=new RegExp("^(u?int)([0-9]*)$"),d=new RegExp("^(.*)\\[([0-9]*)\\]$"),p="0000000000000000000000000000000000000000000000000000000000000000";function o(t,r){if(t.length!=r.length)throw new Error("type/value count mismatch");var n=[];return t.forEach(function(t,e){n.push(function e(t,r,n){switch(t){case"address":return n?h.padZeros(r,32):h.arrayify(r);case"string":return l.toUtf8Bytes(r);case"bytes":return h.arrayify(r);case"bool":return r=r?"0x01":"0x00",n?h.padZeros(r,32):h.arrayify(r)}var i=t.match(c);if(i){if((o=parseInt(i[2]||"256"))%8!=0||0===o||256<o)throw new Error("invalid number type - "+t);return n&&(o=256),r=u.bigNumberify(r).toTwos(o),h.padZeros(r,o/8)}if(i=t.match(f)){var o=parseInt(i[1]);if(String(o)!=i[1]||0===o||32<o)throw new Error("invalid number type - "+t);if(h.arrayify(r).byteLength!==o)throw new Error("invalid value for "+t);return n?h.arrayify((r+p).substring(0,66)):r}if(i=t.match(d)){var s=i[1];if(parseInt(i[2]||r.length)!=r.length)throw new Error("invalid value for "+t);var a=[];return r.forEach(function(t){t=e(s,t,!0),a.push(t)}),h.concat(a)}throw new Error("unknown type - "+t)}(t,r[e]))}),h.hexlify(h.concat(n))}r.pack=o,r.keccak256=function(t,e){return n.keccak256(o(t,e))},r.sha256=function(t,e){return i.sha256(o(t,e))}},{"./bignumber":61,"./bytes":62,"./keccak256":66,"./sha2":70,"./utf8":74}],72:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var f=t("./address"),c=t("./bignumber"),d=t("./bytes"),p=t("./keccak256"),v=t("./secp256k1"),y=n(t("./rlp"));function m(t){return"0x"===t?c.ConstantZero:c.bigNumberify(t)}var o=[{name:"nonce",maxLength:32},{name:"gasPrice",maxLength:32},{name:"gasLimit",maxLength:32},{name:"to",length:20},{name:"value",maxLength:32},{name:"data"}];r.sign=function(n,t){var i=[];o.forEach(function(t){var e,r=n[t.name]||[];if(r=d.arrayify(d.hexlify(r)),t.length&&r.length!==t.length&&0<r.length)throw(e=new Error("invalid "+t.name)).reason="wrong length",e.value=r,e;if(t.maxLength&&(r=d.stripZeros(r)).length>t.maxLength)throw(e=new Error("invalid "+t.name)).reason="too long",e.value=r,e;i.push(d.hexlify(r))}),n.chainId&&(i.push(d.hexlify(n.chainId)),i.push("0x"),i.push("0x"));var e=t(p.keccak256(y.encode(i))),r=27+e.recoveryParam;return n.chainId&&(i.pop(),i.pop(),i.pop(),r+=2*n.chainId+8),i.push(d.hexlify(r)),i.push(d.stripZeros(d.arrayify(e.r))),i.push(d.stripZeros(d.arrayify(e.s))),y.encode(i)},r.parse=function(t){var e=y.decode(t);if(9!==e.length)throw new Error("invalid transaction");var r,n={nonce:m(e[0]).toNumber(),gasPrice:m(e[1]),gasLimit:m(e[2]),to:(r=e[3],"0x"===r?null:f.getAddress(r)),value:m(e[4]),data:e[5],chainId:0},i=d.arrayify(e[6]),o=d.arrayify(e[7]),s=d.arrayify(e[8]);if(1<=i.length&&1<=o.length&&o.length<=32&&1<=s.length&&s.length<=32){n.v=c.bigNumberify(i).toNumber(),n.r=d.hexZeroPad(e[7],32),n.s=d.hexZeroPad(e[8],32);var a=(n.v-35)/2;a<0&&(a=0),a=Math.trunc(a),n.chainId=a;var u=n.v-27,h=e.slice(0,6);a&&(h.push(d.hexlify(a)),h.push("0x"),h.push("0x"),u-=2*a+8);var l=p.keccak256(y.encode(h));try{n.from=v.recoverAddress(l,{r:d.hexlify(o),s:d.hexlify(s),recoveryParam:u})}catch(t){console.log(t)}n.hash=p.keccak256(t)}return n}},{"./address":60,"./bignumber":61,"./bytes":62,"./keccak256":66,"./rlp":68,"./secp256k1":69}],73:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var l=t("./bignumber"),f=n(t("./errors")),s=["wei","kwei","Mwei","Gwei","szabo","finny","ether"],c=function(){var i={};function o(t){return{decimals:t.length-1,tenPower:l.bigNumberify(t)}}var r="1";return s.forEach(function(t){var e=o(r);i[t.toLowerCase()]=e,i[String(e.decimals)]=e,r+="000"}),function(t){var e=i[String(t).toLowerCase()];if(!e&&"number"==typeof t&&Math.trunc(t)==t&&0<=t&&t<=256){for(var r="1",n=0;n<t;n++)r+="0";e=o(r)}return e||f.throwError("invalid unitType",f.INVALID_ARGUMENT,{arg:"name",value:t}),e}}();function i(t,e,r){r||(r={});var n=c(e),i=(t=l.bigNumberify(t)).lt(l.ConstantZero);i&&(t=t.mul(l.ConstantNegativeOne));for(var o=t.mod(n.tenPower).toString();o.length<n.decimals;)o="0"+o;r.pad||(o=o.match(/^([0-9]*[1-9]|0)(0*)/)[1]);var s=t.div(n.tenPower).toString();return r.commify&&(s=s.replace(/\B(?=(\d{3})+(?!\d))/g,",")),t=s+"."+o,i&&(t="-"+t),t}function o(t,e){null==e&&(e=18);var r=c(e);"string"==typeof t&&t.match(/^-?[0-9.,]+$/)||f.throwError("invalid decimal value",f.INVALID_ARGUMENT,{arg:"value",value:t});var n="-"===(t=t.replace(/,/g,"")).substring(0,1);n&&(t=t.substring(1)),"."===t&&f.throwError("missing value",f.INVALID_ARGUMENT,{arg:"value",value:t});var i=t.split(".");2<i.length&&f.throwError("too many decimal points",f.INVALID_ARGUMENT,{arg:"value",value:t});var o=i[0],s=i[1];for(o||(o="0"),s||(s="0"),s.length>r.decimals&&f.throwError("underflow occurred",f.NUMERIC_FAULT,{operation:"division",fault:"underflow"});s.length<r.decimals;)s+="0";var a=l.bigNumberify(o),u=l.bigNumberify(s),h=a.mul(r.tenPower).add(u);return n&&(h=h.mul(l.ConstantNegativeOne)),h}r.formatUnits=i,r.parseUnits=o,r.formatEther=function(t,e){return i(t,18,e)},r.parseEther=function(t){return o(t,18)}},{"./bignumber":61,"./errors":63}],74:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s,n,u=t("./bytes");(n=s=r.UnicodeNormalizationForm||(r.UnicodeNormalizationForm={})).current="",n.NFC="NFC",n.NFD="NFD",n.NFKC="NFKC",n.NFKD="NFKD",r.toUtf8Bytes=function(t,e){void 0===e&&(e=s.current),e!=s.current&&(t=t.normalize(e));for(var r=[],n=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?r[n++]=o:(o<2048?r[n++]=o>>6|192:(55296==(64512&o)&&i+1<t.length&&56320==(64512&t.charCodeAt(i+1))?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128):r[n++]=o>>12|224,r[n++]=o>>6&63|128),r[n++]=63&o|128)}return u.arrayify(r)},r.toUtf8String=function(t){t=u.arrayify(t);for(var e="",r=0;r<t.length;){var n=t[r++];if(n>>7!=0){if(n>>6!=2){var i=null;if(n>>5==6)i=1;else if(n>>4==14)i=2;else if(n>>3==30)i=3;else if(n>>2==62)i=4;else{if(n>>1!=126)continue;i=5}if(r+i>t.length){for(;r<t.length&&t[r]>>6==2;r++);if(r!=t.length)continue;return e}var o,s=n&(1<<8-i-1)-1;for(o=0;o<i;o++){var a=t[r++];if(a>>6!=2)break;s=s<<6|63&a}o==i?s<=65535?e+=String.fromCharCode(s):(s-=65536,e+=String.fromCharCode(55296+(s>>10&1023),56320+(1023&s))):r--}}else e+=String.fromCharCode(n)}return e}},{"./bytes":62}],75:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var h=t("xmlhttprequest"),i=t("./utf8"),o=t("./base64"),l=n(t("./errors"));r.fetchJson=function(s,a,u){var t=[];if("object"==typeof s&&null!=s.url){if(null==s.url&&l.throwError("missing URL",l.MISSING_ARGUMENT,{arg:"url"}),null!=s.user&&null!=s.password){"https:"!==s.url.substring(0,6)&&!0!==s.allowInsecure&&l.throwError("basic authentication requires a secure https url",l.INVALID_ARGUMENT,{arg:"url",url:s.url,user:s.user,password:"[REDACTED]"});var e=s.user+":"+s.password;t.push({key:"Authorization",value:"Basic "+o.encode(i.toUtf8Bytes(e))})}s=s.url}return new Promise(function(n,i){var o=new h.XMLHttpRequest;a?(o.open("POST",s,!0),t.push({key:"Content-Type",value:"application/json"})):o.open("GET",s,!0),t.forEach(function(t){o.setRequestHeader(t.key,t.value)}),o.onreadystatechange=function(){if(4===o.readyState){try{var t=JSON.parse(o.responseText)}catch(r){var e=new Error("invalid json response");return e.orginialError=r,e.responseText=o.responseText,e.url=s,void i(e)}if(u)try{t=u(t)}catch(r){return r.url=s,r.body=a,r.responseText=o.responseText,void i(r)}if(200!=o.status){var r=new Error("invalid response - "+o.status);return r.statusCode=o.statusCode,void i(r)}n(t)}},o.onerror=function(t){i(t)};try{a?o.send(a):o.send()}catch(t){var e=new Error("connection error");e.error=t,i(e)}})}},{"./base64":41,"./errors":63,"./utf8":74,xmlhttprequest:47}],76:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var f=t("../wordlists/lang-en"),c=t("../utils/bytes"),l=t("../utils/bignumber"),i=t("../utils/utf8"),o=t("../utils/pbkdf2"),d=t("../utils/hmac"),s=t("../utils/properties"),p=t("../utils/secp256k1"),v=t("../utils/sha2"),a=n(t("../utils/errors")),u=i.toUtf8Bytes("Bitcoin seed"),y=2147483648;function m(t){return(1<<t)-1<<8-t}r.defaultPath="m/44'/60'/0'/0/0";var h=function(){function h(t,e,r,n,i,o){a.checkNew(this,h),s.defineReadOnly(this,"keyPair",new p.KeyPair(t)),s.defineReadOnly(this,"privateKey",this.keyPair.privateKey),s.defineReadOnly(this,"publicKey",this.keyPair.compressedPublicKey),s.defineReadOnly(this,"chainCode",c.hexlify(e)),s.defineReadOnly(this,"index",r),s.defineReadOnly(this,"depth",n),s.defineReadOnly(this,"mnemonic",i),s.defineReadOnly(this,"path",o)}return h.prototype._derive=function(t){if(!this.privateKey){if(y<=t)throw new Error("cannot derive child of neutered node");throw new Error("not implemented")}var e=new Uint8Array(37),r=this.mnemonic,n=this.path;n&&(n+="/"+t),t&y?(e.set(c.arrayify(this.privateKey),1),n&&(n+="'")):e.set(this.keyPair.publicKeyBytes);for(var i=24;0<=i;i-=8)e[33+(i>>3)]=t>>24-i&255;var o=d.computeHmac("sha512",this.chainCode,e),s=l.bigNumberify(o.slice(0,32)),a=o.slice(32),u=s.add(this.keyPair.privateKey).mod(p.N);return new h(c.arrayify(u),a,t,this.depth+1,r,n)},h.prototype.derivePath=function(t){var e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path");"m"===e[0]&&e.shift();for(var r=this,n=0;n<e.length;n++){var i=e[n];if(i.match(/^[0-9]+'$/)){var o=parseInt(i.substring(0,i.length-1));if(y<=o)throw new Error("invalid path index - "+i);r=r._derive(y+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invlaid path component - "+i);o=parseInt(i);if(y<=o)throw new Error("invalid path index - "+i);r=r._derive(o)}}return r},h}();function g(t,e){var r=c.arrayify(t);if(r.length<16||64<r.length)throw new Error("invalid seed");var n=c.arrayify(d.computeHmac("sha512",u,r));return new h(n.slice(0,32),n.slice(32),0,0,e,"m")}function b(t,e){e||(e="");var r=i.toUtf8Bytes("mnemonic"+e,i.UnicodeNormalizationForm.NFKD);return c.hexlify(o.pbkdf2(i.toUtf8Bytes(t,i.UnicodeNormalizationForm.NFKD),r,2048,64,"sha512"))}function w(t,e){e||(e=f.langEn);var r=e.split(t);if(r.length%3!=0)throw new Error("invalid mnemonic");for(var n=c.arrayify(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o<r.length;o++){var s=e.getWordIndex(r[o].normalize("NFKD"));if(-1===s)throw new Error("invalid mnemonic");for(var a=0;a<11;a++)s&1<<10-a&&(n[i>>3]|=1<<7-i%8),i++}var u=32*r.length/3,h=m(r.length/3),l=c.arrayify(v.sha256(n.slice(0,u/8)))[0];if((l&=h)!==(n[n.length-1]&h))throw new Error("invalid checksum");return c.hexlify(n.slice(0,u/8))}r.HDNode=h,r.fromMnemonic=function(t,e){return w(t,e),g(b(t),t)},r.fromSeed=function(t){return g(t,null)},r.mnemonicToSeed=b,r.mnemonicToEntropy=w,r.entropyToMnemonic=function(t,e){if((t=c.arrayify(t)).length%4!=0||t.length<16||32<t.length)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i<t.length;i++)8<n?(r[r.length-1]<<=8,r[r.length-1]|=t[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[i]>>8-n,r.push(t[i]&(1<<8-n)-1),n+=3);var o=c.arrayify(v.sha256(t))[0],s=t.length/4;return o&=m(s),r[r.length-1]<<=s,r[r.length-1]|=o>>8-s,e||(e=f.langEn),e.join(r.map(function(t){return e.getWord(t)}))},r.isValidMnemonic=function(t,e){try{return w(t,e),!0}catch(t){}return!1}},{"../utils/bignumber":61,"../utils/bytes":62,"../utils/errors":63,"../utils/hmac":43,"../utils/pbkdf2":44,"../utils/properties":67,"../utils/secp256k1":69,"../utils/sha2":70,"../utils/utf8":74,"../wordlists/lang-en":81}],77:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var i=t("./wallet");r.Wallet=i.Wallet;var o=n(t("./hdnode"));r.HDNode=o;var s=t("./signing-key");r.SigningKey=s.SigningKey},{"./hdnode":76,"./signing-key":79,"./wallet":80}],78:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var I=t("aes-js"),m=t("scrypt-js"),T=t("uuid"),g=t("../utils/address"),R=t("../utils/bytes"),b=t("../utils/pbkdf2"),O=t("../utils/keccak256"),p=t("../utils/utf8"),C=t("../utils/random-bytes"),B=t("./signing-key"),L=n(t("./hdnode")),D="m/44'/60'/0'/0/0";function w(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),R.arrayify(t)}function U(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function j(t){return"string"==typeof t?p.toUtf8Bytes(t,p.UnicodeNormalizationForm.NFKC):R.arrayify(t)}function _(t,e){for(var r=t,n=e.toLowerCase().split("/"),i=0;i<n.length;i++){var o=null;for(var s in r)if(s.toLowerCase()===n[i]){o=r[s];break}if(null===o)return null;r=o}return r}r.isCrowdsaleWallet=function(t){try{var e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr},r.isValidWallet=function(t){try{var e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))},r.decryptCrowdsale=function(t,e){var r=JSON.parse(t);e=j(e);var n=g.getAddress(_(r,"ethaddr")),i=w(_(r,"encseed"));if(!i||i.length%16!=0)throw new Error("invalid encseed");var o=b.pbkdf2(e,e,2e3,32,"sha256").slice(0,16),s=i.slice(0,16),a=i.slice(16),u=new I.ModeOfOperation.cbc(o,s),h=R.arrayify(u.decrypt(a));h=I.padding.pkcs7.strip(h);for(var l="",f=0;f<h.length;f++)l+=String.fromCharCode(h[f]);var c=p.toUtf8Bytes(l),d=new B.SigningKey(O.keccak256(c));if(d.address!==n)throw new Error("corrupt crowdsale wallet");return d},r.decrypt=function(t,d,p){var y=JSON.parse(t);d=j(d);var v=function(t,e){var r,n,i=w(_(y,"crypto/ciphertext"));if(R.hexlify((r=t.slice(16,32),n=i,O.keccak256(R.concat([r,n])))).substring(2)!==_(y,"crypto/mac").toLowerCase())return e(new Error("invalid password")),null;var o=function(t,e){if("aes-128-ctr"===_(y,"crypto/cipher")){var r=w(_(y,"crypto/cipherparams/iv")),n=new I.Counter(r),i=new I.ModeOfOperation.ctr(t,n);return R.arrayify(i.decrypt(e))}return null}(t.slice(0,16),i),s=t.slice(32,64);if(!o)return e(new Error("unsupported cipher")),null;var a=new B.SigningKey(o);if(a.address!==g.getAddress(y.address))return e(new Error("address mismatch")),null;if("0.1"===_(y,"x-ethers/version")){var u=w(_(y,"x-ethers/mnemonicCiphertext")),h=w(_(y,"x-ethers/mnemonicCounter")),l=new I.Counter(h),f=new I.ModeOfOperation.ctr(s,l),c=_(y,"x-ethers/path")||D,d=R.arrayify(f.decrypt(u)),p=L.entropyToMnemonic(d),v=L.fromMnemonic(p).derivePath(c);if(v.privateKey!=R.hexlify(o))return e(new Error("mnemonic mismatch")),null;a=new B.SigningKey(v)}return a};return new Promise(function(i,o){var t=_(y,"crypto/kdf");if(t&&"string"==typeof t)if("scrypt"===t.toLowerCase()){var e=w(_(y,"crypto/kdfparams/salt")),r=parseInt(_(y,"crypto/kdfparams/n")),n=parseInt(_(y,"crypto/kdfparams/r")),s=parseInt(_(y,"crypto/kdfparams/p"));if(!r||!n||!s)return void o(new Error("unsupported key-derivation function parameters"));if(0!=(r&r-1))return void o(new Error("unsupported key-derivation function parameter value for N"));if(32!==(h=parseInt(_(y,"crypto/kdfparams/dklen"))))return void o(new Error("unsupported key-derivation derived-key length"));m(d,e,r,n,s,64,function(t,e,r){if(t)t.progress=e,o(t);else if(r){r=R.arrayify(r);var n=v(r,o);if(!n)return;p&&p(1),i(n)}else if(p)return p(e)})}else if("pbkdf2"===t.toLowerCase()){e=w(_(y,"crypto/kdfparams/salt"));var a=null,u=_(y,"crypto/kdfparams/prf");if("hmac-sha256"===u)a="sha256";else{if("hmac-sha512"!==u)return void o(new Error("unsupported prf"));a="sha512"}var h,l=parseInt(_(y,"crypto/kdfparams/c"));if(32!==(h=parseInt(_(y,"crypto/kdfparams/dklen"))))return void o(new Error("unsupported key-derivation derived-key length"));var f=b.pbkdf2(d,e,l,h,a),c=v(f,o);if(!c)return;i(c)}else o(new Error("unsupported key-derivation function"));else o(new Error("unsupported key-derivation function"))})},r.encrypt=function(t,e,r,w){"function"!=typeof r||w||(w=r,r={}),r||(r={});var _=null;if(32!==(_=t instanceof B.SigningKey?R.arrayify(t.privateKey):R.arrayify(t)).length)throw new Error("invalid private key");e=j(e);var M=r.entropy;if(r.mnemonic)if(M){if(L.entropyToMnemonic(M)!==r.mnemonic)throw new Error("entropy and mnemonic mismatch")}else M=L.mnemonicToEntropy(r.mnemonic);M&&(M=R.arrayify(M));var n=r.path;M&&!n&&(n=D);var A=r.client;A||(A="ethers.js");var k=r.salt;k=k?R.arrayify(k):C.randomBytes(32);var S=null;if(r.iv){if(16!==(S=R.arrayify(r.iv)).length)throw new Error("invalid iv")}else S=C.randomBytes(16);var E=r.uuid;if(E){if(16!==(E=R.arrayify(E)).length)throw new Error("invalid uuid")}else E=C.randomBytes(16);var P=1<<17,N=8,x=1;return r.scrypt&&(r.scrypt.N&&(P=r.scrypt.N),r.scrypt.r&&(N=r.scrypt.r),r.scrypt.p&&(x=r.scrypt.p)),new Promise(function(g,b){m(e,k,P,N,x,64,function(t,e,r){if(t)t.progress=e,b(t);else if(r){var n=(r=R.arrayify(r)).slice(0,16),i=r.slice(16,32),o=r.slice(32,64),s=new B.SigningKey(_).address,a=new I.Counter(S),u=new I.ModeOfOperation.ctr(n,a),h=R.arrayify(u.encrypt(_)),l=O.keccak256(R.concat([i,h])),f={address:s.substring(2).toLowerCase(),id:T.v4({random:E}),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:R.hexlify(S).substring(2)},ciphertext:R.hexlify(h).substring(2),kdf:"scrypt",kdfparams:{salt:R.hexlify(k).substring(2),n:P,dklen:32,p:x,r:N},mac:l.substring(2)}};if(M){var c=C.randomBytes(16),d=new I.Counter(c),p=new I.ModeOfOperation.ctr(o,d),v=R.arrayify(p.encrypt(M)),y=new Date,m=y.getUTCFullYear()+"-"+U(y.getUTCMonth()+1,2)+"-"+U(y.getUTCDate(),2)+"T"+U(y.getUTCHours(),2)+"-"+U(y.getUTCMinutes(),2)+"-"+U(y.getUTCSeconds(),2)+".0Z";f["x-ethers"]={client:A,gethFilename:"UTC--"+m+"--"+f.address,mnemonicCounter:R.hexlify(c).substring(2),mnemonicCiphertext:R.hexlify(v).substring(2),version:"0.1"}}w&&w(1),g(JSON.stringify(f))}else if(w)return w(e)})})}},{"../utils/address":60,"../utils/bytes":62,"../utils/keccak256":66,"../utils/pbkdf2":44,"../utils/random-bytes":45,"../utils/utf8":74,"./hdnode":76,"./signing-key":79,"aes-js":1,"scrypt-js":36,uuid:40}],79:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../utils/address"),i=t("../utils/bytes"),o=t("./hdnode"),s=t("../utils/keccak256"),a=t("../utils/properties"),u=t("../utils/secp256k1"),h=t("../utils/errors"),l=function(){function n(t){h.checkNew(this,n);var e=null;t instanceof o.HDNode?(a.defineReadOnly(this,"mnemonic",t.mnemonic),a.defineReadOnly(this,"path",t.path),e=i.arrayify(t.privateKey)):("string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t),e=i.arrayify(t));try{32!==e.length&&h.throwError("exactly 32 bytes required",h.INVALID_ARGUMENT,{value:t})}catch(t){var r={arg:"privateKey",reason:t.reason,value:"[REDACTED]"};t.value&&("number"==typeof t.value.length&&(r.length=t.value.length),r.type=typeof t.value),h.throwError("invalid private key",t.code,r)}a.defineReadOnly(this,"privateKey",i.hexlify(e)),a.defineReadOnly(this,"keyPair",new u.KeyPair(e)),a.defineReadOnly(this,"publicKey",this.keyPair.publicKey),a.defineReadOnly(this,"address",f(this.keyPair.publicKey))}return n.prototype.signDigest=function(t){return this.keyPair.sign(t)},n}();function f(t){var e="0x"+u.computePublicKey(t).slice(4);return n.getAddress("0x"+s.keccak256(e).substring(26))}r.SigningKey=l,r.recoverAddress=function(t,e){return f(u.recoverPublicKey(t,e))},r.computeAddress=f},{"../utils/address":60,"../utils/bytes":62,"../utils/errors":63,"../utils/keccak256":66,"../utils/properties":67,"../utils/secp256k1":69,"./hdnode":76}],80:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var a=t("./hdnode"),u=o(t("./secret-storage")),h=t("./signing-key"),l=t("../utils/bytes"),f=t("../utils/hash"),c=t("../utils/keccak256"),d=t("../utils/properties"),p=t("../utils/random-bytes"),v=t("../utils/transaction"),y=o(t("../utils/errors")),s=function(){},m=function(n){function s(t,e){var r=n.call(this)||this;return y.checkNew(r,s),t instanceof h.SigningKey?d.defineReadOnly(r,"signingKey",t):d.defineReadOnly(r,"signingKey",new h.SigningKey(t)),d.defineReadOnly(r,"provider",e),r}return i(s,n),Object.defineProperty(s.prototype,"address",{get:function(){return this.signingKey.address},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"mnemonic",{get:function(){return this.signingKey.mnemonic},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"path",{get:function(){return this.signingKey.mnemonic},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"privateKey",{get:function(){return this.signingKey.privateKey},enumerable:!0,configurable:!0}),s.prototype.connect=function(t){return new s(this.signingKey,t)},s.prototype.getAddress=function(){return Promise.resolve(this.address)},s.prototype.sign=function(t){var e=this;return d.resolveProperties(t).then(function(t){return v.sign(t,e.signingKey.signDigest.bind(e.signingKey))})},s.prototype.signMessage=function(t){return Promise.resolve(l.joinSignature(this.signingKey.signDigest(f.hashMessage(t))))},s.prototype.getBalance=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getBalance(this.address,t)},s.prototype.getTransactionCount=function(t){if(!this.provider)throw new Error("missing provider");return this.provider.getTransactionCount(this.address,t)},s.prototype.sendTransaction=function(t){if(!this.provider)throw new Error("missing provider");if(!t||"object"!=typeof t)throw new Error("invalid transaction object");var e=d.shallowCopy(t);return null!=e.to&&(e.to=this.provider.resolveName(e.to)),null==e.gasLimit&&(e.gasLimit=this.provider.estimateGas(e)),null==e.gasPrice&&(e.gasPrice=this.provider.getGasPrice()),null==e.nonce&&(e.nonce=this.getTransactionCount()),null==e.chainId&&(e.chainId=this.provider.getNetwork().then(function(t){return t.chainId})),this.provider.sendTransaction(this.sign(e))},s.prototype.encrypt=function(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");if(e||(e={}),this.mnemonic){var n={};for(var i in e)n[i]=e[i];(e=n).mnemonic=this.mnemonic,e.path=this.path}return u.encrypt(this.privateKey,t,e,r)},s.createRandom=function(t){var e=p.randomBytes(16);t||(t={}),t.extraEntropy&&(e=l.arrayify(c.keccak256(l.concat([e,t.extraEntropy])).substring(0,34)));var r=a.entropyToMnemonic(e,t.locale);return s.fromMnemonic(r,t.path,t.locale)},s.fromEncryptedJson=function(n,i,o){if(o&&"function"!=typeof o)throw new Error("invalid callback");return new Promise(function(r,e){if(u.isCrowdsaleWallet(n))try{var t=u.decryptCrowdsale(n,i);r(new s(t))}catch(t){e(t)}else u.isValidWallet(n)?u.decrypt(n,i,o).then(function(t){var e=new s(t);r(e)},function(t){e(t)}):e("invalid wallet JSON")})},s.fromMnemonic=function(t,e,r){return e||(e=a.defaultPath),new s(a.fromMnemonic(t,r).derivePath(e))},s.isEncryptedWallet=function(t){return u.isValidWallet(t)||u.isCrowdsaleWallet(t)},s.verifyMessage=function(t,e){if(132!=(e=l.hexlify(e)).length)throw new Error("invalid signature");var r=f.hashMessage(t),n=parseInt(e.substring(130),16);if(27<=n&&(n-=27),n<0)throw new Error("invalid signature");return h.recoverAddress(r,{r:e.substring(0,66),s:"0x"+e.substring(66,130),recoveryParam:n})},s}(r.Signer=s);r.Wallet=m},{"../utils/bytes":62,"../utils/errors":63,"../utils/hash":64,"../utils/keccak256":66,"../utils/properties":67,"../utils/random-bytes":45,"../utils/transaction":72,"./hdnode":76,"./secret-storage":78,"./signing-key":79}],81:[function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0});var s=t("./wordlist"),a=o(t("../utils/errors")),u="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",h=null;function l(){null==h&&(h=u.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "))}var f=new(function(t){function e(){return t.call(this,"en")||this}return i(e,t),e.prototype.getWord=function(t){return l(),(t<0||t>=h.length||Math.trunc(t)!=t)&&a.throwError("invalid wordlist index",a.INVALID_ARGUMENT,{arg:"index",value:t}),h[t]},e.prototype.getWordIndex=function(t){return l(),h.indexOf(t)},e}(s.Wordlist));r.langEn=f,s.register(f)},{"../utils/errors":63,"./wordlist":82}],82:[function(i,t,o){(function(e){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var r=!1,n=i("../utils/properties"),t=function(){function t(t){n.defineReadOnly(this,"locale",t)}return t.prototype.split=function(t){return t.toLowerCase().split(/ +/g)},t.prototype.join=function(t){return t.join(" ")},t}();o.Wordlist=t,o.register=function(t){r&&(e.wordlists||n.defineReadOnly(e,"wordlists",{}),n.defineReadOnly(e.wordlists,t.locale,t))},r=!0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/properties":67}],83:[function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(r,"__esModule",{value:!0}),t("./utils/shims");var i=t("./contracts");r.Contract=i.Contract,r.Interface=i.Interface;var o=n(t("./providers"));r.providers=o;var s=n(t("./utils/errors"));r.errors=s;var a=t("./providers/networks");r.getNetwork=a.getNetwork;var u=n(t("./utils"));r.utils=u;var h=t("./wallet");r.HDNode=h.HDNode,r.SigningKey=h.SigningKey,r.Wallet=h.Wallet,console.log("@TODO: Get version");r.version="4.0.0"},{"./contracts":49,"./providers":53,"./providers/networks":56,"./utils":65,"./utils/errors":63,"./utils/shims":46,"./wallet":77}]},{},[83])(83)});
//# sourceMappingURL=ethers.min.js.map