var reqEnrollment=requirejs.config({baseUrl:"/",waitSeconds:0,paths:{jquery:"ols/Content/Shared/Scripts/Lib/jquery-3.2.1.min",XmSdk:"ols/Content/Shared/Scripts/SharedAuthTransmit/TransmitScriptsWeb/transmitSDK",xmui:"ols/Content/Shared/Scripts/SharedAuthTransmit/TransmitScriptsWeb/transmitSDK",xmsdk:"ols/Content/Shared/Scripts/SharedAuthTransmit/TransmitScriptsWeb/transmitSDK"}}),__extends,__assign,com;(function(){"use strict";angular.module("TransmitMNOModule",[])})(),function(){"use strict";angular.module("TransmitBusinessEnrollmentModule",[])}(),function(){angular.module("TransmitMNOModule").factory("TransmitMNOService",["$rootScope","LocaleConstants",function(n,t){var i={},r=function(n){i=n},u=function(){return new Promise(function(){reqEnrollment(["jquery","XmSdk","xmui"],function(n,t){var u=t.XmSdk(),r=null,f=com.ts.mobile.sdk.SDKConnectionSettings.create(i.Transmit34WebUrlLogin,i.appId);u.setConnectionSettings(f);JSON.parse(window.sessionStorage.getItem("currentSession"))!=null&&(r=JSON.parse(window.sessionStorage.getItem("currentSession")).user_name);r!=null&&(window.sessionStorage.getItem("ts:provisionalSession:"+r)==!0?console&&console.log("session is provisional"):u.initialize().then(function(){u.logout(r).then(function(){}).catch(function(){})}).catch(function(){}))})})},f=function(){return new Promise(function(r,u){reqEnrollment(["jquery","XmSdk","xmui"],function(f,e,o){function s(){o.XmUIHandler.call(this)}function h(n,t,i,r,u){this.title=n;this.username=t;this.possibleTargets=i;this.autoExecedTarget=r;this.state=c.TargetSelection;this.uiHandler=u}function w(n){var r=n.getData(),i=((r||{}).additional_data||{}).retries_left;typeof locked!="undefined"&&locked?l(t.ENROLLMENT_ENTER_CODE_6_DIGIT_OTP_LOCK_OUT_ERR_MSG):typeof i!="undefined"&&i==1?l(t.ENROLLMENT_ENTER_CODE_6_DIGIT_LAST_ATTEMPT_ERR_MSG):typeof i!="undefined"&&i>0?l(t.ENROLLMENT_INVALID_CODE_ERR_MSG):l()}function l(t){n.$broadcast("TransmitError",t)}var a=e.XmSdk(),p=com.ts.mobile.sdk.SDKConnectionSettings.create(i.Transmit34WebUrlLogin,i.appId),v,c,y;a.setConnectionSettings(p);a.initialize().then(function(){a.invokeAnonymousPolicy(i.policyId,i.policyParams,i.clientContext).then(function(n){r(n._internalData.json_data.Token)}).catch(function(n){u(n)})}).catch(function(n){u(n)});console.log("Initialize end");f(".xmuiMethodMenuItemText").click(function(){n.$broadcast("OpenTransmitOTP","")});s.prototype=Object.create(o.XmUIHandler.prototype);s.prototype.constructor=s;v=new s;a.setUiHandler(v);s.prototype.startActivityIndicator=function(t,i){n.$broadcast("busy.begin");this.actionContext=t;this.clientContext=i;o.XmUIHandler.getContainer(i).append("")};s.prototype.endActivityIndicator=function(){n.$broadcast("busy.end",{remaining:0})};s.prototype.handlePolicyRejection=function(n,t,i,r){var f={};f.reject=(((r||{}).reason||{}).data||{}).code;f.locked=(((r||{}).reason||{}).data||{}).locked;u(f)};s.prototype.createOtpAuthSession=function(n,t,i,r){return new h(n,t,i,r)};s.prototype.processJsonData=function(){return Promise.resolve(y)};h.prototype.setAvailableTargets=function(n){this.possibleTargets=n};h.prototype.setGeneratedOtp=function(n,t){this.generatedFormat=n;this.generatedForTarget=t;t||(this.state=c.TargetSelection)};h.prototype.startSession=function(t,i,r,u){n.$broadcast("OpenTransmitOTP","");this.description=t;this.mode=i;this.actionContext=r;this.clientContext=u;o.XmUIHandler.getContainer(u).append("")};h.prototype.promiseInput=function(){var r=this;switch(this.state){case c.TargetSelection:return new Promise(function(n){r.authError=null;r.state=c.Input;var t=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(r.possibleTargets[0]);return n(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(t))})}return new Promise(function(r){f(i.send).click(function(){if(f(i.otpinput).val()!=""&&f(i.otpinput).val().length==6){var n=com.ts.mobile.sdk.OtpInputOtpSubmission.createOtpSubmission(f(i.otpinput).val().toString()),u=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(n);r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(u))}else l(t.ENROLLMENT_ENTER_CODE_6_DIGIT_REQ_ERR_MSG)});f(i.resend).click(function(){var t,u,f;n.$broadcast("SendNewCode");i.resendDisable&&(t=this,t.setAttribute("disabled",!0),setTimeout(function(){t.removeAttribute("disabled")},i.resendDisableTime));u=com.ts.mobile.sdk.OtpInputRequestResend.createOtpResendRequest();f=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(u);r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(f))})})};h.prototype.promiseRecoveryForError=function(n,t,i){return console.log("error: "+n),w(n),Promise.resolve(i)};h.prototype.endSession=function(){},function(n){n[n.TargetSelection=0]="TargetSelection";n[n.Input=1]="Input"}(c||(c={}));y={getContinueProcessing:function(){return!0}}})})};return{callUnauthenicatedMNOPolicy:f,transmitLogout:u,setMNO:r}}])}(),function(){angular.module("TransmitBusinessEnrollmentModule").factory("TransmitBusinessEnrollmentService",["$rootScope","LocaleConstants",function(n,t){var i={},r=function(n){i=n},u=function(){return new Promise(function(r,u){reqEnrollment(["jquery","XmSdk","xmui"],function(f,e,o){function s(){o.XmUIHandler.call(this)}function h(n,t,i,r,u){this.title=n;this.username=t;this.possibleTargets=i;this.autoExecedTarget=r;this.state=c.TargetSelection;this.uiHandler=u}function w(n){var r=n.getData(),i=((r||{}).additional_data||{}).retries_left;typeof locked!="undefined"&&locked?l(t.ENROLLMENT_ENTER_CODE_6_DIGIT_OTP_LOCK_OUT_ERR_MSG):typeof i!="undefined"&&i==1?l(t.ENROLLMENT_ENTER_CODE_6_DIGIT_LAST_ATTEMPT_ERR_MSG):typeof i!="undefined"&&i>0?l(t.ENROLLMENT_INVALID_CODE_ERR_MSG):l()}function l(t){n.$broadcast("TransmitError",t)}var a=e.XmSdk(),p=com.ts.mobile.sdk.SDKConnectionSettings.create(i.Transmit34WebUrlLogin,i.appId),v,y,c;a.setConnectionSettings(p);a.initialize().then(function(){a.invokeAnonymousPolicy(i.policyId,i.policyParams,i.clientContext).then(function(n){r(n._internalData.json_data.Token)}).catch(function(n){u(n)})}).catch(function(n){u(n)});console.log("Initialize end");s.prototype=Object.create(o.XmUIHandler.prototype);s.prototype.constructor=s;v=new s;a.setUiHandler(v);s.prototype.startActivityIndicator=function(){n.$broadcast("busy.begin")};s.prototype.endActivityIndicator=function(){n.$broadcast("busy.end",{remaining:0})};s.prototype.handlePolicyRejection=function(n,t,i,r){var f={};f.reject=(((r||{}).reason||{}).data||{}).code;f.locked=(((r||{}).reason||{}).data||{}).locked;u(f)};s.prototype.createOtpAuthSession=function(n,t,i,r){return new h(n,t,i,r)};s.prototype.processJsonData=function(){return Promise.resolve(y)};y={getContinueProcessing:function(){return!0}};h.prototype.setAvailableTargets=function(n){this.possibleTargets=n};h.prototype.setGeneratedOtp=function(n,t){this.generatedFormat=n;this.generatedForTarget=t;t||(this.state=c.TargetSelection)};h.prototype.startSession=function(t,i,r,u){n.$broadcast("OpenTransmitOTP","");this.description=t;this.mode=i;this.actionContext=r;this.clientContext=u;o.XmUIHandler.getContainer(u).append("")};h.prototype.promiseInput=function(){var n=this;switch(this.state){case c.TargetSelection:return new Promise(function(t){n.authError=null;n.state=c.Input;var i=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(n.possibleTargets[0]);return t(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(i))})}return new Promise(function(n){f(i.send).click(function(){if(f(i.otpinput).val()!=""&&f(i.otpinput).val().length==6){var r=com.ts.mobile.sdk.OtpInputOtpSubmission.createOtpSubmission(f(i.otpinput).val().toString()),u=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(r);n(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(u))}else l(t.ENROLLMENT_ENTER_CODE_6_DIGIT_REQ_ERR_MSG)});f(i.resend).click(function(){var t,r,u;i.resendDisable&&(t=this,t.setAttribute("disabled",!0),setTimeout(function(){t.removeAttribute("disabled")},i.resendDisableTime));r=com.ts.mobile.sdk.OtpInputRequestResend.createOtpResendRequest();u=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(r);n(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(u))})})};h.prototype.promiseRecoveryForError=function(n,t,i){return w(n),Promise.resolve(i)};h.prototype.endSession=function(){},function(n){n[n.TargetSelection=0]="TargetSelection";n[n.Input=1]="Input"}(c||(c={}))})})};return{callBusinessEnrollmentPolicy:u,setBusinessEnrollment:r}}])}(),function(){angular.module("TransmitBusinessEnrollmentModule").constant("TransmitBusinessEnrollmentConstants",{Transmit_Error_OTP_NotAMobNumber_ErrCode:"19",Transmit_OTP_MNO_Green:"G"})}(),function(){angular.module("TransmitMNOModule").constant("TransmitMNOConstants",{Transmit_Error_OTP_NotAMobNumber_ErrCode:"19",Transmit_OTP_MNO_Green:"G"})}();!function(){function n(t,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!t[f]){if(h="function"==typeof require&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};t[f][0].call(s.exports,function(n){var i=t[f][1][n];return u(i||n)},s,s.exports,n,t,i,r)}return i[f].exports}for(var e="function"==typeof require&&require,f=0;f<r.length;f++)u(r[f]);return u}return n}()({1:[function(n){(function(t){"use strict";n(2);n(3);n(9);n(8);n(10);n(5);n(6);n(4);n(7);n(279);n(280);t._babelPolyfill&&"undefined"!=typeof console&&console.warn&&console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning.");t._babelPolyfill=!0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{10:10,2:2,279:279,280:280,3:3,4:4,5:5,6:6,7:7,8:8,9:9}],2:[function(n,t){n(254);n(190);n(192);n(191);n(194);n(196);n(201);n(195);n(193);n(203);n(202);n(198);n(199);n(197);n(189);n(200);n(204);n(205);n(156);n(158);n(157);n(207);n(206);n(177);n(187);n(188);n(178);n(179);n(180);n(181);n(182);n(183);n(184);n(185);n(186);n(160);n(161);n(162);n(163);n(164);n(165);n(166);n(167);n(168);n(169);n(170);n(171);n(172);n(173);n(174);n(175);n(176);n(241);n(246);n(253);n(244);n(236);n(237);n(242);n(247);n(249);n(232);n(233);n(234);n(235);n(238);n(239);n(240);n(243);n(245);n(248);n(250);n(251);n(252);n(151);n(153);n(152);n(155);n(154);n(139);n(137);n(144);n(141);n(147);n(149);n(136);n(143);n(133);n(148);n(131);n(146);n(145);n(138);n(142);n(130);n(132);n(135);n(134);n(150);n(140);n(223);n(224);n(230);n(225);n(226);n(227);n(228);n(229);n(208);n(159);n(231);n(266);n(267);n(255);n(256);n(261);n(264);n(265);n(259);n(262);n(260);n(263);n(257);n(258);n(209);n(210);n(211);n(212);n(213);n(216);n(214);n(215);n(217);n(218);n(219);n(220);n(222);n(221);t.exports=n(30)},{130:130,131:131,132:132,133:133,134:134,135:135,136:136,137:137,138:138,139:139,140:140,141:141,142:142,143:143,144:144,145:145,146:146,147:147,148:148,149:149,150:150,151:151,152:152,153:153,154:154,155:155,156:156,157:157,158:158,159:159,160:160,161:161,162:162,163:163,164:164,165:165,166:166,167:167,168:168,169:169,170:170,171:171,172:172,173:173,174:174,175:175,176:176,177:177,178:178,179:179,180:180,181:181,182:182,183:183,184:184,185:185,186:186,187:187,188:188,189:189,190:190,191:191,192:192,193:193,194:194,195:195,196:196,197:197,198:198,199:199,200:200,201:201,202:202,203:203,204:204,205:205,206:206,207:207,208:208,209:209,210:210,211:211,212:212,213:213,214:214,215:215,216:216,217:217,218:218,219:219,220:220,221:221,222:222,223:223,224:224,225:225,226:226,227:227,228:228,229:229,230:230,231:231,232:232,233:233,234:234,235:235,236:236,237:237,238:238,239:239,240:240,241:241,242:242,243:243,244:244,245:245,246:246,247:247,248:248,249:249,250:250,251:251,252:252,253:253,254:254,255:255,256:256,257:257,258:258,259:259,260:260,261:261,262:262,263:263,264:264,265:265,266:266,267:267,30:30}],3:[function(n,t){n(268);t.exports=n(30).Array.includes},{268:268,30:30}],4:[function(n,t){n(269);t.exports=n(30).Object.entries},{269:269,30:30}],5:[function(n,t){n(270);t.exports=n(30).Object.getOwnPropertyDescriptors},{270:270,30:30}],6:[function(n,t){n(271);t.exports=n(30).Object.values},{271:271,30:30}],7:[function(n,t){"use strict";n(208);n(272);t.exports=n(30).Promise.finally},{208:208,272:272,30:30}],8:[function(n,t){n(273);t.exports=n(30).String.padEnd},{273:273,30:30}],9:[function(n,t){n(274);t.exports=n(30).String.padStart},{274:274,30:30}],10:[function(n,t){n(275);t.exports=n(127).f("asyncIterator")},{127:127,275:275}],11:[function(n,t){t.exports=function(n){if("function"!=typeof n)throw TypeError(n+" is not a function!");return n}},{}],12:[function(n,t){var i=n(26);t.exports=function(n,t){if("number"!=typeof n&&"Number"!=i(n))throw TypeError(t);return+n}},{26:26}],13:[function(n,t){var i=n(128)("unscopables"),r=Array.prototype;void 0==r[i]&&n(48)(r,i,{});t.exports=function(n){r[i][n]=!0}},{128:128,48:48}],14:[function(n,t){"use strict";var i=n(105)(!0);t.exports=function(n,t,r){return t+(r?i(n,t).length:1)}},{105:105}],15:[function(n,t){t.exports=function(n,t,i,r){if(!(n instanceof t)||void 0!==r&&r in n)throw TypeError(i+": incorrect invocation!");return n}},{}],16:[function(n,t){var i=n(57);t.exports=function(n){if(!i(n))throw TypeError(n+" is not an object!");return n}},{57:57}],17:[function(n,t){"use strict";var r=n(118),i=n(113),u=n(117);t.exports=[].copyWithin||function(n,t){var o=r(this),s=u(o.length),f=i(n,s),e=i(t,s),l=arguments.length>2?arguments[2]:void 0,h=Math.min((void 0===l?s:i(l,s))-e,s-f),c=1;for(e<f&&f<e+h&&(c=-1,e+=h-1,f+=h-1);h-->0;)e in o?o[f]=o[e]:delete o[f],f+=c,e+=c;return o}},{113:113,117:117,118:118}],18:[function(n,t){"use strict";var r=n(118),i=n(113),u=n(117);t.exports=function(n){for(var t=r(this),f=u(t.length),e=arguments.length,o=i(e>1?arguments[1]:void 0,f),s=e>2?arguments[2]:void 0,h=void 0===s?f:i(s,f);h>o;)t[o++]=n;return t}},{113:113,117:117,118:118}],19:[function(n,t){var i=n(116),r=n(117),u=n(113);t.exports=function(n){return function(t,f,e){var c,s=i(t),h=r(s.length),o=u(e,h);if(n&&f!=f){for(;h>o;)if((c=s[o++])!=c)return!0}else for(;h>o;o++)if((n||o in s)&&s[o]===f)return n||o||0;return!n&&-1}}},{113:113,116:116,117:117}],20:[function(n,t){var i=n(32),r=n(53),u=n(118),f=n(117),e=n(23);t.exports=function(n,t){var s=1==n,l=2==n,a=3==n,o=4==n,h=6==n,v=5==n||h,c=t||e;return function(t,e,y){for(var w,b,g=u(t),k=r(g),tt=i(e,y,3),nt=f(k.length),p=0,d=s?c(t,nt):l?c(t,0):void 0;nt>p;p++)if((v||p in k)&&(w=k[p],b=tt(w,p,g),n))if(s)d[p]=b;else if(b)switch(n){case 3:return!0;case 5:return w;case 6:return p;case 2:d.push(w)}else if(o)return!1;return h?-1:a||o?o:d}}},{117:117,118:118,23:23,32:32,53:53}],21:[function(n,t){var i=n(11),r=n(118),u=n(53),f=n(117);t.exports=function(n,t,e,o,s){i(t);var l=r(n),c=u(l),a=f(l.length),h=s?a-1:0,v=s?-1:1;if(e<2)for(;;){if(h in c){o=c[h];h+=v;break}if(h+=v,s?h<0:a<=h)throw TypeError("Reduce of empty array with no initial value");}for(;s?h>=0:a>h;h+=v)h in c&&(o=t(o,c[h],h,l));return o}},{11:11,117:117,118:118,53:53}],22:[function(n,t){var r=n(57),i=n(55),u=n(128)("species");t.exports=function(n){var t;return i(n)&&(t=n.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&null===(t=t[u])&&(t=void 0)),void 0===t?Array:t}},{128:128,55:55,57:57}],23:[function(n,t){var i=n(22);t.exports=function(n,t){return new(i(n))(t)}},{22:22}],24:[function(n,t){"use strict";var u=n(11),f=n(57),e=n(52),r=[].slice,i={},o=function(n,t,r){if(!(t in i)){for(var f=[],u=0;u<t;u++)f[u]="a["+u+"]";i[t]=Function("F,a","return new F("+f.join(",")+")")}return i[t](n,r)};t.exports=Function.bind||function(n){var t=u(this),s=r.call(arguments,1),i=function(){var u=s.concat(r.call(arguments));return this instanceof i?o(t,u.length,u):e(t,u,n)};return f(t.prototype)&&(i.prototype=t.prototype),i}},{11:11,52:52,57:57}],25:[function(n,t){var i=n(26),r=n(128)("toStringTag"),u="Arguments"==i(function(){return arguments}()),f=function(n,t){try{return n[t]}catch(n){}};t.exports=function(n){var t,e,o;return void 0===n?"Undefined":null===n?"Null":"string"==typeof(e=f(t=Object(n),r))?e:u?i(t):"Object"==(o=i(t))&&"function"==typeof t.callee?"Arguments":o}},{128:128,26:26}],26:[function(n,t){var i={}.toString;t.exports=function(n){return i.call(n).slice(8,-1)}},{}],27:[function(n,t){"use strict";var s=n(75).f,h=n(74),c=n(93),l=n(32),a=n(15),v=n(45),y=n(61),u=n(63),p=n(99),e=n(36),o=n(70).fastKey,i=n(125),r=e?"_s":"size",f=function(n,t){var i,r=o(t);if("F"!==r)return n._i[r];for(i=n._f;i;i=i.n)if(i.k==t)return i};t.exports={getConstructor:function(n,t,u,o){var y=n(function(n,i){a(n,y,t,"_i");n._t=t;n._i=h(null);n._f=void 0;n._l=void 0;n[r]=0;void 0!=i&&v(i,u,n[o],n)});return c(y.prototype,{clear:function(){for(var u=i(this,t),f=u._i,n=u._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete f[n.i];u._f=u._l=void 0;u[r]=0},"delete":function(n){var e=i(this,t),u=f(e,n),o,s;return u&&(o=u.n,s=u.p,delete e._i[u.i],u.r=!0,s&&(s.n=o),o&&(o.p=s),e._f==u&&(e._f=o),e._l==u&&(e._l=s),e[r]--),!!u},forEach:function(n){i(this,t);for(var r,u=l(n,arguments.length>1?arguments[1]:void 0,3);r=r?r.n:this._f;)for(u(r.v,r.k,this);r&&r.r;)r=r.p},has:function(n){return!!f(i(this,t),n)}}),e&&s(y.prototype,"size",{get:function(){return i(this,t)[r]}}),y},def:function(n,t,i){var e,s,u=f(n,t);return u?u.v=i:(n._l=u={i:s=o(t,!0),k:t,v:i,p:e=n._l,n:void 0,r:!1},n._f||(n._f=u),e&&(e.n=u),n[r]++,"F"!==s&&(n._i[s]=u)),n},getEntry:f,setStrong:function(n,t,r){y(n,t,function(n,r){this._t=i(n,t);this._k=r;this._l=void 0},function(){for(var t=this,i=t._k,n=t._l;n&&n.r;)n=n.p;return t._t&&(t._l=n=n?n.n:t._t._f)?"keys"==i?u(0,n.k):"values"==i?u(0,n.v):u(0,[n.k,n.v]):(t._t=void 0,u(1))},r?"entries":"values",!r,!0);p(t)}}},{125:125,15:15,32:32,36:36,45:45,61:61,63:63,70:70,74:74,75:75,93:93,99:99}],28:[function(n,t){"use strict";var c=n(93),r=n(70).getWeak,l=n(16),f=n(57),a=n(15),v=n(45),e=n(20),o=n(47),s=n(125),y=e(5),p=e(6),w=0,i=function(n){return n._l||(n._l=new h)},h=function(){this.a=[]},u=function(n,t){return y(n.a,function(n){return n[0]===t})};h.prototype={get:function(n){var t=u(this,n);if(t)return t[1]},has:function(n){return!!u(this,n)},set:function(n,t){var i=u(this,n);i?i[1]=t:this.a.push([n,t])},"delete":function(n){var t=p(this.a,function(t){return t[0]===n});return~t&&this.a.splice(t,1),!!~t}};t.exports={getConstructor:function(n,t,u,e){var h=n(function(n,i){a(n,h,t,"_i");n._t=t;n._i=w++;n._l=void 0;void 0!=i&&v(i,u,n[e],n)});return c(h.prototype,{"delete":function(n){if(!f(n))return!1;var u=r(n);return!0===u?i(s(this,t)).delete(n):u&&o(u,this._i)&&delete u[this._i]},has:function(n){if(!f(n))return!1;var u=r(n);return!0===u?i(s(this,t)).has(n):u&&o(u,this._i)}}),h},def:function(n,t,u){var f=r(l(t),!0);return!0===f?i(n).set(t,u):f[n._i]=u,n},ufstore:i}},{125:125,15:15,16:16,20:20,45:45,47:47,57:57,70:70,93:93}],29:[function(n,t){"use strict";var f=n(46),i=n(40),e=n(94),o=n(93),s=n(70),h=n(45),c=n(15),r=n(57),u=n(42),l=n(62),a=n(100),v=n(51);t.exports=function(n,t,y,p,w,b){var tt=f[n],k=tt,g=w?"set":"add",d=k&&k.prototype,rt={},nt=function(n){var t=d[n];e(d,n,"delete"==n?function(n){return!(b&&!r(n))&&t.call(this,0===n?0:n)}:"has"==n?function(n){return!(b&&!r(n))&&t.call(this,0===n?0:n)}:"get"==n?function(n){if(!b||r(n))return t.call(this,0===n?0:n)}:"add"==n?function(n){return t.call(this,0===n?0:n),this}:function(n,i){return t.call(this,0===n?0:n,i),this})};if("function"==typeof k&&(b||d.forEach&&!u(function(){(new k).entries().next()}))){var it=new k,ft=it[g](b?{}:-0,1)!=it,et=u(function(){it.has(1)}),ot=l(function(n){new k(n)}),ut=!b&&u(function(){for(var t=new k,n=5;n--;)t[g](n,n);return!t.has(-0)});ot||(k=t(function(t,i){c(t,k,n);var r=v(new tt,t,k);return void 0!=i&&h(i,w,r[g],r),r}),k.prototype=d,d.constructor=k);(et||ut)&&(nt("delete"),nt("has"),w&&nt("get"));(ut||ft)&&nt(g);b&&d.clear&&delete d.clear}else k=p.getConstructor(t,n,w,g),o(k.prototype,y),s.NEED=!0;return a(k,n),rt[n]=k,i(i.G+i.W+i.F*(k!=tt),rt),b||p.setStrong(k,n,w),k}},{100:100,15:15,40:40,42:42,45:45,46:46,51:51,57:57,62:62,70:70,93:93,94:94}],30:[function(n,t){var i=t.exports={version:"2.6.1"};"number"==typeof __e&&(__e=i)},{}],31:[function(n,t){"use strict";var i=n(75),r=n(92);t.exports=function(n,t,u){t in n?i.f(n,t,r(0,u)):n[t]=u}},{75:75,92:92}],32:[function(n,t){var i=n(11);t.exports=function(n,t,r){if(i(n),void 0===t)return n;switch(r){case 1:return function(i){return n.call(t,i)};case 2:return function(i,r){return n.call(t,i,r)};case 3:return function(i,r,u){return n.call(t,i,r,u)}}return function(){return n.apply(t,arguments)}}},{11:11}],33:[function(n,t){"use strict";var u=n(42),f=Date.prototype.getTime,r=Date.prototype.toISOString,i=function(n){return n>9?n:"0"+n};t.exports=u(function(){return"0385-07-25T07:06:39.999Z"!=r.call(new Date(-50000000000001))})||!u(function(){r.call(new Date(NaN))})?function(){if(!isFinite(f.call(this)))throw RangeError("Invalid time value");var n=this,t=n.getUTCFullYear(),r=n.getUTCMilliseconds(),u=t<0?"-":t>9999?"+":"";return u+("00000"+Math.abs(t)).slice(u?-6:-4)+"-"+i(n.getUTCMonth()+1)+"-"+i(n.getUTCDate())+"T"+i(n.getUTCHours())+":"+i(n.getUTCMinutes())+":"+i(n.getUTCSeconds())+"."+(r>99?r:"0"+i(r))+"Z"}:r},{42:42}],34:[function(n,t){"use strict";var i=n(16),r=n(119);t.exports=function(n){if("string"!==n&&"number"!==n&&"default"!==n)throw TypeError("Incorrect hint");return r(i(this),"number"!=n)}},{119:119,16:16}],35:[function(n,t){t.exports=function(n){if(void 0==n)throw TypeError("Can't call method on  "+n);return n}},{}],36:[function(n,t){t.exports=!n(42)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{42:42}],37:[function(n,t){var r=n(57),i=n(46).document,u=r(i)&&r(i.createElement);t.exports=function(n){return u?i.createElement(n):{}}},{46:46,57:57}],38:[function(n,t){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],39:[function(n,t){var i=n(83),r=n(80),u=n(84);t.exports=function(n){var t=i(n),f=r.f;if(f)for(var e,o=f(n),h=u.f,s=0;o.length>s;)h.call(n,e=o[s++])&&t.push(e);return t}},{80:80,83:83,84:84}],40:[function(n,t){var r=n(46),u=n(30),e=n(48),o=n(94),f=n(32),i=function(n,t,s){var c,v,h,p,k=n&i.F,y=n&i.G,d=n&i.S,w=n&i.P,g=n&i.B,l=y?r:d?r[t]||(r[t]={}):(r[t]||{}).prototype,a=y?u:u[t]||(u[t]={}),b=a.prototype||(a.prototype={});y&&(s=t);for(c in s)v=!k&&l&&void 0!==l[c],h=(v?l:s)[c],p=g&&v?f(h,r):w&&"function"==typeof h?f(Function.call,h):h,l&&o(l,c,h,n&i.U),a[c]!=h&&e(a,c,p),w&&b[c]!=h&&(b[c]=h)};r.core=u;i.F=1;i.G=2;i.S=4;i.P=8;i.B=16;i.W=32;i.U=64;i.R=128;t.exports=i},{30:30,32:32,46:46,48:48,94:94}],41:[function(n,t){var i=n(128)("match");t.exports=function(n){var t=/./;try{"/./"[n](t)}catch(r){try{return t[i]=!1,!"/./"[n](t)}catch(n){}}return!0}},{128:128}],42:[function(n,t){t.exports=function(n){try{return!!n()}catch(n){return!0}}},{}],43:[function(n,t){"use strict";n(224);var u=n(94),f=n(48),i=n(42),e=n(35),r=n(128),o=n(96),s=r("species"),h=!i(function(){var n=/./;return n.exec=function(){var n=[];return n.groups={a:"7"},n},"7"!=="".replace(n,"$<a>")}),c=function(){var t=/(?:)/,i=t.exec,n;return t.exec=function(){return i.apply(this,arguments)},n="ab".split(t),2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(n,t,l){var a=r(n),v=!i(function(){var t={};return t[a]=function(){return 7},7!=""[n](t)}),w=v?!i(function(){var i=!1,t=/a/;return t.exec=function(){return i=!0,null},"split"===n&&(t.constructor={},t.constructor[s]=function(){return t}),t[a](""),!i}):void 0;if(!v||!w||"replace"===n&&!h||"split"===n&&!c){var b=/./[a],y=l(e,a,""[n],function(n,t,i,r,u){return t.exec===o?v&&!u?{done:!0,value:b.call(t,i,r)}:{done:!0,value:n.call(i,t,r)}:{done:!1}}),k=y[0],p=y[1];u(String.prototype,n,k);f(RegExp.prototype,a,2==t?function(n,t){return p.call(n,this,t)}:function(n){return p.call(n,this)})}}},{128:128,224:224,35:35,42:42,48:48,94:94,96:96}],44:[function(n,t){"use strict";var i=n(16);t.exports=function(){var t=i(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},{16:16}],45:[function(n,t,i){var f=n(32),e=n(59),o=n(54),s=n(16),h=n(117),c=n(129),r={},u={},i=t.exports=function(n,t,i,l,a){var d,y,w,v,b=a?function(){return n}:c(n),k=f(i,l,t?2:1),p=0;if("function"!=typeof b)throw TypeError(n+" is not iterable!");if(o(b)){for(d=h(n.length);d>p;p++)if((v=t?k(s(y=n[p])[0],y[1]):k(n[p]))===r||v===u)return v}else for(w=b.call(n);!(y=w.next()).done;)if((v=e(w,k,y.value,t))===r||v===u)return v};i.BREAK=r;i.RETURN=u},{117:117,129:129,16:16,32:32,54:54,59:59}],46:[function(n,t){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},{}],47:[function(n,t){var i={}.hasOwnProperty;t.exports=function(n,t){return i.call(n,t)}},{}],48:[function(n,t){var i=n(75),r=n(92);t.exports=n(36)?function(n,t,u){return i.f(n,t,r(1,u))}:function(n,t,i){return n[t]=i,n}},{36:36,75:75,92:92}],49:[function(n,t){var i=n(46).document;t.exports=i&&i.documentElement},{46:46}],50:[function(n,t){t.exports=!n(36)&&!n(42)(function(){return 7!=Object.defineProperty(n(37)("div"),"a",{get:function(){return 7}}).a})},{36:36,37:37,42:42}],51:[function(n,t){var r=n(57),i=n(98).set;t.exports=function(n,t,u){var f,e=t.constructor;return e!==u&&"function"==typeof e&&(f=e.prototype)!==u.prototype&&r(f)&&i&&i(n,f),n}},{57:57,98:98}],52:[function(n,t){t.exports=function(n,t,i){var r=void 0===i;switch(t.length){case 0:return r?n():n.call(i);case 1:return r?n(t[0]):n.call(i,t[0]);case 2:return r?n(t[0],t[1]):n.call(i,t[0],t[1]);case 3:return r?n(t[0],t[1],t[2]):n.call(i,t[0],t[1],t[2]);case 4:return r?n(t[0],t[1],t[2],t[3]):n.call(i,t[0],t[1],t[2],t[3])}return n.apply(i,t)}},{}],53:[function(n,t){var i=n(26);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return"String"==i(n)?n.split(""):Object(n)}},{26:26}],54:[function(n,t){var i=n(64),r=n(128)("iterator"),u=Array.prototype;t.exports=function(n){return void 0!==n&&(i.Array===n||u[r]===n)}},{128:128,64:64}],55:[function(n,t){var i=n(26);t.exports=Array.isArray||function(n){return"Array"==i(n)}},{26:26}],56:[function(n,t){var i=n(57),r=Math.floor;t.exports=function(n){return!i(n)&&isFinite(n)&&r(n)===n}},{57:57}],57:[function(n,t){t.exports=function(n){return"object"==typeof n?null!==n:"function"==typeof n}},{}],58:[function(n,t){var i=n(57),r=n(26),u=n(128)("match");t.exports=function(n){var t;return i(n)&&(void 0!==(t=n[u])?!!t:"RegExp"==r(n))}},{128:128,26:26,57:57}],59:[function(n,t){var i=n(16);t.exports=function(n,t,r,u){try{return u?t(i(r)[0],r[1]):t(r)}catch(t){var f=n.return;throw void 0!==f&&i(f.call(n)),t;}}},{16:16}],60:[function(n,t){"use strict";var r=n(74),u=n(92),f=n(100),i={};n(48)(i,n(128)("iterator"),function(){return this});t.exports=function(n,t,e){n.prototype=r(i,{next:u(1,e)});f(n,t+" Iterator")}},{100:100,128:128,48:48,74:74,92:92}],61:[function(n,t){"use strict";var f=n(65),r=n(40),h=n(94),e=n(48),o=n(64),c=n(60),l=n(100),a=n(81),i=n(128)("iterator"),u=!([].keys&&"next"in[].keys()),s=function(){return this};t.exports=function(n,t,v,y,p,w,b){c(v,t,y);var nt,it,tt,rt=function(n){if(!u&&n in k)return k[n];switch(n){case"keys":return function(){return new v(this,n)};case"values":return function(){return new v(this,n)}}return function(){return new v(this,n)}},et=t+" Iterator",ut="values"==p,ft=!1,k=n.prototype,d=k[i]||k["@@iterator"]||p&&k[p],g=d||rt(p),st=p?ut?rt("entries"):g:void 0,ot="Array"==t?k.entries||d:d;if(ot&&(tt=a(ot.call(new n)))!==Object.prototype&&tt.next&&(l(tt,et,!0),f||"function"==typeof tt[i]||e(tt,i,s)),ut&&d&&"values"!==d.name&&(ft=!0,g=function(){return d.call(this)}),f&&!b||!u&&!ft&&k[i]||e(k,i,g),o[t]=g,o[et]=s,p)if(nt={values:ut?g:rt("values"),keys:w?g:rt("keys"),entries:st},b)for(it in nt)it in k||h(k,it,nt[it]);else r(r.P+r.F*(u||ft),t,nt);return nt}},{100:100,128:128,40:40,48:48,60:60,64:64,65:65,81:81,94:94}],62:[function(n,t){var i=n(128)("iterator"),u=!1,r;try{r=[7][i]();r.return=function(){u=!0};Array.from(r,function(){throw 2;})}catch(n){}t.exports=function(n,t){var f,r,e;if(!t&&!u)return!1;f=!1;try{r=[7];e=r[i]();e.next=function(){return{done:f=!0}};r[i]=function(){return e};n(r)}catch(n){}return f}},{128:128}],63:[function(n,t){t.exports=function(n,t){return{value:t,done:!!n}}},{}],64:[function(n,t){t.exports={}},{}],65:[function(n,t){t.exports=!1},{}],66:[function(n,t){var i=Math.expm1;t.exports=!i||i(10)>22025.465794806718||i(10)<22025.465794806718||-2e-17!=i(-2e-17)?function(n){return 0==(n=+n)?n:n>-1e-6&&n<1e-6?n+n*n/2:Math.exp(n)-1}:i},{}],67:[function(n,t){var e=n(69),i=Math.pow,u=i(2,-52),r=i(2,-23),o=i(2,127)*(2-r),f=i(2,-126),s=function(n){return n+1/u-1/u};t.exports=Math.fround||function(n){var h,t,i=Math.abs(n),c=e(n);return i<f?c*s(i/f/r)*f*r:(h=(1+r/u)*i,t=h-(h-i),t>o||t!=t?c*(1/0):c*t)}},{69:69}],68:[function(n,t){t.exports=Math.log1p||function(n){return(n=+n)>-1e-8&&n<1e-8?n-n*n/2:Math.log(1+n)}},{}],69:[function(n,t){t.exports=Math.sign||function(n){return 0==(n=+n)||n!=n?n:n<0?-1:1}},{}],70:[function(n,t){var i=n(123)("meta"),e=n(57),u=n(47),o=n(75).f,s=0,r=Object.isExtensible||function(){return!0},h=!n(42)(function(){return r(Object.preventExtensions({}))}),f=function(n){o(n,i,{value:{i:"O"+ ++s,w:{}}})},c=function(n,t){if(!e(n))return"symbol"==typeof n?n:("string"==typeof n?"S":"P")+n;if(!u(n,i)){if(!r(n))return"F";if(!t)return"E";f(n)}return n[i].i},l=function(n,t){if(!u(n,i)){if(!r(n))return!0;if(!t)return!1;f(n)}return n[i].w},a=function(n){return h&&v.NEED&&r(n)&&!u(n,i)&&f(n),n},v=t.exports={KEY:i,NEED:!1,fastKey:c,getWeak:l,onFreeze:a}},{123:123,42:42,47:47,57:57,75:75}],71:[function(n,t){var i=n(46),o=n(112).set,f=i.MutationObserver||i.WebKitMutationObserver,r=i.process,u=i.Promise,e="process"==n(26)(r);t.exports=function(){var n,s,t,h=function(){var i,u;for(e&&(i=r.domain)&&i.exit();n;){u=n.fn;n=n.next;try{u()}catch(i){throw n?t():s=void 0,i;}}s=void 0;i&&i.enter()},a,c,l;return e?t=function(){r.nextTick(h)}:!f||i.navigator&&i.navigator.standalone?u&&u.resolve?(a=u.resolve(void 0),t=function(){a.then(h)}):t=function(){o.call(i,h)}:(c=!0,l=document.createTextNode(""),new f(h).observe(l,{characterData:!0}),t=function(){l.data=c=!c}),function(i){var r={fn:i,next:void 0};s&&(s.next=r);n||(n=r,t());s=r}}},{112:112,26:26,46:46}],72:[function(n,t){"use strict";function r(n){var t,r;this.promise=new n(function(n,i){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=n;r=i});this.resolve=i(t);this.reject=i(r)}var i=n(11);t.exports.f=function(n){return new r(n)}},{11:11}],73:[function(n,t){"use strict";var r=n(83),u=n(80),f=n(84),e=n(118),o=n(53),i=Object.assign;t.exports=!i||n(42)(function(){var n={},t={},r=Symbol(),u="abcdefghijklmnopqrst";return n[r]=7,u.split("").forEach(function(n){t[n]=n}),7!=i({},n)[r]||Object.keys(i({},t)).join("")!=u})?function(n){for(var s=e(n),v=arguments.length,h=1,c=u.f,y=f.f;v>h;)for(var i,t=o(arguments[h++]),l=c?r(t).concat(c(t)):r(t),p=l.length,a=0;p>a;)y.call(t,i=l[a++])&&(s[i]=t[i]);return s}:i},{118:118,42:42,53:53,80:80,83:83,84:84}],74:[function(n,t){var f=n(16),e=n(76),u=n(38),o=n(101)("IE_PROTO"),r=function(){},i=function(){var t,r=n(37)("iframe"),f=u.length;for(r.style.display="none",n(49).appendChild(r),r.src="javascript:",t=r.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),i=t.F;f--;)delete i.prototype[u[f]];return i()};t.exports=Object.create||function(n,t){var u;return null!==n?(r.prototype=f(n),u=new r,r.prototype=null,u[o]=n):u=i(),void 0===t?u:e(u,t)}},{101:101,16:16,37:37,38:38,49:49,76:76}],75:[function(n,t,i){var r=n(16),u=n(50),f=n(119),e=Object.defineProperty;i.f=n(36)?Object.defineProperty:function(n,t,i){if(r(n),t=f(t,!0),r(i),u)try{return e(n,t,i)}catch(n){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(n[t]=i.value),n}},{119:119,16:16,36:36,50:50}],76:[function(n,t){var i=n(75),r=n(16),u=n(83);t.exports=n(36)?Object.defineProperties:function(n,t){r(n);for(var f,e=u(t),s=e.length,o=0;s>o;)i.f(n,f=e[o++],t[f]);return n}},{16:16,36:36,75:75,83:83}],77:[function(n,t,i){var u=n(84),f=n(92),e=n(116),o=n(119),s=n(47),h=n(50),r=Object.getOwnPropertyDescriptor;i.f=n(36)?r:function(n,t){if(n=e(n),t=o(t,!0),h)try{return r(n,t)}catch(n){}if(s(n,t))return f(!u.f.call(n,t),n[t])}},{116:116,119:119,36:36,47:47,50:50,84:84,92:92}],78:[function(n,t){var u=n(116),i=n(79).f,f={}.toString,r="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],e=function(n){try{return i(n)}catch(n){return r.slice()}};t.exports.f=function(n){return r&&"[object Window]"==f.call(n)?e(n):i(u(n))}},{116:116,79:79}],79:[function(n,t,i){var r=n(82),u=n(38).concat("length","prototype");i.f=Object.getOwnPropertyNames||function(n){return r(n,u)}},{38:38,82:82}],80:[function(n,t,i){i.f=Object.getOwnPropertySymbols},{}],81:[function(n,t){var r=n(47),u=n(118),i=n(101)("IE_PROTO"),f=Object.prototype;t.exports=Object.getPrototypeOf||function(n){return n=u(n),r(n,i)?n[i]:"function"==typeof n.constructor&&n instanceof n.constructor?n.constructor.prototype:n instanceof Object?f:null}},{101:101,118:118,47:47}],82:[function(n,t){var i=n(47),r=n(116),u=n(19)(!1),f=n(101)("IE_PROTO");t.exports=function(n,t){var e,s=r(n),h=0,o=[];for(e in s)e!=f&&i(s,e)&&o.push(e);for(;t.length>h;)i(s,e=t[h++])&&(~u(o,e)||o.push(e));return o}},{101:101,116:116,19:19,47:47}],83:[function(n,t){var i=n(82),r=n(38);t.exports=Object.keys||function(n){return i(n,r)}},{38:38,82:82}],84:[function(n,t,i){i.f={}.propertyIsEnumerable},{}],85:[function(n,t){var i=n(40),r=n(30),u=n(42);t.exports=function(n,t){var f=(r.Object||{})[n]||Object[n],e={};e[n]=t(f);i(i.S+i.F*u(function(){f(1)}),"Object",e)}},{30:30,40:40,42:42}],86:[function(n,t){var i=n(83),r=n(116),u=n(84).f;t.exports=function(n){return function(t){for(var f,e=r(t),o=i(e),c=o.length,s=0,h=[];c>s;)u.call(e,f=o[s++])&&h.push(n?[f,e[f]]:e[f]);return h}}},{116:116,83:83,84:84}],87:[function(n,t){var r=n(79),u=n(80),f=n(16),i=n(46).Reflect;t.exports=i&&i.ownKeys||function(n){var t=r.f(f(n)),i=u.f;return i?t.concat(i(n)):t}},{16:16,46:46,79:79,80:80}],88:[function(n,t){var i=n(46).parseFloat,r=n(110).trim;t.exports=1/i(n(111)+"-0")!=-1/0?function(n){var t=r(String(n),3),u=i(t);return 0===u&&"-"==t.charAt(0)?-0:u}:i},{110:110,111:111,46:46}],89:[function(n,t){var i=n(46).parseInt,u=n(110).trim,r=n(111),f=/^[-+]?0[xX]/;t.exports=8!==i(r+"08")||22!==i(r+"0x16")?function(n,t){var r=u(String(n),3);return i(r,t>>>0||(f.test(r)?16:10))}:i},{110:110,111:111,46:46}],90:[function(n,t){t.exports=function(n){try{return{e:!1,v:n()}}catch(n){return{e:!0,v:n}}}},{}],91:[function(n,t){var i=n(16),r=n(57),u=n(72);t.exports=function(n,t){if(i(n),r(t)&&t.constructor===n)return t;var f=u.f(n);return f.resolve(t),f.promise}},{16:16,57:57,72:72}],92:[function(n,t){t.exports=function(n,t){return{enumerable:!(1&n),configurable:!(2&n),writable:!(4&n),value:t}}},{}],93:[function(n,t){var i=n(94);t.exports=function(n,t,r){for(var u in t)i(n,u,t[u],r);return n}},{94:94}],94:[function(n,t){var e=n(46),i=n(48),f=n(47),r=n(123)("src"),u=Function.toString,o=(""+u).split("toString");n(30).inspectSource=function(n){return u.call(n)};(t.exports=function(n,t,u,s){var h="function"==typeof u;h&&(f(u,"name")||i(u,"name",t));n[t]!==u&&(h&&(f(u,r)||i(u,r,n[t]?""+n[t]:o.join(String(t)))),n===e?n[t]=u:s?n[t]?n[t]=u:i(n,t,u):(delete n[t],i(n,t,u)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[r]||u.call(this)})},{123:123,30:30,46:46,47:47,48:48}],95:[function(n,t){"use strict";var i=n(25),r=RegExp.prototype.exec;t.exports=function(n,t){var f=n.exec,u;if("function"==typeof f){if(u=f.call(n,t),"object"!=typeof u)throw new TypeError("RegExp exec method returned something other than an Object or null");return u}if("RegExp"!==i(n))throw new TypeError("RegExp#exec called on incompatible receiver");return r.call(n,t)}},{25:25}],96:[function(n,t){"use strict";var e=n(44),i=RegExp.prototype.exec,o=String.prototype.replace,f=i,r=function(){var n=/a/,t=/b*/g;return i.call(n,"a"),i.call(t,"a"),0!==n.lastIndex||0!==t.lastIndex}(),u=void 0!==/()??/.exec("")[1];(r||u)&&(f=function(n){var h,c,t,s,f=this;return u&&(c=new RegExp("^"+f.source+"$(?!\\s)",e.call(f))),r&&(h=f.lastIndex),t=i.call(f,n),r&&t&&(f.lastIndex=f.global?t.index+t[0].length:h),u&&t&&t.length>1&&o.call(t[0],c,function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(t[s]=void 0)}),t});t.exports=f},{44:44}],97:[function(n,t){t.exports=Object.is||function(n,t){return n===t?0!==n||1/n==1/t:n!=n&&t!=t}},{}],98:[function(n,t){var r=n(57),u=n(16),i=function(n,t){if(u(n),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!");};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,r,u){try{u=n(32)(Function.call,n(77).f(Object.prototype,"__proto__").set,2);u(t,[]);r=!(t instanceof Array)}catch(n){r=!0}return function(n,t){return i(n,t),r?n.__proto__=t:u(n,t),n}}({},!1):void 0),check:i}},{16:16,32:32,57:57,77:77}],99:[function(n,t){"use strict";var r=n(46),u=n(75),f=n(36),i=n(128)("species");t.exports=function(n){var t=r[n];f&&t&&!t[i]&&u.f(t,i,{configurable:!0,get:function(){return this}})}},{128:128,36:36,46:46,75:75}],100:[function(n,t){var r=n(75).f,u=n(47),i=n(128)("toStringTag");t.exports=function(n,t,f){n&&!u(n=f?n:n.prototype,i)&&r(n,i,{configurable:!0,value:t})}},{128:128,47:47,75:75}],101:[function(n,t){var i=n(102)("keys"),r=n(123);t.exports=function(n){return i[n]||(i[n]=r(n))}},{102:102,123:123}],102:[function(n,t){var u=n(30),i=n(46),r=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(n,t){return r[n]||(r[n]=void 0!==t?t:{})})("versions",[]).push({version:u.version,mode:n(65)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},{30:30,46:46,65:65}],103:[function(n,t){var i=n(16),r=n(11),u=n(128)("species");t.exports=function(n,t){var f,e=i(n).constructor;return void 0===e||void 0==(f=i(e)[u])?t:r(f)}},{11:11,128:128,16:16}],104:[function(n,t){"use strict";var i=n(42);t.exports=function(n,t){return!!n&&i(function(){t?n.call(null,function(){},1):n.call(null)})}},{42:42}],105:[function(n,t){var i=n(115),r=n(35);t.exports=function(n){return function(t,u){var e,s,o=String(r(t)),f=i(u),h=o.length;return f<0||f>=h?n?"":void 0:(e=o.charCodeAt(f),e<55296||e>56319||f+1===h||(s=o.charCodeAt(f+1))<56320||s>57343?n?o.charAt(f):e:n?o.slice(f,f+2):s-56320+(e-55296<<10)+65536)}}},{115:115,35:35}],106:[function(n,t){var i=n(58),r=n(35);t.exports=function(n,t,u){if(i(t))throw TypeError("String#"+u+" doesn't accept regex!");return String(r(n))}},{35:35,58:58}],107:[function(n,t){var i=n(40),r=n(42),u=n(35),f=/"/g,e=function(n,t,i,r){var o=String(u(n)),e="<"+t;return""!==i&&(e+=" "+i+'="'+String(r).replace(f,"&quot;")+'"'),e+">"+o+"<\/"+t+">"};t.exports=function(n,t){var u={};u[n]=t(e);i(i.P+i.F*r(function(){var t=""[n]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",u)}},{35:35,40:40,42:42}],108:[function(n,t){var i=n(117),r=n(109),u=n(35);t.exports=function(n,t,f,e){var s=String(u(n)),l=s.length,c=void 0===f?" ":String(f),a=i(t),h,o;return a<=l||""==c?s:(h=a-l,o=r.call(c,Math.ceil(h/c.length)),o.length>h&&(o=o.slice(0,h)),e?o+s:s+o)}},{109:109,117:117,35:35}],109:[function(n,t){"use strict";var i=n(115),r=n(35);t.exports=function(n){var u=String(r(this)),f="",t=i(n);if(t<0||t==1/0)throw RangeError("Count can't be negative");for(;t>0;(t>>>=1)&&(u+=u))1&t&&(f+=u);return f}},{115:115,35:35}],110:[function(n,t){var r=n(40),o=n(35),s=n(42),u=n(111),i="["+u+"]",f="​",h=RegExp("^"+i+i+"*"),c=RegExp(i+i+"*$"),e=function(n,t,i){var e={},o=s(function(){return!!u[n]()||f[n]()!=f}),h=e[n]=o?t(l):u[n];i&&(e[i]=h);r(r.P+r.F*o,"String",e)},l=e.trim=function(n,t){return n=String(o(n)),1&t&&(n=n.replace(h,"")),2&t&&(n=n.replace(c,"")),n};t.exports=e},{111:111,35:35,40:40,42:42}],111:[function(n,t){t.exports="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff"},{}],112:[function(n,t){var r,o,s,e=n(32),k=n(52),v=n(49),y=n(37),i=n(46),p=i.process,h=i.setImmediate,c=i.clearImmediate,w=i.MessageChannel,l=i.Dispatch,a=0,u={},f=function(){var n=+this,t;u.hasOwnProperty(n)&&(t=u[n],delete u[n],t())},b=function(n){f.call(n.data)};h&&c||(h=function(n){for(var t=[],i=1;arguments.length>i;)t.push(arguments[i++]);return u[++a]=function(){k("function"==typeof n?n:Function(n),t)},r(a),a},c=function(n){delete u[n]},"process"==n(26)(p)?r=function(n){p.nextTick(e(f,n,1))}:l&&l.now?r=function(n){l.now(e(f,n,1))}:w?(o=new w,s=o.port2,o.port1.onmessage=b,r=e(s.postMessage,s,1)):i.addEventListener&&"function"==typeof postMessage&&!i.importScripts?(r=function(n){i.postMessage(n+"","*")},i.addEventListener("message",b,!1)):r="onreadystatechange"in y("script")?function(n){v.appendChild(y("script")).onreadystatechange=function(){v.removeChild(this);f.call(n)}}:function(n){setTimeout(e(f,n,1),0)});t.exports={set:h,clear:c}},{26:26,32:32,37:37,46:46,49:49,52:52}],113:[function(n,t){var i=n(115),r=Math.max,u=Math.min;t.exports=function(n,t){return n=i(n),n<0?r(n+t,0):u(n,t)}},{115:115}],114:[function(n,t){var i=n(115),r=n(117);t.exports=function(n){if(void 0===n)return 0;var t=i(n),u=r(t);if(t!==u)throw RangeError("Wrong length!");return u}},{115:115,117:117}],115:[function(n,t){var i=Math.ceil,r=Math.floor;t.exports=function(n){return isNaN(n=+n)?0:(n>0?r:i)(n)}},{}],116:[function(n,t){var i=n(53),r=n(35);t.exports=function(n){return i(r(n))}},{35:35,53:53}],117:[function(n,t){var i=n(115),r=Math.min;t.exports=function(n){return n>0?r(i(n),9007199254740991):0}},{115:115}],118:[function(n,t){var i=n(35);t.exports=function(n){return Object(i(n))}},{35:35}],119:[function(n,t){var i=n(57);t.exports=function(n,t){if(!i(n))return n;var r,u;if(t&&"function"==typeof(r=n.toString)&&!i(u=r.call(n))||"function"==typeof(r=n.valueOf)&&!i(u=r.call(n))||!t&&"function"==typeof(r=n.toString)&&!i(u=r.call(n)))return u;throw TypeError("Can't convert object to primitive value");}},{57:57}],120:[function(n,t){"use strict";var e;if(n(36)){var ut=n(65),w=n(46),u=n(42),i=n(40),b=n(122),yt=n(121),gi=n(32),pt=n(15),nr=n(92),f=n(48),ft=n(93),tr=n(115),k=n(117),wt=n(114),bt=n(113),kt=n(119),a=n(47),dt=n(25),h=n(57),gt=n(118),ir=n(54),rr=n(74),ur=n(81),et=n(79).f,fr=n(129),ni=n(123),ti=n(128),s=n(20),ii=n(19),ot=n(103),st=n(140),er=n(64),or=n(62),sr=n(99),hr=n(18),cr=n(17),ri=n(75),ui=n(77),v=ri.f,lr=ui.f,y=w.RangeError,fi=w.TypeError,c=w.Uint8Array,o=Array.prototype,ht=yt.ArrayBuffer,ar=yt.DataView,ei=s(0),vr=s(2),yr=s(3),pr=s(4),wr=s(5),br=s(6),kr=ii(!0),dr=ii(!1),gr=st.values,nu=st.keys,tu=st.entries,iu=o.lastIndexOf,ru=o.reduce,uu=o.reduceRight,oi=o.join,fu=o.sort,si=o.slice,p=o.toString,ct=o.toLocaleString,lt=ti("iterator"),d=ti("toStringTag"),hi=ni("typed_constructor"),g=ni("def_constructor"),ci=b.CONSTR,l=b.TYPED,eu=b.VIEW,ou=s(1,function(n,t){return tt(ot(n,n[g]),t)}),li=u(function(){return 1===new c(new Uint16Array([1]).buffer)[0]}),su=!!c&&!!c.prototype.set&&u(function(){new c(1).set({})}),nt=function(n,t){var i=tr(n);if(i<0||i%t)throw y("Wrong offset!");return i},r=function(n){if(h(n)&&l in n)return n;throw fi(n+" is not a typed array!");},tt=function(n,t){if(!(h(n)&&hi in n))throw fi("It is not a typed array constructor!");return new n(t)},ai=function(n,t){return at(ot(n,n[g]),t)},at=function(n,t){for(var i=0,r=t.length,u=tt(n,r);r>i;)u[i]=t[i++];return u},it=function(n,t,i){v(n,t,{get:function(){return this._d[i]}})},vt=function(n){var t,u,f,e,s,h,i=gt(n),c=arguments.length,r=c>1?arguments[1]:void 0,l=void 0!==r,o=fr(i);if(void 0!=o&&!ir(o)){for(h=o.call(i),f=[],t=0;!(s=h.next()).done;t++)f.push(s.value);i=f}for(l&&c>2&&(r=gi(r,arguments[2],2)),t=0,u=k(i.length),e=tt(this,u);u>t;t++)e[t]=l?r(i[t],t):i[t];return e},hu=function(){for(var n=0,t=arguments.length,i=tt(this,t);t>n;)i[n]=arguments[n++];return i},cu=!!c&&u(function(){ct.call(new c(1))}),vi=function(){return ct.apply(cu?si.call(r(this)):r(this),arguments)},yi={copyWithin:function(n,t){return cr.call(r(this),n,t,arguments.length>2?arguments[2]:void 0)},every:function(n){return pr(r(this),n,arguments.length>1?arguments[1]:void 0)},fill:function(){return hr.apply(r(this),arguments)},filter:function(n){return ai(this,vr(r(this),n,arguments.length>1?arguments[1]:void 0))},find:function(n){return wr(r(this),n,arguments.length>1?arguments[1]:void 0)},findIndex:function(n){return br(r(this),n,arguments.length>1?arguments[1]:void 0)},forEach:function(n){ei(r(this),n,arguments.length>1?arguments[1]:void 0)},indexOf:function(n){return dr(r(this),n,arguments.length>1?arguments[1]:void 0)},includes:function(n){return kr(r(this),n,arguments.length>1?arguments[1]:void 0)},join:function(){return oi.apply(r(this),arguments)},lastIndexOf:function(){return iu.apply(r(this),arguments)},map:function(n){return ou(r(this),n,arguments.length>1?arguments[1]:void 0)},reduce:function(){return ru.apply(r(this),arguments)},reduceRight:function(){return uu.apply(r(this),arguments)},reverse:function(){for(var u,n=this,t=r(n).length,f=Math.floor(t/2),i=0;i<f;)u=n[i],n[i++]=n[--t],n[t]=u;return n},some:function(n){return yr(r(this),n,arguments.length>1?arguments[1]:void 0)},sort:function(n){return fu.call(r(this),n)},subarray:function(n,t){var i=r(this),u=i.length,f=bt(n,u);return new(ot(i,i[g]))(i.buffer,i.byteOffset+f*i.BYTES_PER_ELEMENT,k((void 0===t?u:bt(t,u))-f))}},pi=function(n,t){return ai(this,si.call(r(this),n,t))},wi=function(n){r(this);var i=nt(arguments[1],1),e=this.length,u=gt(n),f=k(u.length),t=0;if(f+i>e)throw y("Wrong length!");for(;t<f;)this[i+t]=u[t++]},rt={entries:function(){return tu.call(r(this))},keys:function(){return nu.call(r(this))},values:function(){return gr.call(r(this))}},bi=function(n,t){return h(n)&&n[l]&&"symbol"!=typeof t&&t in n&&String(+t)==String(t)},ki=function(n,t){return bi(n,t=kt(t,!0))?nr(2,n[t]):lr(n,t)},di=function(n,t,i){return!(bi(n,t=kt(t,!0))&&h(i)&&a(i,"value"))||a(i,"get")||a(i,"set")||i.configurable||a(i,"writable")&&!i.writable||a(i,"enumerable")&&!i.enumerable?v(n,t,i):(n[t]=i.value,n)};ci||(ui.f=ki,ri.f=di);i(i.S+i.F*!ci,"Object",{getOwnPropertyDescriptor:ki,defineProperty:di});u(function(){p.call({})})&&(p=ct=function(){return oi.call(this)});e=ft({},yi);ft(e,rt);f(e,lt,rt.values);ft(e,{slice:pi,set:wi,constructor:function(){},toString:p,toLocaleString:vi});it(e,"buffer","b");it(e,"byteOffset","o");it(e,"byteLength","l");it(e,"length","e");v(e,d,{get:function(){return this[l]}});t.exports=function(n,t,r,o){o=!!o;var c=n+(o?"Clamped":"")+"Array",yt="get"+n,bt="set"+n,s=w[c],tt=s||{},ot=s&&ur(s),kt=!s||!b.ABV,st={},a=s&&s.prototype,gt=function(n,i){var r=n._d;return r.v[yt](i*t+r.o,li)},ni=function(n,i,r){var u=n._d;o&&(r=(r=Math.round(r))<0?0:r>255?255:255&r);u.v[bt](i*t+u.o,r,li)},ti=function(n,t){v(n,t,{get:function(){return gt(this,t)},set:function(n){return ni(this,t,n)},enumerable:!0})};kt?(s=r(function(n,i,r,u){var v,e,o,b,w,a,p;if(pt(n,s,c,"_d"),w=0,a=0,h(i)){if(!(i instanceof ht||"ArrayBuffer"==(b=dt(i))||"SharedArrayBuffer"==b))return l in i?at(s,i):vt.call(s,i);if(v=i,a=nt(r,t),p=i.byteLength,void 0===u){if(p%t)throw y("Wrong length!");if((e=p-a)<0)throw y("Wrong length!");}else if((e=k(u)*t)+a>p)throw y("Wrong length!");o=e/t}else o=wt(i),e=o*t,v=new ht(e);for(f(n,"_d",{b:v,o:a,l:e,e:o,v:new ar(v)});w<o;)ti(n,w++)}),a=s.prototype=rr(e),f(a,"constructor",s)):u(function(){s(1)})&&u(function(){new s(-1)})&&or(function(n){new s;new s(null);new s(1.5);new s(n)},!0)||(s=r(function(n,i,r,u){pt(n,s,c);var f;return h(i)?i instanceof ht||"ArrayBuffer"==(f=dt(i))||"SharedArrayBuffer"==f?void 0!==u?new tt(i,nt(r,t),u):void 0!==r?new tt(i,nt(r,t)):new tt(i):l in i?at(s,i):vt.call(s,i):new tt(wt(i))}),ei(ot!==Function.prototype?et(tt).concat(et(ot)):et(tt),function(n){n in s||f(s,n,tt[n])}),s.prototype=a,ut||(a.constructor=s));var it=a[lt],ft=!!it&&("values"==it.name||void 0==it.name),ct=rt.values;f(s,hi,!0);f(a,l,c);f(a,eu,!0);f(a,g,s);(o?new s(1)[d]==c:d in a)||v(a,d,{get:function(){return c}});st[c]=s;i(i.G+i.W+i.F*(s!=tt),st);i(i.S,c,{BYTES_PER_ELEMENT:t});i(i.S+i.F*u(function(){tt.of.call(s,1)}),c,{from:vt,of:hu});"BYTES_PER_ELEMENT"in a||f(a,"BYTES_PER_ELEMENT",t);i(i.P,c,yi);sr(c);i(i.P+i.F*su,c,{set:wi});i(i.P+i.F*!ft,c,rt);ut||a.toString==p||(a.toString=p);i(i.P+i.F*u(function(){new s(1).slice()}),c,{slice:pi});i(i.P+i.F*(u(function(){return[1,2].toLocaleString()!=new s([1,2]).toLocaleString()})||!u(function(){a.toLocaleString.call([1,2])})),c,{toLocaleString:vi});er[c]=ft?it:ct;ut||ft||f(a,lt,ct)}}else t.exports=function(){}},{103:103,113:113,114:114,115:115,117:117,118:118,119:119,121:121,122:122,123:123,128:128,129:129,140:140,15:15,17:17,18:18,19:19,20:20,25:25,32:32,36:36,40:40,42:42,46:46,47:47,48:48,54:54,57:57,62:62,64:64,65:65,74:74,75:75,77:77,79:79,81:81,92:92,93:93,99:99}],121:[function(n,t,i){"use strict";function ut(n,t,i){var r,u,e,s=new Array(i),h=8*i-t-1,c=(1<<h)-1,o=c>>1,a=23===t?f(2,-24)-f(2,-77):0,l=0,v=n<0||0===n&&1/n<0?1:0;for(n=ui(n),n!=n||n===g?(u=n!=n?1:0,r=c):(r=fi(ei(n)/oi),n*(e=f(2,-r))<1&&(r--,e*=2),n+=r+o>=1?a/e:a*f(2,1-o),n*e>=2&&(r++,e/=2),r+o>=c?(u=0,r=c):r+o>=1?(u=(n*e-1)*f(2,t),r+=o):(u=n*f(2,o-1)*f(2,t),r=0));t>=8;s[l++]=255&u,u/=256,t-=8);for(r=r<<t|u,h+=t;h>0;s[l++]=255&r,r/=256,h-=8);return s[--l]|=128*v,s}function ft(n,t,i){var e,h=8*i-t-1,c=(1<<h)-1,l=c>>1,u=h-7,o=i-1,s=n[o--],r=127&s;for(s>>=7;u>0;r=256*r+n[o],o--,u-=8);for(e=r&(1<<-u)-1,r>>=-u,u+=t;u>0;e=256*e+n[o],o--,u-=8);if(0===r)r=1-l;else{if(r===c)return e?NaN:s?-g:g;e+=f(2,t);r-=l}return(s?-1:1)*e*f(2,r-t)}function et(n){return n[3]<<24|n[2]<<16|n[1]<<8|n[0]}function ot(n){return[255&n]}function st(n){return[255&n,n>>8&255]}function ht(n){return[255&n,n>>8&255,n>>16&255,n>>24&255]}function bt(n){return ut(n,52,8)}function kt(n){return ut(n,23,4)}function v(n,t,i){ii(n[s],t,{get:function(){return this[i]}})}function e(n,t,i,r){var o=+i,u=w(o);if(u+t>n[l])throw b(yt);var s=n[nt]._b,f=u+n[tt],e=s.slice(f,f+t);return r?e:e.reverse()}function o(n,t,i,r,u,f){var s=+i,o=w(s);if(o+t>n[l])throw b(yt);for(var h=n[nt]._b,c=o+n[tt],a=r(+u),e=0;e<t;e++)h[c+e]=a[f?e:t-e-1]}var h=n(46),y=n(36),dt=n(65),ct=n(122),lt=n(48),at=n(93),d=n(42),p=n(15),gt=n(115),ni=n(117),w=n(114),ti=n(79).f,ii=n(75).f,ri=n(18),vt=n(100),s="prototype",yt="Wrong index!",r=h.ArrayBuffer,u=h.DataView,c=h.Math,b=h.RangeError,g=h.Infinity,k=r,ui=c.abs,f=c.pow,fi=c.floor,ei=c.log,oi=c.LN2,nt=y?"_b":"buffer",l=y?"_l":"byteLength",tt=y?"_o":"byteOffset",a,rt;if(ct.ABV){if(!d(function(){r(1)})||!d(function(){new r(-1)})||d(function(){return new r,new r(1.5),new r(NaN),"ArrayBuffer"!=r.name})){r=function(n){return p(this,r),new k(w(n))};for(var it,si=r[s]=k[s],pt=ti(k),wt=0;pt.length>wt;)(it=pt[wt++])in r||lt(r,it,k[it]);dt||(si.constructor=r)}a=new u(new r(2));rt=u[s].setInt8;a.setInt8(0,2147483648);a.setInt8(1,2147483649);!a.getInt8(0)&&a.getInt8(1)||at(u[s],{setInt8:function(n,t){rt.call(this,n,t<<24>>24)},setUint8:function(n,t){rt.call(this,n,t<<24>>24)}},!0)}else r=function(n){p(this,r,"ArrayBuffer");var t=w(n);this._b=ri.call(new Array(t),0);this[l]=t},u=function(n,t,i){p(this,u,"DataView");p(n,r,"DataView");var e=n[l],f=gt(t);if(f<0||f>e)throw b("Wrong offset!");if(i=void 0===i?e-f:ni(i),f+i>e)throw b("Wrong length!");this[nt]=n;this[tt]=f;this[l]=i},y&&(v(r,"byteLength","_l"),v(u,"buffer","_b"),v(u,"byteLength","_l"),v(u,"byteOffset","_o")),at(u[s],{getInt8:function(n){return e(this,1,n)[0]<<24>>24},getUint8:function(n){return e(this,1,n)[0]},getInt16:function(n){var t=e(this,2,n,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(n){var t=e(this,2,n,arguments[1]);return t[1]<<8|t[0]},getInt32:function(n){return et(e(this,4,n,arguments[1]))},getUint32:function(n){return et(e(this,4,n,arguments[1]))>>>0},getFloat32:function(n){return ft(e(this,4,n,arguments[1]),23,4)},getFloat64:function(n){return ft(e(this,8,n,arguments[1]),52,8)},setInt8:function(n,t){o(this,1,n,ot,t)},setUint8:function(n,t){o(this,1,n,ot,t)},setInt16:function(n,t){o(this,2,n,st,t,arguments[2])},setUint16:function(n,t){o(this,2,n,st,t,arguments[2])},setInt32:function(n,t){o(this,4,n,ht,t,arguments[2])},setUint32:function(n,t){o(this,4,n,ht,t,arguments[2])},setFloat32:function(n,t){o(this,4,n,kt,t,arguments[2])},setFloat64:function(n,t){o(this,8,n,bt,t,arguments[2])}});vt(r,"ArrayBuffer");vt(u,"DataView");lt(u[s],ct.VIEW,!0);i.ArrayBuffer=r;i.DataView=u},{100:100,114:114,115:115,117:117,122:122,15:15,18:18,36:36,42:42,46:46,48:48,65:65,75:75,79:79,93:93}],122:[function(n,t){for(var i,r=n(46),u=n(48),f=n(123),e=f("typed_array"),o=f("view"),s=!(!r.ArrayBuffer||!r.DataView),h=s,c=0,l="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");c<9;)(i=r[l[c++]])?(u(i.prototype,e,!0),u(i.prototype,o,!0)):h=!1;t.exports={ABV:s,CONSTR:h,TYPED:e,VIEW:o}},{123:123,46:46,48:48}],123:[function(n,t){var i=0,r=Math.random();t.exports=function(n){return"Symbol(".concat(void 0===n?"":n,")_",(++i+r).toString(36))}},{}],124:[function(n,t){var r=n(46),i=r.navigator;t.exports=i&&i.userAgent||""},{46:46}],125:[function(n,t){var i=n(57);t.exports=function(n,t){if(!i(n)||n._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return n}},{57:57}],126:[function(n,t){var r=n(46),i=n(30),u=n(65),f=n(127),e=n(75).f;t.exports=function(n){var t=i.Symbol||(i.Symbol=u?{}:r.Symbol||{});"_"==n.charAt(0)||n in t||e(t,n,{value:f.f(n)})}},{127:127,30:30,46:46,65:65,75:75}],127:[function(n,t,i){i.f=n(128)},{128:128}],128:[function(n,t){var i=n(102)("wks"),f=n(123),r=n(46).Symbol,u="function"==typeof r;(t.exports=function(n){return i[n]||(i[n]=u&&r[n]||(u?r:f)("Symbol."+n))}).store=i},{102:102,123:123,46:46}],129:[function(n,t){var i=n(25),r=n(128)("iterator"),u=n(64);t.exports=n(30).getIteratorMethod=function(n){if(void 0!=n)return n[r]||n["@@iterator"]||u[i(n)]}},{128:128,25:25,30:30,64:64}],130:[function(n){var t=n(40);t(t.P,"Array",{copyWithin:n(17)});n(13)("copyWithin")},{13:13,17:17,40:40}],131:[function(n){"use strict";var t=n(40),i=n(20)(4);t(t.P+t.F*!n(104)([].every,!0),"Array",{every:function(n){return i(this,n,arguments[1])}})},{104:104,20:20,40:40}],132:[function(n){var t=n(40);t(t.P,"Array",{fill:n(18)});n(13)("fill")},{13:13,18:18,40:40}],133:[function(n){"use strict";var t=n(40),i=n(20)(2);t(t.P+t.F*!n(104)([].filter,!0),"Array",{filter:function(n){return i(this,n,arguments[1])}})},{104:104,20:20,40:40}],134:[function(n){"use strict";var t=n(40),u=n(20)(6),i="findIndex",r=!0;i in[]&&Array(1)[i](function(){r=!1});t(t.P+t.F*r,"Array",{findIndex:function(n){return u(this,n,arguments.length>1?arguments[1]:void 0)}});n(13)(i)},{13:13,20:20,40:40}],135:[function(n){"use strict";var t=n(40),r=n(20)(5),i=!0;"find"in[]&&Array(1).find(function(){i=!1});t(t.P+t.F*i,"Array",{find:function(n){return r(this,n,arguments.length>1?arguments[1]:void 0)}});n(13)("find")},{13:13,20:20,40:40}],136:[function(n){"use strict";var t=n(40),i=n(20)(0),r=n(104)([].forEach,!0);t(t.P+t.F*!r,"Array",{forEach:function(n){return i(this,n,arguments[1])}})},{104:104,20:20,40:40}],137:[function(n){"use strict";var r=n(32),t=n(40),u=n(118),f=n(59),e=n(54),o=n(117),i=n(31),s=n(129);t(t.S+t.F*!n(62)(function(n){Array.from(n)}),"Array",{from:function(n){var a,h,v,y,c=u(n),p="function"==typeof this?this:Array,k=arguments.length,l=k>1?arguments[1]:void 0,w=void 0!==l,t=0,b=s(c);if(w&&(l=r(l,k>2?arguments[2]:void 0,2)),void 0==b||p==Array&&e(b))for(a=o(c.length),h=new p(a);a>t;t++)i(h,t,w?l(c[t],t):c[t]);else for(y=b.call(c),h=new p;!(v=y.next()).done;t++)i(h,t,w?f(y,l,[v.value,t],!0):v.value);return h.length=t,h}})},{117:117,118:118,129:129,31:31,32:32,40:40,54:54,59:59,62:62}],138:[function(n){"use strict";var t=n(40),u=n(19)(!1),i=[].indexOf,r=!!i&&1/[1].indexOf(1,-0)<0;t(t.P+t.F*(r||!n(104)(i)),"Array",{indexOf:function(n){return r?i.apply(this,arguments)||0:u(this,n,arguments[1])}})},{104:104,19:19,40:40}],139:[function(n){var t=n(40);t(t.S,"Array",{isArray:n(55)})},{40:40,55:55}],140:[function(n,t){"use strict";var r=n(13),i=n(63),u=n(64),f=n(116);t.exports=n(61)(Array,"Array",function(n,t){this._t=f(n);this._i=0;this._k=t},function(){var t=this._t,r=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==r?i(0,n):"values"==r?i(0,t[n]):i(0,[n,t[n]])},"values");u.Arguments=u.Array;r("keys");r("values");r("entries")},{116:116,13:13,61:61,63:63,64:64}],141:[function(n){"use strict";var t=n(40),r=n(116),i=[].join;t(t.P+t.F*(n(53)!=Object||!n(104)(i)),"Array",{join:function(n){return i.call(r(this),void 0===n?",":n)}})},{104:104,116:116,40:40,53:53}],142:[function(n){"use strict";var t=n(40),u=n(116),f=n(115),e=n(117),i=[].lastIndexOf,r=!!i&&1/[1].lastIndexOf(1,-0)<0;t(t.P+t.F*(r||!n(104)(i)),"Array",{lastIndexOf:function(n){if(r)return i.apply(this,arguments)||0;var o=u(this),s=e(o.length),t=s-1;for(arguments.length>1&&(t=Math.min(t,f(arguments[1]))),t<0&&(t=s+t);t>=0;t--)if(t in o&&o[t]===n)return t||0;return-1}})},{104:104,115:115,116:116,117:117,40:40}],143:[function(n){"use strict";var t=n(40),i=n(20)(1);t(t.P+t.F*!n(104)([].map,!0),"Array",{map:function(n){return i(this,n,arguments[1])}})},{104:104,20:20,40:40}],144:[function(n){"use strict";var t=n(40),i=n(31);t(t.S+t.F*n(42)(function(){function n(){}return!(Array.of.call(n)instanceof n)}),"Array",{of:function(){for(var n=0,t=arguments.length,r=new("function"==typeof this?this:Array)(t);t>n;)i(r,n,arguments[n++]);return r.length=t,r}})},{31:31,40:40,42:42}],145:[function(n){"use strict";var t=n(40),i=n(21);t(t.P+t.F*!n(104)([].reduceRight,!0),"Array",{reduceRight:function(n){return i(this,n,arguments.length,arguments[1],!0)}})},{104:104,21:21,40:40}],146:[function(n){"use strict";var t=n(40),i=n(21);t(t.P+t.F*!n(104)([].reduce,!0),"Array",{reduce:function(n){return i(this,n,arguments.length,arguments[1],!1)}})},{104:104,21:21,40:40}],147:[function(n){"use strict";var t=n(40),i=n(49),e=n(26),r=n(113),u=n(117),f=[].slice;t(t.P+t.F*n(42)(function(){i&&f.call(i)}),"Array",{slice:function(n,t){var o=u(this.length),h=e(this);if(t=void 0===t?o:t,"Array"==h)return f.call(this,n,t);for(var s=r(n,o),a=r(t,o),c=u(a-s),l=new Array(c),i=0;i<c;i++)l[i]="String"==h?this.charAt(s+i):this[s+i];return l}})},{113:113,117:117,26:26,40:40,42:42,49:49}],148:[function(n){"use strict";var t=n(40),i=n(20)(3);t(t.P+t.F*!n(104)([].some,!0),"Array",{some:function(n){return i(this,n,arguments[1])}})},{104:104,20:20,40:40}],149:[function(n){"use strict";var t=n(40),e=n(11),r=n(118),u=n(42),i=[].sort,f=[1,2,3];t(t.P+t.F*(u(function(){f.sort(void 0)})||!u(function(){f.sort(null)})||!n(104)(i)),"Array",{sort:function(n){return void 0===n?i.call(r(this)):i.call(r(this),e(n))}})},{104:104,11:11,118:118,40:40,42:42}],150:[function(n){n(99)("Array")},{99:99}],151:[function(n){var t=n(40);t(t.S,"Date",{now:function(){return(new Date).getTime()}})},{40:40}],152:[function(n){var t=n(40),i=n(33);t(t.P+t.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},{33:33,40:40}],153:[function(n){"use strict";var t=n(40),i=n(118),r=n(119);t(t.P+t.F*n(42)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(){var n=i(this),t=r(n);return"number"!=typeof t||isFinite(t)?n.toISOString():null}})},{118:118,119:119,40:40,42:42}],154:[function(n){var t=n(128)("toPrimitive"),i=Date.prototype;t in i||n(48)(i,t,n(34))},{128:128,34:34,48:48}],155:[function(n){var t=Date.prototype,i=t.toString,r=t.getTime;new Date(NaN)+""!="Invalid Date"&&n(94)(t,"toString",function(){var n=r.call(this);return n===n?i.call(this):"Invalid Date"})},{94:94}],156:[function(n){var t=n(40);t(t.P,"Function",{bind:n(24)})},{24:24,40:40}],157:[function(n){"use strict";var t=n(57),u=n(81),i=n(128)("hasInstance"),r=Function.prototype;i in r||n(75).f(r,i,{value:function(n){if("function"!=typeof this||!t(n))return!1;if(!t(this.prototype))return n instanceof this;for(;n=u(n);)if(this.prototype===n)return!0;return!1}})},{128:128,57:57,75:75,81:81}],158:[function(n){var i=n(75).f,t=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in t||n(36)&&i(t,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(n){return""}}})},{36:36,75:75}],159:[function(n,t){"use strict";var i=n(27),r=n(125);t.exports=n(29)("Map",function(n){return function(){return n(this,arguments.length>0?arguments[0]:void 0)}},{get:function(n){var t=i.getEntry(r(this,"Map"),n);return t&&t.v},set:function(n,t){return i.def(r(this,"Map"),0===n?0:n,t)}},i,!0)},{125:125,27:27,29:29}],160:[function(n){var t=n(40),u=n(68),r=Math.sqrt,i=Math.acosh;t(t.S+t.F*!(i&&710==Math.floor(i(Number.MAX_VALUE))&&i(1/0)==1/0),"Math",{acosh:function(n){return(n=+n)<1?NaN:n>94906265.624251559?Math.log(n)+Math.LN2:u(n-1+r(n-1)*r(n+1))}})},{40:40,68:68}],161:[function(n){function i(n){return isFinite(n=+n)&&0!=n?n<0?-i(-n):Math.log(n+Math.sqrt(n*n+1)):n}var t=n(40),r=Math.asinh;t(t.S+t.F*!(r&&1/r(0)>0),"Math",{asinh:i})},{40:40}],162:[function(n){var t=n(40),i=Math.atanh;t(t.S+t.F*!(i&&1/i(-0)<0),"Math",{atanh:function(n){return 0==(n=+n)?n:Math.log((1+n)/(1-n))/2}})},{40:40}],163:[function(n){var t=n(40),i=n(69);t(t.S,"Math",{cbrt:function(n){return i(n=+n)*Math.pow(Math.abs(n),1/3)}})},{40:40,69:69}],164:[function(n){var t=n(40);t(t.S,"Math",{clz32:function(n){return(n>>>=0)?31-Math.floor(Math.log(n+.5)*Math.LOG2E):32}})},{40:40}],165:[function(n){var t=n(40),i=Math.exp;t(t.S,"Math",{cosh:function(n){return(i(n=+n)+i(-n))/2}})},{40:40}],166:[function(n){var t=n(40),i=n(66);t(t.S+t.F*(i!=Math.expm1),"Math",{expm1:i})},{40:40,66:66}],167:[function(n){var t=n(40);t(t.S,"Math",{fround:n(67)})},{40:40,67:67}],168:[function(n){var t=n(40),i=Math.abs;t(t.S,"Math",{hypot:function(){for(var n,t,u=0,f=0,e=arguments.length,r=0;f<e;)n=i(arguments[f++]),r<n?(t=r/n,u=u*t*t+1,r=n):n>0?(t=n/r,u+=t*t):u+=n;return r===1/0?1/0:r*Math.sqrt(u)}})},{40:40}],169:[function(n){var t=n(40),i=Math.imul;t(t.S+t.F*n(42)(function(){return-5!=i(4294967295,5)||2!=i.length}),"Math",{imul:function(n,t){var i=+n,r=+t,u=65535&i,f=65535&r;return 0|u*f+((65535&i>>>16)*f+u*(65535&r>>>16)<<16>>>0)}})},{40:40,42:42}],170:[function(n){var t=n(40);t(t.S,"Math",{log10:function(n){return Math.log(n)*Math.LOG10E}})},{40:40}],171:[function(n){var t=n(40);t(t.S,"Math",{log1p:n(68)})},{40:40,68:68}],172:[function(n){var t=n(40);t(t.S,"Math",{log2:function(n){return Math.log(n)/Math.LN2}})},{40:40}],173:[function(n){var t=n(40);t(t.S,"Math",{sign:n(69)})},{40:40,69:69}],174:[function(n){var t=n(40),i=n(66),r=Math.exp;t(t.S+t.F*n(42)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(n){return Math.abs(n=+n)<1?(i(n)-i(-n))/2:(r(n-1)-r(-n-1))*(Math.E/2)}})},{40:40,42:42,66:66}],175:[function(n){var t=n(40),i=n(66),r=Math.exp;t(t.S,"Math",{tanh:function(n){var t=i(n=+n),u=i(-n);return t==1/0?1:u==1/0?-1:(t-u)/(r(n)+r(-n))}})},{40:40,66:66}],176:[function(n){var t=n(40);t(t.S,"Math",{trunc:function(n){return(n>0?Math.floor:Math.ceil)(n)}})},{40:40}],177:[function(n){"use strict";var o=n(46),s=n(47),h=n(26),l=n(51),a=n(119),v=n(42),y=n(79).f,p=n(77).f,w=n(75).f,b=n(110).trim,t=o.Number,i=t,r=t.prototype,k="Number"==h(n(74)(r)),d="trim"in String.prototype,c=function(n){var t=a(n,!1),o,r,u,i;if("string"==typeof t&&t.length>2)if(t=d?t.trim():b(t,3),i=t.charCodeAt(0),43===i||45===i){if(88===(o=t.charCodeAt(2))||120===o)return NaN}else if(48===i){switch(t.charCodeAt(1)){case 66:case 98:r=2;u=49;break;case 79:case 111:r=8;u=55;break;default:return+t}for(var s,f=t.slice(2),e=0,h=f.length;e<h;e++)if((s=f.charCodeAt(e))<48||s>u)return NaN;return parseInt(f,r)}return+t},u,e,f;if(!t(" 0o1")||!t("0b1")||t("+0x1")){for(t=function(n){var f=arguments.length<1?0:n,u=this;return u instanceof t&&(k?v(function(){r.valueOf.call(u)}):"Number"!=h(u))?l(new i(c(f)),u,t):c(f)},e=n(36)?y(i):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),f=0;e.length>f;f++)s(i,u=e[f])&&!s(t,u)&&w(t,u,p(i,u));t.prototype=r;r.constructor=t;n(94)(o,"Number",t)}},{110:110,119:119,26:26,36:36,42:42,46:46,47:47,51:51,74:74,75:75,77:77,79:79,94:94}],178:[function(n){var t=n(40);t(t.S,"Number",{EPSILON:Math.pow(2,-52)})},{40:40}],179:[function(n){var t=n(40),i=n(46).isFinite;t(t.S,"Number",{isFinite:function(n){return"number"==typeof n&&i(n)}})},{40:40,46:46}],180:[function(n){var t=n(40);t(t.S,"Number",{isInteger:n(56)})},{40:40,56:56}],181:[function(n){var t=n(40);t(t.S,"Number",{isNaN:function(n){return n!=n}})},{40:40}],182:[function(n){var t=n(40),i=n(56),r=Math.abs;t(t.S,"Number",{isSafeInteger:function(n){return i(n)&&r(n)<=9007199254740991}})},{40:40,56:56}],183:[function(n){var t=n(40);t(t.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{40:40}],184:[function(n){var t=n(40);t(t.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},{40:40}],185:[function(n){var t=n(40),i=n(88);t(t.S+t.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},{40:40,88:88}],186:[function(n){var t=n(40),i=n(89);t(t.S+t.F*(Number.parseInt!=i),"Number",{parseInt:i})},{40:40,89:89}],187:[function(n){"use strict";var u=n(40),l=n(115),a=n(12),f=n(109),o=1..toFixed,s=Math.floor,t=[0,0,0,0,0,0],h="Number.toFixed: incorrect invocation!",i=function(n,i){for(var u=-1,r=i;++u<6;)r+=n*t[u],t[u]=r%1e7,r=s(r/1e7)},e=function(n){for(var r=6,i=0;--r>=0;)i+=t[r],t[r]=s(i/n),i=i%n*1e7},c=function(){for(var r,i=6,n="";--i>=0;)(""!==n||0===i||0!==t[i])&&(r=String(t[i]),n=""===n?r:n+f.call("0",7-r.length)+r);return n},r=function(n,t,i){return 0===t?i:t%2==1?r(n,t-1,i*n):r(n*n,t/2,i)},v=function(n){for(var i=0,t=n;t>=4096;)i+=12,t/=4096;for(;t>=2;)i+=1,t/=2;return i};u(u.P+u.F*(!!o&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0))||!n(42)(function(){o.call({})})),"Number",{toFixed:function(n){var s,w,y,p,t=a(this,h),o=l(n),b="",u="0";if(o<0||o>20)throw RangeError(h);if(t!=t)return"NaN";if(t<=-1e21||t>=1e21)return String(t);if(t<0&&(b="-",t=-t),t>1e-21)if(s=v(t*r(2,69,1))-69,w=s<0?t*r(2,-s,1):t/r(2,s,1),w*=4503599627370496,(s=52-s)>0){for(i(0,w),y=o;y>=7;)i(1e7,0),y-=7;for(i(r(10,y,1),0),y=s-1;y>=23;)e(8388608),y-=23;e(1<<y);i(1,1);e(2);u=c()}else i(0,w),i(1<<-s,0),u=c()+f.call("0",o);return o>0?(p=u.length,u=b+(p<=o?"0."+f.call("0",o-p)+u:u.slice(0,p-o)+"."+u.slice(p-o))):u=b+u,u}})},{109:109,115:115,12:12,40:40,42:42}],188:[function(n){"use strict";var i=n(40),r=n(42),u=n(12),t=1..toPrecision;i(i.P+i.F*(r(function(){return"1"!==t.call(1,void 0)})||!r(function(){t.call({})})),"Number",{toPrecision:function(n){var i=u(this,"Number#toPrecision: incorrect invocation!");return void 0===n?t.call(i):t.call(i,n)}})},{12:12,40:40,42:42}],189:[function(n){var t=n(40);t(t.S+t.F,"Object",{assign:n(73)})},{40:40,73:73}],190:[function(n){var t=n(40);t(t.S,"Object",{create:n(74)})},{40:40,74:74}],191:[function(n){var t=n(40);t(t.S+t.F*!n(36),"Object",{defineProperties:n(76)})},{36:36,40:40,76:76}],192:[function(n){var t=n(40);t(t.S+t.F*!n(36),"Object",{defineProperty:n(75).f})},{36:36,40:40,75:75}],193:[function(n){var t=n(57),i=n(70).onFreeze;n(85)("freeze",function(n){return function(r){return n&&t(r)?n(i(r)):r}})},{57:57,70:70,85:85}],194:[function(n){var t=n(116),i=n(77).f;n(85)("getOwnPropertyDescriptor",function(){return function(n,r){return i(t(n),r)}})},{116:116,77:77,85:85}],195:[function(n){n(85)("getOwnPropertyNames",function(){return n(78).f})},{78:78,85:85}],196:[function(n){var t=n(118),i=n(81);n(85)("getPrototypeOf",function(){return function(n){return i(t(n))}})},{118:118,81:81,85:85}],197:[function(n){var t=n(57);n(85)("isExtensible",function(n){return function(i){return!!t(i)&&(!n||n(i))}})},{57:57,85:85}],198:[function(n){var t=n(57);n(85)("isFrozen",function(n){return function(i){return!t(i)||!!n&&n(i)}})},{57:57,85:85}],199:[function(n){var t=n(57);n(85)("isSealed",function(n){return function(i){return!t(i)||!!n&&n(i)}})},{57:57,85:85}],200:[function(n){var t=n(40);t(t.S,"Object",{is:n(97)})},{40:40,97:97}],201:[function(n){var t=n(118),i=n(83);n(85)("keys",function(){return function(n){return i(t(n))}})},{118:118,83:83,85:85}],202:[function(n){var t=n(57),i=n(70).onFreeze;n(85)("preventExtensions",function(n){return function(r){return n&&t(r)?n(i(r)):r}})},{57:57,70:70,85:85}],203:[function(n){var t=n(57),i=n(70).onFreeze;n(85)("seal",function(n){return function(r){return n&&t(r)?n(i(r)):r}})},{57:57,70:70,85:85}],204:[function(n){var t=n(40);t(t.S,"Object",{setPrototypeOf:n(98).set})},{40:40,98:98}],205:[function(n){"use strict";var i=n(25),t={};t[n(128)("toStringTag")]="z";t+""!="[object z]"&&n(94)(Object.prototype,"toString",function(){return"[object "+i(this)+"]"},!0)},{128:128,25:25,94:94}],206:[function(n){var t=n(40),i=n(88);t(t.G+t.F*(parseFloat!=i),{parseFloat:i})},{40:40,88:88}],207:[function(n){var t=n(40),i=n(89);t(t.G+t.F*(parseInt!=i),{parseInt:i})},{40:40,89:89}],208:[function(n){"use strict";var c,w,b,a,k=n(65),r=n(46),u=n(32),et=n(25),t=n(40),ot=n(57),st=n(11),ht=n(15),d=n(45),ct=n(103),g=n(112).set,nt=n(71)(),tt=n(72),v=n(90),lt=n(124),at=n(91),it=r.TypeError,f=r.process,rt=f&&f.versions,vt=rt&&rt.v8||"",i=r.Promise,o="process"==et(f),l=function(){},s=w=tt.f,h=!!function(){try{var t=i.resolve(1),r=(t.constructor={})[n(128)("species")]=function(n){n(l,l)};return(o||"function"==typeof PromiseRejectionEvent)&&t.then(l)instanceof r&&0!==vt.indexOf("6.6")&&-1===lt.indexOf("Chrome/66")}catch(n){}}(),ut=function(n){var t;return!(!ot(n)||"function"!=typeof(t=n.then))&&t},y=function(n,t){if(!n._n){n._n=!0;var i=n._c;nt(function(){for(var r=n._v,u=1==n._s,f=0;i.length>f;)!function(t){var i,s,h,o=u?t.ok:t.fail,c=t.resolve,e=t.reject,f=t.domain;try{o?(u||(2==n._h&&pt(n),n._h=1),!0===o?i=r:(f&&f.enter(),i=o(r),f&&(f.exit(),h=!0)),i===t.promise?e(it("Promise-chain cycle")):(s=ut(i))?s.call(i,c,e):c(i)):e(r)}catch(n){f&&!h&&f.exit();e(n)}}(i[f++]);n._c=[];n._n=!1;t&&!n._h&&yt(n)})}},yt=function(n){g.call(r,function(){var t,e,i,u=n._v,s=ft(n);if(s&&(t=v(function(){o?f.emit("unhandledRejection",u,n):(e=r.onunhandledrejection)?e({promise:n,reason:u}):(i=r.console)&&i.error&&i.error("Unhandled promise rejection",u)}),n._h=o||ft(n)?2:1),n._a=void 0,s&&t.e)throw t.v;})},ft=function(n){return 1!==n._h&&0===(n._a||n._c).length},pt=function(n){g.call(r,function(){var t;o?f.emit("rejectionHandled",n):(t=r.onrejectionhandled)&&t({promise:n,reason:n._v})})},e=function(n){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=n,t._s=2,t._a||(t._a=t._c.slice()),y(t,!0))},p=function(n){var i,t=this;if(!t._d){t._d=!0;t=t._w||t;try{if(t===n)throw it("Promise can't be resolved itself");(i=ut(n))?nt(function(){var r={_w:t,_d:!1};try{i.call(n,u(p,r,1),u(e,r,1))}catch(n){e.call(r,n)}}):(t._v=n,t._s=1,y(t,!1))}catch(n){e.call({_w:t,_d:!1},n)}}};h||(i=function(n){ht(this,i,"Promise","_h");st(n);c.call(this);try{n(u(p,this,1),u(e,this,1))}catch(n){e.call(this,n)}},c=function(){this._c=[];this._a=void 0;this._s=0;this._d=!1;this._v=void 0;this._h=0;this._n=!1},c.prototype=n(93)(i.prototype,{then:function(n,t){var r=s(ct(this,i));return r.ok="function"!=typeof n||n,r.fail="function"==typeof t&&t,r.domain=o?f.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&y(this,!1),r.promise},"catch":function(n){return this.then(void 0,n)}}),b=function(){var n=new c;this.promise=n;this.resolve=u(p,n,1);this.reject=u(e,n,1)},tt.f=s=function(n){return n===i||n===a?new b(n):w(n)});t(t.G+t.W+t.F*!h,{Promise:i});n(100)(i,"Promise");n(99)("Promise");a=n(30).Promise;t(t.S+t.F*!h,"Promise",{reject:function(n){var t=s(this);return t.reject(n),t.promise}});t(t.S+t.F*(k||!h),"Promise",{resolve:function(n){return at(k&&this===a?i:this,n)}});t(t.S+t.F*!(h&&n(62)(function(n){i.all(n).catch(l)})),"Promise",{all:function(n){var i=this,t=s(i),r=t.resolve,u=t.reject,f=v(function(){var t=[],e=0,f=1;d(n,!1,function(n){var s=e++,o=!1;t.push(void 0);f++;i.resolve(n).then(function(n){o||(o=!0,t[s]=n,--f||r(t))},u)});--f||r(t)});return f.e&&u(f.v),t.promise},race:function(n){var i=this,t=s(i),r=t.reject,u=v(function(){d(n,!1,function(n){i.resolve(n).then(t.resolve,r)})});return u.e&&r(u.v),t.promise}})},{100:100,103:103,11:11,112:112,124:124,128:128,15:15,25:25,30:30,32:32,40:40,45:45,46:46,57:57,62:62,65:65,71:71,72:72,90:90,91:91,93:93,99:99}],209:[function(n){var t=n(40),r=n(11),u=n(16),i=(n(46).Reflect||{}).apply,f=Function.apply;t(t.S+t.F*!n(42)(function(){i(function(){})}),"Reflect",{apply:function(n,t,e){var o=r(n),s=u(e);return i?i(o,t,s):f.call(o,t,s)}})},{11:11,16:16,40:40,42:42,46:46}],210:[function(n){var t=n(40),s=n(74),r=n(11),h=n(16),u=n(57),f=n(42),c=n(24),i=(n(46).Reflect||{}).construct,e=f(function(){function n(){}return!(i(function(){},[],n)instanceof n)}),o=!f(function(){i(function(){})});t(t.S+t.F*(e||o),"Reflect",{construct:function(n,t){var f,l;if(r(n),h(t),f=arguments.length<3?n:r(arguments[2]),o&&!e)return i(n,t,f);if(n==f){switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3])}return l=[null],l.push.apply(l,t),new(c.apply(n,l))}var a=f.prototype,v=s(u(a)?a:Object.prototype),y=Function.apply.call(n,v,t);return u(y)?y:v}})},{11:11,16:16,24:24,40:40,42:42,46:46,57:57,74:74}],211:[function(n){var i=n(75),t=n(40),r=n(16),u=n(119);t(t.S+t.F*n(42)(function(){Reflect.defineProperty(i.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(n,t,f){r(n);t=u(t,!0);r(f);try{return i.f(n,t,f),!0}catch(n){return!1}}})},{119:119,16:16,40:40,42:42,75:75}],212:[function(n){var t=n(40),i=n(77).f,r=n(16);t(t.S,"Reflect",{deleteProperty:function(n,t){var u=i(r(n),t);return!(u&&!u.configurable)&&delete n[t]}})},{16:16,40:40,77:77}],213:[function(n){"use strict";var t=n(40),r=n(16),i=function(n){this._t=r(n);this._i=0;var t,i=this._k=[];for(t in n)i.push(t)};n(60)(i,"Object",function(){var t,n=this,i=n._k;do if(n._i>=i.length)return{value:void 0,done:!0};while(!((t=i[n._i++])in n._t));return{value:t,done:!1}});t(t.S,"Reflect",{enumerate:function(n){return new i(n)}})},{16:16,40:40,60:60}],214:[function(n){var i=n(77),t=n(40),r=n(16);t(t.S,"Reflect",{getOwnPropertyDescriptor:function(n,t){return i.f(r(n),t)}})},{16:16,40:40,77:77}],215:[function(n){var t=n(40),i=n(81),r=n(16);t(t.S,"Reflect",{getPrototypeOf:function(n){return i(r(n))}})},{16:16,40:40,81:81}],216:[function(n){function t(n,i){var s,c,h=arguments.length<3?n:arguments[2];return o(n)===h?n[i]:(s=r.f(n,i))?f(s,"value")?s.value:void 0!==s.get?s.get.call(h):void 0:e(c=u(n))?t(c,i,h):void 0}var r=n(77),u=n(81),f=n(47),i=n(40),e=n(57),o=n(16);i(i.S,"Reflect",{get:t})},{16:16,40:40,47:47,57:57,77:77,81:81}],217:[function(n){var t=n(40);t(t.S,"Reflect",{has:function(n,t){return t in n}})},{40:40}],218:[function(n){var t=n(40),r=n(16),i=Object.isExtensible;t(t.S,"Reflect",{isExtensible:function(n){return r(n),!i||i(n)}})},{16:16,40:40}],219:[function(n){var t=n(40);t(t.S,"Reflect",{ownKeys:n(87)})},{40:40,87:87}],220:[function(n){var t=n(40),r=n(16),i=Object.preventExtensions;t(t.S,"Reflect",{preventExtensions:function(n){r(n);try{return i&&i(n),!0}catch(n){return!1}}})},{16:16,40:40}],221:[function(n){var i=n(40),t=n(98);t&&i(i.S,"Reflect",{setPrototypeOf:function(n,i){t.check(n,i);try{return t.set(n,i),!0}catch(n){return!1}}})},{40:40,98:98}],222:[function(n){function t(n,u,c){var l,y,a=arguments.length<4?n:arguments[3],v=r.f(h(n),u);if(!v){if(e(y=o(n)))return t(y,u,c,a);v=f(0)}if(s(v,"value")){if(!1===v.writable||!e(a))return!1;if(l=r.f(a,u)){if(l.get||l.set||!1===l.writable)return!1;l.value=c;i.f(a,u,l)}else i.f(a,u,f(0,c));return!0}return void 0!==v.set&&(v.set.call(a,c),!0)}var i=n(75),r=n(77),o=n(81),s=n(47),u=n(40),f=n(92),h=n(16),e=n(57);u(u.S,"Reflect",{set:t})},{16:16,40:40,47:47,57:57,75:75,77:77,81:81,92:92}],223:[function(n){var s=n(46),c=n(51),l=n(75).f,a=n(79).f,v=n(58),y=n(44),t=s.RegExp,i=t,u=t.prototype,r=/a/g,f=/a/g,h=new t(r)!==r,e,o;if(n(36)&&(!h||n(42)(function(){return f[n(128)("match")]=!1,t(r)!=r||t(f)==f||"/a/i"!=t(r,"i")}))){for(t=function(n,r){var o=this instanceof t,f=v(n),e=void 0===r;return!o&&f&&n.constructor===t&&e?n:c(h?new i(f&&!e?n.source:n,r):i((f=n instanceof t)?n.source:n,f&&e?y.call(n):r),o?this:u,t)},e=a(i),o=0;e.length>o;)!function(n){n in t||l(t,n,{configurable:!0,get:function(){return i[n]},set:function(t){i[n]=t}})}(e[o++]);u.constructor=t;t.prototype=u;n(94)(s,"RegExp",t)}n(99)("RegExp")},{128:128,36:36,42:42,44:44,46:46,51:51,58:58,75:75,79:79,94:94,99:99}],224:[function(n){"use strict";var t=n(96);n(40)({target:"RegExp",proto:!0,forced:t!==/./.exec},{exec:t})},{40:40,96:96}],225:[function(n){n(36)&&"g"!=/./g.flags&&n(75).f(RegExp.prototype,"flags",{configurable:!0,get:n(44)})},{36:36,44:44,75:75}],226:[function(n){"use strict";var i=n(16),r=n(117),u=n(14),t=n(95);n(43)("match",1,function(n,f,e,o){return[function(t){var i=n(this),r=void 0==t?void 0:t[f];return void 0!==r?r.call(t,i):new RegExp(t)[f](String(i))},function(n){var a=o(e,n,this),f,s,v,y,c,h,l;if(a.done)return a.value;if(f=i(n),s=String(this),!f.global)return t(f,s);for(v=f.unicode,f.lastIndex=0,c=[],h=0;null!==(y=t(f,s));)l=String(y[0]),c[h]=l,""===l&&(f.lastIndex=u(s,r(f.lastIndex),v)),h++;return 0===h?null:c}]})},{117:117,14:14,16:16,43:43,95:95}],227:[function(n){"use strict";var t=n(16),i=n(118),r=n(117),u=n(115),f=n(14),e=n(95),o=Math.max,s=Math.min,h=Math.floor,c=/\$([$&`']|\d\d?|<[^>]*>)/g,l=/\$([$&`']|\d\d?)/g,a=function(n){return void 0===n?n:String(n)};n(43)("replace",2,function(n,v,y,p){function w(n,t,r,u,f,e){var a=r+n.length,o=u.length,s=l;return void 0!==f&&(f=i(f),s=c),y.call(e,s,function(i,e){var l,s,c;switch(e.charAt(0)){case"$":return"$";case"&":return n;case"`":return t.slice(0,r);case"'":return t.slice(a);case"<":l=f[e.slice(1,-1)];break;default:if(s=+e,0===s)return e;if(s>o)return c=h(s/10),0===c?e:c<=o?void 0===u[c-1]?e.charAt(1):u[c-1]+e.charAt(1):e;l=u[s-1]}return void 0===l?"":l})}return[function(t,i){var r=n(this),u=void 0==t?void 0:t[v];return void 0!==u?u.call(t,r,i):y.call(String(r),t,i)},function(n,i){var et=p(y,n,this,i),g,st,b,h,d,ut,ft;if(et.done)return et.value;var l=t(n),c=String(this),ot="function"==typeof i;for(ot||(i=String(i)),g=l.global,g&&(st=l.unicode,l.lastIndex=0),b=[];;){if(h=e(l,c),null===h)break;if(b.push(h),!g)break;""===String(h[0])&&(l.lastIndex=f(c,r(l.lastIndex),st))}for(var ht="",k=0,nt=0;nt<b.length;nt++){h=b[nt];for(var tt=String(h[0]),v=o(s(u(h.index),c.length),0),it=[],rt=1;rt<h.length;rt++)it.push(a(h[rt]));d=h.groups;ot?(ut=[tt].concat(it,v,c),void 0!==d&&ut.push(d),ft=String(i.apply(void 0,ut))):ft=w(tt,c,v,it,d,i);v>=k&&(ht+=c.slice(k,v)+ft,k=v+tt.length)}return ht+c.slice(k)}]})},{115:115,117:117,118:118,14:14,16:16,43:43,95:95}],228:[function(n){"use strict";var i=n(16),t=n(97),r=n(95);n(43)("search",1,function(n,u,f,e){return[function(t){var i=n(this),r=void 0==t?void 0:t[u];return void 0!==r?r.call(t,i):new RegExp(t)[u](String(i))},function(n){var h=e(f,n,this),s;if(h.done)return h.value;var u=i(n),c=String(this),o=u.lastIndex;return t(o,0)||(u.lastIndex=0),s=r(u,c),t(u.lastIndex,o)||(u.lastIndex=o),null===s?-1:s.index}]})},{16:16,43:43,95:95,97:97}],229:[function(n){"use strict";var u=n(58),f=n(16),e=n(103),o=n(14),s=n(117),r=n(95),h=n(96),c=Math.min,l=[].push,t="length",i=!!function(){try{return new RegExp("x","y")}catch(n){}}();n(43)("split",2,function(n,a,v,y){var p;return p="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[t]||2!="ab".split(/(?:ab)*/)[t]||4!=".".split(/(.?)(.?)/)[t]||".".split(/()()/)[t]>1||"".split(/.?/)[t]?function(n,i){var e=String(this);if(void 0===n&&0===i)return[];if(!u(n))return v.call(e,n,i);for(var f,a,y,r=[],p=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(n.sticky?"y":""),o=0,c=void 0===i?4294967295:i>>>0,s=new RegExp(n.source,p+"g");(f=h.call(s,e))&&!((a=s.lastIndex)>o&&(r.push(e.slice(o,f.index)),f[t]>1&&f.index<e[t]&&l.apply(r,f.slice(1)),y=f[0][t],o=a,r[t]>=c));)s.lastIndex===f.index&&s.lastIndex++;return o===e[t]?!y&&s.test("")||r.push(""):r.push(e.slice(o)),r[t]>c?r.slice(0,c):r}:"0".split(void 0,0)[t]?function(n,t){return void 0===n&&0===t?[]:v.call(this,n,t)}:v,[function(t,i){var r=n(this),u=void 0==t?void 0:t[a];return void 0!==u?u.call(t,r,i):p.call(String(r),t,i)},function(n,t){var nt=y(p,n,this,t,p!==v),tt,k,d;if(nt.done)return nt.value;var a=f(n),u=String(this),it=e(a,RegExp),rt=a.unicode,ut=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(i?"y":"g"),w=new it(i?a:"^(?:"+a.source+")",ut),g=void 0===t?4294967295:t>>>0;if(0===g)return[];if(0===u.length)return null===r(w,u)?[u]:[];for(var b=0,h=0,l=[];h<u.length;)if(w.lastIndex=i?h:0,k=r(w,i?u:u.slice(h)),null===k||(tt=c(s(w.lastIndex+(i?0:h)),u.length))===b)h=o(u,h,rt);else{if(l.push(u.slice(b,h)),l.length===g)return l;for(d=1;d<=k.length-1;d++)if(l.push(k[d]),l.length===g)return l;h=b=tt}return l.push(u.slice(b)),l}]})},{103:103,117:117,14:14,16:16,43:43,58:58,95:95,96:96}],230:[function(n){"use strict";n(225);var r=n(16),u=n(44),f=n(36),t=/./.toString,i=function(t){n(94)(RegExp.prototype,"toString",t,!0)};n(42)(function(){return"/a/b"!=t.call({source:"a",flags:"b"})})?i(function(){var n=r(this);return"/".concat(n.source,"/","flags"in n?n.flags:!f&&n instanceof RegExp?u.call(n):void 0)}):"toString"!=t.name&&i(function(){return t.call(this)})},{16:16,225:225,36:36,42:42,44:44,94:94}],231:[function(n,t){"use strict";var i=n(27),r=n(125);t.exports=n(29)("Set",function(n){return function(){return n(this,arguments.length>0?arguments[0]:void 0)}},{add:function(n){return i.def(r(this,"Set"),n=0===n?0:n,n)}},i)},{125:125,27:27,29:29}],232:[function(n){"use strict";n(107)("anchor",function(n){return function(t){return n(this,"a","name",t)}})},{107:107}],233:[function(n){"use strict";n(107)("big",function(n){return function(){return n(this,"big","","")}})},{107:107}],234:[function(n){"use strict";n(107)("blink",function(n){return function(){return n(this,"blink","","")}})},{107:107}],235:[function(n){"use strict";n(107)("bold",function(n){return function(){return n(this,"b","","")}})},{107:107}],236:[function(n){"use strict";var t=n(40),i=n(105)(!1);t(t.P,"String",{codePointAt:function(n){return i(this,n)}})},{105:105,40:40}],237:[function(n){"use strict";var t=n(40),i=n(117),u=n(106),r="".endsWith;t(t.P+t.F*n(41)("endsWith"),"String",{endsWith:function(n){var t=u(this,n,"endsWith"),o=arguments.length>1?arguments[1]:void 0,s=i(t.length),f=void 0===o?s:Math.min(i(o),s),e=String(n);return r?r.call(t,e,f):t.slice(f-e.length,f)===e}})},{106:106,117:117,40:40,41:41}],238:[function(n){"use strict";n(107)("fixed",function(n){return function(){return n(this,"tt","","")}})},{107:107}],239:[function(n){"use strict";n(107)("fontcolor",function(n){return function(t){return n(this,"font","color",t)}})},{107:107}],240:[function(n){"use strict";n(107)("fontsize",function(n){return function(t){return n(this,"font","size",t)}})},{107:107}],241:[function(n){var t=n(40),u=n(113),i=String.fromCharCode,r=String.fromCodePoint;t(t.S+t.F*(!!r&&1!=r.length),"String",{fromCodePoint:function(){for(var n,t=[],f=arguments.length,r=0;f>r;){if(n=+arguments[r++],u(n,1114111)!==n)throw RangeError(n+" is not a valid code point");t.push(n<65536?i(n):i(55296+((n-=65536)>>10),n%1024+56320))}return t.join("")}})},{113:113,40:40}],242:[function(n){"use strict";var t=n(40),i=n(106);t(t.P+t.F*n(41)("includes"),"String",{includes:function(n){return!!~i(this,n,"includes").indexOf(n,arguments.length>1?arguments[1]:void 0)}})},{106:106,40:40,41:41}],243:[function(n){"use strict";n(107)("italics",function(n){return function(){return n(this,"i","","")}})},{107:107}],244:[function(n){"use strict";var t=n(105)(!0);n(61)(String,"String",function(n){this._t=String(n);this._i=0},function(){var n,i=this._t,r=this._i;return r>=i.length?{value:void 0,done:!0}:(n=t(i,r),this._i+=n.length,{value:n,done:!1})})},{105:105,61:61}],245:[function(n){"use strict";n(107)("link",function(n){return function(t){return n(this,"a","href",t)}})},{107:107}],246:[function(n){var t=n(40),i=n(116),r=n(117);t(t.S,"String",{raw:function(n){for(var f=i(n.raw),e=r(f.length),o=arguments.length,u=[],t=0;e>t;)u.push(String(f[t++])),t<o&&u.push(String(arguments[t]));return u.join("")}})},{116:116,117:117,40:40}],247:[function(n){var t=n(40);t(t.P,"String",{repeat:n(109)})},{109:109,40:40}],248:[function(n){"use strict";n(107)("small",function(n){return function(){return n(this,"small","","")}})},{107:107}],249:[function(n){"use strict";var t=n(40),r=n(117),u=n(106),i="".startsWith;t(t.P+t.F*n(41)("startsWith"),"String",{startsWith:function(n){var t=u(this,n,"startsWith"),f=r(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),e=String(n);return i?i.call(t,e,f):t.slice(f,f+e.length)===e}})},{106:106,117:117,40:40,41:41}],250:[function(n){"use strict";n(107)("strike",function(n){return function(){return n(this,"strike","","")}})},{107:107}],251:[function(n){"use strict";n(107)("sub",function(n){return function(){return n(this,"sub","","")}})},{107:107}],252:[function(n){"use strict";n(107)("sup",function(n){return function(){return n(this,"sup","","")}})},{107:107}],253:[function(n){"use strict";n(110)("trim",function(n){return function(){return n(this,3)}})},{110:110}],254:[function(n){"use strict";var v=n(46),t=n(47),k=n(36),u=n(40),lt=n(94),ui=n(70).KEY,at=n(42),d=n(102),g=n(100),fi=n(123),h=n(128),ei=n(127),oi=n(126),si=n(39),hi=n(55),nt=n(16),ci=n(57),y=n(116),tt=n(119),it=n(92),c=n(74),vt=n(78),yt=n(77),pt=n(75),li=n(83),wt=yt.f,o=pt.f,bt=vt.f,i=v.Symbol,p=v.JSON,w=p&&p.stringify,r=h("_hidden"),kt=h("toPrimitive"),ai={}.propertyIsEnumerable,l=d("symbol-registry"),e=d("symbols"),a=d("op-symbols"),f=Object.prototype,s="function"==typeof i,rt=v.QObject,ut=!rt||!rt.prototype||!rt.prototype.findChild,ft=k&&at(function(){return 7!=c(o({},"a",{get:function(){return o(this,"a",{value:7}).a}})).a})?function(n,t,i){var r=wt(f,t);r&&delete f[t];o(n,t,i);r&&n!==f&&o(f,t,r)}:o,dt=function(n){var t=e[n]=c(i.prototype);return t._k=n,t},et=s&&"symbol"==typeof i.iterator?function(n){return"symbol"==typeof n}:function(n){return n instanceof i},b=function(n,i,u){return n===f&&b(a,i,u),nt(n),i=tt(i,!0),nt(u),t(e,i)?(u.enumerable?(t(n,r)&&n[r][i]&&(n[r][i]=!1),u=c(u,{enumerable:it(0,!1)})):(t(n,r)||o(n,r,it(1,{})),n[r][i]=!0),ft(n,i,u)):o(n,i,u)},gt=function(n,t){nt(n);for(var i,r=si(t=y(t)),u=0,f=r.length;f>u;)b(n,i=r[u++],t[i]);return n},vi=function(n,t){return void 0===t?c(n):gt(c(n),t)},ni=function(n){var i=ai.call(this,n=tt(n,!0));return!(this===f&&t(e,n)&&!t(a,n))&&(!(i||!t(this,n)||!t(e,n)||t(this,r)&&this[r][n])||i)},ti=function(n,i){if(n=y(n),i=tt(i,!0),n!==f||!t(e,i)||t(a,i)){var u=wt(n,i);return!u||!t(e,i)||t(n,r)&&n[r][i]||(u.enumerable=!0),u}},ii=function(n){for(var i,u=bt(y(n)),f=[],o=0;u.length>o;)t(e,i=u[o++])||i==r||i==ui||f.push(i);return f},ri=function(n){for(var i,r=n===f,u=bt(r?a:y(n)),o=[],s=0;u.length>s;)t(e,i=u[s++])&&(!r||t(f,i))&&o.push(e[i]);return o},ot,st,ht,ct;for(s||(i=function(){if(this instanceof i)throw TypeError("Symbol is not a constructor!");var n=fi(arguments.length>0?arguments[0]:void 0),u=function(i){this===f&&u.call(a,i);t(this,r)&&t(this[r],n)&&(this[r][n]=!1);ft(this,n,it(1,i))};return k&&ut&&ft(f,n,{configurable:!0,set:u}),dt(n)},lt(i.prototype,"toString",function(){return this._k}),yt.f=ti,pt.f=b,n(79).f=vt.f=ii,n(84).f=ni,n(80).f=ri,k&&!n(65)&&lt(f,"propertyIsEnumerable",ni,!0),ei.f=function(n){return dt(h(n))}),u(u.G+u.W+u.F*!s,{Symbol:i}),ot="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),st=0;ot.length>st;)h(ot[st++]);for(ht=li(h.store),ct=0;ht.length>ct;)oi(ht[ct++]);u(u.S+u.F*!s,"Symbol",{"for":function(n){return t(l,n+="")?l[n]:l[n]=i(n)},keyFor:function(n){if(!et(n))throw TypeError(n+" is not a symbol!");for(var t in l)if(l[t]===n)return t},useSetter:function(){ut=!0},useSimple:function(){ut=!1}});u(u.S+u.F*!s,"Object",{create:vi,defineProperty:b,defineProperties:gt,getOwnPropertyDescriptor:ti,getOwnPropertyNames:ii,getOwnPropertySymbols:ri});p&&u(u.S+u.F*(!s||at(function(){var n=i();return"[null]"!=w([n])||"{}"!=w({a:n})||"{}"!=w(Object(n))})),"JSON",{stringify:function(n){for(var t,r,i=[n],u=1;arguments.length>u;)i.push(arguments[u++]);if(r=t=i[1],(ci(t)||void 0!==n)&&!et(n))return hi(t)||(t=function(n,t){if("function"==typeof r&&(t=r.call(this,n,t)),!et(t))return t}),i[1]=t,w.apply(p,i)}});i.prototype[kt]||n(48)(i.prototype,kt,i.prototype.valueOf);g(i,"Symbol");g(Math,"Math",!0);g(v.JSON,"JSON",!0)},{100:100,102:102,116:116,119:119,123:123,126:126,127:127,128:128,16:16,36:36,39:39,40:40,42:42,46:46,47:47,48:48,55:55,57:57,65:65,70:70,74:74,75:75,77:77,78:78,79:79,80:80,83:83,84:84,92:92,94:94}],255:[function(n){"use strict";var t=n(40),r=n(122),u=n(121),f=n(16),e=n(113),l=n(117),a=n(57),o=n(46).ArrayBuffer,v=n(103),i=u.ArrayBuffer,s=u.DataView,h=r.ABV&&o.isView,c=i.prototype.slice,y=r.VIEW;t(t.G+t.W+t.F*(o!==i),{ArrayBuffer:i});t(t.S+t.F*!r.CONSTR,"ArrayBuffer",{isView:function(n){return h&&h(n)||a(n)&&y in n}});t(t.P+t.U+t.F*n(42)(function(){return!new i(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(n,t){if(void 0!==c&&void 0===t)return c.call(f(this),n);for(var r=f(this).byteLength,u=e(n,r),o=e(void 0===t?r:t,r),h=new(v(this,i))(l(o-u)),a=new s(this),y=new s(h),p=0;u<o;)y.setUint8(p++,a.getUint8(u++));return h}});n(99)("ArrayBuffer")},{103:103,113:113,117:117,121:121,122:122,16:16,40:40,42:42,46:46,57:57,99:99}],256:[function(n){var t=n(40);t(t.G+t.W+t.F*!n(122).ABV,{DataView:n(121).DataView})},{121:121,122:122,40:40}],257:[function(n){n(120)("Float32",4,function(n){return function(t,i,r){return n(this,t,i,r)}})},{120:120}],258:[function(n){n(120)("Float64",8,function(n){return function(t,i,r){return n(this,t,i,r)}})},{120:120}],259:[function(n){n(120)("Int16",2,function(n){return function(t,i,r){return n(this,t,i,r)}})},{120:120}],260:[function(n){n(120)("Int32",4,function(n){return function(t,i,r){return n(this,t,i,r)}})},{120:120}],261:[function(n){n(120)("Int8",1,function(n){return function(t,i,r){return n(this,t,i,r)}})},{120:120}],262:[function(n){n(120)("Uint16",2,function(n){return function(t,i,r){return n(this,t,i,r)}})},{120:120}],263:[function(n){n(120)("Uint32",4,function(n){return function(t,i,r){return n(this,t,i,r)}})},{120:120}],264:[function(n){n(120)("Uint8",1,function(n){return function(t,i,r){return n(this,t,i,r)}})},{120:120}],265:[function(n){n(120)("Uint8",1,function(n){return function(t,i,r){return n(this,t,i,r)}},!0)},{120:120}],266:[function(n,t){"use strict";var r,l=n(20)(0),a=n(94),u=n(70),v=n(73),i=n(28),f=n(57),y=n(42),e=n(125),p=u.getWeak,w=Object.isExtensible,b=i.ufstore,o={},s=function(n){return function(){return n(this,arguments.length>0?arguments[0]:void 0)}},h={get:function(n){if(f(n)){var t=p(n);return!0===t?b(e(this,"WeakMap")).get(n):t?t[this._i]:void 0}},set:function(n,t){return i.def(e(this,"WeakMap"),n,t)}},c=t.exports=n(29)("WeakMap",s,h,i,!0,!0);y(function(){return 7!=(new c).set((Object.freeze||Object)(o),7).get(o)})&&(r=i.getConstructor(s,"WeakMap"),v(r.prototype,h),u.NEED=!0,l(["delete","has","get","set"],function(n){var t=c.prototype,i=t[n];a(t,n,function(t,u){if(f(t)&&!w(t)){this._f||(this._f=new r);var e=this._f[n](t,u);return"set"==n?this:e}return i.call(this,t,u)})}))},{125:125,20:20,28:28,29:29,42:42,57:57,70:70,73:73,94:94}],267:[function(n){"use strict";var t=n(28),i=n(125);n(29)("WeakSet",function(n){return function(){return n(this,arguments.length>0?arguments[0]:void 0)}},{add:function(n){return t.def(i(this,"WeakSet"),n,!0)}},t,!1,!0)},{125:125,28:28,29:29}],268:[function(n){"use strict";var t=n(40),i=n(19)(!0);t(t.P,"Array",{includes:function(n){return i(this,n,arguments.length>1?arguments[1]:void 0)}});n(13)("includes")},{13:13,19:19,40:40}],269:[function(n){var t=n(40),i=n(86)(!0);t(t.S,"Object",{entries:function(n){return i(n)}})},{40:40,86:86}],270:[function(n){var t=n(40),i=n(87),r=n(116),u=n(77),f=n(31);t(t.S,"Object",{getOwnPropertyDescriptors:function(n){for(var t,e,o=r(n),l=u.f,s=i(o),h={},c=0;s.length>c;)void 0!==(e=l(o,t=s[c++]))&&f(h,t,e);return h}})},{116:116,31:31,40:40,77:77,87:87}],271:[function(n){var t=n(40),i=n(86)(!1);t(t.S,"Object",{values:function(n){return i(n)}})},{40:40,86:86}],272:[function(n){"use strict";var t=n(40),r=n(30),u=n(46),f=n(103),i=n(91);t(t.P+t.R,"Promise",{"finally":function(n){var t=f(this,r.Promise||u.Promise),e="function"==typeof n;return this.then(e?function(r){return i(t,n()).then(function(){return r})}:n,e?function(r){return i(t,n()).then(function(){throw r;})}:n)}})},{103:103,30:30,40:40,46:46,91:91}],273:[function(n){"use strict";var t=n(40),i=n(108),r=n(124);t(t.P+t.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(r),"String",{padEnd:function(n){return i(this,n,arguments.length>1?arguments[1]:void 0,!1)}})},{108:108,124:124,40:40}],274:[function(n){"use strict";var t=n(40),i=n(108),r=n(124);t(t.P+t.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(r),"String",{padStart:function(n){return i(this,n,arguments.length>1?arguments[1]:void 0,!0)}})},{108:108,124:124,40:40}],275:[function(n){n(126)("asyncIterator")},{126:126}],276:[function(n){for(var f=n(140),p=n(83),w=n(94),b=n(46),e=n(48),o=n(64),s=n(128),h=s("iterator"),c=s("toStringTag"),l=o.Array,a={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},v=p(a),u=0;u<v.length;u++){var i,r=v[u],k=a[r],y=b[r],t=y&&y.prototype;if(t&&(t[h]||e(t,h,l),t[c]||e(t,c,r),o[r]=l,k))for(i in f)t[i]||w(t,i,f[i],!0)}},{128:128,140:140,46:46,48:48,64:64,83:83,94:94}],277:[function(n){var t=n(40),i=n(112);t(t.G+t.B,{setImmediate:i.set,clearImmediate:i.clear})},{112:112,40:40}],278:[function(n){var i=n(46),t=n(40),u=n(124),f=[].slice,e=/MSIE .\./.test(u),r=function(n){return function(t,i){var r=arguments.length>2,u=!!r&&f.call(arguments,2);return n(r?function(){("function"==typeof t?t:Function(t)).apply(this,u)}:t,i)}};t(t.G+t.B+t.F*e,{setTimeout:r(i.setTimeout),setInterval:r(i.setInterval)})},{124:124,40:40,46:46}],279:[function(n,t){n(278);n(277);n(276);t.exports=n(30)},{276:276,277:277,278:278,30:30}],280:[function(n,t){!function(n){"use strict";function tt(n,t,i,r){var f=t&&t.prototype instanceof w?t:w,u=Object.create(f.prototype),e=new k(r||[]);return u._invoke=ht(n,i,e),u}function p(n,t,i){try{return{type:"normal",arg:n.call(t,i)}}catch(n){return{type:"throw",arg:n}}}function w(){}function h(){}function o(){}function it(n){["next","throw","return"].forEach(function(t){n[t]=function(n){return this._invoke(t,n)}})}function c(n){function t(i,r,u,e){var h=p(n[i],n,r),s,o;if("throw"!==h.type)return s=h.arg,o=s.value,o&&"object"==typeof o&&f.call(o,"__await")?Promise.resolve(o.__await).then(function(n){t("next",n,u,e)},function(n){t("throw",n,u,e)}):Promise.resolve(o).then(function(n){s.value=n;u(s)},function(n){return t("throw",n,u,e)});e(h.arg)}function r(n,r){function u(){return new Promise(function(i,u){t(n,r,i,u)})}return i=i?i.then(u,u):u()}var i;this._invoke=r}function ht(n,t,i){var u=ot;return function(f,e){var h,s,o;if(u===st)throw new Error("Generator is already running");if(u===v){if("throw"===f)throw e;return ut()}for(i.method=f,i.arg=e;;){if(h=i.delegate,h&&(s=rt(h,i),s)){if(s===r)continue;return s}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(u===ot)throw u=v,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);if(u=st,o=p(n,t,i),"normal"===o.type){if(u=i.done?v:at,o.arg===r)continue;return{value:o.arg,done:i.done}}"throw"===o.type&&(u=v,i.method="throw",i.arg=o.arg)}}}function rt(n,t){var e=n.iterator[t.method],f,i;if(e===u){if(t.delegate=null,"throw"===t.method){if(n.iterator.return&&(t.method="return",t.arg=u,rt(n,t),"throw"===t.method))return r;t.method="throw";t.arg=new TypeError("The iterator does not provide a 'throw' method")}return r}return(f=p(e,n.iterator,t.arg),"throw"===f.type)?(t.method="throw",t.arg=f.arg,t.delegate=null,r):(i=f.arg,i?i.done?(t[n.resultName]=i.value,t.next=n.nextLoc,"return"!==t.method&&(t.method="next",t.arg=u),t.delegate=null,r):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,r))}function ct(n){var t={tryLoc:n[0]};1 in n&&(t.catchLoc=n[1]);2 in n&&(t.finallyLoc=n[2],t.afterLoc=n[3]);this.tryEntries.push(t)}function b(n){var t=n.completion||{};t.type="normal";delete t.arg;n.completion=t}function k(n){this.tryEntries=[{tryLoc:"root"}];n.forEach(ct,this);this.reset(!0)}function d(n){var r,i,e;if(n){if(r=n[l],r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length))return i=-1,e=function t(){for(;++i<n.length;)if(f.call(n,i))return t.value=n[i],t.done=!1,t;return t.value=u,t.done=!0,t},e.next=e}return{next:ut}}function ut(){return{value:u,done:!0}}var u,ft=Object.prototype,f=ft.hasOwnProperty,g="function"==typeof Symbol?Symbol:{},l=g.iterator||"@@iterator",lt=g.asyncIterator||"@@asyncIterator",a=g.toStringTag||"@@toStringTag",et="object"==typeof t,i=n.regeneratorRuntime,y,s,e;if(i)return void(et&&(t.exports=i));i=n.regeneratorRuntime=et?t.exports:{};i.wrap=tt;var ot="suspendedStart",at="suspendedYield",st="executing",v="completed",r={},nt={};nt[l]=function(){return this};y=Object.getPrototypeOf;s=y&&y(y(d([])));s&&s!==ft&&f.call(s,l)&&(nt=s);e=o.prototype=w.prototype=Object.create(nt);h.prototype=e.constructor=o;o.constructor=h;o[a]=h.displayName="GeneratorFunction";i.isGeneratorFunction=function(n){var t="function"==typeof n&&n.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))};i.mark=function(n){return Object.setPrototypeOf?Object.setPrototypeOf(n,o):(n.__proto__=o,a in n||(n[a]="GeneratorFunction")),n.prototype=Object.create(e),n};i.awrap=function(n){return{__await:n}};it(c.prototype);c.prototype[lt]=function(){return this};i.AsyncIterator=c;i.async=function(n,t,r,u){var f=new c(tt(n,t,r,u));return i.isGeneratorFunction(t)?f:f.next().then(function(n){return n.done?n.value:f.next()})};it(e);e[a]="Generator";e[l]=function(){return this};e.toString=function(){return"[object Generator]"};i.keys=function(n){var i=[],r;for(r in n)i.push(r);return i.reverse(),function t(){for(;i.length;){var r=i.pop();if(r in n)return t.value=r,t.done=!1,t}return t.done=!0,t}};i.values=d;k.prototype={constructor:k,reset:function(n){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(b),!n)for(var t in this)"t"===t.charAt(0)&&f.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0],n=t.completion;if("throw"===n.type)throw n.arg;return this.rval},dispatchException:function(n){function i(t,i){return o.type="throw",o.arg=n,r.next=t,i&&(r.method="next",r.arg=u),!!i}var r,e,t,o,s,h;if(this.done)throw n;for(r=this,e=this.tryEntries.length-1;e>=0;--e){if(t=this.tryEntries[e],o=t.completion,"root"===t.tryLoc)return i("end");if(t.tryLoc<=this.prev)if(s=f.call(t,"catchLoc"),h=f.call(t,"finallyLoc"),s&&h){if(this.prev<t.catchLoc)return i(t.catchLoc,!0);if(this.prev<t.finallyLoc)return i(t.finallyLoc)}else if(s){if(this.prev<t.catchLoc)return i(t.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<t.finallyLoc)return i(t.finallyLoc)}}},abrupt:function(n,t){for(var u,i,o,e=this.tryEntries.length-1;e>=0;--e)if(u=this.tryEntries[e],u.tryLoc<=this.prev&&f.call(u,"finallyLoc")&&this.prev<u.finallyLoc){i=u;break}return i&&("break"===n||"continue"===n)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null),o=i?i.completion:{},o.type=n,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,r):this.complete(o)},complete:function(n,t){if("throw"===n.type)throw n.arg;return"break"===n.type||"continue"===n.type?this.next=n.arg:"return"===n.type?(this.rval=this.arg=n.arg,this.method="return",this.next="end"):"normal"===n.type&&t&&(this.next=t),r},finish:function(n){for(var t,i=this.tryEntries.length-1;i>=0;--i)if(t=this.tryEntries[i],t.finallyLoc===n)return this.complete(t.completion,t.afterLoc),b(t),r},"catch":function(n){for(var i,r,u,t=this.tryEntries.length-1;t>=0;--t)if(i=this.tryEntries[t],i.tryLoc===n)return r=i.completion,"throw"===r.type&&(u=r.arg,b(i)),u;throw new Error("illegal catch attempt");},delegateYield:function(n,t,i){return this.delegate={iterator:d(n),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=u),r}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},{}]},{},[1]),function(){var n;n=typeof global!="undefined"?global:typeof window!="undefined"&&window.document?window:self;n.Promise.prototype["finally"]=function(n){var t=this.constructor;return this.then(function(i){return t.resolve(n()).then(function(){return i})},function(i){return t.resolve(n()).then(function(){throw i;})})}}(),function(n){function v(n){return parseInt(n)===n}function w(n){if(!v(n.length))return!1;for(var t=0;t<n.length;t++)if(!v(n[t])||n[t]<0||n[t]>255)return!1;return!0}function t(n,t){if(n.buffer&&ArrayBuffer.isView(n)&&n.name==="Uint8Array")return t&&(n=n.slice?n.slice():Array.prototype.slice.call(n)),n;if(Array.isArray(n)){if(!w(n))throw new Error("Array contains invalid value: "+n);return new Uint8Array(n)}if(v(n.length)&&w(n))return new Uint8Array(n);throw new Error("unsupported array-like object");}function i(n){return new Uint8Array(n)}function r(n,t,i,r,u){(r!=null||u!=null)&&(n=n.slice?n.slice(r,u):Array.prototype.slice.call(n,r,u));t.set(n,i)}function y(n){for(var i=[],t=0;t<n.length;t+=4)i.push(n[t]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3]);return i}function at(n){var e,u,f;for(n=t(n,!0),e=16-n.length%16,u=i(n.length+e),r(n,u),f=n.length;f<u.length;f++)u[f]=e;return u}function vt(n){var u,f,e,o;if(n=t(n,!0),n.length<16)throw new Error("PKCS#7 invalid length");if(u=n[n.length-1],u>16)throw new Error("PKCS#7 padding byte out of range");for(f=n.length-u,e=0;e<u;e++)if(n[f+e]!==u)throw new Error("PKCS#7 invalid padding byte");return o=i(f),r(n,o,0,0,f),o}var b=function(){function n(n){var r=[],i=0,u;for(n=encodeURI(n);i<n.length;)u=n.charCodeAt(i++),u===37?(r.push(parseInt(n.substr(i,2),16)),i+=2):r.push(u);return t(r)}function i(n){for(var r=[],t=0,i;t<n.length;)i=n[t],i<128?(r.push(String.fromCharCode(i)),t++):i>191&&i<224?(r.push(String.fromCharCode((i&31)<<6|n[t+1]&63)),t+=2):(r.push(String.fromCharCode((i&15)<<12|(n[t+1]&63)<<6|n[t+2]&63)),t+=3);return r.join("")}return{toBytes:n,fromBytes:i}}(),k=function(){function t(n){for(var i=[],t=0;t<n.length;t+=2)i.push(parseInt(n.substr(t,2),16));return i}function i(t){for(var u=[],r,i=0;i<t.length;i++)r=t[i],u.push(n[(r&240)>>4]+n[r&15]);return u.join("")}var n="0123456789abcdef";return{toBytes:t,fromBytes:i}}(),d={16:10,24:12,32:14},g=[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],u=[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],a=[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],nt=[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],tt=[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],it=[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],rt=[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],ut=[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],ft=[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],et=[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],ot=[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],st=[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],ht=[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],ct=[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],lt=[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],f=function(n){if(!(this instanceof f))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:t(n,!0)});this._prepare()},h,c,l,o,e,s,p;f.prototype._prepare=function(){var o=d[this.key.length],c,s,t,n,f,e;if(o==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");for(this._Ke=[],this._Kd=[],n=0;n<=o;n++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var l=(o+1)*4,r=this.key.length/4,i=y(this.key),h;for(n=0;n<r;n++)h=n>>2,this._Ke[h][n%4]=i[n],this._Kd[o-h][n%4]=i[n];for(c=0,s=r;s<l;){if(t=i[r-1],i[0]^=u[t>>16&255]<<24^u[t>>8&255]<<16^u[t&255]<<8^u[t>>24&255]^g[c]<<24,c+=1,r!=8)for(n=1;n<r;n++)i[n]^=i[n-1];else{for(n=1;n<r/2;n++)i[n]^=i[n-1];for(t=i[r/2-1],i[r/2]^=u[t&255]^u[t>>8&255]<<8^u[t>>16&255]<<16^u[t>>24&255]<<24,n=r/2+1;n<r;n++)i[n]^=i[n-1]}for(n=0;n<r&&s<l;)f=s>>2,e=s%4,this._Ke[f][e]=i[n],this._Kd[o-f][e]=i[n++],s++}for(f=1;f<o;f++)for(e=0;e<4;e++)t=this._Kd[f][e],this._Kd[f][e]=st[t>>24&255]^ht[t>>16&255]^ct[t>>8&255]^lt[t&255]};f.prototype.encrypt=function(n){var o,f,e,t;if(n.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");var s=this._Ke.length-1,h=[0,0,0,0],r=y(n);for(t=0;t<4;t++)r[t]^=this._Ke[0][t];for(o=1;o<s;o++){for(t=0;t<4;t++)h[t]=nt[r[t]>>24&255]^tt[r[(t+1)%4]>>16&255]^it[r[(t+2)%4]>>8&255]^rt[r[(t+3)%4]&255]^this._Ke[o][t];r=h.slice()}for(f=i(16),t=0;t<4;t++)e=this._Ke[s][t],f[4*t]=(u[r[t]>>24&255]^e>>24)&255,f[4*t+1]=(u[r[(t+1)%4]>>16&255]^e>>16)&255,f[4*t+2]=(u[r[(t+2)%4]>>8&255]^e>>8)&255,f[4*t+3]=(u[r[(t+3)%4]&255]^e)&255;return f};f.prototype.decrypt=function(n){var e,u,f,t;if(n.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");var o=this._Kd.length-1,s=[0,0,0,0],r=y(n);for(t=0;t<4;t++)r[t]^=this._Kd[0][t];for(e=1;e<o;e++){for(t=0;t<4;t++)s[t]=ut[r[t]>>24&255]^ft[r[(t+3)%4]>>16&255]^et[r[(t+2)%4]>>8&255]^ot[r[(t+1)%4]&255]^this._Kd[e][t];r=s.slice()}for(u=i(16),t=0;t<4;t++)f=this._Kd[o][t],u[4*t]=(a[r[t]>>24&255]^f>>24)&255,u[4*t+1]=(a[r[(t+3)%4]>>16&255]^f>>16)&255,u[4*t+2]=(a[r[(t+2)%4]>>8&255]^f>>8)&255,u[4*t+3]=(a[r[(t+1)%4]&255]^f)&255;return u};h=function(n){if(!(this instanceof h))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block";this.name="ecb";this._aes=new f(n)};h.prototype.encrypt=function(n){var e,f,u;if(n=t(n),n.length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(e=i(n.length),f=i(16),u=0;u<n.length;u+=16)r(n,f,0,u,u+16),f=this._aes.encrypt(f),r(f,e,u);return e};h.prototype.decrypt=function(n){var e,f,u;if(n=t(n),n.length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(e=i(n.length),f=i(16),u=0;u<n.length;u+=16)r(n,f,0,u,u+16),f=this._aes.decrypt(f),r(f,e,u);return e};c=function(n,r){if(!(this instanceof c))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",r){if(r.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");}else r=i(16);this._lastCipherblock=t(r,!0);this._aes=new f(n)};c.prototype.encrypt=function(n){var o,e,u,f;if(n=t(n),n.length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(o=i(n.length),e=i(16),u=0;u<n.length;u+=16){for(r(n,e,0,u,u+16),f=0;f<16;f++)e[f]^=this._lastCipherblock[f];this._lastCipherblock=this._aes.encrypt(e);r(this._lastCipherblock,o,u)}return o};c.prototype.decrypt=function(n){var o,e,u,f;if(n=t(n),n.length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(o=i(n.length),e=i(16),u=0;u<n.length;u+=16){for(r(n,e,0,u,u+16),e=this._aes.decrypt(e),f=0;f<16;f++)o[u+f]=e[f]^this._lastCipherblock[f];r(n,this._lastCipherblock,0,u,u+16)}return o};l=function(n,r,u){if(!(this instanceof l))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",r){if(r.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");}else r=i(16);u||(u=1);this.segmentSize=u;this._shiftRegister=t(r,!0);this._aes=new f(n)};l.prototype.encrypt=function(n){var u,e,i,f;if(n.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(u=t(n,!0),i=0;i<u.length;i+=this.segmentSize){for(e=this._aes.encrypt(this._shiftRegister),f=0;f<this.segmentSize;f++)u[i+f]^=e[f];r(this._shiftRegister,this._shiftRegister,0,this.segmentSize);r(u,this._shiftRegister,16-this.segmentSize,i,i+this.segmentSize)}return u};l.prototype.decrypt=function(n){var f,e,i,u;if(n.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(f=t(n,!0),i=0;i<f.length;i+=this.segmentSize){for(e=this._aes.encrypt(this._shiftRegister),u=0;u<this.segmentSize;u++)f[i+u]^=e[u];r(this._shiftRegister,this._shiftRegister,0,this.segmentSize);r(n,this._shiftRegister,16-this.segmentSize,i,i+this.segmentSize)}return f};o=function(n,r){if(!(this instanceof o))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",r){if(r.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");}else r=i(16);this._lastPrecipher=t(r,!0);this._lastPrecipherIndex=16;this._aes=new f(n)};o.prototype.encrypt=function(n){for(var r=t(n,!0),i=0;i<r.length;i++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),r[i]^=this._lastPrecipher[this._lastPrecipherIndex++];return r};o.prototype.decrypt=o.prototype.encrypt;e=function(n){if(!(this instanceof e))throw Error("Counter must be instanitated with `new`");n===0||n||(n=1);typeof n=="number"?(this._counter=i(16),this.setValue(n)):this.setBytes(n)};e.prototype.setValue=function(n){if(typeof n!="number"||parseInt(n)!=n)throw new Error("invalid counter value (must be an integer)");if(n>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=n%256,n=parseInt(n/256)};e.prototype.setBytes=function(n){if(n=t(n,!0),n.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=n};e.prototype.increment=function(){for(var n=15;n>=0;n--)if(this._counter[n]===255)this._counter[n]=0;else{this._counter[n]++;break}};s=function(n,t){if(!(this instanceof s))throw Error("AES must be instanitated with `new`");this.description="Counter";this.name="ctr";t instanceof e||(t=new e(t));this._counter=t;this._remainingCounter=null;this._remainingCounterIndex=16;this._aes=new f(n)};s.prototype.encrypt=function(n){for(var r=t(n,!0),i=0;i<r.length;i++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),r[i]^=this._remainingCounter[this._remainingCounterIndex++];return r};s.prototype.decrypt=s.prototype.encrypt;p={AES:f,Counter:e,ModeOfOperation:{ecb:h,cbc:c,cfb:l,ofb:o,ctr:s},utils:{hex:k,utf8:b},padding:{pkcs7:{pad:at,strip:vt}},_arrayTest:{coerceArray:t,createArray:i,copyArray:r}};n.aesjs&&(p._aesjs=n.aesjs);n.aesjs=p}(this),function(n){"use strict";function r(n,t){t?(i[0]=i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0,this.blocks=i):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];n?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225);this.block=this.start=this.bytes=this.hBytes=0;this.finalized=this.hashed=!1;this.first=!0;this.is224=n}function c(n,t,i){var f,v=typeof n,c,l,a;if(v==="string"){var s=[],y=n.length,h=0,u;for(f=0;f<y;++f)u=n.charCodeAt(f),u<128?s[h++]=u:u<2048?(s[h++]=192|u>>6,s[h++]=128|u&63):u<55296||u>=57344?(s[h++]=224|u>>12,s[h++]=128|u>>6&63,s[h++]=128|u&63):(u=65536+((u&1023)<<10|n.charCodeAt(++f)&1023),s[h++]=240|u>>18,s[h++]=128|u>>12&63,s[h++]=128|u>>6&63,s[h++]=128|u&63);n=s}else if(v==="object"){if(n===null)throw new Error(e);else if(o&&n.constructor===ArrayBuffer)n=new Uint8Array(n);else if(!Array.isArray(n)&&(!o||!ArrayBuffer.isView(n)))throw new Error(e);}else throw new Error(e);for(n.length>64&&(n=new r(t,!0).update(n).array()),c=[],l=[],f=0;f<64;++f)a=n[f]||0,c[f]=92^a,l[f]=54^a;r.call(this,t,i);this.update(l);this.oKeyPad=c;this.inner=!0;this.sharedMemory=i}var e="input is invalid type",o=!n.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",t="0123456789abcdef".split(""),p=[-2147483648,8388608,32768,128],u=[24,16,8,0],s=[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],h=["hex","array","digest","arrayBuffer"],i=[],f;(n.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(n){return Object.prototype.toString.call(n)==="[object Array]"});o&&(n.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(n){return typeof n=="object"&&n.buffer&&n.buffer.constructor===ArrayBuffer});var l=function(n,t){return function(i){return new r(t,!0).update(i)[n]()}},a=function(n){var t=l("hex",n),i,u;for(t.create=function(){return new r(n)},t.update=function(n){return t.create().update(n)},i=0;i<h.length;++i)u=h[i],t[u]=l(u,n);return t},v=function(n,t){return function(i,r){return new c(i,t,!0).update(r)[n]()}},y=function(n){var t=v("hex",n),i,r;for(t.create=function(t){return new c(t,n)},t.update=function(n,i){return t.create(n).update(i)},i=0;i<h.length;++i)r=h[i],t[r]=v(r,n);return t};r.prototype.update=function(n){var c,s;if(!this.finalized){if(s=typeof n,s!=="string"){if(s==="object"){if(n===null)throw new Error(e);else if(o&&n.constructor===ArrayBuffer)n=new Uint8Array(n);else if(!Array.isArray(n)&&(!o||!ArrayBuffer.isView(n)))throw new Error(e);}else throw new Error(e);c=!0}for(var r,f=0,t,h=n.length,i=this.blocks;f<h;){if(this.hashed&&(this.hashed=!1,i[0]=this.block,i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0),c)for(t=this.start;f<h&&t<64;++f)i[t>>2]|=n[f]<<u[t++&3];else for(t=this.start;f<h&&t<64;++f)r=n.charCodeAt(f),r<128?i[t>>2]|=r<<u[t++&3]:r<2048?(i[t>>2]|=(192|r>>6)<<u[t++&3],i[t>>2]|=(128|r&63)<<u[t++&3]):r<55296||r>=57344?(i[t>>2]|=(224|r>>12)<<u[t++&3],i[t>>2]|=(128|r>>6&63)<<u[t++&3],i[t>>2]|=(128|r&63)<<u[t++&3]):(r=65536+((r&1023)<<10|n.charCodeAt(++f)&1023),i[t>>2]|=(240|r>>18)<<u[t++&3],i[t>>2]|=(128|r>>12&63)<<u[t++&3],i[t>>2]|=(128|r>>6&63)<<u[t++&3],i[t>>2]|=(128|r&63)<<u[t++&3]);this.lastByteIndex=t;this.bytes+=t-this.start;t>=64?(this.block=i[16],this.start=t-64,this.hash(),this.hashed=!0):this.start=t}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}};r.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var n=this.blocks,t=this.lastByteIndex;n[16]=this.block;n[t>>2]|=p[t&3];this.block=n[16];t>=56&&(this.hashed||this.hash(),n[0]=this.block,n[16]=n[1]=n[2]=n[3]=n[4]=n[5]=n[6]=n[7]=n[8]=n[9]=n[10]=n[11]=n[12]=n[13]=n[14]=n[15]=0);n[14]=this.hBytes<<3|this.bytes>>>29;n[15]=this.bytes<<3;this.hash()}};r.prototype.hash=function(){for(var e=this.h0,u=this.h1,f=this.h2,i=this.h3,o=this.h4,h=this.h5,c=this.h6,r=this.h7,l=this.blocks,a,v,y,n,p,w,b,d,g,k,t=16;t<64;++t)n=l[t-15],a=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,n=l[t-2],v=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,l[t]=l[t-16]+a+l[t-7]+v<<0;for(k=u&f,t=0;t<64;t+=4)this.first?(this.is224?(b=300032,n=l[0]-1413257819,r=n-150054599<<0,i=n+24177077<<0):(b=704751109,n=l[0]-210244248,r=n-1521486534<<0,i=n+143694565<<0),this.first=!1):(a=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),v=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),b=e&u,y=b^e&f^k,w=o&h^~o&c,n=r+v+w+s[t]+l[t],p=a+y,r=i+n<<0,i=n+p<<0),a=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),v=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),d=i&e,y=d^i&u^b,w=r&o^~r&h,n=c+v+w+s[t+1]+l[t+1],p=a+y,c=f+n<<0,f=n+p<<0,a=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),v=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),g=f&i,y=g^f&e^d,w=c&r^~c&o,n=h+v+w+s[t+2]+l[t+2],p=a+y,h=u+n<<0,u=n+p<<0,a=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),v=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),k=u&f,y=k^u&i^g,w=h&c^~h&r,n=o+v+w+s[t+3]+l[t+3],p=a+y,o=e+n<<0,e=n+p<<0;this.h0=this.h0+e<<0;this.h1=this.h1+u<<0;this.h2=this.h2+f<<0;this.h3=this.h3+i<<0;this.h4=this.h4+o<<0;this.h5=this.h5+h<<0;this.h6=this.h6+c<<0;this.h7=this.h7+r<<0};r.prototype.hex=function(){this.finalize();var n=this.h0,i=this.h1,r=this.h2,u=this.h3,f=this.h4,e=this.h5,o=this.h6,s=this.h7,h=t[n>>28&15]+t[n>>24&15]+t[n>>20&15]+t[n>>16&15]+t[n>>12&15]+t[n>>8&15]+t[n>>4&15]+t[n&15]+t[i>>28&15]+t[i>>24&15]+t[i>>20&15]+t[i>>16&15]+t[i>>12&15]+t[i>>8&15]+t[i>>4&15]+t[i&15]+t[r>>28&15]+t[r>>24&15]+t[r>>20&15]+t[r>>16&15]+t[r>>12&15]+t[r>>8&15]+t[r>>4&15]+t[r&15]+t[u>>28&15]+t[u>>24&15]+t[u>>20&15]+t[u>>16&15]+t[u>>12&15]+t[u>>8&15]+t[u>>4&15]+t[u&15]+t[f>>28&15]+t[f>>24&15]+t[f>>20&15]+t[f>>16&15]+t[f>>12&15]+t[f>>8&15]+t[f>>4&15]+t[f&15]+t[e>>28&15]+t[e>>24&15]+t[e>>20&15]+t[e>>16&15]+t[e>>12&15]+t[e>>8&15]+t[e>>4&15]+t[e&15]+t[o>>28&15]+t[o>>24&15]+t[o>>20&15]+t[o>>16&15]+t[o>>12&15]+t[o>>8&15]+t[o>>4&15]+t[o&15];return this.is224||(h+=t[s>>28&15]+t[s>>24&15]+t[s>>20&15]+t[s>>16&15]+t[s>>12&15]+t[s>>8&15]+t[s>>4&15]+t[s&15]),h};r.prototype.toString=r.prototype.hex;r.prototype.digest=function(){this.finalize();var n=this.h0,t=this.h1,i=this.h2,r=this.h3,u=this.h4,f=this.h5,e=this.h6,o=this.h7,s=[n>>24&255,n>>16&255,n>>8&255,n&255,t>>24&255,t>>16&255,t>>8&255,t&255,i>>24&255,i>>16&255,i>>8&255,i&255,r>>24&255,r>>16&255,r>>8&255,r&255,u>>24&255,u>>16&255,u>>8&255,u&255,f>>24&255,f>>16&255,f>>8&255,f&255,e>>24&255,e>>16&255,e>>8&255,e&255];return this.is224||s.push(o>>24&255,o>>16&255,o>>8&255,o&255),s};r.prototype.array=r.prototype.digest;r.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),n=new DataView(t);return n.setUint32(0,this.h0),n.setUint32(4,this.h1),n.setUint32(8,this.h2),n.setUint32(12,this.h3),n.setUint32(16,this.h4),n.setUint32(20,this.h5),n.setUint32(24,this.h6),this.is224||n.setUint32(28,this.h7),t};c.prototype=new r;c.prototype.finalize=function(){if(r.prototype.finalize.call(this),this.inner){this.inner=!1;var n=this.array();r.call(this,this.is224,this.sharedMemory);this.update(this.oKeyPad);this.update(n);r.prototype.finalize.call(this)}};f=a();f.sha256=f;f.sha224=a(!0);f.sha256.hmac=y();f.sha224.hmac=y(!0);n.sha256=f.sha256;n.sha224=f.sha224}(this);!function(n){var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this;t.elliptic=n()}(function(){return function n(t,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!t[f]){if(h="function"==typeof require&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};t[f][0].call(s.exports,function(n){var i=t[f][1][n];return u(i?i:n)},s,s.exports,n,t,i,r)}return i[f].exports}for(var e="function"==typeof require&&require,f=0;f<r.length;f++)u(r[f]);return u}({1:[function(n,t,i){"use strict";var r=i;r.version=n("../package.json").version;r.utils=n("./elliptic/utils");r.rand=n("brorand");r.curve=n("./elliptic/curve");r.curves=n("./elliptic/curves");r.ec=n("./elliptic/ec");r.eddsa=n("./elliptic/eddsa")},{"../package.json":30,"./elliptic/curve":4,"./elliptic/curves":7,"./elliptic/ec":8,"./elliptic/eddsa":11,"./elliptic/utils":15,brorand:17}],2:[function(n,t){"use strict";function r(n,t){this.type=n;this.p=new u(t.p,16);this.red=t.prime?u.red(t.prime):u.mont(this.p);this.zero=new u(0).toRed(this.red);this.one=new u(1).toRed(this.red);this.two=new u(2).toRed(this.red);this.n=t.n&&new u(t.n,16);this.g=t.g&&this.pointFromJSON(t.g,t.gRed);this._wnafT1=new Array(4);this._wnafT2=new Array(4);this._wnafT3=new Array(4);this._wnafT4=new Array(4);var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function i(n,t){this.curve=n;this.type=t;this.precomputed=null}var u=n("bn.js"),s=n("../../elliptic"),f=s.utils,e=f.getNAF,h=f.getJSF,o=f.assert;t.exports=r;r.prototype.point=function(){throw new Error("Not implemented");};r.prototype.validate=function(){throw new Error("Not implemented");};r.prototype._fixedNafMul=function(n,t){var s,t,i,r;o(n.precomputed);var u=n._getDoubles(),l=e(t,1),a=(1<<u.step+1)-(u.step%2==0?2:1);for(a/=3,s=[],i=0;i<l.length;i+=u.step){for(r=0,t=i+u.step-1;t>=i;t--)r=(r<<1)+l[t];s.push(r)}for(var c=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(i=0;i<s.length;i++)r=s[i],r===h?f=f.mixedAdd(u.points[i]):r===-h&&(f=f.mixedAdd(u.points[i].neg()));c=c.add(f)}return c.toP()};r.prototype._wnafMul=function(n,t){var s=4,c=n._getNAFPoints(s),t,u;s=c.wnd;for(var f=c.points,h=e(t,s),i=this.jpoint(null,null,null),r=h.length-1;r>=0;r--){for(t=0;r>=0&&0===h[r];r--)t++;if(r>=0&&t++,i=i.dblp(t),r<0)break;u=h[r];o(0!==u);i="affine"===n.type?u>0?i.mixedAdd(f[u-1>>1]):i.mixedAdd(f[-u-1>>1].neg()):u>0?i.add(f[u-1>>1]):i.add(f[-u-1>>1].neg())}return"affine"===n.type?i.toP():i};r.prototype._wnafMulAdd=function(n,t,i,r,u){for(var nt,s,c,v,rt,d,ut,ft,g,it,o,y,w,b=this._wnafT1,k=this._wnafT2,a=this._wnafT3,l=0,f=0;f<r;f++)y=t[f],nt=y._getNAFPoints(n),b[f]=nt.wnd,k[f]=nt.points;for(f=r-1;f>=1;f-=2)if(s=f-1,c=f,1===b[s]&&1===b[c])for(v=[t[s],null,null,t[c]],0===t[s].y.cmp(t[c].y)?(v[1]=t[s].add(t[c]),v[2]=t[s].toJ().mixedAdd(t[c].neg())):0===t[s].y.cmp(t[c].y.redNeg())?(v[1]=t[s].toJ().mixedAdd(t[c]),v[2]=t[s].add(t[c].neg())):(v[1]=t[s].toJ().mixedAdd(t[c]),v[2]=t[s].toJ().mixedAdd(t[c].neg())),rt=[-3,-1,-5,-7,0,7,5,1,3],d=h(i[s],i[c]),l=Math.max(d[0].length,l),a[s]=new Array(l),a[c]=new Array(l),o=0;o<l;o++)ut=0|d[0][o],ft=0|d[1][o],a[s][o]=rt[3*(ut+1)+(ft+1)],a[c][o]=0,k[s]=v;else a[s]=e(i[s],b[s]),a[c]=e(i[c],b[c]),l=Math.max(a[s].length,l),l=Math.max(a[c].length,l);for(var p=this.jpoint(null,null,null),tt=this._wnafT4,f=l;f>=0;f--){for(g=0;f>=0;){for(it=!0,o=0;o<r;o++)tt[o]=0|a[o][f],0!==tt[o]&&(it=!1);if(!it)break;g++;f--}if(f>=0&&g++,p=p.dblp(g),f<0)break;for(o=0;o<r;o++)w=tt[o],0!==w&&(w>0?y=k[o][w-1>>1]:w<0&&(y=k[o][-w-1>>1].neg()),p="affine"===y.type?p.mixedAdd(y):p.add(y))}for(f=0;f<r;f++)k[f]=null;return u?p:p.toP()};r.BasePoint=i;i.prototype.eq=function(){throw new Error("Not implemented");};i.prototype.validate=function(){return this.curve.validate(this)};r.prototype.decodePoint=function(n,t){var i;if(n=f.toArray(n,t),i=this.p.byteLength(),(4===n[0]||6===n[0]||7===n[0])&&n.length-1==2*i)return 6===n[0]?o(n[n.length-1]%2==0):7===n[0]&&o(n[n.length-1]%2==1),this.point(n.slice(1,1+i),n.slice(1+i,1+2*i));if((2===n[0]||3===n[0])&&n.length-1===i)return this.pointFromX(n.slice(1,1+i),3===n[0]);throw new Error("Unknown point format");};i.prototype.encodeCompressed=function(n){return this.encode(n,!0)};i.prototype._encode=function(n){var t=this.curve.p.byteLength(),i=this.getX().toArray("be",t);return n?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",t))};i.prototype.encode=function(n,t){return f.encode(this._encode(t),n)};i.prototype.precompute=function(n){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,n),t.beta=this._getBeta(),this.precomputed=t,this};i.prototype._hasDoubles=function(n){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((n.bitLength()+1)/t.step)};i.prototype._getDoubles=function(n,t){var r;if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var u=[this],i=this,f=0;f<t;f+=n){for(r=0;r<n;r++)i=i.dbl();u.push(i)}return{step:n,points:u}};i.prototype._getNAFPoints=function(n){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var i=[this],r=(1<<n)-1,u=1===r?null:this.dbl(),t=1;t<r;t++)i[t]=i[t-1].add(u);return{wnd:n,points:i}};i.prototype._getBeta=function(){return null};i.prototype.dblp=function(n){for(var t=this,i=0;i<n;i++)t=t.dbl();return t}},{"../../elliptic":1,"bn.js":16}],3:[function(n,t){"use strict";function r(n){this.twisted=1!=(0|n.a);this.mOneA=this.twisted&&(0|n.a)==-1;this.extended=this.mOneA;f.call(this,"edwards",n);this.a=new u(n.a,16).umod(this.red.m);this.a=this.a.toRed(this.red);this.c=new u(n.c,16).toRed(this.red);this.c2=this.c.redSqr();this.d=new u(n.d,16).toRed(this.red);this.dd=this.d.redAdd(this.d);h(!this.twisted||0===this.c.fromRed().cmpn(1));this.oneC=1==(0|n.c)}function i(n,t,i,r,e){f.BasePoint.call(this,n,"projective");null===t&&null===i&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new u(t,16),this.y=new u(i,16),this.z=r?new u(r,16):this.curve.one,this.t=e&&new u(e,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var o=n("../curve"),s=n("../../elliptic"),u=n("bn.js"),e=n("inherits"),f=o.base,h=s.utils.assert;e(r,f);t.exports=r;r.prototype._mulA=function(n){return this.mOneA?n.redNeg():this.a.redMul(n)};r.prototype._mulC=function(n){return this.oneC?n:this.c.redMul(n)};r.prototype.jpoint=function(n,t,i,r){return this.point(n,t,i,r)};r.prototype.pointFromX=function(n,t){var r;n=new u(n,16);n.red||(n=n.toRed(this.red));var f=n.redSqr(),o=this.c2.redSub(this.a.redMul(f)),s=this.one.redSub(this.c2.redMul(this.d).redMul(f)),e=o.redMul(s.redInvm()),i=e.redSqrt();if(0!==i.redSqr().redSub(e).cmp(this.zero))throw new Error("invalid point");return r=i.fromRed().isOdd(),(t&&!r||!t&&r)&&(i=i.redNeg()),this.point(n,i)};r.prototype.pointFromY=function(n,t){var i;n=new u(n,16);n.red||(n=n.toRed(this.red));var f=n.redSqr(),e=f.redSub(this.one),o=f.redMul(this.d).redAdd(this.one),r=e.redMul(o.redInvm());if(0===r.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,n)}if(i=r.redSqrt(),0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");return i.isOdd()!==t&&(i=i.redNeg()),this.point(i,n)};r.prototype.validate=function(n){if(n.isInfinity())return!0;n.normalize();var t=n.x.redSqr(),i=n.y.redSqr(),r=t.redMul(this.a).redAdd(i),u=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return 0===r.cmp(u)};e(i,f.BasePoint);r.prototype.pointFromJSON=function(n){return i.fromJSON(this,n)};r.prototype.point=function(n,t,r,u){return new i(this,n,t,r,u)};i.fromJSON=function(n,t){return new i(n,t[0],t[1],t[2])};i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};i.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)};i.prototype._extDbl=function(){var r=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var u=this.curve._mulA(r),f=this.x.redAdd(this.y).redSqr().redISub(r).redISub(t),i=u.redAdd(t),e=i.redSub(n),o=u.redSub(t),s=f.redMul(e),h=i.redMul(o),c=f.redMul(o),l=e.redMul(i);return this.curve.point(s,h,l,c)};i.prototype._projDbl=function(){var e,o,s,h=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),i=this.y.redSqr(),n,t,r,u;if(this.curve.twisted)n=this.curve._mulA(f),t=n.redAdd(i),this.zOne?(e=h.redSub(f).redSub(i).redMul(t.redSub(this.curve.two)),o=t.redMul(n.redSub(i)),s=t.redSqr().redSub(t).redSub(t)):(r=this.z.redSqr(),u=t.redSub(r).redISub(r),e=h.redSub(f).redISub(i).redMul(u),o=t.redMul(n.redSub(i)),s=t.redMul(u));else{var n=f.redAdd(i),r=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=n.redSub(r).redSub(r);e=this.curve._mulC(h.redISub(n)).redMul(u);o=this.curve._mulC(n).redMul(f.redISub(i));s=n.redMul(u)}return this.curve.point(e,o,s)};i.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};i.prototype._extAdd=function(n){var t=this.y.redSub(this.x).redMul(n.y.redSub(n.x)),i=this.y.redAdd(this.x).redMul(n.y.redAdd(n.x)),r=this.t.redMul(this.curve.dd).redMul(n.t),u=this.z.redMul(n.z.redAdd(n.z)),f=i.redSub(t),e=u.redSub(r),o=u.redAdd(r),s=i.redAdd(t),h=f.redMul(e),c=o.redMul(s),l=f.redMul(s),a=e.redMul(o);return this.curve.point(h,c,a,l)};i.prototype._projAdd=function(n){var f,e,t=this.z.redMul(n.z),s=t.redSqr(),i=this.x.redMul(n.x),r=this.y.redMul(n.y),h=this.curve.d.redMul(i).redMul(r),o=s.redSub(h),u=s.redAdd(h),c=this.x.redAdd(this.y).redMul(n.x.redAdd(n.y)).redISub(i).redISub(r),l=t.redMul(o).redMul(c);return this.curve.twisted?(f=t.redMul(u).redMul(r.redSub(this.curve._mulA(i))),e=o.redMul(u)):(f=t.redMul(u).redMul(r.redSub(i)),e=this.curve._mulC(o).redMul(u)),this.curve.point(l,f,e)};i.prototype.add=function(n){return this.isInfinity()?n:n.isInfinity()?this:this.curve.extended?this._extAdd(n):this._projAdd(n)};i.prototype.mul=function(n){return this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve._wnafMul(this,n)};i.prototype.mulAdd=function(n,t,i){return this.curve._wnafMulAdd(1,[this,t],[n,i],2,!1)};i.prototype.jmulAdd=function(n,t,i){return this.curve._wnafMulAdd(1,[this,t],[n,i],2,!0)};i.prototype.normalize=function(){if(this.zOne)return this;var n=this.z.redInvm();return this.x=this.x.redMul(n),this.y=this.y.redMul(n),this.t&&(this.t=this.t.redMul(n)),this.z=this.curve.one,this.zOne=!0,this};i.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};i.prototype.getX=function(){return this.normalize(),this.x.fromRed()};i.prototype.getY=function(){return this.normalize(),this.y.fromRed()};i.prototype.eq=function(n){return this===n||0===this.getX().cmp(n.getX())&&0===this.getY().cmp(n.getY())};i.prototype.eqXToP=function(n){var t=n.toRed(this.curve.red).redMul(this.z),i,r;if(0===this.x.cmp(t))return!0;for(i=n.clone(),r=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}return!1};i.prototype.toP=i.prototype.normalize;i.prototype.mixedAdd=i.prototype.add},{"../../elliptic":1,"../curve":4,"bn.js":16,inherits:27}],4:[function(n,t,i){"use strict";var r=i;r.base=n("./base");r.short=n("./short");r.mont=n("./mont");r.edwards=n("./edwards")},{"./base":2,"./edwards":3,"./mont":5,"./short":6}],5:[function(n,t){"use strict";function r(n){f.call(this,"mont",n);this.a=new u(n.a,16).toRed(this.red);this.b=new u(n.b,16).toRed(this.red);this.i4=new u(4).toRed(this.red).redInvm();this.two=new u(2).toRed(this.red);this.a24=this.i4.redMul(this.a.redAdd(this.two))}function i(n,t,i){f.BasePoint.call(this,n,"projective");null===t&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new u(t,16),this.z=new u(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var o=n("../curve"),u=n("bn.js"),e=n("inherits"),f=o.base,s=n("../../elliptic"),h=s.utils;e(r,f);t.exports=r;r.prototype.validate=function(n){var t=n.normalize().x,i=t.redSqr(),r=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t),u=r.redSqrt();return 0===u.redSqr().cmp(r)};e(i,f.BasePoint);r.prototype.decodePoint=function(n,t){return this.point(h.toArray(n,t),1)};r.prototype.point=function(n,t){return new i(this,n,t)};r.prototype.pointFromJSON=function(n){return i.fromJSON(this,n)};i.prototype.precompute=function(){};i.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};i.fromJSON=function(n,t){return new i(n,t[0],t[1]||n.one)};i.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};i.prototype.dbl=function(){var r=this.x.redAdd(this.z),t=r.redSqr(),u=this.x.redSub(this.z),n=u.redSqr(),i=t.redSub(n),f=t.redMul(n),e=i.redMul(n.redAdd(this.curve.a24.redMul(i)));return this.curve.point(f,e)};i.prototype.add=function(){throw new Error("Not supported on Montgomery curve");};i.prototype.diffAdd=function(n,t){var u=this.x.redAdd(this.z),f=this.x.redSub(this.z),e=n.x.redAdd(n.z),o=n.x.redSub(n.z),i=o.redMul(u),r=e.redMul(f),s=t.z.redMul(i.redAdd(r).redSqr()),h=t.x.redMul(i.redISub(r).redSqr());return this.curve.point(s,h)};i.prototype.mul=function(n){for(var r,u=n.clone(),i=this,t=this.curve.point(null,null),e=this,f=[];0!==u.cmpn(0);u.iushrn(1))f.push(u.andln(1));for(r=f.length-1;r>=0;r--)0===f[r]?(i=i.diffAdd(t,e),t=t.dbl()):(t=i.diffAdd(t,e),i=i.dbl());return t};i.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve");};i.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve");};i.prototype.eq=function(n){return 0===this.getX().cmp(n.getX())};i.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};i.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":1,"../curve":4,"bn.js":16,inherits:27}],6:[function(n,t){"use strict";function f(n){e.call(this,"short",n);this.a=new i(n.a,16).toRed(this.red);this.b=new i(n.b,16).toRed(this.red);this.tinv=this.two.redInvm();this.zeroA=0===this.a.fromRed().cmpn(0);this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3);this.endo=this._getEndomorphism(n);this._endoWnafT1=new Array(4);this._endoWnafT2=new Array(4)}function r(n,t,r,u){e.BasePoint.call(this,n,"affine");null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),u&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(n,t,r,u){e.BasePoint.call(this,n,"jacobian");null===t&&null===r&&null===u?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(u,16));this.x.red||(this.x=this.x.toRed(this.curve.red));this.y.red||(this.y=this.y.toRed(this.curve.red));this.z.red||(this.z=this.z.toRed(this.curve.red));this.zOne=this.z===this.curve.one}var s=n("../curve"),h=n("../../elliptic"),i=n("bn.js"),o=n("inherits"),e=s.base,c=h.utils.assert;o(f,e);t.exports=f;f.prototype._getEndomorphism=function(n){var t,r,u,f,e;if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3))return n.beta?t=new i(n.beta,16).toRed(this.red):(u=this._getEndoRoots(this.p),t=u[0].cmp(u[1])<0?u[0]:u[1],t=t.toRed(this.red)),n.lambda?r=new i(n.lambda,16):(f=this._getEndoRoots(this.n),0===this.g.mul(f[0]).x.cmp(this.g.x.redMul(t))?r=f[0]:(r=f[1],c(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))),e=n.basis?n.basis.map(function(n){return{a:new i(n.a,16),b:new i(n.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:e}};f.prototype._getEndoRoots=function(n){var t=n===this.p?this.red:i.mont(n),r=new i(2).toRed(t).redInvm(),u=r.redNeg(),f=new i(3).toRed(t).redNeg().redSqrt().redMul(r),e=u.redAdd(f).fromRed(),o=u.redSub(f).fromRed();return[e,o]};f.prototype._getEndoBasis=function(n){for(var c,k,d,g,v,y,t,e,r,u,p,f,s,nt=this.n.ushrn(Math.floor(this.n.bitLength()/2)),o=n,l=this.n.clone(),h=new i(1),a=new i(0),w=new i(0),b=new i(1),tt=0;0!==o.cmpn(0);){if(c=l.div(o),f=l.sub(c.mul(o)),s=w.sub(c.mul(h)),k=b.sub(c.mul(a)),!t&&f.cmp(nt)<0)v=p.neg(),y=h,t=f.neg(),e=s;else if(t&&2==++tt)break;p=f;l=o;o=f;w=h;h=s;b=a;a=k}return r=f.neg(),u=s,d=t.sqr().add(e.sqr()),g=r.sqr().add(u.sqr()),g.cmp(d)>=0&&(r=v,u=y),t.negative&&(t=t.neg(),e=e.neg()),r.negative&&(r=r.neg(),u=u.neg()),[{a:t,b:e},{a:r,b:u}]};f.prototype._endoSplit=function(n){var r=this.endo.basis,t=r[0],i=r[1],u=i.b.mul(n).divRound(this.n),f=t.b.neg().mul(n).divRound(this.n),e=u.mul(t.a),o=f.mul(i.a),s=u.mul(t.b),h=f.mul(i.b),c=n.sub(e).sub(o),l=s.add(h).neg();return{k1:c,k2:l}};f.prototype.pointFromX=function(n,t){var u,r,f;if(n=new i(n,16),n.red||(n=n.toRed(this.red)),u=n.redSqr().redMul(n).redIAdd(n.redMul(this.a)).redIAdd(this.b),r=u.redSqrt(),0!==r.redSqr().redSub(u).cmp(this.zero))throw new Error("invalid point");return f=r.fromRed().isOdd(),(t&&!f||!t&&f)&&(r=r.redNeg()),this.point(n,r)};f.prototype.validate=function(n){if(n.inf)return!0;var t=n.x,i=n.y,r=this.a.redMul(t),u=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===i.redSqr().redISub(u).cmpn(0)};f.prototype._endoWnafMulAdd=function(n,t,i){for(var c,f,e=this._endoWnafT1,o=this._endoWnafT2,r=0;r<n.length;r++){var u=this._endoSplit(t[r]),s=n[r],h=s._getBeta();u.k1.negative&&(u.k1.ineg(),s=s.neg(!0));u.k2.negative&&(u.k2.ineg(),h=h.neg(!0));e[2*r]=s;e[2*r+1]=h;o[2*r]=u.k1;o[2*r+1]=u.k2}for(c=this._wnafMulAdd(1,e,o,2*r,i),f=0;f<2*r;f++)e[f]=null,o[f]=null;return c};o(r,e.BasePoint);f.prototype.point=function(n,t,i){return new r(this,n,t,i)};f.prototype.pointFromJSON=function(n,t){return r.fromJSON(this,n,t)};r.prototype._getBeta=function(){var n,t,i,r;if(this.curve.endo)return(n=this.precomputed,n&&n.beta)?n.beta:(t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y),n&&(i=this.curve,r=function(n){return i.point(n.x.redMul(i.endo.beta),n.y)},n.beta=t,t.precomputed={beta:null,naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}),t)};r.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};r.fromJSON=function(n,t,i){function f(t){return n.point(t[0],t[1],i)}var u,r;return("string"==typeof t&&(t=JSON.parse(t)),u=n.point(t[0],t[1],i),!t[2])?u:(r=t[2],u.precomputed={beta:null,doubles:r.doubles&&{step:r.doubles.step,points:[u].concat(r.doubles.points.map(f))},naf:r.naf&&{wnd:r.naf.wnd,points:[u].concat(r.naf.points.map(f))}},u)};r.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};r.prototype.isInfinity=function(){return this.inf};r.prototype.add=function(n){var t,i,r;return this.inf?n:n.inf?this:this.eq(n)?this.dbl():this.neg().eq(n)?this.curve.point(null,null):0===this.x.cmp(n.x)?this.curve.point(null,null):(t=this.y.redSub(n.y),0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(n.x).redInvm())),i=t.redSqr().redISub(this.x).redISub(n.x),r=t.redMul(this.x.redSub(i)).redISub(this.y),this.curve.point(i,r))};r.prototype.dbl=function(){var n;if(this.inf)return this;if(n=this.y.redAdd(this.y),0===n.cmpn(0))return this.curve.point(null,null);var u=this.curve.a,t=this.x.redSqr(),f=n.redInvm(),i=t.redAdd(t).redIAdd(t).redIAdd(u).redMul(f),r=i.redSqr().redISub(this.x.redAdd(this.x)),e=i.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,e)};r.prototype.getX=function(){return this.x.fromRed()};r.prototype.getY=function(){return this.y.fromRed()};r.prototype.mul=function(n){return n=new i(n,16),this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve.endo?this.curve._endoWnafMulAdd([this],[n]):this.curve._wnafMul(this,n)};r.prototype.mulAdd=function(n,t,i){var r=[this,t],u=[n,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,u):this.curve._wnafMulAdd(1,r,u,2)};r.prototype.jmulAdd=function(n,t,i){var r=[this,t],u=[n,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,u,!0):this.curve._wnafMulAdd(1,r,u,2,!0)};r.prototype.eq=function(n){return this===n||this.inf===n.inf&&(this.inf||0===this.x.cmp(n.x)&&0===this.y.cmp(n.y))};r.prototype.neg=function(n){var i,t,r;return this.inf?this:(i=this.curve.point(this.x,this.y.redNeg()),n&&this.precomputed&&(t=this.precomputed,r=function(n){return n.neg()},i.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(r)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(r)}}),i)};r.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);return this.curve.jpoint(this.x,this.y,this.curve.one)};o(u,e.BasePoint);f.prototype.jpoint=function(n,t,i){return new u(this,n,t,i)};u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var n=this.z.redInvm(),t=n.redSqr(),i=this.x.redMul(t),r=this.y.redMul(t).redMul(n);return this.curve.point(i,r)};u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};u.prototype.add=function(n){if(this.isInfinity())return n;if(n.isInfinity())return this;var u=n.z.redSqr(),f=this.z.redSqr(),e=this.x.redMul(u),l=n.x.redMul(f),o=this.y.redMul(u.redMul(n.z)),a=n.y.redMul(f.redMul(this.z)),t=e.redSub(l),i=o.redSub(a);if(0===t.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=t.redSqr(),h=s.redMul(t),r=e.redMul(s),c=i.redSqr().redIAdd(h).redISub(r).redISub(r),v=i.redMul(r.redISub(c)).redISub(o.redMul(h)),y=this.z.redMul(n.z).redMul(t);return this.curve.jpoint(c,v,y)};u.prototype.mixedAdd=function(n){if(this.isInfinity())return n.toJ();if(n.isInfinity())return this;var u=this.z.redSqr(),f=this.x,c=n.x.redMul(u),e=this.y,l=n.y.redMul(u).redMul(this.z),t=f.redSub(c),i=e.redSub(l);if(0===t.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=t.redSqr(),s=o.redMul(t),r=f.redMul(o),h=i.redSqr().redIAdd(s).redISub(r).redISub(r),a=i.redMul(r.redISub(h)).redISub(e.redMul(s)),v=this.z.redMul(t);return this.curve.jpoint(h,a,v)};u.prototype.dblp=function(n){var i,t,p;if(0===n||this.isInfinity())return this;if(!n)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(i=this,t=0;t<n;t++)i=i.dbl();return i}for(var w=this.curve.a,b=this.curve.tinv,r=this.x,c=this.y,u=this.z,o=u.redSqr().redSqr(),f=c.redAdd(c),t=0;t<n;t++){var s=r.redSqr(),l=f.redSqr(),a=l.redSqr(),v=s.redAdd(s).redIAdd(s).redIAdd(w.redMul(o)),h=r.redMul(l),y=v.redSqr().redISub(h.redAdd(h)),k=h.redISub(y),e=v.redMul(k);e=e.redIAdd(e).redISub(a);p=f.redMul(u);t+1<n&&(o=o.redMul(a));r=y;u=p;f=e}return this.curve.jpoint(r,f.redMul(b),u)};u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};u.prototype._zeroDbl=function(){var f,s,i;if(this.zOne){var e=this.x.redSqr(),l=this.y.redSqr(),h=l.redSqr(),r=this.x.redAdd(l).redSqr().redISub(e).redISub(h);r=r.redIAdd(r);var a=e.redAdd(e).redIAdd(e),v=a.redSqr().redISub(r).redISub(r),n=h.redIAdd(h);n=n.redIAdd(n);n=n.redIAdd(n);f=v;s=a.redMul(r.redISub(v)).redISub(n);i=this.y.redAdd(this.y)}else{var o=this.x.redSqr(),y=this.y.redSqr(),c=y.redSqr(),u=this.x.redAdd(y).redSqr().redISub(o).redISub(c);u=u.redIAdd(u);var p=o.redAdd(o).redIAdd(o),w=p.redSqr(),t=c.redIAdd(c);t=t.redIAdd(t);t=t.redIAdd(t);f=w.redISub(u).redISub(u);s=p.redMul(u.redISub(f)).redISub(t);i=this.y.redMul(this.z);i=i.redIAdd(i)}return this.curve.jpoint(f,s,i)};u.prototype._threeDbl=function(){var f,o,s,c,l,t,i,w,n;if(this.zOne){var e=this.x.redSqr(),y=this.y.redSqr(),h=y.redSqr(),r=this.x.redAdd(y).redSqr().redISub(e).redISub(h);r=r.redIAdd(r);c=e.redAdd(e).redIAdd(e).redIAdd(this.curve.a);l=c.redSqr().redISub(r).redISub(r);f=l;t=h.redIAdd(h);t=t.redIAdd(t);t=t.redIAdd(t);o=c.redMul(r.redISub(l)).redISub(t);s=this.y.redAdd(this.y)}else{var a=this.z.redSqr(),v=this.y.redSqr(),p=this.x.redMul(v),u=this.x.redSub(a).redMul(this.x.redAdd(a));u=u.redAdd(u).redIAdd(u);i=p.redIAdd(p);i=i.redIAdd(i);w=i.redAdd(i);f=u.redSqr().redISub(w);s=this.y.redAdd(this.z).redSqr().redISub(v).redISub(a);n=v.redSqr();n=n.redIAdd(n);n=n.redIAdd(n);n=n.redIAdd(n);o=u.redMul(i.redISub(f)).redISub(n)}return this.curve.jpoint(f,o,s)};u.prototype._dbl=function(){var a=this.curve.a,i=this.x,r=this.y,e=this.z,v=e.redSqr().redSqr(),u=i.redSqr(),o=r.redSqr(),s=u.redAdd(u).redIAdd(u).redIAdd(a.redMul(v)),t=i.redAdd(i),c,l;t=t.redIAdd(t);var f=t.redMul(o),h=s.redSqr().redISub(f.redAdd(f)),y=f.redISub(h),n=o.redSqr();return n=n.redIAdd(n),n=n.redIAdd(n),n=n.redIAdd(n),c=s.redMul(y).redISub(n),l=r.redAdd(r).redMul(e),this.curve.jpoint(h,c,l)};u.prototype.trpl=function(){var f,t,o,r,u,i,a;if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),s=this.y.redSqr(),v=this.z.redSqr(),h=s.redSqr(),c=e.redAdd(e).redIAdd(e),l=c.redSqr(),n=this.x.redAdd(s).redSqr().redISub(e).redISub(h);return n=n.redIAdd(n),n=n.redAdd(n).redIAdd(n),n=n.redISub(l),f=n.redSqr(),t=h.redIAdd(h),t=t.redIAdd(t),t=t.redIAdd(t),t=t.redIAdd(t),o=c.redIAdd(n).redSqr().redISub(l).redISub(f).redISub(t),r=s.redMul(o),r=r.redIAdd(r),r=r.redIAdd(r),u=this.x.redMul(f).redISub(r),u=u.redIAdd(u),u=u.redIAdd(u),i=this.y.redMul(o.redMul(t.redISub(o)).redISub(n.redMul(f))),i=i.redIAdd(i),i=i.redIAdd(i),i=i.redIAdd(i),a=this.z.redAdd(n).redSqr().redISub(v).redISub(f),this.curve.jpoint(u,i,a)};u.prototype.mul=function(n,t){return n=new i(n,t),this.curve._wnafMul(this,n)};u.prototype.eq=function(n){var t,i,r,u;return"affine"===n.type?this.eq(n.toJ()):this===n?!0:(t=this.z.redSqr(),i=n.z.redSqr(),0!==this.x.redMul(i).redISub(n.x.redMul(t)).cmpn(0))?!1:(r=t.redMul(this.z),u=i.redMul(n.z),0===this.y.redMul(u).redISub(n.y.redMul(r)).cmpn(0))};u.prototype.eqXToP=function(n){var r=this.z.redSqr(),t=n.toRed(this.curve.red).redMul(r),i,u;if(0===this.x.cmp(t))return!0;for(i=n.clone(),u=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(u),0===this.x.cmp(t))return!0}return!1};u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":1,"../curve":4,"bn.js":16,inherits:27}],7:[function(n,t,i){"use strict";function s(n){this.curve="short"===n.type?new f.curve.short(n):"edwards"===n.type?new f.curve.edwards(n):new f.curve.mont(n);this.g=this.curve.g;this.n=this.curve.n;this.hash=n.hash;h(this.g.validate(),"Invalid curve");h(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function r(n,t){Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){var i=new s(t);return Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:i}),i}})}var e=i,u=n("hash.js"),f=n("../elliptic"),h=f.utils.assert,o;e.PresetCurve=s;r("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:u.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});r("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:u.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});r("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:u.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});r("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:u.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});r("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:u.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});r("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u.sha256,gRed:!1,g:["9"]});r("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{o=n("./precomputed/secp256k1")}catch(c){o=void 0}r("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:u.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})},{"../elliptic":1,"./precomputed/secp256k1":14,"hash.js":19}],8:[function(n,t){"use strict";function i(n){return this instanceof i?("string"==typeof n&&(s(u.curves.hasOwnProperty(n),"Unknown curve "+n),n=u.curves[n]),n instanceof u.curves.PresetCurve&&(n={curve:n}),this.curve=n.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=n.curve.g,this.g.precompute(n.curve.n.bitLength()+1),void(this.hash=n.hash||n.curve.hash)):new i(n)}var r=n("bn.js"),o=n("hmac-drbg"),u=n("../../elliptic"),h=u.utils,s=h.assert,e=n("./key"),f=n("./signature");t.exports=i;i.prototype.keyPair=function(n){return new e(this,n)};i.prototype.keyFromPrivate=function(n,t){return e.fromPrivate(this,n,t)};i.prototype.keyFromPublic=function(n,t){return e.fromPublic(this,n,t)};i.prototype.genKeyPair=function(n){var t;n||(n={});for(var i=new o({hash:this.hash,pers:n.pers,persEnc:n.persEnc||"utf8",entropy:n.entropy||u.rand(this.hash.hmacStrength),entropyEnc:n.entropy&&n.entropyEnc||"utf8",nonce:this.n.toArray()}),f=this.n.byteLength(),e=this.n.sub(new r(2));;)if(t=new r(i.generate(f)),!(t.cmp(e)>0))return t.iaddn(1),this.keyFromPrivate(t)};i.prototype._truncateToN=function(n,t){var i=8*n.byteLength()-this.n.bitLength();return i>0&&(n=n.ushrn(i)),!t&&n.cmp(this.n)>=0?n.sub(this.n):n};i.prototype.sign=function(n,t,i,u){var s,c,l,h,e,a;"object"==typeof i&&(u=i,i=null);u||(u={});t=this.keyFromPrivate(t,i);n=this._truncateToN(new r(n,16));for(var v=this.n.byteLength(),p=t.getPrivate().toArray("be",v),w=n.toArray("be",v),b=new o({hash:this.hash,entropy:p,nonce:w,pers:u.pers,persEnc:u.persEnc||"utf8"}),k=this.n.sub(new r(1)),y=0;;y++)if(s=u.k?u.k(y):new r(b.generate(this.n.byteLength())),(s=this._truncateToN(s,!0),!(s.cmpn(1)<=0||s.cmp(k)>=0))&&(c=this.g.mul(s),!c.isInfinity()&&(l=c.getX(),h=l.umod(this.n),0!==h.cmpn(0)&&(e=s.invm(this.n).mul(h.mul(t.getPrivate()).iadd(n)),e=e.umod(this.n),0!==e.cmpn(0)))))return a=(c.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0),u.canonical&&e.cmp(this.nh)>0&&(e=this.n.sub(e),a^=1),new f({r:h,s:e,recoveryParam:a})};i.prototype.verify=function(n,t,i,u){var o,s,e;if((n=this._truncateToN(new r(n,16)),i=this.keyFromPublic(i,u),t=new f(t,"hex"),o=t.r,s=t.s,o.cmpn(1)<0||o.cmp(this.n)>=0)||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var h=s.invm(this.n),c=h.mul(n).umod(this.n),l=h.mul(o).umod(this.n);return this.curve._maxwellTrick?(e=this.g.jmulAdd(c,i.getPublic(),l),!e.isInfinity()&&e.eqXToP(o)):(e=this.g.mulAdd(c,i.getPublic(),l),!e.isInfinity()&&0===e.getX().umod(this.n).cmp(o))};i.prototype.recoverPubKey=function(n,t,i,u){s((3&i)===i,"The recovery param is more than two bits");t=new f(t,u);var o=this.n,a=new r(n),e=t.r,v=t.s,h=1&i,c=i>>1;if(e.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");e=c?this.curve.pointFromX(e.add(this.curve.n),h):this.curve.pointFromX(e,h);var l=t.r.invm(o),y=o.sub(a).mul(l).umod(o),p=v.mul(l).umod(o);return this.g.mulAdd(y,e,p)};i.prototype.getKeyRecoveryParam=function(n,t,i,r){var u,e;if(t=new f(t,r),null!==t.recoveryParam)return t.recoveryParam;for(u=0;u<4;u++){try{e=this.recoverPubKey(n,t,u)}catch(n){continue}if(e.eq(i))return u}throw new Error("Unable to find valid recovery factor");}},{"../../elliptic":1,"./key":9,"./signature":10,"bn.js":16,"hmac-drbg":25}],9:[function(n,t){"use strict";function i(n,t){this.ec=n;this.priv=null;this.pub=null;t.priv&&this._importPrivate(t.priv,t.privEnc);t.pub&&this._importPublic(t.pub,t.pubEnc)}var u=n("bn.js"),f=n("../../elliptic"),e=f.utils,r=e.assert;t.exports=i;i.fromPublic=function(n,t,r){return t instanceof i?t:new i(n,{pub:t,pubEnc:r})};i.fromPrivate=function(n,t,r){return t instanceof i?t:new i(n,{priv:t,privEnc:r})};i.prototype.validate=function(){var n=this.getPublic();return n.isInfinity()?{result:!1,reason:"Invalid public key"}:n.validate()?n.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};i.prototype.getPublic=function(n,t){return"string"==typeof n&&(t=n,n=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,n):this.pub};i.prototype.getPrivate=function(n){return"hex"===n?this.priv.toString(16,2):this.priv};i.prototype._importPrivate=function(n,t){this.priv=new u(n,t||16);this.priv=this.priv.umod(this.ec.curve.n)};i.prototype._importPublic=function(n,t){return n.x||n.y?("mont"===this.ec.curve.type?r(n.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||r(n.x&&n.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(n.x,n.y))):void(this.pub=this.ec.curve.decodePoint(n,t))};i.prototype.derive=function(n){return n.mul(this.priv).getX()};i.prototype.sign=function(n,t,i){return this.ec.sign(n,this,t,i)};i.prototype.verify=function(n,t){return this.ec.verify(n,t,this)};i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":1,"bn.js":16}],10:[function(n,t){"use strict";function i(n,t){return n instanceof i?n:void(this._importDER(n,t)||(c(n.r&&n.s,"Signature without r or s"),this.r=new r(n.r,16),this.s=new r(n.s,16),this.recoveryParam=void 0===n.recoveryParam?null:n.recoveryParam))}function s(){this.place=0}function u(n,t){var i=n[t.place++];if(!(128&i))return i;for(var e=15&i,r=0,f=0,u=t.place;f<e;f++,u++)r<<=8,r|=n[u];return t.place=u,r}function o(n){for(var t=0,i=n.length-1;!n[t]&&!(128&n[t+1])&&t<i;)t++;return 0===t?n:n.slice(t)}function f(n,t){if(t<128)return void n.push(t);var i=1+(Math.log(t)/Math.LN2>>>3);for(n.push(128|i);--i;)n.push(t>>>(i<<3)&255);n.push(t)}var r=n("bn.js"),h=n("../../elliptic"),e=h.utils,c=e.assert;t.exports=i;i.prototype._importDER=function(n,t){var i,l,h,f,c,o;return(n=e.toArray(n,t),i=new s,48!==n[i.place++])?!1:(l=u(n,i),l+i.place!==n.length)?!1:2!==n[i.place++]?!1:(h=u(n,i),f=n.slice(i.place,h+i.place),i.place+=h,2!==n[i.place++])?!1:(c=u(n,i),n.length!==c+i.place)?!1:(o=n.slice(i.place,c+i.place),0===f[0]&&128&f[1]&&(f=f.slice(1)),0===o[0]&&128&o[1]&&(o=o.slice(1)),this.r=new r(f),this.s=new r(o),this.recoveryParam=null,!0)};i.prototype.toDER=function(n){var i=this.r.toArray(),t=this.s.toArray(),r,s,u;for(128&i[0]&&(i=[0].concat(i)),128&t[0]&&(t=[0].concat(t)),i=o(i),t=o(t);!(t[0]||128&t[1]);)t=t.slice(1);return r=[2],f(r,i.length),r=r.concat(i),r.push(2),f(r,t.length),s=r.concat(t),u=[48],f(u,s.length),u=u.concat(s),e.encode(u,n)}},{"../../elliptic":1,"bn.js":16}],11:[function(n,t){"use strict";function i(n){if(h("ed25519"===n,"only tested with ed25519 so far"),!(this instanceof i))return new i(n);var n=u.curves[n].curve;this.curve=n;this.g=n.g;this.g.precompute(n.n.bitLength()+1);this.pointClass=n.point().constructor;this.encodingLength=Math.ceil(n.n.bitLength()/8);this.hash=s.sha512}var s=n("hash.js"),u=n("../../elliptic"),r=u.utils,h=r.assert,f=r.parseBytes,e=n("./key"),o=n("./signature");t.exports=i;i.prototype.sign=function(n,t){n=f(n);var i=this.keyFromSecret(t),r=this.hashInt(i.messagePrefix(),n),u=this.g.mul(r),e=this.encodePoint(u),o=this.hashInt(e,i.pubBytes(),n).mul(i.priv()),s=r.add(o).umod(this.curve.n);return this.makeSignature({R:u,S:s,Rencoded:e})};i.prototype.verify=function(n,t,i){n=f(n);t=this.makeSignature(t);var r=this.keyFromPublic(i),u=this.hashInt(t.Rencoded(),r.pubBytes(),n),e=this.g.mul(t.S()),o=t.R().add(r.pub().mul(u));return o.eq(e)};i.prototype.hashInt=function(){for(var t=this.hash(),n=0;n<arguments.length;n++)t.update(arguments[n]);return r.intFromLE(t.digest()).umod(this.curve.n)};i.prototype.keyFromPublic=function(n){return e.fromPublic(this,n)};i.prototype.keyFromSecret=function(n){return e.fromSecret(this,n)};i.prototype.makeSignature=function(n){return n instanceof o?n:new o(this,n)};i.prototype.encodePoint=function(n){var t=n.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=n.getX().isOdd()?128:0,t};i.prototype.decodePoint=function(n){n=r.parseBytes(n);var t=n.length-1,i=n.slice(0,t).concat(n[t]&-129),u=0!=(128&n[t]),f=r.intFromLE(i);return this.curve.pointFromY(f,u)};i.prototype.encodeInt=function(n){return n.toArray("le",this.encodingLength)};i.prototype.decodeInt=function(n){return r.intFromLE(n)};i.prototype.isPoint=function(n){return n instanceof this.pointClass}},{"../../elliptic":1,"./key":12,"./signature":13,"hash.js":19}],12:[function(n,t){"use strict";function i(n,t){this.eddsa=n;this._secret=e(t.secret);n.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=e(t.pub)}var o=n("../../elliptic"),u=o.utils,f=u.assert,e=u.parseBytes,r=u.cachedProperty;i.fromPublic=function(n,t){return t instanceof i?t:new i(n,{pub:t})};i.fromSecret=function(n,t){return t instanceof i?t:new i(n,{secret:t})};i.prototype.secret=function(){return this._secret};r(i,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});r(i,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});r(i,"privBytes",function(){var t=this.eddsa,r=this.hash(),i=t.encodingLength-1,n=r.slice(0,t.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n});r(i,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});r(i,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});r(i,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});i.prototype.sign=function(n){return f(this._secret,"KeyPair can only verify"),this.eddsa.sign(n,this)};i.prototype.verify=function(n,t){return this.eddsa.verify(n,t,this)};i.prototype.getSecret=function(n){return f(this._secret,"KeyPair is public only"),u.encode(this.secret(),n)};i.prototype.getPublic=function(n){return u.encode(this.pubBytes(),n)};t.exports=i},{"../../elliptic":1}],13:[function(n,t){"use strict";function i(n,t){this.eddsa=n;"object"!=typeof t&&(t=s(t));Array.isArray(t)&&(t={R:t.slice(0,n.encodingLength),S:t.slice(n.encodingLength)});o(t.R&&t.S,"Signature without R or S");n.isPoint(t.R)&&(this._R=t.R);t.S instanceof f&&(this._S=t.S);this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded;this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}var f=n("bn.js"),e=n("../../elliptic"),r=e.utils,o=r.assert,u=r.cachedProperty,s=r.parseBytes;u(i,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});u(i,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});u(i,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});u(i,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});i.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};i.prototype.toHex=function(){return r.encode(this.toBytes(),"hex").toUpperCase()};t.exports=i},{"../../elliptic":1,"bn.js":16}],14:[function(n,t){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],15:[function(n,t,i){"use strict";function f(n,t){for(var u,f,o,s,e=[],r=1<<t+1,i=n.clone();i.cmpn(1)>=0;){for(i.isOdd()?(f=i.andln(r-1),u=f>(r>>1)-1?(r>>1)-f:f,i.isubn(u)):u=0,e.push(u),o=0!==i.cmpn(0)&&0===i.andln(r-1)?t+1:1,s=1;s<o;s++)e.push(0);i.iushrn(o)}return e}function e(n,t){var h=[[],[]],i,r,u,f,o,s,e;for(n=n.clone(),t=t.clone(),i=0,r=0;n.cmpn(-i)>0||t.cmpn(-r)>0;)u=n.andln(3)+i&3,f=t.andln(3)+r&3,3===u&&(u=-1),3===f&&(f=-1),0==(1&u)?o=0:(e=n.andln(7)+i&7,o=3!==e&&5!==e||2!==f?u:-u),h[0].push(o),0==(1&f)?s=0:(e=t.andln(7)+r&7,s=3!==e&&5!==e||2!==u?f:-f),h[1].push(s),2*i===o+1&&(i=1-i),2*r===s+1&&(r=1-r),n.iushrn(1),t.iushrn(1);return h}function o(n,t,i){var r="_"+t;n.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=i.call(this)}}function s(n){return"string"==typeof n?r.toArray(n,"hex"):n}function h(n){return new c(n,"hex","le")}var r=i,c=n("bn.js"),l=n("minimalistic-assert"),u=n("minimalistic-crypto-utils");r.assert=l;r.toArray=u.toArray;r.zero2=u.zero2;r.toHex=u.toHex;r.encode=u.encode;r.getNAF=f;r.getJSF=e;r.cachedProperty=o;r.parseBytes=s;r.intFromLE=h},{"bn.js":16,"minimalistic-assert":28,"minimalistic-crypto-utils":29}],16:[function(n,t){!function(t,i){"use strict";function u(n,t){if(!n)throw new Error(t||"Assertion failed");}function h(n,t){n.super_=t;var i=function(){};i.prototype=t.prototype;n.prototype=new i;n.prototype.constructor=n}function r(n,t,i){return r.isBN(n)?n:(this.negative=0,this.words=null,this.length=0,this.red=null,void(null!==n&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(n||0,t||10,i||"be"))))}function p(n,t,i){for(var r,u=0,e=Math.min(n.length,i),f=t;f<e;f++)r=n.charCodeAt(f)-48,u<<=4,u|=r>=49&&r<=54?r-39:r>=17&&r<=22?r-7:15&r;return u}function w(n,t,i,r){for(var u,f=0,o=Math.min(n.length,i),e=t;e<o;e++)u=n.charCodeAt(e)-48,f*=r,f+=u>=49?u-39:u>=17?u-7:u;return f}function tt(n){for(var u,r,i=new Array(n.bitLength()),t=0;t<i.length;t++)u=t/26|0,r=t%26,i[t]=(n.words[u]&1<<r)>>>r;return i}function b(n,t,i){var u,r,a;i.negative=t.negative^n.negative;u=n.length+t.length|0;i.length=u;u=u-1|0;var s=0|n.words[0],h=0|t.words[0],f=s*h,v=67108863&f,e=f/67108864|0;for(i.words[0]=v,r=1;r<u;r++){for(var l=e>>>26,c=67108863&e,y=Math.min(r,t.length-1),o=Math.max(0,r-n.length+1);o<=y;o++)a=r-o|0,s=0|n.words[a],h=0|t.words[o],f=s*h+c,l+=f/67108864|0,c=67108863&f;i.words[r]=0|c;e=0|l}return 0!==e?i.words[r]=0|e:i.length--,i.strip()}function it(n,t,i){var r;i.negative=t.negative^n.negative;i.length=n.length+t.length;for(var f=0,e=0,u=0;u<i.length-1;u++){r=e;e=0;for(var h=67108863&f,l=Math.min(u,t.length-1),o=Math.max(0,u-n.length+1);o<=l;o++){var a=u-o,v=0|n.words[a],y=0|t.words[o],c=v*y,s=67108863&c;r=r+(c/67108864|0)|0;s=s+h|0;h=67108863&s;r=r+(s>>>26)|0;e+=r>>>26;r&=67108863}i.words[u]=h;f=r;r=e}return 0!==f?i.words[u]=f:i.length--,i.strip()}function k(n,t,i){var r=new o;return r.mulp(n,t,i)}function o(n,t){this.x=n;this.y=t}function e(n,t){this.name=n;this.p=new r(t,16);this.n=this.p.bitLength();this.k=new r(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}function c(){e.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function d(){e.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){e.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function a(){e.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function f(n){if("string"==typeof n){var t=r._prime(n);this.m=t.p;this.prime=t}else u(n.gtn(1),"modulus must be greater than 1"),this.m=n,this.prime=null}function s(n){f.call(this,n);this.shift=this.m.bitLength();this.shift%26!=0&&(this.shift+=26-this.shift%26);this.r=new r(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}var v,y,l;"object"==typeof t?t.exports=r:i.BN=r;r.BN=r;r.wordSize=26;try{v=n("buffer").Buffer}catch(ft){}r.isBN=function(n){return n instanceof r||null!==n&&"object"==typeof n&&n.constructor.wordSize===r.wordSize&&Array.isArray(n.words)};r.max=function(n,t){return n.cmp(t)>0?n:t};r.min=function(n,t){return n.cmp(t)<0?n:t};r.prototype._init=function(n,t,i){if("number"==typeof n)return this._initNumber(n,t,i);if("object"==typeof n)return this._initArray(n,t,i);"hex"===t&&(t=16);u(t===(0|t)&&t>=2&&t<=36);n=n.toString().replace(/\s+/g,"");var r=0;"-"===n[0]&&r++;16===t?this._parseHex(n,r):this._parseBase(n,t,r);"-"===n[0]&&(this.negative=1);this.strip();"le"===i&&this._initArray(this.toArray(),t,i)};r.prototype._initNumber=function(n,t,i){n<0&&(this.negative=1,n=-n);n<67108864?(this.words=[67108863&n],this.length=1):n<4503599627370496?(this.words=[67108863&n,n/67108864&67108863],this.length=2):(u(n<9007199254740992),this.words=[67108863&n,n/67108864&67108863,1],this.length=3);"le"===i&&this._initArray(this.toArray(),t,i)};r.prototype._initArray=function(n,t,i){var r,e,o,f;if(u("number"==typeof n.length),n.length<=0)return this.words=[0],this.length=1,this;for(this.length=Math.ceil(n.length/3),this.words=new Array(this.length),r=0;r<this.length;r++)this.words[r]=0;if(f=0,"be"===i)for(r=n.length-1,e=0;r>=0;r-=3)o=n[r]|n[r-1]<<8|n[r-2]<<16,this.words[e]|=o<<f&67108863,this.words[e+1]=o>>>26-f&67108863,f+=24,f>=26&&(f-=26,e++);else if("le"===i)for(r=0,e=0;r<n.length;r+=3)o=n[r]|n[r+1]<<8|n[r+2]<<16,this.words[e]|=o<<f&67108863,this.words[e+1]=o>>>26-f&67108863,f+=24,f>=26&&(f-=26,e++);return this.strip()};r.prototype._parseHex=function(n,t){var i,u,f,r;for(this.length=Math.ceil((n.length-t)/6),this.words=new Array(this.length),i=0;i<this.length;i++)this.words[i]=0;for(r=0,i=n.length-6,u=0;i>=t;i-=6)f=p(n,i,i+6),this.words[u]|=f<<r&67108863,this.words[u+1]|=f>>>26-r&4194303,r+=24,r>=26&&(r-=26,u++);i+6!==t&&(f=p(n,t,i+6),this.words[u]|=f<<r&67108863,this.words[u+1]|=f>>>26-r&4194303);this.strip()};r.prototype._parseBase=function(n,t,i){var f,e,h;for(this.words=[0],this.length=1,f=0,e=1;e<=67108863;e*=t)f++;f--;e=e/t|0;for(var o=n.length-i,s=o%f,c=Math.min(o,o-s)+i,r=0,u=i;u<c;u+=f)r=w(n,u,u+f,t),this.imuln(e),this.words[0]+r<67108864?this.words[0]+=r:this._iaddn(r);if(0!==s){for(h=1,r=w(n,u,n.length,t),u=0;u<s;u++)h*=t;this.imuln(h);this.words[0]+r<67108864?this.words[0]+=r:this._iaddn(r)}};r.prototype.copy=function(n){n.words=new Array(this.length);for(var t=0;t<this.length;t++)n.words[t]=this.words[t];n.length=this.length;n.negative=this.negative;n.red=this.red};r.prototype.clone=function(){var n=new r(null);return this.copy(n),n};r.prototype._expand=function(n){for(;this.length<n;)this.words[this.length++]=0;return this};r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()};r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this};r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var nt=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],rt=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],ut=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];r.prototype.toString=function(n,t){var i,c,s,a,l,r,h;if(n=n||10,t=0|t||1,16===n||"hex"===n){i="";for(var f=0,e=0,o=0;o<this.length;o++)c=this.words[o],s=(16777215&(c<<f|e)).toString(16),e=c>>>24-f&16777215,i=0!==e||o!==this.length-1?nt[6-s.length]+s+i:s+i,f+=2,f>=26&&(f-=26,o--);for(0!==e&&(i=e.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(n===(0|n)&&n>=2&&n<=36){for(a=rt[n],l=ut[n],i="",r=this.clone(),r.negative=0;!r.isZero();)h=r.modn(l).toString(n),r=r.idivn(l),i=r.isZero()?h+i:nt[a-h.length]+h+i;for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}u(!1,"Base should be between 2 and 36")};r.prototype.toNumber=function(){var n=this.words[0];return 2===this.length?n+=67108864*this.words[1]:3===this.length&&1===this.words[2]?n+=4503599627370496+67108864*this.words[1]:this.length>2&&u(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-n:n};r.prototype.toJSON=function(){return this.toString(16)};r.prototype.toBuffer=function(n,t){return u("undefined"!=typeof v),this.toArrayLike(v,n,t)};r.prototype.toArray=function(n,t){return this.toArrayLike(Array,n,t)};r.prototype.toArrayLike=function(n,t,i){var h=this.byteLength(),f=i||Math.max(1,h);u(h<=f,"byte array longer than desired length");u(f>0,"Requested array length <= 0");this.strip();var s,r,c="le"===t,o=new n(f),e=this.clone();if(c){for(r=0;!e.isZero();r++)s=e.andln(255),e.iushrn(8),o[r]=s;for(;r<f;r++)o[r]=0}else{for(r=0;r<f-h;r++)o[r]=0;for(r=0;!e.isZero();r++)s=e.andln(255),e.iushrn(8),o[f-r-1]=s}return o};r.prototype._countBits=Math.clz32?function(n){return 32-Math.clz32(n)}:function(n){var t=n,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t};r.prototype._zeroBits=function(n){if(0===n)return 26;var t=n,i=0;return 0==(8191&t)&&(i+=13,t>>>=13),0==(127&t)&&(i+=7,t>>>=7),0==(15&t)&&(i+=4,t>>>=4),0==(3&t)&&(i+=2,t>>>=2),0==(1&t)&&i++,i};r.prototype.bitLength=function(){var n=this.words[this.length-1],t=this._countBits(n);return 26*(this.length-1)+t};r.prototype.zeroBits=function(){var t,n,i;if(this.isZero())return 0;for(t=0,n=0;n<this.length;n++)if(i=this._zeroBits(this.words[n]),t+=i,26!==i)break;return t};r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)};r.prototype.toTwos=function(n){return 0!==this.negative?this.abs().inotn(n).iaddn(1):this.clone()};r.prototype.fromTwos=function(n){return this.testn(n-1)?this.notn(n).iaddn(1).ineg():this.clone()};r.prototype.isNeg=function(){return 0!==this.negative};r.prototype.neg=function(){return this.clone().ineg()};r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this};r.prototype.iuor=function(n){for(;this.length<n.length;)this.words[this.length++]=0;for(var t=0;t<n.length;t++)this.words[t]=this.words[t]|n.words[t];return this.strip()};r.prototype.ior=function(n){return u(0==(this.negative|n.negative)),this.iuor(n)};r.prototype.or=function(n){return this.length>n.length?this.clone().ior(n):n.clone().ior(this)};r.prototype.uor=function(n){return this.length>n.length?this.clone().iuor(n):n.clone().iuor(this)};r.prototype.iuand=function(n){for(var i=this.length>n.length?n:this,t=0;t<i.length;t++)this.words[t]=this.words[t]&n.words[t];return this.length=i.length,this.strip()};r.prototype.iand=function(n){return u(0==(this.negative|n.negative)),this.iuand(n)};r.prototype.and=function(n){return this.length>n.length?this.clone().iand(n):n.clone().iand(this)};r.prototype.uand=function(n){return this.length>n.length?this.clone().iuand(n):n.clone().iuand(this)};r.prototype.iuxor=function(n){var i,r,t;for(this.length>n.length?(i=this,r=n):(i=n,r=this),t=0;t<r.length;t++)this.words[t]=i.words[t]^r.words[t];if(this!==i)for(;t<i.length;t++)this.words[t]=i.words[t];return this.length=i.length,this.strip()};r.prototype.ixor=function(n){return u(0==(this.negative|n.negative)),this.iuxor(n)};r.prototype.xor=function(n){return this.length>n.length?this.clone().ixor(n):n.clone().ixor(this)};r.prototype.uxor=function(n){return this.length>n.length?this.clone().iuxor(n):n.clone().iuxor(this)};r.prototype.inotn=function(n){var i,r,t;for(u("number"==typeof n&&n>=0),i=0|Math.ceil(n/26),r=n%26,this._expand(i),r>0&&i--,t=0;t<i;t++)this.words[t]=67108863&~this.words[t];return r>0&&(this.words[t]=~this.words[t]&67108863>>26-r),this.strip()};r.prototype.notn=function(n){return this.clone().inotn(n)};r.prototype.setn=function(n,t){u("number"==typeof n&&n>=0);var i=n/26|0,r=n%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()};r.prototype.iadd=function(n){var i,r,f,u,t;if(0!==this.negative&&0===n.negative)return this.negative=0,i=this.isub(n),this.negative^=1,this._normSign();if(0===this.negative&&0!==n.negative)return n.negative=0,i=this.isub(n),n.negative=1,i._normSign();for(this.length>n.length?(r=this,f=n):(r=n,f=this),u=0,t=0;t<f.length;t++)i=(0|r.words[t])+(0|f.words[t])+u,this.words[t]=67108863&i,u=i>>>26;for(;0!==u&&t<r.length;t++)i=(0|r.words[t])+u,this.words[t]=67108863&i,u=i>>>26;if(this.length=r.length,0!==u)this.words[this.length]=u,this.length++;else if(r!==this)for(;t<r.length;t++)this.words[t]=r.words[t];return this};r.prototype.add=function(n){var t;return 0!==n.negative&&0===this.negative?(n.negative=0,t=this.sub(n),n.negative^=1,t):0===n.negative&&0!==this.negative?(this.negative=0,t=n.sub(this),this.negative=1,t):this.length>n.length?this.clone().iadd(n):n.clone().iadd(this)};r.prototype.isub=function(n){var r,e,i,f,u,t;if(0!==n.negative)return n.negative=0,r=this.iadd(n),n.negative=1,r._normSign();if(0!==this.negative)return this.negative=0,this.iadd(n),this.negative=1,this._normSign();if(e=this.cmp(n),0===e)return this.negative=0,this.length=1,this.words[0]=0,this;for(e>0?(i=this,f=n):(i=n,f=this),u=0,t=0;t<f.length;t++)r=(0|i.words[t])-(0|f.words[t])+u,u=r>>26,this.words[t]=67108863&r;for(;0!==u&&t<i.length;t++)r=(0|i.words[t])+u,u=r>>26,this.words[t]=67108863&r;if(0===u&&t<i.length&&i!==this)for(;t<i.length;t++)this.words[t]=i.words[t];return this.length=Math.max(this.length,t),i!==this&&(this.negative=1),this.strip()};r.prototype.sub=function(n){return this.clone().isub(n)};y=function(n,t,i){var u,r,f,ei=n.words,oi=t.words,o=i.words,e=0,er=0|ei[0],s=8191&er,h=er>>>13,or=0|ei[1],c=8191&or,l=or>>>13,sr=0|ei[2],a=8191&sr,v=sr>>>13,hr=0|ei[3],y=8191&hr,p=hr>>>13,cr=0|ei[4],w=8191&cr,b=cr>>>13,lr=0|ei[5],k=8191&lr,d=lr>>>13,ar=0|ei[6],g=8191&ar,nt=ar>>>13,vr=0|ei[7],tt=8191&vr,it=vr>>>13,yr=0|ei[8],rt=8191&yr,ut=yr>>>13,pr=0|ei[9],ft=8191&pr,et=pr>>>13,wr=0|oi[0],ot=8191&wr,st=wr>>>13,br=0|oi[1],ht=8191&br,ct=br>>>13,kr=0|oi[2],lt=8191&kr,at=kr>>>13,dr=0|oi[3],vt=8191&dr,yt=dr>>>13,gr=0|oi[4],pt=8191&gr,wt=gr>>>13,nu=0|oi[5],bt=8191&nu,kt=nu>>>13,tu=0|oi[6],dt=8191&tu,gt=tu>>>13,iu=0|oi[7],ni=8191&iu,ti=iu>>>13,ru=0|oi[8],ii=8191&ru,ri=ru>>>13,uu=0|oi[9],ui=8191&uu,fi=uu>>>13,si,hi,ci,li,ai,vi,yi,pi,wi,bi,ki,di,gi,nr,tr,ir,rr,ur,fr;return i.negative=n.negative^t.negative,i.length=19,u=Math.imul(s,ot),r=Math.imul(s,st),r=r+Math.imul(h,ot)|0,f=Math.imul(h,st),si=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(si>>>26)|0,si&=67108863,u=Math.imul(c,ot),r=Math.imul(c,st),r=r+Math.imul(l,ot)|0,f=Math.imul(l,st),u=u+Math.imul(s,ht)|0,r=r+Math.imul(s,ct)|0,r=r+Math.imul(h,ht)|0,f=f+Math.imul(h,ct)|0,hi=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(hi>>>26)|0,hi&=67108863,u=Math.imul(a,ot),r=Math.imul(a,st),r=r+Math.imul(v,ot)|0,f=Math.imul(v,st),u=u+Math.imul(c,ht)|0,r=r+Math.imul(c,ct)|0,r=r+Math.imul(l,ht)|0,f=f+Math.imul(l,ct)|0,u=u+Math.imul(s,lt)|0,r=r+Math.imul(s,at)|0,r=r+Math.imul(h,lt)|0,f=f+Math.imul(h,at)|0,ci=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(ci>>>26)|0,ci&=67108863,u=Math.imul(y,ot),r=Math.imul(y,st),r=r+Math.imul(p,ot)|0,f=Math.imul(p,st),u=u+Math.imul(a,ht)|0,r=r+Math.imul(a,ct)|0,r=r+Math.imul(v,ht)|0,f=f+Math.imul(v,ct)|0,u=u+Math.imul(c,lt)|0,r=r+Math.imul(c,at)|0,r=r+Math.imul(l,lt)|0,f=f+Math.imul(l,at)|0,u=u+Math.imul(s,vt)|0,r=r+Math.imul(s,yt)|0,r=r+Math.imul(h,vt)|0,f=f+Math.imul(h,yt)|0,li=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(li>>>26)|0,li&=67108863,u=Math.imul(w,ot),r=Math.imul(w,st),r=r+Math.imul(b,ot)|0,f=Math.imul(b,st),u=u+Math.imul(y,ht)|0,r=r+Math.imul(y,ct)|0,r=r+Math.imul(p,ht)|0,f=f+Math.imul(p,ct)|0,u=u+Math.imul(a,lt)|0,r=r+Math.imul(a,at)|0,r=r+Math.imul(v,lt)|0,f=f+Math.imul(v,at)|0,u=u+Math.imul(c,vt)|0,r=r+Math.imul(c,yt)|0,r=r+Math.imul(l,vt)|0,f=f+Math.imul(l,yt)|0,u=u+Math.imul(s,pt)|0,r=r+Math.imul(s,wt)|0,r=r+Math.imul(h,pt)|0,f=f+Math.imul(h,wt)|0,ai=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(ai>>>26)|0,ai&=67108863,u=Math.imul(k,ot),r=Math.imul(k,st),r=r+Math.imul(d,ot)|0,f=Math.imul(d,st),u=u+Math.imul(w,ht)|0,r=r+Math.imul(w,ct)|0,r=r+Math.imul(b,ht)|0,f=f+Math.imul(b,ct)|0,u=u+Math.imul(y,lt)|0,r=r+Math.imul(y,at)|0,r=r+Math.imul(p,lt)|0,f=f+Math.imul(p,at)|0,u=u+Math.imul(a,vt)|0,r=r+Math.imul(a,yt)|0,r=r+Math.imul(v,vt)|0,f=f+Math.imul(v,yt)|0,u=u+Math.imul(c,pt)|0,r=r+Math.imul(c,wt)|0,r=r+Math.imul(l,pt)|0,f=f+Math.imul(l,wt)|0,u=u+Math.imul(s,bt)|0,r=r+Math.imul(s,kt)|0,r=r+Math.imul(h,bt)|0,f=f+Math.imul(h,kt)|0,vi=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(vi>>>26)|0,vi&=67108863,u=Math.imul(g,ot),r=Math.imul(g,st),r=r+Math.imul(nt,ot)|0,f=Math.imul(nt,st),u=u+Math.imul(k,ht)|0,r=r+Math.imul(k,ct)|0,r=r+Math.imul(d,ht)|0,f=f+Math.imul(d,ct)|0,u=u+Math.imul(w,lt)|0,r=r+Math.imul(w,at)|0,r=r+Math.imul(b,lt)|0,f=f+Math.imul(b,at)|0,u=u+Math.imul(y,vt)|0,r=r+Math.imul(y,yt)|0,r=r+Math.imul(p,vt)|0,f=f+Math.imul(p,yt)|0,u=u+Math.imul(a,pt)|0,r=r+Math.imul(a,wt)|0,r=r+Math.imul(v,pt)|0,f=f+Math.imul(v,wt)|0,u=u+Math.imul(c,bt)|0,r=r+Math.imul(c,kt)|0,r=r+Math.imul(l,bt)|0,f=f+Math.imul(l,kt)|0,u=u+Math.imul(s,dt)|0,r=r+Math.imul(s,gt)|0,r=r+Math.imul(h,dt)|0,f=f+Math.imul(h,gt)|0,yi=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(yi>>>26)|0,yi&=67108863,u=Math.imul(tt,ot),r=Math.imul(tt,st),r=r+Math.imul(it,ot)|0,f=Math.imul(it,st),u=u+Math.imul(g,ht)|0,r=r+Math.imul(g,ct)|0,r=r+Math.imul(nt,ht)|0,f=f+Math.imul(nt,ct)|0,u=u+Math.imul(k,lt)|0,r=r+Math.imul(k,at)|0,r=r+Math.imul(d,lt)|0,f=f+Math.imul(d,at)|0,u=u+Math.imul(w,vt)|0,r=r+Math.imul(w,yt)|0,r=r+Math.imul(b,vt)|0,f=f+Math.imul(b,yt)|0,u=u+Math.imul(y,pt)|0,r=r+Math.imul(y,wt)|0,r=r+Math.imul(p,pt)|0,f=f+Math.imul(p,wt)|0,u=u+Math.imul(a,bt)|0,r=r+Math.imul(a,kt)|0,r=r+Math.imul(v,bt)|0,f=f+Math.imul(v,kt)|0,u=u+Math.imul(c,dt)|0,r=r+Math.imul(c,gt)|0,r=r+Math.imul(l,dt)|0,f=f+Math.imul(l,gt)|0,u=u+Math.imul(s,ni)|0,r=r+Math.imul(s,ti)|0,r=r+Math.imul(h,ni)|0,f=f+Math.imul(h,ti)|0,pi=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(pi>>>26)|0,pi&=67108863,u=Math.imul(rt,ot),r=Math.imul(rt,st),r=r+Math.imul(ut,ot)|0,f=Math.imul(ut,st),u=u+Math.imul(tt,ht)|0,r=r+Math.imul(tt,ct)|0,r=r+Math.imul(it,ht)|0,f=f+Math.imul(it,ct)|0,u=u+Math.imul(g,lt)|0,r=r+Math.imul(g,at)|0,r=r+Math.imul(nt,lt)|0,f=f+Math.imul(nt,at)|0,u=u+Math.imul(k,vt)|0,r=r+Math.imul(k,yt)|0,r=r+Math.imul(d,vt)|0,f=f+Math.imul(d,yt)|0,u=u+Math.imul(w,pt)|0,r=r+Math.imul(w,wt)|0,r=r+Math.imul(b,pt)|0,f=f+Math.imul(b,wt)|0,u=u+Math.imul(y,bt)|0,r=r+Math.imul(y,kt)|0,r=r+Math.imul(p,bt)|0,f=f+Math.imul(p,kt)|0,u=u+Math.imul(a,dt)|0,r=r+Math.imul(a,gt)|0,r=r+Math.imul(v,dt)|0,f=f+Math.imul(v,gt)|0,u=u+Math.imul(c,ni)|0,r=r+Math.imul(c,ti)|0,r=r+Math.imul(l,ni)|0,f=f+Math.imul(l,ti)|0,u=u+Math.imul(s,ii)|0,r=r+Math.imul(s,ri)|0,r=r+Math.imul(h,ii)|0,f=f+Math.imul(h,ri)|0,wi=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(wi>>>26)|0,wi&=67108863,u=Math.imul(ft,ot),r=Math.imul(ft,st),r=r+Math.imul(et,ot)|0,f=Math.imul(et,st),u=u+Math.imul(rt,ht)|0,r=r+Math.imul(rt,ct)|0,r=r+Math.imul(ut,ht)|0,f=f+Math.imul(ut,ct)|0,u=u+Math.imul(tt,lt)|0,r=r+Math.imul(tt,at)|0,r=r+Math.imul(it,lt)|0,f=f+Math.imul(it,at)|0,u=u+Math.imul(g,vt)|0,r=r+Math.imul(g,yt)|0,r=r+Math.imul(nt,vt)|0,f=f+Math.imul(nt,yt)|0,u=u+Math.imul(k,pt)|0,r=r+Math.imul(k,wt)|0,r=r+Math.imul(d,pt)|0,f=f+Math.imul(d,wt)|0,u=u+Math.imul(w,bt)|0,r=r+Math.imul(w,kt)|0,r=r+Math.imul(b,bt)|0,f=f+Math.imul(b,kt)|0,u=u+Math.imul(y,dt)|0,r=r+Math.imul(y,gt)|0,r=r+Math.imul(p,dt)|0,f=f+Math.imul(p,gt)|0,u=u+Math.imul(a,ni)|0,r=r+Math.imul(a,ti)|0,r=r+Math.imul(v,ni)|0,f=f+Math.imul(v,ti)|0,u=u+Math.imul(c,ii)|0,r=r+Math.imul(c,ri)|0,r=r+Math.imul(l,ii)|0,f=f+Math.imul(l,ri)|0,u=u+Math.imul(s,ui)|0,r=r+Math.imul(s,fi)|0,r=r+Math.imul(h,ui)|0,f=f+Math.imul(h,fi)|0,bi=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(bi>>>26)|0,bi&=67108863,u=Math.imul(ft,ht),r=Math.imul(ft,ct),r=r+Math.imul(et,ht)|0,f=Math.imul(et,ct),u=u+Math.imul(rt,lt)|0,r=r+Math.imul(rt,at)|0,r=r+Math.imul(ut,lt)|0,f=f+Math.imul(ut,at)|0,u=u+Math.imul(tt,vt)|0,r=r+Math.imul(tt,yt)|0,r=r+Math.imul(it,vt)|0,f=f+Math.imul(it,yt)|0,u=u+Math.imul(g,pt)|0,r=r+Math.imul(g,wt)|0,r=r+Math.imul(nt,pt)|0,f=f+Math.imul(nt,wt)|0,u=u+Math.imul(k,bt)|0,r=r+Math.imul(k,kt)|0,r=r+Math.imul(d,bt)|0,f=f+Math.imul(d,kt)|0,u=u+Math.imul(w,dt)|0,r=r+Math.imul(w,gt)|0,r=r+Math.imul(b,dt)|0,f=f+Math.imul(b,gt)|0,u=u+Math.imul(y,ni)|0,r=r+Math.imul(y,ti)|0,r=r+Math.imul(p,ni)|0,f=f+Math.imul(p,ti)|0,u=u+Math.imul(a,ii)|0,r=r+Math.imul(a,ri)|0,r=r+Math.imul(v,ii)|0,f=f+Math.imul(v,ri)|0,u=u+Math.imul(c,ui)|0,r=r+Math.imul(c,fi)|0,r=r+Math.imul(l,ui)|0,f=f+Math.imul(l,fi)|0,ki=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(ki>>>26)|0,ki&=67108863,u=Math.imul(ft,lt),r=Math.imul(ft,at),r=r+Math.imul(et,lt)|0,f=Math.imul(et,at),u=u+Math.imul(rt,vt)|0,r=r+Math.imul(rt,yt)|0,r=r+Math.imul(ut,vt)|0,f=f+Math.imul(ut,yt)|0,u=u+Math.imul(tt,pt)|0,r=r+Math.imul(tt,wt)|0,r=r+Math.imul(it,pt)|0,f=f+Math.imul(it,wt)|0,u=u+Math.imul(g,bt)|0,r=r+Math.imul(g,kt)|0,r=r+Math.imul(nt,bt)|0,f=f+Math.imul(nt,kt)|0,u=u+Math.imul(k,dt)|0,r=r+Math.imul(k,gt)|0,r=r+Math.imul(d,dt)|0,f=f+Math.imul(d,gt)|0,u=u+Math.imul(w,ni)|0,r=r+Math.imul(w,ti)|0,r=r+Math.imul(b,ni)|0,f=f+Math.imul(b,ti)|0,u=u+Math.imul(y,ii)|0,r=r+Math.imul(y,ri)|0,r=r+Math.imul(p,ii)|0,f=f+Math.imul(p,ri)|0,u=u+Math.imul(a,ui)|0,r=r+Math.imul(a,fi)|0,r=r+Math.imul(v,ui)|0,f=f+Math.imul(v,fi)|0,di=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(di>>>26)|0,di&=67108863,u=Math.imul(ft,vt),r=Math.imul(ft,yt),r=r+Math.imul(et,vt)|0,f=Math.imul(et,yt),u=u+Math.imul(rt,pt)|0,r=r+Math.imul(rt,wt)|0,r=r+Math.imul(ut,pt)|0,f=f+Math.imul(ut,wt)|0,u=u+Math.imul(tt,bt)|0,r=r+Math.imul(tt,kt)|0,r=r+Math.imul(it,bt)|0,f=f+Math.imul(it,kt)|0,u=u+Math.imul(g,dt)|0,r=r+Math.imul(g,gt)|0,r=r+Math.imul(nt,dt)|0,f=f+Math.imul(nt,gt)|0,u=u+Math.imul(k,ni)|0,r=r+Math.imul(k,ti)|0,r=r+Math.imul(d,ni)|0,f=f+Math.imul(d,ti)|0,u=u+Math.imul(w,ii)|0,r=r+Math.imul(w,ri)|0,r=r+Math.imul(b,ii)|0,f=f+Math.imul(b,ri)|0,u=u+Math.imul(y,ui)|0,r=r+Math.imul(y,fi)|0,r=r+Math.imul(p,ui)|0,f=f+Math.imul(p,fi)|0,gi=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(gi>>>26)|0,gi&=67108863,u=Math.imul(ft,pt),r=Math.imul(ft,wt),r=r+Math.imul(et,pt)|0,f=Math.imul(et,wt),u=u+Math.imul(rt,bt)|0,r=r+Math.imul(rt,kt)|0,r=r+Math.imul(ut,bt)|0,f=f+Math.imul(ut,kt)|0,u=u+Math.imul(tt,dt)|0,r=r+Math.imul(tt,gt)|0,r=r+Math.imul(it,dt)|0,f=f+Math.imul(it,gt)|0,u=u+Math.imul(g,ni)|0,r=r+Math.imul(g,ti)|0,r=r+Math.imul(nt,ni)|0,f=f+Math.imul(nt,ti)|0,u=u+Math.imul(k,ii)|0,r=r+Math.imul(k,ri)|0,r=r+Math.imul(d,ii)|0,f=f+Math.imul(d,ri)|0,u=u+Math.imul(w,ui)|0,r=r+Math.imul(w,fi)|0,r=r+Math.imul(b,ui)|0,f=f+Math.imul(b,fi)|0,nr=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(nr>>>26)|0,nr&=67108863,u=Math.imul(ft,bt),r=Math.imul(ft,kt),r=r+Math.imul(et,bt)|0,f=Math.imul(et,kt),u=u+Math.imul(rt,dt)|0,r=r+Math.imul(rt,gt)|0,r=r+Math.imul(ut,dt)|0,f=f+Math.imul(ut,gt)|0,u=u+Math.imul(tt,ni)|0,r=r+Math.imul(tt,ti)|0,r=r+Math.imul(it,ni)|0,f=f+Math.imul(it,ti)|0,u=u+Math.imul(g,ii)|0,r=r+Math.imul(g,ri)|0,r=r+Math.imul(nt,ii)|0,f=f+Math.imul(nt,ri)|0,u=u+Math.imul(k,ui)|0,r=r+Math.imul(k,fi)|0,r=r+Math.imul(d,ui)|0,f=f+Math.imul(d,fi)|0,tr=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(tr>>>26)|0,tr&=67108863,u=Math.imul(ft,dt),r=Math.imul(ft,gt),r=r+Math.imul(et,dt)|0,f=Math.imul(et,gt),u=u+Math.imul(rt,ni)|0,r=r+Math.imul(rt,ti)|0,r=r+Math.imul(ut,ni)|0,f=f+Math.imul(ut,ti)|0,u=u+Math.imul(tt,ii)|0,r=r+Math.imul(tt,ri)|0,r=r+Math.imul(it,ii)|0,f=f+Math.imul(it,ri)|0,u=u+Math.imul(g,ui)|0,r=r+Math.imul(g,fi)|0,r=r+Math.imul(nt,ui)|0,f=f+Math.imul(nt,fi)|0,ir=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(ir>>>26)|0,ir&=67108863,u=Math.imul(ft,ni),r=Math.imul(ft,ti),r=r+Math.imul(et,ni)|0,f=Math.imul(et,ti),u=u+Math.imul(rt,ii)|0,r=r+Math.imul(rt,ri)|0,r=r+Math.imul(ut,ii)|0,f=f+Math.imul(ut,ri)|0,u=u+Math.imul(tt,ui)|0,r=r+Math.imul(tt,fi)|0,r=r+Math.imul(it,ui)|0,f=f+Math.imul(it,fi)|0,rr=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(rr>>>26)|0,rr&=67108863,u=Math.imul(ft,ii),r=Math.imul(ft,ri),r=r+Math.imul(et,ii)|0,f=Math.imul(et,ri),u=u+Math.imul(rt,ui)|0,r=r+Math.imul(rt,fi)|0,r=r+Math.imul(ut,ui)|0,f=f+Math.imul(ut,fi)|0,ur=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(ur>>>26)|0,ur&=67108863,u=Math.imul(ft,ui),r=Math.imul(ft,fi),r=r+Math.imul(et,ui)|0,f=Math.imul(et,fi),fr=(e+u|0)+((8191&r)<<13)|0,e=(f+(r>>>13)|0)+(fr>>>26)|0,fr&=67108863,o[0]=si,o[1]=hi,o[2]=ci,o[3]=li,o[4]=ai,o[5]=vi,o[6]=yi,o[7]=pi,o[8]=wi,o[9]=bi,o[10]=ki,o[11]=di,o[12]=gi,o[13]=nr,o[14]=tr,o[15]=ir,o[16]=rr,o[17]=ur,o[18]=fr,0!==e&&(o[19]=e,i.length++),i};Math.imul||(y=b);r.prototype.mulTo=function(n,t){var i=this.length+n.length;return 10===this.length&&10===n.length?y(this,n,t):i<63?b(this,n,t):i<1024?it(this,n,t):k(this,n,t)};o.prototype.makeRBT=function(n){for(var i=new Array(n),u=r.prototype._countBits(n)-1,t=0;t<n;t++)i[t]=this.revBin(t,u,n);return i};o.prototype.revBin=function(n,t,i){if(0===n||n===i-1)return n;for(var u=0,r=0;r<t;r++)u|=(1&n)<<t-r-1,n>>=1;return u};o.prototype.permute=function(n,t,i,r,u,f){for(var e=0;e<f;e++)r[e]=t[n[e]],u[e]=i[n[e]]};o.prototype.transform=function(n,t,i,r,u,f){var s;for(this.permute(f,n,t,i,r,u),s=1;s<u;s<<=1)for(var v=s<<1,y=Math.cos(2*Math.PI/v),p=Math.sin(2*Math.PI/v),o=0;o<u;o+=v)for(var h=y,c=p,e=0;e<s;e++){var b=i[o+e],k=r[o+e],l=i[o+e+s],a=r[o+e+s],w=h*l-c*a;a=h*a+c*l;l=w;i[o+e]=b+l;r[o+e]=k+a;i[o+e+s]=b-l;r[o+e+s]=k-a;e!==v&&(w=y*h-p*c,c=y*c+p*h,h=w)}};o.prototype.guessLen13b=function(n,t){for(var i=1|Math.max(t,n),u=1&i,r=0,i=i/2|0;i;i>>>=1)r++;return 1<<r+1+u};o.prototype.conjugate=function(n,t,i){var r,u;if(!(i<=1))for(r=0;r<i/2;r++)u=n[r],n[r]=n[i-r-1],n[i-r-1]=u,u=t[r],t[r]=-t[i-r-1],t[i-r-1]=-u};o.prototype.normalize13b=function(n,t){for(var r,u=0,i=0;i<t/2;i++)r=8192*Math.round(n[2*i+1]/t)+Math.round(n[2*i]/t)+u,n[i]=67108863&r,u=r<67108864?0:r/67108864|0;return n};o.prototype.convert13b=function(n,t,i,r){for(var e=0,f=0;f<t;f++)e+=0|n[f],i[2*f]=8191&e,e>>>=13,i[2*f+1]=8191&e,e>>>=13;for(f=2*t;f<r;++f)i[f]=0;u(0===e);u(0==(e&-8192))};o.prototype.stub=function(n){for(var i=new Array(n),t=0;t<n;t++)i[t]=0;return i};o.prototype.mulp=function(n,t,i){var r=2*this.guessLen13b(n.length,t.length),h=this.makeRBT(r),o=this.stub(r),a=new Array(r),f=new Array(r),e=new Array(r),v=new Array(r),c=new Array(r),l=new Array(r),s=i.words,u,y;for(s.length=r,this.convert13b(n.words,n.length,a,r),this.convert13b(t.words,t.length,v,r),this.transform(a,o,f,e,r,h),this.transform(v,o,c,l,r,h),u=0;u<r;u++)y=f[u]*c[u]-e[u]*l[u],e[u]=f[u]*l[u]+e[u]*c[u],f[u]=y;return this.conjugate(f,e,r),this.transform(f,e,s,o,r,h),this.conjugate(s,o,r),this.normalize13b(s,r),i.negative=n.negative^t.negative,i.length=n.length+t.length,i.strip()};r.prototype.mul=function(n){var t=new r(null);return t.words=new Array(this.length+n.length),this.mulTo(n,t)};r.prototype.mulf=function(n){var t=new r(null);return t.words=new Array(this.length+n.length),k(this,n,t)};r.prototype.imul=function(n){return this.clone().mulTo(n,this)};r.prototype.imuln=function(n){var t,i,r,f;for(u("number"==typeof n),u(n<67108864),t=0,i=0;i<this.length;i++)r=(0|this.words[i])*n,f=(67108863&r)+(67108863&t),t>>=26,t+=r/67108864|0,t+=f>>>26,this.words[i]=67108863&f;return 0!==t&&(this.words[i]=t,this.length++),this};r.prototype.muln=function(n){return this.clone().imuln(n)};r.prototype.sqr=function(){return this.mul(this)};r.prototype.isqr=function(){return this.imul(this.clone())};r.prototype.pow=function(n){var u=tt(n),i,t,f;if(0===u.length)return new r(1);for(i=this,t=0;t<u.length&&0===u[t];t++,i=i.sqr());if(++t<u.length)for(f=i.sqr();t<u.length;t++,f=f.sqr())0!==u[t]&&(i=i.mul(f));return i};r.prototype.iushln=function(n){var r,e,o;u("number"==typeof n&&n>=0);var t,i=n%26,f=(n-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){for(r=0,t=0;t<this.length;t++)e=this.words[t]&s,o=(0|this.words[t])-e<<i,this.words[t]=o|r,r=e>>>26-i;r&&(this.words[t]=r,this.length++)}if(0!==f){for(t=this.length-1;t>=0;t--)this.words[t+f]=this.words[t];for(t=0;t<f;t++)this.words[t]=0;this.length+=f}return this.strip()};r.prototype.ishln=function(n){return u(0===this.negative),this.iushln(n)};r.prototype.iushrn=function(n,t,i){var s,r,o,c;u("number"==typeof n&&n>=0);s=t?(t-t%26)/26:0;var h=n%26,f=Math.min((n-h)/26,this.length),l=67108863^67108863>>>h<<h,e=i;if(s-=f,s=Math.max(0,s),e){for(r=0;r<f;r++)e.words[r]=this.words[r];e.length=f}if(0!==f)if(this.length>f)for(this.length-=f,r=0;r<this.length;r++)this.words[r]=this.words[r+f];else this.words[0]=0,this.length=1;for(o=0,r=this.length-1;r>=0&&(0!==o||r>=s);r--)c=0|this.words[r],this.words[r]=o<<26-h|c>>>h,o=c&l;return e&&0!==o&&(e.words[e.length++]=o),0===this.length&&(this.words[0]=0,this.length=1),this.strip()};r.prototype.ishrn=function(n,t,i){return u(0===this.negative),this.iushrn(n,t,i)};r.prototype.shln=function(n){return this.clone().ishln(n)};r.prototype.ushln=function(n){return this.clone().iushln(n)};r.prototype.shrn=function(n){return this.clone().ishrn(n)};r.prototype.ushrn=function(n){return this.clone().iushrn(n)};r.prototype.testn=function(n){var r;u("number"==typeof n&&n>=0);var t=n%26,i=(n-t)/26,f=1<<t;return this.length<=i?!1:(r=this.words[i],!!(r&f))};r.prototype.imaskn=function(n){var t,i,r;return(u("number"==typeof n&&n>=0),t=n%26,i=(n-t)/26,u(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:((0!==t&&i++,this.length=Math.min(i,this.length),0!==t)&&(r=67108863^67108863>>>t<<t,this.words[this.length-1]&=r),this.strip())};r.prototype.maskn=function(n){return this.clone().imaskn(n)};r.prototype.iaddn=function(n){return u("number"==typeof n),u(n<67108864),n<0?this.isubn(-n):0!==this.negative?1===this.length&&(0|this.words[0])<n?(this.words[0]=n-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(n),this.negative=1,this):this._iaddn(n)};r.prototype._iaddn=function(n){this.words[0]+=n;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this};r.prototype.isubn=function(n){if(u("number"==typeof n),u(n<67108864),n<0)return this.iaddn(-n);if(0!==this.negative)return this.negative=0,this.iaddn(n),this.negative=1,this;if(this.words[0]-=n,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()};r.prototype.addn=function(n){return this.clone().iaddn(n)};r.prototype.subn=function(n){return this.clone().isubn(n)};r.prototype.iabs=function(){return this.negative=0,this};r.prototype.abs=function(){return this.clone().iabs()};r.prototype._ishlnsubmul=function(n,t,i){var r,s=n.length+i,f,e,o;for(this._expand(s),e=0,r=0;r<n.length;r++)f=(0|this.words[r+i])+e,o=(0|n.words[r])*t,f-=67108863&o,e=(f>>26)-(o/67108864|0),this.words[r+i]=67108863&f;for(;r<this.length-i;r++)f=(0|this.words[r+i])+e,e=f>>26,this.words[r+i]=67108863&f;if(0===e)return this.strip();for(u(e===-1),e=0,r=0;r<this.length;r++)f=-(0|this.words[r])+e,e=f>>26,this.words[r]=67108863&f;return this.negative=1,this.strip()};r.prototype._wordDiv=function(n,t){var o=this.length-n.length,i=this.clone(),f=n,l=0|f.words[f.length-1],v=this._countBits(l),u,h,c,a,e,s;if(o=26-v,0!==o&&(f=f.ushln(o),i.iushln(o),l=0|f.words[f.length-1]),h=i.length-f.length,"mod"!==t)for(u=new r(null),u.length=h+1,u.words=new Array(u.length),c=0;c<u.length;c++)u.words[c]=0;for(a=i.clone()._ishlnsubmul(f,1,h),0===a.negative&&(i=a,u&&(u.words[h]=1)),e=h-1;e>=0;e--){for(s=67108864*(0|i.words[f.length+e])+(0|i.words[f.length+e-1]),s=Math.min(s/l|0,67108863),i._ishlnsubmul(f,s,e);0!==i.negative;)s--,i.negative=0,i._ishlnsubmul(f,1,e),i.isZero()||(i.negative^=1);u&&(u.words[e]=s)}return u&&u.strip(),i.strip(),"div"!==t&&0!==o&&i.iushrn(o),{div:u||null,mod:i}};r.prototype.divmod=function(n,t,i){if(u(!n.isZero()),this.isZero())return{div:new r(0),mod:new r(0)};var o,e,f;return 0!==this.negative&&0===n.negative?(f=this.neg().divmod(n,t),"mod"!==t&&(o=f.div.neg()),"div"!==t&&(e=f.mod.neg(),i&&0!==e.negative&&e.iadd(n)),{div:o,mod:e}):0===this.negative&&0!==n.negative?(f=this.divmod(n.neg(),t),"mod"!==t&&(o=f.div.neg()),{div:o,mod:f.mod}):0!=(this.negative&n.negative)?(f=this.neg().divmod(n.neg(),t),"div"!==t&&(e=f.mod.neg(),i&&0!==e.negative&&e.isub(n)),{div:f.div,mod:e}):n.length>this.length||this.cmp(n)<0?{div:new r(0),mod:this}:1===n.length?"div"===t?{div:this.divn(n.words[0]),mod:null}:"mod"===t?{div:null,mod:new r(this.modn(n.words[0]))}:{div:this.divn(n.words[0]),mod:new r(this.modn(n.words[0]))}:this._wordDiv(n,t)};r.prototype.div=function(n){return this.divmod(n,"div",!1).div};r.prototype.mod=function(n){return this.divmod(n,"mod",!1).mod};r.prototype.umod=function(n){return this.divmod(n,"mod",!0).mod};r.prototype.divRound=function(n){var t=this.divmod(n);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(n):t.mod,u=n.ushrn(1),f=n.andln(1),i=r.cmp(u);return i<0||1===f&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)};r.prototype.modn=function(n){u(n<=67108863);for(var r=67108864%n,t=0,i=this.length-1;i>=0;i--)t=(r*t+(0|this.words[i]))%n;return t};r.prototype.idivn=function(n){var i,t,r;for(u(n<=67108863),i=0,t=this.length-1;t>=0;t--)r=(0|this.words[t])+67108864*i,this.words[t]=r/n|0,i=r%n;return this.strip()};r.prototype.divn=function(n){return this.clone().idivn(n)};r.prototype.egcd=function(n){var t,i,l,a,o,v,s,y;u(0===n.negative);u(!n.isZero());t=this;i=n.clone();t=0!==t.negative?t.umod(n):t.clone();for(var h=new r(1),c=new r(0),f=new r(0),e=new r(1),p=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++p;for(l=i.clone(),a=t.clone();!t.isZero();){for(o=0,v=1;0==(t.words[0]&v)&&o<26;++o,v<<=1);if(o>0)for(t.iushrn(o);o-->0;)(h.isOdd()||c.isOdd())&&(h.iadd(l),c.isub(a)),h.iushrn(1),c.iushrn(1);for(s=0,y=1;0==(i.words[0]&y)&&s<26;++s,y<<=1);if(s>0)for(i.iushrn(s);s-->0;)(f.isOdd()||e.isOdd())&&(f.iadd(l),e.isub(a)),f.iushrn(1),e.iushrn(1);t.cmp(i)>=0?(t.isub(i),h.isub(f),c.isub(e)):(i.isub(t),f.isub(h),e.isub(c))}return{a:f,b:e,gcd:i.iushln(p)}};r.prototype._invmp=function(n){var t,i,o,c,s,l,h;u(0===n.negative);u(!n.isZero());t=this;i=n.clone();t=0!==t.negative?t.umod(n):t.clone();for(var f=new r(1),e=new r(0),a=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(o=0,c=1;0==(t.words[0]&c)&&o<26;++o,c<<=1);if(o>0)for(t.iushrn(o);o-->0;)f.isOdd()&&f.iadd(a),f.iushrn(1);for(s=0,l=1;0==(i.words[0]&l)&&s<26;++s,l<<=1);if(s>0)for(i.iushrn(s);s-->0;)e.isOdd()&&e.iadd(a),e.iushrn(1);t.cmp(i)>=0?(t.isub(i),f.isub(e)):(i.isub(t),e.isub(f))}return h=0===t.cmpn(1)?f:e,h.cmpn(0)<0&&h.iadd(n),h};r.prototype.gcd=function(n){var i,t,r,u,f;if(this.isZero())return n.abs();if(n.isZero())return this.abs();for(i=this.clone(),t=n.clone(),i.negative=0,t.negative=0,r=0;i.isEven()&&t.isEven();r++)i.iushrn(1),t.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;t.isEven();)t.iushrn(1);if(u=i.cmp(t),u<0)f=i,i=t,t=f;else if(0===u||0===t.cmpn(1))break;i.isub(t)}return t.iushln(r)};r.prototype.invm=function(n){return this.egcd(n).a.umod(n)};r.prototype.isEven=function(){return 0==(1&this.words[0])};r.prototype.isOdd=function(){return 1==(1&this.words[0])};r.prototype.andln=function(n){return this.words[0]&n};r.prototype.bincn=function(n){var t,i,r;u("number"==typeof n);var e=n%26,f=(n-e)/26,o=1<<e;if(this.length<=f)return this._expand(f+1),this.words[f]|=o,this;for(t=o,i=f;0!==t&&i<this.length;i++)r=0|this.words[i],r+=t,t=r>>>26,r&=67108863,this.words[i]=r;return 0!==t&&(this.words[i]=t,this.length++),this};r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]};r.prototype.cmpn=function(n){var i=n<0,t,r;return 0!==this.negative&&!i?-1:0===this.negative&&i?1:(this.strip(),this.length>1?t=1:(i&&(n=-n),u(n<=67108863,"Number is too big"),r=0|this.words[0],t=r===n?0:r<n?-1:1),0!==this.negative?0|-t:t)};r.prototype.cmp=function(n){if(0!==this.negative&&0===n.negative)return-1;if(0===this.negative&&0!==n.negative)return 1;var t=this.ucmp(n);return 0!==this.negative?0|-t:t};r.prototype.ucmp=function(n){var i,t,r,u;if(this.length>n.length)return 1;if(this.length<n.length)return-1;for(i=0,t=this.length-1;t>=0;t--)if(r=0|this.words[t],u=0|n.words[t],r!==u){r<u?i=-1:r>u&&(i=1);break}return i};r.prototype.gtn=function(n){return 1===this.cmpn(n)};r.prototype.gt=function(n){return 1===this.cmp(n)};r.prototype.gten=function(n){return this.cmpn(n)>=0};r.prototype.gte=function(n){return this.cmp(n)>=0};r.prototype.ltn=function(n){return this.cmpn(n)===-1};r.prototype.lt=function(n){return this.cmp(n)===-1};r.prototype.lten=function(n){return this.cmpn(n)<=0};r.prototype.lte=function(n){return this.cmp(n)<=0};r.prototype.eqn=function(n){return 0===this.cmpn(n)};r.prototype.eq=function(n){return 0===this.cmp(n)};r.red=function(n){return new f(n)};r.prototype.toRed=function(n){return u(!this.red,"Already a number in reduction context"),u(0===this.negative,"red works only with positives"),n.convertTo(this)._forceRed(n)};r.prototype.fromRed=function(){return u(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)};r.prototype._forceRed=function(n){return this.red=n,this};r.prototype.forceRed=function(n){return u(!this.red,"Already a number in reduction context"),this._forceRed(n)};r.prototype.redAdd=function(n){return u(this.red,"redAdd works only with red numbers"),this.red.add(this,n)};r.prototype.redIAdd=function(n){return u(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,n)};r.prototype.redSub=function(n){return u(this.red,"redSub works only with red numbers"),this.red.sub(this,n)};r.prototype.redISub=function(n){return u(this.red,"redISub works only with red numbers"),this.red.isub(this,n)};r.prototype.redShl=function(n){return u(this.red,"redShl works only with red numbers"),this.red.shl(this,n)};r.prototype.redMul=function(n){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.mul(this,n)};r.prototype.redIMul=function(n){return u(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.imul(this,n)};r.prototype.redSqr=function(){return u(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)};r.prototype.redISqr=function(){return u(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)};r.prototype.redSqrt=function(){return u(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)};r.prototype.redInvm=function(){return u(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)};r.prototype.redNeg=function(){return u(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)};r.prototype.redPow=function(n){return u(this.red&&!n.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,n)};l={k256:null,p224:null,p192:null,p25519:null};e.prototype._tmp=function(){var n=new r(null);return n.words=new Array(Math.ceil(this.n/13)),n};e.prototype.ireduce=function(n){var i,t=n,r;do this.split(t,this.tmp),t=this.imulK(t),t=t.iadd(this.tmp),i=t.bitLength();while(i>this.n);return r=i<this.n?-1:t.ucmp(this.p),0===r?(t.words[0]=0,t.length=1):r>0?t.isub(this.p):t.strip(),t};e.prototype.split=function(n,t){n.iushrn(this.n,0,t)};e.prototype.imulK=function(n){return n.imul(this.k)};h(c,e);c.prototype.split=function(n,t){for(var r,u,f=4194303,e=Math.min(n.length,9),i=0;i<e;i++)t.words[i]=n.words[i];if(t.length=e,n.length<=9)return n.words[0]=0,void(n.length=1);for(r=n.words[9],t.words[t.length++]=r&f,i=10;i<n.length;i++)u=0|n.words[i],n.words[i-10]=(u&f)<<4|r>>>22,r=u;r>>>=22;n.words[i-10]=r;n.length-=0===r&&n.length>10?10:9};c.prototype.imulK=function(n){var t,i,r;for(n.words[n.length]=0,n.words[n.length+1]=0,n.length+=2,t=0,i=0;i<n.length;i++)r=0|n.words[i],t+=977*r,n.words[i]=67108863&t,t=64*r+(t/67108864|0);return 0===n.words[n.length-1]&&(n.length--,0===n.words[n.length-1]&&n.length--),n};h(d,e);h(g,e);h(a,e);a.prototype.imulK=function(n){for(var r,u,t=0,i=0;i<n.length;i++)r=19*(0|n.words[i])+t,u=67108863&r,r>>>=26,n.words[i]=u,t=r;return 0!==t&&(n.words[n.length++]=t),n};r._prime=function(n){if(l[n])return l[n];var t;if("k256"===n)t=new c;else if("p224"===n)t=new d;else if("p192"===n)t=new g;else{if("p25519"!==n)throw new Error("Unknown prime "+n);t=new a}return l[n]=t,t};f.prototype._verify1=function(n){u(0===n.negative,"red works only with positives");u(n.red,"red works only with red numbers")};f.prototype._verify2=function(n,t){u(0==(n.negative|t.negative),"red works only with positives");u(n.red&&n.red===t.red,"red works only with red numbers")};f.prototype.imod=function(n){return this.prime?this.prime.ireduce(n)._forceRed(this):n.umod(this.m)._forceRed(this)};f.prototype.neg=function(n){return n.isZero()?n.clone():this.m.sub(n)._forceRed(this)};f.prototype.add=function(n,t){this._verify2(n,t);var i=n.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)};f.prototype.iadd=function(n,t){this._verify2(n,t);var i=n.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i};f.prototype.sub=function(n,t){this._verify2(n,t);var i=n.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)};f.prototype.isub=function(n,t){this._verify2(n,t);var i=n.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i};f.prototype.shl=function(n,t){return this._verify1(n),this.imod(n.ushln(t))};f.prototype.imul=function(n,t){return this._verify2(n,t),this.imod(n.imul(t))};f.prototype.mul=function(n,t){return this._verify2(n,t),this.imod(n.mul(t))};f.prototype.isqr=function(n){return this.imul(n,n.clone())};f.prototype.sqr=function(n){return this.mul(n,n)};f.prototype.sqrt=function(n){var s,p,t,h,o,f,y;if(n.isZero())return n.clone();if(s=this.m.andln(3),u(s%2==1),3===s)return p=this.m.add(new r(1)).iushrn(2),this.pow(n,p);for(t=this.m.subn(1),h=0;!t.isZero()&&0===t.andln(1);)h++,t.iushrn(1);u(!t.isZero());for(var c=new r(1).toRed(this),w=c.redNeg(),b=this.m.subn(1).iushrn(1),i=this.m.bitLength(),i=new r(2*i*i).toRed(this);0!==this.pow(i,b).cmp(w);)i.redIAdd(w);for(var l=this.pow(i,t),a=this.pow(n,t.addn(1).iushrn(1)),e=this.pow(n,t),v=h;0!==e.cmp(c);){for(o=e,f=0;0!==o.cmp(c);f++)o=o.redSqr();u(f<v);y=this.pow(l,new r(1).iushln(v-f-1));a=a.redMul(y);l=y.redSqr();e=e.redMul(l);v=f}return a};f.prototype.invm=function(n){var t=n._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)};f.prototype.pow=function(n,t){var c,u,i,a,o,l;if(t.isZero())return new r(1);if(0===t.cmpn(1))return n.clone();for(c=4,u=new Array(1<<c),u[0]=new r(1).toRed(this),u[1]=n,i=2;i<u.length;i++)u[i]=this.mul(u[i-1],n);var f=u[0],e=0,s=0,h=t.bitLength()%26;for(0===h&&(h=26),i=t.length-1;i>=0;i--){for(a=t.words[i],o=h-1;o>=0;o--)l=a>>o&1,f!==u[0]&&(f=this.sqr(f)),0!==l||0!==e?(e<<=1,e|=l,s++,(s===c||0===i&&0===o)&&(f=this.mul(f,u[e]),s=0,e=0)):s=0;h=26}return f};f.prototype.convertTo=function(n){var t=n.umod(this.m);return t===n?t.clone():t};f.prototype.convertFrom=function(n){var t=n.clone();return t.red=null,t};r.mont=function(n){return new s(n)};h(s,f);s.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))};s.prototype.convertFrom=function(n){var t=this.imod(n.mul(this.rinv));return t.red=null,t};s.prototype.imul=function(n,t){if(n.isZero()||t.isZero())return n.words[0]=0,n.length=1,n;var u=n.imul(t),f=u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=u.isub(f).iushrn(this.shift),r=i;return i.cmp(this.m)>=0?r=i.isub(this.m):i.cmpn(0)<0&&(r=i.iadd(this.m)),r._forceRed(this)};s.prototype.mul=function(n,t){if(n.isZero()||t.isZero())return new r(0)._forceRed(this);var f=n.mul(t),e=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=f.isub(e).iushrn(this.shift),u=i;return i.cmp(this.m)>=0?u=i.isub(this.m):i.cmpn(0)<0&&(u=i.iadd(this.m)),u._forceRed(this)};s.prototype.invm=function(n){var t=this.imod(n._invmp(this.m).mul(this.r2));return t._forceRed(this)}}("undefined"==typeof t||t,this)},{}],17:[function(n,t){function i(n){this.rand=n}var r,u;if(t.exports=function(n){return r||(r=new i(null)),r.generate(n)},t.exports.Rand=i,i.prototype.generate=function(n){return this._rand(n)},"object"==typeof self)i.prototype._rand=self.crypto&&self.crypto.getRandomValues?function(n){var t=new Uint8Array(n);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?function(n){var t=new Uint8Array(n);return self.msCrypto.getRandomValues(t),t}:function(){throw new Error("Not implemented yet");};else try{u=n("crypto");i.prototype._rand=function(n){return u.randomBytes(n)}}catch(f){i.prototype._rand=function(n){for(var t=new Uint8Array(n),i=0;i<t.length;i++)t[i]=this.rand.getByte();return t}}},{crypto:18}],18:[function(){},{}],19:[function(n,t,i){var r=i;r.utils=n("./hash/utils");r.common=n("./hash/common");r.sha=n("./hash/sha");r.ripemd=n("./hash/ripemd");r.hmac=n("./hash/hmac");r.sha1=r.sha.sha1;r.sha256=r.sha.sha256;r.sha224=r.sha.sha224;r.sha384=r.sha.sha384;r.sha512=r.sha.sha512;r.ripemd160=r.ripemd.ripemd160},{"./hash/common":20,"./hash/hmac":21,"./hash/ripemd":22,"./hash/sha":23,"./hash/utils":24}],20:[function(n,t,i){function r(){this.pending=null;this.pendingTotal=0;this.blockSize=this.constructor.blockSize;this.outSize=this.constructor.outSize;this.hmacStrength=this.constructor.hmacStrength;this.padLength=this.constructor.padLength/8;this.endian="big";this._delta8=this.blockSize/8;this._delta32=this.blockSize/32}var f=n("../hash"),u=f.utils,e=u.assert;i.BlockHash=r;r.prototype.update=function(n,t){var r,i;if(n=u.toArray(n,t),this.pending=this.pending?this.pending.concat(n):n,this.pendingTotal+=n.length,this.pending.length>=this._delta8)for(n=this.pending,r=n.length%this._delta8,this.pending=n.slice(n.length-r,n.length),0===this.pending.length&&(this.pending=null),n=u.join32(n,0,n.length-r,this.endian),i=0;i<n.length;i+=this._delta32)this._update(n,i,i+this._delta32);return this};r.prototype.digest=function(n){return this.update(this._pad()),e(null===this.pending),this._digest(n)};r.prototype._pad=function(){var i=this.pendingTotal,u=this._delta8,f=u-(i+this.padLength)%u,t=new Array(f+this.padLength),n,r;for(t[0]=128,n=1;n<f;n++)t[n]=0;if(i<<=3,"big"===this.endian){for(r=8;r<this.padLength;r++)t[n++]=0;t[n++]=0;t[n++]=0;t[n++]=0;t[n++]=0;t[n++]=i>>>24&255;t[n++]=i>>>16&255;t[n++]=i>>>8&255;t[n++]=255&i}else for(t[n++]=255&i,t[n++]=i>>>8&255,t[n++]=i>>>16&255,t[n++]=i>>>24&255,t[n++]=0,t[n++]=0,t[n++]=0,t[n++]=0,r=8;r<this.padLength;r++)t[n++]=0;return t}},{"../hash":19}],21:[function(n,t){function i(n,t,u){return this instanceof i?(this.Hash=n,this.blockSize=n.blockSize/8,this.outSize=n.outSize/8,this.inner=null,this.outer=null,void this._init(r.toArray(t,u))):new i(n,t,u)}var u=n("../hash"),r=u.utils,f=r.assert;t.exports=i;i.prototype._init=function(n){var t;for(n.length>this.blockSize&&(n=(new this.Hash).update(n).digest()),f(n.length<=this.blockSize),t=n.length;t<this.blockSize;t++)n.push(0);for(t=0;t<n.length;t++)n[t]^=54;for(this.inner=(new this.Hash).update(n),t=0;t<n.length;t++)n[t]^=106;this.outer=(new this.Hash).update(n)};i.prototype.update=function(n,t){return this.inner.update(n,t),this};i.prototype.digest=function(n){return this.outer.update(this.inner.digest()),this.outer.digest(n)}},{"../hash":19}],22:[function(n,t,i){function r(){return this instanceof r?(l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.endian="little")):new r}function o(n,t,i,r){return n<=15?t^i^r:n<=31?t&i|~t&r:n<=47?(t|~i)^r:n<=63?t&r|i&~r:t^(i|~r)}function a(n){return n<=15?0:n<=31?1518500249:n<=47?1859775393:n<=63?2400959708:2840853838}function v(n){return n<=15?1352829926:n<=31?1548603684:n<=47?1836072691:n<=63?2053994217:0}var s=n("../hash"),u=s.utils,e=u.rotl32,h=u.sum32,f=u.sum32_3,c=u.sum32_4,l=s.common.BlockHash;u.inherits(r,l);i.ripemd160=r;r.blockSize=512;r.outSize=160;r.hmacStrength=192;r.padLength=64;r.prototype._update=function(n,t){for(var r,d=this.h[0],u=this.h[1],s=this.h[2],l=this.h[3],k=this.h[4],rt=d,g=u,nt=s,tt=l,it=k,i=0;i<80;i++)r=h(e(c(d,o(i,u,s,l),n[y[i]+t],a(i)),w[i]),k),d=k,k=l,l=e(s,10),s=u,u=r,r=h(e(c(rt,o(79-i,g,nt,tt),n[p[i]+t],v(i)),b[i]),it),rt=it,it=tt,tt=e(nt,10),nt=g,g=r;r=f(this.h[1],s,tt);this.h[1]=f(this.h[2],l,it);this.h[2]=f(this.h[3],k,rt);this.h[3]=f(this.h[4],d,g);this.h[4]=f(this.h[0],u,nt);this.h[0]=r};r.prototype._digest=function(n){return"hex"===n?u.toHex32(this.h,"little"):u.split32(this.h,"little")};var y=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],p=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],w=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],b=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"../hash":19}],23:[function(n,t,i){function e(){return this instanceof e?(y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=ei,void(this.W=new Array(64))):new e}function l(){return this instanceof l?(e.call(this),void(this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])):new l}function f(){return this instanceof f?(y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=oi,void(this.W=new Array(160))):new f}function a(){return this instanceof a?(f.call(this),void(this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428])):new a}function o(){return this instanceof o?(y.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.W=new Array(80))):new o}function k(n,t,i){return n&t^~n&i}function d(n,t,i){return n&t^n&i^t&i}function ut(n,t,i){return n^t^i}function ft(n){return s(n,2)^s(n,13)^s(n,22)}function et(n){return s(n,6)^s(n,11)^s(n,25)}function ot(n){return s(n,7)^s(n,18)^n>>>3}function st(n){return s(n,17)^s(n,19)^n>>>10}function ht(n,t,i,r){return 0===n?k(t,i,r):1===n||3===n?ut(t,i,r):2===n?d(t,i,r):void 0}function ct(n,t,i,r,u){var f=n&i^~n&u;return f<0&&(f+=4294967296),f}function lt(n,t,i,r,u,f){var e=t&r^~t&f;return e<0&&(e+=4294967296),e}function at(n,t,i,r,u){var f=n&i^n&u^i&u;return f<0&&(f+=4294967296),f}function vt(n,t,i,r,u,f){var e=t&r^t&f^r&f;return e<0&&(e+=4294967296),e}function yt(n,t){var r=h(n,t,28),u=h(t,n,2),f=h(t,n,7),i=r^u^f;return i<0&&(i+=4294967296),i}function pt(n,t){var r=c(n,t,28),u=c(t,n,2),f=c(t,n,7),i=r^u^f;return i<0&&(i+=4294967296),i}function wt(n,t){var r=h(n,t,14),u=h(n,t,18),f=h(t,n,9),i=r^u^f;return i<0&&(i+=4294967296),i}function bt(n,t){var r=c(n,t,14),u=c(n,t,18),f=c(t,n,9),i=r^u^f;return i<0&&(i+=4294967296),i}function kt(n,t){var r=h(n,t,1),u=h(n,t,8),f=it(n,t,7),i=r^u^f;return i<0&&(i+=4294967296),i}function dt(n,t){var r=c(n,t,1),u=c(n,t,8),f=rt(n,t,7),i=r^u^f;return i<0&&(i+=4294967296),i}function gt(n,t){var r=h(n,t,19),u=h(t,n,29),f=it(n,t,6),i=r^u^f;return i<0&&(i+=4294967296),i}function ni(n,t){var r=c(n,t,19),u=c(t,n,29),f=rt(n,t,6),i=r^u^f;return i<0&&(i+=4294967296),i}var g=n("../hash"),r=g.utils,nt=r.assert,s=r.rotr32,p=r.rotl32,u=r.sum32,ti=r.sum32_4,tt=r.sum32_5,h=r.rotr64_hi,c=r.rotr64_lo,it=r.shr64_hi,rt=r.shr64_lo,v=r.sum64,w=r.sum64_hi,b=r.sum64_lo,ii=r.sum64_4_hi,ri=r.sum64_4_lo,ui=r.sum64_5_hi,fi=r.sum64_5_lo,y=g.common.BlockHash,ei=[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],oi=[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],si=[1518500249,1859775393,2400959708,3395469782];r.inherits(e,y);i.sha256=e;e.blockSize=512;e.outSize=256;e.hmacStrength=192;e.padLength=64;e.prototype._update=function(n,t){for(var v,y,r=this.W,i=0;i<16;i++)r[i]=n[t+i];for(;i<r.length;i++)r[i]=ti(st(r[i-2]),r[i-7],ot(r[i-15]),r[i-16]);var f=this.h[0],o=this.h[1],s=this.h[2],l=this.h[3],e=this.h[4],h=this.h[5],c=this.h[6],a=this.h[7];for(nt(this.k.length===r.length),i=0;i<r.length;i++)v=tt(a,et(e),k(e,h,c),this.k[i],r[i]),y=u(ft(f),d(f,o,s)),a=c,c=h,h=e,e=u(l,v),l=s,s=o,o=f,f=u(v,y);this.h[0]=u(this.h[0],f);this.h[1]=u(this.h[1],o);this.h[2]=u(this.h[2],s);this.h[3]=u(this.h[3],l);this.h[4]=u(this.h[4],e);this.h[5]=u(this.h[5],h);this.h[6]=u(this.h[6],c);this.h[7]=u(this.h[7],a)};e.prototype._digest=function(n){return"hex"===n?r.toHex32(this.h,"big"):r.split32(this.h,"big")};r.inherits(l,e);i.sha224=l;l.blockSize=512;l.outSize=224;l.hmacStrength=192;l.padLength=64;l.prototype._digest=function(n){return"hex"===n?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")};r.inherits(f,y);i.sha512=f;f.blockSize=1024;f.outSize=512;f.hmacStrength=192;f.padLength=128;f.prototype._prepareBlock=function(n,t){for(var r=this.W,i=0;i<32;i++)r[i]=n[t+i];for(;i<r.length;i+=2){var u=gt(r[i-4],r[i-3]),f=ni(r[i-4],r[i-3]),e=r[i-14],o=r[i-13],s=kt(r[i-30],r[i-29]),h=dt(r[i-30],r[i-29]),c=r[i-32],l=r[i-31];r[i]=ii(u,f,e,o,s,h,c,l);r[i+1]=ri(u,f,e,o,s,h,c,l)}};f.prototype._update=function(n,t){var e;this._prepareBlock(n,t);var rt=this.W,i=this.h[0],r=this.h[1],o=this.h[2],s=this.h[3],h=this.h[4],c=this.h[5],et=this.h[6],l=this.h[7],u=this.h[8],f=this.h[9],a=this.h[10],y=this.h[11],p=this.h[12],k=this.h[13],ot=this.h[14],st=this.h[15];for(nt(this.k.length===rt.length),e=0;e<rt.length;e+=2){var d=ot,g=st,tt=wt(u,f),it=bt(u,f),ht=ct(u,f,a,y,p,k),kt=lt(u,f,a,y,p,k),dt=this.k[e],gt=this.k[e+1],ni=rt[e],ti=rt[e+1],ut=ui(d,g,tt,it,ht,kt,dt,gt,ni,ti),ft=fi(d,g,tt,it,ht,kt,dt,gt,ni,ti),d=yt(i,r),g=pt(i,r),tt=at(i,r,o,s,h,c),it=vt(i,r,o,s,h,c),ii=w(d,g,tt,it),ri=b(d,g,tt,it);ot=p;st=k;p=a;k=y;a=u;y=f;u=w(et,l,ut,ft);f=b(l,l,ut,ft);et=h;l=c;h=o;c=s;o=i;s=r;i=w(ut,ft,ii,ri);r=b(ut,ft,ii,ri)}v(this.h,0,i,r);v(this.h,2,o,s);v(this.h,4,h,c);v(this.h,6,et,l);v(this.h,8,u,f);v(this.h,10,a,y);v(this.h,12,p,k);v(this.h,14,ot,st)};f.prototype._digest=function(n){return"hex"===n?r.toHex32(this.h,"big"):r.split32(this.h,"big")};r.inherits(a,f);i.sha384=a;a.blockSize=1024;a.outSize=384;a.hmacStrength=192;a.padLength=128;a.prototype._digest=function(n){return"hex"===n?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")};r.inherits(o,y);i.sha1=o;o.blockSize=512;o.outSize=160;o.hmacStrength=80;o.padLength=64;o.prototype._update=function(n,t){for(var c,l,r=this.W,i=0;i<16;i++)r[i]=n[t+i];for(;i<r.length;i++)r[i]=p(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);for(var f=this.h[0],e=this.h[1],o=this.h[2],s=this.h[3],h=this.h[4],i=0;i<r.length;i++)c=~~(i/20),l=tt(p(f,5),ht(c,e,o,s),h,r[i],si[c]),h=s,s=o,o=p(e,30),e=f,f=l;this.h[0]=u(this.h[0],f);this.h[1]=u(this.h[1],e);this.h[2]=u(this.h[2],o);this.h[3]=u(this.h[3],s);this.h[4]=u(this.h[4],h)};o.prototype._digest=function(n){return"hex"===n?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},{"../hash":19}],24:[function(n,t,i){function s(n,t){var r,i;if(Array.isArray(n))return n.slice();if(!n)return[];if(r=[],"string"==typeof n)if(t){if("hex"===t)for(n=n.replace(/[^a-z0-9]+/gi,""),n.length%2!=0&&(n="0"+n),i=0;i<n.length;i+=2)r.push(parseInt(n[i]+n[i+1],16))}else for(i=0;i<n.length;i++){var u=n.charCodeAt(i),f=u>>8,e=255&u;f?r.push(f,e):r.push(e)}else for(i=0;i<n.length;i++)r[i]=0|n[i];return r}function h(n){for(var i="",t=0;t<n.length;t++)i+=f(n[t].toString(16));return i}function u(n){var t=n>>>24|n>>>8&65280|n<<8&16711680|(255&n)<<24;return t>>>0}function c(n,t){for(var r,f="",i=0;i<n.length;i++)r=n[i],"little"===t&&(r=u(r)),f+=e(r.toString(16));return f}function f(n){return 1===n.length?"0"+n:n}function e(n){return 7===n.length?"0"+n:6===n.length?"00"+n:5===n.length?"000"+n:4===n.length?"0000"+n:3===n.length?"00000"+n:2===n.length?"000000"+n:1===n.length?"0000000"+n:n}function l(n,t,i,r){var s=i-t,h;o(s%4==0);for(var f=new Array(s/4),e=0,u=t;e<f.length;e++,u+=4)h="big"===r?n[u]<<24|n[u+1]<<16|n[u+2]<<8|n[u+3]:n[u+3]<<24|n[u+2]<<16|n[u+1]<<8|n[u],f[e]=h>>>0;return f}function a(n,t){for(var u,i=new Array(4*n.length),f=0,r=0;f<n.length;f++,r+=4)u=n[f],"big"===t?(i[r]=u>>>24,i[r+1]=u>>>16&255,i[r+2]=u>>>8&255,i[r+3]=255&u):(i[r+3]=u>>>24,i[r+2]=u>>>16&255,i[r+1]=u>>>8&255,i[r]=255&u);return i}function v(n,t){return n>>>t|n<<32-t}function y(n,t){return n<<t|n>>>32-t}function p(n,t){return n+t>>>0}function w(n,t,i){return n+t+i>>>0}function b(n,t,i,r){return n+t+i+r>>>0}function k(n,t,i,r,u){return n+t+i+r+u>>>0}function o(n,t){if(!n)throw new Error(t||"Assertion failed");}function d(n,t,i,r){var f=n[t],e=n[t+1],u=r+e>>>0,o=(u<r?1:0)+i+f;n[t]=o>>>0;n[t+1]=u}function g(n,t,i,r){var u=t+r>>>0,f=(u<t?1:0)+n+i;return f>>>0}function nt(n,t,i,r){var u=t+r;return u>>>0}function tt(n,t,i,r,u,f,e,o){var h=0,s=t,c;return s=s+r>>>0,h+=s<t?1:0,s=s+f>>>0,h+=s<f?1:0,s=s+o>>>0,h+=s<o?1:0,c=n+i+u+e+h,c>>>0}function it(n,t,i,r,u,f,e,o){var s=t+r+f+o;return s>>>0}function rt(n,t,i,r,u,f,e,o,s,h){var l=0,c=t,a;return c=c+r>>>0,l+=c<t?1:0,c=c+f>>>0,l+=c<f?1:0,c=c+o>>>0,l+=c<o?1:0,c=c+h>>>0,l+=c<h?1:0,a=n+i+u+e+s+l,a>>>0}function ut(n,t,i,r,u,f,e,o,s,h){var c=t+r+f+o+h;return c>>>0}function ft(n,t,i){var r=t<<32-i|n>>>i;return r>>>0}function et(n,t,i){var r=n<<32-i|t>>>i;return r>>>0}function ot(n,t,i){return n>>>i}function st(n,t,i){var r=n<<32-i|t>>>i;return r>>>0}var r=i,ht=n("inherits");r.toArray=s;r.toHex=h;r.htonl=u;r.toHex32=c;r.zero2=f;r.zero8=e;r.join32=l;r.split32=a;r.rotr32=v;r.rotl32=y;r.sum32=p;r.sum32_3=w;r.sum32_4=b;r.sum32_5=k;r.assert=o;r.inherits=ht;i.sum64=d;i.sum64_hi=g;i.sum64_lo=nt;i.sum64_4_hi=tt;i.sum64_4_lo=it;i.sum64_5_hi=rt;i.sum64_5_lo=ut;i.rotr64_hi=ft;i.rotr64_lo=et;i.shr64_hi=ot;i.shr64_lo=st},{inherits:27}],25:[function(n,t){"use strict";function i(n){if(!(this instanceof i))return new i(n);this.hash=n.hash;this.predResist=!!n.predResist;this.outLen=this.hash.outSize;this.minEntropy=n.minEntropy||this.hash.hmacStrength;this.reseed=null;this.reseedInterval=null;this.K=null;this.V=null;var t=r.toArray(n.entropy,n.entropyEnc||"hex"),f=r.toArray(n.nonce,n.nonceEnc||"hex"),e=r.toArray(n.pers,n.persEnc||"hex");u(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._init(t,f,e)}var f=n("hash.js"),r=n("minimalistic-crypto-utils"),u=n("minimalistic-assert");t.exports=i;i.prototype._init=function(n,t,i){var u=n.concat(t).concat(i),r;for(this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8),r=0;r<this.V.length;r++)this.K[r]=0,this.V[r]=1;this._update(u);this.reseed=1;this.reseedInterval=281474976710656};i.prototype._hmac=function(){return new f.hmac(this.hash,this.K)};i.prototype._update=function(n){var t=this._hmac().update(this.V).update([0]);n&&(t=t.update(n));this.K=t.digest();this.V=this._hmac().update(this.V).digest();n&&(this.K=this._hmac().update(this.V).update([1]).update(n).digest(),this.V=this._hmac().update(this.V).digest())};i.prototype.reseed=function(n,t,i,f){"string"!=typeof t&&(f=i,i=t,t=null);n=r.toArray(n,t);i=r.toArray(i,f);u(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._update(n.concat(i||[]));this.reseed=1};i.prototype.generate=function(n,t,i,u){var f,e;if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");for("string"!=typeof t&&(u=i,i=t,t=null),i&&(i=r.toArray(i,u||"hex"),this._update(i)),f=[];f.length<n;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);return e=f.slice(0,n),this._update(i),this.reseed++,r.encode(e,t)}},{"hash.js":19,"minimalistic-assert":28,"minimalistic-crypto-utils":26}],26:[function(n,t,i){"use strict";function e(n,t){var r,i;if(Array.isArray(n))return n.slice();if(!n)return[];if(r=[],"string"!=typeof n){for(i=0;i<n.length;i++)r[i]=0|n[i];return r}if("hex"===t)for(n=n.replace(/[^a-z0-9]+/gi,""),n.length%2!=0&&(n="0"+n),i=0;i<n.length;i+=2)r.push(parseInt(n[i]+n[i+1],16));else for(i=0;i<n.length;i++){var u=n.charCodeAt(i),f=u>>8,e=255&u;f?r.push(f,e):r.push(e)}return r}function u(n){return 1===n.length?"0"+n:n}function f(n){for(var i="",t=0;t<n.length;t++)i+=u(n[t].toString(16));return i}var r=i;r.toArray=e;r.zero2=u;r.toHex=f;r.encode=function(n,t){return"hex"===t?f(n):n}},{}],27:[function(n,t){t.exports="function"==typeof Object.create?function(n,t){n.super_=t;n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:function(n,t){n.super_=t;var i=function(){};i.prototype=t.prototype;n.prototype=new i;n.prototype.constructor=n}},{}],28:[function(n,t){function i(n,t){if(!n)throw new Error(t||"Assertion failed");}t.exports=i;i.equal=function(n,t,i){if(n!=t)throw new Error(i||"Assertion failed: "+n+" != "+t);}},{}],29:[function(n,t,i){"use strict";function e(n,t){var r,i;if(Array.isArray(n))return n.slice();if(!n)return[];if(r=[],"string"!=typeof n){for(i=0;i<n.length;i++)r[i]=0|n[i];return r}if(t){if("hex"===t)for(n=n.replace(/[^a-z0-9]+/gi,""),n.length%2!=0&&(n="0"+n),i=0;i<n.length;i+=2)r.push(parseInt(n[i]+n[i+1],16))}else for(i=0;i<n.length;i++){var u=n.charCodeAt(i),f=u>>8,e=255&u;f?r.push(f,e):r.push(e)}return r}function u(n){return 1===n.length?"0"+n:n}function f(n){for(var i="",t=0;t<n.length;t++)i+=u(n[t].toString(16));return i}var r=i;r.toArray=e;r.zero2=u;r.toHex=f;r.encode=function(n,t){return"hex"===t?f(n):n}},{}],30:[function(n,t){t.exports={name:"elliptic",version:"6.4.0",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}},{}]},{},[1])(1)}),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.__tarsusInterfaceName="InputResponseType",n}();n.InputResponseType=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.__tarsusInterfaceName="AuthenticationActionParameter",n}();n.AuthenticationActionParameter=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getAuthenticatorInput=function(){return this._authenticatorInput},i.prototype.setAuthenticatorInput=function(n){this._authenticatorInput=n},i.prototype.getSelectedTargets=function(){return this._selectedTargets},i.prototype.setSelectedTargets=function(n){this._selectedTargets=n},i.createAuthenticatorInput=function(t){return n.ts.mobile.sdk.impl.TargetBasedAuthenticatorInputImpl.createAuthenticatorInput(t)},i.createTargetSelectionRequest=function(t){return n.ts.mobile.sdk.impl.TargetBasedAuthenticatorInputImpl.createTargetSelectionRequest(t)},i.createTargetsSelectionRequest=function(t){return n.ts.mobile.sdk.impl.TargetBasedAuthenticatorInputImpl.createTargetsSelectionRequest(t)},i.__tarsusInterfaceName="TargetBasedAuthenticatorInput",i}(t.InputResponseType);t.TargetBasedAuthenticatorInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.__tarsusInterfaceName="OtpInput",t}(n.InputResponseType);n.OtpInput=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createSuccessResponse=function(t){return n.ts.mobile.sdk.impl.PlaceholderInputResponseImpl.createSuccessResponse(t)},i.createdFailedResponse=function(t,i){return n.ts.mobile.sdk.impl.PlaceholderInputResponseImpl.createdFailedResponse(t,i)},i.createFailedResponseWithServerProvidedStatus=function(t){return n.ts.mobile.sdk.impl.PlaceholderInputResponseImpl.createFailedResponseWithServerProvidedStatus(t)},i.__tarsusInterfaceName="PlaceholderInputResponse",i}(t.InputResponseType);t.PlaceholderInputResponse=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.__tarsusInterfaceName="PushRequestPayload",n}();n.PushRequestPayload=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createSuccessResponse=function(t){return n.ts.mobile.sdk.impl.FidoInputResponseImpl.createSuccessResponse(t)},i.createdFailedResponse=function(t,i){return n.ts.mobile.sdk.impl.FidoInputResponseImpl.createdFailedResponse(t,i)},i.__tarsusInterfaceName="FidoInputResponse",i}(t.InputResponseType);t.FidoInputResponse=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createWithUserId=function(t){return n.ts.mobile.sdk.impl.MobileApprovePushRequestPayloadImpl.createWithUserId(t)},i.createWithUserTicket=function(t){return n.ts.mobile.sdk.impl.MobileApprovePushRequestPayloadImpl.createWithUserTicket(t)},i.createWithJsonPayload=function(t){return n.ts.mobile.sdk.impl.MobileApprovePushRequestPayloadImpl.createWithJsonPayload(t)},i.__tarsusInterfaceName="MobileApprovePushRequestPayload",i}(t.PushRequestPayload);t.MobileApprovePushRequestPayload=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createSecurityQuestionAnswersInputResponse=function(t){return n.ts.mobile.sdk.impl.SecurityQuestionInputResponseImpl.createSecurityQuestionAnswersInputResponse(t)},i.__tarsusInterfaceName="SecurityQuestionInputResponse",i}(t.InputResponseType);t.SecurityQuestionInputResponse=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getAnswerText=function(){return this._answerText},t.createWithText=function(t){return n.ts.mobile.sdk.impl.SecurityQuestionAnswerImpl.createWithText(t)},t.__tarsusInterfaceName="SecurityQuestionAnswer",t}();t.SecurityQuestionAnswer=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getQuestion=function(){return this._question},t.prototype.getAnswer=function(){return this._answer},t.createAnswerToQuestion=function(t,i){return n.ts.mobile.sdk.impl.SecurityQuestionAndAnswerImpl.createAnswerToQuestion(t,i)},t.__tarsusInterfaceName="SecurityQuestionAndAnswer",t}();t.SecurityQuestionAndAnswer=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.getAssertionData=function(){return this._assertionData},n.prototype.setAssertionData=function(n){this._assertionData=n},n.prototype.getStoredData=function(){return this._storedData},n.prototype.setStoredData=function(n){this._storedData=n},n.__tarsusInterfaceName="TotpProvisionOutput",n}();n.TotpProvisionOutput=t})(t=n.tarsusplugin||(n.tarsusplugin={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){this._stepTag=n;this._passphraseText=t}return n.prototype.getStepTag=function(){return this._stepTag},n.prototype.getAcquisitionChallenges=function(){return[]},n.prototype.getPassphraseText=function(){return this._passphraseText},n.__tarsusInterfaceName="AudioAcquisitionStepDescription",n}();n.AudioAcquisitionStepDescriptionImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getTarget=function(){return this._target},i.create=function(t){return n.ts.mobile.sdk.impl.AuthenticationActionParameterTargetSelectionImpl.create(t)},i.__tarsusInterfaceName="AuthenticationActionParameterTargetSelection",i}(t.AuthenticationActionParameter);t.AuthenticationActionParameterTargetSelection=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(t){var i=n.call(this)||this;return i._target=t,i}return __extends(t,n),t.create=function(n){return new t(n)},t.__tarsusInterfaceName="AuthenticationActionParameterTargetSelection",t}(n.AuthenticationActionParameterTargetSelection);t.AuthenticationActionParameterTargetSelectionImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getErrorCode=function(){return this._errorCode},t.prototype.getMessage=function(){return this._message},t.prototype.getData=function(){return this._data},t.createApplicationGeneratedGeneralError=function(t,i){return n.ts.mobile.sdk.impl.AuthenticationErrorImpl.createApplicationGeneratedGeneralError(t,i)},t.createApplicationGeneratedCommunicationError=function(t,i){return n.ts.mobile.sdk.impl.AuthenticationErrorImpl.createApplicationGeneratedCommunicationError(t,i)},t.__tarsusInterfaceName="AuthenticationError",t}();t.AuthenticationError=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={}));__assign=this&&this.__assign||function(){return __assign=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},__assign.apply(this,arguments)},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(r){function u(n,t,i){var u=r.call(this)||this;return u._errorCode=n,u._message=t,u._data=__assign({},i||{},{public_properties:{}}),u}return __extends(u,r),u.errorForServerResponse=function(n){var r={server_error_code:n.error_code,server_error_message:n.error_message,server_error_data:n.data},i=t.AuthenticationErrorCode.Internal;switch(n.error_code){case 2009:i=t.AuthenticationErrorCode.DeviceNotFound;break;case 3001:case 3002:i=t.AuthenticationErrorCode.InvalidDeviceBinding;break;case 4e3:case 4002:i=t.AuthenticationErrorCode.ControlFlowExpired;break;case 4005:case 4006:i=t.AuthenticationErrorCode.SessionRequired;break;case 6001:case 6002:i=t.AuthenticationErrorCode.ApprovalWrongState}return new u(i,n.error_message||"Internal error",r)},u.createApplicationGeneratedGeneralError=function(n,i){return new u(t.AuthenticationErrorCode.Internal,n,i)},u.createApplicationGeneratedCommunicationError=function(n,i){return new u(t.AuthenticationErrorCode.Communication,n,i)},u.errorForSessionRejectionFailureData=function(n){var i=t.AuthenticationErrorCode.PolicyRejection,r="Session rejected by server.",f={failure_data:n},e,o;if(n&&n.source){e=n;o=void 0;switch(n.reason&&n.reason.type){case t.core.Protocol.FailureReasonType.ApprovalExpired:i=t.AuthenticationErrorCode.ApprovalWrongState;r="Approval expired.";f.approval_state="expired"}}return new u(i,r,f)},u.errorForHostInternalBiometricErrorData=function(r,u){var f;switch(r[n.sdkhost.ErrorDataInternalError]){case n.sdkhost.InternalErrorBiometricNotConfigured:f=new i.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorExternalConfigError,u+" not configured on this device.");f.setPublicProperty(t.AuthenticationErrorProperty.AuthenticatorExternalConfigErrorReason,t.AuthenticationErrorPropertySymbol.AuthenticatorExternalConfigErrorReasonBiometricsNotEnrolled);break;case n.sdkhost.InternalErrorBiometricOsLockTemporary:f=new i.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorExternalConfigError,u+" authentication is temporarily locked by the OS.");f.setPublicProperty(t.AuthenticationErrorProperty.AuthenticatorExternalConfigErrorReason,t.AuthenticationErrorPropertySymbol.AuthenticatorExternalConfigErrorReasonBiometricsOsLockTemporary);break;case n.sdkhost.InternalErrorBiometricOsLockPermanent:f=new i.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorExternalConfigError,u+" authentication is permanently locked by the OS.");f.setPublicProperty(t.AuthenticationErrorProperty.AuthenticatorExternalConfigErrorReason,t.AuthenticationErrorPropertySymbol.AuthenticatorExternalConfigErrorReasonBiometricsOsLockPermanent);break;default:f=null}return f},u.prototype.setPublicProperty=function(n,i){this._data.public_properties[t.AuthenticationErrorProperty[n]]=i},u.prototype.getPublicProperty=function(n){return this._data.public_properties[t.AuthenticationErrorProperty[n]]},u.prototype.getPublicBooleanProperty=function(n){var i=this.getPublicProperty(n);if(i&&typeof i!="boolean")throw new u(t.AuthenticationErrorCode.AppImplementation,"type of property "+t.AuthenticationErrorProperty[n]+" is not 'boolean'");return i},u.prototype.getPublicNumberProperty=function(n){var i=this.getPublicProperty(n);if(i&&typeof i!="number")throw new u(t.AuthenticationErrorCode.AppImplementation,"type of property "+t.AuthenticationErrorProperty[n]+" is not 'number'");return i},u.prototype.getPublicStringProperty=function(n){var i=this.getPublicProperty(n);if(i&&typeof i!="string")throw new u(t.AuthenticationErrorCode.AppImplementation,"type of property "+t.AuthenticationErrorProperty[n]+" is not 'string'");return i},u.prototype.getPublicSymbolicProperty=function(n){var i=this.getPublicProperty(n);if(i&&!t.AuthenticationErrorProperty[n])throw new u(t.AuthenticationErrorCode.AppImplementation,"type of property "+t.AuthenticationErrorProperty[n]+" is not 'AuthenticationErrorPropertySymbol'");return i},u.prototype.toString=function(){return"AuthenticationError<"+t.AuthenticationErrorCode[this._errorCode]+", "+this._message+", "+JSON.stringify(this._data)+">"},u.errorForAssertionResponse=function(n){var i,r,f;switch(n.assertion_error_code){case t.core.Protocol.AssertionErrorCode.FailedAssertion:i=t.AuthenticationErrorCode.InvalidInput;break;case t.core.Protocol.AssertionErrorCode.MethodLocked:i=t.AuthenticationErrorCode.AuthenticatorLocked;break;case t.core.Protocol.AssertionErrorCode.HistoryRepeat:i=t.AuthenticationErrorCode.RegisteredSecretAlreadyInHistory;break;default:i=t.AuthenticationErrorCode.Internal}return r={assertion_error_code:n.assertion_error_code,additional_data:n.data},f=n.assertion_error_message||"Assertion error code "+n.assertion_error_code,new u(i,f,r)},u.appImplementationError=function(n){return new u(t.AuthenticationErrorCode.AppImplementation,n)},u.errorForTransportResponse=function(n){return new u(t.AuthenticationErrorCode.Communication,"HTTP response error",{status:n.getStatus(),body:n.getBodyJson()})},u.ensureAuthenticationError=function(n){if(u.dynamicCast(n))return n;var i={js_error_message:n.toString()};return n.stack&&(i.js_error_stack=n.stack),new u(t.AuthenticationErrorCode.Internal,"Internal error occurred.",i)},u.augmentErrorData=function(n,t){var r={},f=n.getData(),i;if(f)for(i in f)r[i]=f[i];for(i in t)r[i]=t[i];return new u(n.getErrorCode(),n.getMessage(),r)},u.dynamicCast=function(n){return n.getErrorCode!==undefined&&n.getMessage!==undefined&&n.getData!==undefined},u}(t.AuthenticationError);i.AuthenticationErrorImpl=r})(i=t.impl||(t.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){this._authenticator=n;this._suggestedParams=t}return n.prototype.getAuthenticator=function(){return this._authenticator},n.prototype.getSuggestedParameters=function(){return this._suggestedParams},n}();n.AuthenticationOptionImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i,r){this._appData=i||null;this._token=n||null;this._internalData=r||null;this._deviceId=t||null}return n.prototype.getToken=function(){return this._token||""},n.prototype.getDeviceId=function(){return this._deviceId||""},n.prototype.getData=function(){return this._appData||{}},n.prototype.getInternalData=function(){return this._internalData},n.fromCflowServerResponse=function(t,i){return new n(t.token,i,t.application_data,t.data)},n}();n.AuthenticationResultImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getResultType=function(){return this._resultType},t.prototype.setResultType=function(n){this._resultType=n},t.prototype.getSelectedAuthenticator=function(){return this._selectedAuthenticator},t.prototype.setSelectedAuthenticator=function(n){this._selectedAuthenticator=n},t.prototype.getSelectedAuthenticationParameters=function(){return this._selectedAuthenticationParameters},t.prototype.setSelectedAuthenticationParameters=function(n){this._selectedAuthenticationParameters=n},t.createAbortRequest=function(){return n.ts.mobile.sdk.impl.AuthenticatorSelectionResultImpl.createAbortRequest()},t.createSelectionRequest=function(t){return n.ts.mobile.sdk.impl.AuthenticatorSelectionResultImpl.createSelectionRequest(t)},t.createParameterizedSelectionRequest=function(t,i){return n.ts.mobile.sdk.impl.AuthenticatorSelectionResultImpl.createParameterizedSelectionRequest(t,i)},t.__tarsusInterfaceName="AuthenticatorSelectionResult",t}();t.AuthenticatorSelectionResult=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createAbortRequest=function(){var t=new i;return t.setResultType(n.AuthenticatorSelectionResultType.Abort),t},i.createSelectionRequest=function(t){var r=new i;return r.setResultType(n.AuthenticatorSelectionResultType.SelectAuthenticator),r.setSelectedAuthenticator(t),r},i}(n.AuthenticatorSelectionResult);t.AuthenticatorSelectionResultImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this._acquisitionChallenges=n}return n.prototype.getStepTag=function(){return"imageAcquisition"},n.prototype.getAcquisitionChallenges=function(){return this._acquisitionChallenges},n.__tarsusInterfaceName="CameraAcquisitionStepDescription",n}();n.CameraAcquisitionStepDescriptionImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getLocalEnrollmentKeySizeInBytes=function(){return this._localEnrollmentKeySizeInBytes},t.prototype.getLocalEnrollmentKeyIterationCount=function(){return this._localEnrollmentKeyIterationCount},t.prototype.setLocalEnrollmentKeyIterationCount=function(n){this._localEnrollmentKeyIterationCount=n},t.create=function(t){return n.ts.mobile.sdk.impl.ClientCryptoSettingsImpl.create(t)},t.__tarsusInterfaceName="ClientCryptoSettings",t}();t.ClientCryptoSettings=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return i.setLocalEnrollmentKeyIterationCount(n),i._localEnrollmentKeySizeInBytes=32,i},t}(n.ClientCryptoSettings);t.ClientCryptoSettingsImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function t(n,t){this._description=n;this._menuItemOptions=t||{}}return t.prototype.getDescription=function(){return this._description},t.prototype.getAvailableActions=function(){var t=this,i=[];switch(this._description.getRegistrationStatus()){case n.AuthenticatorRegistrationStatus.Registered:i=[n.AuthenticatorConfigurationAction.Reregister,n.AuthenticatorConfigurationAction.Unregister];break;case n.AuthenticatorRegistrationStatus.Unregistered:case n.AuthenticatorRegistrationStatus.LocallyInvalid:i=[n.AuthenticatorConfigurationAction.Register]}return i.filter(function(i){return i==n.AuthenticatorConfigurationAction.Reregister&&!t._menuItemOptions.hide_reregister||i==n.AuthenticatorConfigurationAction.Register&&!t._menuItemOptions.hide_register||i==n.AuthenticatorConfigurationAction.Unregister&&!t._menuItemOptions.hide_unregister})},t}();t.ConfigurableAuthenticatorImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getUserChoice=function(){return this._userChoice},t.prototype.setUserChoice=function(n){this._userChoice=n},t.create=function(t){return n.ts.mobile.sdk.impl.ConfirmationInputImpl.create(t)},t.__tarsusInterfaceName="ConfirmationInput",t}();t.ConfirmationInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return i.setUserChoice(n),i},t}(n.ConfirmationInput);t.ConfirmationInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getRequestType=function(){return this._requestType},t.prototype.setRequestType=function(n){this._requestType=n},t.create=function(t){return n.ts.mobile.sdk.impl.ControlRequestImpl.create(t)},t.__tarsusInterfaceName="ControlRequest",t}();t.ControlRequest=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return i.setRequestType(n),i},t}(n.ControlRequest);t.ControlRequestImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){this._id=n;this._name=t}return n.prototype.getId=function(){return this._id},n.prototype.getName=function(){return this._name},n}();n.DeviceGroupImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function i(n){this.updateFromServer(n)}return i.prototype.getDeviceHwId=function(){return this._id},i.prototype.getDeviceId=function(){return this._logicalId},i.prototype.getName=function(){return this._name?this._name:this._model+" "+this._osType+" "+this._osVersion},i.prototype.getStatus=function(){return this._status},i.prototype.getLastAccess=function(){return this._lastAccess},i.prototype.getLastAccessLocation=function(){return this._lastAccessLocation},i.prototype.getLastAccessLocationAttributes=function(){return this._lastAccessLocationAttributes},i.prototype.getLastBind=function(){return this._lastBind},i.prototype.getRegistered=function(){return this._registered},i.prototype.getModel=function(){return this._model},i.prototype.getOsType=function(){return this._osType},i.prototype.getOsVersion=function(){return this._osVersion},i.prototype.getUseCount=function(){return this._useCount},i.prototype.getPushSupported=function(){return this._pushSupported},i.prototype.getIsCurrent=function(){return this._isCurrent},i.prototype.getDeviecId=function(){return this._id},i.prototype.getGroups=function(){return this._groups},i.prototype.setStatus=function(n){this._status=n},i.prototype.setName=function(n){this._name=n},i.prototype.forceCurrent=function(){this._isCurrent=!0},i.prototype.updateFromServer=function(i){this._name=i.name;this._lastBind=Date.parse(i.last_bind_date);this._lastAccess=Date.parse(i.last_access);this._registered=Date.parse(i.registered);this._model=i.device_model;this._osType=i.os_type;this._osVersion=i.os_version;this._useCount=i.use_count;this._pushSupported=i.supports_push;this._isCurrent=i.cur_device;this._id=i.device_id;this._logicalId=i.logical_device_id;switch(i.status){case n.core.Protocol.DeviceStatusServerFormat.Disabled:this._status=n.DeviceStatus.Disabled;break;case n.core.Protocol.DeviceStatusServerFormat.LongInactivity:this._status=n.DeviceStatus.LongInactivity;break;case n.core.Protocol.DeviceStatusServerFormat.NoRecentActivity:this._status=n.DeviceStatus.NoRecentActivity;break;case n.core.Protocol.DeviceStatusServerFormat.RecentlyUsed:this._status=n.DeviceStatus.RecentlyUsed;break;case n.core.Protocol.DeviceStatusServerFormat.Removed:this._status=n.DeviceStatus.Removed;break;default:throw new t.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unknown device status "+i.status);}if(i.last_access_location){var r=new n.GeoLocation;r.longitude=i.last_access_location.lng;r.latitude=i.last_access_location.lat;this._lastAccessLocation=r;this._lastAccessLocationAttributes=new t.LocationAttributesImpl(i.last_access_location)}i.groups&&(this._groups=i.groups.map(function(n){return new t.DeviceGroupImpl(n.id,n.name)}))},i}();t.DeviceInfoImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createSuccessResponse=function(t){var i=new n.FidoAuthSuccessResponse;return i.setFidoResponse(t),i},i.createdFailedResponse=function(t,i){var r=new n.FidoAuthFailureResponse;return r.setFailureError(i),r.setExpired(t.getExpired()),r.setLocked(t.getLocked()),r.setRegistered(t.getRegistered()),r.setRegistrationStatus(t.getRegistrationStatus()),r},i}(n.PlaceholderInputResponse);t.FidoInputResponseImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getPrompt=function(){return this._prompt},i.prototype.setPrompt=function(n){this._prompt=n},i.create=function(t){return n.ts.mobile.sdk.impl.FingerprintInputImpl.create(t)},i.__tarsusInterfaceName="FingerprintInput",i}(t.InputResponseType);t.FingerprintInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return n&&i.setPrompt(n),i},t}(n.FingerprintInput);t.FingerprintInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getJsonData=function(){return this._jsonData},t.prototype.setJsonData=function(n){this._jsonData=n},t.prototype.getControlRequest=function(){return this._controlRequest},t.prototype.setControlRequest=function(n){this._controlRequest=n},t.createFormInputSubmissionRequest=function(t){return n.ts.mobile.sdk.impl.FormInputImpl.createFormInputSubmissionRequest(t)},t.createFormCancellationRequest=function(){return n.ts.mobile.sdk.impl.FormInputImpl.createFormCancellationRequest()},t.__tarsusInterfaceName="FormInput",t}();t.FormInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createFormInputSubmissionRequest=function(t){var r=new i;return r.setJsonData(t),r.setControlRequest(n.FormControlRequest.Submit),r},i.createFormCancellationRequest=function(){var t=new i;return t.setControlRequest(n.FormControlRequest.Abort),t},i}(n.FormInput);t.FormInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n}();n.GeoLocation=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getResponse=function(){return this._response},t.prototype.setResponse=function(n){this._response=n},t.prototype.getControlRequest=function(){return this._controlRequest},t.prototype.setControlRequest=function(n){this._controlRequest=n},t.createControlResponse=function(t){return n.ts.mobile.sdk.impl.InputOrControlResponseImpl.createControlResponse(t)},t.createInputResponse=function(t){return n.ts.mobile.sdk.impl.InputOrControlResponseImpl.createInputResponse(t)},t.__tarsusInterfaceName="InputOrControlResponse",t}();t.InputOrControlResponse=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.createControlResponse=function(n){var i=new t;return i.setControlRequest(n),i},t.createInputResponse=function(n){var i=new t;return i.setResponse(n),i},t.prototype.isControlRequest=function(){return!!this._controlRequest},t}(n.InputOrControlResponse);t.InputOrControlResponseImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getContinueProcessing=function(){return this._continueProcessing},t.prototype.setContinueProcessing=function(n){this._continueProcessing=n},t.create=function(t){return n.ts.mobile.sdk.impl.JsonDataProcessingResultImpl.create(t)},t.__tarsusInterfaceName="JsonDataProcessingResult",t}();t.JsonDataProcessingResult=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return i.setContinueProcessing(n),i},t}(n.JsonDataProcessingResult);t.JsonDataProcessingResultImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.city=n.city;this.state=n.state;this.country=n.country}return n.prototype.getCity=function(){return this.city},n.prototype.getCountry=function(){return this.country},n.prototype.getState=function(){return this.state},n}();n.LocationAttributesImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function i(n){this._deviceInfo=new t.DeviceInfoImpl(n)}return i.prototype.getInfo=function(){return this._deviceInfo},i.prototype.getAvailableActions=function(){if(this._deviceInfo.getStatus()==n.DeviceStatus.Removed)return[];var t=[n.DeviceManagementAction.Rename];return this._deviceInfo.getIsCurrent()||t.push(n.DeviceManagementAction.Remove),this._deviceInfo.getPushSupported()&&t.push(n.DeviceManagementAction.Identify),t},i}();t.ManagedDeviceImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function i(i){this._approval=new t.MobileApprovalImpl(i);switch(this._approval.getStatus()){case n.MobileApprovalStatus.Pending:this._availableActions=[n.MobileApprovalAction.Approve,n.MobileApprovalAction.Deny];break;default:this._availableActions=[]}}return i.prototype.getApproval=function(){return this._approval},i.prototype.getAvailableActions=function(){return this._availableActions},i}();t.ManagedMobileApprovalImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function i(i){this._approvalId=i.approval_id;this._source=i.source;this._title=i.title;this._details=i.details;this._creationTime=i.create;this._finishTime=i.finish;this._expiresAt=i.create+i.expiry_in*1e3;switch(i.status){case n.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Approved:this._status=n.MobileApprovalStatus.Approved;break;case n.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Denied:this._status=n.MobileApprovalStatus.Denied;break;case n.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Expired:this._status=n.MobileApprovalStatus.Expired;break;case n.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Pending:this._status=n.MobileApprovalStatus.Pending;break;default:throw new t.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unknown approval status "+i.status);}}return i.prototype.getApprovalId=function(){return this._approvalId},i.prototype.getSource=function(){return this._source},i.prototype.getTitle=function(){return this._title},i.prototype.getDetails=function(){return this._details},i.prototype.getCreationTime=function(){return this._creationTime},i.prototype.getFinishTime=function(){return this._finishTime},i.prototype.getExpiresAt=function(){return this._expiresAt},i.prototype.getStatus=function(){return this._status},i.prototype.isExpired=function(){return this._status==n.MobileApprovalStatus.Expired},i.prototype.updateStatus=function(n){this._status=n},i}();t.MobileApprovalImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.__tarsusInterfaceName="MobileApproveInput",t}(n.InputResponseType);n.MobileApproveInput=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createRequestPollingInput=function(){return n.ts.mobile.sdk.impl.MobileApproveInputRequestPollingImpl.createRequestPollingInput()},i.__tarsusInterfaceName="MobileApproveInputRequestPolling",i}(t.MobileApproveInput);t.MobileApproveInputRequestPolling=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.createRequestPollingInput=function(){return new t},t}(n.MobileApproveInputRequestPolling);t.MobileApproveInputRequestPollingImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){this.value=n;this.format=t}return n.prototype.getValue=function(){return this.value},n.prototype.getFormat=function(){return this.format},n.create=function(t,i){return new n(t,i)},n}();n.MobileApproveOtpImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.userId=function(){return this._userId},r.prototype.ticket=function(){return this._ticket},r.createWithUserId=function(n){var t=new r;return t._userId=n,t},r.createWithUserTicket=function(n){var t=new r;return t._userId=n,t},r.createWithJsonPayload=function(){throw new t.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"createWithJsonPayload Feature not supported.");},r}(n.MobileApprovePushRequestPayload);t.MobileApprovePushRequestPayloadImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getPrompt=function(){return this._prompt},i.prototype.setPrompt=function(n){this._prompt=n},i.create=function(t){return n.ts.mobile.sdk.impl.NativeFaceInputImpl.create(t)},i.__tarsusInterfaceName="NativeFaceInput",i}(t.InputResponseType);t.NativeFaceInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return n&&i.setPrompt(n),i},t}(n.NativeFaceInput);t.NativeFaceInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Password=0]="Password";n[n.Fingerprint=1]="Fingerprint";n[n.Pincode=2]="Pincode";n[n.Pattern=3]="Pattern";n[n.Otp=4]="Otp";n[n.Face=5]="Face";n[n.Voice=6]="Voice";n[n.Eye=7]="Eye";n[n.Emoji=8]="Emoji";n[n.Questions=9]="Questions";n[n.FaceID=10]="FaceID";n[n.Generic=11]="Generic";n[n.MobileApprove=12]="MobileApprove";n[n.Totp=13]="Totp"})(t=n.AuthenticatorType||(n.AuthenticatorType={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.RedirectTypeBind=0]="RedirectTypeBind";n[n.RedirectTypeAuthenticate=1]="RedirectTypeAuthenticate";n[n.RedirectTypeBindOrAuthenticate=2]="RedirectTypeBindOrAuthenticate";n[n.RedirectTypeInvokePolicy=3]="RedirectTypeInvokePolicy"})(t=n.RedirectType||(n.RedirectType={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,r,d,g,nt,tt;t.AuthTypeData={password:{authTypeEnum:n.AuthenticatorType.Password,authTypeName:"Password"},fingerprint:{authTypeEnum:n.AuthenticatorType.Fingerprint,authTypeName:"Fingerprint"},pin:{authTypeEnum:n.AuthenticatorType.Pincode,authTypeName:"PIN"},pin_centralized:{authTypeEnum:n.AuthenticatorType.Pincode,authTypeName:"PIN"},pattern:{authTypeEnum:n.AuthenticatorType.Pattern,authTypeName:"Pattern"},pattern_centralized:{authTypeEnum:n.AuthenticatorType.Pattern,authTypeName:"Pattern"},otp:{authTypeEnum:n.AuthenticatorType.Otp,authTypeName:"OTP"},face:{authTypeEnum:n.AuthenticatorType.Face,authTypeName:"Face"},face_server:{authTypeEnum:n.AuthenticatorType.Face,authTypeName:"Face"},voice_server:{authTypeEnum:n.AuthenticatorType.Voice,authTypeName:"Voice"},eye:{authTypeEnum:n.AuthenticatorType.Eye,authTypeName:"Eye"},emoji:{authTypeEnum:n.AuthenticatorType.Emoji,authTypeName:"Emoji"},question:{authTypeEnum:n.AuthenticatorType.Questions,authTypeName:"Questions"},face_id:{authTypeEnum:n.AuthenticatorType.FaceID,authTypeName:"FaceID"},mobile_approve:{authTypeEnum:n.AuthenticatorType.MobileApprove,authTypeName:"MobileApprove"},totp:{authTypeEnum:n.AuthenticatorType.Totp,authTypeName:"Totp"}},function(n){n.Closed="closed"}(u=t.SessionStateChangeState||(t.SessionStateChangeState={})),function(n){n.Pending="pending";n.Completed="completed";n.Rejected="rejected"}(f=t.AuthSessionState||(t.AuthSessionState={})),function(n){n.LOGINS="frequency_logins";n.DAYS="frequency_days"}(e=t.PromotionStrategyFrequency||(t.PromotionStrategyFrequency={})),function(n){n.Numeric="numeric";n.Alphanumeric="alphanumeric";n.Binary="binary"}(o=t.QrCodeFormatType||(t.QrCodeFormatType={})),function(n){n.Alphanumeric="alphanumeric";n.QrCode="qrcode"}(s=t.TicketIdFormatType||(t.TicketIdFormatType={})),function(n){n.ApprovalApprove="approval_approve"}(h=t.FailureSourceTransactionType||(t.FailureSourceTransactionType={})),function(n){n.AutoExecute="auto_execute";n.AssertionRejected="assertion_rejected";n.Policy="policy";n.Locked="locked";n.ApprovalExpired="approval_expired"}(c=t.FailureReasonType||(t.FailureReasonType={})),function(n){n.DefaultAuthenticator="default";n.AuthenticatorMenu="menu";n.FirstAuthenticator="first"}(l=t.AuthMenuPresentationMode||(t.AuthMenuPresentationMode={})),function(n){n.Registered="registered";n.Registering="registering";n.Unregistered="unregistered"}(a=t.AuthenticationMethodStatus||(t.AuthenticationMethodStatus={})),function(n){n.Validate="validate";n.Generate="generate"}(v=t.AuthenticationMethodOtpState||(t.AuthenticationMethodOtpState={})),function(n){n.None="none";n.Sms="sms";n.Email="email";n.Voice="voice"}(y=t.AuthenticationMethodOtpChannelType||(t.AuthenticationMethodOtpChannelType={})),function(n){n.Numeric="numeric";n.QrCode="qrcode";n.External="external";n.Unknown=""}(p=t.OtpFormatType||(t.OtpFormatType={})),function(n){n.WaitForApproval="wait_for_approval";n.WaitForAuthenticate="wait_for_authenticate"}(w=t.AuthenticationMethodMobileApproveState||(t.AuthenticationMethodMobileApproveState={})),function(n){n.AlphaNumeric="alpha_numeric";n.Numeric="numeric";n.QrCode="qrcode"}(b=t.TotpChallengeFormatType||(t.TotpChallengeFormatType={})),function(n){n.SelectTargets="select_targets";n.Validate="validate";n.Generate="generate"}(k=t.AuthenticationMethodTotpState||(t.AuthenticationMethodTotpState={})),function(n){n.RedirectTypeNameBind="bind";n.RedirectTypeNameAuthenticate="auth";n.RedirectTypeNameBindOrAuthenticate="bind_or_auth";n.RedirectTypeNameInvokePolicy="invoke"}(r=t.RedirectTypeName||(t.RedirectTypeName={}));t.RedirectTypeMap=(i={},i[r.RedirectTypeNameBind]=n.RedirectType.RedirectTypeBind,i[r.RedirectTypeNameAuthenticate]=n.RedirectType.RedirectTypeAuthenticate,i[r.RedirectTypeNameBindOrAuthenticate]=n.RedirectType.RedirectTypeBindOrAuthenticate,i[r.RedirectTypeNameInvokePolicy]=n.RedirectType.RedirectTypeInvokePolicy,i),function(n){n[n.NotRegistered=1]="NotRegistered";n[n.InvalidAction=2]="InvalidAction";n[n.BadConfig=3]="BadConfig";n[n.BadFch=4]="BadFch";n[n.FailedAssertion=5]="FailedAssertion";n[n.MethodLocked=6]="MethodLocked";n[n.DataMissing=7]="DataMissing";n[n.HistoryRepeat=11]="HistoryRepeat";n[n.MustRegister=14]="MustRegister";n[n.NotFinished=16]="NotFinished";n[n.MissingQuestions=17]="MissingQuestions";n[n.RepeatCurrentStep=18]="RepeatCurrentStep";n[n.FailOver=19]="FailOver";n[n.AssertionContainerNotComplete=20]="AssertionContainerNotComplete"}(d=t.AssertionErrorCode||(t.AssertionErrorCode={})),function(n){n.Pending="pending";n.Approved="approved";n.Denied="declined";n.Expired="expired"}(g=t.ServerResponseDataApprovalsApprovalStatus||(t.ServerResponseDataApprovalsApprovalStatus={})),function(n){n.RecentlyUsed="recently_used";n.NoRecentActivity="no_recent_activity";n.LongInactivity="long_inactivity";n.Disabled="disabled";n.Removed="removed"}(nt=t.DeviceStatusServerFormat||(t.DeviceStatusServerFormat={})),function(n){n.Active="active";n.Disabled="disabled"}(tt=t.CollectorState||(t.CollectorState={}))})(i=t.Protocol||(t.Protocol={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var f=function(){function t(){}return t.fromAssertionFormat=function(t){switch(t.type){case n.core.Protocol.OtpFormatType.Numeric:return new i(t.length);case n.core.Protocol.OtpFormatType.QrCode:return new r;case n.core.Protocol.OtpFormatType.External:return new u(t.data);default:throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Invalid format type encountered: "+t.type);}},t}(),i,r,u,t;n.OtpFormatImpl=f;i=function(){function n(n){this._length=n}return n.prototype.getOtpLength=function(){return this._length},n.prototype.getType=function(){return t.Numeric},n.__tarsusInterfaceName="OtpFormatNumeric",n}();n.OtpFormatNumericImpl=i;r=function(){function n(){}return n.prototype.getType=function(){return t.QrCode},n.__tarsusInterfaceName="OtpFormatQr",n}();n.OtpFormatQrImpl=r;u=function(){function n(n){this._data=n}return n.prototype.getData=function(){return this._data},n.prototype.getType=function(){return t.External},n.__tarsusInterfaceName="OtpFormatExternal",n}();n.OtpFormatExternalImpl=u,function(n){n[n.Numeric=0]="Numeric";n[n.QrCode=1]="QrCode";n[n.External=2]="External"}(t=n.OtpFormatType||(n.OtpFormatType={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getOtp=function(){return this._otp},i.prototype.setOtp=function(n){this._otp=n},i.createOtpSubmission=function(t){return n.ts.mobile.sdk.impl.OtpInputOtpSubmissionImpl.createOtpSubmission(t)},i.__tarsusInterfaceName="OtpInputOtpSubmission",i}(t.OtpInput);t.OtpInputOtpSubmission=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.createOtpSubmission=function(n){var i=new t;return i.setOtp(n),i},t}(n.OtpInputOtpSubmission);t.OtpInputOtpSubmissionImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createOtpResendRequest=function(){return n.ts.mobile.sdk.impl.OtpInputRequestResendImpl.createOtpResendRequest()},i.__tarsusInterfaceName="OtpInputRequestResend",i}(t.OtpInput);t.OtpInputRequestResend=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.createOtpResendRequest=function(){return new t},t}(n.OtpInputRequestResend);t.OtpInputRequestResendImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getPassword=function(){return this._password},i.prototype.setPassword=function(n){this._password=n},i.create=function(t){return n.ts.mobile.sdk.impl.PasswordInputImpl.create(t)},i.__tarsusInterfaceName="PasswordInput",i}(t.InputResponseType);t.PasswordInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return i.setPassword(n),i},t}(n.PasswordInput);t.PasswordInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getPatternDescription=function(){return this._patternDescription},i.prototype.setPatternDescription=function(n){this._patternDescription=n},i.create=function(t){return n.ts.mobile.sdk.impl.PatternInputImpl.create(t)},i.__tarsusInterfaceName="PatternInput",i}(t.InputResponseType);t.PatternInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.create=function(n){var t=new r;return t.setPatternDescription(n),t},r.validateFormat=function(n){return n.getPatternDescription().match(/^(r:[0-9]+,c:[0-9]+)+$/)!=null},r.getPatternLength=function(i){if(r.validateFormat(i))return i.getPatternDescription().match(/r/g).length;throw new t.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Invalid pattern input.");},r}(n.PatternInput);t.PatternInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getPin=function(){return this._pin},i.prototype.setPin=function(n){this._pin=n},i.create=function(t){return n.ts.mobile.sdk.impl.PinInputImpl.create(t)},i.__tarsusInterfaceName="PinInput",i}(t.InputResponseType);t.PinInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return i.setPin(n),i},t}(n.PinInput);t.PinInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createSuccessResponse=function(t){var i=new n.PlaceholderAuthSuccessResponse;return i.setPlaceholderToken(t),i},i.createdFailedResponse=function(t,i){var r=new n.PlaceholderAuthFailureResponse;return r.setFailureError(i),r.setExpired(t.getExpired()),r.setLocked(t.getLocked()),r.setRegistered(t.getRegistered()),r.setRegistrationStatus(t.getRegistrationStatus()),r},i.createFailedResponseWithServerProvidedStatus=function(t){var i=new n.PlaceholderAuthFailureWithServerProvidedStatusResponse;return i.setFailureError(t),i},i}(n.PlaceholderInputResponse);t.PlaceholderInputResponseImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this._actionType=n.type}return n.prototype.getActionType=function(){return this._actionType},n.prototype.getAltLabel=function(){return""},n}();n.PolicyActionImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getControlRequest=function(){return this._controlRequest},t.prototype.setControlRequest=function(n){this._controlRequest=n},t.createControlResponse=function(t){return n.ts.mobile.sdk.impl.PromotionInputImpl.createControlResponse(t)},t.prototype.getSelectedAuthenticator=function(){return this._selectedAuthenticator},t.prototype.setSelectedAuthenticator=function(n){this._selectedAuthenticator=n},t.createAuthenticatorDescription=function(t){return n.ts.mobile.sdk.impl.PromotionInputImpl.createAuthenticatorDescription(t)},t.__tarsusInterfaceName="PromotionInput",t}();t.PromotionInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.isControlRequest=function(){return!(typeof this._controlRequest=="undefined"||this._controlRequest===null)},t.createControlResponse=function(n){var i=new t;return i.setControlRequest(n),i},t.createAuthenticatorDescription=function(n){var i=new t;return i.setSelectedAuthenticator(n),i},t}(n.PromotionInput);t.PromotionInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function t(){}return t.fromAssertionFormat=function(t){switch(t){case n.core.Protocol.QrCodeFormatType.Numeric:return n.QrCodeFormat.Numeric;case n.core.Protocol.QrCodeFormatType.Alphanumeric:return n.QrCodeFormat.Alphanumeric;case n.core.Protocol.QrCodeFormatType.Binary:return n.QrCodeFormat.Binary;default:throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Invalid qr code format type encountered: "+t.type);}},t}();n.QrCodeFormatImpl=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getQrCode=function(){return this._qrCode},t.prototype.getQrCodeFormat=function(){return this._qrCodeFormat},t.createQrCodeResult=function(t,i){return n.ts.mobile.sdk.impl.QrCodeResultImpl.createQrCodeResult(t,i)},t.__tarsusInterfaceName="QrCodeResult",t}();t.QrCodeResult=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.createQrCodeResult=function(n,i){var r=new t;return r._qrCode=n,r._qrCodeFormat=i,r},t}(n.QrCodeResult);t.QrCodeResultImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getRedirectResponse=function(){return this._redirectResponse},t.prototype.setRedirectResponse=function(n){this._redirectResponse=n},t.create=function(t){return n.ts.mobile.sdk.impl.RedirectInputImpl.create(t)},t.__tarsusInterfaceName="RedirectInput",t}();t.RedirectInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return i.setRedirectResponse(n),i},t}(n.RedirectInput);t.RedirectInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getServerAddress=function(){return this._serverAddress},t.prototype.setServerAddress=function(n){this._serverAddress=n},t.prototype.getRealm=function(){return this._realm},t.prototype.setRealm=function(n){this._realm=n},t.prototype.getAppId=function(){return this._appId},t.prototype.setAppId=function(n){this._appId=n},t.prototype.getTokenName=function(){return this._tokenName},t.prototype.setTokenName=function(n){this._tokenName=n},t.prototype.getToken=function(){return this._token},t.prototype.setToken=function(n){this._token=n},t.prototype.getCryptoMode=function(){return this._cryptoMode},t.prototype.setCryptoMode=function(n){this._cryptoMode=n},t.create=function(t,i,r,u){return n.ts.mobile.sdk.impl.SDKConnectionSettingsImpl.create(t,i,r,u)},t.createWithCryptoMode=function(t,i,r,u,f){return n.ts.mobile.sdk.impl.SDKConnectionSettingsImpl.createWithCryptoMode(t,i,r,u,f)},t.__tarsusInterfaceName="SDKConnectionSettings",t}();t.SDKConnectionSettings=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.create=function(t,i,r,u){return this.createWithCryptoMode(t,i,r,u,n.ConnectionCryptoMode.None)},i.createWithCryptoMode=function(n,t,r,u,f){var e=new i;return e.setServerAddress(n),e.setAppId(t),e.setTokenName(r),e.setToken(u),e.setCryptoMode(f),e},i}(n.SDKConnectionSettings);t.SDKConnectionSettingsImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getQrCodeResult=function(){return this._qrCodeResult},i.prototype.setQrCodeResult=function(n){this._qrCodeResult=n},i.createScanQrCodeInput=function(t){return n.ts.mobile.sdk.impl.ScanQrCodeInputImpl.createScanQrCodeInput(t)},i.__tarsusInterfaceName="ScanQrCodeInput",i}(t.InputResponseType);t.ScanQrCodeInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.createScanQrCodeInput=function(n){var i=new t;return i.setQrCodeResult(n),i},t}(n.ScanQrCodeInput);t.ScanQrCodeInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.createAnswerToQuestion=function(n,i){var r=new t;return r._question=n,r._answer=i,r},t}(n.SecurityQuestionAndAnswer);t.SecurityQuestionAndAnswerImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.createWithText=function(n){var i=new t;return i._answerText=n,i},t}(n.SecurityQuestionAnswer);t.SecurityQuestionAnswerImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i){this._id=n;this._text=t;this._registered=i}return n.prototype.getSecurityQuestionId=function(){return this._id},n.prototype.getSecurityQuestionText=function(){return this._text},n.__tarsusInterfaceName="SecurityQuestion",n}();n.SecurityQuestionImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createSecurityQuestionAnswersInputResponse=function(t){var i=new n.SecurityQuestionAnswersInputResponse;return i._answers=t,i},i}(n.SecurityQuestionInputResponse);t.SecurityQuestionInputResponseImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.getStepTag=function(){return"question"},n.prototype.getSecurityQuestions=function(){return this._securityQuestions},n.prototype.getMinAnswersNeeded=function(){return this._minAnswers},n.createForAuthQuestion=function(t){var i=new n;return i._minAnswers=1,i._securityQuestions=[t],i},n.createForRegistrationQuestions=function(t,i){var r=new n;return r._minAnswers=i,r._securityQuestions=t,r},n.__tarsusInterfaceName="SecurityQuestionStepDescription",n}();n.SecurityQuestionStepDescriptionImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(t,i){var r=n.call(this)||this;return i&&(r._selectedTargets=i),t&&(r._authenticatorInput=t),r}return __extends(t,n),t.createAuthenticatorInput=function(n){return new t(n,null)},t.createTargetSelectionRequest=function(n){return new t(null,[n])},t.createTargetsSelectionRequest=function(n){return new t(null,n)},t}(n.TargetBasedAuthenticatorInput);t.TargetBasedAuthenticatorInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.createPollRequest=function(){return n.ts.mobile.sdk.impl.TicketWaitInputImpl.createPollRequest()},i.__tarsusInterfaceName="TicketWaitInput",i}(t.InputResponseType);t.TicketWaitInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.__tarsusInterfaceName="TicketWaitInputPollRequest",t}(n.TicketWaitInput);n.TicketWaitInputPollRequest=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var r=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.createPollRequest=function(){return new i},t}(n.TicketWaitInput),i;t.TicketWaitInputImpl=r;i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.__tarsusInterfaceName="TicketWaitInputPollRequest",t}(n.TicketWaitInputPollRequest);t.TicketWaitInputPollRequestImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Qr=0]="Qr";n[n.Alphanumeric=1]="Alphanumeric"})(t=n.TicketIdFormat||(n.TicketIdFormat={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function t(n){this._ticketId=n}return t.prototype.getFormat=function(){switch(this._ticketId.format){case n.core.Protocol.TicketIdFormatType.Alphanumeric:return n.TicketIdFormat.Alphanumeric;case n.core.Protocol.TicketIdFormatType.QrCode:default:return n.TicketIdFormat.Qr}},t.prototype.getValue=function(){return this._ticketId.value},t}(),r;t.TicketIdImpl=i;r=function(){function n(n){this._title=n.title;this._text=n.text;this._ticketId=new i(n.ticket_id)}return n.prototype.getTitle=function(){return this._title},n.prototype.getText=function(){return this._text},n.prototype.getTicketId=function(){return this._ticketId},n}();t.TicketWaitingInformationImpl=r})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var f=function(){function t(){}return t.fromAssertionFormat=function(t){switch(t.type){case n.core.Protocol.TotpChallengeFormatType.Numeric:return new r;case n.core.Protocol.TotpChallengeFormatType.QrCode:return new u;case n.core.Protocol.TotpChallengeFormatType.AlphaNumeric:return new i;default:throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Invalid format type encountered: "+t.type);}},t}(),i,r,u,t;n.TotpChallengeFormatImpl=f;i=function(){function n(){}return n.prototype.getType=function(){return t.AlphaNumeric},n.__tarsusInterfaceName="TotpChallengeFormatAlphaNumeric",n}();n.TotpChallengeFormatAlphaNumericImpl=i;r=function(){function n(){}return n.prototype.getType=function(){return t.Numeric},n.__tarsusInterfaceName="TotpChallengeFormatNumeric",n}();n.TotpChallengeFormatNumericImpl=r;u=function(){function n(){}return n.prototype.getType=function(){return t.QrCode},n.__tarsusInterfaceName="TotpChallengeFormatQr",n}();n.TotpChallengeFormatQrImpl=u,function(n){n[n.AlphaNumeric=0]="AlphaNumeric";n[n.Numeric=1]="Numeric";n[n.QrCode=2]="QrCode"}(t=n.TotpChallengeFormatType||(n.TotpChallengeFormatType={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getChallenge=function(){return this._challenge},i.prototype.setChallenge=function(n){this._challenge=n},i.create=function(t){return n.ts.mobile.sdk.impl.TotpChallengeInputImpl.create(t)},i.__tarsusInterfaceName="TotpChallengeInput",i}(t.InputResponseType);t.TotpChallengeInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return i.setChallenge(n),i},t}(n.TotpChallengeInput);t.TotpChallengeInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.createTotpGenerationRequest=function(t,i,r){var u=new n;return u.setUserId(t),u.setChallenge(i),u.setGeneratorName(r),u},n.prototype.getChallenge=function(){return this._challenge},n.prototype.getGeneratorName=function(){return this._generatorName},n.prototype.setGeneratorName=function(n){this._generatorName=n},n.prototype.setChallenge=function(n){this._challenge=n},n.prototype.setUserId=function(n){this._userId=n},n.prototype.getUserId=function(){return this._userId},n}();n.TotpGenerationRequestImpl=t})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.__tarsusInterfaceName="TotpInput",t}(n.InputResponseType);n.TotpInput=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.getCode=function(){return this._code},i.prototype.setCode=function(n){this._code=n},i.createTotpCodeSubmission=function(t){return n.ts.mobile.sdk.impl.TotpInputCodeSubmissionImpl.createTotpCodeSubmission(t)},i.__tarsusInterfaceName="TotpInputCodeSubmission",i}(t.TotpInput);t.TotpInputCodeSubmission=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.createTotpCodeSubmission=function(n){var i=new t;return i.setCode(n),i},t}(n.TotpInputCodeSubmission);t.TotpInputCodeSubmissionImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var i=function(){function n(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._components=t}return n.prototype.toString=function(){return this._components.map(function(n){return n.replace(/([\\.])/g,function(n){return"\\"+(n=="."?"p":n)})}).join(".")},n.prototype.concat=function(t){return new(n.bind.apply(n,[void 0].concat(this._components.concat(t._components))))},n}(),t;n.TarsusKeyPath=i;t=function(){function n(n){this._host=n}return n.prototype.readStorageKey=function(n){return this._host.readStorageKey(n.toString())},n.prototype.writeStorageKey=function(n,t){this._host.writeStorageKey(n.toString(),t)},n.prototype.deleteStorageKey=function(n){this._host.deleteStorageKey(n.toString())},n.prototype.readSessionStorageKey=function(n){return this._host.readSessionStorageKey(n.toString())},n.prototype.writeSessionStorageKey=function(n,t){this._host.writeSessionStorageKey(n.toString(),t)},n.prototype.deleteSessionStorageKey=function(n){this._host.deleteSessionStorageKey(n.toString())},n.prototype.generateKeyPair=function(n,t,i,r){return this._host.generateKeyPair(n.toString(),t,i,r)},n.prototype.generateKeyPairExternalRepresentation=function(n){return this._host.generateKeyPairExternalRepresentation(n)},n.prototype.generateHexSeededKeyPairExternalRepresentation=function(n,t){return this._host.generateHexSeededKeyPairExternalRepresentation(n,t)},n.prototype.getKeyPair=function(n,t,i){return this._host.getKeyPair(n.toString(),t,i)},n.prototype.deleteKeyPair=function(n){this._host.deleteKeyPair(n.toString())},n.prototype.importVolatileSymmetricKey=function(n,t){return this._host.importVolatileSymmetricKey(n,t)},n.prototype.importVolatileKeyPair=function(n,t){return this._host.importVolatileKeyPair(n,t)},n.prototype.generatePbkdf2HmacSha1HexString=function(n,t,i,r){return this._host.generatePbkdf2HmacSha1HexString(n,t,i,r)},n.prototype.calcHexStringEncodedSha256Hash=function(n){return this._host.calcHexStringEncodedSha256Hash(n)},n.prototype.calcHexStringEncodedSha512Hash=function(n){return this._host.calcHexStringEncodedSha512Hash(n)},n.prototype.generateRandomHexString=function(n){return this._host.generateRandomHexString(n)},n.prototype.queryHostInfo=function(n){return this._host.queryHostInfo(n)},n.prototype.calcHexStringEncodedHmacSha1HashWithHexEncodedKey=function(n,t){return this._host.calcHexStringEncodedHmacSha1HashWithHexEncodedKey(n,t)},n.prototype.getCurrentTime=function(){return this._host.getCurrentTime()},n.prototype.createDelayedPromise=function(n){return this._host.createDelayedPromise(n)},n.prototype.fidoClientXact=function(n,t,i,r){return this._host.fidoClientXact(n,t,i,r)},n.prototype.dyadicEnroll=function(n,t){return this._host.dyadicEnroll(n,t)},n.prototype.dyadicSign=function(n){return this._host.dyadicSign(n)},n.prototype.dyadicDelete=function(){return this._host.dyadicDelete()},n.prototype.dyadicRefreshToken=function(n){return this._host.dyadicRefreshToken(n)},n.prototype.transformApiPath=function(n){return this._host.transformApiPath(n)},n.prototype.log=function(n,t,i){return this._host.log(n,t,i)},n.prototype.loadPlugin=function(n){return this._host.loadPlugin(n)},n}();n.TarsusHostServices=t})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){function f(){return new u}var i=new t.core.TarsusKeyPath("currentSession"),u=function(){function u(){this.mandatoryCollectors=[t.CollectorType.DeviceDetails,t.CollectorType.ExternalSDKDetails,t.CollectorType.HWAuthenticators,t.CollectorType.LocalEnrollments,t.CollectorType.Capabilities]}return u.prototype.setTarsusHost=function(n){this._nativeHost=n;this.host=new t.core.TarsusHostServices(n);this.pluginManager=new t.core.TarsusPluginManager(this);this.enabledCollectors=[t.CollectorType.Accounts,t.CollectorType.DeviceDetails,t.CollectorType.Contacts,t.CollectorType.Owner,t.CollectorType.Software,t.CollectorType.Location,t.CollectorType.Bluetooth,t.CollectorType.ExternalSDKDetails,t.CollectorType.HWAuthenticators,t.CollectorType.FidoAuthenticators,t.CollectorType.Capabilities,t.CollectorType.LargeData,t.CollectorType.LocalEnrollments]},u.prototype.setConnectionSettings=function(n){this.connectionSettings=n},u.prototype.setClientCryptoSettings=function(n){this.cryptoSettings=n},u.prototype.setEnabledCollectors=function(n){this.enabledCollectors=n;this.addMandatoryCollectorsIfNeeded()},u.prototype.setLogLevel=function(n){this._nativeHost.setLogLevel(n)},u.prototype.setExternalLogger=function(n){this._nativeHost.setExternalLogger(n)},u.prototype.setTransportProvider=function(n){this.transportProvider=n},u.prototype.setUiHandler=function(n){this.currentUiHandler=n},u.prototype.setPushToken=function(n){this._lastReceivedPushToken=n},Object.defineProperty(u.prototype,"currentSession",{get:function(){return this._currentSession},enumerable:!0,configurable:!0}),u.prototype.installPlugin=function(n,t){this.pluginManager.installPlugin(n,t)},u.prototype.initialize=function(){var n=this;return new Promise(function(r,u){if(!n.host)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to initialize SDK without host.");if(!n.connectionSettings)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to initialize SDK without connection settings.");if(!n.transportProvider)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to initialize SDK without transport provider.");n.cryptoSettings||(n.cryptoSettings=t.ClientCryptoSettings.create(1e4));n.fidoClient=new t.core.fidoclient.TarsusFidoClient(n);n._nativeHost.initialize(n.enabledCollectors).then(function(){n.pluginManager.initializePlugins().then(function(){var u=n.host.readSessionStorageKey(i);if(u){n.log(t.LogLevel.Info,"Loading existing session from session store");try{n._currentSession=t.core.Session.fromJson(n,u);n.log(t.LogLevel.Debug,"Loaded existing session for user "+(n._currentSession.user&&n._currentSession.user.name))}catch(f){n.log(t.LogLevel.Warning,"Failed to load existing session from session store. Discarding existing session "+f+".")}}r(!0)})}).catch(function(n){u(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})})},u.prototype.isBoundForUser=function(n){var t=this.findUser(n);return!!(t&&t.deviceBound)},u.prototype.getBoundUserIds=function(){var n=[];return t.core.User.iterateUsers(this,function(t){t.deviceBound&&n.push(t.name)}),n},u.prototype.getKnownUserIds=function(){var n=[];return t.core.User.iterateUsers(this,function(t){(t.hasLoggedIn||t.deviceBound)&&n.push(t.name)}),n},u.prototype.logout=function(){var n=this;return new Promise(function(i,r){var e,u,f;if(!n._currentSession){r(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"No logged in user."));return}if(!n._currentSession.canTerminate()){r(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to logout with a locked session."));return}e=n._currentSession.createLogoutRequest();u=n._currentSession;n._currentSession=null;n.saveCurrentSession();u.invalidated?(n.log(t.LogLevel.Info,"Logging out with an invalidated session; not issuing server request."),f=Promise.resolve(!0)):f=u.performSessionExchange(e).then(function(){return!0});f.then(function(n){return t.core.Session.notifySessionObserversOnMainSessionLogout(u),n}).then(i,r)})},u.prototype.isTotpProvisionedForUser=function(n,i){var r;try{r=t.core.totp.TotpPropertiesProcessor.createWithUserId(n,this)}catch(u){return!1}return r.isTotpProvisionedForGenerator(i||"default")},u.prototype.getVersionInfo=function(){return this._versionInfo||(this._versionInfo=new t.impl.VersionInfoImpl(this.host.queryHostInfo(n.sdkhost.HostInformationKey.Platform),this.host.queryHostInfo(n.sdkhost.HostInformationKey.Version))),this._versionInfo},u.prototype.bind=function(i,r,u){var f=this,e=!1;return new Promise(function(o,s){var h,c,l,a;if(f.log(t.LogLevel.Debug,"Bind for user "+i),f.ensureConfigured(),f._currentSession)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to start a session (bind) with a current primary active session.");if(h=f.findUser(i),h&&h.deviceBound)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to bind an already bound user on this device.",{user:i});h||(f.log(t.LogLevel.Debug,"bind: Creating new user "+i),h=t.core.User.createUser(f,i));c=new t.core.Session(f,h);e=!0;f._currentSession=c;f.log(t.LogLevel.Debug,"bind: Generating new device keys for "+i);l=f.host.generateKeyPair(h.deviceSigningKeyTag,n.sdkhost.KeyClass.StdSigningKey,n.sdkhost.KeyBiometricProtectionMode.None,!0);a=f.host.generateKeyPair(h.deviceEncryptionKeyTag,n.sdkhost.KeyClass.StdEncryptionKey,n.sdkhost.KeyBiometricProtectionMode.None,!0);f.log(t.LogLevel.Debug,"bind: Initiating request promise");var p=f.promiseCollectionResult().then(function(n){return f.log(t.LogLevel.Debug,"Collection result completed."),n}),w=t.util.wrapPromiseWithActivityIndicator(f.currentUiHandler,null,u,Promise.all([l,a,p])).then(function(n){var i=n[0],u=n[1],e=n[2];return f.log(t.LogLevel.Debug,"bind: Collection and key generation done; setting up request"),c.createBindRequest(e,f._lastReceivedPushToken,i,u,r)}),v=!1,y=function(n){if(v)return n;v=!0;var i=c.deviceId();return i&&(f.log(t.LogLevel.Debug,"bind: binding device to user after succesful completion"),c.user.bindDeviceToUser(i),t.core.User.save(f,c.user)),t.core.Session.notifySessionObserversOnMainSessionLogin(c),n};f.log(t.LogLevel.Debug,"bind: Sending request");c.startControlFlow(w,null,u,y).then(function(n){return y(n),f.saveCurrentSession(),n}).then(o,s)}).catch(function(n){return e&&(f.log(t.LogLevel.Debug,"bind: Clearing session after error"),f._currentSession=null),Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.authenticate=function(n,i,r,u){var f=this,e=!1;return new Promise(function(o,s){var c,h,l,a;if(f.log(t.LogLevel.Debug,"Authenticate for user "+n+" with policy "+i),f.ensureConfigured(),f._currentSession)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to start a session (authenticate) with a current primary active session.");c=f.deviceSupportsBind()?f.lookupBoundUser(n):f.findUserOrCreate(n);h=new t.core.Session(f,c);e=!0;f._currentSession=h;f.log(t.LogLevel.Debug,"authenticate: Initiating message setup");l=t.util.wrapPromiseWithActivityIndicator(f.currentUiHandler,null,u,f.promiseCollectionResult());a=l.then(function(n){return f.log(t.LogLevel.Debug,"authenticate: Collection done; setting up request"),h.createLoginRequest(n,f._lastReceivedPushToken,i,r)});f.log(t.LogLevel.Debug,"authenticate: Sending request");f._currentSession.startControlFlow(a,null,u).then(function(n){return f.saveCurrentSession(),f.log(t.LogLevel.Debug,"authenticate: marking user has logged in after succesful completion"),h.user.markLoggedIn(),t.core.User.save(f,h.user),t.core.Session.notifySessionObserversOnMainSessionLogin(h),n}).then(o,s)}).catch(function(n){return e&&(f.log(t.LogLevel.Debug,"authenticate: Clearing session after error"),f._currentSession=null),Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.invokePolicy=function(n,i,r){var u=this;return this.log(t.LogLevel.Debug,"Invoke policy "+n+" for current session."),new Promise(function(f,e){u.ensureConfigured();u.runWithCurrentSession(function(f){u.log(t.LogLevel.Debug,"invokePolicy: Initiating request creation");var e=u.promiseCollectionResult(),o=e.then(function(r){return u.log(t.LogLevel.Debug,"invokePolicy: Collection done; setting up request"),f.createLoginRequest(r,u._lastReceivedPushToken,n,i)});return u.log(t.LogLevel.Debug,"invokePolicy: Initiating control flow"),f.startControlFlow(o,null,r)}).then(f,e)}).catch(function(n){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.startTotpSessionForUser=function(n,i,r,u){var f=this;return this.log(t.LogLevel.Debug,"Start TOTP session for user "+n+", generator "+r),new Promise(function(e,o){f.ensureConfigured();f.log(t.LogLevel.Debug,"Get TOTP data for <"+n+", "+r+">");var s=t.core.totp.TotpPropertiesProcessor.createWithUserId(n,f);s.runCodeGenerationSession(r,i,u,f.currentUiHandler).then(e,o)}).catch(function(n){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.totpGenerationRequestForUserFromCanonicalString=function(n,i){this.ensureConfigured();this.log(t.LogLevel.Debug,"Get TOTP request for <"+n+">");var r=t.core.totp.TotpPropertiesProcessor.createWithUserId(n,this);return r.totpRequestFromCanonicalString(i)},u.prototype.startTotpSessionWithRequest=function(n,i){var r=this;return new Promise(function(u,f){r.ensureConfigured();r.log(t.LogLevel.Debug,"Start TOTP session for user "+n.getUserId()+", generator "+n.getGeneratorName());var e=t.core.totp.TotpPropertiesProcessor.createWithUserId(n.getUserId(),r);e.runCodeGenerationSessionWithRequest(n,i,r.currentUiHandler).then(u,f)}).catch(function(n){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.startDeviceManagementSession=function(n){var i=this;return new Promise(function(r,u){i.ensureConfigured();i.runWithCurrentSession(function(r){i.log(t.LogLevel.Debug,"User in current session: "+r.user.name);var u=new t.core.DeviceManagementSessionProcessor(i,r,n);return u.run()}).then(function(n){switch(n){case t.core.DeviceManagementSessionProcessorReturnReason.CurrentDeviceDeleted:var r=i._currentSession&&i._currentSession.user.name;return i.log(t.LogLevel.Debug,"Invalidating current session after deletion of current device."),i._currentSession=null,i.saveCurrentSession(),r?(i.log(t.LogLevel.Debug,"Clearing data for current user ("+r+") after deletion of current device."),i.clearDataForUser(r)):i.log(t.LogLevel.Warning,"No current user after deletion of current device; not clearing sesison."),!0;case t.core.DeviceManagementSessionProcessorReturnReason.FinishSession:return!0}}).then(r,u)}).catch(function(n){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.startAuthenticationConfiguration=function(n){var i=this;return this.log(t.LogLevel.Debug,"Start authentication configuration for current session"),new Promise(function(r,u){i.ensureConfigured();i.runWithCurrentSession(function(r){i.log(t.LogLevel.Debug,"User in current session: "+r.user.name);var u=new t.core.AuthenticationConfigurationSessionProcessor(i,r,n);return u.run()}).then(r,u)}).catch(function(n){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.startAuthenticationConfigurationWithToken=function(n,i){var r=this;return this.log(t.LogLevel.Debug,"Start approval for provided session token"),new Promise(function(u,f){r.ensureConfigured();r.runWithCurrentSession(function(u){r.log(t.LogLevel.Debug,"User in current session: "+u.user.name);var f=new t.core.AuthenticationConfigurationSessionProcessor(r,u,i,n);return f.run()}).then(u,f)}).catch(function(n){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.startApprovalsSessionForCurrentSession=function(n){var i=this;return this.log(t.LogLevel.Debug,"Start approval for current session"),new Promise(function(r,u){i.ensureConfigured();i.runWithCurrentSession(function(r){i.log(t.LogLevel.Debug,"User in current session: "+r.user.name);var u=new t.core.ApprovalSessionProcessor(i,r,n);return u.run()}).then(r,u)}).catch(function(n){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.startApprovalsSessionForPushedRequest=function(n,i){var r=this;return this.log(t.LogLevel.Debug,"Start approval for push request"),new Promise(function(u,f){var e,o,s;if(r.ensureConfigured(),n.userId())r.log(t.LogLevel.Debug,"startApprovalsSessionForPushedRequest with userid "+n.userId()),o=r.lookupBoundUser(n.userId()),e=new t.core.Session(r,o);else{if(n.ticket()){f(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Mobile approval push by ticket not yet implemented."));return}f(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Unknown mobile approval push request."));return}s=new t.core.ApprovalSessionProcessor(r,e,i);s.run().then(u,f)}).catch(function(n){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.invokeAnonymousPolicy=function(n,i,r){var u=this;return this.log(t.LogLevel.Debug,"Start anonymous policy "+n),new Promise(function(f,e){var s,o,h;u.log(t.LogLevel.Debug,"authenticate: Initiating message setup");s=u.promiseCollectionResult();o=t.core.Session.createAnonymousSession(u);h=s.then(function(r){return u.log(t.LogLevel.Debug,"invokeAnonymusPolicy: Collection done; setting up request"),o.createAnonPolicyRequest(r,u._lastReceivedPushToken,n,i)});u.log(t.LogLevel.Debug,"authenticate: Sending request");o.startControlFlow(h,null,r).then(function(n){return n},function(n){u.log(t.LogLevel.Debug,"authenticate: Clearing session after error");throw n;}).then(f,e)}).catch(function(n){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},u.prototype.cancelCurrentRunningControlFlow=function(){this.log(t.LogLevel.Debug,"Cancel current running control flow requested.");this._currentSession?this._currentSession.cancelCurrentControlFlow():this.log(t.LogLevel.Error,"No current session")},u.prototype.ensureConfigured=function(){if(!this.currentUiHandler)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to start authentication without a registered UIHandler.");},u.prototype.saveCurrentSession=function(){this._currentSession?this.host.writeSessionStorageKey(i,this._currentSession.toJson()):this.host.deleteSessionStorageKey(i)},u.prototype.runWithCurrentSession=function(n){var r=this,i;return this._currentSession?(i=this._currentSession,i.lock(),n(i).finally(function(){i.unlock();r.saveCurrentSession()})):Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.SessionRequired,"Operation requires an active session."))},u.prototype.deviceSupportsBind=function(){return this.host.queryHostInfo(n.sdkhost.HostInformationKey.PersistentKeysSupported)=="true"},u.prototype.log=function(n,t){this._nativeHost.log(n,"TransmitSDK/Tarsus",t)},u.prototype.promiseCollectionResult=function(){var n=this;return this._nativeHost.promiseCollectionResult().then(function(t){return n.addTarsusCollectedData(t)})},u.prototype.getClientFeatureSet=function(){var i=this.host.queryHostInfo(n.sdkhost.HostInformationKey.HostProvidedFeatures),r;return r=i&&i.length?i.split(",").map(function(n){return parseInt(n)}):[],t.core.STATIC_FEATURE_SET.concat(r)},u.prototype.clearDataForUser=function(n){try{if(this.log(t.LogLevel.Debug,"Delete data for user "+n+"."),this._currentSession)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to call clearDataForUser with an active primary ongoing session.");var i=this.findUser(n);if(!i)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to call clearDataForUser with a non existing user.");try{this.host.deleteKeyPair(i.deviceSigningKeyTag)}catch(r){this.log(t.LogLevel.Warning,"Can't delete device signing key.")}try{this.host.deleteKeyPair(i.deviceEncryptionKeyTag)}catch(r){this.log(t.LogLevel.Warning,"Can't delete device encryption key.")}try{t.core.LocalEnrollment.deleteEnrollmentsForUser(i.name,this)}catch(r){this.log(t.LogLevel.Warning,"Can't delete enrollments for user.")}try{t.core.totp.TotpPropertiesProcessor.createWithUser(i,this).deleteAllProvisions()}catch(r){this.log(t.LogLevel.Warning,"Can't delete enrollments for user.")}t.core.User.deleteUser(i.name,this)}catch(r){this.log(t.LogLevel.Warning,"Can't delete data for user "+n+": "+r);throw r;}},u.prototype.clearAllData=function(){var i=this,n;if(this._currentSession)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to call clearAllData with an active primary ongoing session.");this.log(t.LogLevel.Debug,"Delete all data: collecting users");n=[];t.core.User.iterateUsers(this,function(t){n.push(t.name)});this.log(t.LogLevel.Debug,"Delete all data: deleting users");n.forEach(function(n){try{i.clearDataForUser(n)}catch(r){i.log(t.LogLevel.Warning,"Error when deleting user "+n+": "+r)}})},u.prototype.lookupBoundUser=function(n){var i=this.findUser(n);if(!i)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to authenticate with an unknown user on this device.",{user:n});if(!i.deviceBound)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to authenticate with an unbound user on this device.",{user:n});return i},u.prototype.findUserOrCreate=function(n){var i=this.findUser(n);return i||(this.log(t.LogLevel.Debug,"bind: Creating new user "+n),i=t.core.User.createUser(this,n)),i},u.prototype.findUser=function(n){return t.core.User.findUser(this,n)},u.prototype.addTarsusCollectedData=function(n){var i=this;return new Promise(function(u,f){var o=[],e=[];Object.keys(t.core.collectors.TarsusCollectors).forEach(function(n){var r=new t.core.collectors.TarsusCollectors[n].createCollector(i.enabledCollectors);r.isEnabled()&&(e.push(n),o.push(r.provide(i)))});Promise.all(o.map(function(n){return n.catch(function(n){return new Error(n)})})).then(function(f){var s=n.toJson(),o;for(o in f)f[o]instanceof Error?i.log(t.LogLevel.Error,"caught collection error "+f[o]):(i.log(t.LogLevel.Debug,"Tarsus collected from: "+e[o]+" "+JSON.stringify(f[o])),s.content[e[o]]=i.mergeCollectedData(f[o],s.content[e[o]]));u(new r(s))}).catch(function(n){f(n)})})},u.prototype.mergeCollectedData=function(n,t){var r={},i;for(i in n)r[i]=n[i];for(i in t)r[i]=t[i];return r},u.prototype.addMandatoryCollectorsIfNeeded=function(){var n=this;this.mandatoryCollectors.forEach(function(i){n.enabledCollectors.indexOf(i)<0&&(n.enabledCollectors.push(i),n.log(t.LogLevel.Warning,t.CollectorType[i]+" collector is mandatory, and will remain enabled."))})},u.__tarsusInterfaceName="TransmitSDKXm",u}(),r;t.TransmitSDKXmImpl=u;r=function(){function n(n){this.theResult=n}return n.prototype.toJson=function(){return this.theResult},n}();t.CollectionResultImpl=r;t.createSdk=f})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getUserChoice=function(){return this._userChoice},t.prototype.setUserChoice=function(n){this._userChoice=n},t.create=function(t){return n.ts.mobile.sdk.impl.UnregistrationInputImpl.create(t)},t.__tarsusInterfaceName="UnregistrationInput",t}();t.UnregistrationInput=i})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n){var i=new t;return i.setUserChoice(n),i},t}(n.UnregistrationInput);t.UnregistrationInputImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function t(n,t){this._sdkVersion=t;this._platformName=n}return t.prototype.getSdkVersion=function(){return this._sdkVersion},t.prototype.getTarsusVersion=function(){return n.core.TARSUS_VERSION},t.prototype.getPlatformName=function(){return this._platformName},t.prototype.getApiLevel=function(){return n.core.API_LEVEL},t}();t.VersionInfoImpl=i})(t=n.impl||(n.impl={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function t(n,t,i){this._sdk=n;this._session=t;this._clientContext=i;this._uiHandler=this._sdk.currentUiHandler}return t.prototype.run=function(){var t=this;return this._sdk.log(n.LogLevel.Debug,"approvals: Starting session"),this.queryApprovalsFromServer().then(function(n){return new Promise(function(i,r){t._completeFn=i;t._rejectFn=r;t.kickStartSession(n)})})},t.prototype.approve=function(t,i){return this.changeApprovalStatus(t,n.MobileApprovalStatus.Approved,i)},t.prototype.deny=function(t){return this.changeApprovalStatus(t,n.MobileApprovalStatus.Denied).then(function(){return!0})},t.prototype.requestRefreshApprovals=function(){var t=this;return this.queryApprovalsFromServer().then(function(n){return t.updateManagedApprovals(n),!0},function(t){throw n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);})},t.prototype.finishSession=function(){if(!this._appSession)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to finish a non started approval session.");this._appSession.endSession();this._appSession=null;this._completeFn(!0)},t.prototype.kickStartSession=function(t){if(this._appSession=this._sdk.currentUiHandler.createApprovalsSession(this._session.user.name),!this._appSession){this._rejectFn(n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTicketWaitSession."));return}this.updateManagedApprovals(t);this._appSession.startSession(this,null,this._clientContext)},t.prototype.updateManagedApprovals=function(t){if(this._managedApprovals=t,!this._appSession)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to update approvals on a non started approval session.");this._appSession.setSessionApprovalsList(t)},t.prototype.queryApprovalsFromServer=function(){var t=this,i;return this._sdk.log(n.LogLevel.Debug,"approvals: Initiating collection"),i=this._sdk.promiseCollectionResult(),n.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,i.then(function(i){t._sdk.log(n.LogLevel.Debug,"approvals: Collection done; setting up request to query approvals");var r=t._session.createApprovalsFetchRequest(i);return t._sdk.log(n.LogLevel.Debug,"approvals: Sending request to query approvals"),t._session.performSessionExchange(r).then(function(t){var i=t.data;return i.approvals.map(function(t){return new n.impl.ManagedMobileApprovalImpl(t)})})}))},t.prototype.changeApprovalStatus=function(t,i,r){var u=this,f,e;return this._sdk.log(n.LogLevel.Debug,"approval: change status of approval "+t.getApproval().getApprovalId()+" to "+i),this._sdk.log(n.LogLevel.Debug,"approval: Initiating request promise"),f=this._sdk.promiseCollectionResult(),e=f.then(function(r){return u._sdk.log(n.LogLevel.Debug,"approval: Collection done; setting up request"),u._session.createApprovalReplyRequest(r,t.getApproval().getApprovalId(),i)}),this._sdk.log(n.LogLevel.Debug,"approval: Initiating control flow"),this._session.startControlFlow(e,t.getApproval(),r||this._clientContext).then(function(n){return t.getApproval().updateStatus(i),u.updateManagedApprovals(u._managedApprovals),n},function(t){var i=n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);if(u._sdk.log(n.LogLevel.Debug,"approval: Got server error "+i),i.getErrorCode()==n.AuthenticationErrorCode.Internal&&i.getData()&&i.getData().server_error_code==6001){u._sdk.log(n.LogLevel.Debug,"approval: Converting server error");throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.ApprovalWrongState,i.getMessage());}else throw i;})},t}();t.ApprovalSessionProcessor=i})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i;(function(i){var r;(function(r){var u,f;(function(n){n[n.Builtin=0]="Builtin";n[n.Placeholder=1]="Placeholder";n[n.Fido=2]="Fido"})(u=r.AuthenticatorPrototype||(r.AuthenticatorPrototype={}));f=function(){function f(n,t,i,r){var f,e,o;this._session=n;this._authenticatorId=t;f=t.match(/^placeholder_(.*)$/);f?(this._authenticatorPrototype=u.Placeholder,this._placeholderId=f[1],e=i,this._authetnicationMethodTypeName=e.placeholder_type):t.match(/^fido_(.*)$/)?(this._authenticatorPrototype=u.Fido,o=i,this._authetnicationMethodTypeName=o.authenticator_type):(this._authenticatorPrototype=u.Builtin,this._authetnicationMethodTypeName=this._authenticatorId);this._authenticatorMethodConfig=i;this._serverReportedRegistrationStatus=r.status;this._expired=r.expired||!1;this._locked=r.locked||!1}return Object.defineProperty(f.prototype,"authenticationDriverDescriptor",{get:function(){var t=this.internalAuthenticationDriverDescriptor();if(!t)throw new n.ts.mobile.sdk.impl.AuthenticationErrorImpl(n.ts.mobile.sdk.AuthenticationErrorCode.Internal,"Unhandled authenticator: "+this.getAuthenticatorId());return t},enumerable:!0,configurable:!0}),f.prototype.internalAuthenticationDriverDescriptor=function(){switch(this._authenticatorPrototype){case u.Placeholder:return r.AuthenticatorDrivers.__placeholder;case u.Fido:return new r.AuthenticationDriverDescriptorFido(this._authenticatorMethodConfig.fido_policy);case u.Builtin:default:return r.AuthenticatorDrivers[this.getAuthenticatorId()]}},f.prototype.getAuthenticatorId=function(){return this._authenticatorId},f.prototype.getType=function(){var n=i.Protocol.AuthTypeData[this._authetnicationMethodTypeName];return n&&"authTypeEnum"in n?n.authTypeEnum:t.AuthenticatorType.Generic},f.prototype.getName=function(){var n=i.Protocol.AuthTypeData[this._authetnicationMethodTypeName];return n&&n.authTypeName||"Generic"},f.prototype.getExpired=function(){return this._expired},f.prototype.getRegistered=function(){return this.getRegistrationStatus()==t.AuthenticatorRegistrationStatus.Registered},f.prototype.getRegistrationStatus=function(){return this._serverReportedRegistrationStatus!=i.Protocol.AuthenticationMethodStatus.Registered?t.AuthenticatorRegistrationStatus.Unregistered:this.authenticationDriverDescriptor.evaluateLocalRegistrationStatus(this._session)},f.prototype.getLocked=function(){return this._locked},f.prototype.getDefaultAuthenticator=function(){return this._session.user.defaultAuthId==this.getAuthenticatorId()},f.prototype.getSupportedOnDevice=function(){var n=this.internalAuthenticationDriverDescriptor();return n&&this.authenticationDriverDescriptor.isSupportedOnDevice(this._session)},f.prototype.getPlaceholderId=function(){return this._placeholderId},f.prototype.updateWithAuthenticatorState=function(n){this._expired=n.expired||!1;this._locked=n.locked||!1;this._serverReportedRegistrationStatus=n.status},f}();r.AuthenticatorDescriptionImpl=f})(r=i.authenticationdrivers||(i.authenticationdrivers={}))})(i=t.core||(t.core={}))})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getEnabled=function(){return this.getSupportedOnDevice()},t}(t.authenticationdrivers.AuthenticatorDescriptionImpl),r=function(){function r(n,t,i,r){this._sdk=n;this._session=t;this._token=r||null;this._clientContext=i;this._uiHandler=this._sdk.currentUiHandler}return r.prototype.run=function(){var t=this;return this._sdk.log(n.LogLevel.Debug,"configuration: Starting session"),this.queryConfigMenuFromServerAndFilter().then(function(n){return new Promise(function(i,r){t.kickStartSession(n);t._completeFn=i;t._rejectFn=r})})},r.prototype.registerAuthenticator=function(n,t){return this.requestAuthenticatorRegistrationChange(n,!0,t)},r.prototype.reregisterAuthenticator=function(n,t){return this.requestAuthenticatorRegistrationChange(n,!0,t)},r.prototype.setDefaultAuthenticator=function(i){var r=this;return this._sdk.log(n.LogLevel.Info,"Coniguration: Updating user default authenticator."),new Promise(function(n){if(!r._session.anonymous){var u=r._session.user;u.updateDefaultAuthId(i.getDescription().getAuthenticatorId());t.User.save(r._sdk,u)}n(!0);r.updateManagedAuthenticators(r._authenticators)})},r.prototype.unregisterAuthenticator=function(n,t){return this.requestAuthenticatorRegistrationChange(n,!1,t).then(function(){return!0})},r.prototype.requestRefreshAuthenticators=function(){var t=this;return this.queryConfigMenuFromServerAndFilter().then(function(n){return t.updateManagedAuthenticators(n),!0},function(t){throw n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);})},r.prototype.finishSession=function(){if(!this._appSession)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to finish a non started config session.");this._appSession.endSession();this._appSession=null;this._completeFn(!0)},r.prototype.kickStartSession=function(t){if(this._appSession=this._uiHandler.createAuthenticationConfigurationSession(this._session.user.name),!this._appSession){this._rejectFn(n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createAuthenticationConfigurationSession."));return}this._appSession.startSession(this,null,this._clientContext);this.updateManagedAuthenticators(t)},r.prototype.updateManagedAuthenticators=function(t){if(!this._appSession)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to work with a non started config session.");var i={};t.forEach(function(n){i[n.getDescription().getAuthenticatorId()]=n});this._authenticators=t;this._authenticatorsByName=i;this._appSession.setAuthenticatorsList(t)},r.prototype.queryConfigMenuFromServerAndFilter=function(){var t=this,r;return this._sdk.log(n.LogLevel.Debug,"configuration: Initiating collection"),r=this._sdk.promiseCollectionResult(),n.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,r.then(function(r){t._sdk.log(n.LogLevel.Debug,"configuration: Collection done; setting up request to query for config menu");var u=t._session.createConfigMenuFetchRequest(r,t._token);return t._sdk.log(n.LogLevel.Debug,"configuration: Sending request to query approvals"),t._session.performSessionExchange(u).then(function(r){var u=r.data&&r.data.type=="configuration"&&r.data;if(!u)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Invalid configuration screen structure encountered.");return u.methods.map(function(r){var u=new i(t._session,r.type,r,r);return new n.impl.ConfigurableAuthenticatorImpl(u,r.options)}).filter(function(n){return n.getDescription().getSupportedOnDevice()})})}))},r.prototype.requestAuthenticatorRegistrationChange=function(i,r,u){var f=this,e,o;return this._sdk.log(n.LogLevel.Debug,"configuration: Authenticator "+i.getDescription().getName()+" request (un)registration "+r),this._sdk.log(n.LogLevel.Debug,"configuration: Initiating registration request promise"),e=this._sdk.promiseCollectionResult(),o=e.then(function(t){return f._sdk.log(n.LogLevel.Debug,"configuration: Collection done; setting up request"),f._session.createAuthRegistrationRequest(t,i.getDescription().getAuthenticatorId(),r,f._token)}),this._sdk.log(n.LogLevel.Debug,"configuration: Initiating control flow"),this._session.startControlFlow(o,null,u||this._clientContext).then(function(u){var e=u.getInternalData(),s=!1,o;return e&&e.methods&&e.methods.length&&(f._sdk.log(n.LogLevel.Debug,"configuration: Processing updates."),e.methods.forEach(function(n){var t=f._authenticatorsByName[n.type];t&&(t.getDescription().updateWithAuthenticatorState(n),s=!0)})),s&&(!r&&i.getDescription().getDefaultAuthenticator&&(f._session.anonymous||(o=f._session.user,o.updateDefaultAuthId(""),t.User.save(f._sdk,o))),f.updateManagedAuthenticators(f._authenticators)),u},function(t){throw n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);})},r}();t.AuthenticationConfigurationSessionProcessor=r})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function i(n,t,i){this._sdk=n;this._session=t;this._uiHandler=this._sdk.currentUiHandler;this._clientContext=i;this._cancelled=!1}return Object.defineProperty(i.prototype,"initiatingRequest",{get:function(){return this._initiatingRequest},enumerable:!0,configurable:!0}),i.prototype.cancelFlow=function(){this._cancelled=!0;this._currentActionDriver&&this._currentActionDriver.cancelRun();this._uiHandler.controlFlowCancelled(this._clientContext)},i.prototype.startControlFlow=function(t,i){var r=this;return this._cancelled?this.createExternalCancellationRejectionPromise():n.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,this._session.performSessionExchange(t)).then(function(n){return r._initiatingRequest=t,r._approval=i||null,r._uiHandler.controlFlowStarting(r._clientContext),r.promiseControlFlowCompletion(n).then(function(n){return r._uiHandler.controlFlowEnded(null,r._clientContext),n},function(n){r._uiHandler.controlFlowEnded(n,r._clientContext);throw n;})})},Object.defineProperty(i.prototype,"challenge",{get:function(){return this._initialCflowResponse&&this._initialCflowResponse.challenge||null},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"approval",{get:function(){return this._approval||null},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"uiHandler",{get:function(){return this._uiHandler},enumerable:!0,configurable:!0}),i.prototype.promiseControlFlowCompletion=function(n){return this._initialCflowResponse=n.data,this.processSingleStepExchange(this._initialCflowResponse)},i.prototype.processSingleStepExchange=function(i){var r=this,u;return i.control_flow&&(this._controlFlow=i.control_flow,this._currentControlFlowStep=0,this._sdk.log(n.LogLevel.Debug,"Got ControlFlow with "+this._controlFlow.length+" steps.")),i.data&&i.data.json_data?(this._sdk.log(n.LogLevel.Debug,"Got a JSON data attachment on control flow response. Processing."),u=t.actiondrivers.ActionDriverJsonData.handleJsonDataByUiHandler(this._uiHandler,i,i.data.json_data,null,this._clientContext)):u=Promise.resolve(i),u.then(function(){var u;switch(i.state){case t.Protocol.AuthSessionState.Pending:return(r._sdk.log(n.LogLevel.Debug,"Execute step "+r._currentControlFlowStep+"."),u=r._controlFlow[r._currentControlFlowStep],!u)?(r._sdk.log(n.LogLevel.Error,"Step "+r._currentControlFlowStep+" nonexisting."),Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Session state is pending but no control flow."))):r._cancelled?r.createExternalCancellationRejectionPromise():r.promiseCancellableSingleActionProcessing(u).then(function(n){return r._currentControlFlowStep++,r.processSingleStepExchange(n)});case t.Protocol.AuthSessionState.Rejected:return r._sdk.log(n.LogLevel.Debug,"Handle control flow rejection."),u=r._controlFlow&&r._controlFlow[r._currentControlFlowStep]||null,r._uiHandler.handlePolicyRejection(i.rejection_data&&i.rejection_data.title||null,i.rejection_data&&i.rejection_data.text||null,i.rejection_data&&i.rejection_data.button_text||null,i.failure_data,u?new n.impl.PolicyActionImpl(u):null,r._clientContext).then(function(t){if(t.getUserChoice()!=-1)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"ConfirmationInput.getUserChoice must be set to -1.");throw n.impl.AuthenticationErrorImpl.errorForSessionRejectionFailureData(i.failure_data);});case t.Protocol.AuthSessionState.Completed:return r._sdk.log(n.LogLevel.Debug,"Handle control flow completion."),Promise.resolve(n.impl.AuthenticationResultImpl.fromCflowServerResponse(i,r._session.deviceId()))}})},i.prototype.promiseCancellableSingleActionProcessing=function(i){var u=this,f=t.actiondrivers.ActionDrivers[i.type],r;return f?(r=new f(this,i),this._currentActionDriver=r,this._uiHandler.controlFlowActionStarting(r.policyAction(),this._clientContext),r.run().then(function(n){return u._uiHandler.controlFlowActionEnded(null,r.policyAction(),u._clientContext),n},function(n){u._uiHandler.controlFlowActionEnded(n,r.policyAction(),u._clientContext);throw n;}).finally(function(){u._currentActionDriver=null})):Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Don't know how to handle action.",{actionType:i.type}))},i.prototype.createAssertionRequest=function(i,r,u,f){var e,s,o;if(!this.challenge)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to create an assertion request without an initial control flow request.");if(e={action:i.type,assert:r||"action",assertion_id:i.assertion_id,fch:this.challenge},u&&(e.data=u),f){s=e;for(o in f)s[o]=f[o]}return new t.SessionExchangeRequest("POST","auth/assert",e)},i.prototype.createExternalCancellationRejectionPromise=function(){return Promise.reject(this.createExternalCancellationError())},i.prototype.createExternalCancellationError=function(){return new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"Operation cancelled by user.",{control_flow_external_cancellation:!0})},i}();t.ControlFlowProcessor=i})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function t(t,i){if(this.sdk=t,this.ec=new elliptic.ec("secp256k1"),i&&(this.sessionId=i.session_id,this.aesKey=this.base64ToJsArray(i.key),!this.isReady()))throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Can't deserialize crypto session");}return t.prototype.getExchangeRequestHeader=function(){var n;return this.kp||(n={entropy:this.sdk.host.generateRandomHexString(192),entropyEnc:"hex"},this.kp=this.ec.genKeyPair(n)),{type:"key_exchange",scheme:2,y:this.jsArrayToBase64(this.kp.getPublic().encode())}},t.prototype.processExchangeResponseHeader=function(n){if(n.scheme!=2)throw"Unsupported crypto scheme "+n.scheme;this.sessionId=n.crypto_session_id;var i=this.kp.derive(this.ec.keyFromPublic(atob(n.y)).getPublic()),t=sha256.create();t.update(i.toArray("be",32));this.aesKey=t.digest()},t.prototype.isReady=function(){return!!(this.aesKey&&this.sessionId)},t.prototype.decryptResponse=function(n){var t=null;if(n.headers.forEach(function(n){n.type=="encryption"&&(t=n)}),t){var r=this.base64ToJsArray(t.iv),u=new aesjs.ModeOfOperation.cbc(this.aesKey,r),f=this.base64ToJsArray(n.data),e=u.decrypt(f),i=aesjs.utils.utf8.fromBytes(e);i=this.pkcs7Unpad(i);n.data=JSON.parse(i)}return n},t.prototype.encryptRequest=function(n){for(var r=this,t=[],i=0;i<16;i++)t.push(Math.floor(Math.random()*256));var u={type:"encryption",iv:this.jsArrayToBase64(t),crypto_session_id:this.sessionId},f=n.headers.map(function(n){return r.encryptStringToBase64(JSON.stringify(n),t)}),e=JSON.stringify(n.data),o=this.encryptStringToBase64(e,t);n.headers=[u];n.enc_headers=f;n.data=o},t.prototype.encryptStringToBase64=function(n,t){var i=new aesjs.ModeOfOperation.cbc(this.aesKey,t),r=aesjs.utils.utf8.toBytes(n),u=this.pkcs7Pad(r),f=i.encrypt(u);return this.jsArrayToBase64(f)},t.prototype.toJson=function(){return{scheme:2,session_id:this.sessionId,key:this.jsArrayToBase64(this.aesKey)}},t.fromJson=function(n,i){return new t(n,i)},t.prototype.jsArrayToBase64=function(n){for(var i="",t=0;t<n.length;t++)i+=String.fromCharCode(n[t]);return btoa(i)},t.prototype.base64ToJsArray=function(n){for(var i=atob(n),r=[],t=0;t<i.length;t++)r.push(i.charCodeAt(t));return r},t.prototype.pkcs7Pad=function(n){var i=16-n.length%16,r=new Uint8Array(n.length+i),t;for(r.set(n,0),t=0;t<i;t++)r[n.length+t]=i;return r},t.prototype.pkcs7Unpad=function(n){var t=n.charCodeAt(n.length-1);return n.slice(0,-t)},t}();t.Scheme2CryptoSession=i})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i,r;(function(n){n[n.FinishSession=0]="FinishSession";n[n.CurrentDeviceDeleted=1]="CurrentDeviceDeleted"})(i=t.DeviceManagementSessionProcessorReturnReason||(t.DeviceManagementSessionProcessorReturnReason={}));r=function(){function t(n,t,i,r){this._sdk=n;this._session=t;this._clientContext=i;this._token=r||null;this._uiHandler=this._sdk.currentUiHandler}return t.prototype.run=function(){var t=this;return this._sdk.log(n.LogLevel.Debug,"device management: Starting session"),this.queryDevicesFromServer().then(function(n){return new Promise(function(i,r){t._completeFn=i;t._rejectFn=r;t.kickStartSession(n)})})},t.prototype.removeDevice=function(t){var i=this;return new Promise(function(r,u){if(t.getInfo().getIsCurrent())throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Illegal attempt to delete the current device using 'DeviceManagementSessionServices.removeDevice'. The current device must only be deleted using DeviceManagementSessionServices.removeCurrentDeviceAndFinishSession.");var f=i.ensureValidDevice(t);i.performDeviceAction(f,n.DeviceManagementAction.Remove,null).then(function(){return i._sdk.log(n.LogLevel.Debug,"device management: Updating device state locally"),f.getInfo().setStatus(n.DeviceStatus.Removed),i.updateManagedDevices(i._managedDevices.filter(function(n){return n!=f})),!0}).then(r,u)})},t.prototype.removeCurrentDeviceAndFinishSession=function(){var t=this,r;if(this._appSession)r=this._appSession;else return Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to finish a non started device management session."));return new Promise(function(u,f){var o,e;if(t._sdk.log(n.LogLevel.Debug,"device management: Start removing current device"),o=t._managedDevices.filter(function(n){return n.getInfo().getIsCurrent()}),o.length!=1)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Couldn't locate current device in device list.");e=o[0];t.performDeviceAction(e,n.DeviceManagementAction.Remove,null).then(function(){return t._sdk.log(n.LogLevel.Debug,"device management: Updating device state locally"),e.getInfo().setStatus(n.DeviceStatus.Removed),t.updateManagedDevices(t._managedDevices.filter(function(n){return n!=e})),!0}).then(function(){u(!0);r.endSession();t._appSession=null;t._completeFn(i.CurrentDeviceDeleted)}).catch(f)})},t.prototype.identifyDevice=function(t){var i=this;return new Promise(function(r,u){var f=i.ensureValidDevice(t);return i.performDeviceAction(f,n.DeviceManagementAction.Identify,null).then(function(){return!0}).then(r,u)})},t.prototype.renameDevice=function(t,i){var r=this;return new Promise(function(u,f){var e=r.ensureValidDevice(t),o={name:i};return r.performDeviceAction(e,n.DeviceManagementAction.Rename,o).then(function(){return r._sdk.log(n.LogLevel.Debug,"device management: Updating device state locally"),e.getInfo().setName(i),r.updateManagedDevices(r._managedDevices),!0}).then(u,f)})},t.prototype.requestRefreshDevices=function(){var t=this;return this.queryDevicesFromServer().then(function(n){return t.updateManagedDevices(n),!0},function(t){throw n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);})},t.prototype.finishSession=function(){if(!this._appSession)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to finish a non started device management session.");this._appSession.endSession();this._appSession=null;this._completeFn(i.FinishSession)},t.prototype.kickStartSession=function(t){if(this._appSession=this._sdk.currentUiHandler.createDeviceManagementSession(this._session.user.name),!this._appSession){this._rejectFn(n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createDeviceManagementSession."));return}this.updateManagedDevices(t);this._appSession.startSession(this,null,this._clientContext)},t.prototype.updateManagedDevices=function(t){if(!this._appSession)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to update device list for a non started device management session.");this._managedDevices=t;this._appSession.setSessionDevicesList(t)},t.prototype.querySingleDeviceFromServer=function(t){var i=this,r;return this._sdk.log(n.LogLevel.Debug,"device management: Initiating collection"),r=this._sdk.promiseCollectionResult(),n.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,r.then(function(r){i._sdk.log(n.LogLevel.Debug,"device management: Collection done; setting up request to query single device");var u=i._session.createSingleDeviceFetchRequest(r,i._token,t);return i._sdk.log(n.LogLevel.Debug,"device management: Sending request to query devices"),i._session.performSessionExchange(u).then(function(n){return n.data})}))},t.prototype.queryDevicesFromServer=function(){var t=this,i;return this._sdk.log(n.LogLevel.Debug,"device management: Initiating collection"),i=this._sdk.promiseCollectionResult(),n.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,i.then(function(i){t._sdk.log(n.LogLevel.Debug,"device management: Collection done; setting up request to query devices");var r=t._session.createDevicesFetchRequest(i,t._token);return t._sdk.log(n.LogLevel.Debug,"device management: Sending request to query devices"),t._session.performSessionExchange(r).then(function(i){t._uiHandler.endActivityIndicator(null,t._clientContext);var r=i.data;return r.map(function(i){var r=new n.impl.ManagedDeviceImpl(i);return r.getInfo().getDeviecId()==t._session.user.deviceId&&r.getInfo().forceCurrent(),r})})}))},t.prototype.performDeviceAction=function(t,i,r){var u=this,f,e;switch(i){case n.DeviceManagementAction.Identify:f="notify";break;case n.DeviceManagementAction.Remove:f="remove";break;case n.DeviceManagementAction.Rename:f="name";break;default:return Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Invalid device action specified "+i))}return this._sdk.log(n.LogLevel.Debug,"devices: action "+f+" on "+t.getInfo().getDeviecId()),this._sdk.log(n.LogLevel.Debug,"devices: Initiating collection"),e=this._sdk.promiseCollectionResult(),n.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,e.then(function(i){u._sdk.log(n.LogLevel.Debug,"devices: Collection done; setting up request");var e=u._session.createDeviceActionRequest(i,u._token,t.getInfo().getDeviecId(),f,r);return u._sdk.log(n.LogLevel.Debug,"devices: Sending request"),u._session.performSessionExchange(e).then(function(n){return n})}).catch(function(t){throw n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);}))},t.prototype.ensureValidDevice=function(t){var i=this._managedDevices.indexOf(t);if(i<0)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to perform a device action on a device not originally included in device management session.");return this._managedDevices[i]},t}();t.DeviceManagementSessionProcessor=r})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function t(n){this._name=n;this._extensions=[];t._extensionPoints[n]=this}return t.prototype.extend=function(n){this._extensions.push(n)},t.prototype.forEach=function(n){this._extensions.forEach(n)},t.prototype.firstNonNull=function(n){var t=null;return this._extensions.forEach(function(i){t||(t=n(i))}),t},t.byName=function(t){var i=this._extensionPoints[t];if(!i)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Invalid extension point requested: "+t);return i},t._extensionPoints={},t}();t.ExtensionPoint=i})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function t(){}return t.installOnSdk=function(n){n.setExternalLogger(new t)},t.prototype.log=function(t,i,r){var u="["+i+"] "+r;switch(t){case n.LogLevel.Debug:console.log(u);break;case n.LogLevel.Info:console.info(u);break;case n.LogLevel.Warning:console.warn(u);break;case n.LogLevel.Error:console.error(u);break;case n.LogLevel.Critical:console.error(u)}},t}();t.JsConsoleLogger=i})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var r,i,u;(function(n){n.Registering="registering";n.Registered="registered";n.Unregistered="unregistered"})(r=t.LocalEnrollmentStatus||(t.LocalEnrollmentStatus={})),function(n){n.None="none";n.Validated="validated";n.Invalidated="invalidated"}(i=t.LocalEnrollmentValidationStatus||(t.LocalEnrollmentValidationStatus={}));u=function(){function u(){}return Object.defineProperty(u.prototype,"salt",{get:function(){return this._record.salt},set:function(n){this._record.salt=n},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"status",{get:function(){return this._record.status||r.Unregistered},set:function(n){this._record.status=n},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"version",{get:function(){return this._record.version},set:function(n){this._record.version=n},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"authenticatorId",{get:function(){return this._record.authenticatorId},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"validationStatus",{get:function(){return this._record.validationStatus},set:function(n){this._record.validationStatus=n},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"publicKeyHash",{get:function(){return this._record.publicKeyHash},set:function(n){this._record.publicKeyHash=n},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"cryptoSettings",{get:function(){return this._record.cryptoSettings?n.ClientCryptoSettings.create(this._record.cryptoSettings.pbkdf_iterations_count):null},set:function(n){this._record.cryptoSettings=n?{pbkdf_iterations_count:n.getLocalEnrollmentKeyIterationCount(),pbkdf_key_size:n.getLocalEnrollmentKeySizeInBytes()}:null},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"keyMaterial",{get:function(){return this._record.keyMeterial},set:function(n){this._record.keyMeterial=n},enumerable:!0,configurable:!0}),u.prototype.setFingerprintDbSnapshot=function(n){this._record.fingerprintDbSsnapshot=n},u.enrollmentWithRecord=function(n){var t=new u;return t._record=n,t},u.enrollmentsForUser=function(t,i){var e={},f=i.host.readStorageKey(this.storageKeyForEnrollmentsForUser(t)),r;i.log(n.LogLevel.Debug,"Got db "+JSON.stringify(f));for(r in f)i.log(n.LogLevel.Debug,"Got db wEnrollmentKey"+r),e[r]=u.enrollmentWithRecord(f[r]);return e},u.deleteEnrollmentsForUser=function(n,t){t.host.deleteStorageKey(this.storageKeyForEnrollmentsForUser(n))},u.createNew=function(n,t,f,e,o){var h={salt:f,status:r.Unregistered,version:t,authenticatorId:n,cryptoSettings:null,validationStatus:i.None,publicKeyHash:o},s=new u;return s._record=h,s},u.updateEnrollmentsForUser=function(n,t,i){var u={},r;for(r in t)u[r]=t[r]._record;i.host.writeStorageKey(this.storageKeyForEnrollmentsForUser(n),u)},u.invalidateLocalRegistrationStatusAndNotifyUIHandler=function(t,r){return new Promise(function(u){var f,e,o;if(!t)throw"No valid session.";if(f=t.getCurrentControlFlowProcessor(),!f)throw"No control flow";t.sdk.log(n.LogLevel.Info,"Marking authenticator as invalidated and invoking UI Handler");e=t.user.localEnrollments[r.getAuthenticatorId()];e.validationStatus=i.Invalidated;t.user.updateEnrollmentRecord(e);o=f._uiHandler;o.localAuthenticatorInvalidated(r,f._clientContext).then(function(n){u(n)})})},u.storageKeyForEnrollmentsForUser=function(n){return new t.TarsusKeyPath("per_user",n,"local_enrollments")},u.listInvalidatedLocalEnrollments=function(n){var t,r=[],u;for(u in n.user.localEnrollments)t=n.user.localEnrollments[u],t.validationStatus==i.Invalidated&&r.push(t);return r},u}();t.LocalEnrollment=u})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){n.TARSUS_EXTENSION_POINT_NAME_MESSAGE_FILTERS="com.ts.mobile.sdk.core.messageFilters";n.TARSUS_EXTENSION_POINT_NAME_SESSION_OBSERVERS="com.ts.mobile.sdk.core.sessionObservers";n.TARSUS_EXTENSION_POINT_NAME_PLACEHOLDER_EXTENSION="com.ts.mobile.sdk.core.placeholderExtension"})(t=n.tarsusplugin||(n.tarsusplugin={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var f=function(){function f(n,t){this._sdk=n;this._user=t;this._lockCount=0;this._invalidated=!1;this._deviceId=t&&t.deviceBound?t.deviceId:null}return Object.defineProperty(f.prototype,"anonymous",{get:function(){return this._anonymous},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"invalidated",{get:function(){return this._invalidated},enumerable:!0,configurable:!0}),f.createAnonymousSession=function(n){var t=new f(n,i.User.createEphemeralUser(n));return t._anonymous=!0,t},f.prototype.createBindRequest=function(n,t,r,u,f){var e={collection_result:n.toJson(),public_key:r.publicKeyToJson(),encryption_public_key:u.publicKeyToJson(),push_token:t};return f&&(e.params=f),new i.SessionExchangeRequest("POST","auth/bind",e)},f.prototype.createLoginRequest=function(n,t,r,u){var f={collection_result:n.toJson(),push_token:t};return r&&(f.policy_request_id=r),u&&(f.params=u),new i.SessionExchangeRequest("POST","auth/login",f)},f.prototype.createAnonPolicyRequest=function(n,t,r,u){var f={collection_result:n.toJson(),push_token:t};return r&&(f.policy_request_id=r),u&&(f.params=u),new i.SessionExchangeRequest("POST","auth/anonymous_invoke",f)},f.prototype.createLogoutRequest=function(){return new i.SessionExchangeRequest("POST","auth/logout",{})},f.prototype.createApprovalsFetchRequest=function(n){var t={collection_result:n.toJson()};return new i.SessionExchangeRequest("POST","approvals/actions/fetch",t)},f.prototype.createApprovalReplyRequest=function(n,r,u){var f={collection_result:n.toJson(),status:u==t.MobileApprovalStatus.Approved?i.Protocol.ServerResponseDataApprovalsApprovalStatus.Approved:i.Protocol.ServerResponseDataApprovalsApprovalStatus.Denied};return new i.SessionExchangeRequest("POST","auth/approve?apid="+r,f)},f.prototype.createSingleDeviceFetchRequest=function(n,t,r){var u={collection_result:n.toJson(),device_id:r};return t&&(u.token=t),new i.SessionExchangeRequest("POST","mobile/device",u)},f.prototype.createDevicesFetchRequest=function(n,t){var r={collection_result:n.toJson()};return t&&(r.token=t),new i.SessionExchangeRequest("POST","mobile/devices",r)},f.prototype.createDeviceActionRequest=function(n,t,r,u,f){var e={collection_result:n.toJson(),device_id:r};return t&&(e.token=t),f&&Object.keys(f).forEach(function(n){e[n]=f[n]}),new i.SessionExchangeRequest("POST","mobile/device/action?action="+u,e)},f.prototype.createConfigMenuFetchRequest=function(n,t){var r={collection_result:n.toJson()};return t&&(r.token=t),new i.SessionExchangeRequest("POST","auth/authenticator/config_menu",r)},f.prototype.createAuthRegistrationRequest=function(n,t,r,u){var f={collection_result:n.toJson(),type:t},e;return u&&(f.token=u),e=r?"register":"unregister",new i.SessionExchangeRequest("POST","auth/authenticator/"+e,f)},f.prototype.startControlFlow=function(n,r,u,f){var e=this,s,o;return(f===void 0&&(f=function(n){return n}),this._currentControlFlowProcessor)?(s="Attempt to start a control flow while an existing control flow ("+this._currentControlFlowProcessor.challenge+") is running.",this._sdk.log(t.LogLevel.Error,s),Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,s))):(o=new i.ControlFlowProcessor(this._sdk,this,u),this._currentControlFlowProcessor=o,n.then(function(n){return e._sdk.log(t.LogLevel.Debug,"Start control flow"),new Promise(function(u){i.authenticationdrivers.SimpleAuthenticationDriverDescriptor.refreshInvalidatedAuthenticatorsEnrollments(e).catch(function(n){e._sdk.log(t.LogLevel.Warning,"Could not refresh invalidated authenticators enrollments: "+n)}).finally(function(){u(o.startControlFlow(n,r))})})}).then(function(n){return f(n)}).finally(function(){e._sdk.log(t.LogLevel.Debug,"Retire control flow "+o.challenge);e._currentControlFlowProcessor=null}).then(function(n){var f=n.getInternalData(),r,s;return f&&f.redirect?(r=f.redirect,s=r.policy_id||null,o._uiHandler.handlePolicyRedirect(i.Protocol.RedirectTypeMap[r.redirect_type],s,r.user_id,r.params,u).then(function(n){switch(n.getRedirectResponse()){case t.RedirectResponseType.RedirectToPolicy:return e.processRedirectRequest(r,u);case t.RedirectResponseType.CancelRedirect:return Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"Redirection to next policy canceled."))}})):n}))},f.prototype.getCurrentControlFlowProcessor=function(){return this._currentControlFlowProcessor},f.prototype.generateInvalidatedAuthenticatorsHeadersIfNeeded=function(){for(var n,f=[],s=i.LocalEnrollment.listInvalidatedLocalEnrollments(this),e,o,r=0,u=s;r<u.length;r++)n=u[r],this._sdk.log(t.LogLevel.Debug,"Found invalidated authenticator: "+n.authenticatorId),n.publicKeyHash&&(e={type:"public_key_hash",hash:n.publicKeyHash},o={type:"registration_invalidated",method:n.authenticatorId,registration_id:e},f.push(o));return f},f.prototype.processRedirectRequest=function(n,r){var e=n.policy_id||null,u=n.user_id||this._user.name,f=n.params,o;this._user.name!=u&&(this._sdk.log(t.LogLevel.Info,"UserId in redirect request is different from current user, switch to user "+u),o=i.User.findUser(this._sdk,u),this._user=o||i.User.createUser(this._sdk,u));this._sdk.log(t.LogLevel.Info,"control flow || type:"+n.redirect_type+" policy: "+e);switch(n.redirect_type){case i.Protocol.RedirectTypeName.RedirectTypeNameAuthenticate:return this._sdk.authenticate(this._user.name,e,f,r);case i.Protocol.RedirectTypeName.RedirectTypeNameBind:return this._sdk.bind(this._user.name,f,r);case i.Protocol.RedirectTypeName.RedirectTypeNameInvokePolicy:return this._sdk.invokePolicy(e,f,r);case i.Protocol.RedirectTypeName.RedirectTypeNameBindOrAuthenticate:return this._sdk.isBoundForUser(u)?this._sdk.authenticate(this._user.name,e,f,r):this._sdk.bind(this._user.name,f,r)}},Object.defineProperty(f.prototype,"user",{get:function(){return this._user},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"deviceSigningKeyPair",{get:function(){if(!this._deviceKeyPair&&!this._anonymous&&this._sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.PersistentKeysSupported)=="true"&&(this._deviceKeyPair=this._sdk.host.getKeyPair(this._user.deviceSigningKeyTag,n.sdkhost.KeyClass.StdSigningKey,n.sdkhost.KeyBiometricProtectionMode.None),!this._deviceKeyPair)){this._sdk.log(t.LogLevel.Error,"Could not load device signing key pair for this device.");throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidDeviceBinding,"Invalid device signature - could not load device signing key pair.");}return this._deviceKeyPair},enumerable:!0,configurable:!0}),f.prototype.performSessionExchange=function(n){return this.performSessionExchangeInternal(n,!0,!0)},f.prototype.performSessionExchangeInternal=function(n,r,u){var f=this;return this._invalidated?(this._sdk.log(t.LogLevel.Error,"Attempt to execute a session exchange from invalidated session."),Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.SessionRequired,"Session was invalidated by server."))):this.connectionSettings().getCryptoMode()==t.ConnectionCryptoMode.Full&&!this._currentCryptoSession&&u?this.performSessionExchangeInternal(new i.SessionExchangeRequest("POST","auth/key_exchange",{r:"Hello Encrypted World"}),r).then(function(){return f.performSessionExchangeInternal(n)}):(this._sdk.log(t.LogLevel.Debug,"Preprocess request "+JSON.stringify(n)),this.preprocessSessionExchangeRequest(n).then(function(u){return f.promisePossiblyEncryptedTransportRequest(u).then(function(u){return f.preprocessTransportRequest(u).then(function(u){return f._sdk.log(t.LogLevel.Debug,"Will send request "+JSON.stringify(u)),f._sdk.transportProvider.sendRequest(u).then(function(u){var e,o;if(f._sdk.log(t.LogLevel.Debug,"Got response "+JSON.stringify(u)),e=JSON.parse(u.getBodyJson()),f.postprocessResponse(e),e=f.possiblyDecryptResponse(e),o=e.data&&e.data.state==i.Protocol.AuthSessionState.Rejected,u.getStatus()==200&&!e.error_code||u.getStatus()==401&&o)return e;if(u.getStatus()==200||e.error_code){if(e.error_code==23&&r)return f._currentCryptoSession=null,f.performSessionExchangeInternal(n,!1,!0);throw t.impl.AuthenticationErrorImpl.errorForServerResponse(e);}else throw t.impl.AuthenticationErrorImpl.errorForTransportResponse(u);})})})}))},f.prototype.cancelCurrentControlFlow=function(){this._currentControlFlowProcessor?this._currentControlFlowProcessor.cancelFlow():this._sdk.log(t.LogLevel.Error,"No current control flow.")},f.prototype.deviceId=function(){return this._deviceId},Object.defineProperty(f.prototype,"sdk",{get:function(){return this._sdk},enumerable:!0,configurable:!0}),f.prototype.preprocessTransportRequest=function(n){var e=this,f={aid:this.connectionSettings().getAppId()},i,r,u;this._deviceId&&(f.did=this._deviceId);this._sessionId&&(f.sid=this._sessionId);n.setUrl(this.urlWithConcatenatedQuery(n.getUrl(),f));i=n.getHeaders()||[];r=new t.TransportHeader;r.setName("X-TS-Client-Version");r.setValue(this.clientVersionHeader);i.push(r);u=new t.TransportHeader;u.setName("Authorization");u.setValue("TSToken "+this.connectionSettings().getToken()+"; tid="+this.connectionSettings().getTokenName());i.push(u);try{if(this._deviceId&&this.deviceSigningKeyPair)return this.generateSignatureForRequest(n).then(function(r){var u=new t.TransportHeader;return u.setName("Content-Signature"),u.setValue("data:"+r+";key-id:"+e._deviceId+";scheme:3"),i.push(u),n.setHeaders(i),n})}catch(o){return Promise.reject(o)}return n.setHeaders(i),Promise.resolve(n)},f.prototype.postprocessResponse=function(n){var t=this;n.headers&&n.headers.forEach(function(n){var i=f.headerProcessors[n.type];i.call(t,n)})},f.prototype.getUserId=function(){return this._anonymous?this._user.ephemeralUserId?this._user.ephemeralUserId:null:this._user.name},f.prototype.encryptEnvelopedMessageIfNeeded=function(n){var t=this.generateKeyExchangeHeaderIfNeeded();this._currentCryptoSession&&this._currentCryptoSession.isReady()&&this._currentCryptoSession.encryptRequest(n);t&&n.headers.push(t)},f.prototype.promisePossiblyEncryptedTransportRequest=function(n){var i=this;return new Promise(function(r){var e={headers:n.envelopeHeaders,data:n.body},u,o,f,s;i.encryptEnvelopedMessageIfNeeded(e);u=new t.TransportRequest;o=i._sdk.host.transformApiPath(n.serverRelativeUrl);u.setMethod(n.method);f=i._sdk.connectionSettings.getRealm()||"";s=f.length?"/"+f:"";u.setUrl(""+i._sdk.connectionSettings.getServerAddress()+s+"/api/v2/"+o);u.setBodyJson(JSON.stringify(e));r(u)})},f.prototype.possiblyDecryptResponse=function(n){return this._currentCryptoSession&&this._currentCryptoSession.isReady()&&(n=this._currentCryptoSession.decryptResponse(n)),n},f.prototype.generateKeyExchangeHeaderIfNeeded=function(){return this.connectionSettings().getCryptoMode()!=t.ConnectionCryptoMode.None&&!this._currentCryptoSession?(this._currentCryptoSession=new i.Scheme2CryptoSession(this._sdk),this._currentCryptoSession.getExchangeRequestHeader()):null},f.prototype.preprocessSessionExchangeRequest=function(n){var i=this;return new Promise(function(r,e){var l=i.generateUserIDHeaderIfNeeded(),h,o,c,a,s,v;if(l&&n.addEnvelopeHeader(l),h=i.generateInvalidatedAuthenticatorsHeadersIfNeeded(),h)for(o=0,c=h;o<c.length;o++)a=c[o],n.addEnvelopeHeader(a);s=Promise.resolve(!0);v=new u(n);f.messageFilteringExtensionPoint.forEach(function(n){s=s.then(function(){return n.filterMessage(i.createPluginSessionInfo(),v).catch(function(n){return i.sdk.log(t.LogLevel.Warning,"Error during message filtering: "+n),!0})})});s.then(function(){return r(n)},e)})},f.prototype.generateUserIDHeaderIfNeeded=function(){var n=this.getUserId();return n!=null?{type:"uid",uid:n}:null},f.prototype.processKeyExchangeResponseHeader=function(n){this._currentCryptoSession&&this._currentCryptoSession.processExchangeResponseHeader(n)},f.prototype.generateSignatureForRequest=function(n){var i=n.getUrl(),r=i.indexOf("?");if(r>0){var u=n.getUrl().substring(r+1),f=n.getUrl().substring(0,r),e=u.split("&").sort().join("&");i=f+"?"+e}var o=i.substr(this.connectionSettings().getServerAddress().length),s=o.replace("%%","\\%")+"%%"+this.clientVersionHeader.replace("%%","\\%%")+"%%"+n.getBodyJson(),h=t.util.asciiToHex(s);return this.deviceSigningKeyPair.signHex(h).then(function(n){return t.util.hexToBase64(n)})},f.prototype.connectionSettings=function(){return this._sdk.connectionSettings},f.prototype.processSessionIdHeader=function(n){this._sdk.log(t.LogLevel.Debug,"Processing session ID header "+n);this._sessionId=n.session_id},f.prototype.processDeviceIdHeader=function(n){this._sdk.log(t.LogLevel.Debug,"Processing Device ID header "+n);this._deviceId?this._deviceId!=n.device_id&&this._sdk.log(t.LogLevel.Warning,"Received device ID "+n.device_id+" in a session with an existing device id "+this._deviceId):(this._user.setProvisionalDeviceId(n.device_id),this._deviceId=n.device_id)},f.prototype.processSessionStateChangeHeader=function(n){this._sdk.log(t.LogLevel.Debug,"Processing session state change header "+n+" to state "+n.state);switch(n.state){case i.Protocol.SessionStateChangeState.Closed:this._sdk.log(t.LogLevel.Debug,"Invalidating session.");this._invalidated=!0;break;default:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Communication,"Invalid session state change encountered in header.");}},f.prototype.processSessionEphemeralUserHeader=function(n){this._sdk.log(t.LogLevel.Debug,"Processing ephemeral user Id header "+n);this._user.updateEphemeralUserId(n.uid)},f.prototype.noHeaderProcessing=function(){},f.prototype.processEncryptedSharedSecretHeader=function(){},f.prototype.urlWithConcatenatedQuery=function(n,t){var i="";return n.indexOf("?")<0?i="?":n[n.length-1]!="&"&&(i="&"),n+i+Object.keys(t).map(function(n){return n+"="+encodeURIComponent(t[n])}).join("&")},Object.defineProperty(f.prototype,"clientVersionHeader",{get:function(){if(!this._cachedClientVersionHeader){var n=this._sdk.getClientFeatureSet().join(",");this._cachedClientVersionHeader=this._sdk.getVersionInfo().getSdkVersion()+";["+n+"]"}return this._cachedClientVersionHeader},enumerable:!0,configurable:!0}),f.prototype.createPluginSessionInfo=function(){return new r(this)},f.prototype.lock=function(){this._sdk.log(t.LogLevel.Debug,"Locking session "+this._sessionId);this._lockCount++},f.prototype.unlock=function(){if(this._sdk.log(t.LogLevel.Debug,"Unlocking session "+this._sessionId),this._lockCount--,this._lockCount<0)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Unbalanced session locking: Attempt to unlock an already unlocked sessoin.");},f.prototype.canTerminate=function(){return!this._lockCount},f.prototype.toJson=function(){var n={session_id:this._sessionId,user_name:this._user.name,device_id:this._deviceId,invalidated:this._invalidated};return this._currentCryptoSession&&this._currentCryptoSession.isReady()&&(n.c_session=this._currentCryptoSession.toJson()),n},f.fromJson=function(n,r){var u=r,o=i.User.findUser(n,u.user_name),e;if(!o)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Can't deserialize session -- user "+u.user_name+" not found.");return e=new f(n,o),e._sessionId=u.session_id,e._deviceId=u.device_id,e._invalidated=u.invalidated||!1,u.c_session&&(e._currentCryptoSession=i.Scheme2CryptoSession.fromJson(n,u.c_session)),e},f.notifySessionObserversOnMainSessionLogin=function(n){var t=n.createPluginSessionInfo();this.sessionObservationExtensionPoint.forEach(function(n){n.mainSessionStarted(t)})},f.notifySessionObserversOnMainSessionLogout=function(n){var t=n.createPluginSessionInfo();this.sessionObservationExtensionPoint.forEach(function(n){n.mainSessionEnded(t)})},f.headerProcessors={session_id:f.prototype.processSessionIdHeader,device_id:f.prototype.processDeviceIdHeader,encrypted_shared_secret:f.prototype.processEncryptedSharedSecretHeader,session_state:f.prototype.processSessionStateChangeHeader,ephemeral_uid:f.prototype.processSessionEphemeralUserHeader,key_exchange:f.prototype.processKeyExchangeResponseHeader,encryption:f.prototype.noHeaderProcessing},f.messageFilteringExtensionPoint=new i.ExtensionPoint(n.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_MESSAGE_FILTERS),f.sessionObservationExtensionPoint=new i.ExtensionPoint(n.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_SESSION_OBSERVERS),f}(),r,u;i.Session=f;r=function(){function n(n){this._underlying=n}return n.prototype.getUsername=function(){return this._underlying.user.name},n}();u=function(){function n(n){this._underlying=n}return n.prototype.getMethod=function(){return this._underlying.method},n.prototype.getBody=function(){return this._underlying.body},n.prototype.getHeaders=function(){return this._underlying.envelopeHeaders},n.prototype.addHeader=function(n){this._underlying.addEnvelopeHeader(n)},n}()})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i,r){this._requestMethod=n;this._requestServerRelativeUrl=t;this._requestBody=i;this._envelopeHeaders=r||[]}return n.prototype.addEnvelopeHeader=function(n){this._envelopeHeaders.push(n)},Object.defineProperty(n.prototype,"method",{get:function(){return this._requestMethod},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"serverRelativeUrl",{get:function(){return this._requestServerRelativeUrl},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this._requestBody},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"envelopeHeaders",{get:function(){return this._envelopeHeaders},enumerable:!0,configurable:!0}),n}();n.SessionExchangeRequest=t})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(){function n(n){this._sdk=n}return n.prototype.extend=function(n,t){i.ExtensionPoint.byName(n).extend(t)},n.prototype.getSdk=function(){return this._sdk},n.prototype.generateRandomHexString=function(n){return this._sdk.host.generateRandomHexString(n)},n}(),u;i.TarsusPluginHostImpl=r;u=function(){function i(n){this._installedPluginsAndConfigs={};this._initializedPlugins=[];this._sdk=n;this._pluginHost=new r(this._sdk)}return i.prototype.getInitializedPlugins=function(){return this._initializedPlugins.concat([])},i.prototype.installPlugin=function(n,i){if(this._installedPluginsAndConfigs[n])throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to install plugin "+n+" twice.");this._installedPluginsAndConfigs[n]=i},i.prototype.initializePlugins=function(){var i=this,r;return this._sdk.log(t.LogLevel.Debug,"Starting plugin initialization..."),r=Object.keys(this._installedPluginsAndConfigs).map(function(r){return i._sdk.log(t.LogLevel.Debug,"Loading plugin "+r+"..."),i._sdk.host.loadPlugin(r).then(function(u){var f=u.getPluginInfo();return i._sdk.log(t.LogLevel.Info,"Initializing plugin "+n.tarsusplugin.impl.PluginInfoImpl.toString(f)+"..."),u.initialize(i._pluginHost,i._installedPluginsAndConfigs[r]).then(function(){i._initializedPlugins.push(u)}).catch(function(r){i._sdk.log(t.LogLevel.Error,"Couldn't initialize plugin "+n.tarsusplugin.impl.PluginInfoImpl.toString(f)+": "+r)})})}),Promise.all(r).then(function(){i._sdk.log(t.LogLevel.Debug,"Plugin initialization completed sucessfuly")})},i}();i.TarsusPluginManager=u})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function i(){}return Object.defineProperty(i.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"deviceId",{get:function(){return this._deviceId},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"phoneNumber",{get:function(){return this._phoneNumber},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"defaultAuthId",{get:function(){return this._defaultAuthId},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"deviceBound",{get:function(){return this._deviceBound},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasLoggedIn",{get:function(){return this._hasLoggedIn},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"deviceSigningKeyTag",{get:function(){return new t.TarsusKeyPath("per_user",this._name,"device_key")},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"deviceEncryptionKeyTag",{get:function(){return new t.TarsusKeyPath("per_user",this._name,"enc_enabled")},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"ephemeralUserId",{get:function(){return this._ephemeralUserId},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localEnrollments",{get:function(){return this._localEnrollments||(this._localEnrollments=t.LocalEnrollment.enrollmentsForUser(this.name,this._sdk)),this._localEnrollments},enumerable:!0,configurable:!0}),i.prototype.updateDefaultAuthId=function(n){this._defaultAuthId=n},i.prototype.updateEphemeralUserId=function(t){if(!this._ephemeral)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Invalid ephemeral user name update reaquest header, user is not ephemeral.");if(this._ephemeralUserId)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to set an ephemeral userId after it has already been updated once.");this._ephemeralUserId=t},i.prototype.setProvisionalDeviceId=function(t){if(this.deviceBound)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to record a provisional device ID for an already bound user record.",{});this._deviceId=t},i.prototype.bindDeviceToUser=function(t){if(this.deviceBound)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to record a device for an already bound user record.",{});if(this._deviceId!=t)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to bind user to a device ID different than provisional device ID.",{});this._deviceBound=!0},i.prototype.markLoggedIn=function(){this._hasLoggedIn=!0},i.iterateUsers=function(n,t){for(var f=n.host.readStorageKey(i.storageKey),e,u,r=0;r<f.length;r++)if(e=i.fromUserRecord(f[r],n),u=t(e),u!=null)return u;return null},i.findUser=function(n,t){return i.iterateUsers(n,function(n){return n.name.toLowerCase()==t.toLowerCase()?n:null})},i.createUser=function(n,t){var r=new i;return r._name=t,r._deviceBound=!1,r._hasLoggedIn=!1,r._phoneNumber="",r._sdk=n,r._ephemeral=!1,i.save(n,r),r},i.createEphemeralUser=function(n){var t=new i;return t._name="",t._deviceBound=!1,t._hasLoggedIn=!1,t._phoneNumber="",t._sdk=n,t._ephemeral=!0,t._ephemeralUserId=null,t},i.deleteUser=function(t,r){var u=r.host.readStorageKey(i.storageKey),f,e,o;for(r.log(n.LogLevel.Warning,"=== CURRENTL LEN    "+u.length),f=0;f<u.length;f++)if(e=i.fromUserRecord(u[f],r),e.name==t)break;if(!(f<u.length)){r.log(n.LogLevel.Warning,"Attempt to delete nonexisting user "+t);return}while(f<u.length-1)u[f]=u[f+1],f++;o=u.length-1;delete u[u.length-1];r.log(n.LogLevel.Warning,"=== CURRENTL LEN2    "+u.length);u.length=o;r.log(n.LogLevel.Warning,"=== CURRENTL LEN3    "+u.length);r.host.writeStorageKey(i.storageKey,u)},i.prototype.createEnrollmentRecord=function(n,i,r,u,f){var e=t.LocalEnrollment.createNew(n,i,r,this._sdk,f);return e.status=u,e},i.prototype.updateEnrollmentRecord=function(i){var r,u;if(this._ephemeral)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to update enrollment record for ephemeral user.",{});r={};for(u in this.localEnrollments)r[u]=this.localEnrollments[u];r[i.authenticatorId]=i;t.LocalEnrollment.updateEnrollmentsForUser(this.name,r,this._sdk);this._localEnrollments=r},i.prototype.toUserRecord=function(){return{default_auth_id:this._defaultAuthId,device_bound:this._deviceBound,has_logged_in:this._hasLoggedIn,device_id:this._deviceId,last_auth:"<null>",user_id:this._name,user_number:this._phoneNumber}},i.save=function(t,r){var u,f,e;if(r._ephemeral)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to save ephemeral user record to persistent store.",{});for(u=t.host.readStorageKey(i.storageKey),u.length=u.length||0,f=0;f<u.length;f++)if(e=i.fromUserRecord(u[f],t),e.name==r.name)break;u[f]=r.toUserRecord();u.length<f+1&&(u.length=f+1);t.host.writeStorageKey(i.storageKey,u)},i.fromUserRecord=function(n,t){var r=new i;return r._sdk=t,r._name=n.user_id,r._defaultAuthId=n.default_auth_id,r._deviceBound=n.device_bound,r._hasLoggedIn=n.has_logged_in,r._deviceId=n.device_id,r._phoneNumber=n.user_number,r},i.storageKey=new t.TarsusKeyPath("users"),i}();t.User=i})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){n.InternalErrorWrongBiometric=1e3;n.InternalErrorBiometricInvalidated=1001;n.InternalErrorBiometricKeyStoreError=1002;n.InternalErrorBiometricNotConfigured=1003;n.InternalErrorBiometricOsLockTemporary=1004;n.InternalErrorBiometricOsLockPermanent=1005;n.ErrorDataInternalError="internal_error";n.ErrorDataNumFailures="num_failures";n.ErrorDataServerErrorCode="server_error_code";n.ErrorDataServerErrorMessage="server_error_message";n.ErrorDataServerErrorData="server_error_data";n.ErrorDataRetriesLeft="retries";n.ErrorDataCommunicationError="communication_error";n.ErrorDataCommunicationSSL="ssl";n.FeatureCodeServerHeaders=1;n.FeatureCodeAuthFailover=2;n.FeatureCodeUnifiedRegFlow=3;n.FeatureCodePromotionAction=6;n.FeatureCodeSilentFingerprintRegistration=7;n.FeatureCodeMultiMethodRegistrationAction=8;n.FeatureCodeOtpCodeInvalidated=10;n.FeatureCodeEnvelopedClientRequest=11;n.FeatureCodeUnregistrationFlow=12;n.FeatureCodeFaceIdAuthentication=13;n.FeatureCodeDynamicPolicySupport=14;n.FeatureCodeAutoRequestForSignContent=19})(t=n.sdkhost||(n.sdkhost={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){t.TARSUS_VERSION="3.6.3";t.API_LEVEL=6;t.STATIC_FEATURE_SET=[n.sdkhost.FeatureCodeServerHeaders,n.sdkhost.FeatureCodeAuthFailover,n.sdkhost.FeatureCodeUnifiedRegFlow,n.sdkhost.FeatureCodePromotionAction,n.sdkhost.FeatureCodeSilentFingerprintRegistration,n.sdkhost.FeatureCodeMultiMethodRegistrationAction,n.sdkhost.FeatureCodeOtpCodeInvalidated,n.sdkhost.FeatureCodeEnvelopedClientRequest,n.sdkhost.FeatureCodeUnregistrationFlow,n.sdkhost.FeatureCodeDynamicPolicySupport]})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(){function t(n,t){this._controlFlowProcessor=n;this._action=t;this._sdk=this._controlFlowProcessor._sdk;this._uiHandler=this._controlFlowProcessor._uiHandler;this._clientContext=this._controlFlowProcessor._clientContext}return t.prototype.cancelRun=function(){},t.prototype.policyAction=function(){return this._policyAction||(this._policyAction=new n.impl.PolicyActionImpl(this._action)),this._policyAction},t.prototype.sendAssertionRequest=function(t,i,r){var u=this._controlFlowProcessor.createAssertionRequest(this._action,t,i,r);return n.util.wrapPromiseWithActivityIndicator(this._uiHandler,this.policyAction(),this._clientContext,this._controlFlowProcessor._session.performSessionExchange(u).then(function(t){if(!t.data)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Communication,"Invalid response to assertion.",{responseBody:JSON.stringify(t)});return t.data}))},t}();t.ActionDriver=i})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(i,r){var u=t.call(this,i,r)||this;return u._clientContext=u._controlFlowProcessor._clientContext,u._cancellationHolder=new n.util.CancelablePromiseHolder,u}return __extends(i,t),i.prototype.run=function(){var t=this;return this._cancellationHolder.resolveWith(function(n,i){t.doRunAction().then(n,i)}),this._cancellationHolder.cancellablePromise.catch(function(i){if(i==n.util.CancelablePromiseHolder.CancelRequest)return t._controlFlowProcessor.createExternalCancellationRejectionPromise();throw i;})},i.prototype.cancelRun=function(){this._cancellationHolder.cancel()},i}(t.ActionDriver);t.SimpleCancellationActionDriver=i})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var u=function(n){function t(t,i,r,u,f,e,o,s){var h=n.call(this,o._controlFlowProcessor._session,t,i,r)||this;return h._assertionId=u,h._retriesLeft=f,h._actionDriver=o,h._fallback=e,h._registration=s,h}return __extends(t,n),Object.defineProperty(t.prototype,"authDriver",{get:function(){return this._authDriver||(this._authDriver=this.authenticationDriverDescriptor.createAuthenticationDriver(this._actionDriver,this._authenticatorMethodConfig,this)),this._authDriver},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"suggestedParameters",{get:function(){return this.getEnabled()?this.authenticationDriverDescriptor.suggestParameters(this._authenticatorMethodConfig,this):[]},enumerable:!0,configurable:!0}),t.prototype.getEnabled=function(){return(this._registration||this.getRegistered()&&!this.getLocked())&&this.getSupportedOnDevice()},Object.defineProperty(t.prototype,"fallback",{get:function(){return this._fallback},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"assertionId",{get:function(){return this._assertionId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"retriesLeft",{get:function(){return this._retriesLeft},enumerable:!0,configurable:!0}),t.prototype.updateWithAssertionResult=function(n){n.retries_left&&(this._retriesLeft=n.retries_left);n.locked&&(this._locked=n.locked)},t.fromUnregistrationAction=function(n,i){return new t(n.method,n,n,n.assertion_id,null,null,i,!1)},t.fromPromotionAction=function(n,i){return new t(n.method,n,n,n.assertion_id,n.retries_left,n.fallback||null,i,!0)},t.fromAuthenticationActionMenuOption=function(n,i){return new t(n.type,n,n,n.assertion_id,n.retries_left,n.fallback||null,i,!1)},t.fromRegistrationAction=function(n,i){return new t(n.method,n,n,n.assertion_id,null,null,i,!0)},t}(t.authenticationdrivers.AuthenticatorDescriptionImpl),r;i.AuthenticationMenuAuthenticator=u;r=function(t){function i(n,i){var r=t.call(this,n,i)||this;return r._externallyCancelled=!1,r}return __extends(i,t),i.prototype.doRunAction=function(){var n=this;return new Promise(function(t,i){n._completionFunction=t;n._rejectionFunction=i;n.runActionWithCompletionFunctions()})},i.prototype.sendAuthenticatorAssertionRequest=function(t,i,r,u){var f,e;if(this._sdk.log(n.LogLevel.Debug,"Sending authenticator asserion request for "+t.getAuthenticatorId()+": assert="+i),f={assertion_id:t.assertionId,method:t.getAuthenticatorId()},u)for(e in u)f[e]=u[e];return this.sendAssertionRequest(i,r,f)},i.prototype.completeAuthenticationWithAssertionResult=function(n){this._completionFunction(n)},i.prototype.completeAuthenticationWithError=function(n){this._rejectionFunction(n)},i.prototype.prepareForRunningAuthenticationDriver=function(n){return this._externallyCancelled?(this.completeAuthenticationWithError(this._controlFlowProcessor.createExternalCancellationError()),!1):(this._runningAuthenticatorDriver=n,!0)},i.prototype.cancelRun=function(){this._externallyCancelled=!0;this._runningAuthenticatorDriver&&this._runningAuthenticatorDriver.onCancelRun();t.prototype.cancelRun.call(this)},i}(i.SimpleCancellationActionDriver);i.ActionDriverAuthenticatorOp=r})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(r){function u(n,t){return r.call(this,n,t)||this}return __extends(u,r),u.prototype.runActionWithCompletionFunctions=function(){var i=this._action;this._sdk.log(n.LogLevel.Debug,"Loading authenticator descriptions");this.loadAuthenticatorDescriptionsFromAction(i);this._shouldUpdateDefaultAuth=i.options&&i.options.update_default;this._sdk.log(n.LogLevel.Debug,"Starting auth presentation");this.runWithPresentationMode(i.options&&i.options.start_with||t.Protocol.AuthMenuPresentationMode.DefaultAuthenticator)},Object.defineProperty(u.prototype,"availableAuthenticators",{get:function(){return this.updateAvailableAuthenticatorsList(),this._availableAuthenticators.concat([])},enumerable:!0,configurable:!0}),u.prototype.runWithPresentationMode=function(i,r){var f=this,u,e;if(this.updateAvailableAuthenticatorsList(),u=this._uiHandler.shouldIncludeDisabledAuthenticatorsInMenu(this.policyAction(),this._clientContext)?this._allAuthenticators:this._availableAuthenticators,r&&(u=u.filter(function(n){return r.filter(function(t){return t.getAuthenticatorId()==n.getAuthenticatorId()}).length>0})),!u.length){this._allAuthenticators.filter(function(n){return n.getLocked()}).length>0?this.completeAuthenticationWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AllAuthenticatorsLocked,"All authenticators locked.")):this.completeAuthenticationWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.NoRegisteredAuthenticator,"No registered authenticator available."));return}switch(i){case t.Protocol.AuthMenuPresentationMode.AuthenticatorMenu:e=u.map(function(t){return new n.impl.AuthenticationOptionImpl(t,t.suggestedParameters)});this._uiHandler.selectAuthenticator(e,this.policyAction(),this._clientContext).then(function(t){switch(t.getResultType()){case n.AuthenticatorSelectionResultType.Abort:f.completeAuthenticationWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"Cancel during authenticator selection."));break;case n.AuthenticatorSelectionResultType.SelectAuthenticator:var i=e.filter(function(n){return n.getAuthenticator()==t.getSelectedAuthenticator()}).length>0;if(!i){f.completeAuthenticationWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"selectAuthenticator returned an authenticator not within options."));break}if(!t.getSelectedAuthenticator().getEnabled()){f.completeAuthenticationWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"selectAuthenticator returned a non-enabled authenticator."));break}f.runAuthenticator(t.getSelectedAuthenticator(),t.getSelectedAuthenticationParameters())}});break;case t.Protocol.AuthMenuPresentationMode.DefaultAuthenticator:this._defaultAuthenticator&&this._availableAuthenticators.indexOf(this._defaultAuthenticator)>=0?this.runAuthenticator(this._defaultAuthenticator,[]):(this._sdk.log(n.LogLevel.Warning,"Default authenticator for user not found. Falling back to first authenticator in list."),this.runAuthenticator(this._availableAuthenticators[0],[]));break;case t.Protocol.AuthMenuPresentationMode.FirstAuthenticator:this.runAuthenticator(this._availableAuthenticators[0],[])}},u.prototype.loadAuthenticatorDescriptionsFromAction=function(n){var t=this;this._allAuthenticators=n.methods.map(function(n){return i.AuthenticationMenuAuthenticator.fromAuthenticationActionMenuOption(n,t)})},u.prototype.updateAvailableAuthenticatorsList=function(){var t=this;this._defaultAuthenticator=null;this._availableAuthenticators=[];this._allAuthenticators.forEach(function(n){n.getEnabled()&&t._availableAuthenticators.push(n);n.getDefaultAuthenticator()&&(t._defaultAuthenticator=n)});this._defaultAuthenticator||(this._defaultAuthenticator=this._availableAuthenticators[0]);this._sdk.log(n.LogLevel.Debug,"Updated available authenticators list; "+this._availableAuthenticators.length+" available authenticators")},u.prototype.runAuthenticator=function(i,r){var u=this,f=i.authDriver;this.prepareForRunningAuthenticationDriver(f)&&f.runAuthentication(r).then(function(r){if(r instanceof t.authenticationdrivers.AuthenticationDriverSessionResultSwitchAuthenticator)r.requiredAuthenticator?u.runAuthenticator(r.requiredAuthenticator,[]):u.runWithPresentationMode(t.Protocol.AuthMenuPresentationMode.AuthenticatorMenu,r.allowedAuthenticators);else if(r instanceof t.authenticationdrivers.AuthenticationDriverSessionResultAuthenticationCompleted){if(u._shouldUpdateDefaultAuth&&(u._sdk.log(n.LogLevel.Info,"Updating user default authenticator."),!u._controlFlowProcessor._session.anonymous)){var f=u._controlFlowProcessor._session.user;f.updateDefaultAuthId(i.getAuthenticatorId());t.User.save(u._sdk,f)}u.completeAuthenticationWithAssertionResult(r.assertionResult)}else u.completeAuthenticationWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unknown authentication driver result type encountered."))},function(t){u._sdk.log(n.LogLevel.Debug,"Received authentication driver error "+t);u.completeAuthenticationWithError(t)})},u}(i.ActionDriverAuthenticatorOp);i.ActionDriverAuthentication=r})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(i){function r(n,t){return i.call(this,n,t)||this}return __extends(r,i),r.prototype.doRunAction=function(){var r=this,i;return this._sdk.log(n.LogLevel.Debug,"Executing confirmation action."),i=this._action,this._uiHandler.getConfirmationInput(i.title,i.text,i.continue_button_text,i.cancel_button_text,this.policyAction(),this._clientContext).then(function(u){var e={user_cancelled:u.getUserChoice()==1},f=Promise.resolve(e),o,s;return i.require_sign_content&&(o={title:i.title,text:i.text,continue_button_text:i.continue_button_text,cancel_button_text:i.cancel_button_text,parameters:i.parameters,image:i.image},s={params:o,user_input:e.user_cancelled?i.cancel_button_text:i.continue_button_text},f=f.then(function(n){return t.ActionDriverSignContent.augmentAssertionDataWithSignedContent(n,s,r._controlFlowProcessor._session.deviceSigningKeyPair,r._sdk)})),f.then(function(t){return r._sdk.log(n.LogLevel.Debug,"Asserting confirmation: "+t),r.sendAssertionRequest(null,t).then(function(n){return n})})})},r}(t.SimpleCancellationActionDriver);t.ActionDriverConfirmation=i})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(n,t){return i.call(this,n,t)||this}return __extends(r,i),r.prototype.doRunAction=function(){var i=this,r,u;return this._sdk.log(n.LogLevel.Debug,"Executing disable TOTP action..."),r=this._action,u=t.totp.TotpPropertiesProcessor.createWithUser(this._controlFlowProcessor._session.user,this._sdk),this._sdk.log(n.LogLevel.Debug,"Obtained TOTP processor."),r.config_ids.forEach(function(t){i._sdk.log(n.LogLevel.Debug,"Deleting TOTP processor "+t+".");u.deleteProvisionForGenerator(t);i._sdk.log(n.LogLevel.Debug,"TOTP processor "+t+" deleted.")}),this.sendAssertionRequest()},r}(i.SimpleCancellationActionDriver);i.ActionDriverDisableTotp=r})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(t,r){var u=i.call(this,t,r)||this;return u.onPromiseResult=function(t){switch(t.getControlRequest()){case n.FormControlRequest.Submit:var i={input:t.getJsonData()};u.request(i);break;case n.FormControlRequest.Abort:u.session.endSession();u.rejectionFunction(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"User cancelled a form action."))}},u}return __extends(r,i),r.prototype.doRunAction=function(){var i=this,t=this._action;return(this.session=this._uiHandler.createFormSession(t.form_id,t.app_data),!this.session)?Promise.reject(n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createFormSession.")):(this.session.startSession(this._clientContext,new n.impl.PolicyActionImpl(t)),this.session.promiseFormInput().then(this.onPromiseResult),new Promise(function(n,t){i.completionFunction=n;i.rejectionFunction=t}))},r.prototype.request=function(n){var i=this;this.sendAssertionRequest(null,null,n).then(function(n){var r=n.data;switch(n.assertion_error_code){case t.Protocol.AssertionErrorCode.NotFinished:i.session.onContinue(r);i.session.promiseFormInput().then(i.onPromiseResult);break;case t.Protocol.AssertionErrorCode.RepeatCurrentStep:i.session.onError(r);i.session.promiseFormInput().then(i.onPromiseResult);break;default:i.session.endSession();i.completionFunction(n)}}).catch(function(n){i.session.endSession();i.rejectionFunction(n)})},r}(i.SimpleCancellationActionDriver);i.ActionDriverForm=r})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i){return t.call(this,n,i)||this}return __extends(i,t),i.prototype.doRunAction=function(){var i=this,t;return this._sdk.log(n.LogLevel.Debug,"Executing information action."),t=this._action,this._uiHandler.getInformationResponse(t.title,t.text,t.button_text,this.policyAction(),this._clientContext).then(function(t){if(i._sdk.log(n.LogLevel.Debug,"Asserting information"),t.getUserChoice()!=-1)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"ConfirmationInput.getUserChoice must be set to -1.");return i.sendAssertionRequest()})},i}(t.SimpleCancellationActionDriver);t.ActionDriverInformation=i})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i){return t.call(this,n,i)||this}return __extends(i,t),i.prototype.run=function(){var t=this;return this._sdk.log(n.LogLevel.Debug,"Executing JSON data action."),this.sendAssertionRequest().then(function(r){return t._sdk.log(n.LogLevel.Debug,"Executing JSON data action: "+r),i.handleJsonDataByUiHandler(t._uiHandler,r,r.data.json_data,t._policyAction,t._clientContext)})},i.handleJsonDataByUiHandler=function(t,i,r,u,f){return t.processJsonData(r,u,f).then(function(t){if(t.getContinueProcessing())return i;throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"User cancelled a JSON action.");})},i}(t.ActionDriver);t.ActionDriverJsonData=i})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var u=function(){function n(){}return n}(),r;i.Stragety=u;r=function(r){function u(n,t){var i=r.call(this,n,t)||this;return i.isAssertionContainerNotComplete=!1,i}return __extends(u,r),u.prototype.runActionWithCompletionFunctions=function(){var t=this,r;if(this._sdk.log(n.LogLevel.Debug,"ActionDriverPromotion#runActionWithCompletionFunctions() started"),this._action=this._action,this._action.assertions.length<1){this._sdk.log(n.LogLevel.Info,"runActionWithCompletionFunctions() Promotion has no assertions, finishing action.");this.completeWithDeclineAssertion();return}if(!this.shouldDisplayPromotion()){this._sdk.log(n.LogLevel.Info,"runActionWithCompletionFunctions() Promotion stragety stop, finishing action.");this.completeWithDeclineAssertion();return}if(this._session=this._uiHandler.createRegistrationPromotionSession(this._controlFlowProcessor._session.user.name,this._policyAction),!this._session){this._rejectionFunction(n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createRegistrationPromotionSession."));return}this._session.startSession(this._clientContext,new n.impl.PolicyActionImpl(this._action));r=this._action.options;this._session.promptIntroduction(r.title,r.text,r.ok_button,r.decline_button).then(function(n){var u,f,r,e;if(t.handlePromotionInputControlRequest(n)){for(u=t._action.assertions,f=[],r=0;r<u.length;r++)e=i.AuthenticationMenuAuthenticator.fromPromotionAction(u[r],t),e.getSupportedOnDevice()&&f.push(e);t.authenticatorList=f;t.suggestAuthenticators()}})},u.prototype.sendAssertionRequest=function(n,i,u){var f=this;return this.isAssertionContainerNotComplete=!1,r.prototype.sendAssertionRequest.call(this,n,i,u).then(function(n){return n.assertion_error_code==t.Protocol.AssertionErrorCode.AssertionContainerNotComplete&&(n.assertion_error_code=undefined,f.isAssertionContainerNotComplete=!0),n})},u.prototype.suggestAuthenticators=function(){var i=this,r;this.currentAuthentictorSelected&&(r=this.authenticatorList.indexOf(this.currentAuthentictorSelected),this.authenticatorList.splice(r,1),this.currentAuthentictorSelected=null);this._session.setPromotedAuthenticators(this.authenticatorList).then(function(r){var u,f;if(!i.handlePromotionInputControlRequest(r)){i._sdk.log(n.LogLevel.Debug,"suggestAuthenticators() stopped by ControlRequest of type "+r.getControlRequest());return}(u=r.getSelectedAuthenticator(),i.currentAuthentictorSelected=u,f=u.authDriver,i.prepareForRunningAuthenticationDriver(f))&&u.authDriver.runRegistration().then(function(r){r instanceof t.authenticationdrivers.AuthenticationDriverSessionResultAuthenticationCompleted?i.isAssertionContainerNotComplete?(i._sdk.log(n.LogLevel.Debug,"suggestAuthenticators() callback result: promotion not completed. showing list again."),i.suggestAuthenticators()):(i._sdk.log(n.LogLevel.Debug,"suggestAuthenticators() callback result: promotion completed. finishing"),i.completeAuthenticationWithAssertionResult(r.assertionResult)):(i._sdk.log(n.LogLevel.Error,"suggestAuthenticators() unexpected callback result: stopping with error. result constructor: '"+r.constructor.toString()+"'"),i.completeAuthenticationWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unknown authentication driver result type encountered during registration.")))},function(t){i._sdk.log(n.LogLevel.Error,"suggestAuthenticators() error callback result: stopping with error. error: '"+t._data+"'");i.completeAuthenticationWithError(t)})})},u.prototype.handlePromotionInputControlRequest=function(t){if(t.isControlRequest())switch(t.getControlRequest()){case n.PromotionControlRequest.Continue:return!0;case n.PromotionControlRequest.Skip:return this.completeWithDeclineAssertion(),!1;case n.PromotionControlRequest.Abort:return this.completeAuthenticationWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"User aborted/canceled")),!1;default:return this._sdk.log(n.LogLevel.Warning,"handlePromotionInputControlRequest() received invalid PromotionInput, unsupported ControlRequest"),!1}else return!0},u.prototype.sendDeclineAssertion=function(){return this.sendAssertionRequest(u.ASSERT_DECLINE)},u.prototype.completeWithDeclineAssertion=function(){var n=this;this.sendDeclineAssertion().then(function(t){n.completeAuthenticationWithAssertionResult(t)}).catch(function(t){n.completeAuthenticationWithError(t)})},u.prototype.completeAuthenticationWithAssertionResult=function(n){this._session&&this._session.endSession();r.prototype.completeAuthenticationWithAssertionResult.call(this,n)},u.prototype.completeAuthenticationWithError=function(n){this._session.endSession();r.prototype.completeAuthenticationWithError.call(this,n)},Object.defineProperty(u.prototype,"availableAuthenticators",{get:function(){return this._availableAuthenticators.concat([])},enumerable:!0,configurable:!0}),u.prototype.shouldDisplayPromotion=function(){var c=this._sdk.host,i=new t.TarsusKeyPath("stragety"),r=c.readStorageKey(i),s,f,u,e,o,h;if(r.days==null||r.logins==null)return this._sdk.log(n.LogLevel.Debug,"shouldDisplayPromotion() first promotion. Stored data was empty."),this.updateStrategy(i,1),!0;for(s=this._action.options.strategies,f=!0,u=0,e=s;u<e.length;u++)if(o=e[u],this.checkStrategy(o,r,i)==!1){this._sdk.log(n.LogLevel.Debug,"shouldDisplayPromotion() strategy stopped promotion. strategy type: "+o.type);f=!1;break}return h=r.logins+1,this.updateStrategy(i,h),f},u.prototype.updateStrategy=function(n,t){var i={days:(new Date).getTime(),logins:t};this._sdk.host.writeStorageKey(n,i)},u.prototype.checkStrategy=function(n,i){var f=this._sdk.host,u,r;return n.type==t.Protocol.PromotionStrategyFrequency.LOGINS?i.logins%n.value==0:n.type==t.Protocol.PromotionStrategyFrequency.DAYS?(u=new Date,r=new Date,r.setTime(i.days),u.getDate()+n.value>=r.getDate()):!1},u.ASSERT_DECLINE="decline",u.ACTION_REGISTRATION="registration",u.ACTION_PROMOTION="registration_promotion",u}(i.ActionDriverAuthenticatorOp);i.ActionDriverPromotion=r})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(n,t){return i.call(this,n,t)||this}return __extends(r,i),r.prototype.doRunAction=function(){var u=this,i,r;return(this._sdk.log(n.LogLevel.Debug,"Executing provision TOTP action."),this._cfmAction=this._action,i=t.totp.TotpPropertiesProcessor.createWithUser(this._controlFlowProcessor._session.user,this._sdk),r=i.createTotpDriver(this._cfmAction.generator,this._cfmAction.otp_type),!r)?(this._sdk.log(n.LogLevel.Error,"failed to create TOTP driver"),Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"failed to create TOTP driver"))):(i.deleteProvisionForGenerator(this._cfmAction.generator),r.promiseProvisionOutput(this._cfmAction,this.policyAction(),this._clientContext,this._uiHandler).then(function(n){return u.sendAssertionRequest(null,n.getAssertionData()).then(function(t){return n.finalize(t),i.updateWithProvisionedGenerator(u._cfmAction,n),t})}))},r}(i.SimpleCancellationActionDriver);i.ActionDriverProvisionTotp=r})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(r){function u(n,t){return r.call(this,n,t)||this}return __extends(u,r),u.prototype.runActionWithCompletionFunctions=function(){var u=this,f=this._action,r,e,o;for(this._sdk.log(n.LogLevel.Debug,"Loading and validating authenticator description"),r=0;r<f.assertions.length;r++)if(e=i.AuthenticationMenuAuthenticator.fromRegistrationAction(f.assertions[r],this),e.getSupportedOnDevice()){this._registeredAuthenticator=e;this._silentRegistration=!!f.assertions[r].silent;break}if(!this._registeredAuthenticator){this.completeAuthenticationWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"No supported authenticator listed in registeration request."));return}(o=this._registeredAuthenticator.authDriver,this.prepareForRunningAuthenticationDriver(o))&&(this._sdk.log(n.LogLevel.Debug,"Starting auth registeration"),o.runRegistration().then(function(i){i instanceof t.authenticationdrivers.AuthenticationDriverSessionResultAuthenticationCompleted?u.completeAuthenticationWithAssertionResult(i.assertionResult):u.completeAuthenticationWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unknown authentication driver result type encountered during registration."))},function(t){u._sdk.log(n.LogLevel.Debug,"Received authentication driver error "+t);u.completeAuthenticationWithError(t)}))},Object.defineProperty(u.prototype,"availableAuthenticators",{get:function(){return[this._registeredAuthenticator]},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isSilentRegistration",{get:function(){return this._silentRegistration},enumerable:!0,configurable:!0}),u}(i.ActionDriverAuthenticatorOp);i.ActionDriverRegistration=r})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i){return t.call(this,n,i)||this}return __extends(i,t),i.prototype.run=function(){var t=this;return this._sdk.log(n.LogLevel.Debug,"Executing scan qr action."),new Promise(function(i,r){var u=t._action,f=n.QrCodeFormat.Alphanumeric;if(u.qr_code_format_type&&(f=n.QrCodeFormatImpl.fromAssertionFormat(u.qr_code_format_type)),t._session=t._uiHandler.createScanQrSession(t._policyAction,t._clientContext),!t._session)throw n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createScanQrSession.");t._session.startSession(t._clientContext,new n.impl.PolicyActionImpl(t._action));t._session.getScanQrResponse(u.instructions,f).then(function(u){if(u.isControlRequest())return t.processControlRequest(u.getControlRequest()).then(function(){});var e=u.getResponse(),f={qr_content:e.getQrCodeResult().getQrCode()};t._sdk.log(n.LogLevel.Debug,"Asserting scan qr: "+f.qr_content);t.sendAssertionRequest(null,f).then(function(n){i(n)}).catch(function(i){t._sdk.log(n.LogLevel.Error,"Scan qr sendAssertionRequest error: "+i);t._session.endSession();r(i)})}).finally(function(){t._session.endSession()}).catch(function(i){t._sdk.log(n.LogLevel.Error,"Scan qr action error: "+i);r(i)})})},i.prototype.processControlRequest=function(t){var i=this;return new Promise(function(r,u){i._sdk.log(n.LogLevel.Debug,"Processing control request "+t.getRequestType());switch(t.getRequestType()){case n.ControlRequestType.CancelAuthenticator:u(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"Scan qr code action canceled by user."));break;default:throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Unsupported control request: "+t.getRequestType()+" for scan qr action.");}})},i}(t.ActionDriver);t.ActionDriverScanQr=i})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i){return t.call(this,n,i)||this}return __extends(i,t),i.augmentAssertionDataWithSignedContent=function(t,i,r,u){var f=JSON.stringify(i),e;return u.log(n.LogLevel.Debug,"Signing consent payload: "+f),e=n.util.asciiToHex(f),r.signHex(e).then(function(i){var r=n.util.hexToBase64(i),u={payload:f,signed_payload:r};return t.sign_content_data=u,t})},i.prototype.run=function(){var u=this;this._sdk.log(n.LogLevel.Debug,"Executing consent action.");var f=this._controlFlowProcessor.initiatingRequest.body,r={params:f.params||{}},t=this._controlFlowProcessor.approval;return t&&(r.approval={approval_id:t.getApprovalId(),message:{title:t.getTitle(),details:t.getDetails()}}),i.augmentAssertionDataWithSignedContent({},r,this._controlFlowProcessor._session.deviceSigningKeyPair,this._sdk).then(function(n){return u.sendAssertionRequest(null,n)})},i}(t.ActionDriver);t.ActionDriverSignContent=i})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i){return t.call(this,n,i)||this}return __extends(i,t),i.prototype.doRunAction=function(){var t=this;return this._sdk.log(n.LogLevel.Debug,"Executing ticket wait action."),new Promise(function(i,r){var u=t._action;if(t._session=t._uiHandler.createTicketWaitSession(t._policyAction,t._clientContext),!t._session)throw n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTicketWaitSession.");t._session.setWaitingTicket(new n.impl.TicketWaitingInformationImpl(u));t._session.startSession(new n.impl.PolicyActionImpl(t._action),t._clientContext);t.pollServer().then(function(n){i(n)}).finally(function(){t._session.endSession()}).catch(function(i){t._sdk.log(n.LogLevel.Error,"Wait for ticket action error: "+i);r(i)})})},i.prototype.pollServer=function(){var t=this;return this._sdk.log(n.LogLevel.Debug,"Asserting ticket wait poll"),this.sendAssertionRequest(null,{}).then(function(n){return n.assertion_error_code==13?t.inputLoop(n):n})},i.prototype.inputLoop=function(t){var i=this;return this._session.promiseInput().then(function(r){if(r.isControlRequest())return i.processControlRequest(r.getControlRequest()).then(function(){return t});var u=r.getResponse();if(u instanceof n.TicketWaitInputPollRequest)return i.pollServer();throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Expected polling request input response but got: "+u);})},i.prototype.processControlRequest=function(t){var i=this;return new Promise(function(r,u){i._sdk.log(n.LogLevel.Debug,"Processing control request "+t.getRequestType());switch(t.getRequestType()){case n.ControlRequestType.CancelAuthenticator:case n.ControlRequestType.AbortAuthentication:u(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"Wait for ticket action canceled by user."));break;default:throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Unsupported control request: "+t.getRequestType()+" for ticket wait action.");}})},i}(t.SimpleCancellationActionDriver);t.ActionDriverTicketWait=i})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(i){function r(n,t){return i.call(this,n,t)||this}return __extends(r,i),r.prototype.runActionWithCompletionFunctions=function(){this._action=this._action;this._sdk.log(n.LogLevel.Debug,"Started unregister action!");var i=t.AuthenticationMenuAuthenticator.fromUnregistrationAction(this._action,this);i.authDriver.runUnregistration().then(this._completionFunction,this._rejectionFunction)},Object.defineProperty(r.prototype,"availableAuthenticators",{get:function(){return this._availableAuthenticators.concat([])},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isSilentRegistration",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isPlaceholder",{get:function(){return this._action.method.indexOf("placeholder")==0},enumerable:!0,configurable:!0}),r.prototype.sendUnregisterAssertion=function(){return this.sendAssertionRequest()},r}(t.ActionDriverAuthenticatorOp);t.ActionDriverUnregistration=i})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(i){var r;(function(r){var u=function(i){function r(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.run=function(){var i=this;return this._sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.DyadicPresent)=="false"?Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Dyadic capability is not present (is Dyadic SDK integrated?)")):this.issueDyadicRequest().then(function(n){return i.sendAssertionRequest(null,i.buildAssertionData(n)).then(function(r){var u=i.dyadicServerResponseFromAssertionResponse(r);return u?n.finalize(u).then(function(){return r}):Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Dyadic data missing from server response"))})})},r.prototype.dyadicServerResponseFromAssertionResponse=function(n){var t=n.data&&n.data.dyadic;return t&&t.server_response},r.prototype.buildAssertionData=function(n){var r={requestData:"request_data",requestPayload:"request_payload",proxyPayload:"proxy_payload"},t=n.getServerRequest(),i;return Object.keys(r).forEach(function(n){var u=r[n],i;t[u]=t[n];delete t[n];i=t[u];i&&(i.original_data=i.originalData,delete i.originalData)}),i={dyadic:t},i.dyadic.token_uid=n.getTokenId()||this._controlFlowProcessor._session.deviceId(),i},r}(i.ActionDriver);r.ActionDriverDyadic=u})(r=i.dyadic||(i.dyadic={}))})(r=i.actiondrivers||(i.actiondrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.issueDyadicRequest=function(){var n=this._action,t=this._controlFlowProcessor._session.user.name;return this._sdk.host.dyadicEnroll(t,n.server_info)},t}(n.ActionDriverDyadic);n.ActionDriverDyadicEnroll=t})(t=n.dyadic||(n.dyadic={}))})(t=n.actiondrivers||(n.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function n(){}return n.prototype.getServerRequest=function(){return this._serverRequest},n.prototype.getTokenId=function(){return this._signHandle.getTokenId()},n.prototype.finalize=function(n){var r=this,t=n,i=this._signHandle.finalize(t.server_response);return t.otp_token_refresh&&Object.keys(t.otp_token_refresh).forEach(function(n){i=i.then(function(){return r._refreshTokenHandles[n].finalize(t.otp_token_refresh[n])})}),i},n.create=function(t,i,r){var u=new n;return u._refreshTokenHandles=t,u._signHandle=i,u._serverRequest=r,u},n}(),r=function(t){function r(){return t!==null&&t.apply(this,arguments)||this}return __extends(r,t),r.prototype.issueDyadicRequest=function(){var r=this,t=this._action,u=n.util.asciiToHex(t.assertion_id+this._controlFlowProcessor.challenge);return this._sdk.host.dyadicSign(u).then(function(n){var e={},u=n.getServerRequest(),f=Promise.resolve(!0);return t.otp_token_uids&&0<t.otp_token_uids.length&&(u.otp_token_refresh={},t.otp_token_uids.forEach(function(n){f=f.then(function(){return r._sdk.host.dyadicRefreshToken(n).then(function(t){return e[n]=t,u.otp_token_refresh[n]=t.getServerRequest(),!0})})})),f.then(function(){return i.create(e,n,u)})})},r.prototype.dyadicServerResponseFromAssertionResponse=function(n){return n.data&&n.data.dyadic},r}(t.ActionDriverDyadic);t.ActionDriverDyadicSign=r})(i=t.dyadic||(t.dyadic={}))})(i=t.actiondrivers||(t.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.issueDyadicRequest=function(){return this._sdk.host.dyadicDelete()},t}(n.ActionDriverDyadic);n.ActionDriverDyadicDelete=t})(t=n.dyadic||(n.dyadic={}))})(t=n.actiondrivers||(n.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n.ActionDrivers={confirmation:n.ActionDriverConfirmation,information:n.ActionDriverInformation,json_data:n.ActionDriverJsonData,authentication:n.ActionDriverAuthentication,registration:n.ActionDriverRegistration,unregistration:n.ActionDriverUnregistration,provision_totp:n.ActionDriverProvisionTotp,disable_totp:n.ActionDriverDisableTotp,sign_content:n.ActionDriverSignContent,form:n.ActionDriverForm,registration_promotion:n.ActionDriverPromotion,scan_qr:n.ActionDriverScanQr,wait_for_ticket:n.ActionDriverTicketWait,dyadic_enroll:n.dyadic.ActionDriverDyadicEnroll,dyadic_sign:n.dyadic.ActionDriverDyadicSign,dyadic_un_enroll:n.dyadic.ActionDriverDyadicDelete}})(t=n.actiondrivers||(n.actiondrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u=function(){function u(n,t,i){this._externalCancelled=!1;this._actionDriver=n;this._authenticatorConfig=t;this._authenticatorDescription=i;this._sdk=n._sdk;this._uiHandler=n._uiHandler;this._clientContext=n._clientContext}return u.prototype.runAuthentication=function(n){return this._authenticationParameters=n,this.runMode(t.AuthenticatorSessionMode.Authentication)},u.prototype.runRegistration=function(){var i=this._actionDriver,n;return i.isSilentRegistration?(n=this,r.instanceOfAuthenticationDriverSilentRegistrationSupport(this)?(n._sdk.log(t.LogLevel.Debug,"Invoking silent registration for "+n._authenticatorDescription.getAuthenticatorId()),this.runSilentRegistration()):Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorError,"Silent registration not supported for this authenticator"))):this.runMode(t.AuthenticatorSessionMode.Registration)},u.prototype.runUnregistration=function(){var i=this,n=this._actionDriver;return this._sdk.currentUiHandler.handleAuthenticatorUnregistration(this._authenticatorDescription,n.isPlaceholder,n.policyAction(),this._clientContext).then(function(r){if(i._sdk.log(t.LogLevel.Debug,"handleAuthenticatorUnregistration() result: "+r),r.getUserChoice()==0)return n.sendUnregisterAssertion();var u=new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Unregistration failed due to app implimentation rejecting unregistertion.");return Promise.reject(u)})},u.prototype.onCancelRun=function(){this._externalCancelled=!0},Object.defineProperty(u.prototype,"user",{get:function(){return this._actionDriver._controlFlowProcessor._session.user},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"operationMode",{get:function(){return this._operationMode},enumerable:!0,configurable:!0}),u.prototype.completeAuthenticatorSessionWithResult=function(n){this._inputSession&&this._inputSession.endSession();this._completionFunction(n)},u.prototype.completeAuthenticatorSessionWithError=function(n){if(this._inputSession)try{this._inputSession.endSession()}catch(i){this._sdk.log(t.LogLevel.Warning,"Can't dismiss authenticator session during error reporting.")}this._rejectionFunction(n)},u.prototype.handleInputOrControlResponse=function(n){try{n.isControlRequest()?this.processControlRequest(n.getControlRequest()):this._operationMode==t.AuthenticatorSessionMode.Authentication?this.handleAuthenticationInputResponse(n.getResponse()):this.handleRegistrationInputResponse(n.getResponse())}catch(i){this.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))}},u.prototype.processRegisterAssertion=function(n,i){var u=this;this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"register",n,i).then(function(n){u.handleRegisterAssertionResult(n)||(u._sdk.log(t.LogLevel.Info,"Registration session done."),u.completeAuthenticatorSessionWithResult(new r.AuthenticationDriverSessionResultAuthenticationCompleted(n)))}).catch(function(n){u._sdk.log(t.LogLevel.Error,"Perform error recovery with server error "+n);u.performErrorRecoveryForError(n)})},u.prototype.processAuthenticateAssertion=function(n,i){var u=this;this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"authenticate",n,i).then(function(n){u.handleAuthenticateAssertionResult(n)||(u._sdk.log(t.LogLevel.Info,"Authenticator session done."),u.completeAuthenticatorSessionWithResult(new r.AuthenticationDriverSessionResultAuthenticationCompleted(n)))}).catch(function(n){u._sdk.log(t.LogLevel.Error,"Perform error recovery with server error "+n);u.performErrorRecoveryForError(n)})},u.prototype.runMode=function(n){var i=this;return new Promise(function(r,u){if(i._completionFunction=r,i._rejectionFunction=u,i._operationMode=n,i._inputSession=i.createAuthenticatorSession(),!i._inputSession)throw t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from authenticator session creation call.");i._inputSession.startSession(i._authenticatorDescription,i._operationMode,i._actionDriver.policyAction(),i._clientContext);i.authOrRegInStartedSession(!1)}).catch(function(n){throw t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n);})},u.prototype.handleGeneralAssertionResult=function(n){return(this._sdk.log(t.LogLevel.Debug,"Authenticator assertion response "+JSON.stringify(n)),n.data&&(this._sdk.log(t.LogLevel.Debug,"Processing authenticator assertion response: updating assertion authenticator description"),this._authenticatorDescription.updateWithAssertionResult(n.data)),n.state!=i.Protocol.AuthSessionState.Pending)?(this._sdk.log(t.LogLevel.Info,"Authenticator session complete; status "+n.state),this.completeAuthenticatorSessionWithResult(new r.AuthenticationDriverSessionResultAuthenticationCompleted(n)),!0):!1},u.prototype.handleRegisterAssertionResult=function(n){return this.handleGeneralAssertionResult(n)?!0:n.assertion_error_code?(this._sdk.log(t.LogLevel.Error,"handleRegisterAssertionResult() Assertion error encoutered. Starting error recovery."),this.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.errorForAssertionResponse(n)),!0):!1},u.prototype.handleAuthenticateAssertionResult=function(n){if(this.handleGeneralAssertionResult(n))return!0;if(n.assertion_error_code)switch(n.assertion_error_code){case i.Protocol.AssertionErrorCode.MustRegister:return this._sdk.log(t.LogLevel.Info,"handleAuthenticateAssertionResult() Authenticator expired; must register"),this.handleRegistrationDueToExpiration(),!0;case i.Protocol.AssertionErrorCode.FailOver:return this._sdk.log(t.LogLevel.Info,"handleAuthenticateAssertionResult() Failover signalled"),this.handleFallback(),!0;default:return this._sdk.log(t.LogLevel.Error,"handleAuthenticateAssertionResult() Assertion error encoutered. Starting error recovery. 2"),this.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.errorForAssertionResponse(n)),!0}else if(this._authenticatorDescription.getExpired())return this._sdk.log(t.LogLevel.Info,"Authenticator expired; must register"),this.handleRegistrationDueToExpiration(),!0;return!1},u.prototype.processAuthFailureAssertionAndHandleError=function(n,r){var u=this,f={num_of_failures:r};this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"auth_failure",f).then(function(r){var e,f;if(!u.handleGeneralAssertionResult(r)){if(r.assertion_error_code)switch(r.assertion_error_code){case i.Protocol.AssertionErrorCode.FailOver:u._sdk.log(t.LogLevel.Info,"Failover signalled during local failure report");u.handleFallback();return}if(r.data){e={};for(f in n.getData())e[f]=n.getData()[f];for(f in r.data)e[f]=r.data[f];n=new t.impl.AuthenticationErrorImpl(n.getErrorCode(),n.getMessage(),e)}u.performErrorRecoveryForError(n)}},function(n){var i=t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n);u._sdk.log(t.LogLevel.Error,"Error ${authError} signalled during local failure report");u.performErrorRecoveryForError(i,!0)})},u.prototype.handleRegistrationDueToExpiration=function(){this._inputSession.changeSessionModeToRegistrationAfterExpiration();this._operationMode=t.AuthenticatorSessionMode.Registration;this.registerInStartedSession(!1)},u.prototype.authOrRegInStartedSession=function(n){this._operationMode==t.AuthenticatorSessionMode.Authentication?this.authenticateInStartedSession(n):this.registerInStartedSession(n)},u.prototype.processControlRequest=function(n){this._sdk.log(t.LogLevel.Debug,"Processing control request "+n.getRequestType());switch(n.getRequestType()){case t.ControlRequestType.AbortAuthentication:this.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"Authentication cancelled due to abort control request."));break;case t.ControlRequestType.ChangeMethod:this.completeAuthenticatorSessionWithResult(new r.AuthenticationDriverSessionResultSwitchAuthenticator(null,this.getAuthenticationActionOtherAuthenticators()));break;case t.ControlRequestType.SelectMethod:this.completeAuthenticatorSessionWithResult(new r.AuthenticationDriverSessionResultSwitchAuthenticator);break;case t.ControlRequestType.CancelAuthenticator:this.invokeUiHandlerCancellation();break;case t.ControlRequestType.RetryAuthenticator:this.authOrRegInStartedSession(!0);break;default:this.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Invalid ControlRequestType value during authentication session."))}},u.prototype.invokeUiHandlerCancellation=function(){var i=this,n;if(this._externalCancelled){this.processControlRequest(t.ControlRequest.create(t.ControlRequestType.AbortAuthentication));return}n=[];switch(this._operationMode){case t.AuthenticatorSessionMode.Authentication:n=[t.ControlRequestType.RetryAuthenticator,t.ControlRequestType.AbortAuthentication];this.getAuthenticationActionOtherAuthenticators().length>0&&n.push(t.ControlRequestType.ChangeMethod);this._actionDriver.availableAuthenticators.length>0&&n.push(t.ControlRequestType.SelectMethod);break;case t.AuthenticatorSessionMode.Registration:n=[t.ControlRequestType.RetryAuthenticator,t.ControlRequestType.AbortAuthentication]}this._uiHandler.controlOptionForCancellationRequestInSession(n,this._inputSession).then(function(r){if(r.getRequestType()==t.ControlRequestType.CancelAuthenticator){i.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned CancelAuthenticator which is an invalid option."));return}if(n.indexOf(r.getRequestType())<0){i.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned an invalid option."));return}i.processControlRequest(r)})},u.prototype.getAuthenticationActionOtherAuthenticators=function(){var n=this;return this._actionDriver.availableAuthenticators.filter(function(t){return t!=n._authenticatorDescription})},u.prototype.handleFallback=function(){var n=this;if(this._authenticatorDescription.fallback){var i=[t.AuthenticatorFallbackAction.Retry,t.AuthenticatorFallbackAction.Cancel],u=null,f=this._authenticatorDescription.fallback.method;f?(u=this._actionDriver.availableAuthenticators.filter(function(n){return n.getAuthenticatorId()==f})[0],u&&i.push(t.AuthenticatorFallbackAction.Fallback)):this.getAuthenticationActionOtherAuthenticators().length>0&&i.push(t.AuthenticatorFallbackAction.AuthMenu);this._uiHandler.selectAuthenticatorFallbackAction(i,u,this._inputSession,this._actionDriver.policyAction(),this._clientContext).then(function(f){n._sdk.log(t.LogLevel.Debug,"Fallback action selected "+f);i.indexOf(f)<0&&(n._sdk.log(t.LogLevel.Error,"Invalid fallback action selected: "+f+" not in "+i),n.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid fallback action selected by callback.")));switch(f){case t.AuthenticatorFallbackAction.Fallback:n.completeAuthenticatorSessionWithResult(new r.AuthenticationDriverSessionResultSwitchAuthenticator(u));break;case t.AuthenticatorFallbackAction.AuthMenu:n.completeAuthenticatorSessionWithResult(new r.AuthenticationDriverSessionResultSwitchAuthenticator(u));break;case t.AuthenticatorFallbackAction.Retry:n.authOrRegInStartedSession(!0);break;case t.AuthenticatorFallbackAction.Cancel:n.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"User cancel in response to fallback action."))}})}else this.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Cannot handle a fallback error without fallback specification in action."))},u.prototype.recoveryOptionsForError=function(n,i){var r=[t.AuthenticationErrorRecovery.Fail];return[t.AuthenticationErrorCode.AllAuthenticatorsLocked,t.AuthenticationErrorCode.AppImplementation,t.AuthenticationErrorCode.ControlFlowExpired,t.AuthenticationErrorCode.SessionRequired,t.AuthenticationErrorCode.InvalidDeviceBinding,t.AuthenticationErrorCode.UserCanceled].indexOf(n.getErrorCode())>=0?r:(i||!this._authenticatorDescription.getEnabled()||this._operationMode==t.AuthenticatorSessionMode.Authentication&&n.getErrorCode()==t.AuthenticationErrorCode.AuthenticatorExternalConfigError||r.push(t.AuthenticationErrorRecovery.RetryAuthenticator),this._operationMode==t.AuthenticatorSessionMode.Authentication&&(this.getAuthenticationActionOtherAuthenticators().length>0&&r.push(t.AuthenticationErrorRecovery.ChangeAuthenticator),this._actionDriver.availableAuthenticators.length>0&&r.push(t.AuthenticationErrorRecovery.SelectAuthenticator)),r)},u.prototype.performErrorRecoveryForError=function(i,r){var u=this,o={};o[n.sdkhost.ErrorDataRetriesLeft]=this._authenticatorDescription.retriesLeft;var s=t.impl.AuthenticationErrorImpl.augmentErrorData(i,o),f=this.recoveryOptionsForError(i,r),e=this.defaultRecoveryForError(i);f.indexOf(e)<0&&(e=f.indexOf(t.AuthenticationErrorRecovery.SelectAuthenticator)>=0?t.AuthenticationErrorRecovery.SelectAuthenticator:t.AuthenticationErrorRecovery.Fail);this._inputSession.promiseRecoveryForError(i,f,e).then(function(n){u._sdk.log(t.LogLevel.Debug,"Error recovery selected "+n);u._sdk.log(t.LogLevel.Debug,"recover from error: "+i.getErrorCode());f.indexOf(n)<0&&(u._sdk.log(t.LogLevel.Error,"Invalid error recovery option from callback: "+n+" not in "+f),u.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid error recovery action selected by callback.")));u.handleErrorRecoveryAction(n,i)})},u.prototype.handleErrorRecoveryAction=function(n,i){switch(n){case t.AuthenticationErrorRecovery.RetryAuthenticator:this.authOrRegInStartedSession(!0);break;case t.AuthenticationErrorRecovery.ChangeAuthenticator:this.completeAuthenticatorSessionWithResult(new r.AuthenticationDriverSessionResultSwitchAuthenticator(null,this.getAuthenticationActionOtherAuthenticators()));break;case t.AuthenticationErrorRecovery.SelectAuthenticator:this.completeAuthenticatorSessionWithResult(new r.AuthenticationDriverSessionResultSwitchAuthenticator);break;case t.AuthenticationErrorRecovery.Fail:default:this.completeAuthenticatorSessionWithError(i)}},u.prototype.defaultRecoveryForError=function(n){return this._operationMode==t.AuthenticatorSessionMode.Authentication?!this._authenticatorDescription.getLocked()&&this._authenticatorDescription.getRegistered()&&this._authenticatorDescription.getEnabled()&&n.getErrorCode()!=t.AuthenticationErrorCode.AuthenticatorLocked&&n.getErrorCode()!=t.AuthenticationErrorCode.AllAuthenticatorsLocked?t.AuthenticationErrorRecovery.RetryAuthenticator:n.getErrorCode()!=t.AuthenticationErrorCode.AllAuthenticatorsLocked?t.AuthenticationErrorRecovery.ChangeAuthenticator:t.AuthenticationErrorRecovery.Fail:t.AuthenticationErrorRecovery.RetryAuthenticator},u}();r.AuthenticationDriver=u})(r=i.authenticationdrivers||(i.authenticationdrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i,r){return t.call(this,n,i,r)||this}return __extends(i,t),i.prototype.authenticateInStartedSession=function(){var t=this;this._inputSession.promiseInput().then(function(n){return t.handleInputOrControlResponse(n)},function(i){return t.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},i.prototype.registerInStartedSession=function(){var t=this;this._inputSession.promiseInput().then(function(n){return t.handleInputOrControlResponse(n)},function(i){return t.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},i.prototype.handleAuthenticationInputResponse=function(t){try{var r=this.generateAssertionDataForInputResponse(t)}catch(i){this.performErrorRecoveryForError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i));return}this.processAuthenticateAssertion(this.generateAssertionDataForInputResponse(t))},i.prototype.handleRegistrationInputResponse=function(t){try{var i=this.generateAssertionDataForInputResponse(t)}catch(r){this.performErrorRecoveryForError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(r));return}this.processRegisterAssertion(i)},i.prototype.generateAssertionDataForInputResponse=function(n){var t=this.generateSecretToSignForInputResponse(n);return{secret:t}},i}(t.AuthenticationDriver);t.AuthenticationDriverCentralizedSecretInputBased=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(){function i(n){this._authenticationDriverCtor=n}return i.prototype.createAuthenticationDriver=function(n,t,i){return new this._authenticationDriverCtor(n,t,i)},i.prototype.evaluateLocalRegistrationStatus=function(){return n.AuthenticatorRegistrationStatus.Registered},i.prototype.isSupportedOnDevice=function(){return!0},i.prototype.suggestParameters=function(){return[]},i.refreshInvalidatedAuthenticatorsEnrollments=function(n){return new Promise(function(i,r){var u,f=[],e,o;for(e in n.user.localEnrollments)u=n.user.localEnrollments[e],o=t.AuthenticatorDrivers[u.authenticatorId],f.push(o.checkAuthenticatorInvalidatedAndNotifyUIHandler(n));Promise.all(f).then(function(n){i(n)}).catch(function(n){r(n)})})},i.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(){return Promise.resolve(!0)},i}();t.SimpleAuthenticationDriverDescriptor=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(n){function i(){return n!==null&&n.apply(this,arguments)||this}return __extends(i,n),i.prototype.getEnabled=function(){return this.getSupportedOnDevice()},i.getDescription=function(n,r){var u={status:t.Protocol.AuthenticationMethodStatus.Unregistered};return new i(n,r,{},u)},i}(i.AuthenticatorDescriptionImpl),u=function(u){function f(n,t){var i=u.call(this,n)||this;return i._authenticatorType=t,i}return __extends(f,u),f.prototype.evaluateLocalRegistrationStatus=function(i){var r=i.user.localEnrollments[this._authenticatorType];return r?r.validationStatus==t.LocalEnrollmentValidationStatus.Invalidated?n.AuthenticatorRegistrationStatus.LocallyInvalid:n.AuthenticatorRegistrationStatus.Registered:n.AuthenticatorRegistrationStatus.LocallyInvalid},f.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(u){var f=this;return new Promise(function(e,o){var s,h,c;u.sdk.log(n.LogLevel.Info,"Checking if authenticator "+f._authenticatorType+" has become invalidated.");s=u.user.localEnrollments[f._authenticatorType];s.status==t.LocalEnrollmentStatus.Registered&&s.validationStatus!=t.LocalEnrollmentValidationStatus.Invalidated?(h=i.AuthenticatorDrivers[f._authenticatorType],h.evaluateLocalRegistrationStatus(u)==n.AuthenticatorRegistrationStatus.LocallyInvalid?(u.sdk.log(n.LogLevel.Info,"Authenticator "+f._authenticatorType+" already became invalidated. Invalidating enrollment record and notifying ui handler."),c=r.getDescription(u,s.authenticatorId),t.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(u,c).then(function(n){e(n)}).catch(function(n){o(n)})):e(!1)):e(!1)})},f}(i.SimpleAuthenticationDriverDescriptor);i.AuthenticationDriverDescriptorLocal=u})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(i){function r(){return i.call(this,t.AuthenticationDriverFace)||this}return __extends(r,i),r.prototype.isSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.ImageAcquitisionSupported)=="true"},r}(t.SimpleAuthenticationDriverDescriptor);t.AuthenticationDriverDescriptorFace=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(i){function r(n){var r=i.call(this,t.AuthenticationDriverFido)||this;return r._fidoPolicy=n,r}return __extends(r,i),r.prototype.isSupportedOnDevice=function(i){i.sdk.log(n.LogLevel.Debug,"Check FIDO authenticator support for "+JSON.stringify(this._fidoPolicy));var r=t.AuthenticationDriverFido.hasEligibleClientProvidersForPolicy(i.sdk,this._fidoPolicy);return r||i.sdk.log(n.LogLevel.Info,"Encountered non-supported FIDO request."),r},r.prototype.evaluateLocalRegistrationStatus=function(){return n.AuthenticatorRegistrationStatus.Registered},r}(t.SimpleAuthenticationDriverDescriptor);t.AuthenticationDriverDescriptorFido=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(i){var r=function(r){function u(){return r.call(this,i.AuthenticationDriverFingerprint,u.authenticatorName)||this}return __extends(u,r),u.prototype.evaluateLocalRegistrationStatus=function(f){var e=r.prototype.evaluateLocalRegistrationStatus.call(this,f);if(e!=t.AuthenticatorRegistrationStatus.Registered)return e;var o=f.user.localEnrollments[u.authenticatorName],h=i.AuthenticationDriverFingerprint.authenticatorKeyTagForUser(f.user,o.version,o.salt),s=f.sdk.host.getKeyPair(h,n.sdkhost.KeyClass.StdSigningKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(s)s.closeKeyPair();else return t.AuthenticatorRegistrationStatus.LocallyInvalid;return t.AuthenticatorRegistrationStatus.Registered},u.prototype.isSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.FingerprintSupported)=="true"},u.authenticatorName="fingerprint",u}(i.AuthenticationDriverDescriptorLocal);i.AuthenticationDriverDescriptorFingerprint=r})(r=i.authenticationdrivers||(i.authenticationdrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(){function n(n,t){this._targetIdentifier=n;this._description=t}return n.prototype.getDescription=function(){return this._description},n.prototype.getDeviceIdentifier=function(){return this._targetIdentifier},n.__tarsusInterfaceName="MobileApproveTarget",n}(),r;t.MobileApproveTargetImpl=i;r=function(){function r(){}return r.prototype.evaluateLocalRegistrationStatus=function(){return n.AuthenticatorRegistrationStatus.Registered},r.prototype.isSupportedOnDevice=function(){return!0},r.prototype.suggestParameters=function(t){return r.createTargetsFromConfig(t).map(function(t){return n.AuthenticationActionParameterTargetSelection.create(t)})},r.prototype.createAuthenticationDriver=function(n,i,r){return new t.AuthenticationDriverMobileApprove(n,i,r)},r.createTargetsFromConfig=function(n){var t=n;return t.selectable_devices.map(function(n){var t=[];return n.alias!==undefined&&t.push(n.alias,": "),t.push(n.model," last accessed on: ",new Date(n.last_access).toLocaleString()),t=[],n.alias!==undefined&&t.push(n.alias,": "),t.push(n.model," last accessed on: ",new Date(n.last_access).toLocaleString()),new i(n.device_id,t.join(""))})},r.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(){return Promise.resolve(!0)},r}();t.AuthenticationDriverDescriptorMobileApprove=r})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(i){var r=function(r){function u(){return r.call(this,i.AuthenticationDriverNativeFace,u.authenticatorName)||this}return __extends(u,r),u.prototype.evaluateLocalRegistrationStatus=function(f){var e=r.prototype.evaluateLocalRegistrationStatus.call(this,f);if(e!=t.AuthenticatorRegistrationStatus.Registered)return e;var o=f.user.localEnrollments[u.authenticatorName],h=i.AuthenticationDriverNativeFace.authenticatorKeyTagForUser(f.user,o.version,o.salt),s=f.sdk.host.getKeyPair(h,n.sdkhost.KeyClass.StdSigningKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(s)s.closeKeyPair();else return t.AuthenticatorRegistrationStatus.LocallyInvalid;return t.AuthenticatorRegistrationStatus.Registered},u.prototype.isSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported)=="true"},u.authenticatorName="face_id",u}(i.AuthenticationDriverDescriptorLocal);i.AuthenticationDriverDescriptorNativeFace=r})(r=i.authenticationdrivers||(i.authenticationdrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(){function n(n,t,i,r,u){this._channelIndex=n;this._channelAssertionId=t;this._targetIdentifier=i;this._description=r;this._channel=u}return n.prototype.getDescription=function(){return this._description},n.prototype.getChannel=function(){return this._channel},n.prototype.getTargetIdentifier=function(){return this._targetIdentifier},n.prototype.getChannelAssertionId=function(){return this._channelAssertionId},n.prototype.getChannelIndex=function(){return this._channelIndex},n.__tarsusInterfaceName="OtpTarget",n}(),u;i.OtpTargetImpl=r;u=function(){function u(){}return u.prototype.evaluateLocalRegistrationStatus=function(){return n.AuthenticatorRegistrationStatus.Registered},u.prototype.isSupportedOnDevice=function(){return!0},u.prototype.suggestParameters=function(t){return this.createTargetsFromConfig(t).map(function(t){return n.AuthenticationActionParameterTargetSelection.create(t)})},u.prototype.createAuthenticationDriver=function(n,t,r){var u=this.createTargetsFromConfig(t);return new i.AuthenticationDriverOtp(n,t,u,r)},u.prototype.createTargetsFromConfig=function(i){var u=i;return u.channels.map(function(i){var u;switch(i.type){case t.Protocol.AuthenticationMethodOtpChannelType.Email:u=n.OtpChannel.Email;break;case t.Protocol.AuthenticationMethodOtpChannelType.Sms:u=n.OtpChannel.Sms;break;case t.Protocol.AuthenticationMethodOtpChannelType.Voice:u=n.OtpChannel.VoiceCall;break;default:u=n.OtpChannel.Unknown}return!i.targets&&i.target&&(i.targets={},i.targets["0"]=i.target),i.targets||(i.targets={}),Object.keys(i.targets).map(function(n,t){return new r(t,i.assertion_id,n,i.targets[n],u)})}).reduce(function(n,t){return n.concat(t)},[])},u.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(){return Promise.resolve(!0)},u}();i.AuthenticationDriverDescriptorOtp=u})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(){function n(n,t){this._targetIdentifier=n;this._description=t}return n.prototype.getDescription=function(){return this._description},n.prototype.getDeviceIdentifier=function(){return this._targetIdentifier},n.__tarsusInterfaceName="TotpTarget",n}(),r;t.TotpTargetImpl=i;r=function(){function r(){}return r.prototype.evaluateLocalRegistrationStatus=function(){return n.AuthenticatorRegistrationStatus.Registered},r.prototype.isSupportedOnDevice=function(){return!0},r.prototype.suggestParameters=function(t){var i=r.createTargetsFromConfig(t);return i.map(function(t){return n.AuthenticationActionParameterTargetSelection.create(t)})},r.prototype.createAuthenticationDriver=function(n,i,r){return new t.AuthenticationDriverTotp(n,i,r)},r.createTargetsFromConfig=function(n){var t=n;return t.selectable_devices?t.selectable_devices.map(function(n){var t=[];return n.alias!==undefined&&t.push(n.alias,": "),t.push(n.model," last accessed on: ",new Date(n.last_access).toLocaleString()),t=[],n.alias!==undefined&&t.push(n.alias,": "),t.push(n.model," last accessed on: ",new Date(n.last_access).toLocaleString()),new i(n.device_id,t.join(""))}):[]},r.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(){return Promise.resolve(!0)},r}();t.AuthenticationDriverDescriptorTotp=r})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(i){function r(){return i.call(this,t.AuthenticationDriverVoice)||this}return __extends(r,i),r.prototype.isSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.AudioAcquitisionSupported)=="true"},r}(t.SimpleAuthenticationDriverDescriptor);t.AuthenticationDriverDescriptorVoice=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(n,t,r){return i.call(this,n,t,r)||this}return __extends(r,i),r.prototype.getMaxStep=function(){return-1},r.prototype.authenticateInStartedSession=function(n){n||this.initializeFirstStep();this.pumpStep()},r.prototype.registerInStartedSession=function(n){n||this.initializeFirstStep();this.pumpStep()},r.prototype.pumpStep=function(){var t=this,i=this._inputSession;i.setInputStep(this._currentStepIndex,this.getMaxStep(),this._currentStep);i.promiseInput().then(function(n){return t.handleInputOrControlResponse(n)},function(i){return t.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},r.prototype.handleAuthenticateAssertionResult=function(n){return this.handleStepManagementAssertionResult(n)?!0:i.prototype.handleAuthenticateAssertionResult.call(this,n)},r.prototype.handleRegisterAssertionResult=function(n){return this.handleStepManagementAssertionResult(n)?!0:i.prototype.handleRegisterAssertionResult.call(this,n)},r.prototype.handleStepManagementAssertionResult=function(n){var i;return n.assertion_error_code==t.Protocol.AssertionErrorCode.NotFinished?(i=this.prepareNextAuthenticationStep(n),i!=this._currentStep&&(this._currentStep=i,this._currentStepIndex++),this.pumpStep(),!0):n.assertion_error_code==t.Protocol.AssertionErrorCode.RepeatCurrentStep?(i=this.updateCurrentAuthenticationStep(n,this._currentStep),this.pumpStep(),!0):!1},r.prototype.initializeFirstStep=function(){this._currentStep=this.createInitialInputStep();this._currentStepIndex=0},r}(i.AuthenticationDriver);i.AuthenticationDriverMultiStep=r})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i,r){return t.call(this,n,i,r)||this}return __extends(i,t),i.prototype.createAuthenticatorSession=function(){return this._uiHandler.createFaceAuthSession("face",this.user.name)},i.prototype.createInitialInputStep=function(){var t=this._authenticatorConfig;return new n.impl.CameraAcquisitionStepDescriptionImpl(t.acquisition_challenges)},i.prototype.prepareNextAuthenticationStep=function(){return this.createInitialInputStep()},i.prototype.updateCurrentAuthenticationStep=function(n,t){return t},i.prototype.handleAuthenticationInputResponse=function(n){var t=n;this.processAuthenticateAssertion(t.getAcquisitionResponse())},i.prototype.handleRegistrationInputResponse=function(n){var t=n;this.processRegisterAssertion(t.getAcquisitionResponse())},i}(t.AuthenticationDriverMultiStep);t.AuthenticationDriverFace=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u=function(){function n(n,t,i,r,u,f){this._uiHandler=i;this._clientContext=r;this._actionContext=u;this._fidoRequest=f;this._username=t;this._sdk=n}return n.prototype.startSession=function(n){this._authDescription=n},n.prototype.changeSessionModeToRegistrationAfterExpiration=function(){throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Can't change FIDO asession mode from authentication to registration.");},n.prototype.promiseRecoveryForError=function(){return Promise.resolve(t.AuthenticationErrorRecovery.Fail)},n.prototype.promiseInput=function(){var n=this;return this.fidoClientXact().then(function(n){return t.InputOrControlResponse.createInputResponse(t.FidoInputResponse.createSuccessResponse(n))},function(i){var r=t.impl.AuthenticationErrorImpl.ensureAuthenticationError(i);return n._sdk.log(t.LogLevel.Debug,"Received FIDO error response from client: "+r),r.getErrorCode()==t.AuthenticationErrorCode.UserCanceled?t.InputOrControlResponse.createControlResponse(t.impl.ControlRequestImpl.create(t.ControlRequestType.CancelAuthenticator)):t.InputOrControlResponse.createInputResponse(t.FidoInputResponse.createdFailedResponse(n._authDescription,r))})},n.prototype.completeSuccessfulAuthenticatorSession=function(){return this.fidoClientSendCompletion({},1200)},n.prototype.endSession=function(){},n}(),e=function(n){function t(t,i,r,u,f,e){return n.call(this,t,i,r,u,f,e)||this}return __extends(t,n),t.prototype.fidoClientXact=function(){return this._sdk.host.fidoClientXact(this._uiHandler,this._clientContext,this._actionContext,this._fidoRequest)},t.prototype.fidoClientSendCompletion=function(n,t){var i={__completion:{responseCode:t,message:n}};return this._sdk.host.fidoClientXact(this._uiHandler,this._clientContext,this._actionContext,i).then(function(){return!0})},t}(u),o=function(){function r(){}return r.prototype.createSession=function(n,t,i,r,u,f){return new e(n,t,i,r,u,f)},r.prototype.canHandlePolicy=function(n,t){return i.fidoclient.TarsusFidoClient.isPolicyTransmitFidoClientExclusive(t)?!1:this.checkPlatformClientIsPresent(n)?!0:!1},r.prototype.getAvailableAuthenticatorsIds=function(n){var i=this;return new Promise(function(r,u){var f,e;if(!i.checkPlatformClientIsPresent(n))return n.log(t.LogLevel.Debug,"No platform FIDO client, therefore no available platform FIDO authenticators"),r();f=null;n.currentSession&&(e=n.currentSession.getCurrentControlFlowProcessor(),e&&(f=e._clientContext));i.requestFidoClientDiscovery(n,n.currentUiHandler,f,i.getPolicyAction()).then(function(n){for(var e=n,o=e.availableAuthenticators,u=[],f,t=0,i=o;t<i.length;t++)f=i[t],u.push(f.aaid);r(u)},function(i){n.log(t.LogLevel.Debug,"Received FIDO discovery error response from client: "+i);u(i)})})},r.prototype.checkPlatformClientIsPresent=function(i){return this._hasPlatformClient==null&&(this._hasPlatformClient=i.host.queryHostInfo(n.sdkhost.HostInformationKey.FidoClientPresent)==="true",this._hasPlatformClient||i.log(t.LogLevel.Info,"No platform FIDO client.")),this._hasPlatformClient},r.prototype.getPolicyAction=function(){var n={};return n.type="",n.assertion_id="",new t.impl.PolicyActionImpl(n)},r.prototype.requestFidoClientDiscovery=function(n,t,i,r){return n.host.fidoClientXact(t,i,r,{discovery:!0})},r}(),s=function(n){function t(t,i,r,u,f,e){return n.call(this,t,i,r,u,f,e)||this}return __extends(t,n),t.prototype.fidoClientXact=function(){return this._sdk.fidoClient.fidoClientXact(this._authDescription,this._uiHandler,this._username,this._clientContext,this._actionContext,this._fidoRequest)},t.prototype.fidoClientSendCompletion=function(){return Promise.resolve(!0)},t}(u),h=function(){function n(){}return n.prototype.createSession=function(n,t,i,r,u,f){return new s(n,t,i,r,u,f)},n.prototype.canHandlePolicy=function(n,t){return n.fidoClient.canHandlePolicy(t)},n.prototype.getAvailableAuthenticatorsIds=function(){return new Promise(function(n){var t=[];Object.keys(i.fidoclient.FidoAuthenticators).forEach(function(n){t.push(n)});n(t)})},n}(),f;r._fidoClientProviders=[new h,new o];f=function(n){function u(t,i,r){return n.call(this,t,i,r)||this}return __extends(u,n),u.getEligibleClientProvidersForPolicy=function(n,t){return r._fidoClientProviders.filter(function(i){return i.canHandlePolicy(n,t)})},u.hasEligibleClientProvidersForPolicy=function(n,t){return this.getEligibleClientProvidersForPolicy(n,t).length>0},u.prototype.runUnregistration=function(){var i=this;return n.prototype.runUnregistration.call(this).finally(function(){var n=i._authenticatorConfig;new Promise(function(r,f){var e=n.fido_policy,c,s,h,o;if(e.rejected||!e.accepted||e.accepted.length!=1)throw"Invalid fido policy (class 1)";if(e.accepted[0].length!=1||Object.keys(e.accepted[0][0]).length!=1||!e.accepted[0][0].aaid||e.accepted[0][0].aaid.length!=1)throw"Invalid fido policy (class 2)";c=e.accepted[0][0].aaid[0];i._sdk.log(t.LogLevel.Debug,"Will unregister AAID "+c+".");s=u.getEligibleClientProvidersForPolicy(i._sdk,n.fido_policy);s.length==0?(i._sdk.log(t.LogLevel.Warning,"Can't find FIDO client for unregister op: "+JSON.stringify(n.fido_policy)+"."),r()):(h=n.fido_request,h.header.appID=n.fido_appid,o=s[0].createSession(i._sdk,i.user.name,i._uiHandler,i._clientContext,i._actionDriver.policyAction(),h),o.startSession(i._authenticatorDescription,t.AuthenticatorSessionMode.Registration,i._actionDriver.policyAction(),i._clientContext),o.promiseInput().then(function(n){if(n.isControlRequest())throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorError,"Unexpected control response from FIDO client during unregistration.");var i=n.getResponse();if(i instanceof t.FidoAuthFailureResponse)throw i.getFailureError();return n}).finally(function(){o.endSession()}).then(r,f))}).then(function(){i._sdk.log(t.LogLevel.Info,"FIDO authenticator unregistered: "+JSON.stringify(n.fido_policy)+".")},function(n){var r=t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n);i._sdk.log(t.LogLevel.Error,"Error during FIDO unregistration: "+r+".")})})},u.prototype.completeAuthenticatorSessionWithResult=function(i){var u=this;i instanceof r.AuthenticationDriverSessionResultAuthenticationCompleted?this._inputSession.completeSuccessfulAuthenticatorSession().then(function(){n.prototype.completeAuthenticatorSessionWithResult.call(u,i)},function(i){n.prototype.completeAuthenticatorSessionWithError.call(u,t.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))}):n.prototype.completeAuthenticatorSessionWithResult.call(this,i)},u.prototype.createAuthenticatorSession=function(){var n=this._authenticatorConfig,i=u.getEligibleClientProvidersForPolicy(this._sdk,n.fido_policy);if(n.fido_request.header.appID=n.fido_appid,i.length>0)return i[0].createSession(this._sdk,this.user.name,this._uiHandler,this._clientContext,this._actionDriver.policyAction(),n.fido_request);throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorExternalConfigError,"Can't find FIDO client to handle FIDO request.",{fidoRequest:n.fido_request});},u.prototype.authenticateInStartedSession=function(){var n=this;this._inputSession.promiseInput().then(function(t){return n.handleInputOrControlResponse(t)},function(i){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},u.prototype.registerInStartedSession=function(){var n=this;this._inputSession.promiseInput().then(function(t){return n.handleInputOrControlResponse(t)},function(i){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},u.prototype.handleAuthenticationInputResponse=function(n){n instanceof t.FidoAuthSuccessResponse?this.handleFidoSuccessAuthResponse(n):this.handleFidoError(n)},u.prototype.handleFidoSuccessAuthResponse=function(n){this.processAuthenticateAssertion({fido_response:n.getFidoResponse()})},u.prototype.handleFidoError=function(n){n instanceof t.FidoAuthFailureResponse?(this._sdk.log(t.LogLevel.Debug,"FIDO session received FidoAuthFailureResponse."),this.handleFidoFailureResponse(n)):(this._sdk.log(t.LogLevel.Error,"FIDO session received unknkown response type."),this.performErrorRecoveryForError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"FIDO session received unknkown response type.")))},u.prototype.handleFidoFailureResponse=function(n){var r={status:n.getRegistrationStatus()==t.AuthenticatorRegistrationStatus.Registered?i.Protocol.AuthenticationMethodStatus.Registered:i.Protocol.AuthenticationMethodStatus.Unregistered,expired:n.getExpired(),locked:n.getLocked(),last_used:0};this._authenticatorDescription.updateWithAuthenticatorState(r);this.performErrorRecoveryForError(n.getFailureError())},u.prototype.handleFidoSuccessRegResponse=function(n){this.processRegisterAssertion({fido_response:n.getFidoResponse()})},u.prototype.handleRegistrationInputResponse=function(n){n instanceof t.FidoAuthSuccessResponse?this.handleFidoSuccessRegResponse(n):this.handleFidoError(n)},u.prototype.defaultRecoveryForError=function(){return this._operationMode==t.AuthenticatorSessionMode.Authentication?t.AuthenticationErrorRecovery.ChangeAuthenticator:t.AuthenticationErrorRecovery.Fail},u}(r.AuthenticationDriver);r.AuthenticationDriverFido=f})(r=i.authenticationdrivers||(i.authenticationdrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(r){function u(n,t,i){return r.call(this,n,t,i)||this}return __extends(u,r),Object.defineProperty(u.prototype,"lastObtainedKeyPair",{get:function(){return this._lastObtainedKeyPair},set:function(n){this._lastObtainedKeyPair&&this._lastObtainedKeyPair!=n&&this._lastObtainedKeyPair.closeKeyPair();this._lastObtainedKeyPair=n},enumerable:!0,configurable:!0}),u.prototype.completeAuthenticatorSessionWithResult=function(u){var f=this.operationMode===n.AuthenticatorSessionMode.Registration&&u instanceof i.AuthenticationDriverSessionResultAuthenticationCompleted&&(!u.assertionResult.assertion_error_code||u.assertionResult.assertion_error_code===t.Protocol.AssertionErrorCode.AssertionContainerNotComplete);f&&(this._enrollmentRecordToCommit?(this._sdk.log(n.LogLevel.Debug,"Updating local enrollment record on registration"),this.user.updateEnrollmentRecord(this._enrollmentRecordToCommit)):this._sdk.log(n.LogLevel.Warning,"No enrollment record to update."));this._enrollmentRecordToCommit=null;this.lastObtainedKeyPair=null;r.prototype.completeAuthenticatorSessionWithResult.call(this,u)},u.prototype.completeAuthenticatorSessionWithError=function(n){this.lastObtainedKeyPair=null;r.prototype.completeAuthenticatorSessionWithError.call(this,n)},u.prototype.registerInStartedSession=function(){this._enrollmentRecordToCommit=null},u.prototype.handleAuthenticationInputResponse=function(i){var r=this,u=this.user.localEnrollments[this.authenticatorType];u||this.performErrorRecoveryForError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.NoRegisteredAuthenticator,"Missing key for fingerprint authenticator"));this.getKeyForEnrollmentDataAndInput(u,i).then(function(i){if(r._sdk.log(n.LogLevel.Debug,"Local authenticator key obtained; signing challenge"),r._externalCancelled)return Promise.reject(r._actionDriver._controlFlowProcessor.createExternalCancellationError());r.lastObtainedKeyPair=i.key;var f=n.util.asciiToHex(r.localAuthenticatorChallenge());return r.lastObtainedKeyPair.signHex(f).then(function(f){var s=n.util.hexToBase64(f),o={},h={fch:s},e;i.rolloverKeyData&&(r._sdk.log(n.LogLevel.Info,"Local authenticator rollover requested"),e={},i.rolloverKeyData.key&&(e.key=i.rolloverKeyData.key.publicKeyToJson()),i.rolloverReason&&(e.reason=i.rolloverReason),o.rollover=e,u.status=t.LocalEnrollmentStatus.Registered,u.validationStatus=t.LocalEnrollmentValidationStatus.Validated,u.salt=i.rolloverKeyData.salt,u.version=i.rolloverKeyData.schemeVersion,u.keyMaterial=i.rolloverKeyData.keyMeterial,u.cryptoSettings=r._sdk.cryptoSettings,r._enrollmentRecordToCommit=u);r.processAuthenticateAssertion(o,h)},function(n){return Promise.reject(n)})}).catch(function(t){r.processLocalAuthenticatorError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})},u.prototype.getNewOrUpdatedEnrollmentRecord=function(i){this._sdk.log(n.LogLevel.Debug,"Register "+this.authenticatorType+": fetching local enrollment record");var r=this.user.localEnrollments[this.authenticatorType],f=i.key.publicKeyToJson().key,u=this._sdk.host.calcHexStringEncodedSha256Hash(n.util.base64ToHex(f));return r||(this._sdk.log(n.LogLevel.Debug,"Register "+this.authenticatorType+": Generating new local enrollment record"),r=this.user.createEnrollmentRecord(this.authenticatorType,i.schemeVersion,i.salt,t.LocalEnrollmentStatus.Unregistered,u)),r.status=t.LocalEnrollmentStatus.Registered,r.validationStatus=t.LocalEnrollmentValidationStatus.Validated,r.salt=i.salt,r.version=i.schemeVersion,r.cryptoSettings=this._sdk.cryptoSettings,r.publicKeyHash=u,r.keyMaterial=i.keyMeterial,r},u.prototype.handleRegistrationInputResponse=function(t){var i=this;this._sdk.log(n.LogLevel.Debug,"Register "+this.authenticatorType+": Generating pending enrollment data");this.generatePendingEnrollment(t).then(function(t){var r,u;return(i._sdk.log(n.LogLevel.Debug,"Register "+i.authenticatorType+": Signing registration assertion"),r=i.getNewOrUpdatedEnrollmentRecord(t),i._enrollmentRecordToCommit=r,u=n.util.asciiToHex(i.localAuthenticatorChallenge()),i._externalCancelled)?Promise.reject(i._actionDriver._controlFlowProcessor.createExternalCancellationError()):(i.lastObtainedKeyPair=t.key,t.key.signHex(u).then(function(r){i._sdk.log(n.LogLevel.Debug,"Register "+i.authenticatorType+": Preparing registration assertion");try{var u=n.util.hexToBase64(r),f={public_key:t.key.publicKeyToJson(),fch:u};i.processRegisterAssertion(null,f)}finally{i.lastObtainedKeyPair=null}},function(n){return i.lastObtainedKeyPair=null,Promise.reject(n)}))}).catch(function(t){i.processLocalAuthenticatorError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})},u.prototype.handleAuthenticateAssertionResult=function(t){return this._enrollmentRecordToCommit&&!t.assertion_error_code&&(this._sdk.log(n.LogLevel.Debug,"Pending commit for enrollment; checking rollover status."),t.data&&t.data.rollover&&t.data.rollover.code==0?(this._sdk.log(n.LogLevel.Info,"Updating local enrollment record on authentication result"),this.user.updateEnrollmentRecord(this._enrollmentRecordToCommit)):this._sdk.log(n.LogLevel.Error,"Received a rollover failure response from the server; aboting rollover.")),this._enrollmentRecordToCommit=null,r.prototype.handleAuthenticateAssertionResult.call(this,t)},u.prototype.processLocalAuthenticatorError=function(n){this.performErrorRecoveryForError(n)},u.prototype.localAuthenticatorChallenge=function(){return this._actionDriver._controlFlowProcessor.challenge+this._authenticatorDescription.assertionId},u.prototype.onCancelRun=function(){r.prototype.onCancelRun.call(this);this.lastObtainedKeyPair&&(this.lastObtainedKeyPair=null)},u}(i.AuthenticationDriver);i.AuthenticationDriverLocal=r})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){function t(n){return n.runSilentRegistration}n.instanceOfAuthenticationDriverSilentRegistrationSupport=t})(t=n.authenticationdrivers||(n.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u=function(u){function f(n,t,i){return u.call(this,n,t,i)||this}return __extends(f,u),f.authenticatorKeyTagForUser=function(n,t,u){return new i.TarsusKeyPath("per_user",n.name,"local_auth_keys",r.AuthenticationDriverDescriptorFingerprint.authenticatorName,t,u)},f.prototype.runSilentRegistration=function(){var n=this;return this.generateKeyForScheme(null,"v2").then(function(i){var u=n.getNewOrUpdatedEnrollmentRecord(i),f={public_key:i.key.publicKeyToJson()};return n._actionDriver.sendAuthenticatorAssertionRequest(n._authenticatorDescription,"register",null,f).then(function(i){if(i.assertion_error_code)throw t.impl.AuthenticationErrorImpl.errorForAssertionResponse(i);else return n.user.updateEnrollmentRecord(u),new r.AuthenticationDriverSessionResultAuthenticationCompleted(i)})})},f.prototype.createAuthenticatorSession=function(){return this._uiHandler.createFingerprintAuthSession(r.AuthenticationDriverDescriptorFingerprint.authenticatorName,this.user.name)},f.prototype.authenticateInStartedSession=function(){var n=this;this._inputSession.promiseInput().then(function(t){return n.handleInputOrControlResponse(t)},function(i){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},f.prototype.registerInStartedSession=function(n){var i=this;u.prototype.registerInStartedSession.call(this,n);this._inputSession.promiseInput().then(function(n){return i.handleInputOrControlResponse(n)},function(n){return i.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},Object.defineProperty(f.prototype,"authenticatorType",{get:function(){return r.AuthenticationDriverDescriptorFingerprint.authenticatorName},enumerable:!0,configurable:!0}),f.prototype.processLocalAuthenticatorError=function(r){var f=this,u=r,s=0,o=Promise.resolve(),e;u.getErrorCode()==t.AuthenticationErrorCode.Internal&&u.getData()&&(e=u.getData(),e[n.sdkhost.ErrorDataInternalError]==n.sdkhost.InternalErrorBiometricInvalidated?(u=new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorInvalidated,"Fingerprint registration invalidated."),this._sdk.log(t.LogLevel.Debug,"Fingerprint invalidated InternalErrorBiometricInvalidated "),o=i.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._sdk.currentSession,this._authenticatorDescription)):e[n.sdkhost.ErrorDataInternalError]==n.sdkhost.InternalErrorWrongBiometric?(s=e[n.sdkhost.ErrorDataNumFailures],u=new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidInput,"Invalid fingerprint was input.")):(u=t.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(e,"Fingerprint")||u,e[n.sdkhost.ErrorDataInternalError]==n.sdkhost.InternalErrorBiometricNotConfigured&&this._authenticatorDescription.getRegistered()&&(o=i.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._sdk.currentSession,this._authenticatorDescription))));o.catch(function(n){f._sdk.log(t.LogLevel.Error,n)});o.finally(function(){if(u.getErrorCode()==t.AuthenticationErrorCode.UserCanceled){f._sdk.log(t.LogLevel.Debug,"Fingerprint authenticator captured user cancel error code.");f.invokeUiHandlerCancellation();return}s&&f._operationMode==t.AuthenticatorSessionMode.Authentication?f.processAuthFailureAssertionAndHandleError(u,s):f.performErrorRecoveryForError(u)})},f.prototype.getKeyForEnrollmentDataAndInput=function(i,r){var u=this;return new Promise(function(f,e){var c=r,l=u.authenticatorKeyTagForScheme(i.version,i.salt),s=u._sdk.host.getKeyPair(l,n.sdkhost.KeyClass.StdSigningKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb),h,o;if(!s){h={};h[n.sdkhost.ErrorDataInternalError]=n.sdkhost.InternalErrorBiometricInvalidated;throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Attempt to authenticate with invalidated Fingerprint.",h);}s.setBiometricPromptInfo(c.getPrompt(),u._uiHandler,u._inputSession);o={key:s};i.version=="v0"||i.version=="v1"?(u._sdk.log(t.LogLevel.Info,"Fingerprint: Key rollover from "+i.version+" to v2"),u.generateKeyForScheme(r,"v2").then(function(n){return o.rolloverKeyData=n,o.rolloverReason="Upgrading fingerprint authenticator scheme from "+i.version+" to v2",o}).then(f,e)):f(o)})},f.prototype.generatePendingEnrollment=function(n){var t=this;return this.generateKeyForScheme(n,"v2").then(function(i){var r=n;return i.key.setBiometricPromptInfo(r?r.getPrompt():null,t._uiHandler,t._inputSession),i})},f.prototype.generateKeyForScheme=function(i,r){var u,f;return u=r=="v1"||r=="v2"?this._sdk.host.generateRandomHexString(24):"",f=this.authenticatorKeyTagForScheme(r,u),t.util.wrapPromiseWithActivityIndicator(this._uiHandler,this._actionDriver.policyAction(),this._clientContext,this._sdk.host.generateKeyPair(f,n.sdkhost.KeyClass.StdSigningKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,!0).then(function(n){return{key:n,salt:u,schemeVersion:r}},function(n){if(n.getErrorCode()==t.AuthenticationErrorCode.Internal&&n.getData()){var r=n.getData(),i=t.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(r,"Fingerprint");if(i)throw i;}throw n;}))},f.prototype.authenticatorKeyTagForScheme=function(n,t){return f.authenticatorKeyTagForUser(this.user,n,t)},f}(r.AuthenticationDriverLocal);r.AuthenticationDriverFingerprint=u})(r=i.authenticationdrivers||(i.authenticationdrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){function f(n,t){var i=n.toString(16);if(i.length>t/4)throw"Number out of range for bitcount.";while(i.length<t/4)i="0"+i;return i}function t(n){for(var r=[],t,i=0;i<n.length;i++)t=n.charCodeAt(i),t<128?r.push(t):t<2048?r.push(192|t>>6,128|t&63):t<55296||t>=57344?r.push(224|t>>12,128|t>>6&63,128|t&63):(i++,t=65536+((t&1023)<<10|n.charCodeAt(i)&1023),r.push(240|t>>18,128|t>>12&63,128|t>>6&63,128|t&63));return r}function i(n){for(var r="",i,u,t=0;t<n.length;t++)i=n[t],i<128?r+=String.fromCharCode(i):i>191&&i<224?(r+=String.fromCharCode((i&31)<<6|n[t+1]&63),t+=1):i>223&&i<240?(r+=String.fromCharCode((i&15)<<12|(n[t+1]&63)<<6|n[t+2]&63),t+=2):(u=((i&7)<<18|(n[t+1]&63)<<12|(n[t+2]&63)<<6|n[t+3]&63)-65536,r+=String.fromCharCode(u>>10|55296,u&1023|56320),t+=3);return r}function e(n){for(var r=[],t=0;t<n.length;t+=2)r.push(parseInt(n.substr(t,2),16));return i(r)}function o(n){return t(n).map(function(n){var t=n.toString(16);return t.length<2&&(t="0"+t),t}).join("")}function s(n){var t=atob(n);return r(t)}function r(n){for(var r="",t,i=0;i<n.length;i++)t=n.charCodeAt(i).toString(16),t.length<2&&(t="0"+t),r+=t;return r}function h(n){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,i=0,t="",u,f=0;f<n.length;f++)r=(r<<4)+parseInt(n[f],16),i+=4,i>=6&&(u=e[r>>i-6],t=t+u,i-=6,r=r&255>>8-i);for(i&&(u=e[r<<6-i],t=t+u);t.length%4;)t=t+"=";return t}function c(n){var t=new RegExp("^([0-9A-Fa-f]{2})+$");return t.test(n)}function l(n,t,i,r){return n.startActivityIndicator(t,i),r.then(function(r){return n.endActivityIndicator(t,i),r},function(r){return n.endActivityIndicator(t,i),Promise.reject(r)})}var u;n.numberToHex=f;n.toUTF8Array=t;n.fromUTF8Array=i;n.hexToAscii=e;n.asciiToHex=o;n.base64ToHex=s;n.bytesToHex=r;n.hexToBase64=h;n.isHexString=c;n.wrapPromiseWithActivityIndicator=l;u=function(){function n(){var t=this;this._cancelPromise=new Promise(function(i,r){t._cancelFn=function(){r(n.CancelRequest)};t._cancelled&&r(n.CancelRequest)})}return Object.defineProperty(n.prototype,"cancellablePromise",{get:function(){return this._cancellablePromise},enumerable:!0,configurable:!0}),n.prototype.resolveWith=function(n){this._cancelled?this._cancellablePromise=this._cancelPromise:(this._underlyingPromise=new Promise(n),this._cancellablePromise=Promise.race([this._cancelPromise,this._underlyingPromise]))},n.prototype.cancel=function(){this._cancelled=!0;this._cancelFn&&this._cancelFn()},n.CancelRequest={},n}();n.CancelablePromiseHolder=u})(t=n.util||(n.util={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u=function(r){function u(n,t,i){return r.call(this,n,t,i)||this}return __extends(u,r),u.prototype.processLocalAuthenticatorError=function(n){var i=n;n.getErrorCode()==t.AuthenticationErrorCode.InvalidInput&&this._operationMode==t.AuthenticatorSessionMode.Authentication?this.processAuthFailureAssertionAndHandleError(i,1):this.performErrorRecoveryForError(i)},u.prototype.getKeyForEnrollmentDataAndInput=function(n,i){var r=this;return new Promise(function(t,u){n.version=="v2"?r.getKeyForEnrollmentDataAndInputV2(n,i).then(t,u):r.getKeyForEnrollmentDataAndInputPreV2(n,i).then(t,u)}).then(function(u){if(!u)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidInput,"Invalid input provided to authenticator.");var f={key:u};return n.version=="v0"||n.version=="v1"?(r._sdk.log(t.LogLevel.Info,r.authenticatorType+": Key rollover from "+n.version+" to v2"),r.generatePendingEnrollment(i).then(function(n){return f.rolloverKeyData=n,f.rolloverReason="Upgrading "+r.authenticatorType+" authenticator scheme",f})):f})},u.prototype.generatePendingEnrollment=function(r){var u=this;return new Promise(function(f,e){var o=u._sdk.host.generateRandomHexString(32),s=u._sdk.host.generateRandomHexString(64),h=u.extractPbkdfInputFromInputResponse(r);return t.util.wrapPromiseWithActivityIndicator(u._uiHandler,u._actionDriver.policyAction(),u._clientContext,u._sdk.host.generateHexSeededKeyPairExternalRepresentation(n.sdkhost.KeyClass.FidoECCSigningKey,s).then(function(t){return i.vault.pbkdfStretchHexSecretIntoAESKey(o,h,u._sdk.cryptoSettings.getLocalEnrollmentKeySizeInBytes(),u._sdk.cryptoSettings.getLocalEnrollmentKeyIterationCount(),!0,u._sdk).then(function(i){return i.encrypt(s).then(function(i){return{key:u._sdk.host.importVolatileKeyPair(n.sdkhost.KeyClass.FidoECCSigningKey,t),salt:o,schemeVersion:"v2",keyMeterial:i}})})})).then(f,e)})},u.prototype.getKeyForEnrollmentDataAndInputV2=function(t,r){var u=this,f=this.extractPbkdfInputFromInputResponse(r);return i.vault.pbkdfStretchHexSecretIntoAESKey(t.salt,f,t.cryptoSettings.getLocalEnrollmentKeySizeInBytes(),t.cryptoSettings.getLocalEnrollmentKeyIterationCount(),!0,this._sdk).then(function(i){return i.decrypt(t.keyMaterial,null).then(function(t){return u._sdk.host.generateHexSeededKeyPairExternalRepresentation(n.sdkhost.KeyClass.FidoECCSigningKey,t).then(function(t){return u._sdk.host.importVolatileKeyPair(n.sdkhost.KeyClass.FidoECCSigningKey,t)})})})},u.prototype.getKeyForEnrollmentDataAndInputPreV2=function(t,i){var r=this;return this.authenticatorKeyTagForScheme(t.version,t.salt,t.cryptoSettings,i).then(function(t){return r._sdk.host.getKeyPair(t,n.sdkhost.KeyClass.StdSigningKey,n.sdkhost.KeyBiometricProtectionMode.None)})},u.prototype.authenticatorKeyTagForScheme=function(n,r,u,f){var e=this;return new Promise(function(o,s){var h=e.extractPbkdfInputFromInputResponse(f);if(n=="v0"&&(e._sdk.log(t.LogLevel.Debug,"Using SDK CryptoSettings for migrated enrollment."),u=e._sdk.cryptoSettings),!u)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Missing crypt settings for local enrollment.");e._sdk.host.generatePbkdf2HmacSha1HexString(r,h,u.getLocalEnrollmentKeySizeInBytes(),u.getLocalEnrollmentKeyIterationCount()).then(function(r){var u=t.util.hexToBase64(r);return new i.TarsusKeyPath("per_user",e.user.name,"local_auth_keys",e.authenticatorType,n,u)}).then(o,s)})},u}(r.AuthenticationDriverLocal);r.AuthenticationDriverLocalSecretInputBased=u})(r=i.authenticationdrivers||(i.authenticationdrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i,r){return t.call(this,n,i,r)||this}return __extends(i,t),Object.defineProperty(i.prototype,"authenticatorType",{get:function(){return i.authenticatorName},enumerable:!0,configurable:!0}),i.prototype.handleAuthenticationInputResponse=function(i){var r=i;n.impl.PatternInputImpl.validateFormat(r)?t.prototype.handleAuthenticationInputResponse.call(this,i):this.processLocalAuthenticatorError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."))},i.prototype.handleRegistrationInputResponse=function(i){var r=this._authenticatorConfig,u=i;if(!n.impl.PatternInputImpl.validateFormat(u)){this.processLocalAuthenticatorError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."));return}if(r.min_length&&n.impl.PatternInputImpl.getPatternLength(u)<r.min_length){this.processLocalAuthenticatorError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Invalid pattern length."));return}t.prototype.handleRegistrationInputResponse.call(this,i)},i.prototype.extractPbkdfInputFromInputResponse=function(t){var i=t;return n.util.asciiToHex(i.getPatternDescription())},i.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPatternAuthSession(i.authenticatorName,this.user.name,3,4)},i.prototype.authenticateInStartedSession=function(){var t=this;this._inputSession.promiseInput().then(function(n){return t.handleInputOrControlResponse(n)},function(i){return t.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},i.prototype.registerInStartedSession=function(){var t=this;this._inputSession.promiseInput().then(function(n){return t.handleInputOrControlResponse(n)},function(i){return t.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},i.authenticatorName="pattern",i}(t.AuthenticationDriverLocalSecretInputBased);t.AuthenticationDriverLocalPattern=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i,r){return t.call(this,n,i,r)||this}return __extends(i,t),Object.defineProperty(i.prototype,"authenticatorType",{get:function(){return i.authenticatorName},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pinLength",{get:function(){var n=this._authenticatorConfig;return n.length},enumerable:!0,configurable:!0}),i.prototype.handleRegistrationInputResponse=function(i){var r=i;r.getPin().length!=this.pinLength?this.processLocalAuthenticatorError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.InvalidInput,"Expecting an entry of length "+this.pinLength+".")):t.prototype.handleRegistrationInputResponse.call(this,i)},i.prototype.extractPbkdfInputFromInputResponse=function(t){var i=t;return n.util.asciiToHex(i.getPin())},i.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPinAuthSession(i.authenticatorName,this.user.name,this.pinLength)},i.prototype.authenticateInStartedSession=function(){var t=this;this._inputSession.promiseInput().then(function(n){return t.handleInputOrControlResponse(n)},function(i){return t.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},i.prototype.registerInStartedSession=function(){var t=this;this._inputSession.promiseInput().then(function(n){return t.handleInputOrControlResponse(n)},function(i){return t.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},i.authenticatorName="pin",i}(t.AuthenticationDriverLocalSecretInputBased);t.AuthenticationDriverLocalPinCode=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(i){function r(n,t,r){return i.call(this,n,t,r)||this}return __extends(r,i),r.prototype.poll=function(){var i=this;this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"authenticate",this.pollingAssertionData(),{}).then(function(r){i.filterAssertionResult(r)&&i.shouldContinuePolling(r)?i.pumpInput():i.handleAuthenticateAssertionResult(r)||(i._sdk.log(n.LogLevel.Info,"Authenticator session done."),i.completeAuthenticatorSessionWithResult(new t.AuthenticationDriverSessionResultAuthenticationCompleted(r)))}).catch(function(t){i.performErrorRecoveryForError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})},r}(t.AuthenticationDriver);t.AuthenticationDriverPolling=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i;(function(i){var r;(function(r){var u=function(u){function f(n,t,i){var r=u.call(this,n,t,i)||this;return r.methodName="mobileApprove",r.setupDataModel(t,i),r}return __extends(f,u),f.prototype.createAuthenticatorSession=function(){var r=this._uiHandler.createMobileApproveAuthSession("mobile_approve",this.user.name,this._instructions),u,e,f,o;if(!r)throw t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createMobileApproveAuthSession");return r.setAvailableTargets(this._selectableDevices),this._state==i.Protocol.AuthenticationMethodMobileApproveState.WaitForAuthenticate&&(this._selectedDevices=this._selectableDevices.map(function(n){return n}),u=null,this._otp&&(e=t.OtpFormatImpl.fromAssertionFormat(this._otp.format),u=n.ts.mobile.sdk.impl.MobileApproveOtpImpl.create(this._otp.value,e)),r.setCreatedApprovalInfo(this._selectedDevices,u)),this._authenticationParameters&&(f=this._authenticationParameters.filter(function(n){n instanceof t.AuthenticationActionParameterTargetSelection}),f.length!=0&&(this._sdk.log(t.LogLevel.Debug,"Target based driver found target selection parameters."),o=this._selectableDevices.reduce(function(n,t){return n[t.getDeviceIdentifier()]=t,n},{}),this._pendingTargetSelection=f.map(function(n){var r=n.getTarget(),i=o[r.getDeviceIdentifier()];if(!i)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Authentication parameter tried to select a device not presented as a selectable target");return i},{}),this._sdk.log(t.LogLevel.Debug,"Target based driver will select targets "+this._pendingTargetSelection+" based on selection parameter."))),r},f.prototype.authenticateInStartedSession=function(){this._autoExecuted?this._autoExecuted=!1:this.reset();this.pumpInput()},f.prototype.pumpInput=function(){if(this._state===i.Protocol.AuthenticationMethodMobileApproveState.WaitForApproval)this.createApproval();else if(this._state===i.Protocol.AuthenticationMethodMobileApproveState.WaitForAuthenticate)this.requestInputAndHandle();else throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Illegal authenticator state encountered: "+this._state);},f.prototype.registerInStartedSession=function(){throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Cannot register Mobile Approve authenticator.");},f.prototype.createApproval=function(){if(this._approvalId=null,this._pendingTargetSelection&&Object.keys(this._pendingTargetSelection).length){this._sdk.log(t.LogLevel.Debug,"Performing pending target selection "+this._pendingTargetSelection);var n=t.TargetBasedAuthenticatorInput.createTargetsSelectionRequest(this._pendingTargetSelection);this._pendingTargetSelection=null;this.handleAuthenticationInputResponse(n)}else this._strategy.user_selection&&this._selectableDevices&&this._selectableDevices.length?this.requestInputAndHandle():this.handleAuthenticationInputResponse(t.TargetBasedAuthenticatorInput.createTargetsSelectionRequest([]))},f.prototype.requestInputAndHandle=function(){var n=this;this._inputSession.promiseInput().then(function(t){n.handleInputOrControlResponse(t)})},f.prototype.handleAuthenticationInputResponse=function(n){var r,u;switch(this._state){case i.Protocol.AuthenticationMethodMobileApproveState.WaitForApproval:if(r=n.getSelectedTargets(),r){this.handleTargetSelectionInput(r);break}else throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Expected target selection input response but got: "+n);case i.Protocol.AuthenticationMethodMobileApproveState.WaitForAuthenticate:if(u=n.getAuthenticatorInput(),u instanceof t.MobileApproveInputRequestPolling){this.poll();break}else throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Expected polling request input response but got: "+n);default:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Illegal state for authenticator: "+this._state);}},f.prototype.handleTargetSelectionInput=function(n){var i=this;this._selectedDevices=n.map(function(n){var r=n;if(i._selectableDevices.indexOf(r)<0)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to select a Mobile Approve target not originally listed in the session.");return r});this.createForSelectedTargets()},f.prototype.createForSelectedTargets=function(){var i=this,r;r=this._selectedDevices&&this._selectedDevices.length?{device_ids:this._selectedDevices.map(function(n){return n.getDeviceIdentifier()})}:{};this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"approval",r,{}).then(function(r){var f,u,e;i.handleGeneralAssertionResult(r)||(r.assertion_error_code?(i._sdk.log(t.LogLevel.Error,"Assertion error encoutered. Starting error recovery."),i.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.errorForAssertionResponse(r))):(f=null,u=r.data,u.otp&&(e=t.OtpFormatImpl.fromAssertionFormat(u.otp.format),f=n.ts.mobile.sdk.impl.MobileApproveOtpImpl.create(u.otp.value,e)),i._approvalId=u.approval_id||null,i._state=u.state,i._inputSession.setCreatedApprovalInfo(i._selectedDevices,f),i._sdk.log(t.LogLevel.Debug,"Restarting auth or reg."),i.pumpInput()))}).catch(function(n){i.completeAuthenticatorSessionWithError(n)})},f.prototype.handleRegistrationInputResponse=function(){throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Cannot register Mobile Approve authenticator.");},f.prototype.processControlRequest=function(n){n.getRequestType()===t.ControlRequestType.RetryAuthenticator&&this.reset();u.prototype.processControlRequest.call(this,n)},f.prototype.filterAssertionResult=function(n){if(n.assertion_error_code==5)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.ApprovalDenied,"Approval was denied");else if(n.assertion_error_code==21)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.ApprovalExpired,"Approval has expired");return!0},f.prototype.shouldContinuePolling=function(n){return n.assertion_error_code==13},f.prototype.pollingAssertionData=function(){return{approval_id:this._approvalId}},f.prototype.reset=function(){this._state=i.Protocol.AuthenticationMethodMobileApproveState.WaitForApproval;this._approvalId=null;this._selectedDevices=null;this._inputSession.setCreatedApprovalInfo(null,null)},f.prototype.setupDataModel=function(n){this._state=n.state;this._otp=n.otp||null;this._strategy=n.strategy;this._selectableDevices=r.AuthenticationDriverDescriptorMobileApprove.createTargetsFromConfig(n);this._instructions=n.instructions;this._approvalId=n.approval_id||null;this._approvalId&&(this._autoExecuted=!0)},f}(r.AuthenticationDriverPolling);r.AuthenticationDriverMobileApprove=u})(r=i.authenticationdrivers||(i.authenticationdrivers={}))})(i=t.core||(t.core={}))})(i=t.sdk||(t.sdk={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u=function(u){function f(n,t,i){return u.call(this,n,t,i)||this}return __extends(f,u),f.authenticatorKeyTagForUser=function(n,t,r){return new i.TarsusKeyPath("per_user",n.name,"local_auth_keys","native_face",t,r)},f.prototype.runSilentRegistration=function(){var n=this;return this.generateFaceNativeKeyForScheme("v2").then(function(i){var u=n.getNewOrUpdatedEnrollmentRecord(i),f={public_key:i.key.publicKeyToJson()};return n._actionDriver.sendAuthenticatorAssertionRequest(n._authenticatorDescription,"register",null,f).then(function(i){if(i.assertion_error_code)throw t.impl.AuthenticationErrorImpl.errorForAssertionResponse(i);else return n.user.updateEnrollmentRecord(u),new r.AuthenticationDriverSessionResultAuthenticationCompleted(i)})})},f.prototype.createAuthenticatorSession=function(){return this._uiHandler.createNativeFaceAuthSession(r.AuthenticationDriverDescriptorNativeFace.authenticatorName,this.user.name)},f.prototype.authenticateInStartedSession=function(){var n=this;this._inputSession.promiseInput().then(function(t){return n.handleInputOrControlResponse(t)},function(i){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},f.prototype.registerInStartedSession=function(n){var i=this;u.prototype.registerInStartedSession.call(this,n);this._inputSession.promiseInput().then(function(n){return i.handleInputOrControlResponse(n)},function(n){return i.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))})},Object.defineProperty(f.prototype,"authenticatorType",{get:function(){return r.AuthenticationDriverDescriptorNativeFace.authenticatorName},enumerable:!0,configurable:!0}),f.prototype.processLocalAuthenticatorError=function(r){var f=this,u=r,s=0,o=Promise.resolve(),e;u.getErrorCode()==t.AuthenticationErrorCode.Internal&&u.getData()&&(e=u.getData(),e[n.sdkhost.ErrorDataInternalError]==n.sdkhost.InternalErrorBiometricInvalidated?(u=new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorInvalidated,"Native face registration invalidated."),this._sdk.log(t.LogLevel.Debug,"Face ID invalidated InternalErrorBiometricInvalidated "),o=i.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._sdk.currentSession,this._authenticatorDescription)):e[n.sdkhost.ErrorDataInternalError]==n.sdkhost.InternalErrorWrongBiometric?(s=e[n.sdkhost.ErrorDataNumFailures],u=new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidInput,"Invalid face was presented.")):(u=t.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(e,"Native Face")||u,e[n.sdkhost.ErrorDataInternalError]==n.sdkhost.InternalErrorBiometricNotConfigured&&this._authenticatorDescription.getRegistered()&&(o=i.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._sdk.currentSession,this._authenticatorDescription))));o.catch(function(n){f._sdk.log(t.LogLevel.Error,n)});o.finally(function(){if(u.getErrorCode()==t.AuthenticationErrorCode.UserCanceled){f._sdk.log(t.LogLevel.Debug,"Native face authenticator captured user cancel error code.");f.invokeUiHandlerCancellation();return}s&&f._operationMode==t.AuthenticatorSessionMode.Authentication?f.processAuthFailureAssertionAndHandleError(u,s):f.performErrorRecoveryForError(u)})},f.prototype.getKeyForEnrollmentDataAndInput=function(i,r){var u=this;return new Promise(function(f,e){var c=r,l=u.authenticatorKeyTagForScheme(i.version,i.salt),s=u._sdk.host.getKeyPair(l,n.sdkhost.KeyClass.StdSigningKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb),h,o;if(!s){h={};h[n.sdkhost.ErrorDataInternalError]=n.sdkhost.InternalErrorBiometricInvalidated;throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Attempt to authenticate with invalidated FaceID.",h);}s.setBiometricPromptInfo(c.getPrompt(),u._uiHandler,u._inputSession);o={key:s};i.version=="v0"||i.version=="v1"?(u._sdk.log(t.LogLevel.Info,"Native face: Key rollover from "+i.version+" to v2"),u.generateKeyForScheme(r,"v2").then(function(n){return o.rolloverKeyData=n,o.rolloverReason="Upgrading native face authenticator scheme from "+i.version+" to v2",o}).then(f,e)):f(o)})},f.prototype.generatePendingEnrollment=function(n){var t=this,i=n;return this.generateKeyForScheme(n,"v2").then(function(n){return n.key.setBiometricPromptInfo(i.getPrompt(),t._uiHandler,t._inputSession),n})},f.prototype.generateKeyForScheme=function(n,t){return this.generateFaceNativeKeyForScheme(t)},f.prototype.generateFaceNativeKeyForScheme=function(i){var r,u;return r=i=="v1"||i=="v2"?this._sdk.host.generateRandomHexString(24):"",u=this.authenticatorKeyTagForScheme(i,r),t.util.wrapPromiseWithActivityIndicator(this._uiHandler,this._actionDriver.policyAction(),this._clientContext,this._sdk.host.generateKeyPair(u,n.sdkhost.KeyClass.StdSigningKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,!0).then(function(n){return{key:n,salt:r,schemeVersion:i}},function(n){if(n.getErrorCode()==t.AuthenticationErrorCode.Internal&&n.getData()){var r=n.getData(),i=t.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(r,"Native Face");if(i)throw i;}throw n;}))},f.prototype.authenticatorKeyTagForScheme=function(n,t){return f.authenticatorKeyTagForUser(this.user,n,t)},f}(r.AuthenticationDriverLocal);r.AuthenticationDriverNativeFace=u})(r=i.authenticationdrivers||(i.authenticationdrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(n,t,r,u){var f=i.call(this,n,t,u)||this;return f._possibleTargets=r,f.setupDataModel(t),f}return __extends(r,i),r.prototype.getPossibleTargets=function(){return this._possibleTargets},r.prototype.createAuthenticatorSession=function(){var r,u,f,i;if(this._otpInitialState==t.Protocol.AuthenticationMethodOtpState.Validate&&(this._lastSelectedTarget=this._possibleTargets[0]),r=this._authenticationParameters?this._authenticationParameters.filter(function(t){return t instanceof n.AuthenticationActionParameterTargetSelection}):[],r.length!=0&&(this._sdk.log(n.LogLevel.Debug,"Target based driver found target selection parameters."),u=r[0].getTarget().getChannelAssertionId(),f=this._possibleTargets.filter(function(n){return n.getChannelAssertionId()==u}),f.length?(this._pendingTargetSelection=f[0],this._sdk.log(n.LogLevel.Debug,"Target based driver will select target "+this._pendingTargetSelection+" based on selection parameter."),this._lastSelectedTarget=this._pendingTargetSelection):this._sdk.log(n.LogLevel.Warning,"Target selection parameter for target based auth driver specified invalid target assertiong id "+u+".")),i=this._uiHandler.createOtpAuthSession("otp",this.user.name,this._possibleTargets,this._lastSelectedTarget),!i)throw n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createOtpAuthSession");return i.setAvailableTargets(this._possibleTargets),i},r.prototype.authenticateInStartedSession=function(){var t=this,i;if(this._possibleTargets.length==0){this._sdk.log(n.LogLevel.Warning,"No authentication target available for OTP. Doing error recovery.");this.performErrorRecoveryForError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AuthenticatorExternalConfigError,"No targets available for OTP."),!0);return}this._sdk.log(n.LogLevel.Debug,"Notifying current session of generated OTP format and target");this._inputSession.setGeneratedOtp(this._format,this._lastSelectedTarget);this._pendingTargetSelection?(this._sdk.log(n.LogLevel.Debug,"Performing pending target selection "+this._pendingTargetSelection),i=n.TargetBasedAuthenticatorInput.createTargetsSelectionRequest([this._pendingTargetSelection]),this._pendingTargetSelection=null,this.handleInputOrControlResponse(n.InputOrControlResponse.createInputResponse(i))):this._inputSession.promiseInput().then(function(n){t.handleInputOrControlResponse(n)}).catch(function(i){t.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},r.prototype.registerInStartedSession=function(){throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Cannot register OTP authenticator.");},r.prototype.handleTargetBasedAuthenticatorConcreteInput=function(t){if(t instanceof n.OtpInputOtpSubmission)this.processAuthenticateAssertion({otp:t.getOtp()},{assertion_id:this._possibleTargets[0].getChannelAssertionId()});else if(t instanceof n.OtpInputRequestResend)this.triggerForSelectedTarget();else throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Unknown OTP response type received from application callback.");},r.prototype.handleAuthenticateAssertionResult=function(t){return t.data&&t.data.additional_error_code&&t.data.additional_error_code==1&&(this._sdk.log(n.LogLevel.Debug,"Reached max number of attempts - invalidating current target."),this._lastSelectedTarget=null,this._format=null),i.prototype.handleAuthenticateAssertionResult.call(this,t)},r.prototype.handleAuthenticationInputResponse=function(t){var i,r;if(t.getAuthenticatorInput())this.handleTargetBasedAuthenticatorConcreteInput(t.getAuthenticatorInput());else if(t.getSelectedTargets()[0]){if(i=t.getSelectedTargets(),i.length>1)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to select multiple OTP targets while OTP supports only a single target.");if(r=i[0],this._possibleTargets.indexOf(r)<0)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to select an OTP target not originally listed in the session.");this._lastSelectedTarget=r;this.triggerForSelectedTarget()}else throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Invalid target-based authetnicator response type received from application callback. Target-based authenticator inputs must be created by calling TargetBasedAuthenticatorInput.createAuthenticatorInput.");},r.prototype.triggerForSelectedTarget=function(){var i=this,r,u;if(!this._lastSelectedTarget)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to trigger OTP generation without a selected target.");r={target_id:this._lastSelectedTarget.getTargetIdentifier(),channel_index:this._lastSelectedTarget.getChannelIndex()};u={assertion_id:this._lastSelectedTarget.getChannelAssertionId()};this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"otp",r,u).then(function(r){r.assertion_error_code&&r.assertion_error_code!=t.Protocol.AssertionErrorCode.FailOver&&(i._sdk.log(n.LogLevel.Error,"Assertion error encoutered. Clearing last selected target."),i._lastSelectedTarget=null);i.handleAuthenticateAssertionResult(r)||(r.data&&r.data.otp_format&&(i._sdk.log(n.LogLevel.Debug,"Received updated OTP and format."),i._format=n.OtpFormatImpl.fromAssertionFormat(r.data.otp_format)),i._sdk.log(n.LogLevel.Debug,"Restarting auth or reg."),i.authOrRegInStartedSession(!0))}).catch(function(n){i.completeAuthenticatorSessionWithError(n)})},r.prototype.handleRegistrationInputResponse=function(){throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Cannot register OTP authenticator.");},r.prototype.setupDataModel=function(t){this._otpInitialState=t.state;var i=t.format||t.otp_format;this._format=i&&n.OtpFormatImpl.fromAssertionFormat(i)||null},r}(i.AuthenticationDriver);i.AuthenticationDriverOtp=r})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i,r){return t.call(this,n,i,r)||this}return __extends(i,t),i.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPasswordAuthSession("password",this.user.name)},i.prototype.authenticateInStartedSession=function(){var t=this;this._inputSession.promiseInput().then(function(n){return t.handleInputOrControlResponse(n)},function(i){return t.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},i.prototype.registerInStartedSession=function(){var t=this;this._inputSession.promiseInput().then(function(n){return t.handleInputOrControlResponse(n)},function(i){return t.completeAuthenticatorSessionWithError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},i.prototype.handleAuthenticationInputResponse=function(t){var r=t,i=r.getPassword();if(i&&i.length>0){this.processAuthenticateAssertion({password:i});return}this.performErrorRecoveryForError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.InvalidInput,"Password can't be empty"))},i.prototype.handleRegistrationInputResponse=function(t){var r=t,i=r.getPassword();if(i&&i.length>0){this.processRegisterAssertion({password:i});return}this.performErrorRecoveryForError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.InvalidInput,"Password can't be empty"))},i}(t.AuthenticationDriver);t.AuthenticationDriverPassword=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i,r){return t.call(this,n,i,r)||this}return __extends(i,t),i.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPatternAuthSession("pattern_centralized",this.user.name,3,4)},i.prototype.handleAuthenticationInputResponse=function(i){var r=i;n.impl.PatternInputImpl.validateFormat(r)?t.prototype.handleAuthenticationInputResponse.call(this,i):this.performErrorRecoveryForError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."))},i.prototype.handleRegistrationInputResponse=function(i){var r=i,u=this._authenticatorConfig;if(!n.impl.PatternInputImpl.validateFormat(r)){this.performErrorRecoveryForError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."));return}if(u.min_length&&n.impl.PatternInputImpl.getPatternLength(r)<u.min_length){this.performErrorRecoveryForError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Invalid pattern length."));return}t.prototype.handleRegistrationInputResponse.call(this,i)},i.prototype.generateSecretToSignForInputResponse=function(n){var t=n;return t.getPatternDescription()},i}(t.AuthenticationDriverCentralizedSecretInputBased);t.AuthenticationDriverPattern=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i,r){return t.call(this,n,i,r)||this}return __extends(i,t),Object.defineProperty(i.prototype,"pinLength",{get:function(){var n=this._authenticatorConfig;return n.length},enumerable:!0,configurable:!0}),i.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPinAuthSession("pin_centralized",this.user.name,this.pinLength)},i.prototype.handleRegistrationInputResponse=function(i){var r=i;if(r.getPin().length!=this.pinLength){this.performErrorRecoveryForError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.InvalidInput,"Invalid PIN length provided.",{expected_length:this.pinLength}));return}t.prototype.handleRegistrationInputResponse.call(this,i)},i.prototype.generateSecretToSignForInputResponse=function(n){var t=n;return t.getPin()},i}(t.AuthenticationDriverCentralizedSecretInputBased);t.AuthenticationDriverPinCode=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u=function(r){function u(n,t,i){return r.call(this,n,t,i)||this}return __extends(u,r),u.prototype.createAuthenticatorSession=function(){var n=this,t=this.generatePlaceholderServerTokenGenerationPayload(),i=u.placeholderExtensionPoint.firstNonNull(function(i){return i.createPlaceholderAuthSession(n._authenticatorDescription.getPlaceholderId(),n._authenticatorConfig.placeholder_type||"",n._authenticatorDescription.getName()||"",n.user.name,n._authenticatorConfig.data||"",t)});return i?i:this._uiHandler.createPlaceholderAuthSession(this._authenticatorDescription.getPlaceholderId(),this._authenticatorConfig.placeholder_type||"",this._authenticatorDescription.getName()||"",this.user.name,this._authenticatorConfig.data||"",t)},u.prototype.authenticateOrRegisterInStratedSession=function(){var n=this;this._inputSession.promiseInput().then(function(t){return n.handleInputOrControlResponse(t)},function(i){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},u.prototype.authenticateInStartedSession=function(n){this.authenticateOrRegisterInStratedSession(n)},u.prototype.registerInStartedSession=function(n){this.authenticateOrRegisterInStratedSession(n)},u.prototype.handleAuthenticationInputResponse=function(n){this.handleAuthenticationOrRegistrationInputResponse(n)},u.prototype.handleRegistrationInputResponse=function(n){this.handleAuthenticationOrRegistrationInputResponse(n)},u.prototype.handleAuthenticationOrRegistrationInputResponse=function(n){n instanceof t.PlaceholderAuthSuccessResponse?(this._sdk.log(t.LogLevel.Debug,"Placeholder received PlaceholderAuthSuccessResponse."),this.handlePlaceholderSuccessResponse(n)):n instanceof t.PlaceholderAuthFailureResponse?(this._sdk.log(t.LogLevel.Debug,"Placeholder received PlaceholderAuthFailureResponse."),this.handlePlaceholderFailureResponse(n)):n instanceof t.PlaceholderAuthFailureWithServerProvidedStatusResponse?(this._sdk.log(t.LogLevel.Debug,"Placehoder received PlaceholderAuthFailureWithServerProvidedStatusResponse"),this.processAuthFailureAssertionAndHandleError(n.getFailureError(),1)):(this._sdk.log(t.LogLevel.Error,"Placeholder received unknkown response type."),this.performErrorRecoveryForError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Placeholder received unknkown response type.")))},u.prototype.handlePlaceholderSuccessResponse=function(n){var i={token:n.getPlaceholderToken()};this._operationMode==t.AuthenticatorSessionMode.Authentication?this.processAuthenticateAssertion(i):this.processRegisterAssertion(i)},u.prototype.handlePlaceholderFailureResponse=function(n){this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"auth_failure",{num_of_failures:1});var r={status:n.getRegistrationStatus()==t.AuthenticatorRegistrationStatus.Registered?i.Protocol.AuthenticationMethodStatus.Registered:i.Protocol.AuthenticationMethodStatus.Unregistered,expired:n.getExpired(),locked:n.getLocked(),last_used:0};this._authenticatorDescription.updateWithAuthenticatorState(r);this.performErrorRecoveryForError(n.getFailureError())},u.prototype.generatePlaceholderServerTokenGenerationPayload=function(){var n=this.user.deviceId||this._actionDriver._controlFlowProcessor._session.deviceId(),t={assertion_id:this._authenticatorDescription.assertionId,challenge:this._actionDriver._controlFlowProcessor.challenge,device_id:n,auth_type:this._authenticatorDescription.getAuthenticatorId()};return btoa(JSON.stringify(t))},u.placeholderExtensionPoint=new i.ExtensionPoint(n.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_PLACEHOLDER_EXTENSION),u}(r.AuthenticationDriver);r.AuthenticationDriverPlaceholder=u})(r=i.authenticationdrivers||(i.authenticationdrivers={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i,r){var u=t.call(this,n,i,r)||this;return u._pendingRestartRequest=!1,u}return __extends(i,t),i.prototype.createAuthenticatorSession=function(){return this._pendingRestartRequest=!1,this._uiHandler.createSecurityQuestionAuthSession("question",this.user.name)},i.prototype.authenticateInStartedSession=function(i){var r=this,u=Promise.resolve(null);this._pendingRestartRequest&&(this._pendingRestartRequest=!1,u=this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"restart",{}).then(function(t){t.data&&t.data.question?r._currentStep=r.loadStepFromQuestionDict(t.data.question):r.completeAuthenticatorSessionWithError(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unexpected response to question restart request."))}));u.then(function(){t.prototype.authenticateInStartedSession.call(r,i)})},i.prototype.loadStepFromQuestionDict=function(t){var i=Object.keys(t);if(i.length!=1)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Expecting a single authentication question.");return n.impl.SecurityQuestionStepDescriptionImpl.createForAuthQuestion(new n.impl.SecurityQuestionImpl(i[0],t[i[0]],!0))},i.prototype.createInitialInputStep=function(){var t=this._authenticatorConfig,i,r;switch(this._operationMode){case n.AuthenticatorSessionMode.Authentication:if(!t.question)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Expecting authentication question dictionary.");return this.loadStepFromQuestionDict(t.question);case n.AuthenticatorSessionMode.Registration:if(!t.questions||!t.reg_min_questions)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Expecting registration question dictionary.");return i=t.questions,r=Object.keys(i).map(function(t){return new n.impl.SecurityQuestionImpl(t,i[t].text,i[t].registered)}),n.impl.SecurityQuestionStepDescriptionImpl.createForRegistrationQuestions(r,t.reg_min_questions)}},i.prototype.prepareNextAuthenticationStep=function(n){return this.loadStepFromQuestionDict(n.data.question)},i.prototype.updateCurrentAuthenticationStep=function(n,t){return t},i.prototype.handleAuthenticationInputResponse=function(t){var i=t,r;if(this.verifyValidAnswers(i),i.getAnswers().length!=1)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Expecting exactly one answer on secuirty question authentication.");r=this.securityQuestionAnswersResposneToAnswerMap(i);this.processAuthenticateAssertion({answer:r})},i.prototype.handleRegistrationInputResponse=function(t){var i=t,r;if(this.verifyValidAnswers(i),this.currentSecurityQuestionsStep().getMinAnswersNeeded()>i.getAnswers().length)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Not enough answers provided to security questions registration process.");r=this.securityQuestionAnswersResposneToAnswerMap(i);this.processRegisterAssertion({answers:r})},i.prototype.handleErrorRecoveryAction=function(i,r){r.getErrorCode()==n.AuthenticationErrorCode.InvalidInput&&(this._pendingRestartRequest=!0);t.prototype.handleErrorRecoveryAction.call(this,i,r)},i.prototype.verifyValidAnswers=function(t){for(var r,i=0,u=t.getAnswers();i<u.length;i++)if(r=u[i],r.getAnswer()&&(!r.getAnswer().getAnswerText()||r.getAnswer().getAnswerText().length==0))throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Empty answers are not allowed.");},i.prototype.securityQuestionAnswersResposneToAnswerMap=function(t){var i=this,r={};return t.getAnswers().forEach(function(t){if(i.currentSecurityQuestionsStep().getSecurityQuestions().indexOf(t.getQuestion())<0)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Answer provided to a question not included in this step.");var u=i._sdk.host.calcHexStringEncodedSha256Hash(n.util.asciiToHex(t.getAnswer().getAnswerText().toLowerCase()));r[t.getQuestion().getSecurityQuestionId()]=u}),r},i.prototype.currentSecurityQuestionsStep=function(){return this._currentStep},i}(t.AuthenticationDriverMultiStep);t.AuthenticationDriverSecurityQuestions=i})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n}(),i,r;n.AuthenticationDriverSessionResult=t;i=function(n){function t(t,i){var r=n.call(this)||this;return r.requiredAuthenticator=t||null,r.allowedAuthenticators=i||null,r}return __extends(t,n),t}(t);n.AuthenticationDriverSessionResultSwitchAuthenticator=i;r=function(n){function t(t){var i=n.call(this)||this;return i.assertionResult=t,i}return __extends(t,n),t}(t);n.AuthenticationDriverSessionResultAuthenticationCompleted=r})(t=n.authenticationdrivers||(n.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(r){function u(n,t,i){var u=r.call(this,n,t,i)||this;return u._previousSelectedDevices=[],u.methodName="totp",u.setupDataModel(t,i),u}return __extends(u,r),u.prototype.setupDataModel=function(n){this._state=n.state;this._requiresChallengeGeneration=n.state!=t.Protocol.AuthenticationMethodTotpState.Validate;this._selectedDevices=null;this._state==t.Protocol.AuthenticationMethodTotpState.Validate&&n.challenge&&(this._challenge=this.createTotpChallenge(n.challenge));n.selectable_devices&&(this._selectableDevices=i.AuthenticationDriverDescriptorTotp.createTargetsFromConfig(n))},u.prototype.createAuthenticatorSession=function(){var i,r,t;if(this._authenticationParameters&&(i=this._authenticationParameters.filter(function(t){t instanceof n.AuthenticationActionParameterTargetSelection}),i.length!=0&&(this._sdk.log(n.LogLevel.Debug,"Target based driver found target selection parameters."),r=this._selectableDevices.reduce(function(n,t){return n[t.getDeviceIdentifier()]=t,n},{}),this._pendingTargetSelection=i.map(function(t){var u=t.getTarget(),i=r[u.getDeviceIdentifier()];if(!i)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Authentication parameter tried to select a device not presented as a selectable target");return i},{}),this._sdk.log(n.LogLevel.Debug,"Target based driver will select targets "+this._pendingTargetSelection+" based on selection parameter."))),t=this._uiHandler.createTotpAuthSession("totp",this.user.name),!t)throw n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTotpAuthSession");return t.setAvailableTargets(this._selectableDevices),t},u.prototype.handleRegistrationInputResponse=function(){throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Cannot register TOTP authenticator.");},u.prototype.registerInStartedSession=function(){throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Cannot register TOTP authenticator.");},u.prototype.authenticateInStartedSession=function(){!this._selectedDevices&&this._pendingTargetSelection&&this._pendingTargetSelection.length&&(this._sdk.log(n.LogLevel.Debug,"TOTP authentication driver has "+this._pendingTargetSelection.length+" pending targets."),this._selectedDevices=this._pendingTargetSelection);this.requestInput()},u.prototype.requestInput=function(){var t=this;this._inputSession.setTargetDevices(this._selectedDevices);this._inputSession.setChallenge(this._challenge);this.pendingChallengeGeneration()?this.sendGenerateTotpAssertion():this._inputSession.promiseInput().then(function(n){t.handleInputOrControlResponse(n)}).catch(function(i){t.performErrorRecoveryForError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i))})},u.prototype.handleAuthenticationInputResponse=function(t){var u=this,r,i;if(t.getSelectedTargets()){if(this._sdk.log(n.LogLevel.Debug,"Handling target selection Input."),this._selectedDevices=t.getSelectedTargets().map(function(t){var i=t;if(u._selectableDevices.indexOf(i)<0)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to select a Totp target not originally listed in the session.");return i}),this._selectedDevices.length===0)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.InvalidInput,"No targets selected for TOTP.");this.requestInput()}else if(t.getAuthenticatorInput())this._sdk.log(n.LogLevel.Debug,"Handling OTP code Input."),r=t.getAuthenticatorInput().getCode(),i={totp:r},this._selectedDevices&&(i.device_ids=this._selectedDevices.map(function(n){return n.getDeviceIdentifier()})),this.processAuthenticateAssertion(i);else throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Invalid target-based authenticator response type received from application callback. Target-based authenticator inputs must be created by calling TargetBasedAuthenticatorInput.createAuthenticatorInput.");},u.prototype.sendGenerateTotpAssertion=function(){var i=this,r={};this._selectedDevices&&(r.device_ids=this._selectedDevices.map(function(n){return n.getDeviceIdentifier()}));this._sdk.log(n.LogLevel.Debug,"Requesting TOTP generation");this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"generate",r,{}).then(function(r){i._previousSelectedDevices=i._selectedDevices||[];r.assertion_error_code&&r.assertion_error_code!=t.Protocol.AssertionErrorCode.FailOver&&(i._sdk.log(n.LogLevel.Error,"Assertion error encountered."),i._selectedDevices=null);!i.handleAuthenticateAssertionResult(r)&&r.data&&(i._state=r.data.state,r.data.challenge&&(i._challenge=i.createTotpChallenge(r.data.challenge)),i.requestInput())}).catch(function(t){i.performErrorRecoveryForError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})},u.prototype.pendingChallengeGeneration=function(){var n=this._selectedDevices&&(this._previousSelectedDevices.length!==this._selectedDevices.length||this._previousSelectedDevices.some(function(n,t){return n!==this._selectedDevices[t]},this)),i=!this._selectableDevices;return this._requiresChallengeGeneration&&(n||i&&this._state==t.Protocol.AuthenticationMethodTotpState.Generate)},u.prototype.createTotpChallenge=function(t){var i=new n.TotpChallenge;return i.setValue(t.value),i.setFormat(n.TotpChallengeFormatImpl.fromAssertionFormat(t.format)),i},u.prototype.handleAuthenticateAssertionResult=function(i){if(i.assertion_error_code&&i.assertion_error_code==t.Protocol.AssertionErrorCode.RepeatCurrentStep&&i.data&&i.data.reason=="check_digit"){this._sdk.log(n.LogLevel.Info,"handleAuthenticateAssertionResult() for Totp code with incorrect check digit");var u=new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.InvalidInput,i.assertion_error_message||"Totp code with incorrect check digit");return u.setPublicProperty(n.AuthenticationErrorProperty.AuthenticatorInvalidInputErrorDescription,n.AuthenticationErrorPropertySymbol.AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit),this.performErrorRecoveryForError(u),!0}return r.prototype.handleAuthenticateAssertionResult.call(this,i)},u}(i.AuthenticationDriver);i.AuthenticationDriverTotp=r})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i,r;(function(n){n.LONG="tooLong";n.SHORT="tooShort";n.LOUD="tooLoud";n.SOFT="tooSoft";n.NOISY="tooNoisy";n.WRONG_PASSPHRASE="wrongPassphrase";n.VALID_PASSPHRASE="000"})(i||(i={}));r=function(t){function r(n,i,r){return t.call(this,n,i,r)||this}return __extends(r,t),r.prototype.createAuthenticatorSession=function(){return this._uiHandler.createVoiceAuthSession("voice",this.user.name)},r.prototype.createInitialInputStep=function(){var t=this._authenticatorConfig;return new n.impl.AudioAcquisitionStepDescriptionImpl(this.createStepTag(),t.passphrase_text)},r.prototype.prepareNextAuthenticationStep=function(t){var i=this._authenticatorConfig;return new n.impl.AudioAcquisitionStepDescriptionImpl(this.createStepTag(t.data&&t.data.additional_error_code),i.passphrase_text)},r.prototype.updateCurrentAuthenticationStep=function(n){return this.prepareNextAuthenticationStep(n)},r.prototype.handleAuthenticationInputResponse=function(n){var t=n;this.processAuthenticateAssertion(t.getAcquisitionResponse())},r.prototype.handleRegistrationInputResponse=function(n){var t=n;this.processRegisterAssertion(t.getAcquisitionResponse())},r.prototype.createStepTag=function(n){var t=n?this.mapHintToVoiceError(n):i.VALID_PASSPHRASE;return"voice_"+t},r.prototype.mapHintToVoiceError=function(t){switch(t){case 101:return i.LONG;case 102:return i.SHORT;case 103:return i.LOUD;case 104:return i.SOFT;case 105:return i.NOISY;case 106:return i.WRONG_PASSPHRASE;default:throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Voice error code "+t+" is unknown/unhandled");}},r}(t.AuthenticationDriverMultiStep);t.AuthenticationDriverVoice=r})(i=t.authenticationdrivers||(t.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n.AuthenticatorDrivers={password:new n.SimpleAuthenticationDriverDescriptor(n.AuthenticationDriverPassword),pin_centralized:new n.SimpleAuthenticationDriverDescriptor(n.AuthenticationDriverPinCode),pin:new n.AuthenticationDriverDescriptorLocal(n.AuthenticationDriverLocalPinCode,n.AuthenticationDriverLocalPinCode.authenticatorName),pattern:new n.AuthenticationDriverDescriptorLocal(n.AuthenticationDriverLocalPattern,n.AuthenticationDriverLocalPattern.authenticatorName),pattern_centralized:new n.SimpleAuthenticationDriverDescriptor(n.AuthenticationDriverPattern),fingerprint:new n.AuthenticationDriverDescriptorFingerprint,face_id:new n.AuthenticationDriverDescriptorNativeFace,otp:new n.AuthenticationDriverDescriptorOtp,face_server:new n.AuthenticationDriverDescriptorFace,voice_server:new n.AuthenticationDriverDescriptorVoice,mobile_approve:new n.AuthenticationDriverDescriptorMobileApprove,totp:new n.AuthenticationDriverDescriptorTotp,question:new n.SimpleAuthenticationDriverDescriptor(n.AuthenticationDriverSecurityQuestions),__placeholder:new n.SimpleAuthenticationDriverDescriptor(n.AuthenticationDriverPlaceholder)}})(t=n.authenticationdrivers||(n.authenticationdrivers={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.enabledCollectors=n}return n.prototype.isEnabled=function(){var n=this.getAssociatedCollectorType();return n==null?!0:this.enabledCollectors.indexOf(n)!=-1},n}();n.Collector=t})(t=n.collectors||(n.collectors={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(t){function i(n,i){var r=t.call(this,n)||this;return r.cacheValidityPeriod=i,r}return __extends(i,t),i.prototype.provide=function(n){var t=this;return new Promise(function(i,r){var u=t.getCachedData(n);u?i(u):t.provideNewData(n).then(function(r){t.saveCollectionResultToLocalStorage(n,r);i(r)},r)})},i.prototype.saveCollectionResultToLocalStorage=function(n,t){var r=n.host,u=this.getSchemeVersionTarsusKeyPath(),i={};i.timeStamp=Date.now();i.collectionResult=t;r.writeStorageKey(u,i)},i.prototype.getCachedData=function(t){var u=t.host,f=this.getSchemeVersionTarsusKeyPath(),i=u.readStorageKey(f),r;return!i.collectionResult||!i.timeStamp?(t.log(n.LogLevel.Debug,"No collected data found in cache."),null):(r=i.timeStamp,Date.now()-r>this.cacheValidityPeriod)?(t.log(n.LogLevel.Debug,"Cached collected data invalidated."),null):(t.log(n.LogLevel.Debug,"Loaded cached collector data: "+JSON.stringify(i.collectionResult)),i.collectionResult)},i}(t.Collector);t.CacheableCollector=i})(i=t.collectors||(t.collectors={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(i){var r=function(i){function r(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.provide=function(t){var r={},i={};return i.audio_acquisition_supported=t.host.queryHostInfo(n.sdkhost.HostInformationKey.AudioAcquitisionSupported)=="true",i.finger_print_supported=t.host.queryHostInfo(n.sdkhost.HostInformationKey.FingerprintSupported)=="true",i.image_acquisition_supported=t.host.queryHostInfo(n.sdkhost.HostInformationKey.ImageAcquitisionSupported)=="true",i.persistent_keys_supported=t.host.queryHostInfo(n.sdkhost.HostInformationKey.PersistentKeysSupported)=="true",i.face_id_key_bio_protection_supported=t.host.queryHostInfo(n.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported)=="true",i.fido_client_present=t.host.queryHostInfo(n.sdkhost.HostInformationKey.FidoClientPresent)=="true",i.dyadic_present=t.host.queryHostInfo(n.sdkhost.HostInformationKey.DyadicPresent)=="true",i.installed_plugins=t.pluginManager.getInitializedPlugins().map(function(t){return{plugin_name:t.getPluginInfo().getPluginName(),plugin_version:n.tarsusplugin.impl.PluginInfoImpl.versionToString(t.getPluginInfo())}}),t.host.queryHostInfo(n.sdkhost.HostInformationKey.HostProvidedFeatures)!=""&&(i.host_provided_features=t.host.queryHostInfo(n.sdkhost.HostInformationKey.HostProvidedFeatures)),r=i,Promise.resolve(r)},r.prototype.getAssociatedCollectorType=function(){return t.CollectorType.Capabilities},r}(i.Collector);i.CapabilitiesCollector=r})(r=i.collectors||(i.collectors={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.provide=function(){var r={},f,e,u,i;for(f in n.CollectorType)r[f]=t.Protocol.CollectorState.Disabled;for(e in this.enabledCollectors)r[e]=t.Protocol.CollectorState.Active;u={};for(i in n.CollectorType)this.isNumeric(i)&&(u[n.CollectorType[i].toLowerCase()]=r[i]);return Promise.resolve(u)},r.prototype.getAssociatedCollectorType=function(){return null},r.prototype.isNumeric=function(n){return parseInt(n,10)>=0},r}(i.Collector);i.CollectorsStateCollector=r})(i=t.collectors||(t.collectors={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.provide=function(n){var i=n.host.readStorageKey(t.User.storageKey),r;return i.length=i.length||0,r={},r.logged_users=i.length,Promise.resolve(r)},r.prototype.getAssociatedCollectorType=function(){return n.CollectorType.DeviceDetails},r}(i.Collector);i.DeviceDetailsCollector=r})(i=t.collectors||(t.collectors={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(n){return i.call(this,n,r.cacheValidityPeriod)||this}return __extends(r,i),r.prototype.provideNewData=function(i){var r=this;return new Promise(function(u){var e,o,h,f,s,c;if(!i.currentSession)throw"No valid session.";for(e={},i.log(n.LogLevel.Debug,"Refreshing fido authenticators data"),o=[],h=t.authenticationdrivers._fidoClientProviders,f=0,s=h;f<s.length;f++)c=s[f],o.push(c.getAvailableAuthenticatorsIds(i));Promise.all(o.map(function(n){return n.catch(function(n){return new Error(n)})})).then(function(n){var t=r.getCollectedAaids(n,i);e.fido=t;u(e)}).catch(function(t){i.log(n.LogLevel.Error,"Error parsing fido authenticators collection results"+t);u({})})})},r.prototype.getAssociatedCollectorType=function(){return n.CollectorType.FidoAuthenticators},r.prototype.getSchemeVersionTarsusKeyPath=function(){return new t.TarsusKeyPath("fido_collection_result")},r.prototype.getCollectedAaids=function(t,i){for(var c=[],r,f,o,s,h,u=0,e=t;u<e.length;u++)if(r=e[u],r instanceof Error)i.log(n.LogLevel.Error,"Error collecting fido authenticators details "+r);else if(r&&r.length>0)for(f=0,o=r;f<o.length;f++)s=o[f],s&&(h={},h.aaid=s,c.push(h));return c},r.cacheValidityPeriod=6048e5,r}(i.CacheableCollector);i.FidoAuthenticatorsCollector=r})(i=t.collectors||(t.collectors={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(){return i!==null&&i.apply(this,arguments)||this}return __extends(r,i),r.prototype.provide=function(n){for(var e={},u,f,t=0,i=r.authenticatorDriversLocal;t<i.length;t++)u=i[t],f=this.provideLocalEnrollmentData(n,u),f&&(e[u]=f);return Promise.resolve(e)},r.prototype.getAssociatedCollectorType=function(){return n.CollectorType.LocalEnrollments},r.prototype.provideLocalEnrollmentData=function(n,t){var i=null,r;return n.currentSession&&(r=n.currentSession.user.localEnrollments[t],r&&(i={},i.registration_status=r.status,i.validation_status=r.validationStatus)),i},r.authenticatorDriversLocal=[t.authenticationdrivers.AuthenticationDriverLocalPinCode.authenticatorName,t.authenticationdrivers.AuthenticationDriverLocalPattern.authenticatorName,t.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName,t.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName],r}(i.Collector);i.LocalEnrollmentsCollector=r})(i=t.collectors||(t.collectors={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n.TarsusCollectors={capabilities:{createCollector:n.CapabilitiesCollector},collector_state:{createCollector:n.CollectorsStateCollector},device_details:{createCollector:n.DeviceDetailsCollector},hw_authenticators:{createCollector:n.FidoAuthenticatorsCollector},local_enrollments:{createCollector:n.LocalEnrollmentsCollector}}})(t=n.collectors||(n.collectors={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this._authCtor=n}return n.prototype.createFidoAuthenticator=function(n,t,i,r,u,f){return new this._authCtor(n,t,i,r,u,f)},n.prototype.isAuthenticatorSupportedOnDevice=function(){return!0},n}();n.SimpleFidoAuthenticatorDescriptor=t})(t=n.fidoclient||(n.fidoclient={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(i){function r(){return i.call(this,t.FidoAuthenticatorFingerprint)||this}return __extends(r,i),r.prototype.isAuthenticatorSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.FingerprintSupported)=="true"},r}(t.SimpleFidoAuthenticatorDescriptor);t.FidoAuthenticatorDescriptorFingerprint=i})(i=t.fidoclient||(t.fidoclient={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(i){function r(){return i.call(this,t.FidoAuthenticatorNativeFace)||this}return __extends(r,i),r.prototype.isAuthenticatorSupportedOnDevice=function(t){return t.sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported)=="true"},r}(t.SimpleFidoAuthenticatorDescriptor);t.FidoAuthenticatorDescriptorNativeFace=i})(i=t.fidoclient||(t.fidoclient={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(){function i(n,t,i,r,u,f){this._client=t;this._sdk=t.sdk;this._uiHandler=r;this._username=i;this._clientContext=u;this._action=f;this._authenticationDescription=n}return i.prototype.signHexWithKeyPair=function(n,t){return n.signHex(t)},i.prototype.generateKeyIdHex=function(t,i){return this._sdk.host.calcHexStringEncodedSha256Hash(n.util.asciiToHex(i+"."+t+"."+this.aaid))},i.prototype.fidoRegisterWithHexUaf1TlvResponse=function(i,r){var u=this;return new Promise(function(f,e){u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator start auth session");u.startAuthenticationSession(n.AuthenticatorSessionMode.Registration);u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator Prepare FCHash and key ID");var s=u._sdk.host.calcHexStringEncodedSha256Hash(n.util.asciiToHex(r)),o=u.generateKeyIdHex(i,u._username);u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator generate key pair");u.generateKeyPair(o,i,u._username).then(function(i){u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator prepare KRD");var f=n.util.base64ToHex(i.publicKeyToJson().key),r={TAG_AAID:u.aaid,TAG_ASSERTION_INFO:{AuthenticatorVersion:u.authenticatorVersion,AuthenticationMode:1,SignatureAlgAndEncoding:t.ALG_SIGN_SECP256R1_ECDSA_SHA256_RAW,PublicKeyAlgAndEncoding:t.ALG_KEY_ECC_X962_RAW},TAG_FINAL_CHALLENGE_HASH:s,TAG_KEYID:o,TAG_COUNTERS:{SignCounter:u.signCounter,RegCounter:u.regCounter},TAG_PUB_KEY:f},e=n.util.tlvEncodeHex(t.FidoTLVTags,{TAG_UAFV1_KRD:r});return u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator sign assertion"),u.signHexWithKeyPair(i,e).then(function(i){u._sdk.log(n.LogLevel.Debug,"FIDO KRD Surrogate Assertion signature "+i);var e={TAG_UAFV1_REG_ASSERTION:{TAG_UAFV1_KRD:r,TAG_ATTESTATION_BASIC_SURROGATE:{TAG_SIGNATURE:i}}},f=n.util.tlvEncodeHex(t.FidoTLVTags,e);return u._sdk.log(n.LogLevel.Debug,"FIDO reg assertion TLV hex: "+f),n.util.hexToBase64(f)}).finally(function(){return i.closeKeyPair()})}).finally(function(){u.finishAuthenticationSession()}).then(f,e)})},i.prototype.fidoDeregister=function(n){var t=this.generateKeyIdHex(n,this._username);return this.deleteKeyPair(t,n,this._username)},i.prototype.fidoAuthenticateWithHexUaf1TlvResponse=function(i,r){var u=this;return new Promise(function(f,e){var h,o,s,c;u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator start auth session");u.startAuthenticationSession(n.AuthenticatorSessionMode.Authentication);u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator Prepare FCHash and key ID");h=u._sdk.host.calcHexStringEncodedSha256Hash(n.util.asciiToHex(r));o=u.generateKeyIdHex(i,u._username);u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator prepare signed data block for FIDO auth assertion");s={TAG_AAID:u.aaid,TAG_ASSERTION_INFO:{AuthenticatorVersion:u.authenticatorVersion,AuthenticationMode:1,SignatureAlgAndEncoding:t.ALG_SIGN_SECP256R1_ECDSA_SHA256_RAW},TAG_AUTHENTICATOR_NONCE:u._sdk.host.generateRandomHexString(16),TAG_FINAL_CHALLENGE_HASH:h,TAG_TRANSACTION_CONTENT_HASH:"",TAG_KEYID:o,TAG_COUNTERS:{SignCounter:u.signCounter}};c=n.util.tlvEncodeHex(t.FidoTLVTags,{TAG_UAFV1_SIGNED_DATA:s});u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator loading key");u.loadKeyPair(o,i,u._username).then(function(i){return u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator signing auth assertion"),u.signHexWithKeyPair(i,c).then(function(i){u._sdk.log(n.LogLevel.Debug,"FIDO authentication assertion signature "+i);var f={TAG_UAFV1_AUTH_ASSERTION:{TAG_UAFV1_SIGNED_DATA:s,TAG_SIGNATURE:i}},r=n.util.tlvEncodeHex(t.FidoTLVTags,f);return u._sdk.log(n.LogLevel.Debug,"FIDO auth assertion TLV hex: "+r),n.util.hexToBase64(r)}).finally(function(){return i.closeKeyPair()})}).finally(function(){u.finishAuthenticationSession()}).then(f,e)})},i.prototype.startAuthenticationSession=function(n){this._authMode=n},i.prototype.finishAuthenticationSession=function(){},i}();t.SimpleFidoAuthenticator=i})(i=t.fidoclient||(t.fidoclient={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var u=function(){function r(n,t,i,r,u,f){this._userId=n;this._vaultData=t;this._vaultId=i;this._vaultOwner=r;this._sdk=u;this._uiHandler=f}return Object.defineProperty(r,"noIntegrityElementKey",{get:function(){return"element"},enumerable:!0,configurable:!0}),r.getStorageKeyForVaultsForUser=function(n){return new t.TarsusKeyPath("per_user",n,"vaults")},r.migrateIncorrectlyStoredVaultsForUserIfExists=function(n,i){var u=new t.TarsusKeyPath("per_user","user","vaults"),r=i.host.readStorageKey(u);r&&0<Object.keys(r).length&&(i.host.writeStorageKey(n,r),i.host.deleteStorageKey(u))},r.vaultsForUser=function(n,t){var r=this.getStorageKeyForVaultsForUser(n),i=t.host.readStorageKey(r);return(!i||0>=Object.keys(i).length)&&(this.migrateIncorrectlyStoredVaultsForUserIfExists(r,t),i=t.host.readStorageKey(r)),i||{}},r.getVaultForUserWithId=function(t,r,u,f,e){var h=this.vaultsForUser(t,f),o=h[r.toString()],s;if(!o){f.log(n.LogLevel.Warning,"vault '"+r+"' for user '"+t+"' not found in '"+this.getStorageKeyForVaultsForUser(t).toString()+"'");throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Vault not found.");}if(s=i.AuthenticatorVaults[o.type],!s)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"unhandled vault type: "+o.type);return new s.loadFromData(t,o,r,u,f,e)},r.updateVaultForUserWithId=function(t,i,u,f){if(i.data.length>r.MAX_DATA_SIZE)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"vault size can not exceed "+r.MAX_DATA_SIZE);var e=this.vaultsForUser(t,f);e[u.toString()]=i;f.host.writeStorageKey(this.getStorageKeyForVaultsForUser(t),e)},r.deleteVaultForUserWithId=function(t,r,u){var e,f,o;if(u.log(n.LogLevel.Debug,"Delete vault "+r+" for user "+t),e=this.vaultsForUser(t,u),f=e[r.toString()],!f){u.log(n.LogLevel.Warning,"vault '"+r+"' for user '"+t+"' not found in '"+this.getStorageKeyForVaultsForUser(t).toString()+"'");return}if(o=i.AuthenticatorVaults[f.type],!o)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"unhandled vault type: "+f.type);u.log(n.LogLevel.Debug,"Vault descriptor found; deleting.");o.deletePrivateResources(t,f,u);delete e[r.toString()];u.log(n.LogLevel.Debug,"Updating storage after vault deletion.");u.host.writeStorageKey(this.getStorageKeyForVaultsForUser(t),e)},r.deleteAllVaultsForUser=function(n,t){t.host.deleteStorageKey(this.getStorageKeyForVaultsForUser(n))},r.prototype.writeVaultKey=function(t,i){var u=this,f;if(!this._unlockedData)return Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to write to a locked vault."));if(this.noIntegrity){if(t!=r.noIntegrityElementKey)return Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unprotected vault may store only '"+r.noIntegrityElementKey+"' key"));if(!n.util.isHexString(i))return Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Expecting hex string."))}return this._unlockedData[t]=i,f=this.hexStringFromJsonToEncrypt(this._unlockedData),this.encrypt(f).then(function(n){u._vaultData.data=n;r.updateVaultForUserWithId(u._userId,u._vaultData,u._vaultId,u._sdk)})},r.prototype.readVaultKey=function(t){if(!this._unlockedData)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to read from  a locked vault.");if(this.noIntegrity&&t!=r.noIntegrityElementKey)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unprotected vault may store only '"+r.noIntegrityElementKey+"' key");return this._unlockedData[t]},r.prototype.unlock=function(t,i){var r=this;return new Promise(function(u,f){if(r._rejectFn=f,r._completeFn=u,r._policyAction=t,r._clientContext=i,r._sdk.log(n.LogLevel.Debug,"Creating vault unlock authenticator session"),r._inputSession=r.createAuthenticatorSession(),!r._inputSession)throw n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from vault unlock authenticator session creation.");r._sdk.log(n.LogLevel.Debug,"Invoking startSession on vault unlock authenticator session");r._inputSession.startSession(r.vaultDescriptor.getDescription(r._sdk),n.AuthenticatorSessionMode.Authentication,t,i);r.unlockInStartedSession()})},Object.defineProperty(r.prototype,"vaultDescriptor",{get:function(){return i.AuthenticatorVaults[this._vaultData.type]},enumerable:!0,configurable:!0}),r.prototype.lock=function(){this._unlockedData=null;this.finalizeLock()},Object.defineProperty(r.prototype,"noIntegrity",{get:function(){return this._vaultData.noIntegrity},enumerable:!0,configurable:!0}),r.prototype.hexStringFromJsonToEncrypt=function(t){return this.noIntegrity?t[r.noIntegrityElementKey]:n.util.asciiToHex(JSON.stringify(t))},r.prototype.jsonFromDecryptedHexString=function(t){if(this.noIntegrity){var i={};return i[r.noIntegrityElementKey]=t,i}return JSON.parse(n.util.hexToAscii(t))},r.prototype.isEmpty=function(){return this._vaultData===null||this._vaultData.data===null||this._vaultData.data===""},r.prototype.unlockInStartedSession=function(){var t=this;this._sdk.log(n.LogLevel.Debug,"Getting vault unlock input");this._inputSession.promiseInput().then(function(i){if(i.isControlRequest())t._sdk.log(n.LogLevel.Debug,"Vault unlock: received control request "+i.getControlRequest()),t.processControlRequest(i.getControlRequest());else return t._sdk.log(n.LogLevel.Debug,"Vault got authenticator input. Trying to unlock."),t.prepareToUnlock(t._inputSession,i.getResponse(),t._vaultData.data,t._policyAction,t._clientContext).then(function(){return t._sdk.log(n.LogLevel.Debug,"Unlock preparation complete."),t.isEmpty()?(t._sdk.log(n.LogLevel.Info,"Unlockling empty vault."),t._unlockedData={},!0):(t._sdk.log(n.LogLevel.Debug,"Decrypting vault."),t.decrypt(t._vaultData.data).then(function(i){return t._unlockedData=t.jsonFromDecryptedHexString(i),t._sdk.log(n.LogLevel.Info,"Vault unlocked."),!0}))}).then(function(n){t._inputSession.endSession();t._completeFn(n)})}).catch(function(i){var r=n.impl.AuthenticationErrorImpl.ensureAuthenticationError(i);t._sdk.log(n.LogLevel.Error,r.getMessage());t.handleLocalDecryptError(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(r))})},r.prototype.getValidErrorRecoveryOptions=function(t){var r=[n.AuthenticationErrorCode.AppImplementation,n.AuthenticationErrorCode.Internal,n.AuthenticationErrorCode.UserCanceled],u=[n.AuthenticationErrorCode.AuthenticatorExternalConfigError,n.AuthenticationErrorCode.AuthenticatorInvalidated,n.AuthenticationErrorCode.AuthenticatorLocked],i;return r.indexOf(t.getErrorCode())>=0?[n.AuthenticationErrorRecovery.Fail]:(i=this._vaultOwner.getValidErrorRecoveryOptions(t),u.indexOf(t.getErrorCode())>=0&&(i=i.filter(function(t){return t!=n.AuthenticationErrorRecovery.RetryAuthenticator})),i)},r.prototype.handleLocalDecryptError=function(t){var i=this,r=this.getValidErrorRecoveryOptions(t),u=r.indexOf(n.AuthenticationErrorRecovery.RetryAuthenticator)>=0?n.AuthenticationErrorRecovery.RetryAuthenticator:n.AuthenticationErrorRecovery.Fail;this._inputSession.promiseRecoveryForError(t,r,u).then(function(u){switch(u){case n.AuthenticationErrorRecovery.RetryAuthenticator:i.unlockInStartedSession();break;case n.AuthenticationErrorRecovery.Fail:i._inputSession.endSession();i._rejectFn(t);break;case n.AuthenticationErrorRecovery.ChangeAuthenticator:if(r.indexOf(n.AuthenticationErrorRecovery.ChangeAuthenticator)>-1){i._inputSession.endSession();i._completeFn(!1);break}default:i._inputSession.endSession();i._rejectFn(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"recovery option choice was not offered"))}})},r.prototype.processControlRequest=function(t){this._sdk.log(n.LogLevel.Debug,"Processing control request "+t.getRequestType());switch(t.getRequestType()){case n.ControlRequestType.AbortAuthentication:this._inputSession.endSession();this._rejectFn(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"Authentication cancelled due to abort control request."));case n.ControlRequestType.ChangeMethod:this._inputSession.endSession();this._completeFn(!1);break;case n.ControlRequestType.CancelAuthenticator:this.invokeUiHandlerCancellation();break;case n.ControlRequestType.RetryAuthenticator:this.unlockInStartedSession();break;default:this._inputSession.endSession();this._rejectFn(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Invalid ControlRequestType value during authentication session."))}},r.prototype.invokeUiHandlerCancellation=function(){var t=this,i=this._vaultOwner.getValidCancelOptions();i==null?(this._inputSession.endSession(),this._rejectFn(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"Authentication cancelled due to abort control request."))):this._uiHandler.controlOptionForCancellationRequestInSession(i,this._inputSession).then(function(i){i.getRequestType()==n.ControlRequestType.CancelAuthenticator?(t._inputSession.endSession(),t._rejectFn(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned CancelAuthenticator which is an invalid option."))):t.processControlRequest(i)})},r.MAX_DATA_SIZE=1e3,r}(),r;i.AuthenticatorVault=u;r=function(){function t(n,t){this._type=n;this._name=t}return t.prototype.getAuthenticatorId=function(){return this._name},t.prototype.getName=function(){return this._name},t.prototype.getType=function(){return this._type},t.prototype.getSupportedOnDevice=function(){return!0},t.prototype.getRegistrationStatus=function(){return n.AuthenticatorRegistrationStatus.Registered},t.prototype.getDefaultAuthenticator=function(){return!1},t.prototype.getRegistered=function(){return!0},t.prototype.getExpired=function(){return!1},t.prototype.getLocked=function(){return!1},t.prototype.getEnabled=function(){return!0},t}();i.AuthenticatorVaultDescription=r})(i=t.vault||(t.vault={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u=function(r){function u(n,t,i,u,f,e){return r.call(this,n,t,i,u,f,e)||this}return __extends(u,r),Object.defineProperty(u.prototype,"aaid",{get:function(){return"1206#0002"},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"authenticatorVersion",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"signCounter",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"regCounter",{get:function(){return 0},enumerable:!0,configurable:!0}),u.prototype.keyTag=function(n,t){return new i.TarsusKeyPath("per_user",n,"fido_authenticators",this.aaid,t)},u.prototype.startAuthenticationSession=function(n){if(r.prototype.startAuthenticationSession.call(this,n),this._fpSession=this._uiHandler.createFingerprintAuthSession(i.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName,this._username),!this._fpSession)throw t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createFingerprintAuthSession.");this._fpSession.startSession(this._authenticationDescription,n,this._action,this._clientContext)},u.prototype.finishAuthenticationSession=function(){this._fpSession&&(this._fpSession.endSession(),this._fpSession=null)},u.prototype.signHexWithKeyPair=function(i,r){var u=this;return i.signHex(r).catch(function(f){if(f.getData()[n.sdkhost.ErrorDataInternalError]==n.sdkhost.InternalErrorWrongBiometric)return u._sdk.log(t.LogLevel.Debug,"FIDO signing received a wrong biometric error; retrying authentication."),u.signHexWithKeyPair(i,r);u._sdk.log(t.LogLevel.Debug,"FIDO signing received an error: "+f+". Propagating.");throw f;})},u.prototype.prepareKeyPairBio=function(n){var i=this;try{return this._fpSession?this._fpSession.promiseInput().then(function(r){if(r.isControlRequest())switch(r.getControlRequest().getRequestType()){case t.ControlRequestType.CancelAuthenticator:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"User cancelled authentication");default:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Unsupported control code when running fingerprint session within FIDO: "+r.getControlRequest().getRequestType());}else{var u=r.getResponse();return n.setBiometricPromptInfo(u.getPrompt(),i._uiHandler,i._fpSession),n}}):Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Attempt to prepare key biometrics without an existing FP session"))}catch(r){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(r))}},u.prototype.generateKeyPair=function(t,i,r){var u=this;return this._sdk.host.generateKeyPair(this.keyTag(r,t),n.sdkhost.KeyClass.FidoECCSigningKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,!0).then(function(n){return u.prepareKeyPairBio(n)})},u.prototype.deleteKeyPair=function(n,t,i){var r=this;return new Promise(function(){r._sdk.host.deleteKeyPair(r.keyTag(i,n))})},u.prototype.loadKeyPair=function(t,i,r){var u=this;return new Promise(function(i,f){var e=u._sdk.host.getKeyPair(u.keyTag(r,t),n.sdkhost.KeyClass.FidoECCSigningKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);u.prepareKeyPairBio(e).then(i,f)})},u}(r.SimpleFidoAuthenticator);r.FidoAuthenticatorFingerprint=u})(r=i.fidoclient||(i.fidoclient={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u=function(r){function u(n,t,i,u,f,e){return r.call(this,n,t,i,u,f,e)||this}return __extends(u,r),Object.defineProperty(u.prototype,"aaid",{get:function(){return"1206#0003"},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"authenticatorVersion",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"signCounter",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"regCounter",{get:function(){return 0},enumerable:!0,configurable:!0}),u.prototype.keyTag=function(n,t){return new i.TarsusKeyPath("per_user",n,"fido_authenticators",this.aaid,t)},u.prototype.startAuthenticationSession=function(n){if(r.prototype.startAuthenticationSession.call(this,n),this._nfSession=this._uiHandler.createNativeFaceAuthSession(i.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName,this._username),!this._nfSession)throw t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createNativeFaceAuthSession.");this._nfSession.startSession(this._authenticationDescription,n,this._action,this._clientContext)},u.prototype.finishAuthenticationSession=function(){this._nfSession&&(this._nfSession.endSession(),this._nfSession=null)},u.prototype.signHexWithKeyPair=function(i,r){var u=this;return i.signHex(r).catch(function(f){if(f.getData()[n.sdkhost.ErrorDataInternalError]==n.sdkhost.InternalErrorWrongBiometric)return u._sdk.log(t.LogLevel.Debug,"FIDO signing received a wrong biometric error; retrying authentication."),u.signHexWithKeyPair(i,r);u._sdk.log(t.LogLevel.Debug,"FIDO signing received an error: "+f+". Propagating.");throw f;})},u.prototype.prepareKeyPairBio=function(n){var i=this;try{return this._nfSession?this._nfSession.promiseInput().then(function(r){if(r.isControlRequest())switch(r.getControlRequest().getRequestType()){case t.ControlRequestType.CancelAuthenticator:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"User cancelled authentication");default:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Unsupported control code when running fingerprint session within FIDO: "+r.getControlRequest().getRequestType());}else{var u=r.getResponse();return n.setBiometricPromptInfo(u.getPrompt(),i._uiHandler,i._nfSession),n}}):Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Attempt to prepare key biometrics without an existing NF session"))}catch(r){return Promise.reject(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(r))}},u.prototype.generateKeyPair=function(t,i,r){var u=this;return this._sdk.host.generateKeyPair(this.keyTag(r,t),n.sdkhost.KeyClass.FidoECCSigningKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,!0).then(function(n){return u.prepareKeyPairBio(n)})},u.prototype.deleteKeyPair=function(n,t,i){var r=this;return new Promise(function(){r._sdk.host.deleteKeyPair(r.keyTag(i,n))})},u.prototype.loadKeyPair=function(t,i,r){var u=this;return new Promise(function(i,f){var e=u._sdk.host.getKeyPair(u.keyTag(r,t),n.sdkhost.KeyClass.FidoECCSigningKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);u.prepareKeyPairBio(e).then(i,f)})},u}(r.SimpleFidoAuthenticator);r.FidoAuthenticatorNativeFace=u})(r=i.fidoclient||(i.fidoclient={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u="fidoKey",f=function(r){function f(n,t,i,u,f,e){return r.call(this,n,t,i,u,f,e)||this}return __extends(f,r),Object.defineProperty(f.prototype,"signCounter",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"regCounter",{get:function(){return 0},enumerable:!0,configurable:!0}),f.prototype.getValidCancelOptions=function(){return null},f.prototype.getValidErrorRecoveryOptions=function(){return[t.AuthenticationErrorRecovery.RetryAuthenticator,t.AuthenticationErrorRecovery.Fail]},f.prototype.deleteKeyPair=function(n){var t=this;return new Promise(function(r){i.vault.AuthenticatorVault.deleteVaultForUserWithId(t._username,t.vaultId(n),t._sdk);r()})},f.prototype.vaultId=function(n){return new i.TarsusKeyPath("fido_authenticators",this.aaid,n)},f.prototype.generateKeyPair=function(r,f,e){var o=this;return this._sdk.host.generateKeyPairExternalRepresentation(n.sdkhost.KeyClass.FidoECCSigningKey).then(function(f){var h=o.authenticatorVaultDescriptor(),s=o.vaultId(r);o._sdk.log(t.LogLevel.Debug,"Deleting existing vault");try{i.vault.AuthenticatorVault.deleteVaultForUserWithId(e,s,o._sdk)}catch(c){}return o._sdk.log(t.LogLevel.Debug,"Creating new vault"),o.authenticatorVaultDescriptor().createNew(e,s,o,o._sdk,o._uiHandler).then(function(n){return n.unlock(o._action,o._clientContext).then(function(i){if(i)return o._sdk.log(t.LogLevel.Debug,"Updating key in vault"),n.writeVaultKey(u,f).then(function(){return n.lock()});o._sdk.log(t.LogLevel.Error,"Aborting vault-based FIDO registration due to unlockResult == false");throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorError,"Could not unlock vault for registration");})}).then(function(){return o._sdk.host.importVolatileKeyPair(n.sdkhost.KeyClass.FidoECCSigningKey,f)})})},f.prototype.loadKeyPair=function(r,f,e){var o=this;return new Promise(function(f,s){o._sdk.log(t.LogLevel.Debug,"Tarsus FIDO authenticator load key material from vault");var h=i.vault.AuthenticatorVault.getVaultForUserWithId(e,o.vaultId(r),o,o._sdk,o._uiHandler),c=h.unlock(o._action,o._clientContext).then(function(n){if(!n)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorError,"Unable to unlock authenticator.");o._sdk.log(t.LogLevel.Debug,"Tarsus FIDO authenticator vault unlocked");var i=h.readVaultKey(u);return o._sdk.log(t.LogLevel.Debug,"Tarsus FIDO authenticator key material read"),h.lock(),o._sdk.log(t.LogLevel.Debug,"Tarsus FIDO authenticator vault locked"),i});c.then(function(i){return o._sdk.log(t.LogLevel.Debug,"Tarsus FIDO authenticator key materialized"),o._sdk.host.importVolatileKeyPair(n.sdkhost.KeyClass.FidoECCSigningKey,i)}).then(f,s)})},f}(r.SimpleFidoAuthenticator);r.FidoAuthenticatorVaultBased=f})(r=i.fidoclient||(i.fidoclient={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),Object.defineProperty(i.prototype,"aaid",{get:function(){return"1206#0001"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"authenticatorVersion",{get:function(){return 1},enumerable:!0,configurable:!0}),i.prototype.authenticatorVaultDescriptor=function(){return n.vault.AuthenticatorVaults.password},i}(t.FidoAuthenticatorVaultBased);t.FidoAuthenticatorPin=i})(t=n.fidoclient||(n.fidoclient={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n.FidoAuthenticators={"1206#0001":new n.SimpleFidoAuthenticatorDescriptor(n.FidoAuthenticatorPin),"1206#0002":new n.FidoAuthenticatorDescriptorFingerprint,"1206#0003":new n.FidoAuthenticatorDescriptorNativeFace}})(t=n.fidoclient||(n.fidoclient={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){function t(n){return!!n.tlvSerializable}function r(n){return function(t,i){var r=[];return Object.keys(n).forEach(function(u){if(u in t){var f=t[u],e=n[u];r.push(e(f,i))}}),r.join("")}}function i(i,r){var u=[];return Object.keys(r).forEach(function(f){var o=i[f],e,s;if(!o)throw"TLV encoding error: Unknown tag "+f;e=r[f];e instanceof Array||(e=[e]);s=[];e.forEach(function(r){var s=r.__type||o.tagType||t(r)&&n.TlvTypes.Serializable,h,e;if(!s)throw"Unknown type for tag "+f;r.__type&&(r=r.__value);h=s;e=h(r,i);u.push(n.TlvTypes.UInt16(o.id));u.push(n.TlvTypes.UInt16(e.length/2));u.push(e)})}),u.join("")}n.instanceOfTlvSerializable=t;n.TlvTypes={UInt8:function(t){return n.numberToHex(t,8)},UInt16:function(t){return n.numberToHex(t>>8&255|(t&255)<<8,16)},UInt32:function(t){return n.numberToHex((t&255)<<24|(t>>8&255)<<16|(t>>16&255)<<8|t>>24&255,32)},Object:function(n,t){return i(t,n)},Serializable:function(n,t){return n.tlvSerialize(t)},String:function(t){return n.asciiToHex(t)},HexBinary:function(n){return n},Struct:r};n.tlvEncodeHex=i})(t=n.util||(n.util={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){t.ALG_SIGN_SECP256R1_ECDSA_SHA256_RAW=1;t.ALG_KEY_ECC_X962_RAW=256;t.FidoTLVTags={TAG_UAFV1_REG_ASSERTION:{id:15873,tagType:n.util.TlvTypes.Object},TAG_UAFV1_AUTH_ASSERTION:{id:15874,tagType:n.util.TlvTypes.Object},TAG_UAFV1_KRD:{id:15875,tagType:n.util.TlvTypes.Object},TAG_UAFV1_SIGNED_DATA:{id:15876,tagType:n.util.TlvTypes.Object},TAG_ATTESTATION_BASIC_SURROGATE:{id:15880,tagType:n.util.TlvTypes.Object},TAG_SIGNATURE:{id:11782,tagType:n.util.TlvTypes.HexBinary},TAG_KEYID:{id:11785,tagType:n.util.TlvTypes.HexBinary},TAG_FINAL_CHALLENGE_HASH:{id:11786,tagType:n.util.TlvTypes.HexBinary},TAG_AAID:{id:11787,tagType:n.util.TlvTypes.String},TAG_PUB_KEY:{id:11788,tagType:n.util.TlvTypes.HexBinary},TAG_COUNTERS:{id:11789,tagType:n.util.TlvTypes.Struct({SignCounter:n.util.TlvTypes.UInt32,RegCounter:n.util.TlvTypes.UInt32})},TAG_ASSERTION_INFO:{id:11790,tagType:n.util.TlvTypes.Struct({AuthenticatorVersion:n.util.TlvTypes.UInt16,AuthenticationMode:n.util.TlvTypes.UInt8,SignatureAlgAndEncoding:n.util.TlvTypes.UInt16,PublicKeyAlgAndEncoding:n.util.TlvTypes.UInt16})},TAG_AUTHENTICATOR_NONCE:{id:11791,tagType:n.util.TlvTypes.HexBinary},TAG_TRANSACTION_CONTENT_HASH:{id:11792,tagType:n.util.TlvTypes.HexBinary}}})(i=t.fidoclient||(t.fidoclient={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i;(function(n){n[n.Reg=1]="Reg";n[n.Auth=2]="Auth";n[n.Dereg=3]="Dereg"})(i||(i={}));var u=function(){function n(n,t){this.aaid=n;this.keyId=t||null}return n}(),r=function(){function n(n){var t=this;if(!n)throw"Missing policy.";if(n.rejected)throw"Unsupported policy 'rejected'";this._acceptedAuths=[];n.accepted.forEach(function(n){var o,s,h;if(n.length==1){var i=null,r=null,f=!1,e=Object.keys(n[0]);for(o in e){s=e[o];switch(s){case"aaid":i=n[0].aaid;break;case"keyIDs":r=n[0].keyIDs;break;default:f=!0}}if(f)return;if(!i)return;h=r||[null];i.forEach(function(n){h.forEach(function(i){t._acceptedAuths.push(new u(n,i))})})}})}return Object.defineProperty(n.prototype,"acceptedAuths",{get:function(){return this._acceptedAuths},enumerable:!0,configurable:!0}),n}(),f=function(){function t(t){var e,u,f;try{if(t.header.upv.major!=1||t.header.upv.minor!=0&&t.header.upv.minor!=1)throw"Invalid FIDO protocol version "+t.header.upv.major+"."+t.header.upv.minor;if(e=t.header.op,this._operation=i[e],!this._operation)throw"Invalid FIDO protocol op "+t.header.op;if(this._appId=t.header.appID,!this._appId)throw"Missing appID";this._serverData=t.header.serverData;this._challenge=t.challenge;this._username=t.username;u=t.policy;!u&&t.authenticators&&(f=[],t.authenticators.forEach(function(n){f.push([{aaid:[n.aaid]}])}),u={accepted:f});u&&(this._policy=new r(u));this._header=t.header}catch(o){throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Cannot parse FIDO request ["+JSON.stringify(t)+"]: "+o,{fidoRequest:t,reason:o.toString()});}}return Object.defineProperty(t.prototype,"policy",{get:function(){return this._policy},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"appId",{get:function(){return this._appId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"challenge",{get:function(){return this._challenge},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"username",{get:function(){return this._username},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"operation",{get:function(){return this._operation},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"header",{get:function(){return this._header},enumerable:!0,configurable:!0}),t.prototype.createFinalChallenge=function(){if(!this.challenge)throw"Missing challenge";var n={appID:this.appId,challenge:this.challenge,facetID:this.appId,channelBinding:{}};return btoa(JSON.stringify(n))},t}(),e=function(){function u(n){this._sdk=n}return Object.defineProperty(u.prototype,"sdk",{get:function(){return this._sdk},enumerable:!0,configurable:!0}),u.prototype.fidoResponseWithUaf1TlvAssertion=function(n,t,i){return{header:n.header,fcParams:t,assertions:[{assertion:i,assertionScheme:"UAFV1TLV"}]}},u.prototype.fidoClientXactReg=function(i,r){var u=this;return new Promise(function(f,e){if(!i.username)throw"Missing username in client registration request";if(!i.challenge)throw"Missing challenge";var o=i.createFinalChallenge();u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO client ready for registration action");r.fidoRegisterWithHexUaf1TlvResponse(i.appId,o,t.FidoTLVTags.TAG_ATTESTATION_BASIC_SURROGATE.id).then(function(t){u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator done succesfully");f(u.fidoResponseWithUaf1TlvAssertion(i,o,t))},e)})},u.prototype.fidoClientXactDereg=function(t,i){var r=this;return new Promise(function(u,f){r._sdk.log(n.LogLevel.Debug,"Tarsus FIDO client ready for deregistration action");i.fidoDeregister(t.appId).then(function(){r._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator done succesfully");u({})},f)})},u.prototype.fidoClientXactAuth=function(i,r){var u=this;return new Promise(function(f,e){if(!i.challenge)throw"Missing challenge";var o=i.createFinalChallenge();u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO client ready for authentication action");r.fidoAuthenticateWithHexUaf1TlvResponse(i.appId,o,t.FidoTLVTags.TAG_ATTESTATION_BASIC_SURROGATE.id).then(function(t){u._sdk.log(n.LogLevel.Debug,"Tarsus FIDO authenticator done succesfully");f(u.fidoResponseWithUaf1TlvAssertion(i,o,t))},e)})},u.prototype.fidoClientXact=function(r,u,e,o,s,h){var c=this;return new Promise(function(l,a){var v,w,y,p;if(c._sdk.log(n.LogLevel.Debug,"Tarsus FIDO client parsing FIDO request"),v=new f(h),v.username&&v.username.toLowerCase!=e.toLowerCase){c._sdk.log(n.LogLevel.Error,"Tarsus FIDO client encountered FIDO request with username not matching session username.");throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Tarsus FIDO client encountered FIDO request with username not matching session username.");}if(w=v.policy.acceptedAuths.map(function(n){return t.FidoAuthenticators[n.aaid]}).filter(function(n){return!!n}),!w.length)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Couldn't find driver for Tarsus native FIDO client request.");c._sdk.log(n.LogLevel.Debug,"Tarsus FIDO client loading authenticator");y=w[0].createFidoAuthenticator(r,c,e,u,o,s);c._sdk.log(n.LogLevel.Info,"Tarsus FIDO client authenticator loaded: "+y.aaid);p=null;switch(v.operation){case i.Reg:c._sdk.log(n.LogLevel.Debug,"Tarsus FIDO client processing registration request.");p=c.fidoClientXactReg(v,y);break;case i.Auth:c._sdk.log(n.LogLevel.Debug,"Tarsus FIDO client processing authentication request.");p=c.fidoClientXactAuth(v,y);break;case i.Dereg:c._sdk.log(n.LogLevel.Debug,"Tarsus FIDO client processing deregistration request.");p=c.fidoClientXactDereg(v,y);break;default:c._sdk.log(n.LogLevel.Error,"Unsupported FIDO Op when dispatching request: "+i[v.operation]);throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unsupported FIDO op "+i[v.operation]);}p.then(l,a)})},u.prototype.canHandlePolicy=function(n){var i=this,u=new r(n),f=u.acceptedAuths.filter(function(n){return t.FidoAuthenticators[n.aaid]&&t.FidoAuthenticators[n.aaid].isAuthenticatorSupportedOnDevice(i)});return f.length>0},u.isPolicyTransmitFidoClientExclusive=function(n){var i=new r(n),u=i.acceptedAuths.filter(function(n){return!t.FidoAuthenticators[n.aaid]});return u.length==0},u}();t.TarsusFidoClient=e})(i=t.fidoclient||(t.fidoclient={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(i){var r=function(){function n(n,t,i,r,u){this._countdownTask=new o(t,i,r,1e3,u)}return n.prototype.promiseCodeGeneration=function(n){return this._countdownTask.run(n)},n}();i.TotpCodeGeneratorTimeBased=r;var u=function(){function n(i,r){if(i<1)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"timeStamp must be positive: "+i);n.assertValidTime(r);this._timeStep=i;this._startTime=r}return n.assertValidTime=function(n){if(n<0)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Negative time: "+n);},Object.defineProperty(n.prototype,"timeStep",{get:function(){return this._timeStep},enumerable:!0,configurable:!0}),n.prototype.getValueAtTime=function(t){n.assertValidTime(t);var i=t-this._startTime;return i>=0?Math.floor(i/this._timeStep):Math.floor((i-(this._timeStep-1))/this._timeStep)},n.prototype.getValueStartTime=function(n){return this._startTime+n*this._timeStep},n}(),f=function(){function n(n,t){this._sdk=t;this._hexElement=n}return n.prototype.sign=function(n){return this._sdk.host.calcHexStringEncodedHmacSha1HashWithHexEncodedKey(this._hexElement,n)},n}(),e=function(){function n(i,r){if(r<0||r>n.MAX_PASSCODE_LENGTH)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"PassCodeLength must be between 1 and "+n.MAX_PASSCODE_LENGTH+" digits.");this._signer=i;this._codeLength=r}return n.prototype.generateResponseCode=function(n,t){var u=t&&t.length||0,f=new ArrayBuffer(8+u),r=new DataView(f),i;if(r.setUint32(0,Math.floor(n/4294967296)&4294967295),r.setUint32(4,n&4294967295),t)for(i=0;i<u;i++)r.setUint8(i+8,t.charCodeAt(i));return this.generateResponseCodeForByteArray(r)},n.prototype.generateResponseCodeForByteArray=function(n){for(var u="",t,i=0;i<n.byteLength;i++)t=n.getUint8(i).toString(16),t.length<2&&(t="0"+t),u+=t;var r=this._signer.sign(u),f=parseInt(r[r.length-1],16),e=r.substring(f*2,f*2+8),o=parseInt(e,16)&2147483647,s=o%Math.pow(10,this._codeLength);return this.padOutput(s)},n.prototype.padOutput=function(n){for(var t=n.toString(),i=t.length;i<this._codeLength;i++)t="0"+t;return t},n.MAX_PASSCODE_LENGTH=9,n.PASS_CODE_LENGTH=6,n.ADJACENT_INTERVALS=1,n.DIGITS_POWER=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],n}(),o=function(){function i(n,t,i,r,o){this._lastSeenCounterValue=0x8000000000000000;this._counter=new u(t,0);this._generator=new e(new f(i,o),n);this._remainingTimeNotificationPeriod=r;this._sdk=o}return i.prototype.run=function(i){var r,u;this._sdk.log(t.LogLevel.Debug,"Genearting a TOTP code.");r=this._sdk.host.getCurrentTime();u=this.getCounterValue(r);this._lastSeenCounterValue!=u&&(this._lastSeenCounterValue=u,this.fireTotpCounterValueChanged(i));this._sdk.log(t.LogLevel.Debug,"Notifying session of TOTP value and countdown");var r=this._sdk.host.getCurrentTime(),f=this.getCounterValueAge(r),e=this._remainingTimeNotificationPeriod-f%this._remainingTimeNotificationPeriod;return Promise.resolve(n.tarsusplugin.TotpCodeGenerationOutput.create(this._mCode,null,this._counter.timeStep,Math.floor(this.getTimeTillNextCounterValue(r)/1e3),e,!1,null))},i.prototype.fireTotpCounterValueChanged=function(n){var t=Math.floor(this._sdk.host.getCurrentTime()/1e3),i=this._counter.getValueAtTime(t);this._mCode=this._generator.generateResponseCode(i,n)},i.prototype.getTimeTillNextCounterValue=function(n){var t=this.getCounterValue(n),i=t+1,r=this._counter.getValueStartTime(i)*1e3;return r-n},i.prototype.getCounterValue=function(n){return this._counter.getValueAtTime(Math.floor(n/1e3))},i.prototype.getCounterValueAge=function(n){return n-this._counter.getValueStartTime(this.getCounterValue(n))*1e3},i}()})(r=i.totp||(i.totp={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var i;(function(i){var r;(function(r){var u=function(){function r(n,t,r){this._generatorName=n;this._userId=t;this._sdk=r;this._vaultId=new i.TarsusKeyPath("totp_properties",this._generatorName)}return r.prototype.promiseProvisionOutput=function(t,i,r,u){var e=this,f=this.getAvailableAuthenticators(t.protection_method);return 0>=f.length?(this._sdk.log(n.LogLevel.Error,"Failed to find matching authenticator for "+t.protection_method),Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Failed to find matching authenticator for "+t.protection_method))):(this._availableAuthenticators=f,this._isProvisioning=!0,this.createProvisionOutput(t,i,r,u).then(function(n){return e.selectAndCreateVault(n.getSecretToLock(),t,i,r,u).then(function(){return n.getUnprotectedProvisionOutput()})}))},r.prototype.promiseCodeGenerator=function(t,i,r,u){var f=this;return this._isProvisioning=!1,this.unlockOtpSecret(u,r).then(function(e){return f._sdk.log(n.LogLevel.Debug,"generating TOTP session"),f.createCodeGenerator(t,i,e,r,u)})},r.prototype.updateProtectedProperties=function(t){return typeof t!="string"||!this._unlockedVault?Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"could not update protected properties for generator <"+this._generatorName+">")):this._unlockedVault.writeVaultKey(this.elementVaultKey,t)},r.prototype.deprovision=function(){i.vault.AuthenticatorVault.deleteVaultForUserWithId(this._userId,this._vaultId,this._sdk)},r.prototype.unlockOtpSecret=function(t,r){var u=this;return new Promise(function(r){u._sdk.log(n.LogLevel.Debug,"Getting TOTP vault");var f=i.vault.AuthenticatorVault.getVaultForUserWithId(u._userId,u._vaultId,u,u._sdk,t);r(f)}).catch(function(t){return u._sdk.log(n.LogLevel.Error,"Error obtaining vault for TOTP <"+u._userId+", "+u._generatorName+">: "+t),Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.TotpNotProvisioned,"Totp for '"+u._userId+"' isn't provisioned",{underlying_error:t.toString()}))}).then(function(t){return u._sdk.log(n.LogLevel.Info,"Unlocking vault for TOTP seed"),t.unlock(null,r).then(function(i){if(!i){u._sdk.log(n.LogLevel.Error,"Change authetnicator requested during vault unlock for TOTP");throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"change authenticator isn't possible here");}u._sdk.log(n.LogLevel.Debug,"TOTP Vault unlocked");var r=t.readVaultKey(u.elementVaultKey);return u._unlockedVault=t,u._sdk.log(n.LogLevel.Debug,"TOTP Vault locked"),r})})},r.prototype.getValidErrorRecoveryOptions=function(){var t=[n.AuthenticationErrorRecovery.Fail,n.AuthenticationErrorRecovery.RetryAuthenticator];return this._isProvisioning&&this._availableAuthenticators.length>1&&t.push(n.AuthenticationErrorRecovery.ChangeAuthenticator),t},r.prototype.getValidCancelOptions=function(){var t=[n.ControlRequestType.RetryAuthenticator,n.ControlRequestType.AbortAuthentication];return this._isProvisioning&&this._availableAuthenticators.length>1&&t.push(n.ControlRequestType.ChangeMethod),t},r.prototype.getAvailableAuthenticators=function(n){var u=this,r=[];return Object.keys(i.vault.AuthenticatorVaults).forEach(function(n){var f=i.vault.AuthenticatorVaults[n].getDescription(u._sdk);f.getSupportedOnDevice()&&r.push(new t.impl.AuthenticationOptionImpl(f,[]))}),r=r.filter(function(t){return-1!==n.indexOf(t.getAuthenticator().getName())})},r.prototype.selectAndCreateVault=function(t,i,r,u,f){var e=this;return f.selectAuthenticator(this._availableAuthenticators,r,u).then(function(o){switch(o.getResultType()){case n.AuthenticatorSelectionResultType.Abort:throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"Cancel during authenticator selection.");case n.AuthenticatorSelectionResultType.SelectAuthenticator:if(o.getSelectedAuthenticationParameters().length)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Authentication parameters not allowed in vault.");return e.createAndWriteToVault(o.getSelectedAuthenticator(),t,i,f,r,u)}})},r.prototype.createAndWriteToVault=function(t,r,u,f,e,o){var h=this,s=i.vault.AuthenticatorVaults[t.getName()],c;return s?(c=s.supportsNoIntegrity()&&u.integrity_protection_disabled,s.createNew(this._userId,this._vaultId,this,this._sdk,f,c).then(function(n){return n.unlock(e,o).then(function(t){return t?n.writeVaultKey(h.elementVaultKey,r).then(function(){n.lock()}):h.selectAndCreateVault(r,u,e,o,f)})})):Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unhandled authennticator name "+t.getName()))},Object.defineProperty(r.prototype,"elementVaultKey",{get:function(){return i.vault.AuthenticatorVault.noIntegrityElementKey},enumerable:!0,configurable:!0}),r}();r.TotpDriverVaultBased=u})(r=i.totp||(i.totp={}))})(i=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(i){var f=function(t){function i(){return t!==null&&t.apply(this,arguments)||this}return __extends(i,t),i.prototype.createCodeGenerator=function(n,t,i){return Promise.resolve(new u(n,i,this._sdk))},i.prototype.createProvisionOutput=function(t){return Promise.resolve(n.tarsusplugin.VaultBasedTotpProvisionOutput.create(t.ec_private_key||"",new r))},i.create=function(n,t,r){return new i(n,t,r)},i}(i.TotpDriverVaultBased),r,u;i.TotpDriverEc=f;r=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.finalize=function(){},t}(n.tarsusplugin.TotpProvisionOutput);u=function(){function i(n,r,u){this._sdk=u;this._sdk.log(t.LogLevel.Debug,"Construct EC OTP Code generator");this._codeLen=n;i._ec||(i._ec=new elliptic.ec("p256"),this._sdk.log(t.LogLevel.Debug,"EC Loaded"));var f=t.util.base64ToHex(r),e=f.substring(f.length-64,f.length);this._keypair=i._ec.keyFromPrivate(e);this._sdk.log(t.LogLevel.Debug,"Private key parsed")}return i.prototype.promiseCodeGeneration=function(r){var o,u,h,c;if(this._sdk.log(t.LogLevel.Debug,"Start generate EC OTP Code"),!r)return Promise.reject(t.impl.AuthenticationErrorImpl.appImplementationError("EC OTP generation requries a challenge."));o=i._ec.keyFromPublic(atob(r));this._sdk.log(t.LogLevel.Debug,"Challenge parsed");u=this._keypair.derive(o.getPublic()).toArray("be");u.push(0,0,0,1);u.push.apply(u,atob(r).split("").map(function(n){return n.charCodeAt(0)}));var l=u.map(function(n){return t.util.numberToHex(n,8)}).join(""),e=this._sdk.host.calcHexStringEncodedSha512Hash(l),a=i._ec.keyFromPrivate(parseInt("1000000000000".substring(0,1+this._codeLen),10).toString(16)).getPrivate(),s=(parseInt(e.substring(e.length-1),16)&15)*2,f=e.substring(s,s+16);return f=(parseInt(f.substring(0,2),16)&127).toString(16)+f.substring(2),h=i._ec.keyFromPrivate(f).getPrivate(),c=h.mod(a).toString(10,this._codeLen),Promise.resolve(n.tarsusplugin.TotpCodeGenerationOutput.create(c,null,-1,-1,-1,!1,null))},i}()})(r=i.totp||(i.totp={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u=function(u){function f(){return u!==null&&u.apply(this,arguments)||this}return __extends(f,u),f.prototype.otpSecretToLock=function(r){var u=this;return new Promise(function(f,e){var s=i.User.findUser(u._sdk,u._userId),o,h;if(!s){e(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"failed to find user record for <"+u._userId+">"));return}if(o=u._sdk.host.getKeyPair(s.deviceEncryptionKeyTag,n.sdkhost.KeyClass.StdEncryptionKey,n.sdkhost.KeyBiometricProtectionMode.None),!o)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"failed to find device encryption key for user: "+u._userId);h=t.util.base64ToHex(r.shared_key);f(o.decrypt(h))})},f.prototype.createCodeGenerator=function(n,t,i){return Promise.resolve(new r.TotpCodeGeneratorTimeBased(this,n,t.ttl,i,this._sdk))},f.prototype.createProvisionOutput=function(t){var i={ttl:t.ttl};return this.otpSecretToLock(t).then(function(t){var u=r.TotpProvisionOutputTimeBased.create(null,i);return n.tarsusplugin.VaultBasedTotpProvisionOutput.create(t,u)})},f.create=function(n,t,i){return new f(n,t,i)},f.transformOldToNewDataForUser=function(n){return{ttl:n.ttl}},f}(r.TotpDriverVaultBased);r.TotpDriverTimeBased=u})(r=i.totp||(i.totp={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i={totp:{create:t.TotpDriverTimeBased.create},ecotp:{create:t.TotpDriverEc.create}},r=function(){function r(){}return r.driverForTypeName=function(n,r,u,f){var e,o,h,s;return(this._extensionPoint.forEach(function(t){e||n!=t.getTotpTypeName()||(e=t)}),e)?e.create(r,u):(this._extensionPointForVaultBased.forEach(function(t){o||n!=t.getTotpTypeName()||(o=t)}),o)?(h=o.create(r,u),new t.VaultBasedTotpDriverProxy(h,r,u,f)):(s=i[n],s&&s.create(r,u,f))},r._extensionPoint=new n.ExtensionPoint("com.ts.mobile.plugins.totp"),r._extensionPointForVaultBased=new n.ExtensionPoint("com.ts.mobile.plugins.totp.vault"),r}();t.TotpDrivers=r})(t=n.totp||(n.totp={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(){function r(r,u){var e,f,o;this._user=r;this._sdk=u;this._shouldStopCodeGen=!0;this._sdk.log(n.LogLevel.Debug,"Loading TOTP processors for user "+r.name);this._propertiesContainer=this._sdk.host.readStorageKey(this.totpPropertiesContainerStorageKey);this._propertiesContainer.version!="v0"&&(this._sdk.log(n.LogLevel.Debug,"Creating TOTP records for user "+this._user.name),this._propertiesContainer.properties={},e=new t.TarsusKeyPath("per_user",this._user.name,"totp_properties","default"),f=this._sdk.host.readStorageKey(e),0<Object.keys(f).length&&(this._user.deviceBound?(this._sdk.log(n.LogLevel.Debug,"Migrating TOTP records for default TOTP generator for user "+this._user.name),o={type:"totp",length:f.length,provision_id:this.provisionIdForGenerator("default"),specific_data:i.TotpDriverTimeBased.transformOldToNewDataForUser(f)},this._propertiesContainer.properties["default"]=o,this._sdk.log(n.LogLevel.Debug,"Updating storage on migration"),this.updateStorage()):this._sdk.log(n.LogLevel.Warning,"Migration of TOTP records for user "+this._user.name+" can not be perfomed (user not bound)"),this._sdk.log(n.LogLevel.Debug,"Deleting old TOTP records storage key"),this._sdk.host.deleteStorageKey(e)),this._propertiesContainer.version="v0",this.updateStorage())}return Object.defineProperty(r.prototype,"totpPropertiesContainerStorageKey",{get:function(){return new t.TarsusKeyPath("per_user",this._user.name,"totp")},enumerable:!0,configurable:!0}),r.prototype.isTotpProvisionedForGenerator=function(n){var t=this._propertiesContainer.properties[n];return!!t},r.prototype.updateWithProvisionedGenerator=function(n,t){var i={type:n.otp_type,length:n.length,add_check_digit:n.add_check_digit,provision_id:this.provisionIdForGenerator(n.generator)};t.getStoredData()&&(i.specific_data=t.getStoredData());this._propertiesContainer.properties[n.generator]=i;this.updateStorage()},r.prototype.deleteProvisionForGenerator=function(n){var t=this.getTotpDriver(n);t&&(delete this._propertiesContainer.properties[n],this.updateStorage(),t.deprovision())},r.prototype.deleteAllProvisions=function(){var t=this,i=[];Object.keys(this._propertiesContainer.properties).forEach(function(r){var u=t.getTotpDriver(r);u?i.push(u):t._sdk.log(n.LogLevel.Error,"Failed to delete TOTP provisioning for "+r)});this._propertiesContainer.properties={};this._sdk.host.deleteStorageKey(this.totpPropertiesContainerStorageKey);i.forEach(function(i){try{i.deprovision()}catch(r){t._sdk.log(n.LogLevel.Error,"Failed to delete TOTP private resources for "+i)}})},r.prototype.createTotpDriver=function(t,r){var u=i.TotpDrivers.driverForTypeName(r,t,this._user.name,this._sdk);return u?u:(this._sdk.log(n.LogLevel.Error,"Unhandled TOTP type: "+r),null)},r.prototype.getTotpDriver=function(t){var r=this._propertiesContainer.properties[t],u;return r?(u=i.TotpDrivers.driverForTypeName(r.type,t,this._user.name,this._sdk),!u)?(this._sdk.log(n.LogLevel.Error,"Unhandled TOTP type: "+r.type),null):u:(this._sdk.log(n.LogLevel.Warning,"Failed to find TOTP provision properties for "+t),null)},r.prototype.totpRequestFromCanonicalString=function(t){var e=this,r=null,u=null,f;if(t=atob(t),255==t.charCodeAt(0)?(f=i.parsing.totpDataFromCanonical(t.slice(1)),f&&0<f.challengesSpecs.length&&Object.keys(this._propertiesContainer.properties).some(function(n){return f.challengesSpecs.some(function(t){return e._propertiesContainer.properties[n].provision_id.lastIndexOf(t.seedId,0)==0?(r=t.challenge,u=n,!0):!1})})):(u="default",r=t),!r||!u){this._sdk.log(n.LogLevel.Warning,"Failed to find TOTP attributes in canonical string");throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Failed to find TOTP attributes in canonical string");}return n.impl.TotpGenerationRequestImpl.createTotpGenerationRequest(this._user.name,r,u)},r.prototype.runCodeGenerationSession=function(t,i,r,u){var f=this;return new Promise(function(e,o){var s,h;if(f._sdk.log(n.LogLevel.Info,"Run TOTP generation session"),s=f.getTotpDriver(t),!s){f._sdk.log(n.LogLevel.Error,"TOTP data not found for <"+f._user.name+", "+t+">");o(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.TotpNotProvisioned,"Totp for '"+f._user.name+"' isn't provisioned"));return}h=f._propertiesContainer.properties[t];s.promiseCodeGenerator(h.length,h.specific_data,r,u).then(function(s){if(f._appCodeGenSession=u.createTotpGenerationSession(f._user.name,t),!f._appCodeGenSession){o(n.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTotpGenerationSession."));return}f._generatorName=t;f._codeGenerator=s;f._requireChallenge=i;f._codeGenCompleteFn=e;f._codeGenRejectFn=o;f._sdk.log(n.LogLevel.Debug,"Invoking TOTP client session startSession");f._appCodeGenSession.startSession(f,null,r);f._sdk.log(n.LogLevel.Info,"TOTP client session running")}).catch(o)})},r.prototype.runCodeGenerationSessionWithRequest=function(n,t,i){return this._codeGenDesignatedRequest=n,this.runCodeGenerationSession(n.getGeneratorName(),!1,t,i)},r.prototype.startCodeGeneration=function(){if(this._sdk.log(n.LogLevel.Debug,"Got request to start code generation."),!this._appCodeGenSession)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to start code generation on a finished TOTP session.");if(this._shouldStopCodeGen=!1,this._requireChallenge){this.startChallengeRequireCodeGeneration(this._appCodeGenSession);return}this._sdk.log(n.LogLevel.Debug,"TOTP session starting code generation");this.generateCode(this._codeGenDesignatedRequest&&this._codeGenDesignatedRequest.getChallenge())},r.prototype.finishSession=function(){if(this._sdk.log(n.LogLevel.Debug,"TOTP session finishing"),this._shouldStopCodeGen=!0,!this._appCodeGenSession)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to finish a finished TOTP session.");this._appCodeGenSession.endSession();this._appCodeGenSession=null;this._codeGenCompleteFn(!0)},r.prototype.updatedWithGeneratorSpecificProperties=function(n,t){var i=this._propertiesContainer.properties[n];return i?(i.specific_data=t,this.updateStorage(),!0):!1},r.prototype.startChallengeRequireCodeGeneration=function(t){var i=this;this._sdk.log(n.LogLevel.Debug,"Starting TOTP challenge acquisition.");t.promiseChallengeInput().then(function(r){if(r.isControlRequest())switch(r.getControlRequest().getRequestType()){case n.ControlRequestType.AbortAuthentication:t.endSession();i._codeGenRejectFn(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserCanceled,"User cancelled generation"));break;default:t.endSession();i._codeGenRejectFn(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Unsupported control code when running TOTP challenge acquisition: "+r.getControlRequest().getRequestType()))}else i._sdk.log(n.LogLevel.Debug,"Challenge acquired successfully. Going to start generation of TOTP codes."),i.generateCode(r.getResponse().getChallenge())})},r.prototype.generateCode=function(t){var i=this;this._shouldStopCodeGen||this._codeGenerator.promiseCodeGeneration(t||null).then(function(r){if(!i._shouldStopCodeGen){r.getMessage()&&i._appCodeGenSession.setMessage(r.getMessage());var u;u=i._propertiesContainer.properties[i._generatorName].add_check_digit?i.computeErrorControlledCode(r.getCode()):r.getCode();i._appCodeGenSession.setTotpCode(u,r.getTimeStepSeconds(),r.getExpiresInSeconds());0<r.getSecondsTillNextInvocation()&&i._sdk.host.createDelayedPromise(r.getSecondsTillNextInvocation()).then(function(){i.generateCode(t)})}if(r.getShouldUpdateSpecificProperties()&&!i.updatedWithGeneratorSpecificProperties(i._generatorName,r.getGeneratorSpecificDataToStore()))throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"could not update generator properties <"+i._generatorName+">");}).catch(function(n){i._shouldStopCodeGen=!0;i._appCodeGenSession.endSession();i._codeGenRejectFn(n)})},r.prototype.computeErrorControlledCode=function(n){for(var r=0,t,i=n.length-1;i>=0;i--)t=Number(n[i]),(n.length-i)%2&&(t*=2,9<t&&(t=t%10+1)),r+=t;return n+r*9%10},r.prototype.updateStorage=function(){this._sdk.host.writeStorageKey(this.totpPropertiesContainerStorageKey,this._propertiesContainer)},r.prototype.provisionIdForGenerator=function(t){var i=n.util.asciiToHex(""+this._user.deviceId+t);return this._sdk.host.calcHexStringEncodedSha256Hash(i)},r.createWithUserId=function(i,u){var f=t.User.findUser(u,i);if(!f){u.log(n.LogLevel.Error,"Can not find user record for <"+i+">");throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Can not find user <"+i+">");}return new r(f,u)},r.createWithUser=function(n,t){return new r(n,t)},r}();i.TotpPropertiesProcessor=r})(i=t.totp||(t.totp={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.finalize=function(){},t.create=function(n,i){var r=new t;return r.setAssertionData(n),r.setStoredData(i),r},t}(n.tarsusplugin.TotpProvisionOutput);t.TotpProvisionOutputTimeBased=i})(i=t.totp||(t.totp={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){var f=n.call(this,i,r,u)||this;return f._underlyingDriver=t,f}return __extends(t,n),t.prototype.createCodeGenerator=function(n,t,i,r,u){return this._underlyingDriver.promiseCodeGenerator(n,i,t,r,u)},t.prototype.createProvisionOutput=function(n,t,i,r){return this._underlyingDriver.promiseProvisionOutput(n,t,i,r)},t}(n.TotpDriverVaultBased);n.VaultBasedTotpDriverProxy=t})(t=n.totp||(n.totp={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i;(function(t){function i(t){var u,i,e,r,f,o,s,h,c;try{for(u={version:0,prefixes:[],challengesSpecs:[]},i=0,u.version=t.charCodeAt(i++),e=t.charCodeAt(i++),f=0;f<e;f++)r=t.charCodeAt(i++),u.prefixes.push(t.slice(i,i+r)),i+=r;while(i<t.length)o=t.charCodeAt(i++),r=4,s=n.util.bytesToHex(t.slice(i,i+r)),i+=r,h=t.charCodeAt(i++),r=t.charCodeAt(i++),c=""+u.prefixes[h]+t.slice(i,i+r),i+=r,u.challengesSpecs.push({version:o,seedId:s,challenge:c});return u}catch(l){}return null}t.totpDataFromCanonical=i})(i=t.parsing||(t.parsing={}))})(i=t.totp||(t.totp={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var u=function(r){function u(){return r!==null&&r.apply(this,arguments)||this}return __extends(u,r),u.supportsNoIntegrity=function(){return!1},u.INCORRECT_KEY_TAG_TO_FALLBACK=function(n){return new i.TarsusKeyPath("per_user`, userId, `vault_keys",n.type,n.salt)},u.getVaultKeyTagForUser=function(n,t){return new i.TarsusKeyPath("per_user",n,"vault_keys",t.type,t.salt)},u.deletePrivateResources=function(n,i,r){r.log(t.LogLevel.Debug,"Biometric authenticator vault deleting private resources...");r.host.deleteKeyPair(u.getVaultKeyTagForUser(n,i))},u.prototype.translateBiometricInternalError=function(i){if(i.getErrorCode()==t.AuthenticationErrorCode.Internal&&i.getData()){var r=i.getData();switch(r[n.sdkhost.ErrorDataInternalError]){case n.sdkhost.InternalErrorBiometricInvalidated:return new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorInvalidated,this.biometricType+" registration invalidated.");case n.sdkhost.InternalErrorWrongBiometric:return new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidInput,"Invalid "+this.biometricType+" was input.")}}else if(i.getErrorCode()==t.AuthenticationErrorCode.UserCanceled)return i;return t.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(r,this.biometricType)||i},u.prototype.prepareToUnlock=function(i,r){var f=this;return new Promise(function(e,o){var s=u.getVaultKeyTagForUser(f._userId,f._vaultData),h;f.isEmpty()?(f._sdk.log(t.LogLevel.Debug,"Generating a new key for empty "+f.biometricType+" vault."),h=t.util.wrapPromiseWithActivityIndicator(f._uiHandler,f._policyAction,f._clientContext,f._sdk.host.generateKeyPair(s,n.sdkhost.KeyClass.StdEncryptionKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,!0)).catch(function(n){throw f.translateBiometricInternalError(n);})):h=new Promise(function(i){var r=f._sdk.host.getKeyPair(s,n.sdkhost.KeyClass.StdEncryptionKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!r&&(r=f._sdk.host.getKeyPair(u.INCORRECT_KEY_TAG_TO_FALLBACK(f._vaultData),n.sdkhost.KeyClass.StdEncryptionKey,n.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb),!r))throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"failed to get key pair for tag: "+s);i(r)});h.then(function(n){f.updateKeyPairWithAuthenticationInput(n,i,r);f._encryptionKeyPair=n}).then(e,o)})},u.prototype.decrypt=function(n){var t=this;return this._encryptionKeyPair.decrypt(n).then(function(n){return t._encryptionKeyPair.closeKeyPair(),n},function(n){t._encryptionKeyPair.closeKeyPair();throw t.translateBiometricInternalError(n);})},u.prototype.encrypt=function(n){return this._encryptionKeyPair.encrypt(n)},u.prototype.finalizeLock=function(){this._encryptionKeyPair=null},u.prototype.handleLocalDecryptError=function(n){n.getErrorCode()==t.AuthenticationErrorCode.UserCanceled?this.invokeUiHandlerCancellation():r.prototype.handleLocalDecryptError.call(this,n)},u}(r.AuthenticatorVault);r.AuthenticatorVaultBiometric=u})(r=i.vault||(i.vault={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var f=function(n){function r(){var t=n!==null&&n.apply(this,arguments)||this;return t.biometricType="FaceId",t}return __extends(r,n),r.prototype.updateKeyPairWithAuthenticationInput=function(n,t,i){n.setBiometricPromptInfo(i.getPrompt(),this._uiHandler,t)},r.createVaultForUserWithId=function(n,u,f,e,o,s){return new Promise(function(h){if(s)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"This vault type does not support disabling integrity protection");var c={type:i.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName,salt:e.host.generateRandomHexString(24),data:""};h(new r(n,c,u,f,e,o))})},r.getAuthenticatorDescription=function(n){return new u(n)},r.prototype.createAuthenticatorSession=function(){return this._uiHandler.createNativeFaceAuthSession(i.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName,this._userId)},r}(r.AuthenticatorVaultBiometric),u;r.AuthenticatorVaultFaceId=f;u=function(r){function u(n){var u=r.call(this,t.AuthenticatorType.FaceID,i.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName)||this;return u._sdk=n,u}return __extends(u,r),u.prototype.getSupportedOnDevice=function(){return this._sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported)==="true"},u}(r.AuthenticatorVaultDescription)})(r=i.vault||(i.vault={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r;(function(r){var f=function(n){function r(){var t=n!==null&&n.apply(this,arguments)||this;return t.biometricType="Fingerprint",t}return __extends(r,n),r.prototype.updateKeyPairWithAuthenticationInput=function(n,t,i){n.setBiometricPromptInfo(i.getPrompt(),this._uiHandler,t)},r.createVaultForUserWithId=function(n,u,f,e,o,s){return new Promise(function(h){if(s)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"This vault type does not support disabling integrity protection");var c={type:i.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName,salt:e.host.generateRandomHexString(24),data:""};h(new r(n,c,u,f,e,o))})},r.getAuthenticatorDescription=function(n){return new u(n)},r.prototype.createAuthenticatorSession=function(){return this._uiHandler.createFingerprintAuthSession(i.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName,this._userId)},r}(r.AuthenticatorVaultBiometric),u;r.AuthenticatorVaultFingerprint=f;u=function(r){function u(n){var u=r.call(this,t.AuthenticatorType.Fingerprint,i.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName)||this;return u._sdk=n,u}return __extends(u,r),u.prototype.getSupportedOnDevice=function(){return this._sdk.host.queryHostInfo(n.sdkhost.HostInformationKey.FingerprintSupported)==="true"},u}(r.AuthenticatorVaultDescription)})(r=i.vault||(i.vault={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(i){function r(t,r,u,f,e,o){var s=i.call(this,t,r,u,f,e,o)||this;if(!s._vaultData.cryptoSettings)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"vault data is missing cryptography settings");return s}return __extends(r,i),r.createVaultForUserWithId=function(n,t,i,u,f,e){return new Promise(function(o){var s={type:r._authenticatorName,salt:u.host.generateRandomHexString(24),data:"",cryptoSettings:{pbkdf_iterations_count:u.cryptoSettings.getLocalEnrollmentKeyIterationCount(),pbkdf_key_size:u.cryptoSettings.getLocalEnrollmentKeySizeInBytes()},noIntegrity:e};o(new r(n,s,t,i,u,f))})},r.supportsNoIntegrity=function(){return!0},r.deletePrivateResources=function(){},r.getAuthenticatorDescription=function(){return new t.AuthenticatorVaultDescription(n.AuthenticatorType.Password,r._authenticatorName)},r.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPasswordAuthSession(r._authenticatorName,this._userId)},r.prototype.prepareToUnlock=function(i,r){var u=this,f=r;return this._vaultData.cryptoSettings?t.pbkdfStretchHexSecretIntoAESKey(this._vaultData.salt,n.util.asciiToHex(f.getPassword()),this._vaultData.cryptoSettings.pbkdf_key_size,this._vaultData.cryptoSettings.pbkdf_iterations_count,this.noIntegrity||!1,this._sdk).then(function(n){u._encryptionKey=n}):Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Missing crypt settings for password vault."))},r.prototype.decrypt=function(t){var i=this;return this._encryptionKey.decrypt(t,null).catch(function(t){if(i.noIntegrity)throw t;else throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.InvalidInput,"Incorrect password input.");})},r.prototype.encrypt=function(n){return this._encryptionKey.encrypt(n)},r.prototype.finalizeLock=function(){this._encryptionKey=null},r._authenticatorName="password",r}(t.AuthenticatorVault);t.AuthenticatorVaultPassword=i})(i=t.vault||(t.vault={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n.AuthenticatorVaults={password:{loadFromData:n.AuthenticatorVaultPassword,createNew:n.AuthenticatorVaultPassword.createVaultForUserWithId,getDescription:n.AuthenticatorVaultPassword.getAuthenticatorDescription,supportsNoIntegrity:n.AuthenticatorVaultPassword.supportsNoIntegrity,deletePrivateResources:n.AuthenticatorVaultPassword.deletePrivateResources},fingerprint:{loadFromData:n.AuthenticatorVaultFingerprint,createNew:n.AuthenticatorVaultFingerprint.createVaultForUserWithId,getDescription:n.AuthenticatorVaultFingerprint.getAuthenticatorDescription,supportsNoIntegrity:n.AuthenticatorVaultFingerprint.supportsNoIntegrity,deletePrivateResources:n.AuthenticatorVaultFingerprint.deletePrivateResources},face_id:{loadFromData:n.AuthenticatorVaultFaceId,createNew:n.AuthenticatorVaultFaceId.createVaultForUserWithId,getDescription:n.AuthenticatorVaultFaceId.getAuthenticatorDescription,supportsNoIntegrity:n.AuthenticatorVaultFaceId.supportsNoIntegrity,deletePrivateResources:n.AuthenticatorVaultFaceId.deletePrivateResources}}})(t=n.vault||(n.vault={}))})(t=n.core||(n.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i;(function(t){function i(t,i,r,u,f,e){return e.host.generatePbkdf2HmacSha1HexString(t,i,r,u).then(function(t){return e.host.importVolatileSymmetricKey(t,f?n.sdkhost.KeyClass.NoIntegrityAES:n.sdkhost.KeyClass.GeneralPurposeAES)})}t.pbkdfStretchHexSecretIntoAESKey=i})(i=t.vault||(t.vault={}))})(i=t.core||(t.core={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getAcquisitionResponse=function(){return this._acquisitionResponse},t.prototype.setAcquisitionResponse=function(n){this._acquisitionResponse=n},t.__tarsusInterfaceName="AudioInputResponse",t}(n.InputResponseType);n.AudioInputResponse=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Internal=0]="Internal";n[n.InvalidInput=1]="InvalidInput";n[n.AuthenticatorLocked=2]="AuthenticatorLocked";n[n.AllAuthenticatorsLocked=3]="AllAuthenticatorsLocked";n[n.NoRegisteredAuthenticator=4]="NoRegisteredAuthenticator";n[n.RegisteredSecretAlreadyInHistory=5]="RegisteredSecretAlreadyInHistory";n[n.Communication=6]="Communication";n[n.UserCanceled=7]="UserCanceled";n[n.AppImplementation=8]="AppImplementation";n[n.PolicyRejection=9]="PolicyRejection";n[n.AuthenticatorInvalidated=10]="AuthenticatorInvalidated";n[n.ControlFlowExpired=11]="ControlFlowExpired";n[n.SessionRequired=12]="SessionRequired";n[n.AuthenticatorError=13]="AuthenticatorError";n[n.ApprovalWrongState=14]="ApprovalWrongState";n[n.TotpNotProvisioned=15]="TotpNotProvisioned";n[n.AuthenticatorExternalConfigError=16]="AuthenticatorExternalConfigError";n[n.InvalidDeviceBinding=17]="InvalidDeviceBinding";n[n.DeviceNotFound=18]="DeviceNotFound";n[n.ApprovalDenied=19]="ApprovalDenied";n[n.ApprovalExpired=20]="ApprovalExpired";n[n.ApplicationGeneratedRecoverableError=21]="ApplicationGeneratedRecoverableError"})(t=n.AuthenticationErrorCode||(n.AuthenticationErrorCode={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.AuthenticatorExternalConfigErrorReason=0]="AuthenticatorExternalConfigErrorReason";n[n.AuthenticatorInvalidInputErrorDescription=1]="AuthenticatorInvalidInputErrorDescription"})(t=n.AuthenticationErrorProperty||(n.AuthenticationErrorProperty={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.AuthenticatorExternalConfigErrorReasonBiometricsNotEnrolled=0]="AuthenticatorExternalConfigErrorReasonBiometricsNotEnrolled";n[n.AuthenticatorExternalConfigErrorReasonBiometricsOsLockTemporary=1]="AuthenticatorExternalConfigErrorReasonBiometricsOsLockTemporary";n[n.AuthenticatorExternalConfigErrorReasonBiometricsOsLockPermanent=2]="AuthenticatorExternalConfigErrorReasonBiometricsOsLockPermanent";n[n.AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit=3]="AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit"})(t=n.AuthenticationErrorPropertySymbol||(n.AuthenticationErrorPropertySymbol={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.RetryAuthenticator=0]="RetryAuthenticator";n[n.ChangeAuthenticator=1]="ChangeAuthenticator";n[n.SelectAuthenticator=2]="SelectAuthenticator";n[n.Fail=3]="Fail"})(t=n.AuthenticationErrorRecovery||(n.AuthenticationErrorRecovery={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Register=0]="Register";n[n.Unregister=1]="Unregister";n[n.Reregister=2]="Reregister"})(t=n.AuthenticatorConfigurationAction||(n.AuthenticatorConfigurationAction={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Fallback=0]="Fallback";n[n.AuthMenu=1]="AuthMenu";n[n.Retry=2]="Retry";n[n.Cancel=3]="Cancel"})(t=n.AuthenticatorFallbackAction||(n.AuthenticatorFallbackAction={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Registered=0]="Registered";n[n.Unregistered=1]="Unregistered";n[n.LocallyInvalid=2]="LocallyInvalid"})(t=n.AuthenticatorRegistrationStatus||(n.AuthenticatorRegistrationStatus={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.SelectAuthenticator=0]="SelectAuthenticator";n[n.Abort=1]="Abort"})(t=n.AuthenticatorSelectionResultType||(n.AuthenticatorSelectionResultType={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Authentication=0]="Authentication";n[n.Registration=1]="Registration"})(t=n.AuthenticatorSessionMode||(n.AuthenticatorSessionMode={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getAcquisitionResponse=function(){return this._acquisitionResponse},t.prototype.setAcquisitionResponse=function(n){this._acquisitionResponse=n},t.__tarsusInterfaceName="CameraInputResponse",t}(n.InputResponseType);n.CameraInputResponse=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Accounts=0]="Accounts";n[n.DeviceDetails=1]="DeviceDetails";n[n.Contacts=2]="Contacts";n[n.Owner=3]="Owner";n[n.Software=4]="Software";n[n.Location=5]="Location";n[n.Bluetooth=6]="Bluetooth";n[n.ExternalSDKDetails=7]="ExternalSDKDetails";n[n.HWAuthenticators=8]="HWAuthenticators";n[n.Capabilities=9]="Capabilities";n[n.FidoAuthenticators=10]="FidoAuthenticators";n[n.LargeData=11]="LargeData";n[n.LocalEnrollments=12]="LocalEnrollments"})(t=n.CollectorType||(n.CollectorType={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.None=0]="None";n[n.Credentials=1]="Credentials";n[n.Full=2]="Full"})(t=n.ConnectionCryptoMode||(n.ConnectionCryptoMode={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.CancelAuthenticator=0]="CancelAuthenticator";n[n.RetryAuthenticator=1]="RetryAuthenticator";n[n.ChangeMethod=2]="ChangeMethod";n[n.SelectMethod=3]="SelectMethod";n[n.AbortAuthentication=4]="AbortAuthentication"})(t=n.ControlRequestType||(n.ControlRequestType={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Remove=0]="Remove";n[n.Identify=1]="Identify";n[n.Rename=2]="Rename"})(t=n.DeviceManagementAction||(n.DeviceManagementAction={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.RecentlyUsed=0]="RecentlyUsed";n[n.NoRecentActivity=1]="NoRecentActivity";n[n.LongInactivity=2]="LongInactivity";n[n.Disabled=3]="Disabled";n[n.Removed=4]="Removed"})(t=n.DeviceStatus||(n.DeviceStatus={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getFailureError=function(){return this._failureError},t.prototype.setFailureError=function(n){this._failureError=n},t.prototype.getExpired=function(){return this._expired},t.prototype.setExpired=function(n){this._expired=n},t.prototype.getRegistered=function(){return this._registered},t.prototype.setRegistered=function(n){this._registered=n},t.prototype.getRegistrationStatus=function(){return this._registrationStatus},t.prototype.setRegistrationStatus=function(n){this._registrationStatus=n},t.prototype.getLocked=function(){return this._locked},t.prototype.setLocked=function(n){this._locked=n},t.__tarsusInterfaceName="FidoAuthFailureResponse",t}(n.FidoInputResponse);n.FidoAuthFailureResponse=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getFidoResponse=function(){return this._fidoResponse},t.prototype.setFidoResponse=function(n){this._fidoResponse=n},t.__tarsusInterfaceName="FidoAuthSuccessResponse",t}(n.FidoInputResponse);n.FidoAuthSuccessResponse=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Submit=0]="Submit";n[n.Abort=1]="Abort"})(t=n.FormControlRequest||(n.FormControlRequest={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Off=0]="Off";n[n.Critical=1]="Critical";n[n.Error=2]="Error";n[n.Warning=3]="Warning";n[n.Info=4]="Info";n[n.Debug=5]="Debug"})(t=n.LogLevel||(n.LogLevel={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Approve=0]="Approve";n[n.Deny=1]="Deny"})(t=n.MobileApprovalAction||(n.MobileApprovalAction={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Pending=0]="Pending";n[n.Approved=1]="Approved";n[n.Denied=2]="Denied";n[n.Expired=3]="Expired"})(t=n.MobileApprovalStatus||(n.MobileApprovalStatus={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Unknown=0]="Unknown";n[n.Sms=1]="Sms";n[n.Email=2]="Email";n[n.VoiceCall=3]="VoiceCall"})(t=n.OtpChannel||(n.OtpChannel={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getFailureError=function(){return this._failureError},t.prototype.setFailureError=function(n){this._failureError=n},t.prototype.getExpired=function(){return this._expired},t.prototype.setExpired=function(n){this._expired=n},t.prototype.getRegistered=function(){return this._registered},t.prototype.setRegistered=function(n){this._registered=n},t.prototype.getRegistrationStatus=function(){return this._registrationStatus},t.prototype.setRegistrationStatus=function(n){this._registrationStatus=n},t.prototype.getLocked=function(){return this._locked},t.prototype.setLocked=function(n){this._locked=n},t.__tarsusInterfaceName="PlaceholderAuthFailureResponse",t}(n.PlaceholderInputResponse);n.PlaceholderAuthFailureResponse=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getFailureError=function(){return this._failureError},t.prototype.setFailureError=function(n){this._failureError=n},t.__tarsusInterfaceName="PlaceholderAuthFailureWithServerProvidedStatusResponse",t}(n.PlaceholderInputResponse);n.PlaceholderAuthFailureWithServerProvidedStatusResponse=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getPlaceholderToken=function(){return this._placeholderToken},t.prototype.setPlaceholderToken=function(n){this._placeholderToken=n},t.__tarsusInterfaceName="PlaceholderAuthSuccessResponse",t}(n.PlaceholderInputResponse);n.PlaceholderAuthSuccessResponse=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Skip=0]="Skip";n[n.Abort=1]="Abort";n[n.Continue=2]="Continue"})(t=n.PromotionControlRequest||(n.PromotionControlRequest={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Numeric=0]="Numeric";n[n.Alphanumeric=1]="Alphanumeric";n[n.Binary=2]="Binary"})(t=n.QrCodeFormat||(n.QrCodeFormat={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.RedirectToPolicy=0]="RedirectToPolicy";n[n.CancelRedirect=1]="CancelRedirect"})(t=n.RedirectResponseType||(n.RedirectResponseType={}))})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.getAnswers=function(){return this._answers},t.__tarsusInterfaceName="SecurityQuestionAnswersInputResponse",t}(n.SecurityQuestionInputResponse);n.SecurityQuestionAnswersInputResponse=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.getValue=function(){return this._value},n.prototype.setValue=function(n){this._value=n},n.prototype.getFormat=function(){return this._format},n.prototype.setFormat=function(n){this._format=n},n.__tarsusInterfaceName="TotpChallenge",n}();n.TotpChallenge=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.getName=function(){return this._name},n.prototype.setName=function(n){this._name=n},n.prototype.getValue=function(){return this._value},n.prototype.setValue=function(n){this._value=n},n.__tarsusInterfaceName="TransportHeader",n}();n.TransportHeader=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.getUrl=function(){return this._url},n.prototype.setUrl=function(n){this._url=n},n.prototype.getMethod=function(){return this._method},n.prototype.setMethod=function(n){this._method=n},n.prototype.getHeaders=function(){return this._headers},n.prototype.setHeaders=function(n){this._headers=n},n.prototype.getBodyJson=function(){return this._bodyJson},n.prototype.setBodyJson=function(n){this._bodyJson=n},n.__tarsusInterfaceName="TransportRequest",n}();n.TransportRequest=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.getStatus=function(){return this._status},n.prototype.setStatus=function(n){this._status=n},n.prototype.getMethod=function(){return this._method},n.prototype.setMethod=function(n){this._method=n},n.prototype.getHeaders=function(){return this._headers},n.prototype.setHeaders=function(n){this._headers=n},n.prototype.getBodyJson=function(){return this._bodyJson},n.prototype.setBodyJson=function(n){this._bodyJson=n},n.__tarsusInterfaceName="TransportResponse",n}();n.TransportResponse=t})(t=n.sdk||(n.sdk={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.Version=0]="Version";n[n.Platform=1]="Platform";n[n.FingerprintSupported=2]="FingerprintSupported";n[n.HostProvidedFeatures=3]="HostProvidedFeatures";n[n.FaceIdKeyBioProtectionSupported=4]="FaceIdKeyBioProtectionSupported";n[n.ImageAcquitisionSupported=5]="ImageAcquitisionSupported";n[n.AudioAcquitisionSupported=6]="AudioAcquitisionSupported";n[n.PersistentKeysSupported=7]="PersistentKeysSupported";n[n.FidoClientPresent=8]="FidoClientPresent";n[n.DyadicPresent=9]="DyadicPresent"})(t=n.HostInformationKey||(n.HostInformationKey={}))})(t=n.sdkhost||(n.sdkhost={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.None=0]="None";n[n.NormalProtection=1]="NormalProtection";n[n.BindToEnrollmentDb=2]="BindToEnrollmentDb"})(t=n.KeyBiometricProtectionMode||(n.KeyBiometricProtectionMode={}))})(t=n.sdkhost||(n.sdkhost={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.StdSigningKey=0]="StdSigningKey";n[n.StdEncryptionKey=1]="StdEncryptionKey";n[n.GeneralPurposeAES=2]="GeneralPurposeAES";n[n.NoIntegrityAES=3]="NoIntegrityAES";n[n.FidoECCSigningKey=4]="FidoECCSigningKey"})(t=n.KeyClass||(n.KeyClass={}))})(t=n.sdkhost||(n.sdkhost={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getPluginName=function(){return this._pluginName},t.prototype.setPluginName=function(n){this._pluginName=n},t.prototype.getVersionMajor=function(){return this._versionMajor},t.prototype.setVersionMajor=function(n){this._versionMajor=n},t.prototype.getVersionMinor=function(){return this._versionMinor},t.prototype.setVersionMinor=function(n){this._versionMinor=n},t.prototype.getVersionPatch=function(){return this._versionPatch},t.prototype.setVersionPatch=function(n){this._versionPatch=n},t.prototype.getRequiredPluginApiLevel=function(){return this._requiredPluginApiLevel},t.prototype.setRequiredPluginApiLevel=function(n){this._requiredPluginApiLevel=n},t.create=function(){return n.ts.mobile.tarsusplugin.impl.PluginInfoImpl.create()},t.__tarsusInterfaceName="PluginInfo",t}();t.PluginInfo=i})(i=t.tarsusplugin||(t.tarsusplugin={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getCode=function(){return this._code},t.prototype.getTimeStepSeconds=function(){return this._timeStepSeconds},t.prototype.getExpiresInSeconds=function(){return this._expiresInSeconds},t.prototype.getSecondsTillNextInvocation=function(){return this._secondsTillNextInvocation},t.prototype.getShouldUpdateSpecificProperties=function(){return this._shouldUpdateSpecificProperties},t.prototype.getGeneratorSpecificDataToStore=function(){return this._generatorSpecificDataToStore},t.prototype.getMessage=function(){return this._message},t.create=function(t,i,r,u,f,e,o){return n.ts.mobile.tarsusplugin.impl.TotpCodeGenerationOutputImpl.create(t,i,r,u,f,e,o)},t.__tarsusInterfaceName="TotpCodeGenerationOutput",t}();t.TotpCodeGenerationOutput=i})(i=t.tarsusplugin||(t.tarsusplugin={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(){function t(){}return t.prototype.getUnprotectedProvisionOutput=function(){return this._unprotectedProvisionOutput},t.prototype.getSecretToLock=function(){return this._secretToLock},t.create=function(t,i){return n.ts.mobile.tarsusplugin.impl.VaultBasedTotpProvisionOutputImpl.create(t,i)},t.__tarsusInterfaceName="VaultBasedTotpProvisionOutput",t}();t.VaultBasedTotpProvisionOutput=i})(i=t.tarsusplugin||(t.tarsusplugin={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i;(function(i){var r=function(t){function i(){var n=t.call(this)||this;return n._versionMajor=0,n._versionMinor=0,n._versionPatch=0,n}return __extends(i,t),i.create=function(){return new n.ts.mobile.tarsusplugin.impl.PluginInfoImpl},i.versionToString=function(n){return n.getVersionMajor()+"."+n.getVersionMinor()+"."+n.getVersionPatch()},i.toString=function(n){return n.getPluginName()+" v"+this.versionToString(n)},i}(t.PluginInfo);i.PluginInfoImpl=r})(i=t.impl||(t.impl={}))})(i=t.tarsusplugin||(t.tarsusplugin={}))})(i=t.mobile||(t.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n,i,r,u,f,e,o){var s=new t;return s._code=n,i&&(s._message=i),s._timeStepSeconds=r,s._expiresInSeconds=u,s._secondsTillNextInvocation=f,s._shouldUpdateSpecificProperties=e,o&&(s._generatorSpecificDataToStore=o),s},t}(n.TotpCodeGenerationOutput);t.TotpCodeGenerationOutputImpl=i})(t=n.impl||(n.impl={}))})(t=n.tarsusplugin||(n.tarsusplugin={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.create=function(n,i){var r=new t;return r._secretToLock=n,r._unprotectedProvisionOutput=i,r},t}(n.VaultBasedTotpProvisionOutput);t.VaultBasedTotpProvisionOutputImpl=i})(t=n.impl||(n.impl={}))})(t=n.tarsusplugin||(n.tarsusplugin={}))})(t=n.mobile||(n.mobile={}))})(t=n.ts||(n.ts={}))}(com||(com={}));!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.xmsdk=t():n.xmsdk=t()}(window,function(){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((1&i&&(n=t(n)),8&i)||4&i&&"object"==typeof n&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&i&&"string"!=typeof n)for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=5)}([function(n,t){"use strict";function i(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(t,i,r){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this.supportsInlineError=!1;this.title=t;this.username=i;this.common=r}return function(n,t,r){t&&i(n.prototype,t);r&&i(n,r)}(n,[{key:"startSession",value:function(n,t,i,r){this.description=n;this.mode=t;this.actionContext=i;this.clientContext=r;console.log("Starting session; session mode: [".concat(this.mode,"], authenticator: [").concat(this.title,"]"))}},{key:"changeSessionModeToRegistrationAfterExpiration",value:function(){console.log("Changing session mode to registration after expiration; authenticator: [".concat(this.title,"]"));this.mode=com.ts.mobile.sdk.AuthenticatorSessionMode.Registration;this.authError=null}},{key:"promiseRecoveryForError",value:function(n,t,i){return console.log("Starting error recovery; session mode: [".concat(this.mode,"], authenticator: [").concat(this.title,"], error: [").concat(n,"]")),this.supportsInlineError&&i===com.ts.mobile.sdk.AuthenticationErrorRecovery.RetryAuthenticator?(this.authError=n,Promise.resolve(i)):i===com.ts.mobile.sdk.AuthenticationErrorRecovery.Fail?Promise.resolve(i):this.common.promiseRecoveryForError(n,t,i,this.clientContext)}},{key:"endSession",value:function(){console.log("Ending session; session mode: [".concat(this.mode,"], authenticator: [").concat(this.title,"]"))}},{key:"promiseInput",value:function(){var n,t=this;switch(this.common.setAriaBusy(this.clientContext),this.mode){case com.ts.mobile.sdk.AuthenticatorSessionMode.Authentication:console.log("Fetching authentication input; authenticator: [".concat(this.title,"]"));this.common.unsetAriaBusy(this.clientContext);n=this.promiseAuthInput();break;case com.ts.mobile.sdk.AuthenticatorSessionMode.Registration:console.log("Fetching registration input; authenticator: [".concat(this.title,"]"));this.common.unsetAriaBusy(this.clientContext);n=this.promiseRegInput()}return n.then(function(n){return t.common.clearContainer(t.clientContext),n})}}]),n}();t.BaseAuthenticatorSession=r},function(n,t,i){"use strict";var r,u;void 0===(u="function"==typeof(r=function(){var n=function n(t){if(!(this instanceof n))return new n(t);this.options=this.extend(t,{swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",detectScreenOrientation:!0,sortPluginsFor:[/palemoon/i],userDefinedFonts:[]});this.nativeForEach=Array.prototype.forEach;this.nativeMap=Array.prototype.map};return n.prototype={extend:function(n,t){if(null==n)return t;for(var i in n)null!=n[i]&&t[i]!==n[i]&&(t[i]=n[i]);return t},get:function(n){var i=this,t={data:[],push:function(n){var r=n.key,t=n.value;"function"==typeof i.options.preprocessor&&(t=i.options.preprocessor(r,t));this.data.push({key:r,value:t})}};t=this.userAgentKey(t);t=this.languageKey(t);t=this.colorDepthKey(t);t=this.pixelRatioKey(t);t=this.hardwareConcurrencyKey(t);t=this.screenResolutionKey(t);t=this.availableScreenResolutionKey(t);t=this.timezoneOffsetKey(t);t=this.sessionStorageKey(t);t=this.localStorageKey(t);t=this.indexedDbKey(t);t=this.addBehaviorKey(t);t=this.openDatabaseKey(t);t=this.cpuClassKey(t);t=this.platformKey(t);t=this.doNotTrackKey(t);t=this.pluginsKey(t);t=this.canvasKey(t);t=this.webglKey(t);t=this.adBlockKey(t);t=this.hasLiedLanguagesKey(t);t=this.hasLiedResolutionKey(t);t=this.hasLiedOsKey(t);t=this.hasLiedBrowserKey(t);t=this.touchSupportKey(t);t=this.customEntropyFunction(t);this.fontsKey(t,function(t){var r=[],u;return i.each(t.data,function(n){var t=n.value;void 0!==n.value.join&&(t=n.value.join(";"));r.push(t)}),u=i.x64hash128(r.join("~~~"),31),n(u,t.data)})},customEntropyFunction:function(n){return"function"==typeof this.options.customFunction&&n.push({key:"custom",value:this.options.customFunction()}),n},userAgentKey:function(n){return this.options.excludeUserAgent||n.push({key:"user_agent",value:this.getUserAgent()}),n},getUserAgent:function(){return navigator.userAgent},languageKey:function(n){return this.options.excludeLanguage||n.push({key:"language",value:navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||""}),n},colorDepthKey:function(n){return this.options.excludeColorDepth||n.push({key:"color_depth",value:screen.colorDepth||-1}),n},pixelRatioKey:function(n){return this.options.excludePixelRatio||n.push({key:"pixel_ratio",value:this.getPixelRatio()}),n},getPixelRatio:function(){return window.devicePixelRatio||""},screenResolutionKey:function(n){return this.options.excludeScreenResolution?n:this.getScreenResolution(n)},getScreenResolution:function(n){var t;return void 0!==(t=this.options.detectScreenOrientation&&screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height])&&n.push({key:"resolution",value:t}),n},availableScreenResolutionKey:function(n){return this.options.excludeAvailableScreenResolution?n:this.getAvailableScreenResolution(n)},getAvailableScreenResolution:function(n){var t;return screen.availWidth&&screen.availHeight&&(t=this.options.detectScreenOrientation?screen.availHeight>screen.availWidth?[screen.availHeight,screen.availWidth]:[screen.availWidth,screen.availHeight]:[screen.availHeight,screen.availWidth]),void 0!==t&&n.push({key:"available_resolution",value:t}),n},timezoneOffsetKey:function(n){return this.options.excludeTimezoneOffset||n.push({key:"timezone_offset",value:(new Date).getTimezoneOffset()}),n},sessionStorageKey:function(n){return!this.options.excludeSessionStorage&&this.hasSessionStorage()&&n.push({key:"session_storage",value:1}),n},localStorageKey:function(n){return!this.options.excludeSessionStorage&&this.hasLocalStorage()&&n.push({key:"local_storage",value:1}),n},indexedDbKey:function(n){return!this.options.excludeIndexedDB&&this.hasIndexedDB()&&n.push({key:"indexed_db",value:1}),n},addBehaviorKey:function(n){return document.body&&!this.options.excludeAddBehavior&&document.body.addBehavior&&n.push({key:"add_behavior",value:1}),n},openDatabaseKey:function(n){return!this.options.excludeOpenDatabase&&window.openDatabase&&n.push({key:"open_database",value:1}),n},cpuClassKey:function(n){return this.options.excludeCpuClass||n.push({key:"cpu_class",value:this.getNavigatorCpuClass()}),n},platformKey:function(n){return this.options.excludePlatform||n.push({key:"navigator_platform",value:this.getNavigatorPlatform()}),n},doNotTrackKey:function(n){return this.options.excludeDoNotTrack||n.push({key:"do_not_track",value:this.getDoNotTrack()}),n},canvasKey:function(n){return!this.options.excludeCanvas&&this.isCanvasSupported()&&n.push({key:"canvas",value:this.getCanvasFp()}),n},webglKey:function(n){return this.options.excludeWebGL?n:this.isWebGlSupported()?(n.push({key:"webgl",value:this.getWebglFp()}),n):n},adBlockKey:function(n){return this.options.excludeAdBlock||n.push({key:"adblock",value:this.getAdBlock()}),n},hasLiedLanguagesKey:function(n){return this.options.excludeHasLiedLanguages||n.push({key:"has_lied_languages",value:this.getHasLiedLanguages()}),n},hasLiedResolutionKey:function(n){return this.options.excludeHasLiedResolution||n.push({key:"has_lied_resolution",value:this.getHasLiedResolution()}),n},hasLiedOsKey:function(n){return this.options.excludeHasLiedOs||n.push({key:"has_lied_os",value:this.getHasLiedOs()}),n},hasLiedBrowserKey:function(n){return this.options.excludeHasLiedBrowser||n.push({key:"has_lied_browser",value:this.getHasLiedBrowser()}),n},fontsKey:function(n,t){return this.options.excludeJsFonts?this.flashFontsKey(n,t):this.jsFontsKey(n,t)},flashFontsKey:function(n,t){return this.options.excludeFlashFonts?t(n):this.hasSwfObjectLoaded()&&this.hasMinFlashInstalled()?void 0===this.options.swfPath?t(n):void this.loadSwfAndDetectFonts(function(i){n.push({key:"swf_fonts",value:i.join(";")});t(n)}):t(n)},jsFontsKey:function(n,t){var i=this;return setTimeout(function(){var r=["monospace","sans-serif","serif"],u=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"],f,y,p;i.options.extendedJsFonts&&(u=u.concat(["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"]));u=u.concat(i.options.userDefinedFonts);var e=document.getElementsByTagName("body")[0],s=document.createElement("div"),h=document.createElement("div"),c={},l={},a=function(){var n=document.createElement("span");return n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="72px",n.style.lineHeight="normal",n.innerHTML="mmmmmmmmmmlli",n},b=function(n,t){var i=a();return i.style.fontFamily="'"+n+"',"+t,i},k=function(n){for(var i=!1,t=0;t<r.length;t++)if(i=n[t].offsetWidth!==c[r[t]]||n[t].offsetHeight!==l[r[t]])return i;return i},v=function(){for(var n,i=[],t=0,u=r.length;t<u;t++)n=a(),n.style.fontFamily=r[t],s.appendChild(n),i.push(n);return i}();for(e.appendChild(s),f=0,y=r.length;f<y;f++)c[r[f]]=v[f].offsetWidth,l[r[f]]=v[f].offsetHeight;p=function(){for(var i,f={},n=0,o=u.length;n<o;n++){for(var e=[],t=0,s=r.length;t<s;t++)i=b(u[n],r[t]),h.appendChild(i),e.push(i);f[u[n]]=e}return f}();e.appendChild(h);for(var w=[],o=0,d=u.length;o<d;o++)k(p[u[o]])&&w.push(u[o]);e.removeChild(h);e.removeChild(s);n.push({key:"js_fonts",value:w});t(n)},1)},pluginsKey:function(n){return this.options.excludePlugins||(this.isIE()?this.options.excludeIEPlugins||n.push({key:"ie_plugins",value:this.getIEPlugins()}):n.push({key:"regular_plugins",value:this.getRegularPlugins()})),n},getRegularPlugins:function(){for(var n=[],t=0,i=navigator.plugins.length;t<i;t++)n.push(navigator.plugins[t]);return this.pluginsShouldBeSorted()&&(n=n.sort(function(n,t){return n.name>t.name?1:n.name<t.name?-1:0})),this.map(n,function(n){var t=this.map(n,function(n){return[n.type,n.suffixes].join("~")}).join(",");return[n.name,n.description,t].join("::")},this)},getIEPlugins:function(){var n=[];return(Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(window,"ActiveXObject")||"ActiveXObject"in window)&&(n=this.map(["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","MacromediaFlashPaper.MacromediaFlashPaper","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","ShockwaveFlash.ShockwaveFlash","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"],function(n){try{return new ActiveXObject(n),n}catch(n){return null}})),navigator.plugins&&(n=n.concat(this.getRegularPlugins())),n},pluginsShouldBeSorted:function(){for(var i,t=!1,n=0,r=this.options.sortPluginsFor.length;n<r;n++)if(i=this.options.sortPluginsFor[n],navigator.userAgent.match(i)){t=!0;break}return t},touchSupportKey:function(n){return this.options.excludeTouchSupport||n.push({key:"touch_support",value:this.getTouchSupport()}),n},hardwareConcurrencyKey:function(n){return this.options.excludeHardwareConcurrency||n.push({key:"hardware_concurrency",value:this.getHardwareConcurrency()}),n},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(n){return!0}},hasLocalStorage:function(){try{return!!window.localStorage}catch(n){return!0}},hasIndexedDB:function(){try{return!!window.indexedDB}catch(n){return!0}},getHardwareConcurrency:function(){return navigator.hardwareConcurrency?navigator.hardwareConcurrency:"unknown"},getNavigatorCpuClass:function(){return navigator.cpuClass?navigator.cpuClass:"unknown"},getNavigatorPlatform:function(){return navigator.platform?navigator.platform:"unknown"},getDoNotTrack:function(){return navigator.doNotTrack?navigator.doNotTrack:navigator.msDoNotTrack?navigator.msDoNotTrack:window.doNotTrack?window.doNotTrack:"unknown"},getTouchSupport:function(){var n=0,t=!1,i;void 0!==navigator.maxTouchPoints?n=navigator.maxTouchPoints:void 0!==navigator.msMaxTouchPoints&&(n=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent");t=!0}catch(n){}return i="ontouchstart"in window,[n,t,i]},getCanvasFp:function(){var i=[],t=document.createElement("canvas"),n;return t.width=2e3,t.height=200,t.style.display="inline",n=t.getContext("2d"),n.rect(0,0,10,10),n.rect(2,2,6,6),i.push("canvas winding:"+(!1===n.isPointInPath(5,5,"evenodd")?"yes":"no")),n.textBaseline="alphabetic",n.fillStyle="#f60",n.fillRect(125,1,62,20),n.fillStyle="#069",n.font=this.options.dontUseFakeFontInCanvas?"11pt Arial":"11pt no-real-font-123",n.fillText("Cwm fjordbank glyphs vext quiz, ????",2,15),n.fillStyle="rgba(102, 204, 0, 0.2)",n.font="18pt Arial",n.fillText("Cwm fjordbank glyphs vext quiz, ????",4,45),n.globalCompositeOperation="multiply",n.fillStyle="rgb(255,0,255)",n.beginPath(),n.arc(50,50,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(0,255,255)",n.beginPath(),n.arc(100,50,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(255,255,0)",n.beginPath(),n.arc(75,100,50,0,2*Math.PI,!0),n.closePath(),n.fill(),n.fillStyle="rgb(255,0,255)",n.arc(75,75,75,0,2*Math.PI,!0),n.arc(75,75,25,0,2*Math.PI,!0),n.fill("evenodd"),i.push("canvas fp:"+t.toDataURL()),i.join("~")},getWebglFp:function(){var n,o=function(t){return n.clearColor(0,0,0,1),n.enable(n.DEPTH_TEST),n.depthFunc(n.LEQUAL),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),"["+t[0]+", "+t[1]+"]"},t,r,s,i,u,f,e;if(!(n=this.getWebglCanvas()))return null;t=[];r=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,r);s=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);n.bufferData(n.ARRAY_BUFFER,s,n.STATIC_DRAW);r.itemSize=3;r.numItems=3;i=n.createProgram();u=n.createShader(n.VERTEX_SHADER);n.shaderSource(u,"attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}");n.compileShader(u);f=n.createShader(n.FRAGMENT_SHADER);n.shaderSource(f,"precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}");n.compileShader(f);n.attachShader(i,u);n.attachShader(i,f);n.linkProgram(i);n.useProgram(i);i.vertexPosAttrib=n.getAttribLocation(i,"attrVertex");i.offsetUniform=n.getUniformLocation(i,"uniformOffset");n.enableVertexAttribArray(i.vertexPosArray);n.vertexAttribPointer(i.vertexPosAttrib,r.itemSize,n.FLOAT,!1,0,0);n.uniform2f(i.offsetUniform,1,1);n.drawArrays(n.TRIANGLE_STRIP,0,r.numItems);null!=n.canvas&&t.push(n.canvas.toDataURL());t.push("extensions:"+n.getSupportedExtensions().join(";"));t.push("webgl aliased line width range:"+o(n.getParameter(n.ALIASED_LINE_WIDTH_RANGE)));t.push("webgl aliased point size range:"+o(n.getParameter(n.ALIASED_POINT_SIZE_RANGE)));t.push("webgl alpha bits:"+n.getParameter(n.ALPHA_BITS));t.push("webgl antialiasing:"+(n.getContextAttributes().antialias?"yes":"no"));t.push("webgl blue bits:"+n.getParameter(n.BLUE_BITS));t.push("webgl depth bits:"+n.getParameter(n.DEPTH_BITS));t.push("webgl green bits:"+n.getParameter(n.GREEN_BITS));t.push("webgl max anisotropy:"+function(n){var t,i=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic");return i?(0===(t=n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT))&&(t=2),t):null}(n));t.push("webgl max combined texture image units:"+n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS));t.push("webgl max cube map texture size:"+n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE));t.push("webgl max fragment uniform vectors:"+n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS));t.push("webgl max render buffer size:"+n.getParameter(n.MAX_RENDERBUFFER_SIZE));t.push("webgl max texture image units:"+n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS));t.push("webgl max texture size:"+n.getParameter(n.MAX_TEXTURE_SIZE));t.push("webgl max varying vectors:"+n.getParameter(n.MAX_VARYING_VECTORS));t.push("webgl max vertex attribs:"+n.getParameter(n.MAX_VERTEX_ATTRIBS));t.push("webgl max vertex texture image units:"+n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS));t.push("webgl max vertex uniform vectors:"+n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS));t.push("webgl max viewport dims:"+o(n.getParameter(n.MAX_VIEWPORT_DIMS)));t.push("webgl red bits:"+n.getParameter(n.RED_BITS));t.push("webgl renderer:"+n.getParameter(n.RENDERER));t.push("webgl shading language version:"+n.getParameter(n.SHADING_LANGUAGE_VERSION));t.push("webgl stencil bits:"+n.getParameter(n.STENCIL_BITS));t.push("webgl vendor:"+n.getParameter(n.VENDOR));t.push("webgl version:"+n.getParameter(n.VERSION));try{e=n.getExtension("WEBGL_debug_renderer_info");e&&(t.push("webgl unmasked vendor:"+n.getParameter(e.UNMASKED_VENDOR_WEBGL)),t.push("webgl unmasked renderer:"+n.getParameter(e.UNMASKED_RENDERER_WEBGL)))}catch(n){}return n.getShaderPrecisionFormat?(t.push("webgl vertex shader high float precision:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision),t.push("webgl vertex shader high float precision rangeMin:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).rangeMin),t.push("webgl vertex shader high float precision rangeMax:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).rangeMax),t.push("webgl vertex shader medium float precision:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision),t.push("webgl vertex shader medium float precision rangeMin:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).rangeMin),t.push("webgl vertex shader medium float precision rangeMax:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).rangeMax),t.push("webgl vertex shader low float precision:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).precision),t.push("webgl vertex shader low float precision rangeMin:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).rangeMin),t.push("webgl vertex shader low float precision rangeMax:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_FLOAT).rangeMax),t.push("webgl fragment shader high float precision:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision),t.push("webgl fragment shader high float precision rangeMin:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).rangeMin),t.push("webgl fragment shader high float precision rangeMax:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).rangeMax),t.push("webgl fragment shader medium float precision:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision),t.push("webgl fragment shader medium float precision rangeMin:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).rangeMin),t.push("webgl fragment shader medium float precision rangeMax:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).rangeMax),t.push("webgl fragment shader low float precision:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).precision),t.push("webgl fragment shader low float precision rangeMin:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).rangeMin),t.push("webgl fragment shader low float precision rangeMax:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_FLOAT).rangeMax),t.push("webgl vertex shader high int precision:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).precision),t.push("webgl vertex shader high int precision rangeMin:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).rangeMin),t.push("webgl vertex shader high int precision rangeMax:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_INT).rangeMax),t.push("webgl vertex shader medium int precision:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).precision),t.push("webgl vertex shader medium int precision rangeMin:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).rangeMin),t.push("webgl vertex shader medium int precision rangeMax:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_INT).rangeMax),t.push("webgl vertex shader low int precision:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).precision),t.push("webgl vertex shader low int precision rangeMin:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).rangeMin),t.push("webgl vertex shader low int precision rangeMax:"+n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.LOW_INT).rangeMax),t.push("webgl fragment shader high int precision:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).precision),t.push("webgl fragment shader high int precision rangeMin:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).rangeMin),t.push("webgl fragment shader high int precision rangeMax:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_INT).rangeMax),t.push("webgl fragment shader medium int precision:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).precision),t.push("webgl fragment shader medium int precision rangeMin:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).rangeMin),t.push("webgl fragment shader medium int precision rangeMax:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_INT).rangeMax),t.push("webgl fragment shader low int precision:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).precision),t.push("webgl fragment shader low int precision rangeMin:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).rangeMin),t.push("webgl fragment shader low int precision rangeMax:"+n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.LOW_INT).rangeMax),t.join("~")):t.join("~")},getAdBlock:function(){var n=document.createElement("div"),t;n.innerHTML="&nbsp;";n.className="adsbox";t=!1;try{document.body.appendChild(n);t=0===document.getElementsByClassName("adsbox")[0].offsetHeight;document.body.removeChild(n)}catch(n){t=!1}return t},getHasLiedLanguages:function(){if(void 0!==navigator.languages)try{var n=navigator.languages[0].substr(0,2);if(n!==navigator.language.substr(0,2))return!0}catch(n){return!0}return!1},getHasLiedResolution:function(){return screen.width<screen.availWidth||screen.height<screen.availHeight},getHasLiedOs:function(){var n,r=navigator.userAgent.toLowerCase(),i=navigator.oscpu,t=navigator.platform.toLowerCase();return(n=r.indexOf("windows phone")>=0?"Windows Phone":r.indexOf("win")>=0?"Windows":r.indexOf("android")>=0?"Android":r.indexOf("linux")>=0?"Linux":r.indexOf("iphone")>=0||r.indexOf("ipad")>=0?"iOS":r.indexOf("mac")>=0?"Mac":"Other",("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&"Windows Phone"!==n&&"Android"!==n&&"iOS"!==n&&"Other"!==n)?!0:void 0!==i&&((i=i.toLowerCase()).indexOf("win")>=0&&"Windows"!==n&&"Windows Phone"!==n||i.indexOf("linux")>=0&&"Linux"!==n&&"Android"!==n||i.indexOf("mac")>=0&&"Mac"!==n&&"iOS"!==n||0===i.indexOf("win")&&0===i.indexOf("linux")&&i.indexOf("mac")>=0&&"other"!==n)?!0:t.indexOf("win")>=0&&"Windows"!==n&&"Windows Phone"!==n||(t.indexOf("linux")>=0||t.indexOf("android")>=0||t.indexOf("pike")>=0)&&"Linux"!==n&&"Android"!==n||(t.indexOf("mac")>=0||t.indexOf("ipad")>=0||t.indexOf("ipod")>=0||t.indexOf("iphone")>=0)&&"Mac"!==n&&"iOS"!==n||0===t.indexOf("win")&&0===t.indexOf("linux")&&t.indexOf("mac")>=0&&"other"!==n||void 0===navigator.plugins&&"Windows"!==n&&"Windows Phone"!==n},getHasLiedBrowser:function(){var n,t=navigator.userAgent.toLowerCase(),u=navigator.productSub,r,i;if(("Chrome"==(n=t.indexOf("firefox")>=0?"Firefox":t.indexOf("opera")>=0||t.indexOf("opr")>=0?"Opera":t.indexOf("chrome")>=0?"Chrome":t.indexOf("safari")>=0?"Safari":t.indexOf("trident")>=0?"Internet Explorer":"Other")||"Safari"===n||"Opera"===n)&&"20030107"!==u||(i=eval.toString().length,37===i&&"Safari"!==n&&"Firefox"!==n&&"Other"!==n)||39===i&&"Internet Explorer"!==n&&"Other"!==n||33===i&&"Chrome"!==n&&"Opera"!==n&&"Other"!==n)return!0;try{throw"a";}catch(n){try{n.toSource();r=!0}catch(n){r=!1}}return!(!r||"Firefox"===n||"Other"===n)},isCanvasSupported:function(){var n=document.createElement("canvas");return!(!n.getContext||!n.getContext("2d"))},isWebGlSupported:function(){if(!this.isCanvasSupported())return!1;var n,t=document.createElement("canvas");try{n=t.getContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))}catch(t){n=!1}return!!window.WebGLRenderingContext&&!!n},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},hasSwfObjectLoaded:function(){return void 0!==window.swfobject},hasMinFlashInstalled:function(){return swfobject.hasFlashPlayerVersion("9.0.0")},addFlashDivNode:function(){var n=document.createElement("div");n.setAttribute("id",this.options.swfContainerId);document.body.appendChild(n)},loadSwfAndDetectFonts:function(n){var t="___fp_swf_loaded",i,r;window[t]=function(t){n(t)};i=this.options.swfContainerId;this.addFlashDivNode();r={onReady:t};swfobject.embedSWF(this.options.swfPath,i,"1","1","9.0.0",!1,r,{allowScriptAccess:"always",menu:"false"},{})},getWebglCanvas:function(){var t=document.createElement("canvas"),n=null;try{n=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(t){}return n||(n=null),n},each:function(n,t,i){var r,f,u;if(null!==n)if(this.nativeForEach&&n.forEach===this.nativeForEach)n.forEach(t,i);else if(n.length===+n.length){for(r=0,f=n.length;r<f;r++)if(t.call(i,n[r],r,n)==={})return}else for(u in n)if(n.hasOwnProperty(u)&&t.call(i,n[u],u,n)==={})return},map:function(n,t,i){var r=[];return null==n?r:this.nativeMap&&n.map===this.nativeMap?n.map(t,i):(this.each(n,function(n,u,f){r[r.length]=t.call(i,n,u,f)}),r)},x64Add:function(n,t){n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var i=[0,0,0,0];return i[3]+=n[3]+t[3],i[2]+=i[3]>>>16,i[3]&=65535,i[2]+=n[2]+t[2],i[1]+=i[2]>>>16,i[2]&=65535,i[1]+=n[1]+t[1],i[0]+=i[1]>>>16,i[1]&=65535,i[0]+=n[0]+t[0],i[0]&=65535,[i[0]<<16|i[1],i[2]<<16|i[3]]},x64Multiply:function(n,t){n=[n[0]>>>16,65535&n[0],n[1]>>>16,65535&n[1]];t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var i=[0,0,0,0];return i[3]+=n[3]*t[3],i[2]+=i[3]>>>16,i[3]&=65535,i[2]+=n[2]*t[3],i[1]+=i[2]>>>16,i[2]&=65535,i[2]+=n[3]*t[2],i[1]+=i[2]>>>16,i[2]&=65535,i[1]+=n[1]*t[3],i[0]+=i[1]>>>16,i[1]&=65535,i[1]+=n[2]*t[2],i[0]+=i[1]>>>16,i[1]&=65535,i[1]+=n[3]*t[1],i[0]+=i[1]>>>16,i[1]&=65535,i[0]+=n[0]*t[3]+n[1]*t[2]+n[2]*t[1]+n[3]*t[0],i[0]&=65535,[i[0]<<16|i[1],i[2]<<16|i[3]]},x64Rotl:function(n,t){return 32==(t%=64)?[n[1],n[0]]:t<32?[n[0]<<t|n[1]>>>32-t,n[1]<<t|n[0]>>>32-t]:(t-=32,[n[1]<<t|n[0]>>>32-t,n[0]<<t|n[1]>>>32-t])},x64LeftShift:function(n,t){return 0==(t%=64)?n:t<32?[n[0]<<t|n[1]>>>32-t,n[1]<<t]:[n[1]<<t-32,0]},x64Xor:function(n,t){return[n[0]^t[0],n[1]^t[1]]},x64Fmix:function(n){return n=this.x64Xor(n,[0,n[0]>>>1]),n=this.x64Multiply(n,[4283543511,3981806797]),n=this.x64Xor(n,[0,n[0]>>>1]),n=this.x64Multiply(n,[3301882366,444984403]),n=this.x64Xor(n,[0,n[0]>>>1])},x64hash128:function(n,t){n=n||"";t=t||0;for(var h=n.length%16,c=n.length-h,f=[0,t],e=[0,t],r=[0,0],u=[0,0],o=[2277735313,289559509],s=[1291169091,658871167],i=0;i<c;i+=16)r=[255&n.charCodeAt(i+4)|(255&n.charCodeAt(i+5))<<8|(255&n.charCodeAt(i+6))<<16|(255&n.charCodeAt(i+7))<<24,255&n.charCodeAt(i)|(255&n.charCodeAt(i+1))<<8|(255&n.charCodeAt(i+2))<<16|(255&n.charCodeAt(i+3))<<24],u=[255&n.charCodeAt(i+12)|(255&n.charCodeAt(i+13))<<8|(255&n.charCodeAt(i+14))<<16|(255&n.charCodeAt(i+15))<<24,255&n.charCodeAt(i+8)|(255&n.charCodeAt(i+9))<<8|(255&n.charCodeAt(i+10))<<16|(255&n.charCodeAt(i+11))<<24],r=this.x64Multiply(r,o),r=this.x64Rotl(r,31),r=this.x64Multiply(r,s),f=this.x64Xor(f,r),f=this.x64Rotl(f,27),f=this.x64Add(f,e),f=this.x64Add(this.x64Multiply(f,[0,5]),[0,1390208809]),u=this.x64Multiply(u,s),u=this.x64Rotl(u,33),u=this.x64Multiply(u,o),e=this.x64Xor(e,u),e=this.x64Rotl(e,31),e=this.x64Add(e,f),e=this.x64Add(this.x64Multiply(e,[0,5]),[0,944331445]);switch(r=[0,0],u=[0,0],h){case 15:u=this.x64Xor(u,this.x64LeftShift([0,n.charCodeAt(i+14)],48));case 14:u=this.x64Xor(u,this.x64LeftShift([0,n.charCodeAt(i+13)],40));case 13:u=this.x64Xor(u,this.x64LeftShift([0,n.charCodeAt(i+12)],32));case 12:u=this.x64Xor(u,this.x64LeftShift([0,n.charCodeAt(i+11)],24));case 11:u=this.x64Xor(u,this.x64LeftShift([0,n.charCodeAt(i+10)],16));case 10:u=this.x64Xor(u,this.x64LeftShift([0,n.charCodeAt(i+9)],8));case 9:u=this.x64Xor(u,[0,n.charCodeAt(i+8)]);u=this.x64Multiply(u,s);u=this.x64Rotl(u,33);u=this.x64Multiply(u,o);e=this.x64Xor(e,u);case 8:r=this.x64Xor(r,this.x64LeftShift([0,n.charCodeAt(i+7)],56));case 7:r=this.x64Xor(r,this.x64LeftShift([0,n.charCodeAt(i+6)],48));case 6:r=this.x64Xor(r,this.x64LeftShift([0,n.charCodeAt(i+5)],40));case 5:r=this.x64Xor(r,this.x64LeftShift([0,n.charCodeAt(i+4)],32));case 4:r=this.x64Xor(r,this.x64LeftShift([0,n.charCodeAt(i+3)],24));case 3:r=this.x64Xor(r,this.x64LeftShift([0,n.charCodeAt(i+2)],16));case 2:r=this.x64Xor(r,this.x64LeftShift([0,n.charCodeAt(i+1)],8));case 1:r=this.x64Xor(r,[0,n.charCodeAt(i)]);r=this.x64Multiply(r,o);r=this.x64Rotl(r,31);r=this.x64Multiply(r,s);f=this.x64Xor(f,r)}return f=this.x64Xor(f,[0,n.length]),e=this.x64Xor(e,[0,n.length]),f=this.x64Add(f,e),e=this.x64Add(e,f),f=this.x64Fmix(f),e=this.x64Fmix(e),f=this.x64Add(f,e),e=this.x64Add(e,f),("00000000"+(f[0]>>>0).toString(16)).slice(-8)+("00000000"+(f[1]>>>0).toString(16)).slice(-8)+("00000000"+(e[0]>>>0).toString(16)).slice(-8)+("00000000"+(e[1]>>>0).toString(16)).slice(-8)}},n.VERSION="1.5.1",n})?r.call(t,i,t,n):r)||(n.exports=u)},function(n,t,i){"use strict";function f(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}var u=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}},r=this&&this.__importStar||function(n){var t,i;if(n&&n.__esModule)return n;if(t={},null!=n)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t.default=n,t};Object.defineProperty(t,"__esModule",{value:!0});var o=u(i(3)),s=u(i(4)),h=u(i(17)),c=r(i(18)),l=r(i(19)),a=r(i(20)),v=r(i(21)),y=r(i(23)),p=r(i(24)),w=r(i(26)),b=r(i(27)),k=r(i(28)),d=r(i(29)),e=i(30),g=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this.common=new e.XmUiCommon}return function(n,t,i){t&&f(n.prototype,t);i&&f(n,i)}(n,[{key:"startActivityIndicator",value:function(n,t){this.common.showProgressForm(t)}},{key:"endActivityIndicator",value:function(n,t){this.common.hideProgressForm(t)}},{key:"controlFlowCancelled",value:function(n){console.log("Control flow cancelled");this.common.clearContainer(n)}},{key:"controlFlowStarting",value:function(){console.log("Control flow started")}},{key:"controlFlowEnded",value:function(n){console.log(" with error: ".concat(n))}},{key:"controlFlowActionStarting",value:function(){console.log("Control flow action starting")}},{key:"controlFlowActionEnded",value:function(){console.log("Control flow action starting")}},{key:"handleAuthenticatorUnregistration",value:function(){return Promise.resolve(com.ts.mobile.sdk.UnregistrationInput.create(0))}},{key:"selectAuthenticator",value:function(n,t,i){return this.common.methodMenuPromise(n,i)}},{key:"selectAuthenticatorFallbackAction",value:function(n,t,i,r,u){return this.common.methodFallbackPromise(n,t,u)}},{key:"controlOptionForCancellationRequestInSession",value:function(n,t){return this.common.promiseCancelAction(n,t.clientContext)}},{key:"createPasswordAuthSession",value:function(n,t){return new l.PasswordAuthenticatorSession(n,t,this.common)}},{key:"createPinAuthSession",value:function(n,t,i){return new a.PinAuthenticatorSession(n,t,i,this.common)}},{key:"createPatternAuthSession",value:function(n,t,i,r){return new v.PatternAuthenticatorSession(n,t,i,r,this.common)}},{key:"createOtpAuthSession",value:function(n,t,i,r){return new y.OtpAuthenticatorSession(n,t,i,r,this.common)}},{key:"createVoiceAuthSession",value:function(n,t){return new p.VoiceAuthenticatorSession(n,t,this.common)}},{key:"createSecurityQuestionAuthSession",value:function(n,t){return new w.SecurityQuestionAuthenticatorSession(n,t,this.common)}},{key:"createPlaceholderAuthSession",value:function(){throw new Error("Method not implemented by demo application.");}},{key:"getConfirmationInput",value:function(n,t,i,r,u,f){return o.default(n,t,i,r,u,f,this.common)}},{key:"getInformationResponse",value:function(n,t,i,r,u){return s.default(n,t,i,r,u,this.common)}},{key:"createMobileApproveAuthSession",value:function(n,t,i){return new b.MobileApproveAuthenticatorSession(n,t,i,this.common)}},{key:"createTicketWaitSession",value:function(){return new d.TicketWaitSession(this.common)}},{key:"createTotpAuthSession",value:function(n,t){return new k.TotpAuthenticatorSession(n,t,this.common)}},{key:"createFormSession",value:function(){throw new Error("Method not implemented by demo application.");}},{key:"createAuthenticationConfigurationSession",value:function(n){return this.common.configurationSession(n)}},{key:"createRegistrationPromotionSession",value:function(n,t){return new c.RegistrationPromotionSession(n,t,this.common)}},{key:"processJsonData",value:function(){throw new Error("Method not implemented by demo application.");}},{key:"handlePolicyRejection",value:function(n,t,i,r,u,f){return n||t||i?h.default(n,t,i,f,this.common):Promise.resolve(com.ts.mobile.sdk.ConfirmationInput.create(-1))}},{key:"handlePolicyRedirect",value:function(n,t,i,r){return console.log("Policy redirection requested. redirecting to policy: [".concat(t,"] with additionalParameters: [").concat(r,"]")),Promise.resolve(com.ts.mobile.sdk.RedirectInput.create(com.ts.mobile.sdk.RedirectResponseType.RedirectToPolicy))}},{key:"shouldIncludeDisabledAuthenticatorsInMenu",value:function(){return!1}},{key:"createScanQrSession",value:function(){throw new Error("Method not implemented.");}},{key:"createFingerprintAuthSession",value:function(){throw new Error("Method not implemented.");}},{key:"createApprovalsSession",value:function(){throw new Error("Method not implemented.");}},{key:"createTotpGenerationSession",value:function(){throw new Error("Method not implemented.");}},{key:"createDeviceManagementSession",value:function(){throw new Error("Method not implemented.");}},{key:"createNativeFaceAuthSession",value:function(){throw new Error("Method not implemented.");}},{key:"createFaceAuthSession",value:function(){throw new Error("Method not implemented.");}},{key:"localAuthenticatorInvalidated",value:function(){throw new Error("Method not implemented.");}}],[{key:"getContainer",value:function(n){return e.XmUiCommon.getContainer(n)}}]),n}();t.XmUIHandler=g},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(n,t,i,r,u,f,e){var o=$('<div class="xmuiCore xmuiForm xmuiConfirmationForm">            <div class="xmuiPageHeader">                <div>                    <span class="xmuiConfirmationTitle"><\/span>                <\/div>            <\/div>            <div class="xmuiFullHeightContentBelowPrompt">                <div class="xmuiConfirmationText"/><br/>                <div>                    <button class="xmuiConfirmationContinueButton" type="button"/>                    <button class="xmuiConfirmationCancelButton" type="button"/>                <\/div>            <\/div>        <\/div>');return e.appendElement(o,f),e.setAriaBusy(f),new Promise(function(u){var s,h;o.find(".xmuiConfirmationTitle").text(n);o.find(".xmuiConfirmationText").html(t);s=o.find(".xmuiConfirmationContinueButton");s.text(i);s.click(function(){o.fadeOut(function(){e.clearContainer(f);u(com.ts.mobile.sdk.ConfirmationInput.create(0))})});h=o.find(".xmuiConfirmationCancelButton");h.text(r);h.click(function(){o.fadeOut(function(){e.clearContainer(f);u(com.ts.mobile.sdk.ConfirmationInput.create(1))})});e.unsetAriaBusy(f)})}},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(n,t,i,r,u,f){var e=$('<div class="xmuiCore xmuiForm xmuiInformationForm">            <div class="xmuiPageHeader">                <div>                    <span class="xmuiInformationTitle"<\/span>                <\/div>            <\/div>            <div class="xmuiFullHeightContentBelowPrompt">                <div class="xmuiInformationText"/><br/>                <div>                    <button class="xmuiInformationButton" type="button"/>                <\/div>            <\/div>        <\/div>');return f.appendElement(e,u),f.setAriaBusy(u),new Promise(function(r){e.find(".xmuiInformationTitle").text(n);e.find(".xmuiInformationText").html(t);var o=e.find(".xmuiInformationButton");o.text(i);o.click(function(){e.fadeOut(function(){f.clearContainer(u);r(com.ts.mobile.sdk.ConfirmationInput.create(-1))})});f.unsetAriaBusy(u)})}},function(n,t,i){"use strict";var r,u;Object.defineProperty(t,"__esModule",{value:!0});r=i(6);t.XmSdk=r.XmSdk;u=i(2);t.XmUIHandler=u.XmUIHandler},function(n,t,i){"use strict";var f;Object.defineProperty(t,"__esModule",{value:!0});var e=i(7),o=i(8),s=i(2),r=com.ts.mobile.sdk.createSdk(),u=new o.XmHost;r.setTarsusHost(u);f=new s.XmUIHandler;r.setUiHandler(f);r.setTransportProvider(new e.XmTransportProvider(u));r.setEnabledCollectors([com.ts.mobile.sdk.CollectorType.DeviceDetails,com.ts.mobile.sdk.CollectorType.LargeData]);r.setLogLevel(com.ts.mobile.sdk.LogLevel.Error);t.XmSdk=function(){return r}},function(n,t){"use strict";function i(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(t){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this._host=t}return function(n,t,r){t&&i(n.prototype,t);r&&i(n,r)}(n,[{key:"extractHeaders",value:function(n){return n.trim().split(/[\r\n]+/).map(function(n){var i=n.split(": "),r=i.shift(),u=i.join(": "),t=new com.ts.mobile.sdk.TransportHeader;return t.setName(r),t.setValue(u),t})}},{key:"sendRequest",value:function(n){var t=this;return new Promise(function(i,r){var u=new XMLHttpRequest,f=function(){r(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Communication,u.responseText))};u.open(n.getMethod(),n.getUrl(),!0);u.onreadystatechange=function(){if(4===u.readyState)try{if(0===u.status)return t._host.log(com.ts.mobile.sdk.LogLevel.Error,"transport","Destination server is invalid or the server does not support access-control-allow-origin."),r(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Communication,u.responseText));JSON.parse(u.responseText);var e=new com.ts.mobile.sdk.TransportResponse;e.setStatus(u.status);e.setMethod(n.getMethod());e.setHeaders(t.extractHeaders(u.getAllResponseHeaders()));e.setBodyJson(u.responseText);i(e)}catch(n){f()}};u.onerror=function(){f()};n.getHeaders().forEach(function(n){u.setRequestHeader(n.getName(),n.getValue())});u.setRequestHeader("Content-Type","application/json");u.send(n.getBodyJson())})}}]),n}();t.XmTransportProvider=r},function(n,t,i){"use strict";function u(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}var f=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}},e=this&&this.__importStar||function(n){var t,i;if(n&&n.__esModule)return n;if(t={},null!=n)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t.default=n,t};Object.defineProperty(t,"__esModule",{value:!0});var o=f(i(9)),r=f(i(10)),s=e(i(11)),h=e(i(13)),c=i(16),l=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this.logLevel=com.ts.mobile.sdk.LogLevel.Error;this.collectionResultsPromise=null;this.loggers=[new o.default];window.__XMSDK_PLUGINS={}}return function(n,t,i){t&&u(n.prototype,t);i&&u(n,i)}(n,[{key:"initialize",value:function(n){var t=this;return new Promise(function(i){t.enabledCollectors=n;i(!0)})}},{key:"setLogLevel",value:function(n){this.logLevel=n}},{key:"log",value:function(n,t,i){n<=this.logLevel&&this.loggers.forEach(function(r){r.log(n,t,i)})}},{key:"readStorageKey",value:function(n){return JSON.parse(r.default.localStorage.getItem(n)||"{}")}},{key:"writeStorageKey",value:function(n,t){r.default.localStorage.setItem(n,JSON.stringify(t))}},{key:"deleteStorageKey",value:function(n){r.default.localStorage.removeItem(n)}},{key:"readSessionStorageKey",value:function(n){return JSON.parse(r.default.sessionStorage.getItem(n)||"{}")}},{key:"writeSessionStorageKey",value:function(n,t){r.default.sessionStorage.setItem(n,JSON.stringify(t))}},{key:"deleteSessionStorageKey",value:function(n){r.default.sessionStorage.removeItem(n)}},{key:"promiseCollectionResult",value:function(){var n=this;return new Promise(function(t){var i={location:{allow:n.enabledCollectors.indexOf(com.ts.mobile.sdk.CollectorType.Location)>=0,timeout:4e3,maximumAge:18e4},largeData:n.enabledCollectors.indexOf(com.ts.mobile.sdk.CollectorType.LargeData)>=0},r=new Promise(function(n){h.TsCollectionResult(i).get(function(t){n(t)})}),u=new Promise(function(n){s.default.promiseCollection(i.largeData).then(function(t){n(t)})});n.collectionResultsPromise=Promise.all([r,u]).then(function(n){var t=Object.assign(n[0],n[1]);return t.toJson=function(){return t},t});t(n.collectionResultsPromise)})}},{key:"calcHexStringEncodedMd5Hash",value:function(n){var t=com.ts.mobile.sdk.util.hexToAscii(n);return c.md5(t)}},{key:"generateRandomHexString",value:function(n){var t=new Uint8Array(n);(window.crypto||window.msCrypto).getRandomValues(t);for(var r="",u=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],i=0;i<t.length;i++)r+=u[15&t[i]];return r}},{key:"queryHostInfo",value:function(n){switch(n){case com.ts.mobile.sdkhost.HostInformationKey.Version:return"3.6.3";case com.ts.mobile.sdkhost.HostInformationKey.Platform:return"web";case com.ts.mobile.sdkhost.HostInformationKey.FingerprintSupported:return"false";case com.ts.mobile.sdkhost.HostInformationKey.HostProvidedFeatures:return"";case com.ts.mobile.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported:case com.ts.mobile.sdkhost.HostInformationKey.ImageAcquitisionSupported:return"false";case com.ts.mobile.sdkhost.HostInformationKey.AudioAcquitisionSupported:return"true";case com.ts.mobile.sdkhost.HostInformationKey.PersistentKeysSupported:case com.ts.mobile.sdkhost.HostInformationKey.FidoClientPresent:case com.ts.mobile.sdkhost.HostInformationKey.DyadicPresent:return"false";default:throw new Error("Info key is unsupported: ".concat(n));}}},{key:"setExternalLogger",value:function(n){this.loggers=[n]}},{key:"getCurrentTime",value:function(){return Date.now()}},{key:"createDelayedPromise",value:function(n){return new Promise(function(t){setTimeout(t(n),n)})}},{key:"transformApiPath",value:function(n){var t=n.split("/");return t[0]="auth"===t[0]?"web":t[0],t[1]="login"===t[1]?"authenticate":t[1],t.join("/")}},{key:"calcHexStringEncodedHmacSha1HashWithHexEncodedKey",value:function(){return this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","calcHexStringEncodedHmacSha1HashWithHexEncodedKey not implemented for tarsus-web"),null}},{key:"generatePbkdf2HmacSha1HexString",value:function(){return Promise.reject("generatePbkdf2HmacSha1HexString not implemented for tarsus-web")}},{key:"fidoClientXact",value:function(){return Promise.reject("fidoClientXact not implemented for tarsus-web")}},{key:"generateKeyPair",value:function(){return Promise.reject("generateKeyPair not implemented for tarsus-web")}},{key:"getKeyPair",value:function(){return this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","getKeyPair not implemented for tarsus-web"),null}},{key:"deleteKeyPair",value:function(){this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","deleteKeyPair not implemented for tarsus-web")}},{key:"importSymmetricKey",value:function(){return this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","importSymmetricKey not implemented for tarsus-web"),null}},{key:"calcHexStringEncodedSha256Hash",value:function(n){var t=com.ts.mobile.sdk.util.hexToAscii(n);return sha256(com.ts.mobile.sdk.util.toUTF8Array(t))}},{key:"calcHexStringEncodedSha512Hash",value:function(){throw this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","calcHexStringEncodedSha512Hash not implemented for tarsus-web"),new Error("Method not implemented.");}},{key:"generateHexSeededKeyPairExternalRepresentation",value:function(){return Promise.reject("Method not implemented.")}},{key:"generateKeyPairExternalRepresentation",value:function(){return Promise.reject("Method not implemented.")}},{key:"importVolatileKeyPair",value:function(){throw new Error("Method not implemented.");}},{key:"importVolatileSymmetricKey",value:function(){throw new Error("Method not implemented.");}},{key:"loadPlugin",value:function(n){var t=window.__XMSDK_PLUGINS[n];return t?(this.log(com.ts.mobile.sdk.LogLevel.Debug,"plugins","Found defined plugin "+n),Promise.resolve(t)):(this.log(com.ts.mobile.sdk.LogLevel.Error,"plugins","Could not find defined plugin "+n),Promise.reject(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.AppImplementation,"Could not find defined plugin "+n)))}},{key:"dyadicRefreshToken",value:function(){throw new Error("Method not implemented.");}},{key:"dyadicEnroll",value:function(){return Promise.reject("Method not implemented.")}},{key:"dyadicSign",value:function(){return Promise.reject("Method not implemented.")}},{key:"dyadicDelete",value:function(){return Promise.reject("Method not implemented.")}}]),n}();t.XmHost=l},function(n,t){"use strict";function i(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return function(n,t,r){t&&i(n.prototype,t);r&&i(n,r)}(n,[{key:"log",value:function(n,t,i){console.log("".concat(n,": ").concat(t,": ").concat(i))}}]),n}();t.default=r},function(n,t){"use strict";function f(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function o(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function e(n,t,i){return t&&o(n.prototype,t),i&&o(n,i),n}function r(n,t,i){var u,e,o,f,h,r,c;if("undefined"!=typeof document){if(arguments.length>1){"number"==typeof(i=function(){for(var t,i,r,u,f=arguments.length,e=new Array(f),n=0;n<f;n++)e[n]=arguments[n];for(t=0,i={};t<arguments.length;t++){r=arguments[t];for(u in r)i[u]=r[u]}return i}({path:"/"},{},i)).expires&&(e=new Date,e.setMilliseconds(e.getMilliseconds()+864e5*i.expires),i.expires=e);i.expires=i.expires?i.expires.toUTCString():"";try{u=JSON.stringify(t);/^[\{\[]/.test(u)&&(t=u)}catch(n){}t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);o="";for(f in i)i[f]&&(o+="; "+f,!0!==i[f]&&(o+="="+i[f]));return document.cookie=n+"="+t+o}n||(u={});for(var l=document.cookie?document.cookie.split("; "):[],a=/(%[0-9A-Z]{2})+/g,s=0;s<l.length;s++){h=l[s].split("=");r=h.slice(1).join("=");'"'===r.charAt(0)&&(r=r.slice(1,-1));try{if(c=h[0].replace(a,decodeURIComponent),r=r.replace(a,decodeURIComponent),n===c){u=r;break}n||(u[c]=r)}catch(n){}}return u}}Object.defineProperty(t,"__esModule",{value:!0});var u={set:r,get:function(n){return r.call(r,n)},remove:function(n){r(n,"",{expires:-1})}},s=function(){function n(t){f(this,n);this._persistent=t}return e(n,[{key:"setItem",value:function(n,t){var i=btoa(t);this._persistent?u.set(n,i,{expires:365}):u.set(n,i)}},{key:"removeItem",value:function(n){u.remove(n)}},{key:"getItem",value:function(n){var t=u.get(n);return t&&(t=atob(t)),t}}]),n}(),h=function(){function n(){f(this,n);this._memStore={}}return e(n,[{key:"setItem",value:function(n,t){this._memStore[n]=t}},{key:"removeItem",value:function(n){delete this._memStore[n]}},{key:"getItem",value:function(n){return this._memStore[n]}}]),n}(),i=function(){function n(t){if(f(this,n),"undefined"!=typeof window){this.currentStorage=window[t];try{this.currentStorage.setItem("ts:test","ok");this.currentStorage.removeItem("ts:test")}catch(n){console.warn("Failed to use browser storage. Resorting to cookies.");this.currentStorage=new s("localStorage"==t)}}else this.currentStorage=new h}return e(n,[{key:"setItem",value:function(n,t){this.currentStorage.setItem(n,t)}},{key:"getItem",value:function(n){return this.currentStorage.getItem(n)}},{key:"removeItem",value:function(n){this.currentStorage.removeItem(n)}}]),n}();i.localStorage=new i("localStorage");i.sessionStorage=new i("sessionStorage");t.default=i},function(n,t,i){"use strict";function r(n,t){if(!(t instanceof Promise)){var i=t;t=new Promise(function(n,t){try{n(i())}catch(n){t(n)}})}return t.then(function(t){var i={};return null!=t&&(i[n]=t),i},function(t){var i={};return i[n]={__err__:t},i})}var e=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}};Object.defineProperty(t,"__esModule",{value:!0});var s=e(i(12)),h=e(i(1)),o="ts.fp.binding_id",u={},c=[r("binding_id",function(){return window.localStorage?window.localStorage.getItem(o):null}),r("collector_version",function(){return"1.0.0"}),r("local_ip",s.default()),r("cpu_cores",function(){return navigator.hardwareConcurrency})],f=null;t.default={promiseCollection:function(n){var t=Object.keys(u).map(function(n){return r(n,u[n])}),i=c.concat(function(n){return f||(f=new Promise(function(t){var i={};n||(i.excludeCanvas=!0,i.excludeWebGL=!0);new h.default(i).get(function(n,i){for(var u={},r=0;r<i.length;r++)u[i[r].key]=i[r].value;t({fp2_hash:n,fp2_keys:u})})})),f}(n)).concat(t);return Promise.all(i).then(function(n){return function(n){var t={};return Object.assign.apply(null,[t].concat(n)),t}(n)})},evaluateDfpServerInstructions:function(n){if(n.setBindingId)try{window.localStorage.setItem(o,n.setBindingId)}catch(n){}},setUserCollectors:function(n){u=n}}},function(n,t){"use strict";function i(n){var u=setTimeout(function(){n(null)},300),r={},t=window,f=t.RTCPeerConnection||t.mozRTCPeerConnection||t.webkitRTCPeerConnection,i=(t.webkitRTCPeerConnection,new f({iceServers:[{urls:"stun:dummysrv.dummyserver.com.nowhere"}]},{optional:[{RtpDataChannels:!0}]}));i.onicecandidate=function(t){t.candidate&&function(t){var i=/([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(t)[1];void 0===r[i]&&(clearTimeout(u),n(i));r[i]=!0}(t.candidate.candidate)};i.createDataChannel("");i.createOffer(function(n){i.setLocalDescription(n,function(){},function(){})},function(){})}Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){return new Promise(function(n,t){i(function(i){i?n&&(n(i),n=null):t("Timeout")})})}},function(n,t,i){"use strict";var u=this&&this.__importStar||function(n){var t,i;if(n&&n.__esModule)return n;if(t={},null!=n)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t.default=n,t};Object.defineProperty(t,"__esModule",{value:!0});var e=u(i(1)),f=u(i(14)),r=void 0;t.TsCollectionResult=function(n){function u(n,t,r,u){i={enabled:n||!1,lat:t,lng:r,error:u}}var h=!0,i=void 0,s=function(){i=void 0},c=function(n,t){var r={},i;for(i in n=n||{},t=t||{},n)r[i]=n[i];for(i in t)r[i]=t[i];return r},l=function(n,i,u){if(r)t(n,u);else{var f={excludeUserAgent:!0,excludeScreenResolution:!0,excludeJsFonts:!0,excludeFlashFonts:!0,excludePlugins:!0,excludeColorDepth:!0};h||(f.excludeCanvas=!0,f.excludeWebGL=!0);new i.default(f).get(function(i,f){for(var o,s={},e=0,h=(f=f||[]).length;e<h;e++)o=f[e],s[o.key]=o.value;r={id:i,details:s};t(n,u)})}},a=function(r,f){var e,s,h;if((i=void 0,e=n.location,!e.allow)||o(navigator.geolocation)||"function"!=typeof navigator.geolocation.getCurrentPosition)return u(!1),void t(r,f);s=setTimeout(function(){h({code:3})},e.timeout);h=function(n){clearTimeout(s);u(!0,void 0,void 0,v(n.code));t(r,f)};navigator.geolocation.getCurrentPosition(function(n){clearTimeout(s);u(!0,n.coords.latitude,n.coords.longitude);t(r,f)},h,e)},o=function(n){return void 0===n||null===n},v=function(n){return 1===n?"permission_denied":2===n?"position_unavailable":3===n?"timeout":"unknown"},t=function(n,t){if(!o(r)&&!o(i)){var u={metadata:{timestamp:Date.now()},content:{device_details:y(r,t),location:i}};s();n(u)}},y=function(n,t){var i={device_id:n.id},u=n.details,r=(new t.UAParser).setUA(navigator.userAgent).getResult();return i.os_type=r.os.name,i.os_version=r.os.version,i.device_model=r.browser.name+" "+r.browser.version,i.device_platform=u.navigator_platform,i.tampered=p(u),i.timezone_offset=u.timezone_offset,i},p=function(n){return n&&(n.has_lied_browser||n.has_lied_language||n.has_lied_os||n.has_lied_resolution)};return(n=n||{}).location=c({allow:!1,timeout:4e3,maximumAge:18e4},n.location),s(),{get:function(n){l(n,e,f);a(n,f)}}}},function(n,t,i){var r;!function(u){"use strict";var f="model",s="name",o="type",e="vendor",h="version",l="mobile",c="tablet",y={extend:function(n,t){var r={},i;for(i in n)r[i]=t[i]&&t[i].length%2==0?t[i].concat(n[i]):n[i];return r},has:function(n,t){return"string"==typeof n&&-1!==t.toLowerCase().indexOf(n.toLowerCase())},lowerize:function(n){return n.toLowerCase()},major:function(n){if("string"==typeof n)return n.replace(/[^\d\.]/g,"").split(".")[0]},trim:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},v={rgx:function(n,t){for(var o,c,f,i,e,r,s,h,u=0;u<t.length&&!e;){for(s=t[u],h=t[u+1],o=c=0;o<s.length&&!e;)if(e=s[o++].exec(n))for(f=0;f<h.length;f++)r=e[++c],"object"==typeof(i=h[f])&&i.length>0?2==i.length?this[i[0]]="function"==typeof i[1]?i[1].call(this,r):i[1]:3==i.length?this[i[0]]="function"!=typeof i[1]||i[1].exec&&i[1].test?r?r.replace(i[1],i[2]):void 0:r?i[1].call(this,r,i[2]):void 0:4==i.length&&(this[i[0]]=r?i[3].call(this,r.replace(i[1],i[2])):void 0):this[i]=r||void 0;u+=2}},str:function(n,t){var i,r;for(i in t)if("object"==typeof t[i]&&t[i].length>0){for(r=0;r<t[i].length;r++)if(y.has(t[i][r],n))return"?"===i?void 0:i}else if(y.has(t[i],n))return"?"===i?void 0:i;return n}},p={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},k={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[s,h],[/(opios)[\/\s]+([\w\.]+)/i],[[s,"Opera Mini"],h],[/\s(opr)\/([\w\.]+)/i],[[s,"Opera"],h],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark)\/([\w\.-]+)/i],[s,h],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[s,"IE"],h],[/(edge|edgios|edgea)\/((\d+)?[\w\.]+)/i],[[s,"Edge"],h],[/(yabrowser)\/([\w\.]+)/i],[[s,"Yandex"],h],[/(puffin)\/([\w\.]+)/i],[[s,"Puffin"],h],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[s,"UCBrowser"],h],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],h],[/(micromessenger)\/([\w\.]+)/i],[[s,"WeChat"],h],[/(qqbrowserlite)\/([\w\.]+)/i],[s,h],[/(QQ)\/([\d\.]+)/i],[s,h],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[s,h],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[s,h],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[s,h],[/(MetaSr)[\/\s]?([\w\.]+)/i],[s],[/(LBBROWSER)/i],[s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[h,[s,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[h,[s,"Facebook"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[h,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,/(.+)/,"$1 WebView"],h],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[s,/(.+(?:g|us))(.+)/,"$1 $2"],h],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[h,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,h],[/(dolfin)\/([\w\.]+)/i],[[s,"Dolphin"],h],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[s,"Chrome"],h],[/(coast)\/([\w\.]+)/i],[[s,"Opera Coast"],h],[/fxios\/([\w\.-]+)/i],[h,[s,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[h,[s,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[h,s],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[s,"GSA"],h],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[h,v.str,p.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[s,h],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],h],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[s,h]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",y.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",y.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",y.lowerize]]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[f,e,[o,c]],[/applecoremedia\/[\w\.]+ \((ipad)/],[f,[e,"Apple"],[o,c]],[/(apple\s{0,1}tv)/i],[[f,"Apple TV"],[e,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[e,f,[o,c]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[f,[e,"Amazon"],[o,c]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[f,v.str,p.device.amazon.model],[e,"Amazon"],[o,l]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[f,e,[o,l]],[/\((ip[honed|\s\w*]+);/i],[f,[e,"Apple"],[o,l]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[e,f,[o,l]],[/\(bb10;\s(\w+)/i],[f,[e,"BlackBerry"],[o,l]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[f,[e,"Asus"],[o,c]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[e,"Sony"],[f,"Xperia Tablet"],[o,c]],[/android.+\s([c-g]\d{4}|so[-l]\w+)\sbuild\//i],[f,[e,"Sony"],[o,l]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[e,f,[o,"console"]],[/android.+;\s(shield)\sbuild/i],[f,[e,"Nvidia"],[o,"console"]],[/(playstation\s[34portablevi]+)/i],[f,[e,"Sony"],[o,"console"]],[/(sprint\s(\w+))/i],[[e,v.str,p.device.sprint.vendor],[f,v.str,p.device.sprint.model],[o,l]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[e,f,[o,c]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[e,[f,/_/g," "],[o,l]],[/(nexus\s9)/i],[f,[e,"HTC"],[o,c]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[f,[e,"Huawei"],[o,l]],[/(microsoft);\s(lumia[\s\w]+)/i],[e,f,[o,l]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[f,[e,"Microsoft"],[o,"console"]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[e,"Microsoft"],[o,l]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[f,[e,"Motorola"],[o,l]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[f,[e,"Motorola"],[o,c]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[e,y.trim],[f,y.trim],[o,"smarttv"]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[e,"Samsung"],[o,"smarttv"]],[/\(dtv[\);].+(aquos)/i],[f,[e,"Sharp"],[o,"smarttv"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[e,"Samsung"],f,[o,c]],[/smart-tv.+(samsung)/i],[e,[o,"smarttv"],f],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[e,"Samsung"],f,[o,l]],[/sie-(\w*)/i],[f,[e,"Siemens"],[o,l]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[e,"Nokia"],f,[o,l]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[f,[e,"Acer"],[o,c]],[/android.+([vl]k\-?\d{3})\s+build/i],[f,[e,"LG"],[o,c]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[e,"LG"],f,[o,c]],[/(lg) netcast\.tv/i],[e,f,[o,"smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[f,[e,"LG"],[o,l]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[f,[e,"Lenovo"],[o,c]],[/linux;.+((jolla));/i],[e,f,[o,l]],[/((pebble))app\/[\d\.]+\s/i],[e,f,[o,"wearable"]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[e,f,[o,l]],[/crkey/i],[[f,"Chromecast"],[e,"Google"]],[/android.+;\s(glass)\s\d/i],[f,[e,"Google"],[o,"wearable"]],[/android.+;\s(pixel c)\s/i],[f,[e,"Google"],[o,c]],[/android.+;\s(pixel xl|pixel)\s/i],[f,[e,"Google"],[o,l]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[f,/_/g," "],[e,"Xiaomi"],[o,l]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[f,/_/g," "],[e,"Xiaomi"],[o,c]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[f,[e,"Meizu"],[o,c]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[f,[e,"OnePlus"],[o,l]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[f,[e,"RCA"],[o,c]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[f,[e,"Dell"],[o,c]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[f,[e,"Verizon"],[o,c]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[e,"Barnes & Noble"],f,[o,c]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[f,[e,"NuVision"],[o,c]],[/android.+;\s(k88)\sbuild/i],[f,[e,"ZTE"],[o,c]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[f,[e,"Swiss"],[o,l]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[f,[e,"Swiss"],[o,c]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[f,[e,"Zeki"],[o,c]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[e,"Dragon Touch"],f,[o,c]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[f,[e,"Insignia"],[o,c]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[f,[e,"NextBook"],[o,c]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[e,"Voice"],f,[o,l]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[e,"LvTel"],f,[o,l]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[f,[e,"Envizen"],[o,c]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[e,f,[o,c]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[f,[e,"MachSpeed"],[o,c]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[e,f,[o,c]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[f,[e,"Rotor"],[o,c]],[/android.+(KS(.+))\s+build/i],[f,[e,"Amazon"],[o,c]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[e,f,[o,c]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[o,y.lowerize],e,f],[/(android[\w\.\s\-]{0,9});.+build/i],[f,[e,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[h,[s,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[s,h],[/rv\:([\w\.]{1,9}).+(gecko)/i],[h,s]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[s,h],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[s,[h,v.str,p.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[s,"Windows"],[h,v.str,p.os.windows.version]],[/\((bb)(10);/i],[[s,"BlackBerry"],h],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]*)/i,/linux;.+(sailfish);/i],[s,h],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[s,"Symbian"],h],[/\((series40);/i],[s],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[s,"Firefox OS"],h],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[s,h],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[s,"Chromium OS"],h],[/(sunos)\s?([\w\.\d]*)/i],[[s,"Solaris"],h],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[s,h],[/(haiku)\s(\w+)/i],[s,h],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[h,/_/g,"."],[s,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[s,"Mac OS"],[h,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]*)/i],[s,h]]},a=function(n,t){if("object"==typeof n&&(t=n,n=void 0),!(this instanceof a))return new a(n,t).getResult();var i=n||(u&&u.navigator&&u.navigator.userAgent?u.navigator.userAgent:""),r=t?y.extend(k,t):k;return this.getBrowser=function(){var n={name:void 0,version:void 0};return v.rgx.call(n,i,r.browser),n.major=y.major(n.version),n},this.getCPU=function(){var n={architecture:void 0};return v.rgx.call(n,i,r.cpu),n},this.getDevice=function(){var n={vendor:void 0,model:void 0,type:void 0};return v.rgx.call(n,i,r.device),n},this.getEngine=function(){var n={name:void 0,version:void 0};return v.rgx.call(n,i,r.engine),n},this.getOS=function(){var n={name:void 0,version:void 0};return v.rgx.call(n,i,r.os),n},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(n){return i=n,this},this},w,b;a.VERSION="0.7.18";a.BROWSER={NAME:s,MAJOR:"major",VERSION:h};a.CPU={ARCHITECTURE:"architecture"};a.DEVICE={MODEL:f,VENDOR:e,TYPE:o,CONSOLE:"console",MOBILE:l,SMARTTV:"smarttv",TABLET:c,WEARABLE:"wearable",EMBEDDED:"embedded"};a.ENGINE={NAME:s,VERSION:h};a.OS={NAME:s,VERSION:h};void 0!==t?(void 0!==n&&n.exports&&(t=n.exports=a),t.UAParser=a):i(15)?void 0===(r=function(){return a}.call(t,i,t,n))||(n.exports=r):u&&(u.UAParser=a);w=u&&(u.jQuery||u.Zepto);void 0!==w&&(b=new a,w.ua=b.getResult(),w.ua.get=function(){return b.getUA()},w.ua.set=function(n){var t,i;b.setUA(n);t=b.getResult();for(i in t)w.ua[i]=t[i]})}("object"==typeof window?window:this)},function(n){(function(t){n.exports=t}).call(this,{})},function(n,t){"use strict";function e(n,t){var i=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(i>>16)<<16|65535&i}function o(n,t,i,r,u,f){return e(function(n,t){return n<<t|n>>>32-t}(e(e(t,n),e(r,f)),u),i)}function i(n,t,i,r,u,f,e){return o(t&i|~t&r,n,t,u,f,e)}function r(n,t,i,r,u,f,e){return o(t&r|i&~r,n,t,u,f,e)}function u(n,t,i,r,u,f,e){return o(t^i^r,n,t,u,f,e)}function f(n,t,i,r,u,f,e){return o(i^(t|~r),n,t,u,f,e)}function s(n,t){var l,a,v,y,p;n[t>>5]|=128<<t%32;n[14+(t+64>>>9<<4)]=t;var s=1732584193,o=-271733879,h=-1732584194,c=271733878;for(l=0;l<n.length;l+=16)a=s,v=o,y=h,p=c,o=f(o=f(o=f(o=f(o=u(o=u(o=u(o=u(o=r(o=r(o=r(o=r(o=i(o=i(o=i(o=i(o,h=i(h,c=i(c,s=i(s,o,h,c,n[l],7,-680876936),o,h,n[l+1],12,-389564586),s,o,n[l+2],17,606105819),c,s,n[l+3],22,-1044525330),h=i(h,c=i(c,s=i(s,o,h,c,n[l+4],7,-176418897),o,h,n[l+5],12,1200080426),s,o,n[l+6],17,-1473231341),c,s,n[l+7],22,-45705983),h=i(h,c=i(c,s=i(s,o,h,c,n[l+8],7,1770035416),o,h,n[l+9],12,-1958414417),s,o,n[l+10],17,-42063),c,s,n[l+11],22,-1990404162),h=i(h,c=i(c,s=i(s,o,h,c,n[l+12],7,1804603682),o,h,n[l+13],12,-40341101),s,o,n[l+14],17,-1502002290),c,s,n[l+15],22,1236535329),h=r(h,c=r(c,s=r(s,o,h,c,n[l+1],5,-165796510),o,h,n[l+6],9,-1069501632),s,o,n[l+11],14,643717713),c,s,n[l],20,-373897302),h=r(h,c=r(c,s=r(s,o,h,c,n[l+5],5,-701558691),o,h,n[l+10],9,38016083),s,o,n[l+15],14,-660478335),c,s,n[l+4],20,-405537848),h=r(h,c=r(c,s=r(s,o,h,c,n[l+9],5,568446438),o,h,n[l+14],9,-1019803690),s,o,n[l+3],14,-187363961),c,s,n[l+8],20,1163531501),h=r(h,c=r(c,s=r(s,o,h,c,n[l+13],5,-1444681467),o,h,n[l+2],9,-51403784),s,o,n[l+7],14,1735328473),c,s,n[l+12],20,-1926607734),h=u(h,c=u(c,s=u(s,o,h,c,n[l+5],4,-378558),o,h,n[l+8],11,-2022574463),s,o,n[l+11],16,1839030562),c,s,n[l+14],23,-35309556),h=u(h,c=u(c,s=u(s,o,h,c,n[l+1],4,-1530992060),o,h,n[l+4],11,1272893353),s,o,n[l+7],16,-155497632),c,s,n[l+10],23,-1094730640),h=u(h,c=u(c,s=u(s,o,h,c,n[l+13],4,681279174),o,h,n[l],11,-358537222),s,o,n[l+3],16,-722521979),c,s,n[l+6],23,76029189),h=u(h,c=u(c,s=u(s,o,h,c,n[l+9],4,-640364487),o,h,n[l+12],11,-421815835),s,o,n[l+15],16,530742520),c,s,n[l+2],23,-995338651),h=f(h,c=f(c,s=f(s,o,h,c,n[l],6,-198630844),o,h,n[l+7],10,1126891415),s,o,n[l+14],15,-1416354905),c,s,n[l+5],21,-57434055),h=f(h,c=f(c,s=f(s,o,h,c,n[l+12],6,1700485571),o,h,n[l+3],10,-1894986606),s,o,n[l+10],15,-1051523),c,s,n[l+1],21,-2054922799),h=f(h,c=f(c,s=f(s,o,h,c,n[l+8],6,1873313359),o,h,n[l+15],10,-30611744),s,o,n[l+6],15,-1560198380),c,s,n[l+13],21,1309151649),h=f(h,c=f(c,s=f(s,o,h,c,n[l+4],6,-145523070),o,h,n[l+11],10,-1120210379),s,o,n[l+2],15,718787259),c,s,n[l+9],21,-343485551),s=e(s,a),o=e(o,v),h=e(h,y),c=e(c,p);return[s,o,h,c]}function l(n){for(var i="",r=32*n.length,t=0;t<r;t+=8)i+=String.fromCharCode(n[t>>5]>>>t%32&255);return i}function h(n){var t,i=[],r;for(i[(n.length>>2)-1]=void 0,t=0;t<i.length;t+=1)i[t]=0;for(r=8*n.length,t=0;t<r;t+=8)i[t>>5]|=(255&n.charCodeAt(t/8))<<t%32;return i}function a(n){for(var i,r="",t=0;t<n.length;t+=1)i=n.charCodeAt(t),r+="0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i);return r}function c(n){return unescape(encodeURIComponent(n))}function v(n){return function(n){return l(s(h(n),8*n.length))}(c(n))}function y(n,t){return function(n,t){var i,e,r=h(n),u=[],f=[];for(u[15]=f[15]=void 0,r.length>16&&(r=s(r,8*n.length)),i=0;i<16;i+=1)u[i]=909522486^r[i],f[i]=1549556828^r[i];return e=s(u.concat(h(t)),512+8*t.length),l(s(f.concat(e),640))}(c(n),c(t))}Object.defineProperty(t,"__esModule",{value:!0});t.md5=function(n,t,i){return t?i?y(t,n):function(n,t){return a(y(n,t))}(t,n):i?v(n):function(n){return a(v(n))}(n)}},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(n,t,i,r,u){var f=$('<div class="xmuiCore xmuiForm xmuiRejectionForm">            <div class="xmuiPageHeader">                <div>                    <span class="xmuiRejectionTitle"<\/span>                <\/div>            <\/div>            <div class="xmuiFullHeightContentBelowPrompt">                <div class="xmuiRejectionText"/>                <div class="xmuiRejectionData"/>                <div>                    <button class="xmuiRejectionButton" type="button"/>                <\/div>            <\/div>        <\/div>');return u.appendElement(f,r),u.setAriaBusy(r),new Promise(function(e){f.find(".xmuiRejectionTitle").text(n);f.find(".xmuiRejectionText").text(t);var o=f.find(".xmuiRejectionButton");o.text(i);o.click(function(){f.fadeOut(function(){u.clearContainer(r);e(com.ts.mobile.sdk.ConfirmationInput.create(-1))})});u.unsetAriaBusy(r)})}},function(n,t){"use strict";function i(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(t,i,r){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this.userId=t;this.actionContext=i;this.common=r}return function(n,t,r){t&&i(n.prototype,t);r&&i(n,r)}(n,[{key:"startSession",value:function(n,t){this.clientContext=n;this.actionContext=t;console.log("Starting registration promotion action session")}},{key:"endSession",value:function(){console.log("Ending registration promotion action session")}},{key:"promptIntroduction",value:function(n,t,i,r){var f=this,u=$('<div class="xmuiCore xmuiForm xmuiRegistationPromotionForm">                <div class="xmuiFullHeightContentBelowPrompt">                    <div class="xmuiPageHeader">                        <div>                            <span><\/span>                        <\/div>                    <\/div>                    <div class="xmuiRegistationPromotionText"/><br/>                    <div>                        <button class="xmuiRegistationPromotionContinueButton" type="button"/>                        <button class="xmuiRegistationPromotionSkipButton" type="button"/>                        <button class="xmuiRegistationPromotionAbortButton" type="button"/>                    <\/div>                <\/div>            <\/div>');return this.common.setAriaBusy(this.clientContext),u.find("span").text(n),u.find(".xmuiRegistationPromotionText").text(t),this.common.appendElement(u,this.clientContext),new Promise(function(n){var o=u.find(".xmuiRegistationPromotionContinueButton"),t,e;o.text(i);o.click(function(){u.fadeOut(function(){f.common.clearContainer(f.clientContext);n(com.ts.mobile.sdk.PromotionInput.createControlResponse(com.ts.mobile.sdk.PromotionControlRequest.Continue))})});t=u.find(".xmuiRegistationPromotionAbortButton");t.text("Abort");t.click(function(){u.fadeOut(function(){f.common.clearContainer(f.clientContext);n(com.ts.mobile.sdk.PromotionInput.createControlResponse(com.ts.mobile.sdk.PromotionControlRequest.Abort))})});e=u.find(".xmuiRegistationPromotionSkipButton");e.text(r);e.click(function(){u.fadeOut(function(){f.common.clearContainer(f.clientContext);n(com.ts.mobile.sdk.PromotionInput.createControlResponse(com.ts.mobile.sdk.PromotionControlRequest.Skip))})});f.common.unsetAriaBusy(f.clientContext)})}},{key:"setPromotedAuthenticators",value:function(n){return this.common.registrationPromotionMethodSelectionPromise(n,this.clientContext)}}]),n}();t.RegistrationPromotionSession=r},function(n,t,i){"use strict";function r(n){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function u(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function o(n,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(n):t}function f(n){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function e(n,t){return(e=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}Object.defineProperty(t,"__esModule",{value:!0});var s=i(0),h=function(){function n(t,i,r){var u;return function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n),(u=o(this,f(n).call(this,t,i,r))).supportsInlineError=!0,u}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&e(n,t)}(n,s.BaseAuthenticatorSession),function(n,t,i){t&&u(n.prototype,t);i&&u(n,i)}(n,[{key:"newForm",value:function(){return $('<div class="xmuiCore xmuiForm xmuiPasswordForm">                <div class="xmuiPrompt"/>                <div class="xmuiFullHeightContentBelowPrompt">                    <form onsubmit="return false">                        <div>                            <input type="password" data-xmui-customstringtext-placeholder="password.inputPlaceholder"/>                        <\/div>                        <div>                            <button type="submit"/>                        <\/div>                    <\/form>                <\/div>            <\/div>')}},{key:"promiseAuthInput",value:function(){var n=this,t=this.newForm(),i=t.find("input"),u=t.find("button"),r=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(f){n.authError?(r.text(n.authError.getMessage()),r.addClass("xmuiPromptError")):r.text(n.common.resolveString("password.prompt"));i.val("");i.attr("role","textbox").attr("aria-label",n.common.resolveString("aria.enterPassword"));i.focus();u.text(n.common.resolveString("password.loginButton"));u.click(function(){var n=com.ts.mobile.sdk.PasswordInput.create(i.val().toString());t.fadeOut(function(){f(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(n))})});n.common.prependPageHeader(t,n.title,f)})}},{key:"promiseRegInput",value:function(){var n=this,i=this.newForm(),t=i.find("input"),u=i.find("button"),r=i.find(".xmuiPrompt");return this.common.appendElement(i,this.clientContext),new Promise(function(f){var e,o=function(){if(e===t.val()){var u=com.ts.mobile.sdk.PasswordInput.create(t.val().toString());i.fadeOut(function(){f(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(u))})}else r.text(n.common.resolveString("password.registration.noMatch")),r.addClass("xmuiPromptError"),t.val(""),t.attr("role","alert").attr("aria-label",n.common.resolveString("aria.passwordsDontMatch"))};n.authError?(r.text(n.authError.getMessage()),r.addClass("xmuiPromptError")):r.text(n.common.resolveString("password.registration.prompt"));t.val("");t.attr("role","textbox").attr("aria-label",n.common.resolveString("aria.enterPassword"));t.focus();u.text(n.common.resolveString("password.registration.continueButton"));u.click(function(){e=t.val().toString();r.text(n.common.resolveString("password.registration.promptAgain"));i.removeClass("xmuiPromptError");t.val("");t.attr("role","alert").attr("aria-label",n.common.resolveString("aria.enterPasswordAgain"));u.text(n.common.resolveString("password.registration.registerButton"));n.common.reBind(u,o)});n.common.prependPageHeader(i,n.title,f)})}}]),n}();t.PasswordAuthenticatorSession=h},function(n,t,i){"use strict";function r(n){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function u(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function o(n,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(n):t}function f(n){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function e(n,t){return(e=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}Object.defineProperty(t,"__esModule",{value:!0});var s=i(0),h=function(){function n(t,i,r,u){var e;return function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n),(e=o(this,f(n).call(this,t,i,u))).supportsInlineError=!0,e.pinLength=r,e}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&e(n,t)}(n,s.BaseAuthenticatorSession),function(n,t,i){t&&u(n.prototype,t);i&&u(n,i)}(n,[{key:"newForm",value:function(){return $('<div class="xmuiCore xmuiForm xmuiPinForm">                <div class="xmuiPrompt"/>                <div class="xmuiFullHeightContentBelowPrompt">                    <form onsubmit="return false">                        <input type="number" class="xmuiPinFormElement" data-xmui-customstringtext-placeholder="pin.inputPlaceholder"/>                        <div style="align-items: center;">                            <button class="xmuiLoginButton" type="submit"/>                        <\/div>                    <\/form>                <\/div>            <\/div>')}},{key:"promiseAuthInput",value:function(){var n=this,t=this.newForm(),r=t.find("input"),u=t.find("button"),i=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(f){n.authError?(i.text(n.authError.getMessage()),i.addClass("xmuiPromptError")):i.text(n.common.resolveString("pin.prompt"));r.val("");r.attr("role","textbox").attr("aria-label",n.common.resolveString("aria.enterPin"));u.text(n.common.resolveString("pin.loginButton"));u.click(function(){var u=n.validateNumericOnly(r,i),e;u&&(e=com.ts.mobile.sdk.PinInput.create(u),t.fadeOut(function(){f(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(e))}))});n.common.prependPageHeader(t,n.title,f)})}},{key:"promiseRegInput",value:function(){var n=this,r=this.newForm(),t=r.find("input"),u=r.find("button"),i=r.find(".xmuiPrompt");return this.common.appendElement(r,this.clientContext),new Promise(function(f){var e,o=function(){if(e===t.val()){i.removeClass("xmuiPromptError");var u=com.ts.mobile.sdk.PinInput.create(t.val().toString());r.fadeOut(function(){f(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(u))})}else i.text(n.common.resolveString("pin.registration.noMatch")),i.addClass("xmuiPromptError"),t.val(""),t.attr("role","alert").attr("aria-label",n.common.resolveString("aria.pinsDontMatch"))};n.authError?(i.text(n.authError.getMessage()),i.addClass("xmuiPromptError")):i.text(n.common.resolveString("pin.registration.prompt"));t.val("");t.attr("role","textbox").attr("aria-label",n.common.resolveString("aria.enterPin"));u.text(n.common.resolveString("pin.registration.continueButton"));u.click(function(){var r=n.validateNumericOnly(t,i);r&&(r.length==n.pinLength?(e=r,i.text(n.common.resolveString("pin.registration.promptAgain")),i.removeClass("xmuiPromptError"),t.val(""),t.attr("role","status").attr("aria-label",n.common.resolveString("aria.enterPinAgain")),u.text(n.common.resolveString("pin.registration.registerButton")),n.common.reBind(u,o)):(i.text(n.common.resolveString("pin.registration.badLength").replace("$length",n.pinLength.toString())),i.addClass("xmuiPromptError"),t.val(""),t.attr("role","alert").attr("aria-label",n.common.resolveString("aria.badPinLength").replace("$length",n.pinLength.toString()))))});n.common.prependPageHeader(r,n.title,f)})}},{key:"validateNumericOnly",value:function(n,t){for(var i=n.val().toString(),r=i.length;r--;)if(-1==="0123456789".indexOf(i.charAt(r)))return n.empty(),t.text(this.common.resolveString("pin.registration.digitsOnly")),t.addClass("xmuiPromptError"),null;return i}}]),n}();t.PinAuthenticatorSession=h},function(n,t,i){"use strict";function r(n){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function u(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function s(n,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(n):t}function f(n){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function e(n,t){return(e=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}Object.defineProperty(t,"__esModule",{value:!0});var h=i(0),o=i(22),c=function(){function n(t,i,r,u,e){var o;return function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n),(o=s(this,f(n).call(this,t,i,e))).supportsInlineError=!0,o.gridWidth=r,o.gridHeight=u,o}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&e(n,t)}(n,h.BaseAuthenticatorSession),function(n,t,i){t&&u(n.prototype,t);i&&u(n,i)}(n,[{key:"createPatternInputString",value:function(n){var t=this;return n.map(function(n){return"r:"+Math.floor((n-1)/t.gridWidth)+",c:"+(n-1)%t.gridWidth}).join("")}},{key:"promiseAuthInput",value:function(){var n=this,t=$('<div class="xmuiCore xmuiForm xmuiPatternForm">                <div class="xmuiPrompt"/>                <div class="xmuiFullHeightContentBelowPrompt">                    <div class="xmuiPatternControl xmuiAuthPatternControl"/>                <\/div>            <\/div>'),i=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(r){n.authError?(i.text(n.authError.getMessage()),i.addClass("xmuiPromptError")):i.text(n.common.resolveString("pattern.prompt"));new o.PatternLock(".xmuiAuthPatternControl",{matrix:[n.gridHeight,n.gridWidth],onDraw:function(i){var u=JSON.parse("["+i+"]"),f=com.ts.mobile.sdk.PatternInput.create(n.createPatternInputString(u));t.fadeOut(function(){r(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(f))})}});n.common.prependPageHeader(t,n.title,r)})}},{key:"promiseRegInput",value:function(){var n=this,i=$('<div class="xmuiCore xmuiForm xmuiPatternForm">                <div class="xmuiPrompt"/>                <div class="xmuiFullHeightContentBelowPrompt">                    <div class="xmuiPatternControl xmuiRegPatternControl"/>                    <div>                        <button class="xmuiPatternRegRestartButton" data-xmui-customstringtext="pattern.registerRestartButton"><\/button>                        <button class="xmuiPatternRegContinueButton" data-xmui-customstringtext="pattern.registerContinueButton"><\/button>                    <\/div>                <\/div>            <\/div>'),t=i.find(".xmuiPrompt"),u=i.find(".xmuiPatternRegRestartButton"),r=i.find(".xmuiPatternRegContinueButton");return this.common.appendElement(i,this.clientContext),new Promise(function(f){var l=function(){s===n.createPatternInputString(e)?i.fadeOut(function(){f(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(com.ts.mobile.sdk.PatternInput.create(s)))}):(h.reset(),r.attr("disabled","true"),t.addClass("xmuiPromptError"),t.text(n.common.resolveString("pattern.registerNoMatchErrorPrompt")))},c=function(){h.reset();r.attr("disabled","true");t.removeClass("xmuiPromptError");t.text(n.common.resolveString("pattern.registerDrawAgainPrompt"));c=l;s=n.createPatternInputString(e)},s=null,e=null,h=new o.PatternLock(".xmuiRegPatternControl",{matrix:[n.gridHeight,n.gridWidth],onDraw:function(n){e=JSON.parse("["+n+"]");r.removeAttr("disabled")}});n.authError?(t.text(n.authError.getMessage()),t.addClass("xmuiPromptError")):t.text(n.common.resolveString("pattern.registerDrawPrompt"));r.attr("disabled","true");r.click(function(){e.length<4?(t.addClass("xmuiPromptError"),t.text(n.common.resolveString("pattern.registerTooShortErrorPrompt").replace("$length",4..toString())),h.reset()):c()});u.click(function(){t.removeClass("xmuiPromptError");var n=com.ts.mobile.sdk.ControlRequest.create(com.ts.mobile.sdk.ControlRequestType.RetryAuthenticator);f(com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(n))});n.common.prependPageHeader(i,n.title,f)})}}]),n}();t.PatternAuthenticatorSession=c},function(n,t){"use strict";function e(n){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function o(n){for(var o=n.holder,u=n.option,r=u.matrix,i=u.margin,t=u.radius,f=['<ul class="patt-wrap" style="padding:'+i+'px">'],e=0,s=r[0]*r[1];e<s;e++)f.push('<li class="patt-circ" style="margin:'+i+"px; width : "+2*t+"px; height : "+2*t+"px; -webkit-border-radius: "+t+"px; -moz-border-radius: "+t+"px; border-radius: "+t+'px; "><div class="patt-dots"><\/div><\/li>');f.push("<\/ul>");o.html(f.join("")).css({width:r[1]*(2*t+2*i)+2*i+"px",height:r[0]*(2*t+2*i)+2*i+"px"});n.pattCircle=n.holder.find(".patt-circ")}function s(n,t,i,r){var u=t-n,f=r-i;return{length:Math.ceil(Math.sqrt(u*u+f*f)),angle:Math.round(180*Math.atan2(f,u)/Math.PI)}}function f(){}function u(n,t){var v=this,p=v.token=Math.random(),h=i[p]=new f,s=h.holder=$(n),y,a,c;0!==s.length&&(h.object=v,y={onDraw:r},a=(t=t||{}).matrix,a&&a[0]*a[1]>9&&(y.delimiter=","),t=h.option=$.extend({},u.defaults,y,t),o(h),s.addClass("patt-holder"),"static"==s.css("position")&&s.css("position","relative"),(s.bind||s.on).call(s,"mousedown touchstart",function(n){l.call(this,n,v)}),c=t.mapper,h.mapperFunc="object"==e(c)?function(n){return c[n]}:"function"==typeof c?c:r,h.option.mapper=null)}Object.defineProperty(t,"__esModule",{value:!0});var c=window.document,r=function(){},i={};var l=function(n,t){var r,f;if(n.preventDefault(),r=i[t.token],!r.disabled){r.option.patternVisible||r.holder.addClass("patt-hidden");var e="touchstart"==n.type?"touchmove":"mousemove",o="touchstart"==n.type?"touchend":"mouseup",u=$(this);(u.on||u.bind).call(u,e+".pattern-move",function(n){h.call(this,n,t)});$(c).one(o,function(){a.call(this,n,t)});f=r.holder.find(".patt-wrap")[0].getBoundingClientRect();r.wrapTop=f.top;r.wrapLeft=f.left;t.reset()}},h=function(n,t){var w,d,b,v;n.preventDefault();var g=n.clientX||n.originalEvent.touches[0].clientX,nt=n.clientY||n.originalEvent.touches[0].clientY,r=i[t.token],y=r.option,k=r.pattCircle,h=r.patternAry,u=r.getIdxFromPoint(g,nt),l=u.idx,p=r.mapperFunc(l)||l;if(h.length>0&&(w=s(r.lineX1,u.x,r.lineY1,u.y),r.line.css({width:w.length+10+"px",transform:"rotate("+w.angle+"deg)"})),l&&(y.allowRepeat&&h[h.length-1]!==p||-1===h.indexOf(p))){if(d=$(k[l-1]),r.lastPosObj)for(var a=r.lastPosObj,f=a.i,e=a.j,tt=u.i-a.i>0?1:-1,it=u.j-a.j>0?1:-1,c=Math.abs(u.i-f),o=Math.abs(u.j-e);0===c&&o>1||0===o&&c>1||o==c&&o>1;)f=c?f+tt:f,e=o?e+it:e,c=Math.abs(u.i-f),o=Math.abs(u.j-e),b=(e-1)*y.matrix[1]+f,v=r.mapperFunc(b)||b,(y.allowRepeat||-1==h.indexOf(v))&&(r.addDirectionClass({i:f,j:e}),r.markPoint($(k[v-1]),v),r.addLine({i:f,j:e}));r.lastPosObj&&r.addDirectionClass(u);r.markPoint(d,p);r.addLine(u);r.lastPosObj=u}},a=function(n,t){n.preventDefault();var r=i[t.token],e=r.option,u=r.patternAry.join(e.delimiter),f=r.holder;(f.off||f.unbind).call(f,".pattern-move").removeClass("patt-hidden");u&&(e.onDraw(u),r.line.remove(),r.rightPattern&&(u==r.rightPattern?r.onSuccess():(r.onError(),t.error())))};f.prototype={constructor:f,getIdxFromPoint:function(n,t){var r=this.option,u=r.matrix,f=n-this.wrapLeft,e=t-this.wrapTop,c=null,o=r.margin,i=2*r.radius+2*o,s=Math.ceil(f/i),h=Math.ceil(e/i),l=f%i,a=e%i;return s<=u[1]&&h<=u[0]&&l>2*o&&a>2*o&&(c=(h-1)*u[1]+s),{idx:c,i:s,j:h,x:f,y:e}},markPoint:function(n,t){n.addClass("hovered");this.patternAry.push(t);this.lastElm=n},addLine:function(n){var c=this.patternAry,r=this.option,h=r.lineOnMove,t=r.margin,i=r.radius,u=(n.i-1)*(2*t+2*i)+2*t+i,f=(n.j-1)*(2*t+2*i)+2*t+i,e,o;c.length>1&&(e=s(this.lineX1,u,this.lineY1,f),this.line.css({width:e.length+"px",transform:"rotate("+e.angle+"deg)"}),h||this.line.show());o=$('<div class="patt-lines" style="top:'+(f-2)+"px; left:"+(u-2)+'px"><\/div>');this.line=o;this.lineX1=u;this.lineY1=f;this.holder.append(o);h||this.line.hide()},addDirectionClass:function(n){var r=this.lastElm,u=this.line,i=this.lastPosObj,t=[];n.j-i.j>0?t.push("s"):n.j-i.j<0&&t.push("n");n.i-i.i>0?t.push("e"):n.i-i.i<0&&t.push("w");(t=t.join("-"))&&r.add(u).addClass(t+" dir")}};t.PatternLock=u;u.prototype={constructor:u,option:function(n,t){var r=i[this.token],u=r.option;if(void 0===t)return u[n];u[n]=t;"margin"!=n&&"matrix"!=n&&"radius"!=n||o(r)},getPattern:function(){var n=i[this.token];return(n.patternAry||[]).join(n.option.delimiter)},setPattern:function(n){var o=i[this.token],t=o.option,s=t.matrix,u=t.margin,f=t.radius,e;if(t.enableSetPattern)for("string"==typeof n&&(n=n.split(t.delimiter)),this.reset(),o.wrapLeft=0,o.wrapTop=0,e=0;e<n.length;e++){var c=n[e]-1,l=c%s[1]*(2*u+2*f)+2*u+f,a=Math.floor(c/s[1])*(2*u+2*f)+2*u+f;h.call(null,{clientX:l,clientY:a,preventDefault:r},this)}},enable:function(){i[this.token].disabled=!1},disable:function(){i[this.token].disabled=!0},reset:function(){var n=i[this.token];n.pattCircle.removeClass("hovered dir s n w e s-w s-e n-w n-e");n.holder.find(".patt-lines").remove();n.patternAry=[];n.lastPosObj=null;n.holder.removeClass("patt-error")},error:function(){i[this.token].holder.addClass("patt-error")},checkForPattern:function(n,t,u){var f=i[this.token];f.rightPattern=n;f.onSuccess=t||r;f.onError=u||r}};u.defaults={matrix:[3,3],margin:20,radius:25,patternVisible:!0,lineOnMove:!0,delimiter:"",enableSetPattern:!1,allowRepeat:!1}},function(n,t,i){"use strict";function u(n){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function f(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function c(n,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(n):t}function e(n){return(e=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function o(n,t){return(o=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}var r,s,h;Object.defineProperty(t,"__esModule",{value:!0});s=i(0);!function(n){n[n.TargetSelection=0]="TargetSelection";n[n.Input=1]="Input"}(r||(r={}));h=function(){function n(t,i,u,f,o){var s;return function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n),(s=c(this,e(n).call(this,t,i,o))).supportsInlineError=!0,s.possibleTargets=u,s.autoExecedTarget=f,s.state=f?r.Input:r.TargetSelection,s}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&o(n,t)}(n,s.BaseAuthenticatorSession),function(n,t,i){t&&f(n.prototype,t);i&&f(n,i)}(n,[{key:"setAvailableTargets",value:function(n){this.possibleTargets=n}},{key:"setGeneratedOtp",value:function(n,t){this.generatedFormat=n;this.generatedForTarget=t;t||(this.state=r.TargetSelection)}},{key:"promiseOtpInput",value:function(){var t=this,n=$('<div class="xmuiCore xmuiForm xmuiOtpForm">                <div class="xmuiPrompt"/>                <div class="xmuiFullHeightContentBelowPrompt">                    <form onsubmit="return false">                        <input data-xmui-customstringtext-placeholder="otp.inputPlaceholder"/>                        <div style="align-items: center;">                            <button class="xmuiLoginButton" type="submit" data-xmui-customstringtext="otp.loginButton"/><br>                            <button class="xmuiResendButton" type="button" data-xmui-customstringtext="otp.resendButton"/>                        <\/div>                    <\/form>                <\/div>            <\/div>'),r=n.find("input"),u=n.find(".xmuiLoginButton"),f=n.find(".xmuiResendButton"),i=n.find(".xmuiPrompt");return this.common.appendElement(n,this.clientContext),new Promise(function(e){t.authError?(i.text(t.authError.getMessage()),i.addClass("xmuiPromptError")):i.text(t.common.resolveString("otp.prompt"));r.val("");u.click(function(){n.fadeOut(function(){var n=com.ts.mobile.sdk.OtpInputOtpSubmission.createOtpSubmission(r.val().toString()),t=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(n);e(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(t))})});f.click(function(){n.fadeOut(function(){t.authError=null;var n=com.ts.mobile.sdk.OtpInputRequestResend.createOtpResendRequest(),i=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(n);e(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(i))})});t.common.prependPageHeader(n,t.title,e)})}},{key:"promiseTargetSelectionInput",value:function(){var n=this,t=$('<div class="xmuiCore xmuiForm xmuiOtpTargetSelectionForm"><div class="xmuiOtpTargetSelectionList"><h1 data-xmui-customstringtext="otpTargetSelection.selectTarget"/><\/div><\/div>'),i=t.find(".xmuiOtpTargetSelectionList");return this.common.appendElement(t,this.clientContext),new Promise(function(u){$.each(n.possibleTargets,function(f,e){var o=com.ts.mobile.sdk.OtpChannel[e.getChannel()],s=$('<div class="xmuiMenuItem xmuiOtpTargetSelectionItem">').text(n.common.resolveString("otpMethodChannel.".concat(o)).replace("$target",e.getDescription())).click(function(){t.fadeOut(function(){n.authError=null;n.state=r.Input;var t=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetSelectionRequest(e);u(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(t))})});i.append(s)});n.common.prependPageHeader(t,n.title,u)})}},{key:"promiseAuthInput",value:function(){switch(this.state){case r.TargetSelection:return this.promiseTargetSelectionInput();case r.Input:return this.promiseOtpInput()}}},{key:"promiseRegInput",value:function(){return Promise.reject("Otp registration unsupported")}}]),n}();t.OtpAuthenticatorSession=h},function(n,t,i){"use strict";function f(n){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function r(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function e(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function o(n,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(n):t}function u(n){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function s(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&h(n,t)}function h(n,t){return(h=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}var c,l;Object.defineProperty(t,"__esModule",{value:!0});var a=i(0),v=i(25),y=function(){function n(t,i,f){var e;return r(this,n),(e=o(this,u(n).call(this,t,i,f))).supportsInlineError=!0,e}return s(n,a.BaseAuthenticatorSession),function(n,t,i){t&&e(n.prototype,t);i&&e(n,i)}(n,[{key:"newForm",value:function(){return $('<div class="xmuiCore xmuiForm xmuiVoiceForm"><div class="xmuiPrompt"/><div class="xmuiFullHeightContentBelowPrompt"><div class="xmuiVoicePassphrase"/><div class="xmuiAudioAnalyzer" hidden style="display:none"><canvas width="120" height="120"/><\/div><div class="xmuiAudioControls"><button type="button" data-xmui-customstringtext="voice.startButton"/><\/div><\/div><\/div>')}},{key:"promiseAuthInput",value:function(){var n=this,t=this.newForm(),e=t.find(".xmuiVoicePassphrase"),f=t.find("canvas"),r=t.find(".xmuiAudioControls button"),o=t.find(".xmuiAudioAnalyzer"),u=t.find(".xmuiPrompt"),i=null;return r.click(function(){r.hide();o.show();i.record()}),f.click(function(){i.stop()}),this.common.appendElement(t,this.clientContext),new Promise(function(o){n.authError?(u.text(n.authError.getMessage()),u.addClass("xmuiPromptError")):u.text(n.common.resolveString("voice.prompt"));e.text(n.currentStep.stepDescription.getPassphraseText());var s={vizCanvas:f.get(0)};i||(i=new v.voiceRecorder.Recorder(s));i.setOnEndRecording(function(t){n.common.showProgressForm(n.clientContext);var i=new l({sample:function(n){for(var i="",r=new Uint8Array(n),u=r.byteLength,t=0;t<u;t++)i+=String.fromCharCode(r[t]);return window.btoa(i)}(t.getPcm16().buffer),passphrase_text:n.currentStep.stepDescription.getPassphraseText()});o(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(i))});r.show();r.attr("role","Button").attr("aria-label",n.common.resolveString("aria.voiceRecordButton"));t.find(".xmuiAudioAnalyzer").hide();n.common.prependPageHeader(t,n.title,o);n.common.hideProgressForm(n.clientContext)})}},{key:"promiseRegInput",value:function(){return Promise.reject("Voice registration unsupported")}},{key:"setInputStep",value:function(n,t,i){this.currentStep=new c(n,t,i)}}]),n}();t.VoiceAuthenticatorSession=y;c=function n(t,i,u){r(this,n);this.stepNumber=t;this.maxStepNumber=i;this.stepDescription=u};l=function(){function n(t){var i;return r(this,n),(i=o(this,u(n).call(this))).setAcquisitionResponse(t),i}return s(n,com.ts.mobile.sdk.AudioInputResponse),n}()},function(n,t){"use strict";var i;void 0===(i=function(){return{Recorder:function(n){function v(){if(o){var n=o.width,t=o.height,i=o.getContext("2d");b(i,n,t)}r&&w(v)}var e,y=window.AudioContext||window.webkitAudioContext,p=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia,w=(navigator.cancelAnimationFrame||navigator.webkitCancelAnimationFrame||navigator.mozCancelAnimationFrame,window.requestAnimationFrame||navigator.webkitRequestAnimationFrame||navigator.mozRequestAnimationFrame),i=n||{},c=i.bufferLen||4096,r=!1,t=[],l=[],s=0,a=function(){},o=i.vizCanvas,b=function(n,t,r){var u=new Uint8Array(f.analyserNode.fftSize),e;f.analyserNode.getByteFrequencyData(u);e=u[0];n.clearRect(0,0,t,r);n.beginPath();n.arc(t/2,r/2,e/255*t/2*.8,0,2*Math.PI,!1);n.fillStyle=i.vizPrimaryColor||"#F6D565";n.fill()},u=i.sampleRate||8e3,f,h;this.audioContext=new y;this.jsAudioNode=null;e=this.audioContext.sampleRate;this.jsAudioNode=this.audioContext.createScriptProcessor?this.audioContext.createScriptProcessor(c,2,2):this.audioContext.createJavaScriptNode(c,2,2);this.analyserNode=this.audioContext.createAnalyser();this.analyserNode.fftSize=1024;f=this;this.jsAudioNode.onaudioprocess=function(n){r&&(t.push(new Float32Array(n.inputBuffer.getChannelData(0))),l.push(new Float32Array(n.inputBuffer.getChannelData(1))),s+=n.inputBuffer.getChannelData(0).length)};h={audio:{mandatory:{googEchoCancellation:"false",googAutoGainControl:"false",googNoiseSuppression:"false",googHighpassFilter:"false"},optional:[]}};Object.assign(h,i.userMediaRequest||{});p.call(navigator,h,function(n){f.setSourceStream(n)},function(n){console.log(n);f.setError(n)});this.getPcm16=function(){for(var r,l=new ArrayBuffer(2*Math.ceil(s/e*u)),f=new DataView(l),o=0,n=0,i=0,h=Math.floor(e/u),a=e-u*h,c=0;i<t.length;)r=Math.max(-1,Math.min(1,t[i][n])),f.setInt16(o,r<0?32768*r:32767*r,!0),o+=2,n+=h,(c+=a)>=u&&(c-=u,n++),n>=t[i].length&&(n-=t[i].length,i+=1);return f};this.setOnEndRecording=function(n){a=n};this.record=function(){t=[];l=[];s=0;r=!0;v()};this.stop=function(){r=!1;a(this)};this.isRecording=function(){return r};this.setSourceStream=function(n){var t=this.audioContext.createMediaStreamSource(n);t.connect(this.jsAudioNode);t.connect(this.analyserNode);this.jsAudioNode.connect(this.audioContext.destination)};this.setError=function(n){this.lastError=n};this.isError=function(){return this.lastError};this.getError=this.isError}}}.apply(t,[]))||(n.exports=i)},function(n,t,i){"use strict";function f(n){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function e(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function s(n,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(n):t}function u(n,t,i){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(n,t,i){var f=function(n,t){for(;!Object.prototype.hasOwnProperty.call(n,t)&&null!==(n=r(n)););return n}(n,t),u;if(f)return u=Object.getOwnPropertyDescriptor(f,t),u.get?u.get.call(i):u.value})(n,t,i||n)}function r(n){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function o(n,t){return(o=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}Object.defineProperty(t,"__esModule",{value:!0});var h=i(0),c=function(){function n(t,i,u){var f;return function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n),(f=s(this,r(n).call(this,t,i,u))).supportsInlineError=!1,f}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&o(n,t)}(n,h.BaseAuthenticatorSession),function(n,t,i){t&&e(n.prototype,t);i&&e(n,i)}(n,[{key:"newForm",value:function(){return $('<div class="xmuiCore xmuiForm xmuiSecurityQuestionForm"><div class="xmuiPrompt" data-xmui-customstringtext="question.prompt"/><div class="xmuiFullHeightContentBelowPrompt"><div class="xmuiSecurityQuestionList"><\/div><button class="xmuiSubmitButton" type="submit" data-xmui-customstringtext="question.submitButton"><\/button><\/div><\/div>')}},{key:"startSession",value:function(t,i,f,e){u(r(n.prototype),"startSession",this).call(this,t,i,f,e)}},{key:"promiseRecoveryForError",value:function(t,i,f){var e=this;return this.common.clearContainer(this.clientContext),u(r(n.prototype),"promiseRecoveryForError",this).call(this,t,i,f).finally(function(){e.questionForm=null})}},{key:"promiseInput",value:function(){var n;switch(this.common.setAriaBusy(this.clientContext),this.questionForm||(this.questionForm=this.newForm(),this.common.appendElement(this.questionForm,this.clientContext)),this.mode){case com.ts.mobile.sdk.AuthenticatorSessionMode.Authentication:console.log("Fetching authentication input; authenticator: [".concat(this.title,"]"));this.common.unsetAriaBusy(this.clientContext);n=this.promiseAuthInput();break;case com.ts.mobile.sdk.AuthenticatorSessionMode.Registration:console.log("Fetching registration input; authenticator: [".concat(this.title,"]"));this.common.unsetAriaBusy(this.clientContext);n=this.promiseRegInput()}return n}},{key:"endSession",value:function(){this.common.clearContainer(this.clientContext)}},{key:"promiseAuthInput",value:function(){return this.promiseQuestionsInput()}},{key:"promiseRegInput",value:function(){return this.promiseQuestionsInput()}},{key:"promiseQuestionsInput",value:function(){var n=this;return new Promise(function(t){var i=n;new Promise(function(t){n.common.prependPageHeader(n.questionForm,n.title,t)}).then(function(i){n.common.clearContainer(n.clientContext);n.questionForm=null;t(i)});n.askQuestions(function(n){var r=[];i.currentStep.getSecurityQuestions().forEach(function(t){var i=n[t.getSecurityQuestionId()];i&&r.push(com.ts.mobile.sdk.SecurityQuestionAndAnswer.createAnswerToQuestion(t,com.ts.mobile.sdk.SecurityQuestionAnswer.createWithText(i)))});i.questionForm.fadeOut(function(){t(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(com.ts.mobile.sdk.SecurityQuestionInputResponse.createSecurityQuestionAnswersInputResponse(r)))})})})}},{key:"setInputStep",value:function(n,t,i){this.currentStep=i}},{key:"askQuestions",value:function(n){var r=this,i=this.questionForm.find(".xmuiSecurityQuestionList"),u=this.currentStep.getMinAnswersNeeded(),t;this.currentStep.getSecurityQuestions().forEach(function(n){i.append($('<div class="xmuiSecurityQuestion">'+"   ".concat(n.getSecurityQuestionText(),"?")+"   <br/>"+'   <input id="xmui_secq_'.concat(n.getSecurityQuestionId(),'" placeholder="Answer here"/>')+"<\/div>"))});t=this.questionForm.find(".xmuiSubmitButton");t.click(function(){t.off("click");var r={};return i.find("input").each(function(n,t){var i=t;r[i.id.substring(10)]=i.value}),i.find("input").toArray().forEach(function(n){$(n).replaceWith($("<span>").text(n.value))}),n(r),!1});t.attr("disabled","disabled");this.questionForm.find("input").on("input",function(){var n=0;r.questionForm.find("input").each(function(t,i){i.value.length>0&&n++});n>=u?t.removeAttr("disabled"):t.attr("disabled","disabled")});this.questionForm.fadeIn()}}]),n}();t.SecurityQuestionAuthenticatorSession=c},function(n,t,i){"use strict";function f(n){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function e(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function l(n,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(n):t}function o(n,t,i){return(o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(n,t,i){var f=function(n,t){for(;!Object.prototype.hasOwnProperty.call(n,t)&&null!==(n=u(n)););return n}(n,t),r;if(f)return r=Object.getOwnPropertyDescriptor(f,t),r.get?r.get.call(i):r.value})(n,t,i||n)}function u(n){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function s(n,t){return(s=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}var r,h,c;Object.defineProperty(t,"__esModule",{value:!0});h=i(0);!function(n){n[n.TargetSelection=0]="TargetSelection";n[n.PollingRequested=1]="PollingRequested";n[n.PollingStarted=2]="PollingStarted"}(r||(r={}));c=function(){function n(t,i,f,e){var o;return function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n),(o=l(this,u(n).call(this,t,i,e))).state=r.TargetSelection,o.pollingIntervalMillis=3e3,o.instructions=f,o}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&s(n,t)}(n,h.BaseAuthenticatorSession),function(n,t,i){t&&e(n.prototype,t);i&&e(n,i)}(n,[{key:"setPollingIntervalInMillis",value:function(n){this.pollingIntervalMillis=n}},{key:"setCreatedApprovalInfo",value:function(n,t){null!=n?(this.createdForTargets=n,this.otp=t,this.state=r.PollingRequested):(this.createdForTargets=null,this.otp=null,this.state=r.TargetSelection,clearTimeout(this.pollingTimer),this.hidePendingUi())}},{key:"setAvailableTargets",value:function(n){this.availableTargets=n}},{key:"endSession",value:function(){this.common.clearContainer(this.clientContext);clearTimeout(this.pollingTimer)}},{key:"promiseInput",value:function(){var n=this;switch(this.mode){case com.ts.mobile.sdk.AuthenticatorSessionMode.Authentication:switch(this.common.setAriaBusy(this.clientContext),console.log("Fetching Mobile Approve authentication input;"),this.state){case r.TargetSelection:return this.promiseTargetSelectionInput();case r.PollingRequested:return this.state=r.PollingStarted,this.promisePendingUI().then(function(t){t.isControlRequest()&&(n.hidePendingUi(),clearTimeout(n.pollingTimer));n.currentPollingResolver(t)}),this.startPolling();case r.PollingStarted:return this.startPolling();default:return Promise.reject("Illegal state")}case com.ts.mobile.sdk.AuthenticatorSessionMode.Registration:throw new Error("Method not implemented.");}}},{key:"promiseTargetSelectionInput",value:function(){var n=this,t=$('<div class="xmuiCore xmuiForm xmuiMobileAuthSelectDeviceForm">                <div class="xmuiPrompt" data-xmui-customstringtext="mobileAuthDeviceSelection.selectDevices"/>                <div class="xmuiFullHeightContentBelowPrompt xmuiAuthMobileDeviceSelection">                    <div class="xmuiAuthMobileDeviceSelectionList"><\/div>                    <div style="align-items: center;">                        <button class="xmuiLoginButton" type="submit" data-xmui-customstringtext="mobileAuthDeviceSelection.select"/>                    <\/div>                <\/div>            <\/div>'),r=t.find(".xmuiAuthMobileDeviceSelectionList"),u=t.find(".xmuiLoginButton"),i=t.find(".xmuiPrompt");return this.common.appendElement(t,this.clientContext),new Promise(function(f){n.availableTargets.forEach(function(n){var t=n.getDescription(),i=$("<input/>").attr({id:"xmui_device_"+t,name:"xmui_device_"+t,type:"checkbox"}).data("xmui_device_id",n),u=$("<label/>").attr("htmlFor","xmui_device_"+t).text(t).css("font-size","10pt");r.append(i).append(u).append($("<br/>"))});u.click(function(){var r=[];t.find("input:checkbox:checked").each(function(n,t){r.push($(t).data("xmui_device_id"))});r.length<=0?(i.text(n.common.resolveString("mobileApprove.deviceSelection.noneError")),i.addClass("xmuiPromptError"),i.attr("role","alert").attr("aria-label",n.common.resolveString("aria.noDeviceSelected"))):t.fadeOut(function(){var n=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetsSelectionRequest(r);f(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(n))})});n.common.prependPageHeader(t,n.title,f)}).then(function(t){return n.common.unsetAriaBusy(n.clientContext),n.common.clearContainer(n.clientContext),t})}},{key:"promisePendingUI",value:function(){var n=this,t=$('<div class="xmuiCore xmuiForm xmuiMobileAuthForm" style="display:none;">                <div class="xmuiFullHeightContentBelowPrompt">                    <div class="xmuiHalfHeight">                        <span class="xmuiHalfHeightText" data-xmui-customstringtext="mobileAuth.approvalPending"/>                    <\/div>                    <div class="xmuiLoginInstructionsLabel"><\/div>                    <div class="xmuiOtpText" style="display:none;"><\/div>                    <div>                        <img class="xmuiOtpImg" style="display:none;"/><\/img>                    <\/div>                    <div class="xmuiSpinner xmuiInProgress"><\/div>                <\/div>            <\/div>');return new Promise(function(i){n.common.appendElement(t,n.clientContext);t.find(".xmuiLoginInstructionsLabel").text(n.instructions);n.updateOtp();n.common.prependPageHeader(t,n.title,i);n.common.unsetAriaBusy(n.clientContext);t.fadeIn()})}},{key:"updateOtp",value:function(){var n,t;if(this.otp)switch(this.otp.getFormat().getType()){case com.ts.mobile.sdk.OtpFormatType.Numeric:n=$(".xmuiMobileAuthForm").find(".xmuiOtpText");n.text(this.otp.getValue());n.show();break;case com.ts.mobile.sdk.OtpFormatType.QrCode:t=$(".xmuiMobileAuthForm").find(".xmuiOtpImg");t.attr("src","data:image/jpeg;base64,"+this.otp.getValue());t.show();break;default:throw console.log("Unsupported otp format"),new Error("Unsupported otp format");}}},{key:"hidePendingUi",value:function(){this.common.unsetAriaBusy(this.clientContext);$(".xmuiMobileAuthForm").hide()}},{key:"promiseRecoveryForError",value:function(t,i,r){var f=this;return new Promise(function(e){f.hidePendingUi();e(o(u(n.prototype),"promiseRecoveryForError",f).call(f,t,i,r))})}},{key:"startPolling",value:function(){var n=this;return new Promise(function(t){n.updateOtp();n.pollingTimer=setTimeout(function(){t(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(com.ts.mobile.sdk.MobileApproveInputRequestPolling.createRequestPollingInput())))},n.pollingIntervalMillis);n.currentPollingResolver=t})}},{key:"promiseAuthInput",value:function(){throw new Error("Method not implemented");}},{key:"promiseRegInput",value:function(){throw new Error("Method not implemented");}}]),n}();t.MobileApproveAuthenticatorSession=c},function(n,t,i){"use strict";function u(n){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function f(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function s(n,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(n):t}function e(n,t,i){return(e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(n,t,i){var f=function(n,t){for(;!Object.prototype.hasOwnProperty.call(n,t)&&null!==(n=r(n)););return n}(n,t),u;if(f)return u=Object.getOwnPropertyDescriptor(f,t),u.get?u.get.call(i):u.value})(n,t,i||n)}function r(n){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function o(n,t){return(o=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}Object.defineProperty(t,"__esModule",{value:!0});var h=i(0),c=function(){function n(t,i,u){return function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n),s(this,r(n).call(this,t,i,u))}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&o(n,t)}(n,h.BaseAuthenticatorSession),function(n,t,i){t&&f(n.prototype,t);i&&f(n,i)}(n,[{key:"setAvailableTargets",value:function(n){this.availableTargets=n}},{key:"setTargetDevices",value:function(n){this.targetDevices=n}},{key:"setChallenge",value:function(n){this.challenge=n}},{key:"promiseAuthInput",value:function(){return this.availableTargets&&!this.targetDevices?this.promiseTargetSelectionInput():this.promiseCodeInput()}},{key:"promiseRecoveryForError",value:function(t,i,u){if(t.getErrorCode()==com.ts.mobile.sdk.AuthenticationErrorCode.InvalidInput&&i.indexOf(com.ts.mobile.sdk.AuthenticationErrorRecovery.RetryAuthenticator)>=0){if(t.getPublicSymbolicProperty(com.ts.mobile.sdk.AuthenticationErrorProperty.AuthenticatorInvalidInputErrorDescription)==com.ts.mobile.sdk.AuthenticationErrorPropertySymbol.AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit)return console.log("Totp authentication failed due to invalid check-digit, starting recovery"),this.errorTooltip=this.common.resolveString("totp.invalidCheckDigit"),Promise.resolve(com.ts.mobile.sdk.AuthenticationErrorRecovery.RetryAuthenticator);this.errorTooltip=this.common.resolveString("totp.invalidSecret")}return e(r(n.prototype),"promiseRecoveryForError",this).call(this,t,i,u)}},{key:"promiseTargetSelectionInput",value:function(){var t=this,n=$('<div class="xmuiCore xmuiForm xmuiTotpSelectDeviceForm">                <div class="xmuiPrompt" data-xmui-customstringtext="totpDeviceSelection.selectDevices"/>                <div class="xmuiFullHeightContentBelowPrompt xmuiAuthMobileDeviceSelection">                    <div class="xmuiTotpDeviceSelectionList"><\/div>                    <div style="align-items: center;">                        <button class="xmuiLoginButton" type="submit" data-xmui-customstringtext="mobileAuthDeviceSelection.select"/>                    <\/div>                <\/div>            <\/div>'),r=n.find(".xmuiTotpDeviceSelectionList"),u=n.find(".xmuiLoginButton"),i=n.find(".xmuiPrompt");return this.common.appendElement(n,this.clientContext),new Promise(function(f){t.availableTargets.forEach(function(n){var t=n.getDescription(),i=$("<input/>").attr({id:"xmui_device_"+t,name:"xmui_device_"+t,type:"checkbox"}).data("xmui_device_id",n),u=$("<label/>").attr("htmlFor","xmui_device_"+t).text(t).css("font-size","10pt");r.append(i).append(u).append($("<br/>"))});u.click(function(){var r=[];n.find("input:checkbox:checked").each(function(n,t){r.push($(t).data("xmui_device_id"))});r.length<=0?(i.text(t.common.resolveString("totp.deviceSelection.noneError")),i.addClass("xmuiPromptError"),i.attr("role","alert").attr("aria-label",t.common.resolveString("aria.noDeviceSelected"))):n.fadeOut(function(){var n=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createTargetsSelectionRequest(r);f(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(n))})});t.common.prependPageHeader(n,t.title,f)})}},{key:"promiseCodeInput",value:function(){var n=this,t=$('<div class="xmuiCore xmuiForm xmuiTotpForm"><div class="xmuiErrorTooltip xmuiPromptError"/><div class="xmuiPrompt"/><div class="xmuiFullHeightContentBelowPrompt"><form onsubmit="return false"><div class="xmuiTotpChallenge" style="display:none;"><h5 data-xmui-customstringtext="totp.challengeHeader"><\/h5><\/div><div class="xmuiTotpInput"><input data-xmui-customstringtext-placeholder="totp.inputPlaceholder"/><\/div><div><button class="xmuiLoginButton" type="button" data-xmui-customstringtext="totp.loginButton"/><\/div><\/form><\/div><\/div>'),r=t.find("input"),u=t.find("button"),i=t.find(".xmuiTotpChallenge");return this.common.appendElement(t,this.clientContext),new Promise(function(f){var e,o,s;if(n.challenge){switch(n.challenge.getFormat().getType()){case com.ts.mobile.sdk.TotpChallengeFormatType.Numeric:case com.ts.mobile.sdk.TotpChallengeFormatType.AlphaNumeric:o=$('<div class="xmuiTotpNumericChallenge">');o.text(n.challenge.getValue());i.append(o);break;case com.ts.mobile.sdk.TotpChallengeFormatType.QrCode:s=$("<img>");s.attr("src","data:image/jpeg;base64,"+n.challenge.getValue());i.append($("<div>").append(s))}e=n.common.resolveString("totp.instructionsWithChallenge");i.show()}else e=n.common.resolveString("totp.instructions");n.errorTooltip&&t.find(".xmuiErrorTooltip").text(n.errorTooltip);t.find(".xmuiPrompt").text(e);r.val("");u.click(function(){t.fadeOut(function(){var n=com.ts.mobile.sdk.impl.TotpInputCodeSubmissionImpl.createTotpCodeSubmission(r.val().toString()),t=com.ts.mobile.sdk.TargetBasedAuthenticatorInput.createAuthenticatorInput(n);f(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(t))})});n.common.prependPageHeader(t,n.title,f)})}},{key:"promiseRegInput",value:function(){throw new Error("Method not implemented.");}}]),n}();t.TotpAuthenticatorSession=c},function(n,t){"use strict";function i(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(t){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this.pollingIntervalMillis=3e3;this.common=t}return function(n,t,r){t&&i(n.prototype,t);r&&i(n,r)}(n,[{key:"setWaitingTicket",value:function(n){this.ticketWaitInfo=n;this.ui&&this.loadTicketInfoToUi()}},{key:"startSession",value:function(n,t){this.clientContext=t;this.common.setAriaBusy(this.clientContext);this.ui=this.createUi();this.loadTicketInfoToUi();this.common.unsetAriaBusy(this.clientContext);this.ui.fadeIn()}},{key:"endSession",value:function(){this.common.clearContainer(this.clientContext);this.ui=null;this.abortPolling()}},{key:"promiseInput",value:function(){var n=this;return new Promise(function(t){n.currentInputPromiseResolver=function(i){return n.currentInputPromiseResolver=null,t(i)};n.startPolling()})}},{key:"startPolling",value:function(){var n=this;this.pollingTimer=setTimeout(function(){n.currentInputPromiseResolver&&n.currentInputPromiseResolver(com.ts.mobile.sdk.InputOrControlResponse.createInputResponse(com.ts.mobile.sdk.TicketWaitInput.createPollRequest()));n.pollingTimer=null},this.pollingIntervalMillis)}},{key:"abortPolling",value:function(){this.pollingTimer&&(clearTimeout(this.pollingTimer),this.pollingTimer=null)}},{key:"createUi",value:function(){var t=this,n=$('<div class="xmuiCore xmuiForm xmuiMobileAuthForm" style="display:none;">                <div class="xmuiFullHeightContentBelowPrompt">                    <div class="xmuiLoginInstructionsLabel"><\/div>                    <div class="xmuiTicketText" style="display:none;"><\/div>                    <div>                        <img class="xmuiTicketImg" style="display:none;"/><\/img>                    <\/div>                    <div class="xmuiSpinner xmuiInProgress"><\/div>                <\/div>            <\/div>');return this.common.prependPageHeader(n,"ticketWait",function(n){t.currentInputPromiseResolver(n)}),this.common.appendElement(n,this.clientContext),n}},{key:"loadTicketInfoToUi",value:function(){var n,t;if(this.ticketWaitInfo){if(this.ticketWaitInfo.getTicketId())try{switch(this.ticketWaitInfo.getTicketId().getFormat()){case com.ts.mobile.sdk.TicketIdFormat.Alphanumeric:n=this.ui.find(".xmuiTicketText");n.text(this.ticketWaitInfo.getTicketId().getValue());n.show();break;case com.ts.mobile.sdk.TicketIdFormat.Qr:t=this.ui.find(".xmuiTicketImg");t.attr("src","data:image/jpeg;base64,"+this.ticketWaitInfo.getTicketId().getValue());t.show();break;default:throw console.log("Unsupported ticket ID format"),new Error("Unsupported ticket ID format");}}catch(n){console.log("Error in loadTicketInfoToUi(), not displaying ticket : "+n)}this.ui.find(".xmuiLoginInstructionsLabel").text(this.ticketWaitInfo.getText());this.ui.find(".xmuiPageHeader span").text(this.ticketWaitInfo.getTitle())}}}]),n}();t.TicketWaitSession=r},function(n,t,i){"use strict";function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function f(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function e(n,t,i){return t&&f(n.prototype,t),i&&f(n,i),n}var o=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}};Object.defineProperty(t,"__esModule",{value:!0});var r,s=o(i(3)),h=o(i(4)),c=function(){function n(){u(this,n)}return e(n,[{key:"resolveString",value:function(n){var t={"progress.pleaseWait":"Please wait...","authMenu.title":"Authentication","authMenu.selectAuthenticator":"Please select authentication method:","authMenu.methodTitle":"Authenticate with $method","configMenu.instructions":"Add, edit or remove authenticators","configMenu.title":"Authentication Options","password.inputPlaceholder":"Password","password.loginButton":"Sign In","password.prompt":"Please type your password","password.registration.prompt":"Please type a new password","password.registration.promptAgain":"Please type the new password again","password.registration.noMatch":"Passwords did not match. Try again","password.registration.continueButton":"Continue","password.registration.registerButton":"Confirm","question.prompt":"Please answer the following","question.submitButton":"Submit","otp.prompt":"Input OTP code","otp.inputPlaceholder":"Input code here","otp.loginButton":"Login","otp.resendButton":"Resend OTP","totp.inputPlaceholder":"Input Time-Based Token code","totp.challengeHeader":"Challenge:","totp.loginButton":"Login","totp.instructions":"Please enter generated time-based token code here","totp.instructionsWithChallenge":"Please generate code using below challenge and enter generated code below","totp.invalidSecret":"Incorrect code, please restart code generation","totp.invalidCheckDigit":"Typing error detected - retype code","enroll.prompt":"Please scan the QR code below to bind your device.","enroll.continue":"Continue","mobileAuth.approvalPending":"Approval pending...","mobileAuthDeviceSelection.selectDevices":"Select devices for mobile approve:","mobileAuthDeviceSelection.select":"Select","mobileApprove.deviceSelection.noneError":"No device selected - please select at least one to continue","totpDeviceSelection.selectDevices":"Select devices for Time-Based Token:","totpDeviceSelection.select":"Select","totp.deviceSelection.noneError":"No device selected - please select at least one to continue","mobilePin.authPending":"Authentication pending...","mobilePin.registrationPending":"Waiting for completion of registration on your mobile device.","mobilePin.registrationInstructions":"Please complete registration on your mobile device.","mobilePin.registerPrompt":"Please type your mobile phone number","mobilePin.registerInputPlaceholder":"Mobile phone number","mobilePin.registerSubmitButton":"Register","mobilePin.authTitle":"Login with Clickable SMS","mobilePin.authAskMobilePrompt":"Please input the last 4 digits of your mobile device phone number to login","mobilePin.authAskMobileInputPlaceholder":"","mobilePin.authAskSubmitButton":"Continue","mobilePin.authCfmMobilePrompt":"Confirm login with your mobile device","mobilePin.loginWith":"Login with ******","otpTargetSelection.selectTarget":"Select target for OTP:","error.xmapiError.invalidPassword":"Invalid password provided","error.xmapiError.invalidTotp":"Invalid code provided","error.xmapiError.invalidPattern":"Invalid pattern provided","error.xmapiError.invalidPin":"Invalid PIN provided","error.xmapiError.invalidOtp":"Invalid OTP provided","error.xmapiError.invalidVoice":"Invalid voice provided","error.xmapiError.approvalDenied":"Mobile approval denied","error.xmapiError.approvalExpired":"Mobile approval expired","error.xmapiError.allAuthenticatorsLocked":"All authenticators are locked","error.xmapiError.noRegisteredAuthenticator":"No registered authenticator is available","error.xmapiError.commError":"Protocol error","error.xmapiError.authRejected":"Access was rejected by server","error.xmapiError.authActionError":"Error occured while handling authentication assertion action","error.xmapiError.secretAlreadyUsed":"Secret has already been used","error.xmapiError.notEnoughAnswers":"Must have at least $count answers","error.xmapiError.corsOrInvalidHost":"Destination server is invalid or the server does not support access-control-allow-origin","error.xmapiError.sessionExpired":"Session has expired","methodName.password":"Password","methodName.voice_server":"Voice Passphrase","methodName.otp":"OTP","methodName.totp":"Time-Based Token","methodName.mobile_approve":"Mobile Approve","methodName.mobile_pin":"Clickable SMS","methodName.question":"Memorable Question","methodName.pattern_centralized":"Pattern","methodName.pin_centralized":"Pin","otpMethodChannel.Sms":"SMS $target","otpMethodChannel.Email":"Email $target","otpMethodChannel.VoiceCall":"Voice call $target","otpMethodChannel.Unknown":"External Provider $target","pattern.prompt":"Draw your pattern below","pattern.registerDrawPrompt":"Please draw a new pattern","pattern.registerDrawAgainPrompt":"Please draw the pattern again to confirm","pattern.registerTooShortErrorPrompt":"Pattern must be at least $length points long","pattern.registerNoMatchErrorPrompt":"Pattern do not match, please try again","pattern.registerRestartButton":"Start Over","pattern.registerContinueButton":"Continue","pin.prompt":"Input Pin code","pin.inputPlaceholder":"Input Pin code","pin.loginButton":"Login","pin.registration.prompt":"Please type a new PIN","pin.registration.promptAgain":"Please type the new PIN again","pin.registration.noMatch":"PINs did not match. Try again","pin.registration.badLength":"PIN should be $length digits long","pin.registration.digitsOnly":"PIN should contain digits only","pin.registration.continueButton":"Continue","pin.registration.registerButton":"Confirm","recoveryMenu.failed":"Authentication failed: $reason","recoveryMenu.locked":"Authenticator locked.","recoveryMenu.title":"Recovery","failureAction.Fail":"Cancel","failureAction.ChangeAuthenticator":"Change Authentication Method","failureAction.SelectAuthenticator":"Select Authentication Method","failureAction.RetryAuthenticator":"Retry","voice.prompt":"Please click the button below and speak the following phrase:","login.cancelButton":"Cancel","cancelMenu.title":"Cancel Action","cancelMenu.instructions":"Are you sure you want to cancel and go back?","cancelMenu.AbortAuthentication":"Yes","cancelMenu.RetryAuthenticator":"Try Again","cancelMenu.ChangeMethod":"Change Authentication Method","cancelMenu.SelectMethod":"Select Authentication Method","unregister.confirmation.title":"Unregister Authenticator","unregister.confirmation.instructions":"Are you sure you want to unregister $method authentication?","unregister.confirmation.summary":"Authenticator $method unregistered.","unregister.confirmation.continue":"Yes","unregister.confirmation.cancel":"Cancel","configMenu.error.title":"Configuration action failed","configMenu.error.continue":"Reload Menu","user.management.title":"User Management","user.management.cancelButton":"Cancel","newUser.title":"New User","newUser.cancelButton":"Cancel","newUser.remember":"Remember me on this computer","fallbackMenu.instructions":"We have other authentication options you can choose from. If you continue failing you may get locked out so switching to another option is recommended.","fallbackMenu.title":"Having trouble logging in?","fallbackMenu.Fallback":"Switch to authentication with $method","fallbackMenu.AuthMenu":"Choose a different authenticator","fallbackMenu.Retry":"Go back and let me try again","fallbackMenu.Cancel":"Cancel authentication","removeUser.title":"Remove User","removeUser.text":"Are you sure you want to remove user: $user","removeUser.continue":"Yes","removeUser.cancel":"Cancel","promotion.skipButton":"Skip","aria.unregisterMethod":"Unregister $name","aria.reRegisterMethod":"Re-register $name","aria.registerMethod":"Register $name","aria.lockedMethod":"$name is locked","aria.expiredMethod":"$name has expired","aria.defaultMethod":"$name is set as default authentication method","aria.setDefaultMethod":"click to set $name as default authentication method","aria.existingUser":"Select existing user named: $name","aria.deleteExistingUser":"Delete saved user named: $name","aria.newUser":"Add a new user","aria.enterPassword":"Enter a new password","aria.enterPasswordAgain":"Enter new password again","aria.passwordsDontMatch":"Passwords don't match. Try again","aria.voiceRecordButton":"Start recording voice","aria.enterPin":"Enter a new PIN","aria.enterPinAgain":"Enter new PIN again","aria.pinsDontMatch":"Passwords don't match. Try again","aria.badPinLength":"Pin should be $length digits long","aria.noDeviceSelected":"No device selected"};return null!=t[n]?t[n]:n}},{key:"resolveRtStrings",value:function(){var n=this.resolveString;$("[data-xmui-customstringtext]").each(function(t,i){var r=$(i),u=r.attr("data-xmui-customstringtext"),f=n(u);r.text(f)});["placeholder"].forEach(function(t){var i="data-xmui-customstringtext-"+t;$("["+i+"]").each(function(r,u){var f=$(u),e=f.attr(i),o=n(e);f.attr(t,o)})})}},{key:"reBind",value:function(n,t){(n.off||n.unbind).call(n,"click");(n.on||n.bind).call(n,"click",t)}},{key:"setAriaBusy",value:function(t){n.getContainer(t).attr("aria-busy","true")}},{key:"unsetAriaBusy",value:function(t){n.getContainer(t).removeAttr("aria-busy")}},{key:"showProgressForm",value:function(t){var i=n.getContainer(t),r;i.find(".xmuiInProgress").length||(r=$('<div class="xmuiCore xmuiForm xmuiProgressForm" aria-busy="true" role="alert">                    <div class="xmuiSpinner"/>                    <span style="vertical-align:middle" data-xmui-customstringtext="progress.pleaseWait"><\/span>                <\/div>'),i.append(r),this.resolveRtStrings())}},{key:"hideProgressForm",value:function(t){n.getContainer(t).find(".xmuiProgressForm").hide()}},{key:"prependPageHeader",value:function(n,t,i){var r=n.find(".xmuiPageHeader");r.length||(r=$('<div class="xmuiPageHeader">                    <div>                        <span><\/span>                        <button role="button" data-xmui-customstringtext="login.cancelButton"><\/button>                    <\/div>                <\/div>'),n.prepend(r));r.find("span").text(this.resolveString("methodName.".concat(t)));r.find("button").click(function(){var n=com.ts.mobile.sdk.ControlRequest.create(com.ts.mobile.sdk.ControlRequestType.CancelAuthenticator);i(com.ts.mobile.sdk.InputOrControlResponse.createControlResponse(n))});this.resolveRtStrings()}},{key:"promiseCancelAction",value:function(n,t){var r=this,i;return n.indexOf(com.ts.mobile.sdk.ControlRequestType.ChangeMethod)>=0&&n.indexOf(com.ts.mobile.sdk.ControlRequestType.SelectMethod)>=0&&(n=n.filter(function(n){return n!=com.ts.mobile.sdk.ControlRequestType.ChangeMethod})),i=n.map(function(n){var t=com.ts.mobile.sdk.ControlRequestType[n],i=com.ts.mobile.sdk.ControlRequest.create(n);return{classes:["xmuiCancelActionMenuItem","xmuiCancelMenu_"+t],title:r.resolveString("cancelMenu."+t),resp:i}}),this.promiseMenuInput(i,this.resolveString("cancelMenu.title"),this.resolveString("cancelMenu.instructions"),t).then(function(n){return n.resp})}},{key:"loadForms",value:function(n){var t=$('<div class="xmuiLoginTiles">');this.allFormElements.forEach(function(n){n.appendTo(t)});t.appendTo(n);this.resolveRtStrings()}},{key:"resolveMethodTitle",value:function(n){return n.getAuthenticatorId().startsWith("placeholder_")?n.getName():this.resolveString("methodName."+n.getAuthenticatorId())}},{key:"resolveMethodAuthenticateTitle",value:function(n){return this.resolveString("authMenu.methodTitle").replace("$method",this.resolveMethodTitle(n))}},{key:"clearContainer",value:function(t){var i=n.getContainer(t),r=i.html();return i.empty(),r}},{key:"restoreContainer",value:function(t,i){n.getContainer(t).html(i)}},{key:"appendElement",value:function(t,i){n.getContainer(i).append(t);this.resolveRtStrings()}},{key:"promiseMenuInput",value:function(n,t,i,u,f,e,o,s){var c=this,h=$('<div class="xmuiCore xmuiForm xmuiMenuForm" role="dialog" aria-labelledby="xmuiMenuTitle" aria-describedby="xmuiMenuInstructions" aria-hidden="true">                <div class="xmuiPageHeader">                    <div>                        <span id="xmuiMenuTitle"><\/span>                        <button><\/button>                    <\/div>                <\/div>                <h1 id="xmuiMenuInstructions" class="xmuiPrompt"/>                <div class="xmuiFullHeightContentBelowPrompt">                    <div class="xmuiMenuItems" role="menu"><\/div>                <\/div>            <\/div>'),v=h.find(".xmuiPageHeader"),y=v.find("span"),a=v.find("button"),l=h.find(".xmuiPrompt"),p=function(n,t,i,f){var o=function(n,t,i,r,u){n.attr("aria-label",c.resolveString(i).replace("$name",t));n.attr("role",r);n.attr("tabindex",u)},s=n.annunciators||[],l=$("<div>").addClass("xmuiMenuItemAnnunciators").appendTo(t);return s.forEach(function(t){var s=$("<div>").addClass("xmuiMenuItemAnnunciator").addClass(t);e&&function(n,t,i,f,e){var s={authenticator:n.authenticator};switch(t){case"xmuiMethodMenuAnnUnregister":s.action=r.Unregister;o(i,n.title,"aria.unregisterMethod","Button",f);break;case"xmuiMethodMenuAnnReRegister":s.action=r.Reregister;o(i,n.title,"aria.reRegisterMethod","Button",f);break;case"xmuiMehtodMenuAnnRegister":s.action=r.Register;o(i,n.title,"aria.registerMethod","Button",f);break;case"xmuiMethodMenuAnnLocked":o(i,n.title,"aria.lockedMethod","status",f);break;case"xmuiMehtodMenuAnnExpired":o(i,n.title,"aria.expiredMethod","status",f);break;case"xmuiMethodMenuAnnDefault":o(i,n.title,"aria.defaultMethod","status",f)}s.action&&i.click(function(){h.attr("aria-hidden","true");h.fadeOut(function(){c.clearContainer(u);e(s)})})}(n,t,s,i,f);s.html("&nbsp;");l.append(s)}),t};return h.attr("aria-hidden","false"),this.appendElement(h,u),new Promise(function(v){h.find(".xmuiMenuItems").empty();f?(l.text(f),l.addClass("xmuiPromptError")):(l.text(i),l.removeClass("xmuiPromptError"));y.text(t);var w=0;n.forEach(function(n){var t=$('<div class="xmuiMenuItem xmuiAuthenticatorMenuItem">'),i=$('<span class="xmuiMethodMenuItemText" role="button"><\/span>');i.text(n.title);t.append(i);n.classes.forEach(function(n){t.addClass(n)});w+=1;i.attr("tabindex",w);n.disabled?function(n,t){n.addClass("xmuiMenuItemDisabled");t.attr("aria-disabled","true")}(t,i):(i.attr("aria-label",e?c.resolveString("aria.setDefaultMethod").replace("$name",n.title):n.title),i.click(function(){h.attr("aria-hidden","true");h.fadeOut(function(){c.clearContainer(u);v(e?{authenticator:n.authenticator,action:r.SetDefault}:n)})}));n.annunciators&&(t=p(n,t,w,v));h.find(".xmuiMenuItems").append(t)});o?(a.text(s||c.resolveString("login.cancelButton")),a.click(function(){h.attr("aria-hidden","true");c.clearContainer(u);v({abortSelection:!0})})):a.hide();c.unsetAriaBusy(u)})}},{key:"promiseRecoveryForError",value:function(n,t,i,r){var o=this,u=n.getMessage(),f=n.getData(),e;return f&&f.additional_data&&f.additional_data.locked&&(u="Authenticator locked: ".concat(u)),t.indexOf(com.ts.mobile.sdk.AuthenticationErrorRecovery.ChangeAuthenticator)>=0&&t.indexOf(com.ts.mobile.sdk.AuthenticationErrorRecovery.SelectAuthenticator)>=0&&(t=t.filter(function(n){return n!=com.ts.mobile.sdk.AuthenticationErrorRecovery.ChangeAuthenticator})),e=t.map(function(n){var t=com.ts.mobile.sdk.AuthenticationErrorRecovery[n];return{classes:["xmuiAuthRecoveryMenuItem","xmuiRecoveryMenu_"+t],title:o.resolveString("failureAction."+t),resp:n}}),this.promiseMenuInput(e,this.resolveString("recoveryMenu.title"),null,r,u).then(function(n){return n.resp})}},{key:"methodMenuPromise",value:function(n,t){var i=this;return new Promise(function(r){var u=n.map(function(n){var t=n.getAuthenticator();return{disabled:!t.getEnabled()||t.getLocked()||!t.getRegistered(),classes:["xmuiMethodMenuItem","xmuiMethodMenu_"+t.getType()],annunciators:function(n){var t=[];return n.getDefaultAuthenticator()&&t.push("xmuiMethodMenuAnnDefault"),n.getLocked()&&t.push("xmuiMethodMenuAnnLocked"),t}(t),title:i.resolveMethodAuthenticateTitle(t),method:t}});return i.promiseMenuInput(u,i.resolveString("authMenu.title"),i.resolveString("authMenu.selectAuthenticator"),t,null,!1,!0).then(function(n){n.abortSelection?r(com.ts.mobile.sdk.AuthenticatorSelectionResult.createAbortRequest()):r(com.ts.mobile.sdk.AuthenticatorSelectionResult.createSelectionRequest(n.method))})})}},{key:"registrationPromotionMethodSelectionPromise",value:function(n,t){var i=this,r=n.map(function(n){return{classes:["xmuiMethodMenuItem","xmuiMethodMenu_"+n.getType()],title:i.resolveMethodTitle(n),method:n}});return this.promiseMenuInput(r,this.resolveString("authMenu.title"),this.resolveString("authMenu.selectAuthenticator"),t,null,!1,!0,this.resolveString("promotion.skipButton")).then(function(n){return n.abortSelection?com.ts.mobile.sdk.PromotionInput.createControlResponse(com.ts.mobile.sdk.PromotionControlRequest.Skip):com.ts.mobile.sdk.PromotionInput.createAuthenticatorDescription(n.method)})}},{key:"methodFallbackPromise",value:function(n,t,i){var r=this,u=n.map(function(n){var i=r.resolveString("fallbackMenu."+com.ts.mobile.sdk.AuthenticatorFallbackAction[n]);if(n===com.ts.mobile.sdk.AuthenticatorFallbackAction.Fallback){if(!t)throw new Error("Fallback is an option for fallback but no fallback authenticator is defined on action");i=i.replace("$method",t.getName())}return{classes:["xmuiFallbackOptionsMenuItem","xmuiFallbackMenu_"+com.ts.mobile.sdk.AuthenticatorFallbackAction[n]],title:i,resp:n}});return this.promiseMenuInput(u,this.resolveString("fallbackMenu.title"),this.resolveString("fallbackMenu.instructions"),i).then(function(n){return n.resp})}},{key:"configurationSession",value:function(){var n=this;return new(function(){function t(n){u(this,t);this.common=n}return e(t,[{key:"setAuthenticatorsList",value:function(t){var i=this,u=t.map(function(t){var i=t.getDescription();return{method:i,title:n.resolveMethodTitle(i),classes:["xmuiMethodMenuItem","xmuiMethodMenu_"+i.getAuthenticatorId()],annunciators:function(n,t){var i=[];return n.getDefaultAuthenticator()&&i.push("xmuiMethodMenuAnnDefault"),n.getLocked()&&i.push("xmuiMethodMenuAnnLocked"),n.getRegistered()?(t.indexOf(com.ts.mobile.sdk.AuthenticatorConfigurationAction.Reregister)>-1&&i.push("xmuiMethodMenuAnnReRegister"),t.indexOf(com.ts.mobile.sdk.AuthenticatorConfigurationAction.Unregister)>-1&&i.push("xmuiMethodMenuAnnUnregister")):t.indexOf(com.ts.mobile.sdk.AuthenticatorConfigurationAction.Register)>-1&&i.push("xmuiMehtodMenuAnnRegister"),n.getExpired()&&i.push("xmuiMehtodMenuAnnExpired"),i}(i,t.getAvailableActions()),authenticator:t}});n.promiseMenuInput(u,n.resolveString("configMenu.title"),n.resolveString("configMenu.instructions"),this.clientContext,null,!0).then(function(t){if(!t.abortSelection){var u;switch(t.action){case r.SetDefault:u=i.authentiocationConfigurationSessionServices.setDefaultAuthenticator(t.authenticator);break;case r.Register:u=i.authentiocationConfigurationSessionServices.registerAuthenticator(t.authenticator,i.clientContext).then(function(){i.authentiocationConfigurationSessionServices.setDefaultAuthenticator(t.authenticator)});break;case r.Reregister:u=i.authentiocationConfigurationSessionServices.reregisterAuthenticator(t.authenticator,i.clientContext).then(function(){i.authentiocationConfigurationSessionServices.setDefaultAuthenticator(t.authenticator)});break;case r.Unregister:u=s.default(i.common.resolveString("unregister.confirmation.title"),i.common.resolveString("unregister.confirmation.instructions").replace("$method",i.common.resolveMethodTitle(t.authenticator.getDescription())),i.common.resolveString("unregister.confirmation.continue"),i.common.resolveString("unregister.confirmation.cancel"),i.actionContext,i.clientContext,n).then(function(n){return 0===n.getUserChoice()?i.authentiocationConfigurationSessionServices.unregisterAuthenticator(t.authenticator,i.clientContext):Promise.resolve(!0)})}return u.then(function(){n.clearContainer(i.clientContext);i.authentiocationConfigurationSessionServices.requestRefreshAuthenticators()})}i.authentiocationConfigurationSessionServices.finishSession()}).catch(function(t){h.default(i.common.resolveString("configMenu.error.title"),t.getMessage(),i.common.resolveString("configMenu.error.continue"),i.actionContext,i.clientContext,n).then(function(n){-1===n.getUserChoice()&&(t.getErrorCode()==com.ts.mobile.sdk.AuthenticationErrorCode.PolicyRejection?(i.authentiocationConfigurationSessionServices.finishSession(),window.location.reload()):i.authentiocationConfigurationSessionServices.requestRefreshAuthenticators())})})}},{key:"startSession",value:function(n,t,i){this.authentiocationConfigurationSessionServices=n;this.actionContext=t;this.clientContext=i;console.log("Starting configuration session")}},{key:"endSession",value:function(){console.log("Ending configuration session")}}]),t}())(this)}}],[{key:"getContainer",value:function(n){var t;return n&&n.uiContainer?t=n.uiContainer:$("#transmitContainer").length?t=$("#transmitContainer").first():$(document.documentElement).append($('<div id="transmitContainer" style="position: absolute; left: 0; top: 0;"><\/div>')),(t=$(t)).attr("aria-live","assertive"),t}}]),n}();t.XmUiCommon=c,function(n){n[n.SetDefault=0]="SetDefault";n[n.Register=1]="Register";n[n.Reregister=2]="Reregister";n[n.Unregister=3]="Unregister"}(r||(r={}))}])})