-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
2 lines (2 loc) · 364 KB
/
main.js
1
2
/*! For license information please see main.js.LICENSE.txt */
(()=>{var e,t,r,n,i={8826:function(e){!function(t){"use strict";function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t<e.length;t++)if(!r(e[t])||e[t]<0||e[t]>255)return!1;return!0}function i(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function a(e){return new Uint8Array(e)}function s(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var o,u={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r<e.length;){var n=e.charCodeAt(r++);37===n?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(n)}return i(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},c=(o="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(o[(240&n)>>4]+o[15&n])}return t.join("")}}),l={16:10,24:12,32:14},f=[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],p=[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],d=[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],y=[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],g=[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],v=[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],C=[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],E=[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],S=[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],b=[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],T=[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],I=[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 B(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var w=function(e){if(!(this instanceof w))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};w.prototype._prepare=function(){var e=l[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),i=this.key.length/4,a=B(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=a[t],this._Kd[e-r][t%4]=a[t];for(var s,o=0,u=i;u<n;){if(s=a[i-1],a[0]^=p[s>>16&255]<<24^p[s>>8&255]<<16^p[255&s]<<8^p[s>>24&255]^f[o]<<24,o+=1,8!=i)for(t=1;t<i;t++)a[t]^=a[t-1];else{for(t=1;t<i/2;t++)a[t]^=a[t-1];for(s=a[i/2-1],a[i/2]^=p[255&s]^p[s>>8&255]<<8^p[s>>16&255]<<16^p[s>>24&255]<<24,t=i/2+1;t<i;t++)a[t]^=a[t-1]}for(t=0;t<i&&u<n;)c=u>>2,h=u%4,this._Ke[c][h]=a[t],this._Kd[e-c][h]=a[t++],u++}for(var c=1;c<e;c++)for(var h=0;h<4;h++)s=this._Kd[c][h],this._Kd[c][h]=b[s>>24&255]^T[s>>16&255]^A[s>>8&255]^I[255&s]},w.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=B(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s<t;s++){for(i=0;i<4;i++)r[i]=d[n[i]>>24&255]^y[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^v[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}var o,u=a(16);for(i=0;i<4;i++)o=this._Ke[t][i],u[4*i]=255&(p[n[i]>>24&255]^o>>24),u[4*i+1]=255&(p[n[(i+1)%4]>>16&255]^o>>16),u[4*i+2]=255&(p[n[(i+2)%4]>>8&255]^o>>8),u[4*i+3]=255&(p[255&n[(i+3)%4]]^o);return u},w.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=B(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s<t;s++){for(i=0;i<4;i++)r[i]=m[n[i]>>24&255]^C[n[(i+3)%4]>>16&255]^E[n[(i+2)%4]>>8&255]^S[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}var o,u=a(16);for(i=0;i<4;i++)o=this._Kd[t][i],u[4*i]=255&(h[n[i]>>24&255]^o>>24),u[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^o>>16),u[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^o>>8),u[4*i+3]=255&(h[255&n[(i+1)%4]]^o);return u};var k=function(e){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new w(e)};k.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16)s(e,r,0,n,n+16),s(r=this._aes.encrypt(r),t,n);return t},k.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16)s(e,r,0,n,n+16),s(r=this._aes.decrypt(r),t,n);return t};var N=function(e,t){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=a(16);this._lastCipherblock=i(t,!0),this._aes=new w(e)};N.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16){s(e,r,0,n,n+16);for(var o=0;o<16;o++)r[o]^=this._lastCipherblock[o];this._lastCipherblock=this._aes.encrypt(r),s(this._lastCipherblock,t,n)}return t},N.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16){s(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var o=0;o<16;o++)t[n+o]=r[o]^this._lastCipherblock[o];s(e,this._lastCipherblock,0,n,n+16)}return t};var R=function(e,t,r){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=a(16);r||(r=1),this.segmentSize=r,this._shiftRegister=i(t,!0),this._aes=new w(e)};R.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[n+a]^=t[a];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},R.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[n+a]^=t[a];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var _=function(e,t){if(!(this instanceof _))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=a(16);this._lastPrecipher=i(t,!0),this._lastPrecipherIndex=16,this._aes=new w(e)};_.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},_.prototype.decrypt=_.prototype.encrypt;var L=function(e){if(!(this instanceof L))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=a(16),this.setValue(e)):this.setBytes(e)};L.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},L.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},L.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var U=function(e,t){if(!(this instanceof U))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof L||(t=new L(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new w(e)};U.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},U.prototype.decrypt=U.prototype.encrypt;var D={AES:w,Counter:L,ModeOfOperation:{ecb:k,cbc:N,cfb:R,ofb:_,ctr:U},utils:{hex:c,utf8:u},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=a(e.length+t);s(e,r);for(var n=e.length;n<r.length;n++)r[n]=t;return r},strip:function(e){if((e=i(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n<t;n++)if(e[r+n]!==t)throw new Error("PKCS#7 invalid padding byte");var o=a(r);return s(e,o,0,0,r),o}}},_arrayTest:{coerceArray:i,createArray:a,copyArray:s}};e.exports=D}()},4276:(e,t,r)=>{"use strict";r.r(t),r.d(t,{version:()=>n,VERSION:()=>i,atob:()=>_,atobPolyfill:()=>R,btoa:()=>m,btoaPolyfill:()=>v,fromBase64:()=>O,toBase64:()=>I,utob:()=>T,encode:()=>I,encodeURI:()=>B,encodeURL:()=>B,btou:()=>N,decode:()=>O,isValid:()=>V,fromUint8Array:()=>E,toUint8Array:()=>U,extendString:()=>K,extendUint8Array:()=>M,extendBuiltins:()=>F,Base64:()=>j});const n="3.6.0",i=n,a="function"==typeof atob,s="function"==typeof btoa,o="function"==typeof Buffer,u="function"==typeof TextDecoder?new TextDecoder:void 0,c="function"==typeof TextEncoder?new TextEncoder:void 0,l=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],f=(e=>{let t={};return e.forEach(((e,r)=>t[e]=r)),t})(l),p=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,h=String.fromCharCode.bind(String),d="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),y=e=>e.replace(/[+\/]/g,(e=>"+"==e?"-":"_")).replace(/=+$/m,""),g=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),v=e=>{let t,r,n,i,a="";const s=e.length%3;for(let s=0;s<e.length;){if((r=e.charCodeAt(s++))>255||(n=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,a+=l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}return s?a.slice(0,s-3)+"===".substring(s):a},m=s?e=>btoa(e):o?e=>Buffer.from(e,"binary").toString("base64"):v,C=o?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(h.apply(null,e.subarray(r,r+4096)));return m(t.join(""))},E=(e,t=!1)=>t?y(C(e)):C(e),S=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?h(192|t>>>6)+h(128|63&t):h(224|t>>>12&15)+h(128|t>>>6&63)+h(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return h(240|t>>>18&7)+h(128|t>>>12&63)+h(128|t>>>6&63)+h(128|63&t)},b=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,T=e=>e.replace(b,S),A=o?e=>Buffer.from(e,"utf8").toString("base64"):c?e=>C(c.encode(e)):e=>m(T(e)),I=(e,t=!1)=>t?y(A(e)):A(e),B=e=>I(e,!0),w=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,k=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return h(55296+(t>>>10))+h(56320+(1023&t));case 3:return h((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return h((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},N=e=>e.replace(w,k),R=e=>{if(e=e.replace(/\s+/g,""),!p.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let a=0;a<e.length;)t=f[e.charAt(a++)]<<18|f[e.charAt(a++)]<<12|(r=f[e.charAt(a++)])<<6|(n=f[e.charAt(a++)]),i+=64===r?h(t>>16&255):64===n?h(t>>16&255,t>>8&255):h(t>>16&255,t>>8&255,255&t);return i},_=a?e=>atob(g(e)):o?e=>Buffer.from(e,"base64").toString("binary"):R,L=o?e=>d(Buffer.from(e,"base64")):e=>d(_(e),(e=>e.charCodeAt(0))),U=e=>L(P(e)),D=o?e=>Buffer.from(e,"base64").toString("utf8"):u?e=>u.decode(L(e)):e=>N(_(e)),P=e=>g(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),O=e=>D(P(e)),V=e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/=+$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},x=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),K=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,x(t));e("fromBase64",(function(){return O(this)})),e("toBase64",(function(e){return I(this,e)})),e("toBase64URI",(function(){return I(this,!0)})),e("toBase64URL",(function(){return I(this,!0)})),e("toUint8Array",(function(){return U(this)}))},M=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,x(t));e("toBase64",(function(e){return E(this,e)})),e("toBase64URI",(function(){return E(this,!0)})),e("toBase64URL",(function(){return E(this,!0)}))},F=()=>{K(),M()},j={version:n,VERSION:i,atob:_,atobPolyfill:R,btoa:m,btoaPolyfill:v,fromBase64:O,toBase64:I,encode:I,encodeURI:B,encodeURL:B,utob:T,btou:N,decode:O,isValid:V,fromUint8Array:E,toUint8Array:U,extendString:K,extendUint8Array:M,extendBuiltins:F}},4473:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HashAll:()=>u,HashDataKey:()=>c,HashRegistryEntry:()=>l,encodeString:()=>p,stringToUint8Array:()=>h,hexToUint8Array:()=>d,keyPairFromSeed:()=>y,generateSeed:()=>g,recoverPassword:()=>v});var n=r(1395),i=r(8834),a=r(6432),s=r(2365),o=r(8826);function u(...e){const t=n.blake2bInit(32,null);for(let r=0;r<e.length;r++)n.blake2bUpdate(t,e[r]);return n.blake2bFinal(t)}function c(e){return u(p(e))}function l(e){return u(c(e.datakey),p(e.data),f(e.revision))}function f(e){const t=new Uint8Array(8);for(let r=0;r<t.length;r++){const n=255&e;t[r]=n,e>>=8}return t}function p(e){const t=new Uint8Array(8+e.length);return t.set(f(e.length)),t.set(h(e),8),t}function h(e){return Uint8Array.from(i.Buffer.from(e))}function d(e){return new Uint8Array(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))}function y(e){return e=a.pkcs5.pbkdf2(e,"",1e3,32,a.md.sha256.create()),a.pki.ed25519.generateKeyPair({seed:e})}async function g(e,t,r){const n=c(r),i=new Uint8Array(16);i.set(h(r).slice(0,16));const a=new Uint8Array(32);a.set(o.utils.utf8.toBytes(e)),a.set(o.utils.utf8.toBytes(t),32-t.length);const u=function(e){const t=new Array(24);let r,n,i=8,a=8,s=11,o=0,u=0,c=7,l=0,f=0;for(;f<32;)r=(1<<c+1)-(1<<u),n=e[f]&r,t[l]|=o>=u?n<<o-u:n>>u-o,a-=i,0==a&&(a=8,f++),s-=i,0==s&&(s=11,l++),o=(o+i)%11,i=Math.min(s,a),u=(c+1)%8,c=u+i-1;return t}(new o.ModeOfOperation.cbc(n,i).encrypt(a));return await s.getWords(u)}async function v(e,t){const r=c(t),n=new Uint8Array(16);n.set(h(t).slice(0,16));const i=function(e){const t=new Uint8Array(32);let r,n,i=8,a=8,s=11,o=0,u=7,c=0,l=0;for(;l<32;)r=(1<<u+1)-(1<<o),n=(e[c]&r)>>o,t[l]|=n<<8-a,a-=i,0==a&&(a=8,l++),s-=i,0==s&&(s=11,c++),i=Math.min(s,a),o=(u+1)%11,u=o+i-1;return t}(await s.getNumbers(e)),a=new o.ModeOfOperation.cbc(r,n).decrypt(i),u=o.utils.utf8.fromBytes(a);return{login:u.slice(0,u.indexOf(String.fromCharCode(0))),password:u.slice(u.lastIndexOf(String.fromCharCode(0))+1)}}r(4276)},6247:(e,t,r)=>{"use strict";r.r(t),r.d(t,{appendKey:()=>u,appendRegistryKey:()=>c,keyExists:()=>l,createAppId:()=>f});var n=r(2412),i=r(4473),a=r(8826),s=r(4276),o=r(8834);async function u(e,t,r){const o=await n.downloadText(t);if(!o)throw new Error("Could not locate database");const u=new Uint8Array(32);u.set(i.stringToUint8Array("{"+e+"}").slice(0,32));const c=s.Base64.toUint8Array(o.text.slice(o.text.indexOf("{")+1,o.text.indexOf("}"))),l=i.HashAll(i.encodeString(r),i.encodeString(e)),f=new a.ModeOfOperation.ecb(l).encrypt(u),p=new Uint8Array(c.length+f.length);p.set(c),p.set(f,c.length);const h="{"+s.Base64.fromUint8Array(p)+"}";return await n.uploadText(h,o.name)}async function c(e,t){const r=o.Buffer.from(i.HashDataKey(t)).toString("hex"),{publicKey:a,privateKey:s}=i.keyPairFromSeed(r),c=await n.getEntry(a,t);if(c){const r=c.entry.data,i=await u(e,r,t);return""!=i&&(await n.setEntry(s,t,{datakey:t,data:i,revision:0}),!0)}{const r=await n.uploadText("{}","db.txt"),i=await u(e,r,t);return""!=i&&(await n.setEntry(s,t,{datakey:t,data:i,revision:0}),!0)}}async function l(e,t){const r=o.Buffer.from(i.HashDataKey(t)).toString("hex"),{publicKey:u,privateKey:c}=i.keyPairFromSeed(r),l=await n.getEntry(u,t);if(l){const r=await n.downloadText(l.entry.data);if(!r)throw new Error("Could not locate database");let o=r.text.slice(r.text.indexOf("{")+1,r.text.indexOf("}"));const u=i.HashAll(i.encodeString(t),i.encodeString(e)),c=new a.ModeOfOperation.ecb(u);if(o.length>0&&a.utils.utf8.fromBytes(c.decrypt(s.Base64.toUint8Array(o))).indexOf(e)>=0)return!0}return!1}function f(e){if(e.length>=32)return e;const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split("");let r=e+"-";for(let e=r.length;e<32;e++)r+=t[Math.floor(Math.random()*t.length)];return r}},2412:(e,t,r)=>{"use strict";r.r(t),r.d(t,{setDefaultPortal:()=>u,setDefaultTimeout:()=>c,uploadText:()=>f,downloadText:()=>p,getEntry:()=>h,setEntry:()=>d});var n=r(4473),i=r(8834),a=r(6432),s="https://siasky.net",o=5e3;function u(e){s=e}function c(e){o=e}function l(e,t,r,n={}){return new Promise((function(i,a){let u=new XMLHttpRequest;u.open(e,s+"/"+t),n&&n.timeout?u.timeout=n.timeout:u.timeout=o,n&&n.onUploadProgress&&(u.upload.onprogress=n.onUploadProgress),u.onload=function(){this.status>=200&&this.status<300?i(this):a(this)},u.ontimeout=function(){i(this)},u.send(r)}))}async function f(e,t,r){let n=new File([e],{type:"text/plain"}),i=new FormData;i.append("file",n,t);let a=await l("POST","skynet/skyfile",i,r);return 200==a.status?JSON.parse(a.responseText).skylink:""}async function p(e,t){let r=await l("GET",e,null,t);return 200==r.status?{name:JSON.parse(r.getResponseHeader("skynet-file-metadata")).filename,text:r.responseText}:null}async function h(e,t){let r=await l("GET","skynet/registry?publickey=ed25519:"+i.Buffer.from(e).toString("hex")+"&datakey="+i.Buffer.from(n.HashDataKey(t)).toString("hex"),null);if(200==r.status){const s=JSON.parse(r.responseText),o={entry:{datakey:t,data:i.Buffer.from(n.hexToUint8Array(s.data)).toString(),revision:parseInt(s.revision,10)},signature:i.Buffer.from(n.hexToUint8Array(s.signature))};if(o&&!a.pki.ed25519.verify({message:n.HashRegistryEntry(o.entry),signature:o.signature,publicKey:e}))throw new Error("Could not verify signature from retrieved, signed registry entry -- possibly corrupted entry");return o}return null}async function d(e,t,r){const s=a.pki.ed25519.publicKeyFromPrivateKey({privateKey:e});let o;o=await h(s,t),r.revision=0,o&&(r.revision=o.entry.revision+1);const u=a.pki.ed25519.sign({message:n.HashRegistryEntry(r),privateKey:e}),c={publickey:{algorithm:"ed25519",key:Array.from(s)},datakey:i.Buffer.from(n.HashDataKey(t)).toString("hex"),revision:r.revision,data:Array.from(i.Buffer.from(r.data)),signature:Array.from(u)};let f=await l("POST","skynet/registry",JSON.stringify(c));if(204==f.status)return null;throw new Error("Could not post registry entry: "+f.responseText)}},2365:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getWords:()=>a,getNumbers:()=>s});var n=r(2412);const i="GAAkCKHUdy8SVidL3RF9TsyfdfFp3ouvZrg04k55oPnrfQ";async function a(e){let t=await n.downloadText(i);if(t){let r=t.text.split("\n");return e.map((e=>r[e])).join(" ")}return null}async function s(e){let t=await n.downloadText(i);if(t){let r,n=t.text.split("\n"),i=e.split(" "),a=new Array(i.length),s=!0;return i.forEach(((e,t)=>{r=n.indexOf(i[t]),r<0&&(s=!1),a[t]=r})),s?a:null}return null}},5766:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),s=a[0],o=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,o)),l=0,f=o>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],s=16383,o=0,u=n-i;o<u;o+=s)a.push(c(e,o,o+s>u?u:o+s));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=a.length;s<o;++s)r[s]=a[s],n[a.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,s=[],o=t;o<n;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},651:(e,t,r)=>{var n=r(7967);function i(e,t,r){var n=e[t]+e[r],i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function a(e,t,r,n){var i=e[t]+r;r<0&&(i+=4294967296);var a=e[t+1]+n;i>=4294967296&&a++,e[t]=i,e[t+1]=a}function s(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,r,n,s,o){var u=f[s],c=f[s+1],p=f[o],h=f[o+1];i(l,e,t),a(l,e,u,c);var d=l[n]^l[e],y=l[n+1]^l[e+1];l[n]=y,l[n+1]=d,i(l,r,n),d=l[t]^l[r],y=l[t+1]^l[r+1],l[t]=d>>>24^y<<8,l[t+1]=y>>>24^d<<8,i(l,e,t),a(l,e,p,h),d=l[n]^l[e],y=l[n+1]^l[e+1],l[n]=d>>>16^y<<16,l[n+1]=y>>>16^d<<16,i(l,r,n),d=l[t]^l[r],y=l[t+1]^l[r+1],l[t]=y>>>31^d<<1,l[t+1]=d>>>31^y<<1}var u=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),l=new Uint32Array(32),f=new Uint32Array(32);function p(e,t){var r=0;for(r=0;r<16;r++)l[r]=e.h[r],l[r+16]=u[r];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),r=0;r<32;r++)f[r]=s(e.b,4*r);for(r=0;r<12;r++)o(0,8,16,24,c[16*r+0],c[16*r+1]),o(2,10,18,26,c[16*r+2],c[16*r+3]),o(4,12,20,28,c[16*r+4],c[16*r+5]),o(6,14,22,30,c[16*r+6],c[16*r+7]),o(0,10,20,30,c[16*r+8],c[16*r+9]),o(2,12,22,24,c[16*r+10],c[16*r+11]),o(4,14,16,26,c[16*r+12],c[16*r+13]),o(6,8,18,28,c[16*r+14],c[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^l[r]^l[r+16]}function h(e,t){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var r={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e},n=0;n<16;n++)r.h[n]=u[n];var i=t?t.length:0;return r.h[0]^=16842752^i<<8^e,t&&(d(r,t),r.c=128),r}function d(e,t){for(var r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,p(e,!1),e.c=0),e.b[e.c++]=t[r]}function y(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;p(e,!0);for(var t=new Uint8Array(e.outlen),r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function g(e,t,r){r=r||64,e=n.normalizeInput(e);var i=h(r,t);return d(i,e),y(i)}e.exports={blake2b:g,blake2bHex:function(e,t,r){var i=g(e,t,r);return n.toHex(i)},blake2bInit:h,blake2bUpdate:d,blake2bFinal:y}},9962:(e,t,r)=>{var n=r(7967);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,i,a){c[e]=c[e]+c[t]+i,c[n]=s(c[n]^c[e],16),c[r]=c[r]+c[n],c[t]=s(c[t]^c[r],12),c[e]=c[e]+c[t]+a,c[n]=s(c[n]^c[e],8),c[r]=c[r]+c[n],c[t]=s(c[t]^c[r],7)}function s(e,t){return e>>>t^e<<32-t}var o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),c=new Uint32Array(16),l=new Uint32Array(16);function f(e,t){var r=0;for(r=0;r<8;r++)c[r]=e.h[r],c[r+8]=o[r];for(c[12]^=e.t,c[13]^=e.t/4294967296,t&&(c[14]=~c[14]),r=0;r<16;r++)l[r]=i(e.b,4*r);for(r=0;r<10;r++)a(0,4,8,12,l[u[16*r+0]],l[u[16*r+1]]),a(1,5,9,13,l[u[16*r+2]],l[u[16*r+3]]),a(2,6,10,14,l[u[16*r+4]],l[u[16*r+5]]),a(3,7,11,15,l[u[16*r+6]],l[u[16*r+7]]),a(0,5,10,15,l[u[16*r+8]],l[u[16*r+9]]),a(1,6,11,12,l[u[16*r+10]],l[u[16*r+11]]),a(2,7,8,13,l[u[16*r+12]],l[u[16*r+13]]),a(3,4,9,14,l[u[16*r+14]],l[u[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=c[r]^c[r+8]}function p(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");var r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");var n={h:new Uint32Array(o),b:new Uint32Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(h(n,t),n.c=64),n}function h(e,t){for(var r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,f(e,!1),e.c=0),e.b[e.c++]=t[r]}function d(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;f(e,!0);for(var t=new Uint8Array(e.outlen),r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function y(e,t,r){r=r||32,e=n.normalizeInput(e);var i=p(r,t);return h(i,e),d(i)}e.exports={blake2s:y,blake2sHex:function(e,t,r){var i=y(e,t,r);return n.toHex(i)},blake2sInit:p,blake2sUpdate:h,blake2sFinal:d}},1395:(e,t,r)=>{var n=r(651),i=r(9962);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},7967:e=>{function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){var t;if(e instanceof Uint8Array)t=e;else if(e instanceof Buffer)t=new Uint8Array(e);else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=new Uint8Array(Buffer.from(e,"utf8"))}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,r,n){for(var i="\n"+e+" = ",a=0;a<r.length;a+=2){if(32===n)i+=t(r[a]).toUpperCase(),i+=" ",i+=t(r[a+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=t(r[a+1]).toUpperCase(),i+=t(r[a]).toUpperCase()}a%6==4?i+="\n"+new Array(e.length+4).join(" "):a<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){for(var n=(new Date).getTime(),i=new Uint8Array(t),a=0;a<t;a++)i[a]=a%256;var s=(new Date).getTime();for(console.log("Generated random input in "+(s-n)+"ms"),n=s,a=0;a<r;a++){var o=e(i),u=(new Date).getTime(),c=u-n;n=u,console.log("Hashed in "+c+"ms: "+o.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(c/1e3)*100)/100+" MB PER SECOND")}}}},8834:(e,t,r)=>{"use strict";var n=r(5766),i=r(2333),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;var s=2147483647;function o(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|y(e,t),n=o(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return p(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);var i=function(e){if(u.isBuffer(e)){var t=0|d(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||H(e.length)?o(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),o(e<0?0:0|d(e))}function p(e){for(var t=e.length<0?0:0|d(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function d(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return M(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return _(this,t,r);case"utf8":case"utf-8":return w(this,t,r);case"ascii":return N(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return B(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:C(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):C(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function C(e,t,r,n,i){var a,s=1,o=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(a=r;a<o;a++)if(c(e,a)===c(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*s}else-1!==l&&(a-=a-l),l=-1}else for(r+u>o&&(r=o-u),a=r;a>=0;a--){for(var f=!0,p=0;p<u;p++)if(c(e,a+p)!==c(t,p)){f=!1;break}if(f)return a}return-1}function E(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var s=0;s<n;++s){var o=parseInt(t.substr(2*s,2),16);if(H(o))return s;e[r+s]=o}return s}function S(e,t,r,n){return F(K(t,e.length-r),e,r,n)}function b(e,t,r,n){return F(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function T(e,t,r,n){return b(e,t,r,n)}function A(e,t,r,n){return F(M(t),e,r,n)}function I(e,t,r,n){return F(function(e,t){for(var r,n,i,a=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function B(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function w(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,s,o,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[i+1],s=e[i+2],128==(192&a)&&128==(192&s)&&(u=(15&c)<<12|(63&a)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(u=(15&c)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(e){var t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(j(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),j(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(j(a,Uint8Array)&&(a=u.from(a)),!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?w(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(j(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),o=Math.min(a,s),c=this.slice(n,i),l=e.slice(t,r),f=0;f<o;++f)if(c[f]!==l[f]){a=c[f],s=l[f];break}return a<s?-1:s<a?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return E(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return T(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var k=4096;function N(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function _(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=q[e[a]];return i}function L(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function P(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,n,a){return t=+t,r>>>=0,a||P(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function V(e,t,r,n,a){return t=+t,r>>>=0,a||P(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<r&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);D(this,e,t,r,i-1,-i)}var a=r-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return V(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return V(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var a=i-1;a>=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var s=u.isBuffer(e)?e:u.from(e,n),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=s[a%o]}return this};var x=/[^+/0-9A-Za-z-_]/g;function K(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function M(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}var q=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},2333:(e,t)=>{t.read=function(e,t,r,n,i){var a,s,o=8*i-n-1,u=(1<<o)-1,c=u>>1,l=-7,f=r?i-1:0,p=r?-1:1,h=e[t+f];for(f+=p,a=h&(1<<-l)-1,h>>=-l,l+=o;l>0;a=256*a+e[t+f],f+=p,l-=8);for(s=a&(1<<-l)-1,a>>=-l,l+=n;l>0;s=256*s+e[t+f],f+=p,l-=8);if(0===a)a=1-c;else{if(a===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),a-=c}return(h?-1:1)*s*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var s,o,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(o=0,s=l):s+f>=1?(o=(t*u-1)*Math.pow(2,i),s+=f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&o,h+=d,o/=256,i-=8);for(s=s<<i|o,c+=i;c>0;e[r+h]=255&s,h+=d,s/=256,c-=8);e[r+h-d]|=128*y}},1482:(e,t,r)=>{var n=r(7768);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(4609),r(9554),r(3103),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return h(r._w,e,t,!1)},decrypt:function(e,t){return h(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i<t.length;++i)r.putByte(t[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){t=r,r=[];var a=t.length();if(16===a||24===a||32===a)for(a>>>=2,i=0;i<a;++i)r.push(t.getInt32())}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var s=this.mode.name,o=-1!==["CFB","OFB","CTR","GCM"].indexOf(s);this._w=p(r,e.decrypt&&!o),this._init=!0}},n.aes._expandKey=function(e,t){return l||f(),p(e,t)},n.aes._updateBlock=h,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var a,s,o,u,c,l=!1;function f(){l=!0,o=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;for(a=new Array(256),s=new Array(256),u=new Array(4),c=new Array(4),t=0;t<4;++t)u[t]=new Array(256),c[t]=new Array(256);var r,n,i,f,p,h,d,y=0,g=0;for(t=0;t<256;++t){f=(f=g^g<<1^g<<2^g<<3^g<<4)>>8^255&f^99,a[y]=f,s[f]=y,h=(p=e[f])<<24^f<<16^f<<8^f^p,d=((r=e[y])^(n=e[r])^(i=e[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var v=0;v<4;++v)u[v][y]=h,c[v][f]=d,h=h<<24|h>>>8,d=d<<24|d>>>8;0===y?y=g=1:(y=r^e[e[e[r^i]]],g^=e[e[g]])}}function p(e,t){for(var r,n=e.slice(0),i=1,s=n.length,u=4*(s+6+1),l=s;l<u;++l)r=n[l-1],l%s==0?(r=a[r>>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^o[i]<<24,i++):s>6&&l%s==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[l]=n[l-s]^r;if(t){for(var f,p=c[0],h=c[1],d=c[2],y=c[3],g=n.slice(0),v=(l=0,(u=n.length)-4);l<u;l+=4,v-=4)if(0===l||l===u-4)g[l]=n[v],g[l+1]=n[v+3],g[l+2]=n[v+2],g[l+3]=n[v+1];else for(var m=0;m<4;++m)f=n[v+m],g[l+(3&-m)]=p[a[f>>>24]]^h[a[f>>>16&255]]^d[a[f>>>8&255]]^y[a[255&f]];n=g}return n}function h(e,t,r,n){var i,o,l,f,p,h,d,y,g,v,m,C,E=e.length/4-1;n?(i=c[0],o=c[1],l=c[2],f=c[3],p=s):(i=u[0],o=u[1],l=u[2],f=u[3],p=a),h=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],g=t[n?1:3]^e[3];for(var S=3,b=1;b<E;++b)v=i[h>>>24]^o[d>>>16&255]^l[y>>>8&255]^f[255&g]^e[++S],m=i[d>>>24]^o[y>>>16&255]^l[g>>>8&255]^f[255&h]^e[++S],C=i[y>>>24]^o[g>>>16&255]^l[h>>>8&255]^f[255&d]^e[++S],g=i[g>>>24]^o[h>>>16&255]^l[d>>>8&255]^f[255&y]^e[++S],h=v,d=m,y=C;r[0]=p[h>>>24]<<24^p[d>>>16&255]<<16^p[y>>>8&255]<<8^p[255&g]^e[++S],r[n?3:1]=p[d>>>24]<<24^p[y>>>16&255]<<16^p[g>>>8&255]<<8^p[255&h]^e[++S],r[2]=p[y>>>24]<<24^p[g>>>16&255]<<16^p[h>>>8&255]<<8^p[255&d]^e[++S],r[n?1:3]=p[g>>>24]<<24^p[h>>>16&255]<<16^p[d>>>8&255]<<8^p[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},6898:(e,t,r)=>{var n=r(7768);r(1482),r(8472);var i=e.exports=n.tls;function a(e,t,r){var a=t.entity===n.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:n.cipher.createDecipher("AES-CBC",a?r.keys.server_write_key:r.keys.client_write_key),iv:a?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:n.cipher.createCipher("AES-CBC",a?r.keys.client_write_key:r.keys.server_write_key),iv:a?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=c,e.write.cipherFunction=s,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=i.hmac_sha1}function s(e,t){var r,a=!1,s=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(s),t.updateSequenceNumber(),r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:n.random.getBytesSync(16),t.cipherState.init=!0;var u=t.cipherState.cipher;return u.start({iv:r}),e.version.minor>=i.Versions.TLS_1_1.minor&&u.output.putBytes(r),u.update(e.fragment),u.finish(o)&&(e.fragment=u.output,e.length=e.fragment.length(),a=!0),a}function o(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function u(e,t,r){var n=!0;if(r){for(var i=t.length(),a=t.last(),s=i-1-a;s<i-1;++s)n=n&&t.at(s)==a;n&&t.truncate(a+1)}return n}function c(e,t){var r,a=!1;r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var s=t.cipherState.cipher;s.start({iv:r}),s.update(e.fragment),a=s.finish(u);var o=t.macLength,c=n.random.getBytesSync(o),l=s.output.length();l>=o?(e.fragment=s.output.getBytes(l-o),c=s.output.getBytes(o)):e.fragment=s.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var f=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),function(e,t,r){var i=n.hmac.create();return i.start("SHA1",e),i.update(t),t=i.digest().getBytes(),i.start(null,null),i.update(r),t===(r=i.digest().getBytes())}(t.macKey,c,f)&&a}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:a},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:a}},5235:(e,t,r)=>{var n=r(7768);r(2624);var i=n.asn1;t.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},t.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},2624:(e,t,r)=>{var n=r(7768);r(3103),r(2884);var i=e.exports=n.asn1=n.asn1||{};function a(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}function s(e,t,r,n){var o;a(e,t,2);var u=e.getByte();t--;var c=192&u,l=31&u;o=e.length();var f,p,h=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;a(e,t,i),n=e.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(e,t);if(t-=o-e.length(),void 0!==h&&h>t){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=t,d.requested=h,d}h=t}var y=32==(32&u);if(y)if(f=[],void 0===h)for(;;){if(a(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}o=e.length(),f.push(s(e,t,r+1,n)),t-=o-e.length()}else for(;h>0;)o=e.length(),f.push(s(e,h,r+1,n)),t-=o-e.length(),h-=o-e.length();if(void 0===f&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(p=e.bytes(h)),void 0===f&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&h>1){var g=e.read,v=t,m=0;if(l===i.Type.BITSTRING&&(a(e,t,1),m=e.getByte(),t--),0===m)try{o=e.length();var C=s(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),E=o-e.length();t-=E,l==i.Type.BITSTRING&&E++;var S=C.tagClass;E!==h||S!==i.Class.UNIVERSAL&&S!==i.Class.CONTEXT_SPECIFIC||(f=[C])}catch(e){}void 0===f&&(e.read=g,t=v)}if(void 0===f){if(void 0===h){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");h=t}if(l===i.Type.BMPSTRING)for(f="";h>0;h-=2)a(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(h)}var b=void 0===p?null:{bitStringContents:p};return i.create(c,l,y,f,b)}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,a,s){if(n.util.isArray(a)){for(var o=[],u=0;u<a.length;++u)void 0!==a[u]&&o.push(a[u]);a=o}var c={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(a),value:a};return s&&"bitStringContents"in s&&(c.bitStringContents=s.bitStringContents,c.original=i.copy(c)),c},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var a=0;a<e.length;++a)r.push(i.copy(e[a],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var a=0;a<e.length;++a)if(!i.equals(e[a],t[a]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var s=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(s=s&&e.bitStringContents===t.bitStringContents),s},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t},i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e)),s(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,a=n.util.createBuffer(),s=!1;if("bitStringContents"in e&&(s=!0,e.original&&(s=i.equals(e,e.original))),s)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var o=0;o<e.value.length;++o)void 0!==e.value[o]&&a.putBuffer(i.toDer(e.value[o]))}else if(e.type===i.Type.BMPSTRING)for(o=0;o<e.value.length;++o)a.putInt16(e.value.charCodeAt(o));else e.type===i.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var u=a.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);for(t.putByte(128|c.length),o=c.length-1;o>=0;--o)t.putByte(c.charCodeAt(o))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,s=e.split("."),o=n.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var u=2;u<s.length;++u){t=!0,r=[],i=parseInt(s[u],10);do{a=127&i,i>>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var c=r.length-1;c>=0;--c)o.putByte(r[c])}return o},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(o=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,s,o,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var l=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);l*=6e4,"+"===u?t.setTime(+t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),u=0,c=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var f=e.length-5,p=e.charAt(f);return"+"!==p&&"-"!==p||(c=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),c*=6e4,"+"===p&&(c*=-1),l=!0),"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,s,o,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,s,o,u)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+"Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+"Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,a){var s=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(s=!0,t.value&&n.util.isArray(t.value))for(var o=0,u=0;s&&u<t.value.length;++u)s=t.value[u].optional||!1,e.value[o]&&((s=i.validate(e.value[o],t.value[u],r,a))?++o:t.value[u].optional&&(s=!0)),!s&&a&&a.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(s&&r&&(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else a&&a.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return s};var o=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var a="";r=r||2,(t=t||0)>0&&(a+="\n");for(var s="",u=0;u<t*r;++u)s+=" ";switch(a+=s+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:a+="Universal:";break;case i.Class.APPLICATION:a+="Application:";break;case i.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case i.Class.PRIVATE:a+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(a+=e.type,e.type){case i.Type.NONE:a+=" (None)";break;case i.Type.BOOLEAN:a+=" (Boolean)";break;case i.Type.INTEGER:a+=" (Integer)";break;case i.Type.BITSTRING:a+=" (Bit string)";break;case i.Type.OCTETSTRING:a+=" (Octet string)";break;case i.Type.NULL:a+=" (Null)";break;case i.Type.OID:a+=" (Object Identifier)";break;case i.Type.ODESC:a+=" (Object Descriptor)";break;case i.Type.EXTERNAL:a+=" (External or Instance of)";break;case i.Type.REAL:a+=" (Real)";break;case i.Type.ENUMERATED:a+=" (Enumerated)";break;case i.Type.EMBEDDED:a+=" (Embedded PDV)";break;case i.Type.UTF8:a+=" (UTF8)";break;case i.Type.ROID:a+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:a+=" (Sequence)";break;case i.Type.SET:a+=" (Set)";break;case i.Type.PRINTABLESTRING:a+=" (Printable String)";break;case i.Type.IA5String:a+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:a+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case i.Type.BMPSTRING:a+=" (BMP String)"}else a+=e.type;if(a+="\n",a+=s+"Constructed: "+e.constructed+"\n",e.composed){var c=0,l="";for(u=0;u<e.value.length;++u)void 0!==e.value[u]&&(c+=1,l+=i.prettyPrint(e.value[u],t+1,r),u+1<e.value.length&&(l+=","));a+=s+"Sub values: "+c+l}else{if(a+=s+"Value: ",e.type===i.Type.OID){var f=i.derToOid(e.value);a+=f,n.pki&&n.pki.oids&&f in n.pki.oids&&(a+=" ("+n.pki.oids[f]+") ")}if(e.type===i.Type.INTEGER)try{a+=i.derToInteger(e.value)}catch(t){a+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var p=e.value.charCodeAt(0);1==p?a+=" (1 unused bit shown)":p>1&&(a+=" ("+p+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(o.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?a+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:o.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},7858:e=>{var t={};e.exports=t;var r={};t.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,s=t.charAt(0),o=[0];for(i=0;i<e.length;++i){for(var u=0,c=e[i];u<o.length;++u)c+=o[u]<<8,o[u]=c%a,c=c/a|0;for(;c>0;)o.push(c%a),c=c/a|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=s;for(i=o.length-1;i>=0;--i)n+=t[o[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var s=0,o=e.at(r);s<a.length;++s)o+=a[s]<<8,a[s]=o%n,o=o/n|0;for(;o>0;)a.push(o%n),o=o/n|0}var u="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)u+=i;for(r=a.length-1;r>=0;--r)u+=t[a[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},t.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var n=r[t];if(!n){n=r[t]=[];for(var i=0;i<t.length;++i)n[t.charCodeAt(i)]=i}e=e.replace(/\s/g,"");var a=t.length,s=t.charAt(0),o=[0];for(i=0;i<e.length;i++){var u=n[e.charCodeAt(i)];if(void 0===u)return;for(var c=0,l=u;c<o.length;++c)l+=o[c]*a,o[c]=255&l,l>>=8;for(;l>0;)o.push(255&l),l>>=8}for(var f=0;e[f]===s&&f<e.length-1;++f)o.push(0);return"undefined"!=typeof Buffer?Buffer.from(o.reverse()):new Uint8Array(o.reverse())}},4609:(e,t,r)=>{var n=r(7768);r(3103),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},9554:(e,t,r)=>{var n=r(7768);r(3103),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function a(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){var a=[],s=t/4;for(i=0;i<s;++i)a.push(e.getInt32());e=a}return e}function s(e){e[e.length-1]=e[e.length-1]+1&4294967295}function o(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*i)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=o(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;for(a>0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var o=n%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(o(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var a=[];this.cipher.encrypt(this._j0,a);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^a[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i)e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n);return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),s=0;s<i;++s){var o=[0,0,0,0],u=(n-1-s%n)*t;o[s/n|0]=1<<t-1<<u,a[s]=this.generateSubHashTable(this.multiply(o,e),t)}return a},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var s=1;s<a;++s){var o=i[a],u=i[s];i[a+s]=[o[0]^u[0],o[1]^u[1],o[2]^u[2],o[3]^u[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var c=i[a^n];i[a]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i}},4401:(e,t,r)=>{var n=r(7768);e.exports=n.debug=n.debug||{},n.debug.storage={},n.debug.get=function(e,t){var r;return void 0===e?r=n.debug.storage:e in n.debug.storage&&(r=void 0===t?n.debug.storage[e]:n.debug.storage[e][t]),r},n.debug.set=function(e,t,r){e in n.debug.storage||(n.debug.storage[e]={}),n.debug.storage[e][t]=r},n.debug.clear=function(e,t){void 0===e?n.debug.storage={}:e in n.debug.storage&&(void 0===t?delete n.debug.storage[e]:delete n.debug.storage[e][t])}},2023:(e,t,r)=>{var n=r(7768);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(4609),r(9554),r(3103),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return h(r._keys,e,t,!1)},decrypt:function(e,t){return h(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,v=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E<g;E++){var S=e.getInt32(),b=e.getInt32();S^=(t=252645135&(S>>>4^b))<<4,S^=t=65535&((b^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(b^=t<<-16)))<<2,S^=t=65535&((b^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(b^=t<<-16)))<<1,S^=t=16711935&((b^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(b^=t<<8)))<<1)<<8|(b^=t)>>>20&240,S=b<<24|b<<8&16711680|b>>>8&65280|b>>>24&240,b=t;for(var T=0;T<m.length;++T){m[T]?(S=S<<2|S>>>26,b=b<<2|b>>>26):(S=S<<1|S>>>27,b=b<<1|b>>>27);var A=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|u[S>>>4&15],I=c[(b&=-15)>>>28]|l[b>>>24&15]|f[b>>>20&15]|p[b>>>16&15]|h[b>>>12&15]|d[b>>>8&15]|y[b>>>4&15];t=65535&(I>>>16^A),v[C++]=A^t,v[C++]=I^t<<16}}return v}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var a=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],p=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function h(e,t,r,n){var i,h,d=32===e.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];y^=(h=252645135&(y>>>4^g))<<4,y^=(h=65535&(y>>>16^(g^=h)))<<16,y^=h=858993459&((g^=h)>>>2^y),y^=h=16711935&((g^=h<<2)>>>8^y),y=(y^=(h=1431655765&(y>>>1^(g^=h<<8)))<<1)<<1|y>>>31,g=(g^=h)<<1|g>>>31;for(var v=0;v<d;v+=3){for(var m=i[v+1],C=i[v+2],E=i[v];E!=m;E+=C){var S=g^e[E],b=(g>>>4|g<<28)^e[E+1];h=y,y=g,g=h^(s[S>>>24&63]|u[S>>>16&63]|l[S>>>8&63]|p[63&S]|a[b>>>24&63]|o[b>>>16&63]|c[b>>>8&63]|f[63&b])}h=y,y=g,g=h}g=g>>>1|g<<31,g^=h=1431655765&((y=y>>>1|y<<31)>>>1^g),g^=(h=16711935&(g>>>8^(y^=h<<1)))<<8,g^=(h=858993459&(g>>>2^(y^=h)))<<2,g^=h=65535&((y^=h)>>>16^g),g^=h=252645135&((y^=h<<16)>>>4^g),y^=h<<4,r[0]=y,r[1]=g}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},2554:(e,t,r)=>{var n=r(7768);r(1633),r(4097),r(8672),r(3103);var i=r(5235),a=i.publicKeyValidator,s=i.privateKeyValidator;if(void 0===o)var o=n.jsbn.BigInteger;var u=n.util.ByteBuffer,c="undefined"==typeof Buffer?Uint8Array:Buffer;n.pki=n.pki||{},e.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var l=n.ed25519;function f(e){var t=e.message;if(t instanceof Uint8Array||t instanceof c)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new u(t,r)}else if(!(t instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new c(t.length()),i=0;i<n.length;++i)n[i]=t.at(i);return n}l.constants={},l.constants.PUBLIC_KEY_BYTE_LENGTH=32,l.constants.PRIVATE_KEY_BYTE_LENGTH=64,l.constants.SEED_BYTE_LENGTH=32,l.constants.SIGN_BYTE_LENGTH=64,l.constants.HASH_BYTE_LENGTH=64,l.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=n.random.getBytesSync(l.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==l.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+l.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=f({message:t,encoding:"binary"});for(var r=new c(l.constants.PUBLIC_KEY_BYTE_LENGTH),i=new c(l.constants.PRIVATE_KEY_BYTE_LENGTH),a=0;a<32;++a)i[a]=t[a];return function(e,t){var r,n=[P(),P(),P(),P()],i=E(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,_(n,i),I(e,n),r=0;r<32;++r)t[r+32]=e[r]}(r,i),{publicKey:r,privateKey:i}},l.privateKeyFromAsn1=function(e){var t={},r=[];if(!n.asn1.validate(e,s,t,r)){var i=new Error("Invalid Key.");throw i.errors=r,i}var a=n.asn1.derToOid(t.privateKeyOid),o=n.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var u=t.privateKey;return{privateKeyBytes:f({message:n.asn1.fromDer(u).value,encoding:"binary"})}},l.publicKeyFromAsn1=function(e){var t={},r=[];if(!n.asn1.validate(e,a,t,r)){var i=new Error("Invalid Key.");throw i.errors=r,i}var s=n.asn1.derToOid(t.publicKeyOid),o=n.oids.EdDSA25519;if(s!==o)throw new Error('Invalid OID "'+s+'"; OID must be "'+o+'".');var u=t.ed25519PublicKey;if(u.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return f({message:u,encoding:"binary"})},l.publicKeyFromPrivateKey=function(e){var t=f({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+l.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new c(l.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},l.sign=function(e){var t=f(e=e||{}),r=f({message:e.privateKey,encoding:"binary"});if(r.length===l.constants.SEED_BYTE_LENGTH)r=l.generateKeyPair({seed:r}).privateKey;else if(r.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+l.constants.SEED_BYTE_LENGTH+" or "+l.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new c(l.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,n){var i,a,s=new Float64Array(64),o=[P(),P(),P(),P()],u=E(n,32);u[0]&=248,u[31]&=127,u[31]|=64;for(i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=u[32+i];var c=E(e.subarray(32),r+32);for(b(c),_(o,c),I(e,o),i=32;i<64;++i)e[i]=n[i];var l=E(e,r+64);for(b(l),i=32;i<64;++i)s[i]=0;for(i=0;i<32;++i)s[i]=c[i];for(i=0;i<32;++i)for(a=0;a<32;a++)s[i+a]+=l[i]*u[a];S(e.subarray(32),s)}(n,t,t.length,r);for(var i=new c(l.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=n[a];return i},l.verify=function(e){var t=f(e=e||{});if(void 0===e.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=f({message:e.signature,encoding:"binary"});if(r.length!==l.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+l.constants.SIGN_BYTE_LENGTH);var n=f({message:e.publicKey,encoding:"binary"});if(n.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+l.constants.PUBLIC_KEY_BYTE_LENGTH);var i,a=new c(l.constants.SIGN_BYTE_LENGTH+t.length),s=new c(l.constants.SIGN_BYTE_LENGTH+t.length);for(i=0;i<l.constants.SIGN_BYTE_LENGTH;++i)a[i]=r[i];for(i=0;i<t.length;++i)a[i+l.constants.SIGN_BYTE_LENGTH]=t[i];return function(e,t,r,n){var i,a=new c(32),s=[P(),P(),P(),P()],o=[P(),P(),P(),P()];if(r<64)return-1;if(function(e,t){var r=P(),n=P(),i=P(),a=P(),s=P(),o=P(),u=P();return L(e[2],h),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),x(i,e[1]),K(a,i,d),V(i,i,e[2]),O(a,e[2],a),x(s,a),x(o,s),K(u,o,s),K(r,u,i),K(r,r,a),function(e,t){var r,n=P();for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)x(n,n),1!==r&&K(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),K(r,r,i),K(r,r,a),K(r,r,a),K(e[0],r,a),x(n,e[0]),K(n,n,a),w(n,i)&&K(e[0],e[0],C),x(n,e[0]),K(n,n,a),w(n,i)?-1:(N(e[0])===t[31]>>7&&V(e[0],p,e[0]),K(e[3],e[0],e[1]),0)}(o,n))return-1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var u=E(e,r);if(b(u),R(s,o,u),_(o,t.subarray(32)),T(s,o),I(a,s),r-=64,k(t,0,a,0)){for(i=0;i<r;++i)e[i]=0;return-1}for(i=0;i<r;++i)e[i]=t[i+64];return r}(s,a,a.length,n)>=0};var p=P(),h=P([1]),d=P([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=P([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=P([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=P([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),C=P([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,t){var r=n.md.sha512.create(),i=new u(e);r.update(i.getBytes(t),"binary");var a=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(a,"binary");for(var s=new c(l.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)s[o]=a.charCodeAt(o);return s}function S(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i<a;++i)t[i]+=r-16*t[n]*m[i-(n-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*m[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*m[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function b(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;S(e,t)}function T(e,t){var r=P(),n=P(),i=P(),a=P(),s=P(),o=P(),u=P(),c=P(),l=P();V(r,e[1],e[0]),V(l,t[1],t[0]),K(r,r,l),O(n,e[0],e[1]),O(l,t[0],t[1]),K(n,n,l),K(i,e[3],t[3]),K(i,i,y),K(a,e[2],t[2]),O(a,a,a),V(s,n,r),V(o,a,i),O(u,a,i),O(c,n,r),K(e[0],s,o),K(e[1],c,u),K(e[2],u,o),K(e[3],s,c)}function A(e,t,r){for(var n=0;n<4;++n)D(e[n],t[n],r)}function I(e,t){var r=P(),n=P(),i=P();!function(e,t){var r,n=P();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)x(n,n),2!==r&&4!==r&&K(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(i,t[2]),K(r,t[0],i),K(n,t[1],i),B(e,n),e[31]^=N(r)<<7}function B(e,t){var r,n,i,a=P(),s=P();for(r=0;r<16;++r)s[r]=t[r];for(U(s),U(s),U(s),n=0;n<2;++n){for(a[0]=s[0]-65517,r=1;r<15;++r)a[r]=s[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,D(s,a,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function w(e,t){var r=new c(32),n=new c(32);return B(r,e),B(n,t),k(r,0,n,0)}function k(e,t,r,n){return function(e,t,r,n,i){var a,s=0;for(a=0;a<32;++a)s|=e[t+a]^r[n+a];return(1&s-1>>>8)-1}(e,t,r,n)}function N(e){var t=new c(32);return B(t,e),1&t[0]}function R(e,t,r){var n,i;for(L(e[0],p),L(e[1],h),L(e[2],h),L(e[3],p),i=255;i>=0;--i)A(e,t,n=r[i/8|0]>>(7&i)&1),T(t,e),T(e,e),A(e,t,n)}function _(e,t){var r=[P(),P(),P(),P()];L(r[0],g),L(r[1],v),L(r[2],h),K(r[3],g,v),R(e,r,t)}function L(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function U(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function D(e,t,r){for(var n,i=~(r-1),a=0;a<16;++a)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function P(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function O(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function V(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function x(e,t){K(e,t,t)}function K(e,t,r){var n,i,a=0,s=0,o=0,u=0,c=0,l=0,f=0,p=0,h=0,d=0,y=0,g=0,v=0,m=0,C=0,E=0,S=0,b=0,T=0,A=0,I=0,B=0,w=0,k=0,N=0,R=0,_=0,L=0,U=0,D=0,P=0,O=r[0],V=r[1],x=r[2],K=r[3],M=r[4],F=r[5],j=r[6],H=r[7],q=r[8],G=r[9],z=r[10],Q=r[11],Y=r[12],W=r[13],X=r[14],Z=r[15];a+=(n=t[0])*O,s+=n*V,o+=n*x,u+=n*K,c+=n*M,l+=n*F,f+=n*j,p+=n*H,h+=n*q,d+=n*G,y+=n*z,g+=n*Q,v+=n*Y,m+=n*W,C+=n*X,E+=n*Z,s+=(n=t[1])*O,o+=n*V,u+=n*x,c+=n*K,l+=n*M,f+=n*F,p+=n*j,h+=n*H,d+=n*q,y+=n*G,g+=n*z,v+=n*Q,m+=n*Y,C+=n*W,E+=n*X,S+=n*Z,o+=(n=t[2])*O,u+=n*V,c+=n*x,l+=n*K,f+=n*M,p+=n*F,h+=n*j,d+=n*H,y+=n*q,g+=n*G,v+=n*z,m+=n*Q,C+=n*Y,E+=n*W,S+=n*X,b+=n*Z,u+=(n=t[3])*O,c+=n*V,l+=n*x,f+=n*K,p+=n*M,h+=n*F,d+=n*j,y+=n*H,g+=n*q,v+=n*G,m+=n*z,C+=n*Q,E+=n*Y,S+=n*W,b+=n*X,T+=n*Z,c+=(n=t[4])*O,l+=n*V,f+=n*x,p+=n*K,h+=n*M,d+=n*F,y+=n*j,g+=n*H,v+=n*q,m+=n*G,C+=n*z,E+=n*Q,S+=n*Y,b+=n*W,T+=n*X,A+=n*Z,l+=(n=t[5])*O,f+=n*V,p+=n*x,h+=n*K,d+=n*M,y+=n*F,g+=n*j,v+=n*H,m+=n*q,C+=n*G,E+=n*z,S+=n*Q,b+=n*Y,T+=n*W,A+=n*X,I+=n*Z,f+=(n=t[6])*O,p+=n*V,h+=n*x,d+=n*K,y+=n*M,g+=n*F,v+=n*j,m+=n*H,C+=n*q,E+=n*G,S+=n*z,b+=n*Q,T+=n*Y,A+=n*W,I+=n*X,B+=n*Z,p+=(n=t[7])*O,h+=n*V,d+=n*x,y+=n*K,g+=n*M,v+=n*F,m+=n*j,C+=n*H,E+=n*q,S+=n*G,b+=n*z,T+=n*Q,A+=n*Y,I+=n*W,B+=n*X,w+=n*Z,h+=(n=t[8])*O,d+=n*V,y+=n*x,g+=n*K,v+=n*M,m+=n*F,C+=n*j,E+=n*H,S+=n*q,b+=n*G,T+=n*z,A+=n*Q,I+=n*Y,B+=n*W,w+=n*X,k+=n*Z,d+=(n=t[9])*O,y+=n*V,g+=n*x,v+=n*K,m+=n*M,C+=n*F,E+=n*j,S+=n*H,b+=n*q,T+=n*G,A+=n*z,I+=n*Q,B+=n*Y,w+=n*W,k+=n*X,N+=n*Z,y+=(n=t[10])*O,g+=n*V,v+=n*x,m+=n*K,C+=n*M,E+=n*F,S+=n*j,b+=n*H,T+=n*q,A+=n*G,I+=n*z,B+=n*Q,w+=n*Y,k+=n*W,N+=n*X,R+=n*Z,g+=(n=t[11])*O,v+=n*V,m+=n*x,C+=n*K,E+=n*M,S+=n*F,b+=n*j,T+=n*H,A+=n*q,I+=n*G,B+=n*z,w+=n*Q,k+=n*Y,N+=n*W,R+=n*X,_+=n*Z,v+=(n=t[12])*O,m+=n*V,C+=n*x,E+=n*K,S+=n*M,b+=n*F,T+=n*j,A+=n*H,I+=n*q,B+=n*G,w+=n*z,k+=n*Q,N+=n*Y,R+=n*W,_+=n*X,L+=n*Z,m+=(n=t[13])*O,C+=n*V,E+=n*x,S+=n*K,b+=n*M,T+=n*F,A+=n*j,I+=n*H,B+=n*q,w+=n*G,k+=n*z,N+=n*Q,R+=n*Y,_+=n*W,L+=n*X,U+=n*Z,C+=(n=t[14])*O,E+=n*V,S+=n*x,b+=n*K,T+=n*M,A+=n*F,I+=n*j,B+=n*H,w+=n*q,k+=n*G,N+=n*z,R+=n*Q,_+=n*Y,L+=n*W,U+=n*X,D+=n*Z,E+=(n=t[15])*O,s+=38*(b+=n*x),o+=38*(T+=n*K),u+=38*(A+=n*M),c+=38*(I+=n*F),l+=38*(B+=n*j),f+=38*(w+=n*H),p+=38*(k+=n*q),h+=38*(N+=n*G),d+=38*(R+=n*z),y+=38*(_+=n*Q),g+=38*(L+=n*Y),v+=38*(U+=n*W),m+=38*(D+=n*X),C+=38*(P+=n*Z),a=(n=(a+=38*(S+=n*V))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),E=(n=E+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),E=(n=E+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=s,e[2]=o,e[3]=u,e[4]=c,e[5]=l,e[6]=f,e[7]=p,e[8]=h,e[9]=d,e[10]=y,e[11]=g,e[12]=v,e[13]=m,e[14]=C,e[15]=E}},7768:e=>{e.exports={options:{usePureJavaScript:!1}}},7461:(e,t,r)=>{var n=r(7768);r(6067),r(3103),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,s){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===s)s=e;else{if("string"==typeof s)s=n.util.createBuffer(s);else if(n.util.isArray(s)){var o=s;s=n.util.createBuffer();for(var u=0;u<o.length;++u)s.putByte(o[u])}var c=s.length();for(c>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=s.length(),u=0;u<c;++u)o=s.at(u),r.putByte(54^o),i.putByte(92^o);if(c<t.blockLength)for(o=t.blockLength-c,u=0;u<o;++u)r.putByte(54),i.putByte(92);e=s,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return a.digest=a.getMac,a}},6432:(e,t,r)=>{e.exports=r(7768),r(1482),r(6898),r(2624),r(4609),r(4401),r(2023),r(2554),r(7461),r(1169),r(7316),r(7847),r(5024),r(9580),r(5477),r(4034),r(779),r(1559),r(4885),r(8547),r(3930),r(665),r(4097),r(3323),r(2676),r(2073),r(8472),r(3103)},1633:(e,t,r)=>{var n,i=r(7768);function a(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function s(){return new a(null)}function o(e,t,r,n,i,a){for(var s=16383&t,o=t>>14;--a>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=o*u+c*s;i=((u=s*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+o*c,r.data[n++]=268435455&u}return i}e.exports=i.jsbn=i.jsbn||{},i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=o,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var s=32767&t,o=t>>15;--a>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=o*u+c*s;i=((u=s*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+o*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var s=t*this.data[e++]+r.data[n]+i;i=Math.floor(s/67108864),r.data[n++]=67108863&s}return i},n=26):(a.prototype.am=o,n=28),a.prototype.DB=n,a.prototype.DM=(1<<n)-1,a.prototype.DV=1<<n,a.prototype.FV=Math.pow(2,52),a.prototype.F1=52-n,a.prototype.F2=2*n-52;var u,c,l=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)l[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)l[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)l[u++]=c;function f(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function p(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function h(e){var t=s();return t.fromInt(e),t}function d(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function v(e,t){return e&t}function m(e,t){return e|t}function C(e,t){return e^t}function E(e,t){return e&~t}function S(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function b(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function T(){}function A(e){return e}function I(e){this.r2=s(),this.q3=s(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=s();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=s();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},a.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},a.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,s=0;--n>=0;){var o=8==r?255&e[n]:p(e,n);o<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==s?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this.data[this.t++]=o>>this.DB-s):this.data[this.t-1]|=o<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&a.ZERO.subTo(this,this)},a.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},a.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},a.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},a.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,s=Math.floor(e/this.DB),o=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+s+1]=this.data[r]>>i|o,o=(this.data[r]&a)<<n;for(r=s-1;r>=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},a.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var s=r+1;s<this.t;++s)t.data[s-r-1]|=(this.data[s]&a)<<i,t.data[s-r]=this.data[s]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},a.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},a.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&a.ZERO.subTo(t,t)},a.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=s());var o=s(),u=this.s,c=e.s,l=this.DB-d(n.data[n.t-1]);l>0?(n.lShiftTo(l,o),i.lShiftTo(l,r)):(n.copyTo(o),i.copyTo(r));var f=o.t,p=o.data[f-1];if(0!=p){var h=p*(1<<this.F1)+(f>1?o.data[f-2]>>this.F2:0),y=this.FV/h,g=(1<<this.F1)/h,v=1<<this.F2,m=r.t,C=m-f,E=null==t?s():t;for(o.dlShiftTo(C,E),r.compareTo(E)>=0&&(r.data[r.t++]=1,r.subTo(E,r)),a.ONE.dlShiftTo(f,E),E.subTo(o,o);o.t<f;)o.data[o.t++]=0;for(;--C>=0;){var S=r.data[--m]==p?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+v)*g);if((r.data[m]+=o.am(0,S,r,C,0,f))<S)for(o.dlShiftTo(C,E),r.subTo(E,r);r.data[m]<--S;)r.subTo(E,r)}null!=t&&(r.drShiftTo(f,t),u!=c&&a.ZERO.subTo(t,t)),r.t=f,r.clamp(),l>0&&r.rShiftTo(l,r),u<0&&a.ZERO.subTo(r,r)}}},a.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=s(),n=s(),i=t.convert(this),o=d(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},a.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(i=!0,a=f(r));s>=0;)o<t?(r=(this.data[s]&(1<<o)-1)<<t-o,r|=this.data[--s]>>(o+=this.DB-t)):(r=this.data[s]>>(o-=t)&n,o<=0&&(o+=this.DB,--s)),r>0&&(i=!0),i&&(a+=f(r));return i?a:"0"},a.prototype.negate=function(){var e=s();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=s();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new g(t),this.exp(e,r)},a.ZERO=h(0),a.ONE=h(1),T.prototype.convert=A,T.prototype.revert=A,T.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},T.prototype.sqrTo=function(e,t){e.squareTo(t)},I.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=s();return e.copyTo(t),this.reduce(t),t},I.prototype.revert=function(e){return e},I.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},I.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var B=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],w=(1<<26)/B[B.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=h(r),i=s(),a=s(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(e)+o},a.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,s=0,o=0,u=0;u<e.length;++u){var c=p(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(i=!0):(o=t*o+c,++s>=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(t,s)),this.dAddOffset(o,0)),i&&a.ZERO.subTo(this,this)},a.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(a.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},a.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},a.prototype.changeBit=function(e,t){var r=a.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},a.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},a.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},a.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},a.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),s={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},o=0;o<e;++o){do{n=new a(this.bitLength(),s)}while(n.compareTo(a.ONE)<=0||n.compareTo(t)>=0);var u=n.modPow(i,this);if(0!=u.compareTo(a.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<r&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(a.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},a.prototype.clone=function(){var e=s();return this.copyTo(e),e},a.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},a.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=s();return this.bitwiseTo(e,v,t),t},a.prototype.or=function(e){var t=s();return this.bitwiseTo(e,m,t),t},a.prototype.xor=function(e){var t=s();return this.bitwiseTo(e,C,t),t},a.prototype.andNot=function(e){var t=s();return this.bitwiseTo(e,E,t),t},a.prototype.not=function(){for(var e=s(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},a.prototype.shiftLeft=function(e){var t=s();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},a.prototype.shiftRight=function(e){var t=s();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},a.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+S(this.data[e]);return this.s<0?this.t*this.DB:-1},a.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=b(this.data[r]^t);return e},a.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},a.prototype.setBit=function(e){return this.changeBit(e,m)},a.prototype.clearBit=function(e){return this.changeBit(e,E)},a.prototype.flipBit=function(e){return this.changeBit(e,C)},a.prototype.add=function(e){var t=s();return this.addTo(e,t),t},a.prototype.subtract=function(e){var t=s();return this.subTo(e,t),t},a.prototype.multiply=function(e){var t=s();return this.multiplyTo(e,t),t},a.prototype.divide=function(e){var t=s();return this.divRemTo(e,t,null),t},a.prototype.remainder=function(e){var t=s();return this.divRemTo(e,null,t),t},a.prototype.divideAndRemainder=function(e){var t=s(),r=s();return this.divRemTo(e,t,r),new Array(t,r)},a.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=h(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new y(t):t.isEven()?new I(t):new g(t);var o=new Array,u=3,c=r-1,l=(1<<r)-1;if(o[1]=n.convert(this),r>1){var f=s();for(n.sqrTo(o[1],f);u<=l;)o[u]=s(),n.mulTo(f,o[u-2],o[u]),u+=2}var p,v,m=e.t-1,C=!0,E=s();for(i=d(e.data[m])-1;m>=0;){for(i>=c?p=e.data[m]>>i-c&l:(p=(e.data[m]&(1<<i+1)-1)<<c-i,m>0&&(p|=e.data[m-1]>>this.DB+i-c)),u=r;0==(1&p);)p>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),C)o[p].copyTo(a),C=!1;else{for(;u>1;)n.sqrTo(a,E),n.sqrTo(E,a),u-=2;u>0?n.sqrTo(a,E):(v=a,a=E,E=v),n.mulTo(E,o[p],a)}for(;m>=0&&0==(e.data[m]&1<<i);)n.sqrTo(a,E),v=a,a=E,E=v,--i<0&&(i=this.DB-1,--m)}return n.revert(a)},a.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return a.ZERO;for(var r=e.clone(),n=this.clone(),i=h(1),s=h(0),o=h(0),u=h(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(e,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&u.isEven()||(o.addTo(this,o),u.subTo(e,u)),o.rShiftTo(1,o)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(o,i),s.subTo(u,s)):(n.subTo(r,n),t&&o.subTo(i,o),u.subTo(s,u))}return 0!=n.compareTo(a.ONE)?a.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},a.prototype.pow=function(e){return this.exp(e,new T)},a.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=B[B.length-1]){for(t=0;t<B.length;++t)if(r.data[0]==B[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<B.length;){for(var n=B[t],i=t+1;i<B.length&&n<w;)n*=B[i++];for(n=r.modInt(n);t<i;)if(n%B[t++]==0)return!1}return r.millerRabin(e)}},1169:(e,t,r)=>{var n=r(7768);r(3103),r(4097),r(1633),e.exports=n.kem=n.kem||{};var i=n.jsbn.BigInteger;function a(e,t,r,i){e.generate=function(e,a){for(var s=new n.util.ByteBuffer,o=Math.ceil(a/i)+r,u=new n.util.ByteBuffer,c=r;c<o;++c){u.putInt32(c),t.start(),t.update(e+u.getBytes());var l=t.digest();s.putBytes(l.getBytes(i))}return s.truncate(s.length()-a),s.getBytes()}}n.kem.rsa={},n.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||n.random;return{encrypt:function(t,a){var s,o=Math.ceil(t.n.bitLength()/8);do{s=new i(n.util.bytesToHex(r.getBytesSync(o)),16).mod(t.n)}while(s.compareTo(i.ONE)<=0);var u=o-(s=n.util.hexToBytes(s.toString(16))).length;return u>0&&(s=n.util.fillString(String.fromCharCode(0),u)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,a)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}}},n.kem.kdf1=function(e,t){a(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){a(this,e,1,t||e.digestLength)}},7316:(e,t,r)=>{var n=r(7768);r(3103),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},a=[],s=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var o=0;o<n.log.levels.length;++o){var u=n.log.levels[o];i[u]={index:o,name:u.toUpperCase()}}n.log.logMessage=function(e){for(var t=i[e.level].index,r=0;r<a.length;++r){var s=a[r];s.flags&n.log.NO_LEVEL_CHECK?s.f(e):t<=i[s.level].index&&s.f(s,e)}},n.log.prepareStandard=function(e){"standard"in e||(e.standard=i[e.level].name+" ["+e.category+"] "+e.message)},n.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||0),e.full=n.util.format.apply(this,t)}},n.log.prepareStandardFull=function(e){"standardFull"in e||(n.log.prepareStandard(e),e.standardFull=e.standard)};var c=["error","warning","info","debug","verbose"];for(o=0;o<c.length;++o)!function(e){n.log[e]=function(t,r){var i=Array.prototype.slice.call(arguments).slice(2),a={timestamp:new Date,level:e,category:t,message:r,arguments:i};n.log.logMessage(a)}}(c[o]);if(n.log.makeLogger=function(e){var t={flags:0,f:e};return n.log.setLevel(t,"none"),t},n.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&n.log.LEVEL_LOCKED))for(var i=0;i<n.log.levels.length;++i)if(t==n.log.levels[i]){e.level=t,r=!0;break}return r},n.log.lock=function(e,t){void 0===t||t?e.flags|=n.log.LEVEL_LOCKED:e.flags&=~n.log.LEVEL_LOCKED},n.log.addLogger=function(e){a.push(e)},"undefined"!=typeof console&&"log"in console){var l;if(console.error&&console.warn&&console.info&&console.debug){var f={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},p=function(e,t){n.log.prepareStandard(t);var r=f[t.level],i=[t.standard];i=i.concat(t.arguments.slice()),r.apply(console,i)};l=n.log.makeLogger(p)}else p=function(e,t){n.log.prepareStandardFull(t),console.log(t.standardFull)},l=n.log.makeLogger(p);n.log.setLevel(l,"debug"),n.log.addLogger(l),s=l}else console={log:function(){}};if(null!==s){var h=n.util.getQueryVariables();"console.level"in h&&n.log.setLevel(s,h["console.level"].slice(-1)[0]),"console.lock"in h&&"true"==h["console.lock"].slice(-1)[0]&&n.log.lock(s)}n.log.consoleLogger=s},7847:(e,t,r)=>{e.exports=r(6067),r(4581),r(2936),r(9141),r(8672)},6067:(e,t,r)=>{var n=r(7768);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},4581:(e,t,r)=>{var n=r(7768);r(6067),r(3103);var i=e.exports=n.md5=n.md5||{};n.md.md5=n.md.algorithms.md5=i,i.create=function(){c||function(){a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],o=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],u=new Array(64);for(var e=0;e<64;++e)u[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));c=!0}();var e=null,t=n.util.createBuffer(),r=new Array(16),i={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},i}};return i.start(),i.update=function(a,s){"utf8"===s&&(a=n.util.encodeUtf8(a));var o=a.length;i.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=o[1],o[1]=o[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(a),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var o=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-o));for(var u,c=0,f=i.fullMessageLength.length-1;f>=0;--f)c=(u=8*i.fullMessageLength[f]+c)/4294967296>>>0,s.putInt32Le(u>>>0);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(p,r,s);var h=n.util.createBuffer();return h.putInt32Le(p.h0),h.putInt32Le(p.h1),h.putInt32Le(p.h2),h.putInt32Le(p.h3),h},i};var a=null,s=null,o=null,u=null,c=!1;function l(e,t,r){for(var n,i,a,c,l,f,p,h=r.length();h>=64;){for(i=e.h0,a=e.h1,c=e.h2,l=e.h3,p=0;p<16;++p)t[p]=r.getInt32Le(),n=i+(l^a&(c^l))+u[p]+t[p],i=l,l=c,c=a,a+=n<<(f=o[p])|n>>>32-f;for(;p<32;++p)n=i+(c^l&(a^c))+u[p]+t[s[p]],i=l,l=c,c=a,a+=n<<(f=o[p])|n>>>32-f;for(;p<48;++p)n=i+(a^c^l)+u[p]+t[s[p]],i=l,l=c,c=a,a+=n<<(f=o[p])|n>>>32-f;for(;p<64;++p)n=i+(c^(a|~l))+u[p]+t[s[p]],i=l,l=c,c=a,a+=n<<(f=o[p])|n>>>32-f;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+c|0,e.h3=e.h3+l|0,h-=64}}},826:(e,t,r)=>{var n=r(7768);r(5024),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},5024:(e,t,r)=>{var n=r(7768);r(3103),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),s=0;s<a;s++){var o=new n.util.ByteBuffer;o.putInt32(s),e.start(),e.update(t+o.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},2884:(e,t,r)=>{var n=r(7768);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function a(e,t){i[e]=t,i[t]=e}function s(e,t){i[e]=t}a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRSAEncryption"),a("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),a("1.2.840.113549.1.1.7","RSAES-OAEP"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.9","pSpecified"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),a("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),a("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),a("1.3.101.112","EdDSA25519"),a("1.2.840.10040.4.3","dsa-with-sha1"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("1.2.840.113549.2.5","md5"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),a("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),a("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),a("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),a("1.2.840.113549.2.7","hmacWithSHA1"),a("1.2.840.113549.2.8","hmacWithSHA224"),a("1.2.840.113549.2.9","hmacWithSHA256"),a("1.2.840.113549.2.10","hmacWithSHA384"),a("1.2.840.113549.2.11","hmacWithSHA512"),a("1.2.840.113549.3.7","des-EDE3-CBC"),a("2.16.840.1.101.3.4.1.2","aes128-CBC"),a("2.16.840.1.101.3.4.1.22","aes192-CBC"),a("2.16.840.1.101.3.4.1.42","aes256-CBC"),a("2.5.4.3","commonName"),a("2.5.4.5","serialName"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.9","streetAddress"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.13","description"),a("2.5.4.15","businessCategory"),a("2.5.4.17","postalCode"),a("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),a("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),a("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping")},6635:(e,t,r)=>{var n=r(7768);if(r(1482),r(2624),r(2023),r(6067),r(2884),r(9580),r(5477),r(4097),r(3323),r(144),r(3103),void 0===i)var i=n.jsbn.BigInteger;var a=n.asn1,s=n.pki=n.pki||{};e.exports=s.pbe=n.pbe=n.pbe||{};var o=s.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"iterations"}]};function f(e,t){return e.start().update(t).digest().getBytes()}function p(e){var t;if(e){if(!(t=s.oids[a.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return h(t)}function h(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}s.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,u,c,l=n.random.getBytesSync(r.saltSize),f=r.count,p=a.integerToDer(f);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var d,y,g;switch(r.algorithm){case"aes128":i=16,d=16,y=o["aes128-CBC"],g=n.aes.createEncryptionCipher;break;case"aes192":i=24,d=16,y=o["aes192-CBC"],g=n.aes.createEncryptionCipher;break;case"aes256":i=32,d=16,y=o["aes256-CBC"],g=n.aes.createEncryptionCipher;break;case"des":i=8,d=8,y=o.desCBC,g=n.des.createEncryptionCipher;break;default:throw(b=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,b}var v="hmacWith"+r.prfAlgorithm.toUpperCase(),m=h(v),C=n.pkcs5.pbkdf2(t,l,f,i,m),E=n.random.getBytesSync(d);(T=g(C)).start(E),T.update(a.toDer(e)),T.finish(),c=T.output.getBytes();var S=function(e,t,r,i){var o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==i&&o.value.push(a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.oids[i]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")])),o}(l,p,i,v);u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.pkcs5PBES2).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.pkcs5PBKDF2).getBytes()),S]),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(y).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,E)])])])}else{var b;if("3des"!==r.algorithm)throw(b=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,b;i=24;var T,A=new n.util.ByteBuffer(l);C=s.pbe.generatePkcs12Key(t,A,1,f,i),E=s.pbe.generatePkcs12Key(t,A,2,f,i),(T=n.des.createEncryptionCipher(C)).start(E),T.update(a.toDer(e)),T.finish(),c=T.output.getBytes(),u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,l),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,p.getBytes())])])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[u,a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,c)])},s.decryptPrivateKeyInfo=function(e,t){var r=null,i={},o=[];if(!a.validate(e,u,i,o)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=o,c}var l=a.derToOid(i.encryptionOid),f=s.pbe.getCipher(l,i.encryptionParams,t),p=n.util.createBuffer(i.encryptedData);return f.update(p),f.finish()&&(r=a.fromDer(f.output)),r},s.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:a.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},s.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return a.fromDer(t.body)},s.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=s.wrapRsaPrivateKey(s.privateKeyToAsn1(e));return i=s.encryptPrivateKeyInfo(i,t,r),s.encryptedPrivateKeyToPem(i)}var o,u,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var p=l(n.pbe.opensslDeriveBytes(t,u.substr(0,8),c));p.start(u),p.update(a.toDer(s.privateKeyToAsn1(e))),p.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:n.util.bytesToHex(u).toUpperCase()},body:p.output.getBytes()};return n.pem.encode(h)},s.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var o,u;switch(i.dekInfo.algorithm){case"DES-CBC":o=8,u=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":o=24,u=n.des.createDecryptionCipher;break;case"AES-128-CBC":o=16,u=n.aes.createDecryptionCipher;break;case"AES-192-CBC":o=24,u=n.aes.createDecryptionCipher;break;case"AES-256-CBC":o=32,u=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":o=5,u=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":o=8,u=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":o=16,u=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var l=n.util.hexToBytes(i.dekInfo.parameters),f=u(n.pbe.opensslDeriveBytes(t,l.substr(0,8),o));if(f.start(l),f.update(n.util.createBuffer(i.body)),!f.finish())return r;r=f.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?s.decryptPrivateKeyInfo(a.fromDer(r),t):a.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(e,t,r,i,a,s){var o,u;if(null==s){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');s=n.md.sha1.create()}var c=s.digestLength,l=s.blockLength,f=new n.util.ByteBuffer,p=new n.util.ByteBuffer;if(null!=e){for(u=0;u<e.length;u++)p.putInt16(e.charCodeAt(u));p.putInt16(0)}var h=p.length(),d=t.length(),y=new n.util.ByteBuffer;y.fillWithByte(r,l);var g=l*Math.ceil(d/l),v=new n.util.ByteBuffer;for(u=0;u<g;u++)v.putByte(t.at(u%d));var m=l*Math.ceil(h/l),C=new n.util.ByteBuffer;for(u=0;u<m;u++)C.putByte(p.at(u%h));var E=v;E.putBuffer(C);for(var S=Math.ceil(a/c),b=1;b<=S;b++){var T=new n.util.ByteBuffer;T.putBytes(y.bytes()),T.putBytes(E.bytes());for(var A=0;A<i;A++)s.start(),s.update(T.getBytes()),T=s.digest();var I=new n.util.ByteBuffer;for(u=0;u<l;u++)I.putByte(T.at(u%c));var B=Math.ceil(d/l)+Math.ceil(h/l),w=new n.util.ByteBuffer;for(o=0;o<B;o++){var k=new n.util.ByteBuffer(E.getBytes(l)),N=511;for(u=I.length()-1;u>=0;u--)N>>=8,N+=I.at(u)+k.at(u),k.setAt(u,255&N);w.putBuffer(k)}E=w,f.putBuffer(T)}return f.truncate(f.length()-a),f},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},s.pbe.getCipherForPBES2=function(e,t,r){var i,o={},u=[];if(!a.validate(t,c,o,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((e=a.derToOid(o.kdfOid))!==s.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(o.encOid))!==s.oids["aes128-CBC"]&&e!==s.oids["aes192-CBC"]&&e!==s.oids["aes256-CBC"]&&e!==s.oids["des-EDE3-CBC"]&&e!==s.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,f,h=o.kdfSalt,d=n.util.createBuffer(o.kdfIterationCount);switch(d=d.getInt(d.length()<<3),s.oids[e]){case"aes128-CBC":l=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=n.des.createDecryptionCipher;break;case"desCBC":l=8,f=n.des.createDecryptionCipher}var y=p(o.prfOid),g=n.pkcs5.pbkdf2(r,h,d,l,y),v=o.encIv,m=f(g);return m.start(v),m},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},o=[];if(!a.validate(t,l,i,o))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=o,y;var u,c,f,h=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),e){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,f=n.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var g=p(i.prfOid),v=s.pbe.generatePkcs12Key(r,h,1,d,u,g);return g.start(),f(v,s.pbe.generatePkcs12Key(r,h,2,d,c,g))},s.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var a=[f(i,e+t)],s=16,o=1;s<r;++o,s+=16)a.push(f(i,a[o-1]+e+t));return a.join("").substr(0,r)}},9580:(e,t,r)=>{var n=r(7768);r(7461),r(6067),r(3103);var i,a=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(3906)),e.exports=n.pbkdf2=a.pbkdf2=function(e,t,r,a,s,o){if("function"==typeof s&&(o=s,s=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===s||"object"!=typeof s)&&(i.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),o?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,a,(function(e,t){if(e)return o(e);o(null,t.toString("binary"))})):i.pbkdf2(e,t,r,a,s,(function(e,t){if(e)return o(e);o(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,a).toString("binary"):i.pbkdf2Sync(e,t,r,a,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=n.md[s].create()}var u=s.digestLength;if(a>4294967295*u){var c=new Error("Derived key is too long.");if(o)return o(c);throw c}var l=Math.ceil(a/u),f=a-(l-1)*u,p=n.hmac.create();p.start(s,e);var h,d,y,g="";if(!o){for(var v=1;v<=l;++v){p.start(null,null),p.update(t),p.update(n.util.int32ToBytes(v)),h=y=p.digest().getBytes();for(var m=2;m<=r;++m)p.start(null,null),p.update(y),d=p.digest().getBytes(),h=n.util.xorBytes(h,d,u),y=d;g+=v<l?h:h.substr(0,f)}return g}function C(){if(v>l)return o(null,g);p.start(null,null),p.update(t),p.update(n.util.int32ToBytes(v)),h=y=p.digest().getBytes(),m=2,E()}function E(){if(m<=r)return p.start(null,null),p.update(y),d=p.digest().getBytes(),h=n.util.xorBytes(h,d,u),y=d,++m,n.util.setImmediate(E);g+=v<l?h:h.substr(0,f),++v,C()}v=1,C()}},5477:(e,t,r)=>{var n=r(7768);r(3103);var i=e.exports=n.pem=n.pem||{};function a(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var a=0,s=-1;for(i=0;i<t.length;++i,++a)if(a>65&&-1!==s){var o=t[s];","===o?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+o+t.substr(s+1),a=i-s-1,s=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(s=i);return t}function s(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=a(r)),e.headers)for(var s=0;s<e.headers.length;++s)i+=a(e.headers[s]);return e.procType&&(i+="\r\n"),(i+=n.util.encode64(e.body,t.maxline||64)+"\r\n")+"-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,o=/\r?\n/;t=i.exec(e);){var u={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(t[3])};if(r.push(u),t[2]){for(var c=t[2].split(o),l=0;t&&l<c.length;){for(var f=c[l].replace(/\s+$/,""),p=l+1;p<c.length;++p){var h=c[p];if(!/\s/.test(h[0]))break;f+=h,l=p}if(t=f.match(a)){for(var d={name:t[1],values:[]},y=t[2].split(","),g=0;g<y.length;++g)d.values.push(s(y[g]));if(u.procType)if(u.contentDomain||"Content-Domain"!==d.name)if(u.dekInfo||"DEK-Info"!==d.name)u.headers.push(d);else{if(0===d.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.contentDomain=y[0]||"";else{if("Proc-Type"!==d.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==d.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++l}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},4034:(e,t,r)=>{var n=r(7768);r(3103),r(4097),r(2936);var i=e.exports=n.pkcs1=n.pkcs1||{};function a(e,t,r){r||(r=n.md.sha1.create());for(var i="",a=Math.ceil(t/r.digestLength),s=0;s<a;++s){var o=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,s,o,u;"string"==typeof r?(i=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(i=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),o?o.start():o=n.md.sha1.create(),u||(u=o);var c=Math.ceil(e.n.bitLength()/8),l=c-2*o.digestLength-2;if(t.length>l)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=t.length,g.maxLength=l,g;i||(i=""),o.update(i,"raw");for(var f=o.digest(),p="",h=l-t.length,d=0;d<h;d++)p+="\0";var y=f.getBytes()+p+""+t;if(s){if(s.length!==o.digestLength){var g;throw(g=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=s.length,g.digestLength=o.digestLength,g}}else s=n.random.getBytes(o.digestLength);var v=a(s,c-o.digestLength-1,u),m=n.util.xorBytes(y,v,y.length),C=a(m,o.digestLength,u),E=n.util.xorBytes(s,C,s.length);return"\0"+E+m},i.decode_rsa_oaep=function(e,t,r){var i,s,o;"string"==typeof r?(i=r,s=arguments[3]||void 0):r&&(i=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md));var u=Math.ceil(e.n.bitLength()/8);if(t.length!==u)throw(m=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,m.expectedLength=u,m;if(void 0===s?s=n.md.sha1.create():s.start(),o||(o=s),u<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),s.update(i,"raw");for(var c=s.digest().getBytes(),l=t.charAt(0),f=t.substring(1,s.digestLength+1),p=t.substring(1+s.digestLength),h=a(p,s.digestLength,o),d=n.util.xorBytes(f,h,f.length),y=a(d,u-s.digestLength-1,o),g=n.util.xorBytes(p,y,p.length),v=g.substring(0,s.digestLength),m="\0"!==l,C=0;C<s.digestLength;++C)m|=c.charAt(C)!==v.charAt(C);for(var E=1,S=s.digestLength,b=s.digestLength;b<g.length;b++){var T=g.charCodeAt(b),A=1&T^1,I=E?65534:0;m|=T&I,S+=E&=A}if(m||1!==g.charCodeAt(S))throw new Error("Invalid RSAES-OAEP padding.");return g.substring(S+1)}},779:(e,t,r)=>{var n=r(7768);r(2624),r(7461),r(2884),r(8989),r(6635),r(4097),r(144),r(2936),r(3103),r(6446);var i=n.asn1,a=n.pki,s=e.exports=n.pkcs12=n.pkcs12||{},o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},o,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},c={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},l={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},f={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function p(e,t,r,n){for(var i=[],a=0;a<e.length;a++)for(var s=0;s<e[a].safeBags.length;s++){var o=e[a].safeBags[s];void 0!==n&&o.type!==n||(null!==t?void 0!==o.attributes[t]&&o.attributes[t].indexOf(r)>=0&&i.push(o):i.push(o))}return i}function h(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,t){var r={},s=[];if(!i.validate(e,n.pkcs7.asn1.encryptedDataValidator,r,s))throw(o=new Error("Cannot read EncryptedContentInfo.")).errors=s,o;var o,u=i.derToOid(r.contentType);if(u!==a.oids.data)throw(o=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=u,o;u=i.derToOid(r.encAlgorithm);var c=a.pbe.getCipher(u,r.encParameter,t),l=h(r.encryptedContentAsn1),f=n.util.createBuffer(l.value);if(c.update(f),!c.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return c.output.getBytes()}function y(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],s=0;s<e.value.length;s++){var o=e.value[s],u={},l=[];if(!i.validate(o,c,u,l))throw(v=new Error("Cannot read SafeBag.")).errors=l,v;var p,h,d={type:i.derToOid(u.bagId),attributes:g(u.bagAttributes)};n.push(d);var y=u.bagValue.value[0];switch(d.type){case a.oids.pkcs8ShroudedKeyBag:if(null===(y=a.decryptPrivateKeyInfo(y,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case a.oids.keyBag:try{d.key=a.privateKeyFromAsn1(y)}catch(e){d.key=null,d.asn1=y}continue;case a.oids.certBag:p=f,h=function(){if(i.derToOid(u.certId)!==a.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(u.certId),e}var r=i.fromDer(u.cert,t);try{d.cert=a.certificateFromAsn1(r,!0)}catch(e){d.cert=null,d.asn1=r}};break;default:var v;throw(v=new Error("Unsupported PKCS#12 SafeBag type.")).oid=d.type,v}if(void 0!==p&&!i.validate(y,p,u,l))throw(v=new Error("Cannot read PKCS#12 "+p.name)).errors=l,v;h()}return n}function g(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},s=[];if(!i.validate(e[r],l,n,s)){var o=new Error("Cannot read PKCS#12 BagAttribute.");throw o.errors=s,o}var u=i.derToOid(n.oid);if(void 0!==a.oids[u]){t[a.oids[u]]=[];for(var c=0;c<n.values.length;++c)t[a.oids[u]].push(n.values[c].value)}}return t}s.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var c={};if(!i.validate(e,u,c,[]))throw(l=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=l,l;var l,f={version:c.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=n.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=p(f.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=p(f.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=p(f.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return p(f.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return p(f.safeContents,"localKeyId",e,t)}};if(3!==c.version.charCodeAt(0))throw(l=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=c.version.charCodeAt(0),l;if(i.derToOid(c.contentType)!==a.oids.data)throw(l=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=i.derToOid(c.contentType),l;var g=c.content.value[0];if(g.tagClass!==i.Class.UNIVERSAL||g.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(g=h(g),c.mac){var v=null,m=0,C=i.derToOid(c.macAlgorithm);switch(C){case a.oids.sha1:v=n.md.sha1.create(),m=20;break;case a.oids.sha256:v=n.md.sha256.create(),m=32;break;case a.oids.sha384:v=n.md.sha384.create(),m=48;break;case a.oids.sha512:v=n.md.sha512.create(),m=64;break;case a.oids.md5:v=n.md.md5.create(),m=16}if(null===v)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+C);var E=new n.util.ByteBuffer(c.macSalt),S="macIterations"in c?parseInt(n.util.bytesToHex(c.macIterations),16):1,b=s.generateKey(r,E,3,S,m,v),T=n.hmac.create();if(T.start(v,b),T.update(g.value),T.getMac().getBytes()!==c.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,t,r,n){if((t=i.fromDer(t,r)).tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var s=0;s<t.value.length;s++){var u=t.value[s],c={},l=[];if(!i.validate(u,o,c,l))throw(v=new Error("Cannot read ContentInfo.")).errors=l,v;var f={encrypted:!1},p=null,g=c.content.value[0];switch(i.derToOid(c.contentType)){case a.oids.data:if(g.tagClass!==i.Class.UNIVERSAL||g.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");p=h(g).value;break;case a.oids.encryptedData:p=d(g,n),f.encrypted=!0;break;default:var v;throw(v=new Error("Unsupported PKCS#12 contentType.")).contentType=i.derToOid(c.contentType),v}f.safeBags=y(p,r,n),e.safeContents.push(f)}}(f,g.value,t,r),f},s.toPkcs12Asn1=function(e,t,r,o){(o=o||{}).saltSize=o.saltSize||8,o.count=o.count||2048,o.algorithm=o.algorithm||o.encAlgorithm||"aes128","useMac"in o||(o.useMac=!0),"localKeyId"in o||(o.localKeyId=null),"generateLocalKeyId"in o||(o.generateLocalKeyId=!0);var u,c=o.localKeyId;if(null!==c)c=n.util.hexToBytes(c);else if(o.generateLocalKeyId)if(t){var l=n.util.isArray(t)?t[0]:t;"string"==typeof l&&(l=a.certificateFromPem(l)),(w=n.md.sha1.create()).update(i.toDer(a.certificateToAsn1(l)).getBytes()),c=w.digest().getBytes()}else c=n.random.getBytes(20);var f=[];null!==c&&f.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,c)])])),"friendlyName"in o&&f.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,o.friendlyName)])])),f.length>0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var p=[],h=[];null!==t&&(h=n.util.isArray(t)?t:[t]);for(var d=[],y=0;y<h.length;++y){"string"==typeof(t=h[y])&&(t=a.certificateFromPem(t));var g=0===y?u:void 0,v=a.certificateToAsn1(t),m=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(v).getBytes())])])]),g]);d.push(m)}if(d.length>0){var C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(C).getBytes())])]);p.push(E)}var S=null;if(null!==e){var b=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[b]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(b,r,o)]),u]);var T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(T).getBytes())])]);p.push(A)}var I,B=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,p);if(o.useMac){var w=n.md.sha1.create(),k=new n.util.ByteBuffer(n.random.getBytes(o.saltSize)),N=o.count,R=(e=s.generateKey(r,k,3,N,20),n.hmac.create());R.start(w,e),R.update(i.toDer(B).getBytes());var _=R.getMac();I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,_.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,k.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(N).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(B).getBytes())])]),I])},s.generateKey=n.pbe.generatePkcs12Key},1559:(e,t,r)=>{var n=r(7768);r(1482),r(2624),r(2023),r(2884),r(5477),r(8989),r(4097),r(3103),r(6446);var i=n.asn1,a=e.exports=n.pkcs7=n.pkcs7||{};function s(e){var t={},r=[];if(!i.validate(e,a.asn1.recipientInfoValidator,t,r)){var s=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw s.errors=r,s}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function o(e){for(var t,r=[],a=0;a<e.length;++a)r.push((t=e[a],i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:t.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(t.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}function u(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a<e.unauthenticatedAttributes.length;++a){var s=e.unauthenticatedAttributes[a];r.values.push(c(s))}t.value.push(r)}return t}function c(e){var t;if(e.type===n.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),a=new Date("2050-01-01T00:00:00Z"),s=e.value;if("string"==typeof s){var o=Date.parse(s);s=isNaN(o)?13===s.length?i.utcTimeToDate(s):i.generalizedTimeToDate(s):new Date(o)}t=s>=r&&s<a?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(s)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(s))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function l(e,t,r){var a={};if(!i.validate(t,r,a,[])){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}if(i.derToOid(a.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(a.encryptedContent){var o="";if(n.util.isArray(a.encryptedContent))for(var u=0;u<a.encryptedContent.length;++u){if(a.encryptedContent[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=a.encryptedContent[u].value}else o=a.encryptedContent;e.encryptedContent={algorithm:i.derToOid(a.encAlgorithm),parameter:n.util.createBuffer(a.encParameter.value),content:n.util.createBuffer(o)}}if(a.content){if(o="",n.util.isArray(a.content))for(u=0;u<a.content.length;++u){if(a.content[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=a.content[u].value}else o=a.content;e.content=n.util.createBuffer(o)}return e.version=a.version.charCodeAt(0),e.rawCapture=a,a}function f(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}a.messageFromPem=function(e){var t=n.pem.decode(e)[0];if("PKCS7"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return a.messageFromAsn1(s)},a.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:t})},a.messageFromAsn1=function(e){var t={},r=[];if(!i.validate(e,a.asn1.contentInfoValidator,t,r)){var s=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw s.errors=r,s}var o,u=i.derToOid(t.contentType);switch(u){case n.pki.oids.envelopedData:o=a.createEnvelopedData();break;case n.pki.oids.encryptedData:o=a.createEncryptedData();break;case n.pki.oids.signedData:o=a.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+u+" is not (yet) supported.")}return o.fromAsn1(t.content.value[0]),o},a.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(l(e,t,a.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(n.pki.certificateToAsn1(e.certificates[r]));var a=[],s=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),a.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,a)),s.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var a=t.certificate;"string"==typeof a&&(a=n.pki.certificateFromPem(a)),r=a.issuer.attributes,i=a.serialNumber}var s=t.key;if(!s)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof s&&(s=n.pki.privateKeyFromPem(s));var o=t.digestAlgorithm||n.pki.oids.sha1;switch(o){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var c=!1,l=!1,f=0;f<u.length;++f){var p=u[f];if(c||p.type!==n.pki.oids.contentType){if(l||p.type!==n.pki.oids.messageDigest);else if(l=!0,c)break}else if(c=!0,l)break}if(!c||!l)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:s,version:1,issuer:r,serialNumber:i,digestAlgorithm:o,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(t){var r;t=t||{},("object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof n.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=n.util.encodeUtf8(e.content)),t.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)])))),0!==e.signers.length&&function(t){var r;if(!(r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0]))throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var a=i.derToOid(e.contentInfo.value[0].value),s=i.toDer(r);for(var o in s.getByte(),i.getBerValueLength(s),s=s.getBytes(),t)t[o].start().update(s);for(var l=new Date,f=0;f<e.signers.length;++f){var p=e.signers[f];if(0===p.authenticatedAttributes.length){if(a!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{p.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var h=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),d=0;d<p.authenticatedAttributes.length;++d){var y=p.authenticatedAttributes[d];y.type===n.pki.oids.messageDigest?y.value=t[p.digestAlgorithm].digest():y.type===n.pki.oids.signingTime&&(y.value||(y.value=l)),h.value.push(c(y)),p.authenticatedAttributesAsn1.value.push(c(y))}s=i.toDer(h).getBytes(),p.md.start().update(s)}p.signature=p.key.sign(p.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(u(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var a=e.signers[r];(s=a.digestAlgorithm)in t||(t[s]=n.md[n.pki.oids[s]].create()),0===a.authenticatedAttributes.length?a.md=t[s]:a.md=n.md[n.pki.oids[s]].create()}for(var s in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},a.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){l(e,t,a.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),f(e)}}},a.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=l(e,t,a.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(s(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,o(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(t=e.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.parameter.getBytes())]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])]);var t},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===r.length){for(var s=!0,o=0;o<r.length;++o)if(a[o].type!==r[o].type||a[o].value!==r[o].value){s=!1;break}if(s)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}f(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var i,a,s;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,a=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,a=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,a=16,s=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,a=8,s=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(a));var o=s(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var u=0;u<e.recipients.length;++u){var c=e.recipients[u];if(void 0===c.encryptedContent.content)switch(c.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}}}},8989:(e,t,r)=>{var n=r(7768);r(2624),r(3103);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};a.contentInfoValidator=s;var o={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};a.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},a.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};a.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},a.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},4885:(e,t,r)=>{var n=r(7768);r(2624),r(2884),r(6635),r(5477),r(9580),r(779),r(665),r(144),r(3103),r(6446);var i=n.asn1,a=e.exports=n.pki=n.pki||{};a.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},a.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return a.privateKeyFromAsn1(s)},a.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(a.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},8547:(e,t,r)=>{var n=r(7768);r(3103),r(1633),r(4097),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],a=new r(null);a.fromInt(30);var s=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var a=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof a&&(a={name:a}),a.options=a.options||{};var s=t.prng||n.random,u={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===a.name)return function(e,t,i,a){return"workers"in i?function(e,t,i,a){if("undefined"==typeof Worker)return o(e,t,i,a);var s=c(e,t),u=i.workers,l=i.workLoad||100,f=30*l/8,p=i.workerScript||"forge/prime.worker.js";if(-1===u)return n.util.estimateCores((function(e,t){e&&(t=2),u=t-1,h()}));function h(){u=Math.max(1,u);for(var n=[],i=0;i<u;++i)n[i]=new Worker(p);for(i=0;i<u;++i)n[i].addEventListener("message",h);var o=!1;function h(i){if(!o){var u=i.data;if(u.found){for(var p=0;p<n.length;++p)n[p].terminate();return o=!0,a(null,new r(u.prime,16))}s.bitLength()>e&&(s=c(e,t));var h=s.toString(16);i.target.postMessage({hex:h,workLoad:l}),s.dAddOffset(f,0)}}}h()}(e,t,i,a):o(e,t,i,a)}(e,u,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function o(e,t,r,n){var i=c(e,t),a=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var s=10;"maxBlockTime"in r&&(s=r.maxBlockTime),u(i,e,t,0,a,s,n)}function u(e,t,r,a,s,o,l){var f=+new Date;do{if(e.bitLength()>t&&(e=c(t,r)),e.isProbablePrime(s))return l(null,e);e.dAddOffset(i[a++%8],0)}while(o<0||+new Date-f<o);n.util.setImmediate((function(){u(e,t,r,a,s,o,l)}))}function c(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),s,n),n.dAddOffset(31-n.mod(a).byteValue(),0),n}}()},3930:(e,t,r)=>{var n=r(7768);r(3103);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(3906)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,a=new Array(32),s=0;s<32;++s)a[s]=r.create();function o(){if(t.pools[0].messageLength>=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var a=n.util.createBuffer();if(t)for(;a.length()<e;){var s=Math.max(1,Math.min(e-a.length(),65536)/4),o=new Uint32Array(Math.floor(s));try{t(o);for(var u=0;u<o.length;++u)a.putInt32(o[u])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(a.length()<e)for(var c,l,f,p=Math.floor(65536*Math.random());a.length()<e;)for(l=16807*(65535&p),l+=(32767&(c=16807*(p>>16)))<<16,p=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31)),u=0;u<3;++u)f=p>>>(u<<3),f^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&f));return a.getBytes(e)}return t.pools=a,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,a=t.plugin.increment,s=t.plugin.formatKey,o=t.plugin.formatSeed,c=n.util.createBuffer();t.key=null,function l(f){if(f)return r(f);if(c.length()>=e)return r(null,c.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}(l)}));var p=i(t.key,t.seed);t.generated+=p.length,c.putBytes(p),t.key=s(i(t.key,a(t.seed))),t.seed=o(i(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&o();var c=r(t.key,t.seed);t.generated+=c.length,u.putBytes(c),t.key=a(r(t.key,i(t.seed))),t.seed=s(r(t.key,t.seed))}return u.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){e===self?t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))},t}},665:(e,t,r)=>{var n=r(7768);r(4097),r(3103),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,s=e.salt||null;if("string"==typeof s&&(s=n.util.createBuffer(s)),"saltLength"in e)t=e.saltLength;else{if(null===s)throw new Error("Salt length not specified or specific salt not given.");t=s.length()}if(null!==s&&s.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||n.random,u={encode:function(e,u){var c,l,f=u-1,p=Math.ceil(f/8),h=e.digest().getBytes();if(p<a+t+2)throw new Error("Message is too long to encrypt.");l=null===s?o.getBytesSync(t):s.bytes();var d=new n.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(h),d.putBytes(l),r.start(),r.update(d.getBytes());var y=r.digest().getBytes(),g=new n.util.ByteBuffer;g.fillWithByte(0,p-t-a-2),g.putByte(1),g.putBytes(l);var v=g.getBytes(),m=p-a-1,C=i.generate(y,m),E="";for(c=0;c<m;c++)E+=String.fromCharCode(v.charCodeAt(c)^C.charCodeAt(c));var S=65280>>8*p-f&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,s,o){var u,c=o-1,l=Math.ceil(c/8);if(s=s.substr(-l),l<a+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==s.charCodeAt(l-1))throw new Error("Encoded message does not end in 0xBC.");var f=l-a-1,p=s.substr(0,f),h=s.substr(f,a),d=65280>>8*l-c&255;if(0!=(p.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(h,f),g="";for(u=0;u<f;u++)g+=String.fromCharCode(p.charCodeAt(u)^y.charCodeAt(u));g=String.fromCharCode(g.charCodeAt(0)&~d)+g.substr(1);var v=l-a-t-2;for(u=0;u<v;u++)if(0!==g.charCodeAt(u))throw new Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(v))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var m=g.substr(-t),C=new n.util.ByteBuffer;return C.fillWithByte(0,8),C.putBytes(e),C.putBytes(m),r.start(),r.update(C.getBytes()),h===r.digest().getBytes()}};return u}},4097:(e,t,r)=>{var n=r(7768);r(1482),r(9141),r(3930),r(3103),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),a=n.util.createBuffer();function s(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),a.putInt32(i[0]),a.putInt32(i[1]),a.putInt32(i[2]),a.putInt32(i[3]),a.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var o=s(),u=null,c=n.util.globalScope,l=c.crypto||c.msCrypto;if(l&&l.getRandomValues&&(u=function(e){return l.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"==typeof window||window.document,o.collectInt(+new Date,32),"undefined"!=typeof navigator){var f="";for(var p in navigator)try{"string"==typeof navigator[p]&&(f+=navigator[p])}catch(e){}o.collect(f),f=null}t&&(t().mousemove((function(e){o.collectInt(e.clientX,16),o.collectInt(e.clientY,16)})),t().keypress((function(e){o.collectInt(e.charCode,8)})))}if(n.random)for(var p in o)n.random[p]=o[p];else n.random=o;n.random.createInstance=s,e.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},3323:(e,t,r)=>{var n=r(7768);r(3103);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],a=[1,2,3,5],s=function(e,t){return e<<t&65535|(65535&e)>>16-t},o=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,a=e,s=e.length(),o=t,u=Math.ceil(o/8),c=255>>(7&o);for(r=s;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-s)&255]);for(a.setAt(128-u,i[a.at(128-u)&c]),r=127-u;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+u)]);return a};var u=function(e,t,r){var i,u,c,l,f=!1,p=null,h=null,d=null,y=[];for(e=n.rc2.expandKey(e,t),c=0;c<64;c++)y.push(e.getInt16Le());r?(i=function(e){for(c=0;c<4;c++)e[c]+=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),e[c]=s(e[c],a[c]),l++},u=function(e){for(c=0;c<4;c++)e[c]+=y[63&e[(c+3)%4]]}):(i=function(e){for(c=3;c>=0;c--)e[c]=o(e[c],a[c]),e[c]-=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),l--},u=function(e){for(c=3;c>=0;c--)e[c]-=y[63&e[(c+3)%4]]});var g=function(e){var t=[];for(c=0;c<4;c++){var n=p.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i<e.length;i++)for(var a=0;a<e[i][0];a++)e[i][1](t);for(c=0;c<4;c++)null!==d&&(r?d.putInt16Le(t[c]):t[c]^=d.getInt16Le()),h.putInt16Le(t[c])},v=null;return v={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),f=!1,p=n.util.createBuffer(),h=t||new n.util.createBuffer,d=e,v.output=h},update:function(e){for(f||p.putBuffer(e);p.length()>=8;)g([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,p,!r);else{var n=8===p.length()?8:8-p.length();p.fillWithByte(n,n)}if(t&&(f=!0,v.update()),!r&&(t=0===p.length()))if(e)t=e(8,h,!r);else{var i=h.length(),a=h.at(i-1);a>i?t=!1:h.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},144:(e,t,r)=>{var n=r(7768);if(r(2624),r(1633),r(2884),r(4034),r(8547),r(4097),r(3103),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(3906):null,s=n.asn1,o=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},p={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},h=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=s.oidToDer(t).getBytes(),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),a=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);a.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,n)),a.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(o),s.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var a;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var s=(e=e.multiply(a.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);s.compareTo(o)<0;)s=s.add(t.p);var u=s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return u.multiply(a.modInverse(t.n)).mod(t.n)};function g(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=e.length,s.max=a-11,s}i.putByte(0),i.putByte(r);var o,u=a-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var c=0;c<u;++c)i.putByte(o)}else for(;u>0;){var l=0,f=n.random.getBytes(u);for(c=0;c<u;++c)0===(o=f.charCodeAt(c))?++l:i.putByte(o);u=l}return i.putByte(0),i.putBytes(e),i}function v(e,t,r,i){var a=Math.ceil(t.n.bitLength()/8),s=n.util.createBuffer(e),o=s.getByte(),u=s.getByte();if(0!==o||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&void 0===i)throw new Error("Encryption block is invalid.");var c=0;if(0===u){c=a-3-i;for(var l=0;l<c;++l)if(0!==s.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(c=0;s.length()>1;){if(255!==s.getByte()){--s.read;break}++c}else if(2===u)for(c=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++c}if(0!==s.getByte()||c!==a-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function m(e,t,r){"function"==typeof t&&(r=t,t={});var a={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function s(){o(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void o(e.qBits,c))}))}function o(e,t){n.prime.generateProbablePrime(e,a,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void s();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void o(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void s();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void o(e.qBits,c);var l=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(a.prng=t.prng),s()}function C(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof a[e]}function b(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[e]}function T(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[e]}function A(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}u.rsa.encrypt=function(e,t,r){var a,s=r,o=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(s=2===r,a=g(e,t,r)):(a=n.util.createBuffer()).putBytes(e);for(var u=new i(a.toHex(),16),c=y(u,t,s).toString(16),l=n.util.createBuffer(),f=o-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),l.getBytes()},u.rsa.decrypt=function(e,t,r,a){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var o=new Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=s,o}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=y(u,t,r).toString(16),l=n.util.createBuffer(),f=s-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),!1!==a?v(l.getBytes(),t,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var a,s=(r=r||{}).prng||n.random,o={nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},u=r.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(a={algorithm:u,state:0,bits:e,rng:o,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,s=function(e,t){return e|t},o=+new Date,l=0;null===e.keys&&(t<=0||l<t);){if(0===e.state){var f=null===e.p?e.pBits:e.qBits,p=f-1;0===e.pqState?(e.num=new i(f,e.rng),e.num.testBit(p)||e.num.bitwiseTo(i.ONE.shiftLeft(p),s,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),a=0,++e.pqState):1===e.pqState?e.num.bitLength()>f?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[a++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var h=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-o,o=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(i=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(i=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(b("generateKey")&&b("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return o.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(T("generateKey")&&T("exportKey")){var c=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(S("generateKeyPairSync")){var l=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(l.privateKey),publicKey:u.publicKeyFromPem(l.publicKey)}}var f=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(f,0),f.keys;m(f,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return g(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var a=t.encode(e,r,!0);return u.rsa.encrypt(a,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=v(t,r,!0),e===s.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===v(t,r,!0)}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,a,s,o,c){var l={n:e,e:t,d:r,p:i,q:a,dP:s,dQ:o,qInv:c,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:v};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return u.rsa.encrypt(n,l,r)}};return l},u.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(u.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,a,o,c,p,h,d,y={},g=[];if(s.validate(e,l,y,g)&&(e=s.fromDer(n.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(e,f,y,g)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=g,v}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),o=n.util.createBuffer(y.privateKeyPrime1).toHex(),c=n.util.createBuffer(y.privateKeyPrime2).toHex(),p=n.util.createBuffer(y.privateKeyExponent1).toHex(),h=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(o,16),new i(c,16),new i(p,16),new i(h,16),new i(d,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,h,t,r)){var a,o=s.derToOid(t.publicKeyOid);if(o!==u.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=o,a;e=t.rsaPublicKey}if(r=[],!s.validate(e,p,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(l,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(u.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.e))])}},2936:(e,t,r)=>{var n=r(7768);r(6067),r(3103);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){s||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(a,s){"utf8"===s&&(a=n.util.encodeUtf8(a));var u=a.length;i.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(u=8*i.fullMessageLength[f+1])/4294967296>>>0,s.putInt32(l>>>0),l=u>>>0;s.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(p,r,s);var h=n.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h},i};var a=null,s=!1;function o(e,t,r){for(var n,i,a,s,o,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,s=e.h2,o=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(o^a&(s^o))+u+1518500249+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(o^a&(s^o))+u+1518500249+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(a^s^o)+u+1859775393+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^s^o)+u+1859775393+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a&s|o&(a^s))+u+2400959708+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^s^o)+u+3395469782+n,u=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+u|0,l-=64}}},9141:(e,t,r)=>{var n=r(7768);r(6067),r(3103);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){s||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=[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],s=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(a,s){"utf8"===s&&(a=n.util.encodeUtf8(a));var o=a.length;i.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=o[1],o[1]=o[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(t.bytes());var o,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(o=8*i.fullMessageLength[f+1])/4294967296>>>0,s.putInt32(l>>>0),l=o>>>0;s.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(p,r,s);var h=n.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h.putInt32(p.h5),h.putInt32(p.h6),h.putInt32(p.h7),h},i};var a=null,s=!1,o=null;function u(e,t,r){for(var n,i,a,s,u,c,l,f,p,h,d,y,g,v=r.length();v>=64;){for(u=0;u<16;++u)t[u]=r.getInt32();for(;u<64;++u)n=((n=t[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=n+t[u-7]+i+t[u-16]|0;for(c=e.h0,l=e.h1,f=e.h2,p=e.h3,h=e.h4,d=e.h5,y=e.h6,g=e.h7,u=0;u<64;++u)a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),s=c&l|f&(c^l),n=g+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(y^h&(d^y))+o[u]+t[u],g=y,y=d,d=h,h=p+n>>>0,p=f,f=l,l=c,c=n+(i=a+s)>>>0;e.h0=e.h0+c|0,e.h1=e.h1+l|0,e.h2=e.h2+f|0,e.h3=e.h3+p|0,e.h4=e.h4+h|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+g|0,v-=64}}},8672:(e,t,r)=>{var n=r(7768);r(6067),r(3103);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var a=n.sha384=n.sha512.sha384=n.sha512.sha384||{};a.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=a,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(o||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),128),u=[[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]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],o=!0),void 0===e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),a=new Array(80),f=0;f<80;++f)a[f]=new Array(2);var p=64;switch(e){case"SHA-384":p=48;break;case"SHA-512/256":p=32;break;case"SHA-512/224":p=28}var h={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:p,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){h.messageLength=0,h.fullMessageLength=h.messageLength128=[];for(var e=h.messageLengthSize/4,a=0;a<e;++a)h.fullMessageLength.push(0);for(i=n.util.createBuffer(),r=new Array(t.length),a=0;a<t.length;++a)r[a]=t[a].slice(0);return h}};return h.start(),h.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var s=e.length;h.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=h.fullMessageLength.length-1;o>=0;--o)h.fullMessageLength[o]+=s[1],s[1]=s[0]+(h.fullMessageLength[o]/4294967296>>>0),h.fullMessageLength[o]=h.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return i.putBytes(e),l(r,a,i),(i.read>2048||0===i.length())&&i.compact(),h},h.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var o,u=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;t.putBytes(s.substr(0,h.blockLength-u));for(var c=8*h.fullMessageLength[0],f=0;f<h.fullMessageLength.length-1;++f)c+=(o=8*h.fullMessageLength[f+1])/4294967296>>>0,t.putInt32(c>>>0),c=o>>>0;t.putInt32(c);var p=new Array(r.length);for(f=0;f<r.length;++f)p[f]=r[f].slice(0);l(p,a,t);var d,y=n.util.createBuffer();for(d="SHA-512"===e?p.length:"SHA-384"===e?p.length-2:p.length-4,f=0;f<d;++f)y.putInt32(p[f][0]),f===d-1&&"SHA-512/224"===e||y.putInt32(p[f][1]);return y},h};var s=null,o=!1,u=null,c=null;function l(e,t,r){for(var n,i,a,s,o,c,l,f,p,h,d,y,g,v,m,C,E,S,b,T,A,I,B,w,k,N,R,_,L,U,D,P,O,V=r.length();V>=128;){for(R=0;R<16;++R)t[R][0]=r.getInt32()>>>0,t[R][1]=r.getInt32()>>>0;for(;R<80;++R)n=(((_=(U=t[R-2])[0])>>>19|(L=U[1])<<13)^(L>>>29|_<<3)^_>>>6)>>>0,i=((_<<13|L>>>19)^(L<<3|_>>>29)^(_<<26|L>>>6))>>>0,a=(((_=(P=t[R-15])[0])>>>1|(L=P[1])<<31)^(_>>>8|L<<24)^_>>>7)>>>0,s=((_<<31|L>>>1)^(_<<24|L>>>8)^(_<<25|L>>>7))>>>0,D=t[R-7],O=t[R-16],L=i+D[1]+s+O[1],t[R][0]=n+D[0]+a+O[0]+(L/4294967296>>>0)>>>0,t[R][1]=L>>>0;for(d=e[0][0],y=e[0][1],g=e[1][0],v=e[1][1],m=e[2][0],C=e[2][1],E=e[3][0],S=e[3][1],b=e[4][0],T=e[4][1],A=e[5][0],I=e[5][1],B=e[6][0],w=e[6][1],k=e[7][0],N=e[7][1],R=0;R<80;++R)l=((b>>>14|T<<18)^(b>>>18|T<<14)^(T>>>9|b<<23))>>>0,f=(B^b&(A^B))>>>0,o=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,c=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,p=(d&g|m&(d^g))>>>0,h=(y&v|C&(y^v))>>>0,L=N+(((b<<18|T>>>14)^(b<<14|T>>>18)^(T<<23|b>>>9))>>>0)+((w^T&(I^w))>>>0)+u[R][1]+t[R][1],n=k+l+f+u[R][0]+t[R][0]+(L/4294967296>>>0)>>>0,i=L>>>0,a=o+p+((L=c+h)/4294967296>>>0)>>>0,s=L>>>0,k=B,N=w,B=A,w=I,A=b,I=T,b=E+n+((L=S+i)/4294967296>>>0)>>>0,T=L>>>0,E=m,S=C,m=g,C=v,g=d,v=y,d=n+a+((L=i+s)/4294967296>>>0)>>>0,y=L>>>0;L=e[0][1]+y,e[0][0]=e[0][0]+d+(L/4294967296>>>0)>>>0,e[0][1]=L>>>0,L=e[1][1]+v,e[1][0]=e[1][0]+g+(L/4294967296>>>0)>>>0,e[1][1]=L>>>0,L=e[2][1]+C,e[2][0]=e[2][0]+m+(L/4294967296>>>0)>>>0,e[2][1]=L>>>0,L=e[3][1]+S,e[3][0]=e[3][0]+E+(L/4294967296>>>0)>>>0,e[3][1]=L>>>0,L=e[4][1]+T,e[4][0]=e[4][0]+b+(L/4294967296>>>0)>>>0,e[4][1]=L>>>0,L=e[5][1]+I,e[5][0]=e[5][0]+A+(L/4294967296>>>0)>>>0,e[5][1]=L>>>0,L=e[6][1]+w,e[6][0]=e[6][0]+B+(L/4294967296>>>0)>>>0,e[6][1]=L>>>0,L=e[7][1]+N,e[7][0]=e[7][0]+k+(L/4294967296>>>0)>>>0,e[7][1]=L>>>0,V-=128}}},2676:(e,t,r)=>{var n=r(7768);r(1482),r(7461),r(4581),r(2936),r(3103);var i=e.exports=n.ssh=n.ssh||{};function a(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var i=n.util.hexToBytes(r);e.putInt32(i.length),e.putBytes(i)}function s(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}i.privateKeyToPutty=function(e,t,r){var i="ssh-rsa",u=""===(t=t||"")?"none":"aes256-cbc",c="PuTTY-User-Key-File-2: ssh-rsa\r\n";c+="Encryption: "+u+"\r\n",c+="Comment: "+(r=r||"")+"\r\n";var l=n.util.createBuffer();s(l,i),a(l,e.e),a(l,e.n);var f=n.util.encode64(l.bytes(),64),p=Math.floor(f.length/66)+1;c+="Public-Lines: "+p+"\r\n",c+=f;var h,d=n.util.createBuffer();if(a(d,e.d),a(d,e.p),a(d,e.q),a(d,e.qInv),t){var y=d.length()+16-1;y-=y%16;var g=o(d.bytes());g.truncate(g.length()-y+d.length()),d.putBuffer(g);var v=n.util.createBuffer();v.putBuffer(o("\0\0\0\0",t)),v.putBuffer(o("\0\0\0",t));var m=n.aes.createEncryptionCipher(v.truncate(8),"CBC");m.start(n.util.createBuffer().fillWithByte(0,16)),m.update(d.copy()),m.finish();var C=m.output;C.truncate(16),h=n.util.encode64(C.bytes(),64)}else h=n.util.encode64(d.bytes(),64);c+="\r\nPrivate-Lines: "+(p=Math.floor(h.length/66)+1)+"\r\n",c+=h;var E=o("putty-private-key-file-mac-key",t),S=n.util.createBuffer();s(S,i),s(S,u),s(S,r),S.putInt32(l.length()),S.putBuffer(l),S.putInt32(d.length()),S.putBuffer(d);var b=n.hmac.create();return b.start("sha1",E),b.update(S.bytes()),c+"\r\nPrivate-MAC: "+b.digest().toHex()+"\r\n"},i.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var i=n.util.createBuffer();return s(i,r),a(i,e.e),a(i,e.n),r+" "+n.util.encode64(i.bytes())+" "+t},i.privateKeyToOpenSSH=function(e,t){return t?n.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):n.pki.privateKeyToPem(e)},i.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||n.md.md5.create(),i=n.util.createBuffer();s(i,"ssh-rsa"),a(i,e.e),a(i,e.n),r.start(),r.update(i.getBytes());var o=r.digest();if("hex"===t.encoding){var u=o.toHex();return t.delimiter?u.match(/.{2}/g).join(t.delimiter):u}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return o}},2073:(e,t,r)=>{var n=r(7768);r(4401),r(7316),r(3103);var i="forge.task",a={},s=0;n.debug.set(i,"tasks",a);var o={};n.debug.set(i,"queues",o);var u="ready",c="running",l="blocked",f="sleeping",p="done",h="error",d={ready:{}};d.ready.stop=u,d.ready.start=c,d.ready.cancel=p,d.ready.fail=h,d.running={},d.running.stop=u,d.running.start=c,d.running.block=l,d.running.unblock=c,d.running.sleep=f,d.running.wakeup=c,d.running.cancel=p,d.running.fail=h,d.blocked={},d.blocked.stop=l,d.blocked.start=l,d.blocked.block=l,d.blocked.unblock=l,d.blocked.sleep=l,d.blocked.wakeup=l,d.blocked.cancel=p,d.blocked.fail=h,d.sleeping={},d.sleeping.stop=f,d.sleeping.start=f,d.sleeping.block=f,d.sleeping.unblock=f,d.sleeping.sleep=f,d.sleeping.wakeup=f,d.sleeping.cancel=p,d.sleeping.fail=h,d.done={},d.done.stop=p,d.done.start=p,d.done.block=p,d.done.unblock=p,d.done.sleep=p,d.done.wakeup=p,d.done.cancel=p,d.done.fail=h,d.error={},d.error.stop=h,d.error.start=h,d.error.block=h,d.error.unblock=h,d.error.sleep=h,d.error.wakeup=h,d.error.cancel=h,d.error.fail=h;var y=function(e){this.id=-1,this.name=e.name||"?",this.parent=e.parent||null,this.run=e.run,this.subtasks=[],this.error=!1,this.state=u,this.blocks=0,this.timeoutId=null,this.swapTime=null,this.userData=null,this.id=s++,a[this.id]=this};y.prototype.debug=function(e){e=e||"",n.log.debug(i,e,"[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",o)},y.prototype.next=function(e,t){"function"==typeof e&&(t=e,e=this.name);var r=new y({run:t,name:e,parent:this});return r.state=c,r.type=this.type,r.successCallback=this.successCallback||null,r.failureCallback=this.failureCallback||null,this.subtasks.push(r),this},y.prototype.parallel=function(e,t){return n.util.isArray(e)&&(t=e,e=this.name),this.next(e,(function(r){var i=r;i.block(t.length);for(var a=function(e,r){n.task.start({type:e,run:function(e){t[r](e)},success:function(e){i.unblock()},failure:function(e){i.unblock()}})},s=0;s<t.length;s++)a(e+"__parallel-"+r.id+"-"+s,s)}))},y.prototype.stop=function(){this.state=d[this.state].stop},y.prototype.start=function(){this.error=!1,this.state=d[this.state].start,this.state===c&&(this.start=new Date,this.run(this),g(this,0))},y.prototype.block=function(e){e=void 0===e?1:e,this.blocks+=e,this.blocks>0&&(this.state=d[this.state].block)},y.prototype.unblock=function(e){return e=void 0===e?1:e,this.blocks-=e,0===this.blocks&&this.state!==p&&(this.state=c,g(this,0)),this.blocks},y.prototype.sleep=function(e){e=void 0===e?0:e,this.state=d[this.state].sleep;var t=this;this.timeoutId=setTimeout((function(){t.timeoutId=null,t.state=c,g(t,0)}),e)},y.prototype.wait=function(e){e.wait(this)},y.prototype.wakeup=function(){this.state===f&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state=c,g(this,0))},y.prototype.cancel=function(){this.state=d[this.state].cancel,this.permitsNeeded=0,null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null),this.subtasks=[]},y.prototype.fail=function(e){if(this.error=!0,v(this,!0),e)e.error=this.error,e.swapTime=this.swapTime,e.userData=this.userData,g(e,0);else{if(null!==this.parent){for(var t=this.parent;null!==t.parent;)t.error=this.error,t.swapTime=this.swapTime,t.userData=this.userData,t=t.parent;v(t,!0)}this.failureCallback&&this.failureCallback(this)}};var g=function(e,t){var r=t>30||+new Date-e.swapTime>20,n=function(t){if(t++,e.state===c)if(r&&(e.swapTime=+new Date),e.subtasks.length>0){var n=e.subtasks.shift();n.error=e.error,n.swapTime=e.swapTime,n.userData=e.userData,n.run(n),n.error||g(n,t)}else v(e),e.error||null!==e.parent&&(e.parent.error=e.error,e.parent.swapTime=e.swapTime,e.parent.userData=e.userData,g(e.parent,t))};r?setTimeout(n,0):n(t)},v=function(e,t){e.state=p,delete a[e.id],null===e.parent&&(e.type in o?0===o[e.type].length?n.log.error(i,"[%s][%s] task queue empty [%s]",e.id,e.name,e.type):o[e.type][0]!==e?n.log.error(i,"[%s][%s] task not first in queue [%s]",e.id,e.name,e.type):(o[e.type].shift(),0===o[e.type].length?delete o[e.type]:o[e.type][0].start()):n.log.error(i,"[%s][%s] task queue missing [%s]",e.id,e.name,e.type),t||(e.error&&e.failureCallback?e.failureCallback(e):!e.error&&e.successCallback&&e.successCallback(e)))};e.exports=n.task=n.task||{},n.task.start=function(e){var t=new y({run:e.run,name:e.name||"?"});t.type=e.type,t.successCallback=e.success||null,t.failureCallback=e.failure||null,t.type in o?o[e.type].push(t):(o[t.type]=[t],function(e){e.error=!1,e.state=d[e.state].start,setTimeout((function(){e.state===c&&(e.swapTime=+new Date,e.run(e),g(e,0))}),0)}(t))},n.task.cancel=function(e){e in o&&(o[e]=[o[e][0]])},n.task.createCondition=function(){var e={tasks:{},wait:function(t){t.id in e.tasks||(t.block(),e.tasks[t.id]=t)},notify:function(){var t=e.tasks;for(var r in e.tasks={},t)t[r].unblock()}};return e}},8472:(e,t,r)=>{var n=r(7768);r(2624),r(7461),r(4581),r(5477),r(4885),r(4097),r(2936),r(3103);var i=function(e,t,r,i){var a=n.util.createBuffer(),s=e.length>>1,o=s+(1&e.length),u=e.substr(0,o),c=e.substr(s,o),l=n.util.createBuffer(),f=n.hmac.create();r=t+r;var p=Math.ceil(i/16),h=Math.ceil(i/20);f.start("MD5",u);var d=n.util.createBuffer();l.putBytes(r);for(var y=0;y<p;++y)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+r),d.putBuffer(f.digest());f.start("SHA1",c);var g=n.util.createBuffer();for(l.clear(),l.putBytes(r),y=0;y<h;++y)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+r),g.putBuffer(f.digest());return a.putBytes(n.util.xorBytes(d.getBytes(),g.getBytes(),i)),a},a=function(e,t,r){var i=!1;try{var a=e.deflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(a),t.length=a.length,i=!0}catch(e){}return i},s=function(e,t,r){var i=!1;try{var a=e.inflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(a),t.length=a.length,i=!0}catch(e){}return i},o=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return n.util.createBuffer(e.getBytes(r))},u=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},c={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};c.SupportedVersions=[c.Versions.TLS_1_1,c.Versions.TLS_1_0],c.Version=c.SupportedVersions[0],c.MaxFragment=15360,c.ConnectionEnd={server:0,client:1},c.PRFAlgorithm={tls_prf_sha256:0},c.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},c.CipherType={stream:0,block:1,aead:2},c.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},c.CompressionMethod={none:0,deflate:1},c.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},c.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},c.Alert={},c.Alert.Level={warning:1,fatal:2},c.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},c.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},c.CipherSuites={},c.getCipherSuite=function(e){var t=null;for(var r in c.CipherSuites){var n=c.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},c.handleUnexpected=function(e,t){!e.open&&e.entity===c.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unexpected_message}})},c.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(c.queue(e,c.createAlert(e,{level:c.Alert.Level.warning,description:c.Alert.Description.no_renegotiation})),c.flush(e)),e.process()},c.parseHelloMessage=function(e,t,r){var i=null,a=e.entity===c.ConnectionEnd.client;if(r<38)e.error(e,{message:a?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});else{var s=t.fragment,u=s.length();if(i={version:{major:s.getByte(),minor:s.getByte()},random:n.util.createBuffer(s.getBytes(32)),session_id:o(s,1),extensions:[]},a?(i.cipher_suite=s.getBytes(2),i.compression_method=s.getByte()):(i.cipher_suites=o(s,2),i.compression_methods=o(s,1)),(u=r-(u-s.length()))>0){for(var l=o(s,2);l.length()>0;)i.extensions.push({type:[l.getByte(),l.getByte()],data:o(l,2)});if(!a)for(var f=0;f<i.extensions.length;++f){var p=i.extensions[f];if(0===p.type[0]&&0===p.type[1])for(var h=o(p.data,2);h.length()>0&&0===h.getByte();)e.session.extensions.server_name.serverNameList.push(o(h,2).getBytes())}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});if(a)e.session.cipherSuite=c.getCipherSuite(i.cipher_suite);else for(var d=n.util.createBuffer(i.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=c.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});e.session.compressionMethod=a?i.compression_method:c.CompressionMethod.none}return i},c.createSecurityParameters=function(e,t){var r=e.entity===c.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,a=r?n:c.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:c.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:a}},c.handleServerHello=function(e,t,r){var n=c.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var i=n.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=d,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=l,e.session.resuming=!1,c.createSecurityParameters(e,n)),e.session.id=i,e.process()}},c.handleClientHello=function(e,t,r){var i=c.parseHelloMessage(e,t,r);if(!e.fail){var a=i.session_id.bytes(),s=null;if(e.sessionCache&&(null===(s=e.sessionCache.getSession(a))?a="":(s.version.major!==i.version.major||s.version.minor>i.version.minor)&&(s=null,a="")),0===a.length&&(a=n.random.getBytes(32)),e.session.id=a,e.session.clientHelloVersion=i.version,e.session.sp={},s)e.version=e.session.version=s.version,e.session.sp=s.sp;else{for(var o,u=1;u<c.SupportedVersions.length&&!((o=c.SupportedVersions[u]).minor<=i.version.minor);++u);e.version={major:o.major,minor:o.minor},e.session.version=e.version}null!==s?(e.expect=S,e.session.resuming=!0,e.session.sp.client_random=i.random.bytes()):(e.expect=!1!==e.verifyClient?m:C,e.session.resuming=!1,c.createSecurityParameters(e,i)),e.open=!0,c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createServerHello(e)})),e.session.resuming?(c.queue(e,c.createRecord(e,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),e.state.pending=c.createConnectionState(e),e.state.current.write=e.state.pending.write,c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createFinished(e)}))):(c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createCertificate(e)})),e.fail||(c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createServerKeyExchange(e)})),!1!==e.verifyClient&&c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createCertificateRequest(e)})),c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createServerHelloDone(e)})))),c.flush(e),e.process()}},c.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var i,a,s=t.fragment,u={certificate_list:o(s,3)},l=[];try{for(;u.certificate_list.length()>0;)i=o(u.certificate_list,3),a=n.asn1.fromDer(i),i=n.pki.certificateFromAsn1(a,!0),l.push(i)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate}})}var p=e.entity===c.ConnectionEnd.client;!p&&!0!==e.verifyClient||0!==l.length?0===l.length?e.expect=p?f:C:(p?e.session.serverCertificate=l[0]:e.session.clientCertificate=l[0],c.verifyCertificateChain(e,l)&&(e.expect=p?f:C)):e.error(e,{message:p?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}}),e.process()},c.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});e.expect=p,e.process()},c.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});var i=t.fragment,a={enc_pre_master_secret:o(i,2).getBytes()},s=null;if(e.getPrivateKey)try{s=e.getPrivateKey(e,e.session.serverCertificate),s=n.pki.privateKeyFromPem(s)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}})}if(null===s)return e.error(e,{message:"No private key set.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}});try{var u=e.session.sp;u.pre_master_secret=s.decrypt(a.enc_pre_master_secret);var l=e.session.clientHelloVersion;if(l.major!==u.pre_master_secret.charCodeAt(0)||l.minor!==u.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){u.pre_master_secret=n.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=E),e.process()},c.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:o(n,1),certificate_authorities:o(n,2)};e.session.certificateRequest=i,e.expect=h,e.process()},c.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var a=i.bytes();i.read+=4;var s={signature:o(i,2).getBytes()},u=n.util.createBuffer();u.putBuffer(e.session.md5.digest()),u.putBuffer(e.session.sha1.digest()),u=u.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(u,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(a),e.session.sha1.update(a)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure}})}e.expect=S,e.process()},c.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.insufficient_security}},a=e.verify(e,i.alert.description,0,[]);if(!0!==a)return(a||0===a)&&("object"!=typeof a||n.util.isArray(a)?"number"==typeof a&&(i.alert.description=a):(a.message&&(i.message=a.message),a.alert&&(i.alert.description=a.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=c.createRecord(e,{type:c.ContentType.handshake,data:c.createCertificate(e)}),c.queue(e,t)),t=c.createRecord(e,{type:c.ContentType.handshake,data:c.createClientKeyExchange(e)}),c.queue(e,t),e.expect=v;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createCertificateVerify(e,t)})),c.queue(e,c.createRecord(e,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),e.state.pending=c.createConnectionState(e),e.state.current.write=e.state.pending.write,c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createFinished(e)})),e.expect=d,c.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);c.getClientSignature(e,s)},c.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var r=e.entity===c.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=c.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?y:b,e.process()},c.handleFinished=function(e,t,r){var a=t.fragment;a.read-=4;var s=a.bytes();a.read+=4;var o=t.fragment.getBytes();(a=n.util.createBuffer()).putBuffer(e.session.md5.digest()),a.putBuffer(e.session.sha1.digest());var u=e.entity===c.ConnectionEnd.client,l=u?"server finished":"client finished",f=e.session.sp;if((a=i(f.master_secret,l,a.getBytes(),12)).getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&u||!e.session.resuming&&!u)&&(c.queue(e,c.createRecord(e,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createFinished(e)}))),e.expect=u?g:T,e.handshaking=!1,++e.handshakes,e.peerCertificate=u?e.session.serverCertificate:e.session.clientCertificate,c.flush(e),e.isConnected=!0,e.connected(e),e.process()},c.handleAlert=function(e,t){var r,n=t.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case c.Alert.Description.close_notify:r="Connection closed.";break;case c.Alert.Description.unexpected_message:r="Unexpected message.";break;case c.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case c.Alert.Description.decryption_failed:r="Decryption failed.";break;case c.Alert.Description.record_overflow:r="Record overflow.";break;case c.Alert.Description.decompression_failure:r="Decompression failed.";break;case c.Alert.Description.handshake_failure:r="Handshake failure.";break;case c.Alert.Description.bad_certificate:r="Bad certificate.";break;case c.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case c.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case c.Alert.Description.certificate_expired:r="Certificate expired.";break;case c.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case c.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case c.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case c.Alert.Description.access_denied:r="Access denied.";break;case c.Alert.Description.decode_error:r="Decode error.";break;case c.Alert.Description.decrypt_error:r="Decrypt error.";break;case c.Alert.Description.export_restriction:r="Export restriction.";break;case c.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case c.Alert.Description.insufficient_security:r="Insufficient security.";break;case c.Alert.Description.internal_error:r="Internal error.";break;case c.Alert.Description.user_canceled:r="User canceled.";break;case c.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===c.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===c.ConnectionEnd.client?"server":"client",alert:i}),e.process()},c.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt24();if(a>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(a+4);r.read+=4,i in x[e.entity][e.expect]?(e.entity!==c.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==c.HandshakeType.hello_request&&i!==c.HandshakeType.certificate_verify&&i!==c.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),x[e.entity][e.expect][i](e,t,a)):c.handleUnexpected(e,t)},c.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},c.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),a=r.getInt16(),s=r.getBytes(a);if(i===c.HeartbeatMessageType.heartbeat_request){if(e.handshaking||a>s.length)return e.process();c.queue(e,c.createRecord(e,{type:c.ContentType.heartbeat,data:c.createHeartbeat(c.HeartbeatMessageType.heartbeat_response,s)})),c.flush(e)}else if(i===c.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(s))}e.process()};var l=1,f=2,p=3,h=4,d=5,y=6,g=7,v=8,m=1,C=2,E=3,S=4,b=5,T=6,A=c.handleUnexpected,I=c.handleChangeCipherSpec,B=c.handleAlert,w=c.handleHandshake,k=c.handleApplicationData,N=c.handleHeartbeat,R=[];R[c.ConnectionEnd.client]=[[A,B,w,A,N],[A,B,w,A,N],[A,B,w,A,N],[A,B,w,A,N],[A,B,w,A,N],[I,B,A,A,N],[A,B,w,A,N],[A,B,w,k,N],[A,B,w,A,N]],R[c.ConnectionEnd.server]=[[A,B,w,A,N],[A,B,w,A,N],[A,B,w,A,N],[A,B,w,A,N],[I,B,A,A,N],[A,B,w,A,N],[A,B,w,k,N],[A,B,w,A,N]];var _=c.handleHelloRequest,L=c.handleServerHello,U=c.handleCertificate,D=c.handleServerKeyExchange,P=c.handleCertificateRequest,O=c.handleServerHelloDone,V=c.handleFinished,x=[];x[c.ConnectionEnd.client]=[[A,A,L,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[_,A,A,A,A,A,A,A,A,A,A,U,D,P,O,A,A,A,A,A,A],[_,A,A,A,A,A,A,A,A,A,A,A,D,P,O,A,A,A,A,A,A],[_,A,A,A,A,A,A,A,A,A,A,A,A,P,O,A,A,A,A,A,A],[_,A,A,A,A,A,A,A,A,A,A,A,A,A,O,A,A,A,A,A,A],[_,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[_,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,V],[_,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[_,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]];var K=c.handleClientHello,M=c.handleClientKeyExchange,F=c.handleCertificateVerify;x[c.ConnectionEnd.server]=[[A,K,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,U,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,M,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,F,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,V],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A],[A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A,A]],c.generateKeys=function(e,t){var r=i,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var a=2*t.mac_key_length+2*t.enc_key_length,s=e.version.major===c.Versions.TLS_1_0.major&&e.version.minor===c.Versions.TLS_1_0.minor;s&&(a+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",n,a),u={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return s&&(u.client_write_IV=o.getBytes(t.fixed_iv_length),u.server_write_IV=o.getBytes(t.fixed_iv_length)),u},c.createConnectionState=function(e){var t=e.entity===c.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=c.generateKeys(e,i),n.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,i),i.compression_algorithm){case c.CompressionMethod.none:break;case c.CompressionMethod.deflate:n.read.compressFunction=s,n.write.compressFunction=a;break;default:throw new Error("Unsupported compression algorithm.")}}return n},c.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},c.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},c.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),c.createRecord(e,{type:c.ContentType.alert,data:r})},c.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var i=e.cipherSuites[r];t.putByte(i.id[0]),t.putByte(i.id[1])}var a=t.length(),s=n.util.createBuffer();s.putByte(c.CompressionMethod.none);var o=s.length(),l=n.util.createBuffer();if(e.virtualHost){var f=n.util.createBuffer();f.putByte(0),f.putByte(0);var p=n.util.createBuffer();p.putByte(0),u(p,2,n.util.createBuffer(e.virtualHost));var h=n.util.createBuffer();u(h,2,p),u(f,2,h),l.putBuffer(f)}var d=l.length();d>0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+a+1+o+d,v=n.util.createBuffer();return v.putByte(c.HandshakeType.client_hello),v.putInt24(g),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),u(v,1,n.util.createBuffer(y)),u(v,2,t),u(v,1,s),d>0&&u(v,2,l),v},c.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(c.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),u(i,1,n.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},c.createCertificate=function(e){var t,r=e.entity===c.ConnectionEnd.client,i=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,i=e.getCertificate(e,t));var a=n.util.createBuffer();if(null!==i)try{n.util.isArray(i)||(i=[i]);for(var s=null,o=0;o<i.length;++o){var l=n.pem.decode(i[o])[0];if("CERTIFICATE"!==l.type&&"X509 CERTIFICATE"!==l.type&&"TRUSTED CERTIFICATE"!==l.type){var f=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw f.headerType=l.type,f}if(l.procType&&"ENCRYPTED"===l.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var p=n.util.createBuffer(l.body);null===s&&(s=n.asn1.fromDer(p.bytes(),!1));var h=n.util.createBuffer();u(h,3,p),a.putBuffer(h)}i=n.pki.certificateFromAsn1(s),r?e.session.clientCertificate=i:e.session.serverCertificate=i}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate}})}var d=3+a.length(),y=n.util.createBuffer();return y.putByte(c.HandshakeType.certificate),y.putInt24(d),u(y,3,a),y},c.createClientKeyExchange=function(e){var t=n.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(n.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var i=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,a=n.util.createBuffer();return a.putByte(c.HandshakeType.client_key_exchange),a.putInt24(i),a.putInt16(t.length),a.putBytes(t),a},c.createServerKeyExchange=function(e){return n.util.createBuffer()},c.getClientSignature=function(e,t){var r=n.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.clientCertificate),i=n.pki.privateKeyFromPem(i)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}})}null===i?e.error(e,{message:"No private key set.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},c.createCertificateVerify=function(e,t){var r=t.length+2,i=n.util.createBuffer();return i.putByte(c.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},c.createCertificateRequest=function(e){var t=n.util.createBuffer();t.putByte(1);var r=n.util.createBuffer();for(var i in e.caStore.certs){var a=e.caStore.certs[i],s=n.pki.distinguishedNameToAsn1(a.subject),o=n.asn1.toDer(s);r.putInt16(o.length()),r.putBuffer(o)}var l=1+t.length()+2+r.length(),f=n.util.createBuffer();return f.putByte(c.HandshakeType.certificate_request),f.putInt24(l),u(f,1,t),u(f,2,r),f},c.createServerHelloDone=function(e){var t=n.util.createBuffer();return t.putByte(c.HandshakeType.server_hello_done),t.putInt24(0),t},c.createChangeCipherSpec=function(){var e=n.util.createBuffer();return e.putByte(1),e},c.createFinished=function(e){var t=n.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===c.ConnectionEnd.client,a=e.session.sp,s=r?"client finished":"server finished";t=i(a.master_secret,s,t.getBytes(),12);var o=n.util.createBuffer();return o.putByte(c.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o},c.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var i=n.util.createBuffer();i.putByte(e),i.putInt16(r),i.putBytes(t);var a=i.length(),s=Math.max(16,a-r-3);return i.putBytes(n.random.getBytes(s)),i},c.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==c.ContentType.handshake&&t.type!==c.ContentType.alert&&t.type!==c.ContentType.change_cipher_spec)){if(t.type===c.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var i;if(t.fragment.length()<=c.MaxFragment)i=[t];else{i=[];for(var a=t.fragment.bytes();a.length>c.MaxFragment;)i.push(c.createRecord(e,{type:t.type,data:n.util.createBuffer(a.slice(0,c.MaxFragment))})),a=a.slice(c.MaxFragment);a.length>0&&i.push(c.createRecord(e,{type:t.type,data:n.util.createBuffer(a)}))}for(var s=0;s<i.length&&!e.fail;++s){var o=i[s];e.state.current.write.update(e,o)&&e.records.push(o)}}},c.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var j=function(e){switch(e){case!0:return!0;case n.pki.certificateError.bad_certificate:return c.Alert.Description.bad_certificate;case n.pki.certificateError.unsupported_certificate:return c.Alert.Description.unsupported_certificate;case n.pki.certificateError.certificate_revoked:return c.Alert.Description.certificate_revoked;case n.pki.certificateError.certificate_expired:return c.Alert.Description.certificate_expired;case n.pki.certificateError.certificate_unknown:return c.Alert.Description.certificate_unknown;case n.pki.certificateError.unknown_ca:return c.Alert.Description.unknown_ca;default:return c.Alert.Description.bad_certificate}};for(var H in c.verifyCertificateChain=function(e,t){try{var r={};for(var i in e.verifyOptions)r[i]=e.verifyOptions[i];r.verify=function(t,r,i){j(t);var a=e.verify(e,t,r,i);if(!0!==a){if("object"==typeof a&&!n.util.isArray(a)){var s=new Error("The application rejected the certificate.");throw s.send=!0,s.alert={level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate},a.message&&(s.message=a.message),a.alert&&(s.alert.description=a.alert),s}a!==t&&(a=function(e){switch(e){case!0:return!0;case c.Alert.Description.bad_certificate:return n.pki.certificateError.bad_certificate;case c.Alert.Description.unsupported_certificate:return n.pki.certificateError.unsupported_certificate;case c.Alert.Description.certificate_revoked:return n.pki.certificateError.certificate_revoked;case c.Alert.Description.certificate_expired:return n.pki.certificateError.certificate_expired;case c.Alert.Description.certificate_unknown:return n.pki.certificateError.certificate_unknown;case c.Alert.Description.unknown_ca:return n.pki.certificateError.unknown_ca;default:return n.pki.certificateError.bad_certificate}}(a))}return a},n.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var a=t;("object"!=typeof a||n.util.isArray(a))&&(a={send:!0,alert:{level:c.Alert.Level.fatal,description:j(t)}}),"send"in a||(a.send=!0),"alert"in a||(a.alert={level:c.Alert.Level.fatal,description:j(a.error)}),e.error(e,a)}return!e.fail},c.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var i in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(i):delete e[i];r.getSession=function(e){var t=null,i=null;if(e?i=n.util.bytesToHex(e):r.order.length>0&&(i=r.order[0]),null!==i&&i in r.cache)for(var a in t=r.cache[i],delete r.cache[i],r.order)if(r.order[a]===i){r.order.splice(a,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}i=n.util.bytesToHex(e),r.order.push(i),r.cache[i]=t}}return r},c.createConnection=function(e){var t;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var i in r=[],c.CipherSuites)r.push(c.CipherSuites[i]);var a=e.server?c.ConnectionEnd.server:c.ConnectionEnd.client,s=e.sessionCache?c.createSessionCache(e.sessionCache):null,o={version:{major:c.Version.major,minor:c.Version.minor},entity:a,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===c.ConnectionEnd.client?"client":"server"),r.send&&(c.queue(t,c.createAlert(t,r.alert)),c.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:c.Version.major,minor:c.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,c.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=c.createConnectionState(o)}};return o.reset(),o.handshake=function(e){if(o.entity!==c.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=c.createRandom().getBytes(),o.open=!0,c.queue(o,c.createRecord(o,{type:c.ContentType.handshake,data:c.createClientHello(o)})),c.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var a=e.record.version.major===e.version.major;a&&e.session&&e.session.version&&(a=e.record.version.minor===e.version.minor),a||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();return n<e.record.length?t=e.record.length-n:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unexpected_message}})),e.record.ready=!0)),t}(o)),!o.fail&&null!==o.record&&o.record.ready&&function(e,t){var r=t.type-c.ContentType.change_cipher_spec,n=R[e.entity][e.expect];r in n?n[r](e,t):c.handleUnexpected(e,t)}(o,o.record)),t},o.prepare=function(e){return c.queue(o,c.createRecord(o,{type:c.ContentType.application_data,data:n.util.createBuffer(e)})),c.flush(o)},o.prepareHeartbeatRequest=function(e,t){return e instanceof n.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),o.expectedHeartbeatPayload=e,c.queue(o,c.createRecord(o,{type:c.ContentType.heartbeat,data:c.createHeartbeat(c.HeartbeatMessageType.heartbeat_request,e,t)})),c.flush(o)},o.close=function(e){if(!o.fail&&o.sessionCache&&o.session){var t={id:o.session.id,version:o.session.version,sp:o.session.sp};t.sp.keys=null,o.sessionCache.setSession(t.id,t)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,c.queue(o,c.createAlert(o,{level:c.Alert.Level.warning,description:c.Alert.Description.close_notify})),c.flush(o)),o.closed(o)),o.reset(e)},o},e.exports=n.tls=n.tls||{},c)"function"!=typeof c[H]&&(n.tls[H]=c[H]);n.tls.prf_tls1=i,n.tls.hmac_sha1=function(e,t,r){var i=n.hmac.create();i.start("SHA1",e);var a=n.util.createBuffer();return a.putInt32(t[0]),a.putInt32(t[1]),a.putByte(r.type),a.putByte(r.version.major),a.putByte(r.version.minor),a.putInt16(r.length),a.putBytes(r.fragment.bytes()),i.update(a.getBytes()),i.digest().getBytes()},n.tls.createSessionCache=c.createSessionCache,n.tls.createConnection=c.createConnection},3103:(e,t,r)=>{var n=r(7768),i=r(7858),a=e.exports=n.util=n.util||{};function s(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function o(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(a.isArrayBuffer(e)||a.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof o||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return a.nextTick=process.nextTick,void("function"==typeof setImmediate?a.setImmediate=setImmediate:a.setImmediate=a.nextTick);if("function"==typeof setImmediate)return a.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(a.nextTick=function(e){return setImmediate(e)});if(a.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",t=[];a.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var r=Date.now(),n=!0,i=document.createElement("div");t=[],new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(i,{attributes:!0});var s=a.setImmediate;a.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),s(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"==typeof self?window:self,a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=o,a.ByteStringBuffer=o,a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},a.ByteStringBuffer.prototype.putInt=function(e,t){s(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},a.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},a.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},a.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},a.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},a.ByteStringBuffer.prototype.getInt=function(e){s(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.ByteStringBuffer.prototype.toString=function(){return a.decodeUtf8(this.bytes())},a.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=a.isArrayBuffer(e),n=a.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},a.DataBuffer.prototype.length=function(){return this.write-this.read},a.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},a.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},a.DataBuffer.prototype.putBytes=function(e,t){if(a.isArrayBufferView(e)){var r=(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(a.isArrayBuffer(e)){var n=new Uint8Array(e);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(e instanceof a.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&a.isArrayBufferView(e.data))return n=new Uint8Array(e.data.byteLength,e.read,e.length()),this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this;if(e instanceof a.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){var i;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.hex.decode(e,i,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=a.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=a.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},a.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},a.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},a.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},a.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){s(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return s(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},a.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},a.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},a.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},a.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},a.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},a.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},a.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},a.DataBuffer.prototype.getInt=function(e){s(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return a.binary.raw.encode(t);if("hex"===e)return a.binary.hex.encode(t);if("base64"===e)return a.binary.base64.encode(t);if("utf8"===e)return a.text.utf8.decode(t);if("utf16"===e)return a.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},a.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=a.encodeUtf8(e)),new a.ByteBuffer(e)},a.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",a="",s=0,o=0;r>0;--r,++s)i=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(n+=a,a="",o=0),a+=String.fromCharCode(i),++o;return n+a},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},a.bytesToHex=function(e){return a.createBuffer(e).toHex()},a.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){for(var r,n,i,a="",s="",o=0;o<e.length;)r=e.charCodeAt(o++),n=e.charCodeAt(o++),i=e.charCodeAt(o++),a+=u.charAt(r>>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+a},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",s=0;s<e.length;)t=c[e.charCodeAt(s++)-43],r=c[e.charCodeAt(s++)-43],n=c[e.charCodeAt(s++)-43],i=c[e.charCodeAt(s++)-43],a+=String.fromCharCode(t<<2|r>>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},a.binary.hex.encode=a.bytesToHex,a.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,a=r=r||0;for(1&e.length&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n},a.binary.base64.encode=function(e,t){for(var r,n,i,a="",s="",o=0;o<e.byteLength;)r=e[o++],n=e[o++],i=e[o++],a+=u.charAt(r>>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(s+=a.substr(0,t)+"\r\n",a=a.substr(t));return s+a},a.binary.base64.decode=function(e,t,r){var n,i,a,s,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u<e.length;)n=c[e.charCodeAt(u++)-43],i=c[e.charCodeAt(u++)-43],a=c[e.charCodeAt(u++)-43],s=c[e.charCodeAt(u++)-43],o[l++]=n<<2|i>>4,64!==a&&(o[l++]=(15&i)<<4|a>>2,64!==s&&(o[l++]=(3&a)<<6|s));return t?l-r:o.subarray(0,l)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,l,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,l,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,s=0;s<e.length;++s)n[i++]=e.charCodeAt(s);return t?i-r:n},a.text.utf8.decode=function(e){return a.decodeUtf8(String.fromCharCode.apply(null,e))},a.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),a=r=r||0,s=r,o=0;o<e.length;++o)i[s++]=e.charCodeAt(o),a+=2;return t?a-r:n},a.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},a.deflate=function(e,t,r){if(t=a.decode64(e.deflate(a.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},a.inflate=function(e,t,r){var n=e.inflate(a.encode64(t)).rval;return null===n?null:a.decode64(n)};var f=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=a.encode64(JSON.stringify(r)),n=e.setItem(t,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},p=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(a.decode64(r))),r},h=function(e,t,r,n){var i=p(e,t);null===i&&(i={}),i[r]=n,f(e,t,i)},d=function(e,t,r){var n=p(e,t);return null!==n&&(n=r in n?n[r]:null),n},y=function(e,t,r){var n=p(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),f(e,t,n)}},g=function(e,t){f(e,t,null)},v=function(e,t,r){var n,i=null;void 0===r&&(r=["web","flash"]);var a=!1,s=null;for(var o in r){n=r[o];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),a="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),a=!0)}catch(e){s=e}if(a)break}if(!a)throw s;return i};a.setItem=function(e,t,r,n,i){v(h,arguments,i)},a.getItem=function(e,t,r,n){return v(d,arguments,n)},a.removeItem=function(e,t,r,n){v(y,arguments,n)},a.clearItems=function(e,t,r){v(g,arguments,r)},a.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var m=null;a.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,a,s=r[n].indexOf("=");s>0?(i=r[n].substring(0,s),a=r[n].substring(s+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=m):t=r(e),t},a.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:a.getQueryVariables(r)}},a.makeRequest=function(e){var t=a.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},a.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},a.format=function(e){for(var t,r,n=/%./g,i=0,a=[],s=0;t=n.exec(e);){(r=e.substring(s,n.lastIndex-2)).length>0&&a.push(r),s=n.lastIndex;var o=t[0][1];switch(o){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+o+"?>")}}return a.push(e.substring(s)),a.join("")},a.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,s=void 0===r?",":r,o=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+o:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+o)+(a?s+Math.abs(i-c).toFixed(a).slice(2):"")},a.formatSize=function(e){return e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes"},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=a.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},a.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++t,!0}))).length+t),n=a.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var s=a.hexToBytes(e[i]);s.length<2&&n.putByte(0),n.putBytes(s)}else n.fillWithByte(0,r),r=0;return n.getBytes()},a.bytesToIP=function(e){return 4===e.length?a.bytesToIPv4(e):16===e.length?a.bytesToIPv6(e):null},a.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},a.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var s=a.bytesToHex(e[i]+e[i+1]);"0"===s[0]&&"0"!==s;)s=s.substr(1);if("0"===s){var o=r[r.length-1],u=t.length;o&&u===o.end+1?(o.end=u,o.end-o.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(s)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"==typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"==typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(n,i,s){if(0===i){var o=Math.floor(n.reduce((function(e,t){return e+t}),0)/n.length);return a.cores=Math.max(1,o),URL.revokeObjectURL(r),t(null,a.cores)}!function(e,t){for(var n=[],i=[],a=0;a<e;++a){var s=new Worker(r);s.addEventListener("message",(function(r){if(i.push(r.data),i.length===e){for(var a=0;a<e;++a)n[a].terminate();t(0,i)}})),n.push(s)}for(a=0;a<e;++a)n[a].postMessage(a)}(s,(function(t,r){n.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],a=r[n]=[],s=0;s<e;++s)if(n!==s){var o=t[s];(i.st>o.st&&i.st<o.et||o.st>i.st&&o.st<i.et)&&a.push(s)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(s,r)),e(n,i-1,s)}))}([],5,16)}},6446:(e,t,r)=>{var n=r(7768);r(1482),r(2624),r(2023),r(6067),r(826),r(2884),r(5477),r(665),r(144),r(3103);var i=n.asn1,a=e.exports=n.pki=n.pki||{},s=a.oids,o={};o.CN=s.commonName,o.commonName="CN",o.C=s.countryName,o.countryName="C",o.L=s.localityName,o.localityName="L",o.ST=s.stateOrProvinceName,o.stateOrProvinceName="ST",o.O=s.organizationName,o.organizationName="O",o.OU=s.organizationalUnitName,o.organizationalUnitName="OU",o.E=s.emailAddress,o.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},l={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},f={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},p={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[f,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function h(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}a.RDNAttributesAsArray=function(e,t){for(var r,n,a,u=[],c=0;c<e.value.length;++c){r=e.value[c];for(var l=0;l<r.value.length;++l)a={},n=r.value[l],a.type=i.derToOid(n.value[0].value),a.value=n.value[1].value,a.valueTagClass=n.value[1].type,a.type in s&&(a.name=s[a.type],a.name in o&&(a.shortName=o[a.name])),t&&(t.update(a.type),t.update(a.value)),u.push(a)}return u},a.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],u=i.derToOid(n.value[0].value),c=n.value[1].value,l=0;l<c.length;++l){var f={};if(f.type=u,f.value=c[l].value,f.valueTagClass=c[l].type,f.type in s&&(f.name=s[f.type],f.name in o&&(f.shortName=o[f.name])),f.type===s.extensionRequest){f.extensions=[];for(var p=0;p<f.value.length;++p)f.extensions.push(a.certificateExtensionFromAsn1(f.value[p]))}t.push(f)}return t};var d=function(e,t,r){var n={};if(e!==s["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:s.sha1},mgf:{algorithmOid:s.mgf1,hash:{algorithmOid:s.sha1}},saltLength:20});var a={},o=[];if(!i.validate(t,l,a,o)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=o,u}return void 0!==a.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(a.hashOid)),void 0!==a.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(a.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(a.maskGenHashOid)),void 0!==a.saltLength&&(n.saltLength=a.saltLength.charCodeAt(0)),n};function y(e){for(var t,r,a=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),s=e.attributes,o=0;o<s.length;++o){var u=(t=s[o]).value,c=i.Type.PRINTABLESTRING;"valueTagClass"in t&&(c=t.valueTagClass)===i.Type.UTF8&&(u=n.util.encodeUtf8(u)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,c,!1,u)])]),a.value.push(r)}return a}function g(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in a.oids?t.name=a.oids[t.type]:t.shortName&&t.shortName in o&&(t.name=a.oids[o[t.shortName]])),void 0===t.type){if(!t.name||!(t.name in a.oids))throw(u=new Error("Attribute type not specified.")).attribute=t,u;t.type=a.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in o&&(t.shortName=o[t.name]),t.type===s.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(a.certificateExtensionToAsn1(v(t.extensions[n])))}var u;if(void 0===t.value)throw(u=new Error("Attribute value not specified.")).attribute=t,u}}function v(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in a.oids&&(e.name=a.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in a.oids))throw(S=new Error("Extension ID not specified.")).extension=e,S;e.id=a.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var r=0,o=0,u=0;e.digitalSignature&&(o|=128,r=7),e.nonRepudiation&&(o|=64,r=6),e.keyEncipherment&&(o|=32,r=5),e.dataEncipherment&&(o|=16,r=4),e.keyAgreement&&(o|=8,r=3),e.keyCertSign&&(o|=4,r=2),e.cRLSign&&(o|=2,r=1),e.encipherOnly&&(o|=1,r=0),e.decipherOnly&&(u|=128,r=7);var c=String.fromCharCode(r);0!==u?c+=String.fromCharCode(o)+String.fromCharCode(u):0!==o&&(c+=String.fromCharCode(o)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=e.value.value;for(var f in e)!0===e[f]&&(f in s?l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s[f]).getBytes())):-1!==f.indexOf(".")&&l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(f).getBytes())))}else if("nsCertType"===e.name)r=0,o=0,e.client&&(o|=128,r=7),e.server&&(o|=64,r=6),e.email&&(o|=32,r=5),e.objsign&&(o|=16,r=4),e.reserved&&(o|=8,r=3),e.sslCA&&(o|=4,r=2),e.emailCA&&(o|=2,r=1),e.objCA&&(o|=1,r=0),c=String.fromCharCode(r),0!==o&&(c+=String.fromCharCode(o)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c);else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var p=0;p<e.altNames.length;++p){if(c=(m=e.altNames[p]).value,7===m.type&&m.ip){if(null===(c=n.util.bytesFromIP(m.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(c=m.oid?i.oidToDer(i.oidToDer(m.oid)):i.oidToDer(c));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,m.type,!1,c))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var h=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=h.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,h.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){if(e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),l=e.value.value,e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var g=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var v=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,v))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),l=e.value.value;var m,C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),E=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(p=0;p<e.altNames.length;++p){if(c=(m=e.altNames[p]).value,7===m.type&&m.ip){if(null===(c=n.util.bytesFromIP(m.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(c=m.oid?i.oidToDer(i.oidToDer(m.oid)):i.oidToDer(c));E.value.push(i.create(i.Class.CONTEXT_SPECIFIC,m.type,!1,c))}C.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[E])),l.push(C)}var S;if(void 0===e.value)throw(S=new Error("Extension value not specified.")).extension=e,S;return e}function m(e,t){switch(e){case s["RSASSA-PSS"]:var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r);default:return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}}function C(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,a=0;a<r.length;++a){var s=r[a],o=s.value,u=i.Type.UTF8;"valueTagClass"in s&&(u=s.valueTagClass),u===i.Type.UTF8&&(o=n.util.encodeUtf8(o));var c=!1;"valueConstructed"in s&&(c=s.valueConstructed);var l=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,u,c,o)])]);t.value.push(l)}return t}a.certificateFromPem=function(e,t,r){var s=n.pem.decode(e)[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var o=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw o.headerType=s.type,o}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=i.fromDer(s.body,r);return a.certificateFromAsn1(u,t)},a.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(a.certificateToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return a.publicKeyFromAsn1(s)},a.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(a.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(a.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.getPublicKeyFingerprint=function(e,t){var r,s=(t=t||{}).md||n.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(a.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(a.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}s.start(),s.update(r);var o=s.digest();if("hex"===t.encoding){var u=o.toHex();return t.delimiter?u.match(/.{2}/g).join(t.delimiter):u}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return o},a.certificationRequestFromPem=function(e,t,r){var s=n.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==s.type){var o=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw o.headerType=s.type,o}if(s.procType&&"ENCRYPTED"===s.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var u=i.fromDer(s.body,r);return a.certificationRequestFromAsn1(u,t)},a.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(a.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return h(e.issuer,t)},e.issuer.addField=function(t){g([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){g([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){g(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){g(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)v(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,n=null,i=0;null===n&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,r){e.md=r||n.md.sha1.create();var o=s[e.md.algorithm+"WithRSAEncryption"];if(!o){var u=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=o,e.tbsCertificate=a.getTBSCertificate(e);var c=i.toDer(e.tbsCertificate);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var o=t.issuer,u=e.subject;throw(y=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=o.attributes,y.actualIssuer=u.attributes,y}var c=t.md;if(null===c){if(t.signatureOid in s)switch(s[t.signatureOid]){case"sha1WithRSAEncryption":c=n.md.sha1.create();break;case"md5WithRSAEncryption":c=n.md.md5.create();break;case"sha256WithRSAEncryption":c=n.md.sha256.create();break;case"sha384WithRSAEncryption":c=n.md.sha384.create();break;case"sha512WithRSAEncryption":c=n.md.sha512.create();break;case"RSASSA-PSS":c=n.md.sha256.create()}if(null===c)throw(y=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,y;var l=t.tbsCertificate||a.getTBSCertificate(t),f=i.toDer(l);c.update(f.getBytes())}if(null!==c){var p;switch(t.signatureOid){case s.sha1WithRSAEncryption:p=void 0;break;case s["RSASSA-PSS"]:var h,d,y;if(void 0===(h=s[t.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[h])throw(y=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,y.name=h,y;if(void 0===(d=s[t.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[d])throw(y=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,y.name=d,y;if(d=n.mgf[d].create(n.md[h].create()),void 0===(h=s[t.signatureParameters.hash.algorithmOid])||void 0===n.md[h])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:h};p=n.pss.create(n.md[h].create(),d,t.signatureParameters.saltLength)}r=e.publicKey.verify(c.digest().getBytes(),t.signature,p)}return r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var a,s;r=!0;for(var o=0;r&&o<n.attributes.length;++o)a=n.attributes[o],s=i.attributes[o],a.type===s.type&&a.value===s.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return a.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=s.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var a=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===a}}return!1},e},a.certificateFromAsn1=function(e,t){var r={},o=[];if(!i.validate(e,c,r,o))throw(p=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=o,p;if(i.derToOid(r.publicKeyOid)!==a.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=a.createCertificate();u.version=r.certVersion?r.certVersion.charCodeAt(0):0;var l=n.util.createBuffer(r.certSerialNumber);u.serialNumber=l.toHex(),u.signatureOid=n.asn1.derToOid(r.certSignatureOid),u.signatureParameters=d(u.signatureOid,r.certSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),u.siginfo.parameters=d(u.siginfo.algorithmOid,r.certinfoSignatureParams,!1),u.signature=r.certSignature;var f=[];if(void 0!==r.certValidity1UTCTime&&f.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&f.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&f.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&f.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),f.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,t){var p;if(u.md=null,u.signatureOid in s)switch(s[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(p=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,p;var y=i.toDer(u.tbsCertificate);u.md.update(y.getBytes())}var v=n.md.sha1.create();u.issuer.getField=function(e){return h(u.issuer,e)},u.issuer.addField=function(e){g([e]),u.issuer.attributes.push(e)},u.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer,v),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=v.digest().toHex();var m=n.md.sha1.create();return u.subject.getField=function(e){return h(u.subject,e)},u.subject.addField=function(e){g([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certSubject,m),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=m.digest().toHex(),r.certExtensions?u.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(a.certificateExtensionFromAsn1(n.value[i]));return t},a.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in s)if(t.name=s[t.id],"keyUsage"===t.name){var r=0,a=0;(u=i.fromDer(t.value)).value.length>1&&(r=u.value.charCodeAt(1),a=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&a)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var o=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?o=u.value[0].value:u.value.length>1&&(o=u.value[1].value),null!==o&&(t.pathLenConstraint=i.derToInteger(o))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),c=0;c<u.value.length;++c){var l=i.derToOid(u.value[c].value);l in s?t[s[l]]=!0:t[l]=!0}else if("nsCertType"===t.name)r=0,(u=i.fromDer(t.value)).value.length>1&&(r=u.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r);else if("subjectAltName"===t.name||"issuerAltName"===t.name){var f;t.altNames=[],u=i.fromDer(t.value);for(var p=0;p<u.value.length;++p){var h={type:(f=u.value[p]).type,value:f.value};switch(t.altNames.push(h),f.type){case 1:case 2:case 6:break;case 7:h.ip=n.util.bytesToIP(f.value);break;case 8:h.oid=i.derToOid(f.value)}}}else"subjectKeyIdentifier"===t.name&&(u=i.fromDer(t.value),t.subjectKeyIdentifier=n.util.bytesToHex(u.value));return t},a.certificationRequestFromAsn1=function(e,t){var r={},o=[];if(!i.validate(e,p,r,o))throw(c=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=o,c;if(i.derToOid(r.publicKeyOid)!==a.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=a.createCertificationRequest();if(u.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,u.signatureOid=n.asn1.derToOid(r.csrSignatureOid),u.signatureParameters=d(u.signatureOid,r.csrSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),u.siginfo.parameters=d(u.siginfo.algorithmOid,r.csrSignatureParams,!1),u.signature=r.csrSignature,u.certificationRequestInfo=r.certificationRequestInfo,t){var c;if(u.md=null,u.signatureOid in s)switch(s[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(c=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=u.signatureOid,c;var l=i.toDer(u.certificationRequestInfo);u.md.update(l.getBytes())}var f=n.md.sha1.create();return u.subject.getField=function(e){return h(u.subject,e)},u.subject.addField=function(e){g([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certificationRequestInfoSubject,f),u.subject.hash=f.digest().toHex(),u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u.getAttribute=function(e){return h(u,e)},u.addAttribute=function(e){g([e]),u.attributes.push(e)},u.attributes=a.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),u},a.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){g([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return h(e,t)},e.addAttribute=function(t){g([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){g(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){g(t),e.attributes=t},e.sign=function(t,r){e.md=r||n.md.sha1.create();var o=s[e.md.algorithm+"WithRSAEncryption"];if(!o){var u=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=o,e.certificationRequestInfo=a.getCertificationRequestInfo(e);var c=i.toDer(e.certificationRequestInfo);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){if(e.signatureOid in s)switch(s[e.signatureOid]){case"sha1WithRSAEncryption":r=n.md.sha1.create();break;case"md5WithRSAEncryption":r=n.md.md5.create();break;case"sha256WithRSAEncryption":r=n.md.sha256.create();break;case"sha384WithRSAEncryption":r=n.md.sha384.create();break;case"sha512WithRSAEncryption":r=n.md.sha512.create();break;case"RSASSA-PSS":r=n.md.sha256.create()}if(null===r)throw(p=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,p;var o=e.certificationRequestInfo||a.getCertificationRequestInfo(e),u=i.toDer(o);r.update(u.getBytes())}if(null!==r){var c;switch(e.signatureOid){case s.sha1WithRSAEncryption:break;case s["RSASSA-PSS"]:var l,f,p;if(void 0===(l=s[e.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[l])throw(p=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,p.name=l,p;if(void 0===(f=s[e.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[f])throw(p=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,p.name=f,p;if(f=n.mgf[f].create(n.md[l].create()),void 0===(l=s[e.signatureParameters.hash.algorithmOid])||void 0===n.md[l])throw(p=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,p.name=l,p;c=n.pss.create(n.md[l].create(),f,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,c)}return t},e};var E=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");function b(e){return e>=E&&e<S?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}a.getTBSCertificate=function(e){var t=b(e.validity.notBefore),r=b(e.validity.notAfter),s=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),m(e.siginfo.algorithmOid,e.siginfo.parameters)]),y(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),y(e.subject),a.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&s.value.push(a.certificateExtensionsToAsn1(e.extensions)),s},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),a.publicKeyToAsn1(e.publicKey),C(e)])},a.distinguishedNameToAsn1=function(e){return y(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(a.certificateExtensionToAsn1(e[n]));return t},a.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},a.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||a.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.createCaStore=function(e){var t={certs:{}};function r(e){return s(e),t.certs[e.hash]||null}function s(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=a.RDNAttributesAsArray(y(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=n.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var s=i.toDer(a.certificateToAsn1(e)).getBytes(),o=0;o<t.length;++o)if(s===i.toDer(a.certificateToAsn1(t[o])).getBytes())return!0;return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(n.util.isArray(i))for(var a=0;a<i.length;++a)e.push(i[a]);else e.push(i)}return e},t.removeCertificate=function(e){var o;if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))return null;var u=r(e.subject);if(!n.util.isArray(u))return o=t.certs[e.subject.hash],delete t.certs[e.subject.hash],o;for(var c=i.toDer(a.certificateToAsn1(e)).getBytes(),l=0;l<u.length;++l)c===i.toDer(a.certificateToAsn1(u[l])).getBytes()&&(o=u[l],u.splice(l,1));return 0===u.length&&delete t.certs[e.subject.hash],o},e)for(var o=0;o<e.length;++o){var u=e[o];t.addCertificate(u)}return t},a.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},a.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),s=r.validityCheckDate;void 0===s&&(s=new Date);var o=!0,u=null,c=0;do{var l=t.shift(),f=null,p=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),null===u){if(null===(f=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(p=!0,f=l),f){var h=f;n.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){f=h.shift();try{d=f.verify(l)}catch(e){}}d||(u={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==u||f&&!p||e.hasCertificate(l)||(u={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===u&&f&&!l.isIssuer(f)&&(u={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===u&&g<l.extensions.length;++g){var v=l.extensions[g];v.critical&&!(v.name in y)&&(u={message:"Certificate has an unsupported critical extension.",error:a.certificateError.unsupported_certificate})}if(null===u&&(!o||0===t.length&&(!f||p))){var m=l.getExtension("basicConstraints"),C=l.getExtension("keyUsage");null!==C&&(C.keyCertSign&&null!==m||(u={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:a.certificateError.bad_certificate})),null!==u||null===m||m.cA||(u={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:a.certificateError.bad_certificate}),null===u&&null!==C&&"pathLenConstraint"in m&&c-1>m.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var E=null===u||u.error,S=r.verify?r.verify(E,c,i):E;if(!0!==S)throw!0===E&&(u={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(u.error=S):(S.message&&(u.message=S.message),S.error&&(u.error=S.error))),u;u=null,o=!1,++c}while(t.length>0);return!0}},3906:()=>{}},a={};function s(e){if(a[e])return a[e].exports;var t=a[e]={exports:{}};return i[e].call(t.exports,t,t.exports,s),t.exports}s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e=s(4473),t=s(2412),r=s(2365),n=s(6247),window.toRegistry=async function(r,n,i){const{publicKey:a,privateKey:s}=e.keyPairFromSeed(r);return await t.setEntry(s,n,{datakey:n,data:i,revision:0})},window.fromRegistry=async function(r,n){const{publicKey:i,privateKey:a}=e.keyPairFromSeed(r);return(await t.getEntry(i,n)).entry.data},window.downloadText=async function(e){return await t.downloadText(e)},window.uploadText=async function(e,r){return await t.uploadText(e,r)},window.getWords=async function(e){return await r.getWords(e)},window.getNumbers=async function(e){return await r.getNumbers(e)},window.generateSeed=async function(t,r,n){return await e.generateSeed(t,r,n)},window.recoverPassword=async function(t,r){return await e.recoverPassword(t,r)},window.appendKey=async function(e,t,r){return await n.appendKey(e,t,r)},window.appendRegistryKey=async function(e,t){return await n.appendRegistryKey(e,t)},window.setDefaultPortal=function(e){t.setDefaultPortal(e)},window.setDefaultTimeout=function(e){t.setDefaultTimeout(e)},window.createAppId=function(e){return n.createAppId(e)},window.keyExists=async function(e,t){return await n.keyExists(e,t)}})();