/*! For license information please see 2.18ead362.chunk.js.LICENSE.txt */ (this["webpackJsonpjira-app"]=this["webpackJsonpjira-app"]||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(452)},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return i})),n.d(t,"__assign",(function(){return o})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return s})),n.d(t,"__param",(function(){return u})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return f})),n.d(t,"__createBinding",(function(){return h})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return p})),n.d(t,"__read",(function(){return m})),n.d(t,"__spread",(function(){return g})),n.d(t,"__spreadArrays",(function(){return v})),n.d(t,"__await",(function(){return y})),n.d(t,"__asyncGenerator",(function(){return b})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return S})),n.d(t,"__makeTemplateObject",(function(){return _})),n.d(t,"__importStar",(function(){return E})),n.d(t,"__importDefault",(function(){return M})),n.d(t,"__classPrivateFieldGet",(function(){return x})),n.d(t,"__classPrivateFieldSet",(function(){return k}));var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function f(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function g(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof y?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function S(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function M(e){return e&&e.__esModule?e:{default:e}}function x(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function k(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return f})),n.d(t,"d",(function(){return m})),n.d(t,"c",(function(){return g}));var r=n(1),i=function e(){var t=[],n=[],i=new Set,s=function(e){return t.forEach((function(t){e.add(t.middleware,Object(r.__assign)({},t))})),n.forEach((function(t){e.addRelativeTo(t.middleware,Object(r.__assign)({},t))})),e},u=function e(t){var n=[];return t.before.forEach((function(t){0===t.before.length&&0===t.after.length?n.push(t):n.push.apply(n,Object(r.__spread)(e(t)))})),n.push(t),t.after.reverse().forEach((function(t){0===t.before.length&&0===t.after.length?n.push(t):n.push.apply(n,Object(r.__spread)(e(t)))})),n},c=function(){var e,i=[],s=[],c={};return t.forEach((function(e){var t=Object(r.__assign)(Object(r.__assign)({},e),{before:[],after:[]});t.name&&(c[t.name]=t),i.push(t)})),n.forEach((function(e){var t=Object(r.__assign)(Object(r.__assign)({},e),{before:[],after:[]});t.name&&(c[t.name]=t),s.push(t)})),s.forEach((function(e){if(e.toMiddleware){var t=c[e.toMiddleware];if(void 0===t)throw new Error(e.toMiddleware+" is not found when adding "+(e.name||"anonymous")+" middleware "+e.relation+" "+e.toMiddleware);"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(e=i,e.sort((function(e,t){return o[t.step]-o[e.step]||a[t.priority||"normal"]-a[e.priority||"normal"]}))).map(u).reduce((function(e,t){return e.push.apply(e,Object(r.__spread)(t)),e}),[]).map((function(e){return e.middleware}))},l={add:function(e,n){void 0===n&&(n={});var o=n.name,a=n.override,s=Object(r.__assign)({step:"initialize",priority:"normal",middleware:e},n);if(o){if(i.has(o)){if(!a)throw new Error("Duplicate middleware name '"+o+"'");var u=t.findIndex((function(e){return e.name===o})),c=t[u];if(c.step!==s.step||c.priority!==s.priority)throw new Error('"'+o+'" middleware with '+c.priority+" priority in "+c.step+" step cannot be overridden by same-name middleware with "+s.priority+" priority in "+s.step+" step.");t.splice(u,1)}i.add(o)}t.push(s)},addRelativeTo:function(e,t){var o=t.name,a=t.override,s=Object(r.__assign)({middleware:e},t);if(o){if(i.has(o)){if(!a)throw new Error("Duplicate middleware name '"+o+"'");var u=n.findIndex((function(e){return e.name===o})),c=n[u];if(c.toMiddleware!==s.toMiddleware||c.relation!==s.relation)throw new Error('"'+o+'" middleware '+c.relation+' "'+c.toMiddleware+'" middleware cannot be overridden by same-name middleware '+s.relation+' "'+s.toMiddleware+'" middleware.');n.splice(u,1)}i.add(o)}n.push(s)},clone:function(){return s(e())},use:function(e){e.applyToStack(l)},remove:function(e){return"string"===typeof e?function(e){var r=!1,o=function(t){return!t.name||t.name!==e||(r=!0,i.delete(e),!1)};return t=t.filter(o),n=n.filter(o),r}(e):function(e){var r=!1,o=function(t){return t.middleware!==e||(r=!0,t.name&&i.delete(t.name),!1)};return t=t.filter(o),n=n.filter(o),r}(e)},removeByTag:function(e){var r=!1,o=function(t){var n=t.tags,o=t.name;return!n||!n.includes(e)||(o&&i.delete(o),r=!0,!1)};return t=t.filter(o),n=n.filter(o),r},concat:function(t){var n=s(e());return n.use(t),n},applyToStack:s,resolve:function(e,t){var n,i;try{for(var o=Object(r.__values)(c().reverse()),a=o.next();!a.done;a=o.next()){e=(0,a.value)(e,t)}}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e}};return l},o={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},a={high:3,normal:2,low:1},s=function(){function e(e){this.middlewareStack=i(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!==typeof t?t:void 0,i="function"===typeof t?t:n,o=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!i)return o(e).then((function(e){return e.output}));o(e).then((function(e){return i(null,e.output)}),(function(e){return i(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),u=function(){this.middlewareStack=i()};function c(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}var l=function(e){return Array.isArray(e)?e:[e]},f=function e(t){for(var n in t)t.hasOwnProperty(n)&&void 0!==t[n]["#text"]?t[n]=t[n]["#text"]:"object"===typeof t[n]&&null!==t[n]&&(t[n]=e(t[n]));return t},h=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,Object(r.__spread)([null],arguments)),n=new t;return Object.setPrototypeOf(n,e.prototype),n};h.prototype=Object.create(String.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(h,String);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Object(r.__extends)(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"===typeof e?e:JSON.stringify(e))}}(h);var d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(e){var t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),i=e.getUTCDate(),o=e.getUTCHours(),a=e.getUTCMinutes(),s=e.getUTCSeconds();return d[r]+", "+(i<10?"0"+i:""+i)+" "+p[n]+" "+t+" "+(o<10?"0"+o:""+o)+":"+(a<10?"0"+a:""+a)+":"+(s<10?"0"+s:""+s)+" GMT"}var g="***SensitiveInformation***"},function(e,t,n){"use strict";e.exports=n(458)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t0?1:-1},p=function(e){return h()(e)&&e.indexOf("%")===e.length-1},m=function(e){return l()(e)&&!u()(e)},g=function(e){return m(e)||h()(e)},v=0,y=function(e){var t=++v;return"".concat(e||"").concat(t)},b=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!m(e)&&!h()(e))return r;if(p(e)){var o=e.indexOf("%");n=t*parseFloat(e.slice(0,o))/100}else n=+e;return u()(n)&&(n=r),i&&n>t&&(n=t),n},w=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},S=function(e){if(!a()(e))return!1;for(var t=e.length,n={},r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t,n){"use strict";function r(e){var t,n,i="";if("string"===typeof e||"number"===typeof e)i+=e;else if("object"===typeof e)if(Array.isArray(e))for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=t.defaultTheme,s=t.withTheme,h=void 0!==s&&s,d=t.name,p=Object(i.a)(t,["defaultTheme","withTheme","name"]);var m=d,g=Object(c.a)(e,Object(r.a)({defaultTheme:o,Component:n,name:d||n.displayName,classNamePrefix:m},p)),v=a.a.forwardRef((function(e,t){e.classes;var s,u=e.innerRef,c=Object(i.a)(e,["classes","innerRef"]),p=g(Object(r.a)({},n.defaultProps,e)),m=c;return("string"===typeof d||h)&&(s=Object(f.a)()||o,d&&(m=Object(l.a)({theme:s,name:d,props:c})),h&&!m.theme&&(m.theme=s)),a.a.createElement(n,Object(r.a)({ref:u||t,classes:p},m))}));return u()(v,n),v}},d=n(93);t.a=function(e,t){return h(e,Object(r.a)({defaultTheme:d.a},t))}},function(e,t){e.exports=function(e){return null==e}},function(e,t,n){"use strict";n.d(t,"t",(function(){return ye})),n.d(t,"j",(function(){return be})),n.d(t,"b",(function(){return we})),n.d(t,"n",(function(){return Se})),n.d(t,"m",(function(){return _e})),n.d(t,"g",(function(){return Ee})),n.d(t,"f",(function(){return Me})),n.d(t,"a",(function(){return xe})),n.d(t,"w",(function(){return Oe})),n.d(t,"k",(function(){return Ce})),n.d(t,"u",(function(){return Ae})),n.d(t,"i",(function(){return Te})),n.d(t,"q",(function(){return Ie})),n.d(t,"d",(function(){return Pe})),n.d(t,"x",(function(){return Re})),n.d(t,"c",(function(){return Ne})),n.d(t,"o",(function(){return Ue})),n.d(t,"r",(function(){return Be})),n.d(t,"h",(function(){return Fe})),n.d(t,"p",(function(){return ze})),n.d(t,"l",(function(){return qe})),n.d(t,"y",(function(){return We})),n.d(t,"e",(function(){return Ke})),n.d(t,"v",(function(){return Ge})),n.d(t,"s",(function(){return $e}));var r=n(192),i=n.n(r),o=n(120),a=n.n(o),s=n(129),u=n.n(s),c=n(104),l=n.n(c),f=n(94),h=n.n(f),d=n(21),p=n.n(d),m=n(163),g=n.n(m),v=n(164),y=n.n(v),b=n(395),w=n.n(b),S=n(13),_=n.n(S),E=n(38),M=n.n(E),x=n(10),k=n.n(x),O=n(24),C=n.n(O);function A(e){return function(e){if(Array.isArray(e))return T(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return T(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,i):e(t-a,j((function(){for(var e=arguments.length,t=new Array(e),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);nr&&(i=r,o=n),[i,o]}function $(e,t,n){if(e.lte(0))return new C.a(0);var r=q.getDigitCount(e.toNumber()),i=new C.a(10).pow(r),o=e.div(i),a=1!==r?.05:.1,s=new C.a(Math.ceil(o.div(a).toNumber())).add(n).mul(a).mul(i);return t?s:new C.a(Math.ceil(s))}function Y(e,t,n){var r=1,i=new C.a(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new C.a(10).pow(q.getDigitCount(e)-1),i=new C.a(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new C.a(Math.floor(e)))}else 0===e?i=new C.a(Math.floor((t-1)/2)):n||(i=new C.a(Math.floor(e)));var a=Math.floor((t-1)/2);return B(U((function(e){return i.add(new C.a(e-a).mul(r)).toNumber()})),D)(0,t)}function X(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new C.a(0),tickMin:new C.a(0),tickMax:new C.a(0)};var o,a=$(new C.a(t).sub(e).div(n-1),r,i);o=e<=0&&t>=0?new C.a(0):(o=new C.a(e).add(t).div(2)).sub(new C.a(o).mod(a));var s=Math.ceil(o.sub(e).div(a).toNumber()),u=Math.ceil(new C.a(t).sub(o).div(a).toNumber()),c=s+u+1;return c>n?X(e,t,n,r,i+1):(c0?u+(n-c):u,s=t>0?s:s+(n-c)),{step:a,tickMin:o.sub(new C.a(s).mul(a)),tickMax:o.add(new C.a(u).mul(a))})}var Z=z((function(e){var t=V(e,2),n=t[0],r=t[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=Math.max(i,2),s=G([n,r]),u=V(s,2),c=u[0],l=u[1];if(c===-1/0||l===1/0){var f=l===1/0?[c].concat(H(D(0,i-1).map((function(){return 1/0})))):[].concat(H(D(0,i-1).map((function(){return-1/0}))),[l]);return n>r?F(f):f}if(c===l)return Y(c,i,o);var h=X(c,l,a,o),d=h.step,p=h.tickMin,m=h.tickMax,g=q.rangeStep(p,m.add(new C.a(.1).mul(d)),d);return n>r?F(g):g})),J=(z((function(e){var t=V(e,2),n=t[0],r=t[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=Math.max(i,2),s=G([n,r]),u=V(s,2),c=u[0],l=u[1];if(c===-1/0||l===1/0)return[n,r];if(c===l)return Y(c,i,o);var f=$(new C.a(l).sub(c).div(a-1),o,0),h=B(U((function(e){return new C.a(c).add(new C.a(e).mul(f)).toNumber()})),D),d=h(0,a).filter((function(e){return e>=c&&e<=l}));return n>r?F(d):d})),z((function(e,t){var n=V(e,2),r=n[0],i=n[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=G([r,i]),s=V(a,2),u=s[0],c=s[1];if(u===-1/0||c===1/0)return[r,i];if(u===c)return[u];var l=Math.max(t,2),f=$(new C.a(c).sub(u).div(l-1),o,0),h=[].concat(H(q.rangeStep(new C.a(u),new C.a(c).sub(new C.a(.99).mul(f)),f)),[c]);return r>i?F(h):h}))),Q=n(258),ee=n(44),te=n(207),ne=function(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o=0;)n[t]=t;return n};function se(e,t){return e[t]}function ue(e){var t=[];return t.key=e,t}var ce=n(5),le=n(161),fe=n(22),he=n(12);function de(e){return function(e){if(Array.isArray(e))return pe(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,a=null!==(t=null===n||void 0===n?void 0:n.length)&&void 0!==t?t:0;if(a>1){if(i&&"angleAxis"===i.axisType&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var s=i.range,u=0;u0?r[u-1].coordinate:r[a-1].coordinate,l=r[u].coordinate,f=u>=a-1?r[0].coordinate:r[u+1].coordinate,h=void 0;if(Object(ce.i)(l-c)!==Object(ce.i)(f-l)){var d=[];if(Object(ce.i)(f-l)===Object(ce.i)(s[1]-s[0])){h=f;var p=l+s[1]-s[0];d[0]=Math.min(p,(p+c)/2),d[1]=Math.max(p,(p+c)/2)}else{h=c;var m=f+s[1]-s[0];d[0]=Math.min(l,(m+l)/2),d[1]=Math.max(l,(m+l)/2)}var g=[Math.min(l,(h+l)/2),Math.max(l,(h+l)/2)];if(e>g[0]&&e<=g[1]||e>=d[0]&&e<=d[1]){o=r[u].index;break}}else{var v=Math.min(c,f),y=Math.max(c,f);if(e>(v+l)/2&&e<=(y+l)/2){o=r[u].index;break}}}else for(var b=0;b0&&b(n[b].coordinate+n[b-1].coordinate)/2&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b===a-1&&e>(n[b].coordinate+n[b-1].coordinate)/2){o=n[b].index;break}}else o=0;return o},Se=function(e){var t,n=e.type.displayName,r=e.props,i=r.stroke,o=r.fill;switch(n){case"Line":t=i;break;case"Area":case"Radar":t=i&&"none"!==i?i:o;break;default:t=o}return t},_e=function(e){var t,n=e.children,r=e.formatedGraphicalItems,i=e.legendWidth,o=e.legendContent,a=Object(fe.b)(n,le.a.displayName);return a?(t=a.props&&a.props.payload?a.props&&a.props.payload:"children"===o?(r||[]).reduce((function(e,t){var n=t.item,r=t.props,i=r.sectors||r.data||[];return e.concat(i.map((function(e){return{type:a.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}})))}),[]):(r||[]).map((function(e){var t=e.item,n=t.props,r=n.dataKey,i=n.name,o=n.legendType;return{inactive:n.hide,dataKey:r,type:a.props.iconType||o||"square",color:Se(t),value:i||r,payload:t.props}})),ge(ge(ge({},a.props),le.a.getWithHeight(a,i)),{},{payload:t,item:a})):null},Ee=function(e){var t=e.barSize,n=e.stackGroups,r=void 0===n?{}:n;if(!r)return{};for(var i={},o=Object.keys(r),a=0,s=o.length;a=0}));if(m&&m.length){var g=m[0].props.barSize,v=m[0].props[p];i[v]||(i[v]=[]),i[v].push({item:m[0],stackList:m.slice(1),barSize:k()(g)?t:g})}}return i},Me=function(e){var t=e.barGap,n=e.barCategoryGap,r=e.bandSize,i=e.sizeList,o=void 0===i?[]:i,a=e.maxBarSize,s=o.length;if(s<1)return null;var u,c=Object(ce.c)(t,r,0,!0);if(o[0].barSize===+o[0].barSize){var l=!1,f=r/s,h=o.reduce((function(e,t){return e+t.barSize||0}),0);(h+=(s-1)*c)>=r&&(h-=(s-1)*c,c=0),h>=r&&f>0&&(l=!0,h=s*(f*=.9));var d={offset:((r-h)/2>>0)-c,size:0};u=o.reduce((function(e,t){var n=[].concat(de(e),[{item:t.item,position:{offset:d.offset+d.size+c,size:l?f:t.barSize}}]);return d=n[n.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:d})})),n}),[])}else{var p=Object(ce.c)(n,r,0,!0);r-2*p-(s-1)*c<=0&&(c=0);var m=(r-2*p-(s-1)*c)/s;m>1&&(m>>=0);var g=a===+a?Math.min(m,a):m;u=o.reduce((function(e,t,n){var r=[].concat(de(e),[{item:t.item,position:{offset:p+(m+c)*n+(m-g)/2,size:g}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){r.push({item:e,position:r[r.length-1].position})})),r}),[])}return u},xe=function(e,t,n,r){var i=n.children,o=n.width,a=n.margin,s=o-(a.left||0)-(a.right||0),u=_e({children:i,legendWidth:s}),c=e;if(u){var l=r||{},f=u.align,h=u.verticalAlign,d=u.layout;("vertical"===d||"horizontal"===d&&"center"===h)&&Object(ce.g)(e[f])&&(c=ge(ge({},e),{},ve({},f,c[f]+(l.width||0)))),("horizontal"===d||"vertical"===d&&"center"===f)&&Object(ce.g)(e[h])&&(c=ge(ge({},e),{},ve({},h,c[h]+(l.height||0))))}return c},ke=function(e,t,n,r){var i=t.props.children,o=Object(fe.a)(i,"ErrorBar").filter((function(e){var t=e.props.direction;return!(!k()(t)&&!k()(r))||r.indexOf(t)>=0}));if(o&&o.length){var a=o.map((function(e){return e.props.dataKey}));return e.reduce((function(e,t){var r=ye(t,n,0),i=p()(r)?[y()(r),g()(r)]:[r,r],o=a.reduce((function(e,n){var r=ye(t,n,0),o=i[0]-Math.abs(p()(r)?r[0]:r),a=i[1]+Math.abs(p()(r)?r[1]:r);return[Math.min(o,e[0]),Math.max(a,e[1])]}),[1/0,-1/0]);return[Math.min(o[0],e[0]),Math.max(o[1],e[1])]}),[1/0,-1/0])}return null},Oe=function(e,t,n,r){var i=t.map((function(t){return ke(e,t,n,r)})).filter((function(e){return!k()(e)}));return i&&i.length?i.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]):null},Ce=function(e,t,n,r){var i=t.map((function(t){var i=t.props.dataKey;return"number"===n&&i&&ke(e,t,i)||be(e,i,n,r)}));if("number"===n)return i.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]);var o={};return i.reduce((function(e,t){for(var n=0,r=t.length;n=0||t.indexOf("AreaChart")>=0||t.indexOf("ComposedChart")>=0&&!n)?{scale:Q.b(),realScaleType:"point"}:"category"===i?{scale:Q.a(),realScaleType:"band"}:{scale:ee.a(),realScaleType:"linear"};if(h()(r)){var s="scale".concat(l()(r));return{scale:(te[s]||Q.b)(),realScaleType:te[s]?s:"point"}}return _()(r)?{scale:r}:{scale:Q.b(),realScaleType:"point"}},je=1e-4,Ne=function(e){var t=e.domain();if(t&&!(t.length<=2)){var n=t.length,r=e.range(),i=Math.min(r[0],r[1])-je,o=Math.max(r[0],r[1])+je,a=e(t[0]),s=e(t[n-1]);(ao||so)&&e.domain([t[0],t[n-1]])}},Le={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n=0?(e[a][n][0]=i,e[a][n][1]=i+s,i=e[a][n][1]):(e[a][n][0]=o,e[a][n][1]=o+s,o=e[a][n][1])}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o0){for(var n,r=0,i=e[t[0]],o=i.length;r0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a=0?(e[o][n][0]=i,e[o][n][1]=i+a,i=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}}},De=function(e,t,n){var r=t.map((function(e){return e.props.dataKey}));return function(){var e=Object(oe.a)([]),t=ae,n=ne,r=se;function i(i){var o,a,s,u=Array.from(e.apply(this,arguments),ue),c=u.length,l=-1,f=Object(re.a)(i);try{for(f.s();!(s=f.n()).done;){var h=s.value;for(o=0,++l;o=0?r.stackedData[i]:null}}return null},qe=function(e,t,n){return Object.keys(e).reduce((function(r,i){var o=e[i].stackedData.reduce((function(e,r){var i=r.slice(t,n+1).reduce((function(e,t){return[y()(t.concat([e[0]]).filter(ce.g)),g()(t.concat([e[1]]).filter(ce.g))]}),[1/0,-1/0]);return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]}),[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]}),[1/0,-1/0]).map((function(e){return e===1/0||e===-1/0?0:e}))},He=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ve=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,We=function(e,t,n){if(!p()(e))return t;var r=[];if(Object(ce.g)(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(He.test(e[0])){var i=+He.exec(e[0])[1];r[0]=t[0]-i}else _()(e[0])?r[0]=e[0](t[0]):r[0]=t[0];if(Object(ce.g)(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(Ve.test(e[1])){var o=+Ve.exec(e[1])[1];r[1]=t[1]+o}else _()(e[1])?r[1]=e[1](t[1]):r[1]=t[1];return r},Ke=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=a()(t,(function(e){return e.coordinate})),o=1/0,s=1,u=i.length;s=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"===typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function x(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128===(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return S(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function j(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function L(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,o){return o||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,o){return o||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(36))},function(e,t){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){e.exports=n(459)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(421);function i(e){if("string"!==typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){var r=n(16),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";n.d(t,"c",(function(){return w})),n.d(t,"a",(function(){return S})),n.d(t,"b",(function(){return _})),n.d(t,"h",(function(){return E})),n.d(t,"e",(function(){return k})),n.d(t,"g",(function(){return C})),n.d(t,"d",(function(){return A})),n.d(t,"f",(function(){return T}));var r=n(396),i=n.n(r),o=n(10),a=n.n(o),s=n(94),u=n.n(s),c=n(38),l=n.n(c),f=n(21),h=n.n(f),d=n(0),p=n.n(d),m=n(397),g=n(5),v=n(95);function y(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var b={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},w=function(e){return"string"===typeof e?e:e?e.displayName||e.name||"Component":""},S=function e(t,n){var r=[],i=[];return i=h()(n)?n.map((function(e){return w(e)})):[w(n)],p.a.Children.forEach(t,(function(t){Object(m.isFragment)(t)&&(r=r.concat(e(t.props.children,n)));var o=l()(t,"type.displayName")||l()(t,"type.name");-1!==i.indexOf(o)&&r.push(t)})),r},_=function(e,t){var n=S(e,t);return n&&n[0]},E=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!(!Object(g.g)(n)||n<=0||!Object(g.g)(r)||r<=0)},M=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],x=function(e){return e&&e.type&&u()(e.type)&&M.indexOf(e.type)>=0},k=function e(t,n){if(t===n)return!0;if(d.Children.count(t)!==d.Children.count(n))return!1;var r=d.Children.count(t);if(0===r)return!0;if(1===r)return O(h()(t)?t[0]:t,h()(n)?n[0]:n);for(var i=0;i(s=(a=Math.ceil(h/7))>s?a+1:s+1)&&(o=s,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for((s=c.length)-(o=l.length)<0&&(o=s,r=l,l=c,c=r),n=0;o;)n=(c[--o]=c[o]+l[o]+n)/m|0,c[o]%=m;for(n&&(c.unshift(n),++i),s=c.length;0==c[--s];)c.pop();return t.d=c,t.e=i,u?A(t,h):t}function w(e,t,n){if(e!==~~e||en)throw Error(l+e)}function S(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;te.e^o.s<0?1:-1;for(t=0,n=(r=o.d.length)<(i=e.d.length)?r:i;te.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1},y.decimalPlaces=y.dp=function(){var e=this,t=e.d.length-1,n=7*(t-e.e);if(t=e.d[t])for(;t%10==0;t/=10)n--;return n<0?0:n},y.dividedBy=y.div=function(e){return _(this,new this.constructor(e))},y.dividedToIntegerBy=y.idiv=function(e){var t=this.constructor;return A(_(this,new t(e),0,1),t.precision)},y.equals=y.eq=function(e){return!this.cmp(e)},y.exponent=function(){return M(this)},y.greaterThan=y.gt=function(e){return this.cmp(e)>0},y.greaterThanOrEqualTo=y.gte=function(e){return this.cmp(e)>=0},y.isInteger=y.isint=function(){return this.e>this.d.length-2},y.isNegative=y.isneg=function(){return this.s<0},y.isPositive=y.ispos=function(){return this.s>0},y.isZero=function(){return 0===this.s},y.lessThan=y.lt=function(e){return this.cmp(e)<0},y.lessThanOrEqualTo=y.lte=function(e){return this.cmp(e)<1},y.logarithm=y.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(void 0===e)e=new r(10);else if((e=new r(e)).s<1||e.eq(o))throw Error(c+"NaN");if(n.s<1)throw Error(c+(n.s?"NaN":"-Infinity"));return n.eq(o)?new r(0):(u=!1,t=_(O(n,a),O(e,a),a),u=!0,A(t,i))},y.minus=y.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?T(t,e):b(t,(e.s=-e.s,e))},y.modulo=y.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(!(e=new r(e)).s)throw Error(c+"NaN");return n.s?(u=!1,t=_(n,e,0,1).times(e),u=!0,n.minus(t)):A(new r(n),i)},y.naturalExponential=y.exp=function(){return E(this)},y.naturalLogarithm=y.ln=function(){return O(this)},y.negated=y.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},y.plus=y.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?b(t,e):T(t,(e.s=-e.s,e))},y.precision=y.sd=function(e){var t,n,r,i=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(l+e);if(t=M(i)+1,n=7*(r=i.d.length-1)+1,r=i.d[r]){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},y.squareRoot=y.sqrt=function(){var e,t,n,r,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(c+"NaN")}for(e=M(s),u=!1,0==(i=Math.sqrt(+s))||i==1/0?(((t=S(s.d)).length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=h((e+1)/2)-(e<0||e%2),r=new l(t=i==1/0?"5e"+e:(t=i.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new l(i.toString()),i=a=(n=l.precision)+3;;)if(r=(o=r).plus(_(s,o,a+2)).times(.5),S(o.d).slice(0,a)===(t=S(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&"4999"==t){if(A(o,n+1,0),o.times(o).eq(s)){r=o;break}}else if("9999"!=t)break;a+=4}return u=!0,A(r,n)},y.times=y.mul=function(e){var t,n,r,i,o,a,s,c,l,f=this,h=f.constructor,d=f.d,p=(e=new h(e)).d;if(!f.s||!e.s)return new h(0);for(e.s*=f.s,n=f.e+e.e,(c=d.length)<(l=p.length)&&(o=d,d=p,p=o,a=c,c=l,l=a),o=[],r=a=c+l;r--;)o.push(0);for(r=l;--r>=0;){for(t=0,i=c+r;i>r;)s=o[i]+p[r]*d[i-r-1]+t,o[i--]=s%m|0,t=s/m|0;o[i]=(o[i]+t)%m|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,u?A(e,h.precision):e},y.toDecimalPlaces=y.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(w(e,0,a),void 0===t?t=r.rounding:w(t,0,8),A(n,e+M(n)+1,t))},y.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=I(r,!0):(w(e,0,a),void 0===t?t=i.rounding:w(t,0,8),n=I(r=A(new i(r),e+1,t),!0,e+1)),n},y.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?I(i):(w(e,0,a),void 0===t?t=o.rounding:w(t,0,8),n=I((r=A(new o(i),e+M(i)+1,t)).abs(),!1,e+M(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)},y.toInteger=y.toint=function(){var e=this,t=e.constructor;return A(new t(e),M(e)+1,t.rounding)},y.toNumber=function(){return+this},y.toPower=y.pow=function(e){var t,n,r,i,a,s,l=this,f=l.constructor,d=+(e=new f(e));if(!e.s)return new f(o);if(!(l=new f(l)).s){if(e.s<1)throw Error(c+"Infinity");return l}if(l.eq(o))return l;if(r=f.precision,e.eq(o))return A(l,r);if(s=(t=e.e)>=(n=e.d.length-1),a=l.s,s){if((n=d<0?-d:d)<=g){for(i=new f(o),t=Math.ceil(r/7+4),u=!1;n%2&&P((i=i.times(l)).d,t),0!==(n=h(n/2));)P((l=l.times(l)).d,t);return u=!0,e.s<0?new f(o).div(i):A(i,r)}}else if(a<0)throw Error(c+"NaN");return a=a<0&&1&e.d[Math.max(t,n)]?-1:1,l.s=1,u=!1,i=e.times(O(l,r+12)),u=!0,(i=E(i)).s=a,i},y.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?r=I(i,(n=M(i))<=o.toExpNeg||n>=o.toExpPos):(w(e,1,a),void 0===t?t=o.rounding:w(t,0,8),r=I(i=A(new o(i),e,t),e<=(n=M(i))||n<=o.toExpNeg,e)),r},y.toSignificantDigits=y.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(w(e,1,a),void 0===t?t=n.rounding:w(t,0,8)),A(new n(this),e,t)},y.toString=y.valueOf=y.val=y.toJSON=function(){var e=this,t=M(e),n=e.constructor;return I(e,t<=n.toExpNeg||t>=n.toExpPos)};var _=function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%m|0,r=n/m|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]1;)e.shift()}return function(r,i,o,a){var s,u,l,f,h,d,p,g,v,y,b,w,S,_,E,x,k,O,C=r.constructor,T=r.s==i.s?1:-1,I=r.d,P=i.d;if(!r.s)return new C(r);if(!i.s)throw Error(c+"Division by zero");for(u=r.e-i.e,k=P.length,E=I.length,g=(p=new C(T)).d=[],l=0;P[l]==(I[l]||0);)++l;if(P[l]>(I[l]||0)&&--u,(w=null==o?o=C.precision:a?o+(M(r)-M(i))+1:o)<0)return new C(0);if(w=w/7+2|0,l=0,1==k)for(f=0,P=P[0],w++;(l1&&(P=e(P,f),I=e(I,f),k=P.length,E=I.length),_=k,y=(v=I.slice(0,k)).length;y=m/2&&++x;do{f=0,(s=t(P,v,k,y))<0?(b=v[0],k!=y&&(b=b*m+(v[1]||0)),(f=b/x|0)>1?(f>=m&&(f=m-1),1==(s=t(h=e(P,f),v,d=h.length,y=v.length))&&(f--,n(h,k16)throw Error(f+M(e));if(!e.s)return new h(o);for(null==t?(u=!1,s=p):s=t,a=new h(.03125);e.abs().gte(.1);)e=e.times(a),l+=5;for(s+=Math.log(d(2,l))/Math.LN10*2+5|0,n=r=i=new h(o),h.precision=s;;){if(r=A(r.times(e),s),n=n.times(++c),S((a=i.plus(_(r,n,s))).d).slice(0,s)===S(i.d).slice(0,s)){for(;l--;)i=A(i.times(i),s);return h.precision=p,null==t?(u=!0,A(i,p)):i}i=a}}function M(e){for(var t=7*e.e,n=e.d[0];n>=10;n/=10)t++;return t}function x(e,t,n){if(t>e.LN10.sd())throw u=!0,n&&(e.precision=n),Error(c+"LN10 precision limit exceeded");return A(new e(e.LN10),t)}function k(e){for(var t="";e--;)t+="0";return t}function O(e,t){var n,r,i,a,s,l,f,h,d,p=1,m=e,g=m.d,v=m.constructor,y=v.precision;if(m.s<1)throw Error(c+(m.s?"NaN":"-Infinity"));if(m.eq(o))return new v(0);if(null==t?(u=!1,h=y):h=t,m.eq(10))return null==t&&(u=!0),x(v,h);if(h+=10,v.precision=h,r=(n=S(g)).charAt(0),a=M(m),!(Math.abs(a)<15e14))return f=x(v,h+2,y).times(a+""),m=O(new v(r+"."+n.slice(1)),h-10).plus(f),v.precision=y,null==t?(u=!0,A(m,y)):m;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=S((m=m.times(e)).d)).charAt(0),p++;for(a=M(m),r>1?(m=new v("0."+n),a++):m=new v(r+"."+n.slice(1)),l=s=m=_(m.minus(o),m.plus(o),h),d=A(m.times(m),h),i=3;;){if(s=A(s.times(d),h),S((f=l.plus(_(s,new v(i),h))).d).slice(0,h)===S(l.d).slice(0,h))return l=l.times(2),0!==a&&(l=l.plus(x(v,h+2,y).times(a+""))),l=_(l,new v(p),h),v.precision=y,null==t?(u=!0,A(l,y)):l;l=f,i+=2}}function C(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(i=t.length;48===t.charCodeAt(i-1);)--i;if(t=t.slice(r,i)){if(i-=r,n=n-r-1,e.e=h(n/7),e.d=[],r=(n+1)%7,n<0&&(r+=7),rv||e.e<-v))throw Error(f+n)}else e.s=0,e.e=0,e.d=[0];return e}function A(e,t,n){var r,i,o,a,s,c,l,p,g=e.d;for(a=1,o=g[0];o>=10;o/=10)a++;if((r=t-a)<0)r+=7,i=t,l=g[p=0];else{if((p=Math.ceil((r+1)/7))>=(o=g.length))return e;for(l=o=g[p],a=1;o>=10;o/=10)a++;i=(r%=7)-7+a}if(void 0!==n&&(s=l/(o=d(10,a-i-1))%10|0,c=t<0||void 0!==g[p+1]||l%o,c=n<4?(s||c)&&(0==n||n==(e.s<0?3:2)):s>5||5==s&&(4==n||c||6==n&&(r>0?i>0?l/d(10,a-i):0:g[p-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return c?(o=M(e),g.length=1,t=t-o-1,g[0]=d(10,(7-t%7)%7),e.e=h(-t/7)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(0==r?(g.length=p,o=1,p--):(g.length=p+1,o=d(10,7-r),g[p]=i>0?(l/d(10,a-i)%d(10,i)|0)*o:0),c)for(;;){if(0==p){(g[0]+=o)==m&&(g[0]=1,++e.e);break}if(g[p]+=o,g[p]!=m)break;g[p--]=0,o=1}for(r=g.length;0===g[--r];)g.pop();if(u&&(e.e>v||e.e<-v))throw Error(f+M(e));return e}function T(e,t){var n,r,i,o,a,s,c,l,f,h,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),u?A(t,p):t;if(c=e.d,h=t.d,r=t.e,l=e.e,c=c.slice(),a=l-r){for((f=a<0)?(n=c,a=-a,s=h.length):(n=h,r=l,s=c.length),a>(i=Math.max(Math.ceil(p/7),s)+2)&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for((f=(i=c.length)<(s=h.length))&&(s=i),i=0;i0;--i)c[s++]=0;for(i=h.length;i>a;){if(c[--i]0?o=o.charAt(0)+"."+o.slice(1)+k(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+k(-i-1)+o,n&&(r=n-a)>0&&(o+=k(r))):i>=a?(o+=k(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+k(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=k(r))),e.s<0?"-"+o:o}function P(e,t){if(e.length>t)return e.length=t,!0}function R(e){if(!e||"object"!==typeof e)throw Error(c+"Object expected");var t,n,r,i=["precision",1,a,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t=i[t+1]&&r<=i[t+2]))throw Error(l+n+": "+r);this[n]=r}if(void 0!==(r=e[n="LN10"])){if(r!=Math.LN10)throw Error(l+n+": "+r);this[n]=new this(r)}return this}(s=function e(t){var n,r,i;function o(e){var t=this;if(!(t instanceof o))return new o(e);if(t.constructor=o,e instanceof o)return t.s=e.s,t.e=e.e,void(t.d=(e=e.d)?e.slice():e);if("number"===typeof e){if(0*e!==0)throw Error(l+e);if(e>0)t.s=1;else{if(!(e<0))return t.s=0,t.e=0,void(t.d=[0]);e=-e,t.s=-1}return e===~~e&&e<1e7?(t.e=0,void(t.d=[e])):C(t,e.toString())}if("string"!==typeof e)throw Error(l+e);if(45===e.charCodeAt(0)?(e=e.slice(1),t.s=-1):t.s=1,!p.test(e))throw Error(l+e);C(t,e)}if(o.prototype=y,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=e,o.config=o.set=R,void 0===t&&(t={}),t)for(i=["precision","rounding","toExpNeg","toExpPos","LN10"],n=0;nt&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(p[0],p[e-1])),r=e>2?h:f,l=d=null,b}function b(t){return null==t||isNaN(t=+t)?n:(l||(l=r(p.map(e),m,g)))(e(v(t)))}return b.invert=function(n){return v(t((d||(d=r(m,p.map(e),o.a)))(n)))},b.domain=function(e){return arguments.length?(p=Array.from(e,s.a),y()):p.slice()},b.range=function(e){return arguments.length?(m=Array.from(e),y()):m.slice()},b.rangeRound=function(e){return m=Array.from(e),g=a.a,y()},b.clamp=function(e){return arguments.length?(v=!!e||c,y()):v!==c},b.interpolate=function(e){return arguments.length?(g=e,y()):g},b.unknown=function(e){return arguments.length?(n=e,b):n},function(n,r){return e=n,t=r,y()}}function m(){return p()(c,c)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i=n(69);function o(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){Object(i.a)(e,n),Object(i.a)(t,n)}}),[e,t])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(186);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(err){i=!0,o=err}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||Object(r.a)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return f}));var r=n(421);function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,e));var i=e.substring(t+1,e.length-1).split(",");return{type:n,values:i=i.map((function(e){return parseFloat(e)}))}}function a(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function s(e,t){var n=u(e),r=u(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function u(e){var t="hsl"===(e=o(e)).type?o(function(e){var t=(e=o(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,s=r*Math.min(i,1-i),u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",l=[Math.round(255*u(0)),Math.round(255*u(8)),Math.round(255*u(4))];return"hsla"===e.type&&(c+="a",l.push(t[3])),a({type:c,values:l})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function c(e,t){return e=o(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,a(e)}function l(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return a(e)}function f(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return a(e)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return u})),n.d(t,"b",(function(){return f}));n(10),n(5),n(11);function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;to&&(c=2*Math.PI-c),{radius:a,angle:s(c),angleInRadian:c}},l=function(e,t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),o=Math.floor(r/360);return e+360*Math.min(i,o)},f=function(e,t){var n=e.x,r=e.y,o=c({x:n,y:r},t),a=o.radius,s=o.angle,u=t.innerRadius,f=t.outerRadius;if(af)return!1;if(0===a)return!0;var h,d=function(e){var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),o=Math.min(r,i);return{startAngle:t-360*o,endAngle:n-360*o}}(t),p=d.startAngle,m=d.endAngle,g=s;if(p<=m){for(;g>m;)g-=360;for(;g=p&&g<=m}else{for(;g>p;)g-=360;for(;g=m&&g<=p}return h?i(i({},t),{},{radius:a,angle:l(g,t)}):null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(0),i=n.n(r),o=n(15),a=n.n(o),s=n(12);function u(){return(u=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e){var t=e.children,n=e.className,r=c(e,["children","className"]),o=a()("recharts-layer",n);return i.a.createElement("g",u({className:o},Object(s.c)(r,!0)),t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(1),i={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},o={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function a(e,t,n){return{applyToStack:function(a){a.add(function(e,t){return function(n,i){return function(i){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var o,a;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[4,n(i)];case 1:return o=r.sent().response,[4,t(o,e)];case 2:return a=r.sent(),[2,{response:o,output:a}]}}))}))}}}(e,n),i),a.add(function(e,t){return function(n,i){return function(i){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var o;return Object(r.__generator)(this,(function(a){switch(a.label){case 0:return[4,t(i.input,e)];case 1:return o=a.sent(),[2,n(Object(r.__assign)(Object(r.__assign)({},i),{request:o}))]}}))}))}}}(e,t),o)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m})),n.d(t,"c",(function(){return x})),n.d(t,"d",(function(){return p})),n.d(t,"e",(function(){return y}));var r=n(37),i=n(0),o=n.n(i),a=(n(745),n(59)),s=n(266),u=n(52),c=n(4),l=n(268),f=n.n(l),h=(n(751),n(47)),d=(n(119),function(e){var t=Object(s.a)();return t.displayName=e,t}("Router-History")),p=function(e){var t=Object(s.a)();return t.displayName=e,t}("Router"),m=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(r.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return o.a.createElement(p.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},o.a.createElement(d.Provider,{children:this.props.children||null,value:this.props.history}))},t}(o.a.Component);o.a.Component;o.a.Component;var g={},v=0;function y(e,t){void 0===t&&(t={}),("string"===typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,i=n.exact,o=void 0!==i&&i,a=n.strict,s=void 0!==a&&a,u=n.sensitive,c=void 0!==u&&u;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=g[n]||(g[n]={});if(r[e])return r[e];var i=[],o={regexp:f()(e,i,t),keys:i};return v<1e4&&(r[e]=o,v++),o}(n,{end:o,strict:s,sensitive:c}),i=r.regexp,a=r.keys,u=i.exec(e);if(!u)return null;var l=u[0],h=u.slice(1),d=e===l;return o&&!d?null:{path:n,url:"/"===n&&""===l?"/":l,isExact:d,params:a.reduce((function(e,t,n){return e[t.name]=h[n],e}),{})}}),null)}var b=function(e){function t(){return e.apply(this,arguments)||this}return Object(r.a)(t,e),t.prototype.render=function(){var e=this;return o.a.createElement(p.Consumer,null,(function(t){t||Object(u.a)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?y(n.pathname,e.props):t.match,i=Object(c.a)({},t,{location:n,match:r}),a=e.props,s=a.children,l=a.component,f=a.render;return Array.isArray(s)&&0===s.length&&(s=null),o.a.createElement(p.Provider,{value:i},i.match?s?"function"===typeof s?s(i):s:l?o.a.createElement(l,i):f?f(i):null:"function"===typeof s?s(i):null)}))},t}(o.a.Component);function w(e){return"/"===e.charAt(0)?e:"/"+e}function S(e,t){if(!e)return t;var n=w(e);return 0!==t.pathname.indexOf(n)?t:Object(c.a)({},t,{pathname:t.pathname.substr(n.length)})}function _(e){return"string"===typeof e?e:Object(a.e)(e)}function E(e){return function(){Object(u.a)(!1)}}function M(){}o.a.Component;var x=function(e){function t(){return e.apply(this,arguments)||this}return Object(r.a)(t,e),t.prototype.render=function(){var e=this;return o.a.createElement(p.Consumer,null,(function(t){t||Object(u.a)(!1);var n,r,i=e.props.location||t.location;return o.a.Children.forEach(e.props.children,(function(e){if(null==r&&o.a.isValidElement(e)){n=e;var a=e.props.path||e.props.from;r=a?y(i.pathname,Object(c.a)({},e.props,{path:a})):t.match}})),r?o.a.cloneElement(n,{location:i,computedMatch:r}):null}))},t}(o.a.Component);o.a.useContext},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,"a",(function(){return i}))},function(e,t,n){var r=n(220);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));for(var r={},i={},o=0;o<256;o++){var a=o.toString(16).toLowerCase();1===a.length&&(a="0"+a),r[o]=a,i[a]=o}function s(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");for(var t=new Uint8Array(e.length/2),n=0;n1)for(var n=1;n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return u}));var r=n(422),i=n(27),o=n(23),a=n(184);function s(e){var t=e.domain;return e.ticks=function(e){var n=t();return Object(r.a)(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Object(a.a)(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,o,a=t(),s=0,u=a.length-1,c=a[s],l=a[u],f=10;for(l0;){if((o=Object(r.b)(c,l,n))===i)return a[s]=c,a[u]=l,t(a);if(o>0)c=Math.floor(c/o)*o,l=Math.ceil(l/o)*o;else{if(!(o<0))break;c=Math.ceil(c*o)/o,l=Math.floor(l*o)/o}i=o}return e},e}function u(){var e=Object(i.b)();return e.copy=function(){return Object(i.a)(e,u())},o.b.apply(e,arguments),s(e)}},function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,"a",(function(){return r}))},function(e,t,n){(function(t){e.exports=function(){var e=e||function(e,r){var i;if("undefined"!==typeof window&&window.crypto&&(i=window.crypto),!i&&"undefined"!==typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&"undefined"!==typeof t&&t.crypto&&(i=t.crypto),!i)try{i=n(625)}catch(err){}var o=function(){if(i){if("function"===typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(err){}if("function"===typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(err){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},u=s.lib={},c=u.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},l=u.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=t!=r?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(o=0;o>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},d=f.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new l.init(n,t)}},p=f.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},m=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,c=e.min(4*u,o);if(u){for(var f=0;f=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var r=n(403),i=new(n.n(r).a);i.setMaxListeners&&i.setMaxListeners(10);var o="recharts.syncMouseEvents"},,function(e,t,n){"use strict";var r=n(315),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function a(e){return"undefined"===typeof e}function s(e){return null!==e&&"object"===typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;no?1*r:0})),!0},a=function(e,t){var n=Object.assign({},e);return t&&("string"===typeof t?delete n[t]:t.forEach((function(e){delete n[e]}))),n},s=function(e,t){void 0===t&&(t="application/octet-stream");var n=e.toLowerCase(),i=r.filter((function(e){return n.endsWith("."+e.ext)}));return i.length>0?i[0].type:t},u=function(e){var t=e.toLowerCase();return!!t.startsWith("text/")||("application/json"===t||"application/xml"===t||"application/sh"===t)},c=function(){for(var e="",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=32;n>0;n-=1)e+=t[Math.floor(Math.random()*t.length)];return e},l=function(e){if(e.isResolved)return e;var t=!0,n=!1,r=!1,i=e.then((function(e){return r=!0,t=!1,e}),(function(e){throw n=!0,t=!1,e}));return i.isFullfilled=function(){return r},i.isPending=function(){return t},i.isRejected=function(){return n},i},f=function(){if("undefined"===typeof self)return!1;var e=self;return"undefined"!==typeof e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope},h=function(){return{isBrowser:"undefined"!==typeof window&&"undefined"!==typeof window.document,isNode:"undefined"!==typeof e&&null!=e.versions&&null!=e.versions.node}},d=function e(t,n,r){if(void 0===n&&(n=[]),void 0===r&&(r=[]),!m(t))return t;var i={};for(var o in t){if(t.hasOwnProperty(o))i[n.includes(o)?o:o[0].toLowerCase()+o.slice(1)]=r.includes(o)?t[o]:e(t[o],n,r)}return i},p=function e(t,n,r){if(void 0===n&&(n=[]),void 0===r&&(r=[]),!m(t))return t;var i={};for(var o in t){if(t.hasOwnProperty(o))i[n.includes(o)?o:o[0].toUpperCase()+o.slice(1)]=r.includes(o)?t[o]:e(t[o],n,r)}return i},m=function(e){return e instanceof Object&&!(e instanceof Array)&&!(e instanceof Function)&&!(e instanceof Number)&&!(e instanceof String)&&!(e instanceof Boolean)},g=function(){function e(){}return e.isEmpty=i,e.sortByField=o,e.objectLessAttributes=a,e.filenameToContentType=s,e.isTextFile=u,e.generateRandomString=c,e.makeQuerablePromise=l,e.isWebWorker=f,e.browserOrNode=h,e.transferKeyToLowerCase=d,e.transferKeyToUpperCase=p,e.isStrictObject=m,e}()}).call(this,n(41))},function(e,t,n){"use strict";var r="Invariant failed";t.a=function(e,t){if(!e)throw new Error(r)}},function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=n,n.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},function(e,t,n){"use strict";var r=t,i=n(81),o=n(53),a=n(357);r.assert=o,r.toArray=a.toArray,r.zero2=a.zero2,r.toHex=a.toHex,r.encode=a.encode,r.getNAF=function(e,t,n){var r=new Array(Math.max(e.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,r[a]=s,o.iushrn(1)}return r},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(r=e.andln(7)+i&7)&&5!==r||2!==c?u:-u,n[0].push(a),s=0===(1&c)?0:3!==(r=t.andln(7)+o&7)&&5!==r||2!==u?c:-c,n[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return n},r.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),i="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;function o(e){var t=r.useRef(e);return i((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},function(e,t,n){"use strict";n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return g}));var r=n(71);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0&&i===+i?"".concat(i,"px"):i),";");var r,i,o}),"")},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===e||null===e||r.a.isSsr)return{width:0,height:0};var n="".concat(e),i=d(t),a="".concat(n,"-").concat(i);if(c.widthCache[a])return c.widthCache[a];try{var s=document.getElementById(h);s||((s=document.createElement("span")).setAttribute("id",h),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var u=o(o({},l),t);Object.keys(u).map((function(e){return s.style[e]=u[e],e})),s.textContent=n;var f=s.getBoundingClientRect(),p={width:f.width,height:f.height};return c.widthCache[a]=p,++c.cacheCount>2e3&&(c.cacheCount=0,c.widthCache={}),p}catch(m){return{width:0,height:0}}},m=function(e){var t=e.ownerDocument.documentElement,n={top:0,left:0};return"undefined"!==typeof e.getBoundingClientRect&&(n=e.getBoundingClientRect()),{top:n.top+window.pageYOffset-t.clientTop,left:n.left+window.pageXOffset-t.clientLeft}},g=function(e,t){return{chartX:Math.round(e.pageX-t.left),chartY:Math.round(e.pageY-t.top)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(99),i=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},o=new r.a("Amplify"),a=new(function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Logger=r.a,this.ServiceWorker=null}return e.prototype.register=function(e){o.debug("component registered in amplify",e),this._components.push(e),"function"===typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):o.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),o.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=i(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"===typeof e.getCategory&&this._components.map((function(t){t.addPluggable&&"function"===typeof t.addPluggable&&t.addPluggable(e)}))},e}())},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var r=function(e){return e.scrollTop};function i(e,t){var n=e.timeout,r=e.style,i=void 0===r?{}:r;return{duration:i.transitionDuration||"number"===typeof n?n:n[t.mode]||0,delay:i.transitionDelay}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return E})),n.d(t,"b",(function(){return A})),n.d(t,"d",(function(){return I})),n.d(t,"c",(function(){return m})),n.d(t,"f",(function(){return g})),n.d(t,"e",(function(){return p}));var r=n(4);function i(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,i=e.length;r=0;h--){var d=a[h];"."===d?o(a,h):".."===d?(o(a,h),f++):f&&(o(a,h),f--)}if(!c)for(;f--;f)a.unshift("..");!c||""===a[0]||a[0]&&i(a[0])||a.unshift("");var p=a.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var u=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"===typeof t||"object"===typeof n){var r=s(t),i=s(n);return r!==t||i!==n?e(r,i):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},c=n(52);function l(e){return"/"===e.charAt(0)?e:"/"+e}function f(e){return"/"===e.charAt(0)?e.substr(1):e}function h(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function m(e,t,n,i){var o;"string"===typeof e?(o=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(r.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function g(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&u(e.state,t.state)}function v(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"===typeof e?e(t,n):e;"string"===typeof o?"function"===typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,i):n.push(i),f({action:r,location:i,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",i=m(e,t,h(),w.location);l.confirmTransitionTo(i,r,n,(function(e){e&&(w.entries[w.index]=i,f({action:r,location:i}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t>6|192,63&i|128);else if(n+1>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},i=function(e){return"function"===typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1;"insideStart"===o?(r=b+x*s,i=S):"insideEnd"===o?(r=w-x*s,i=!S):"end"===o&&(r=w+x*s,i=S),i=M<=0?i:!i;var k=Object(g.c)(d,p,_,r),O=Object(g.c)(d,p,_,r+359*(i?1:-1)),C="M".concat(k.x,",").concat(k.y,"\n A").concat(_,",").concat(_,",0,1,").concat(i?0:1,",\n ").concat(O.x,",").concat(O.y),A=u()(e.id)?Object(m.j)("recharts-radial-line-"):e.id;return l.a.createElement("text",E({},n,{dominantBaseline:"central",className:h()("recharts-radial-bar-label",c)}),l.a.createElement("defs",null,l.a.createElement("path",{id:A,d:C})),l.a.createElement("textPath",{xlinkHref:"#".concat(A)},t))};function x(e){var t,n=e.viewBox,r=e.position,o=e.value,s=e.children,f=e.content,p=e.className,y=void 0===p?"":p,b=e.textBreakAll;if(!n||u()(o)&&u()(s)&&!Object(c.isValidElement)(f)&&!a()(f))return null;if(Object(c.isValidElement)(f))return Object(c.cloneElement)(f,e);if(a()(f)){if(t=Object(c.createElement)(f,e),Object(c.isValidElement)(t))return t}else t=function(e){var t=e.value,n=e.formatter,r=u()(e.children)?t:e.children;return a()(n)?n(r):r}(e);var w=function(e){return Object(m.g)(e.cx)}(n),_=Object(v.c)(e,!0);if(w&&("insideStart"===r||"insideEnd"===r||"end"===r))return M(e,t,_);var x=w?function(e){var t=e.viewBox,n=e.offset,r=e.position,i=t,o=i.cx,a=i.cy,s=i.innerRadius,u=i.outerRadius,c=(i.startAngle+i.endAngle)/2;if("outside"===r){var l=Object(g.c)(o,a,u+n,c),f=l.x;return{x:f,y:l.y,textAnchor:f>=o?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:o,y:a,textAnchor:"middle",verticalAnchor:"end"};var h=(s+u)/2,d=Object(g.c)(o,a,h,c);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}}(e):function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,o=e.position,a=t,s=a.x,u=a.y,c=a.width,l=a.height,f=l>=0?1:-1,h=f*r,d=f>0?"end":"start",p=f>0?"start":"end",g=c>=0?1:-1,v=g*r,y=g>0?"end":"start",b=g>0?"start":"end";if("top"===o)return S(S({},{x:s+c/2,y:u-f*r,textAnchor:"middle",verticalAnchor:d}),n?{height:Math.max(u-n.y,0),width:c}:{});if("bottom"===o)return S(S({},{x:s+c/2,y:u+l+h,textAnchor:"middle",verticalAnchor:p}),n?{height:Math.max(n.y+n.height-(u+l),0),width:c}:{});if("left"===o){var w={x:s-v,y:u+l/2,textAnchor:y,verticalAnchor:"middle"};return S(S({},w),n?{width:Math.max(w.x-n.x,0),height:l}:{})}if("right"===o){var _={x:s+c+v,y:u+l/2,textAnchor:b,verticalAnchor:"middle"};return S(S({},_),n?{width:Math.max(n.x+n.width-_.x,0),height:l}:{})}var E=n?{width:c,height:l}:{};return"insideLeft"===o?S({x:s+v,y:u+l/2,textAnchor:b,verticalAnchor:"middle"},E):"insideRight"===o?S({x:s+c-v,y:u+l/2,textAnchor:y,verticalAnchor:"middle"},E):"insideTop"===o?S({x:s+c/2,y:u+h,textAnchor:"middle",verticalAnchor:p},E):"insideBottom"===o?S({x:s+c/2,y:u+l-h,textAnchor:"middle",verticalAnchor:d},E):"insideTopLeft"===o?S({x:s+v,y:u+h,textAnchor:b,verticalAnchor:p},E):"insideTopRight"===o?S({x:s+c-v,y:u+h,textAnchor:y,verticalAnchor:p},E):"insideBottomLeft"===o?S({x:s+v,y:u+l-h,textAnchor:b,verticalAnchor:d},E):"insideBottomRight"===o?S({x:s+c-v,y:u+l-h,textAnchor:y,verticalAnchor:d},E):i()(o)&&(Object(m.g)(o.x)||Object(m.h)(o.x))&&(Object(m.g)(o.y)||Object(m.h)(o.y))?S({x:s+Object(m.c)(o.x,c),y:u+Object(m.c)(o.y,l),textAnchor:"end",verticalAnchor:"end"},E):S({x:s+c/2,y:u+l/2,textAnchor:"middle",verticalAnchor:"middle"},E)}(e);return l.a.createElement(d.a,E({className:h()("recharts-label",y)},_,x,{breakAll:b}),t)}x.displayName="Label",x.defaultProps={offset:5};var k=function(e){var t=e.cx,n=e.cy,r=e.angle,i=e.startAngle,o=e.endAngle,a=e.r,s=e.radius,u=e.innerRadius,c=e.outerRadius,l=e.x,f=e.y,h=e.top,d=e.left,p=e.width,g=e.height,v=e.clockWise,y=e.labelViewBox;if(y)return y;if(Object(m.g)(p)&&Object(m.g)(g)){if(Object(m.g)(l)&&Object(m.g)(f))return{x:l,y:f,width:p,height:g};if(Object(m.g)(h)&&Object(m.g)(d))return{x:h,y:d,width:p,height:g}}return Object(m.g)(l)&&Object(m.g)(f)?{x:l,y:f,width:0,height:0}:Object(m.g)(t)&&Object(m.g)(n)?{cx:t,cy:n,startAngle:i||r||0,endAngle:o||r||0,innerRadius:u||0,outerRadius:c||s||a||0,clockWise:v}:e.viewBox?e.viewBox:{}},O=function(e,t){return e?!0===e?l.a.createElement(x,{key:"label-implicit",viewBox:t}):Object(m.f)(e)?l.a.createElement(x,{key:"label-implicit",viewBox:t,value:e}):Object(c.isValidElement)(e)?e.type===x?Object(c.cloneElement)(e,{key:"label-implicit",viewBox:t}):l.a.createElement(x,{key:"label-implicit",content:e,viewBox:t}):a()(e)?l.a.createElement(x,{key:"label-implicit",content:e,viewBox:t}):i()(e)?l.a.createElement(x,E({viewBox:t},e,{key:"label-implicit"})):null:null};x.parseViewBox=k,x.renderCallByParent=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=k(e),o=Object(p.a)(r,x.displayName).map((function(e,n){return Object(c.cloneElement)(e,{viewBox:t||i,key:"label-".concat(n)})}));if(!n)return o;var a=O(e.label,t||i);return[a].concat(y(o))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));var r=n(7),i={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},o={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a(e){return"".concat(Math.round(e),"ms")}t.a={easing:i,duration:o,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?o.standard:n,u=t.easing,c=void 0===u?i.easeInOut:u,l=t.delay,f=void 0===l?0:l;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:a(s)," ").concat(c," ").concat("string"===typeof f?f:a(f))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){var r=n(469).default;function i(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(754)},function(e,t,n){var r=n(286),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";var r=n(53),i=n(17);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"===typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i>6|192,n[r++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,i){return e+t+n+r+i>>>0},t.sum64=function(e,t,n,r){var i=e[t],o=r+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,i,o,a,s){var u=0,c=t;return u+=(c=c+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,i,o,a,s){return t+r+o+s>>>0},t.sum64_5_hi=function(e,t,n,r,i,o,a,s,u,c){var l=0,f=t;return l+=(f=f+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,i,o,a,s,u,c){return t+r+o+s+c>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},function(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(759),i=(n(0),n(93));function o(){return Object(r.a)()||i.a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r={isSsr:!("undefined"!==typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return r[e]},set:function(e,t){if("string"===typeof e)r[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach((function(t){r[t]=e[t]}))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(153);var i=n(188);function o(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(i.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";var r=n(0),i=r.createContext({});t.a=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1&&void 0!==arguments[1]?arguments[1]:{},n=t.bandAware,r=t.position;if(void 0!==e){if(r)switch(r){case"start":return this.scale(e);case"middle":var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case"end":var o=this.bandwidth?this.bandwidth():0;return this.scale(e)+o;default:return this.scale(e)}if(n){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+a}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}])&&c(t.prototype,n),r&&c(t,r),e}();g.EPS=1e-4;var v=function(e){var t=Object.keys(e).reduce((function(t,n){return f(f({},t),{},h({},n,g.create(e[n])))}),{});return f(f({},t),{},{apply:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.bandAware;return a()(e,(function(e,n){return t[n].apply(e,{bandAware:r})}))},isInRange:function(e){return i()(e,(function(e,n){return t[n].isInRange(e)}))}})}},function(e,t,n){e.exports=n(605)},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return v})),n.d(t,"c",(function(){return w}));var r=n(1),i={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},o=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(i){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var o;return Object(r.__generator)(this,(function(a){return(null===(o=null===e||void 0===e?void 0:e.retryStrategy)||void 0===o?void 0:o.mode)&&(n.userAgent=Object(r.__spread)(n.userAgent||[],[["cfg/retry-mode",e.retryStrategy.mode]])),[2,e.retryStrategy.retry(t,i)]}))}))}}}(e),i)}}},a=n(6),s="amz-sdk-invocation-id",u="amz-sdk-request",c=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],l=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],f=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],h=[500,502,503,504],d=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||l.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},p=n(408),m=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},g=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return c.includes(e.name)}(e)||d(e)||function(e){var t;return f.includes(e.name)||h.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},v=3,y="standard",b=function(){function e(e,t){var n,r,i;this.maxAttemptsProvider=e,this.mode=y,this.retryDecider=null!==(n=null===t||void 0===t?void 0:t.retryDecider)&&void 0!==n?n:g,this.delayDecider=null!==(r=null===t||void 0===t?void 0:t.delayDecider)&&void 0!==r?r:m,this.retryQuota=null!==(i=null===t||void 0===t?void 0:t.retryQuota)&&void 0!==i?i:function(e){var t=e,n=e,r=function(e){return"TimeoutError"===e.name?10:5},i=function(e){return r(e)<=n};return Object.freeze({hasRetryTokens:i,retrieveRetryTokens:function(e){if(!i(e))throw new Error("No retry token available");var t=r(e);return n-=t,t},releaseRetryTokens:function(e){n+=null!==e&&void 0!==e?e:1,n=Math.min(n,t)}})}(500)}return e.prototype.shouldRetry=function(e,t,n){return t",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(718);function b(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o127?R+="x":R+=P[j];if(!R.match(d)){var L=T.slice(0,O),D=T.slice(O+1),U=P.match(p);U&&(L.push(U[1]),D.unshift(U[2])),D.length&&(b="/"+D.join(".")+b),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=r.toASCII(this.hostname));var B=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+B,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[_])for(O=0,I=l.length;O0)&&n.host.split("@"))&&(n.auth=A.shift(),n.host=n.hostname=A.shift());return n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var x=E.slice(-1)[0],k=(n.host||e.host||E.length>1)&&("."===x||".."===x)||""===x,O=0,C=E.length;C>=0;C--)"."===(x=E[C])?E.splice(C,1):".."===x?(E.splice(C,1),O++):O&&(E.splice(C,1),O--);if(!S&&!_)for(;O--;O)E.unshift("..");!S||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),k&&"/"!==E.join("/").substr(-1)&&E.push("");var A,T=""===E[0]||E[0]&&"/"===E[0].charAt(0);M&&(n.hostname=n.host=T?"":E.length?E.shift():"",(A=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=A.shift(),n.host=n.hostname=A.shift()));return(S=S||n.host&&E.length)&&!T&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},,function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(677).Buffer}catch(x){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","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"],f=[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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?l[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:l[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r("undefined"!==typeof a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,S=b>>>13,_=0|a[4],E=8191&_,M=_>>>13,x=0|a[5],k=8191&x,O=x>>>13,C=0|a[6],A=8191&C,T=C>>>13,I=0|a[7],P=8191&I,R=I>>>13,j=0|a[8],N=8191&j,L=j>>>13,D=0|a[9],U=8191&D,B=D>>>13,F=0|s[0],z=8191&F,q=F>>>13,H=0|s[1],V=8191&H,W=H>>>13,K=0|s[2],G=8191&K,$=K>>>13,Y=0|s[3],X=8191&Y,Z=Y>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,q))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var ve=(c+(r=r+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,z),i=(i=Math.imul(v,q))+Math.imul(y,z)|0,o=Math.imul(y,q),r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(S,z)|0,o=Math.imul(S,q),r=r+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,W)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,$)|0;var be=(c+(r=r+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,W)|0,r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,$)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var we=(c+(r=r+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(k,z),i=(i=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(E,V)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Z)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Se=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(T,z)|0,o=Math.imul(T,q),r=r+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,$)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,r=r+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var _e=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(P,z),i=(i=Math.imul(P,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,W)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(v,ne)|0,i=(i=i+Math.imul(v,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(L,z)|0,o=Math.imul(L,q),r=r+Math.imul(P,V)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,$)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Me=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(U,z),i=(i=Math.imul(U,q))+Math.imul(B,z)|0,o=Math.imul(B,q),r=r+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,W)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,$)|0,r=r+Math.imul(A,X)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Z)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var xe=(c+(r=r+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(U,V),i=(i=Math.imul(U,W))+Math.imul(B,V)|0,o=Math.imul(B,W),r=r+Math.imul(N,G)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,$)|0,r=r+Math.imul(P,X)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(k,ne)|0,i=(i=i+Math.imul(k,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(v,fe)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var ke=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(U,G),i=(i=Math.imul(U,$))+Math.imul(B,G)|0,o=Math.imul(B,$),r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Z)|0,r=r+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(r=r+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,me)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(U,X),i=(i=Math.imul(U,Z))+Math.imul(B,X)|0,o=Math.imul(B,Z),r=r+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(R,ne)|0,o=o+Math.imul(R,re)|0,r=r+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,he)|0;var Ce=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),r=r+Math.imul(N,ne)|0,i=(i=i+Math.imul(N,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,r=r+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0;var Ae=(c+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,ne),i=(i=Math.imul(U,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,r=r+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,he)|0;var Te=(c+(r=r+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(U,oe),i=(i=Math.imul(U,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Ie=(c+(r=r+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(U,ue),i=(i=Math.imul(U,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,he)|0;var Pe=(c+(r=r+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(U,fe),i=(i=Math.imul(U,he))+Math.imul(B,fe)|0,o=Math.imul(B,he);var Re=(c+(r=r+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(L,pe)|0))<<13)|0;c=((o=o+Math.imul(L,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var je=(c+(r=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,me))+Math.imul(B,pe)|0))<<13)|0;return c=((o=Math.imul(B,me))+(i>>>13)|0)+(je>>>26)|0,je&=67108863,u[0]=ge,u[1]=ve,u[2]=ye,u[3]=be,u[4]=we,u[5]=Se,u[6]=_e,u[7]=Ee,u[8]=Me,u[9]=xe,u[10]=ke,u[11]=Oe,u[12]=Ce,u[13]=Ae,u[14]=Te,u[15]=Ie,u[16]=Pe,u[17]=Re,u[18]=je,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):m(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=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},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;0===(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new w;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return v[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,E),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(67)(e))},function(e,t,n){"use strict";var r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+r+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+i+"$");t.isExist=function(e){return"undefined"!==typeof e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t)for(var r=Object.keys(t),i=r.length,o=0;o0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"===typeof u)o(u,this,t);else{var c=u.length,l=g(u,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";function r(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}n.d(t,"b",(function(){return r})),t.a=function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,i)},i=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}},function(e,t,n){var r=n(141),i=n(473),o=n(474),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(519),i=n(543),o=n(110),a=n(21),s=n(547);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},function(e,t,n){var r=n(20).Buffer,i=n(639).Transform,o=n(144).StringDecoder;function a(e){i.call(this),this.hashMode="string"===typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(17)(a,i),a.prototype.update=function(e,t,n){"string"===typeof e&&(e=r.from(e,t));var i=this._update(e);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(i){r=i}finally{n(r)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(n){t=n}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r},e.exports=a},function(e,t,n){"use strict";var r=n(756);t.a=function(e,t){return t?Object(r.a)(e,t,{clone:!1}):e}},function(e,t,n){"use strict";var r=n(0),i=r.createContext();t.a=i},function(e,t,n){"use strict";var r=n(39),i=n(7),o=n(756),a=n(4),s=["xs","sm","md","lg","xl"];function u(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,o=void 0===r?"px":r,u=e.step,c=void 0===u?5:u,l=Object(i.a)(e,["values","unit","step"]);function f(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function h(e,t){var r=s.indexOf(t);return r===s.length-1?f(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[s[r+1]]?n[s[r+1]]:t)-c/100).concat(o,")")}return Object(a.a)({keys:s,values:n,up:f,down:function(e){var t=s.indexOf(e)+1,r=n[s[t]];return t===s.length?f("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-c/100).concat(o,")")},between:h,only:function(e){return h(e,e)},width:function(e){return n[e]}},l)}function c(e,t,n){var i;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var l=n(421),f={black:"#000",white:"#fff"},h={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},d={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},m={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},g={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},v={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},y={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},b=n(30),w={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:f.white,default:h[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},S={text:{primary:f.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:h[800],default:"#303030"},action:{active:f.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function _(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(b.d)(e.main,i):"dark"===t&&(e.dark=Object(b.a)(e.main,o)))}function E(e){var t=e.primary,n=void 0===t?{light:d[300],main:d[500],dark:d[700]}:t,r=e.secondary,s=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,u=e.error,c=void 0===u?{light:m[300],main:m[500],dark:m[700]}:u,E=e.warning,M=void 0===E?{light:g[300],main:g[500],dark:g[700]}:E,x=e.info,k=void 0===x?{light:v[300],main:v[500],dark:v[700]}:x,O=e.success,C=void 0===O?{light:y[300],main:y[500],dark:y[700]}:O,A=e.type,T=void 0===A?"light":A,I=e.contrastThreshold,P=void 0===I?3:I,R=e.tonalOffset,j=void 0===R?.2:R,N=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function L(e){return Object(b.c)(e,S.text.primary)>=P?S.text.primary:w.text.primary}var D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Object(l.a)(4,t));if("string"!==typeof e.main)throw new Error(Object(l.a)(5,JSON.stringify(e.main)));return _(e,"light",n,j),_(e,"dark",r,j),e.contrastText||(e.contrastText=L(e.main)),e},U={dark:S,light:w};return Object(o.a)(Object(a.a)({common:f,type:T,primary:D(n),secondary:D(s,"A400","A200","A700"),error:D(c),warning:D(M),info:D(k),success:D(C),grey:h,contrastThreshold:P,getContrastText:L,augmentColor:D,tonalOffset:j},U[T]),N)}function M(e){return Math.round(1e5*e)/1e5}var x={textTransform:"uppercase"},k='"Roboto", "Helvetica", "Arial", sans-serif';function O(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?k:r,u=n.fontSize,c=void 0===u?14:u,l=n.fontWeightLight,f=void 0===l?300:l,h=n.fontWeightRegular,d=void 0===h?400:h,p=n.fontWeightMedium,m=void 0===p?500:p,g=n.fontWeightBold,v=void 0===g?700:g,y=n.htmlFontSize,b=void 0===y?16:y,w=n.allVariants,S=n.pxToRem,_=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var E=c/14,O=S||function(e){return"".concat(e/b*E,"rem")},C=function(e,t,n,r,i){return Object(a.a)({fontFamily:s,fontWeight:e,fontSize:O(t),lineHeight:n},s===k?{letterSpacing:"".concat(M(r/t),"em")}:{},i,w)},A={h1:C(f,96,1.167,-1.5),h2:C(f,60,1.2,-.5),h3:C(d,48,1.167,0),h4:C(d,34,1.235,.25),h5:C(d,24,1.334,0),h6:C(m,20,1.6,.15),subtitle1:C(d,16,1.75,.15),subtitle2:C(m,14,1.57,.1),body1:C(d,16,1.5,.15),body2:C(d,14,1.43,.15),button:C(m,14,1.75,.4,x),caption:C(d,12,1.66,.4),overline:C(d,12,2.66,1,x)};return Object(o.a)(Object(a.a)({htmlFontSize:b,pxToRem:O,round:M,fontFamily:s,fontSize:c,fontWeightLight:f,fontWeightRegular:d,fontWeightMedium:m,fontWeightBold:v},A),_,{clone:!1})}function C(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var A=["none",C(0,2,1,-1,0,1,1,0,0,1,3,0),C(0,3,1,-2,0,2,2,0,0,1,5,0),C(0,3,3,-2,0,3,4,0,0,1,8,0),C(0,2,4,-1,0,4,5,0,0,1,10,0),C(0,3,5,-1,0,5,8,0,0,1,14,0),C(0,3,5,-1,0,6,10,0,0,1,18,0),C(0,4,5,-2,0,7,10,1,0,2,16,1),C(0,5,5,-3,0,8,10,1,0,3,14,2),C(0,5,6,-3,0,9,12,1,0,3,16,2),C(0,6,6,-3,0,10,14,1,0,4,18,3),C(0,6,7,-4,0,11,15,1,0,4,20,3),C(0,7,8,-4,0,12,17,2,0,5,22,4),C(0,7,8,-4,0,13,19,2,0,5,24,4),C(0,7,9,-4,0,14,21,2,0,5,26,4),C(0,8,9,-5,0,15,22,2,0,6,28,5),C(0,8,10,-5,0,16,24,2,0,6,30,5),C(0,8,11,-5,0,17,26,2,0,6,32,5),C(0,9,11,-5,0,18,28,2,0,7,34,6),C(0,9,12,-6,0,19,29,2,0,7,36,6),C(0,10,13,-6,0,20,31,3,0,8,38,7),C(0,10,13,-6,0,21,33,3,0,8,40,7),C(0,10,14,-6,0,22,35,3,0,8,42,7),C(0,11,14,-7,0,23,36,3,0,9,44,8),C(0,11,15,-7,0,24,38,3,0,9,46,8)],T={borderRadius:4},I=n(844);function P(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=Object(I.a)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,a=void 0===r?{}:r,s=e.palette,l=void 0===s?{}:s,f=e.spacing,h=e.typography,d=void 0===h?{}:h,p=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),m=E(l),g=u(n),v=P(f),y=Object(o.a)({breakpoints:g,direction:"ltr",mixins:c(g,v,a),overrides:{},palette:m,props:{},shadows:A,typography:O(m,d),spacing:v,shape:T,transitions:R.a,zIndex:j.a},p),b=arguments.length,w=new Array(b>1?b-1:0),S=1;S>=6;var l=o/4*3;a>>=s%8;for(var f=Math.floor(s/8),h=0;h>d)}}return new Uint8Array(n)}function f(e){for(var t="",n=0;n>l]}t+="==".slice(0,4-u)}return t}},function(e,t,n){"use strict";n.d(t,"b",(function(){return E}));var r=n(0),i=n.n(r),o=n(14),a=n.n(o),s=n(400),u=n(98),c=n.n(u);function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1,r=function r(i){n<0&&(n=i),i-n>t?(e(i),n=-1):c()(r)};c()(r)}function f(e){return(f="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0&&e<=1}));var l=P(r,o),f=P(i,a),h=R(r,o),d=function(e){return e>1?1:e<0?0:e},p=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var i=l(n)-t,o=h(n);if(Math.abs(i-t)0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiff,n=void 0===t?100:t,r=e.damping,i=void 0===r?8:r,o=e.dt,a=void 0===o?17:o,s=function(e,t,r){var o=r+(-(e-t)*n-r*i)*a/1e3,s=r*a/1e3+e;return Math.abs(s-t)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Y(e){return function(e){if(Array.isArray(e))return X(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return X(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?n[i-1]:r,h=c||Object.keys(u);if("function"===typeof s||"spring"===s)return[].concat(Y(e),[t.runJSAnimation.bind(t,{from:f.style,to:u,duration:o,easing:s}),o]);var d=M(h,o,s),p=J(J(J({},f.style),u),{},{transition:d});return[].concat(Y(e),[p,o,l]).filter(S)}),[a,Math.max(u,r)])),[e.onAnimationEnd]))}},{key:"runAnimation",value:function(e){this.manager||(this.manager=p());var t=e.begin,n=e.duration,r=e.attributeName,i=e.to,o=e.easing,a=e.onAnimationStart,s=e.onAnimationEnd,u=e.steps,c=e.children,l=this.manager;if(this.unSubscribe=l.subscribe(this.handleStyleChange),"function"!==typeof o&&"function"!==typeof c&&"spring"!==o)if(u.length>1)this.runStepAnimation(e);else{var f=r?Q({},r,i):i,h=M(Object.keys(f),n,o);l.start([a,t,J(J({},f),{},{transition:h}),n,s])}else this.runJSAnimation(e)}},{key:"handleStyleChange",value:function(e){this.changeStyle(e)}},{key:"changeStyle",value:function(e){this.mounted&&this.setState({style:e})}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.begin,e.duration,e.attributeName,e.easing,e.isActive),o=(e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart,$(e,["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"])),a=r.Children.count(t),s=E(this.state.style);if("function"===typeof t)return t(s);if(!n||0===a)return t;var u=function(e){var t=e.props,n=t.style,i=void 0===n?{}:n,a=t.className;return Object(r.cloneElement)(e,J(J({},o),{},{style:J(J({},i),s),className:a}))};return 1===a?u(r.Children.only(t)):i.a.createElement("div",null,r.Children.map(t,(function(e){return u(e)})))}}])&&ee(t.prototype,n),o&&ee(t,o),u}(r.PureComponent);ae.displayName="Animate",ae.propTypes={from:a.a.oneOfType([a.a.object,a.a.string]),to:a.a.oneOfType([a.a.object,a.a.string]),attributeName:a.a.string,duration:a.a.number,begin:a.a.number,easing:a.a.oneOfType([a.a.string,a.a.func]),steps:a.a.arrayOf(a.a.shape({duration:a.a.number.isRequired,style:a.a.object.isRequired,easing:a.a.oneOfType([a.a.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),a.a.func]),properties:a.a.arrayOf("string"),onAnimationEnd:a.a.func})),children:a.a.oneOfType([a.a.node,a.a.func]),isActive:a.a.bool,canBegin:a.a.bool,onAnimationEnd:a.a.func,shouldReAnimate:a.a.bool,onAnimationStart:a.a.func,onAnimationReStart:a.a.func},ae.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};var se=ae,ue=n(193);function ce(e){return(ce="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function le(){return(le=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function de(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.steps,n=e.duration;return t&&t.length?t.reduce((function(e,t){return e+(Number.isFinite(t.duration)&&t.duration>0?t.duration:0)}),0):Number.isFinite(n)?n:0},_e=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ve(e,t)}(s,e);var t,n,o,a=ye(s);function s(){var e;me(this,s);for(var t=arguments.length,n=new Array(t),r=0;r0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=function(){for(var e=[],t=0;t=a){var u=console.log.bind(console);"ERROR"===t&&console.error&&(u=console.error.bind(console)),"WARN"===t&&console.warn&&(u=console.warn.bind(console));var c="["+t+"] "+this._ts()+" "+this.name;if(1===n.length&&"string"===typeof n[0])u(c+" - "+n[0]);else if(1===n.length)u(c,n[0]);else if("string"===typeof n[0]){var l=n.slice(1);1===l.length&&(l=l[0]),u(c+" - "+n[0],l)}else u(c,n)}},e.prototype.log=function(){for(var e=[],t=0;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){var o=t.word,a=t.width,s=e[e.length-1];if(s&&(null==r||i||s.width+a+ne.maxLines||function(e){return e.reduce((function(e,t){return e.width>t.width?e:t}))}(o).width>r,o]},h=0,d=a.length-1,p=0;h<=d&&p<=a.length-1;){var m=Math.floor((h+d)/2),g=M(l(m-1),2),v=g[0],y=g[1],b=M(l(m),1)[0];if(v||b||(h=m+1),v&&b&&(d=m-1),!v&&b){c=y;break}p++}return c||u}(e,n.wordsWithComputedWidth,n.spaceWidth,e.width,e.scaleToFit):I(e.children)}return I(e.children)},R=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(o,e);var t,n,r,i=S(o);function o(){var e;y(this,o);for(var t=arguments.length,n=new Array(t),r=0;ro)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(e);if(e>0)if(e>i)for(var u=0;u2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,i,a,s;if("string"===typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(o(t,"type"));else{var u=function(e,t,n){return"number"!==typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(r," ").concat(o(t,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){"use strict";(function(t){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=c;var i=n(326),o=n(330);n(17)(c,i);for(var a=r(o.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(0),i=n(25),o=!0,a=!1,s=null,u={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function l(){o=!1}function f(){"hidden"===this.visibilityState&&a&&(o=!0)}function h(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return o||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!u[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function d(){a=!0,window.clearTimeout(s),s=window.setTimeout((function(){a=!1}),100)}function p(){return{isFocusVisible:h,onBlurVisible:d,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",l,!0),t.addEventListener("pointerdown",l,!0),t.addEventListener("touchstart",l,!0),t.addEventListener("visibilitychange",f,!0))}),[])}}},function(e,t,n){"use strict";function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},function(e,t,n){"use strict";t.a=function(e,t){return et?1:e>=t?0:NaN}},function(e,t,n){"use strict";Array.prototype.slice;t.a=function(e){return"object"===typeof e&&"length"in e?e:Array.from(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(0),i=n.n(r),o=n(15),a=n.n(o),s=n(12);function u(e){return(u="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(){return(c=Object.assign||function(e){for(var t=1;t=0&&!o.headers[":authority"]?(delete o.headers.host,o.headers[":authority"]=""):o.headers.host||(o.headers.host=o.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),a)}}}},function(e,t,n){"use strict";t.parse=function(e,t){if("string"!==typeof e)throw new TypeError("argument str must be a string");for(var n={},i=t||{},a=e.split(o),u=i.decode||r,c=0;c0})).map((function(e){return null===e||void 0===e?void 0:e.replace(s,"_")})).join("/")},c={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},l=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(i){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var s,c,l,f,h,d,p,m;return Object(r.__generator)(this,(function(g){switch(g.label){case 0:return s=i.request,o.a.isInstance(s)?(c=s.headers,l=(null===(p=null===t||void 0===t?void 0:t.userAgent)||void 0===p?void 0:p.map(u))||[],[4,n.defaultUserAgentProvider()]):[2,e(i)];case 1:return f=g.sent().map(u),h=(null===(m=null===n||void 0===n?void 0:n.customUserAgent)||void 0===m?void 0:m.map(u))||[],c["x-amz-user-agent"]=Object(r.__spread)(f,l,h).join(" "),d=Object(r.__spread)(f.filter((function(e){return e.startsWith("aws-sdk-")})),h).join(" "),"browser"!==n.runtime&&d&&(c[a]=c[a]?c[a]+" "+d:d),[2,e(Object(r.__assign)(Object(r.__assign)({},i),{request:s}))]}}))}))}}),c)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return u}));var r=n(1),i=n(6),o=n(124);var a=function(){function e(e){var t=(void 0===e?{}:e).requestTimeout;this.requestTimeout=t}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal,a=this.requestTimeout;if(null===n||void 0===n?void 0:n.aborted){var s=new Error("Request aborted");return s.name="AbortError",Promise.reject(s)}var u=e.path;if(e.query){var c=Object(o.a)(e.query);c&&(u+="?"+c)}var l=e.port,f=e.method,h=e.protocol+"//"+e.hostname+(l?":"+l:"")+u,d={body:"GET"===f||"HEAD"===f?void 0:e.body,headers:new Headers(e.headers),method:f};"undefined"!==typeof AbortController&&(d.signal=n);var p,m=new Request(h,d),g=[fetch(m).then((function(e){var t,n,o=e.headers,a={};try{for(var s=Object(r.__values)(o.entries()),u=s.next();!u.done;u=s.next()){var c=u.value;a[c[0]]=c[1]}}catch(l){t={error:l}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new i.b({headers:a,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new i.b({headers:a,statusCode:e.status,body:t})}}))})),(p=a,void 0===p&&(p=0),new Promise((function(e,t){p&&setTimeout((function(){var e=new Error("Request did not complete within "+p+" ms");e.name="TimeoutError",t(e)}),p)})))];return n&&g.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),Promise.race(g)},e}(),s=n(96),u=function(e){return"function"===typeof Blob&&e instanceof Blob?function(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,n;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[4,c(e)];case 1:return t=r.sent(),n=Object(s.a)(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,n,i,o,a,s,u;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:t=new Uint8Array(0),n=e.getReader(),i=!1,r.label=1;case 1:return i?[3,3]:[4,n.read()];case 2:return o=r.sent(),a=o.done,(s=o.value)&&(u=t,(t=new Uint8Array(u.length+s.length)).set(u),t.set(s,u.length)),i=a,[3,1];case 3:return[2,t]}}))}))}(e)};function c(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e;if(2!==r.readyState)return n(new Error("Reader aborted too early"));var i=null!==(e=r.result)&&void 0!==e?e:"",o=i.indexOf(","),a=o>-1?o+1:i.length;t(i.substring(a))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return s}));var r=n(1),i=function(e){var t;return Object(r.__assign)(Object(r.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?o(e):function(){return a(e)},isCustomEndpoint:!!e.endpoint})},o=function(e){var t=e.endpoint,n=e.urlParser;if("string"===typeof t){var r=Promise.resolve(n(t));return function(){return r}}if("object"===typeof t){var i=Promise.resolve(t);return function(){return i}}return t},a=function(e){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var t,n,i,o,a;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(i=r.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(i))throw new Error("Invalid region in client config");return[4,e.regionInfoProvider(i)];case 2:if(!(o=(null!==(a=r.sent())&&void 0!==a?a:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((n?"https:":"http:")+"//"+o)]}}))}))},s=function(e){if(!e.region)throw new Error("Region is missing");return Object(r.__assign)(Object(r.__assign)({},e),{region:u(e.region)})},u=function(e){if("string"===typeof e){var t=Promise.resolve(e);return function(){return t}}return e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return I}));var r=n(38),i=n.n(r),o=n(13),a=n.n(o),s=n(0),u=n.n(s),c=n(15),l=n.n(c),f=n(95),h=n(56),d=n(33),p=n(106),m=n(62),g=n(71),v=n(5),y=n(12);function b(e){return(b="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(){return(w=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k(e,t){for(var n=0;n=2?Object(v.i)(y[1].coordinate-y[0].coordinate):1;if(1===S?(n="width"===g?f:d,r="width"===g?f+p:d+m):(n="width"===g?f+p:d+m,r="width"===g?f:d),t){var E=i[w-1],M=a()(o)?o(E.value,w-1):E.value,x=Object(h.c)(M)[g]+b,k=S*(E.coordinate+S*x/2-r);y[w-1]=E=_(_({},E),{},{tickCoord:k>0?E.coordinate-k*S:E.coordinate}),S*(E.tickCoord-S*x/2-n)>=0&&S*(E.tickCoord+S*x/2-r)<=0&&(r=E.tickCoord-S*(x/2+c),y[w-1]=_(_({},E),{},{isShow:!0}))}for(var O=t?w-1:w,C=0;C=0&&S*(A.tickCoord+S*I/2-r)<=0&&(n=A.tickCoord+S*(I/2+c),y[C]=_(_({},A),{},{isShow:!0}))}return y.filter((function(e){return e.isShow}))}},{key:"getTicksEnd",value:function(e){var t,n,r=e.ticks,i=e.tickFormatter,o=e.viewBox,s=e.orientation,u=e.minTickGap,c=e.unit,l=o.x,f=o.y,d=o.width,p=o.height,m="top"===s||"bottom"===s?"width":"height",g=c&&"width"===m?Object(h.c)(c)[m]:0,y=(r||[]).slice(),b=y.length,w=b>=2?Object(v.i)(y[1].coordinate-y[0].coordinate):1;1===w?(t="width"===m?l:f,n="width"===m?l+d:f+p):(t="width"===m?l+d:f+p,n="width"===m?l:f);for(var S=b-1;S>=0;S--){var E=y[S],M=a()(i)?i(E.value,b-S-1):E.value,x=Object(h.c)(M)[m]+g;if(S===b-1){var k=w*(E.coordinate+w*x/2-n);y[S]=E=_(_({},E),{},{tickCoord:k>0?E.coordinate-k*w:E.coordinate})}else y[S]=E=_(_({},E),{},{tickCoord:E.coordinate});w*(E.tickCoord-w*x/2-t)>=0&&w*(E.tickCoord+w*x/2-n)<=0&&(n=E.tickCoord-w*(x/2+u),y[S]=_(_({},E),{},{isShow:!0}))}return y.filter((function(e){return e.isShow}))}},{key:"renderTickItem",value:function(e,t,n){return u.a.isValidElement(e)?u.a.cloneElement(e,t):a()(e)?e(t):u.a.createElement(p.a,w({},t,{className:"recharts-cartesian-axis-tick-value"}),n)}}],(n=[{key:"shouldComponentUpdate",value:function(e){var t=e.viewBox,n=M(e,["viewBox"]),r=this.props,i=r.viewBox,o=M(r,["viewBox"]);return!Object(f.a)(t,i)||!Object(f.a)(n,o)}},{key:"getTickLineCoord",value:function(e){var t,n,r,i,o,a,s=this.props,u=s.x,c=s.y,l=s.width,f=s.height,h=s.orientation,d=s.tickSize,p=s.mirror,m=s.tickMargin,g=p?-1:1,y=e.tickSize||d,b=Object(v.g)(e.tickCoord)?e.tickCoord:e.coordinate;switch(h){case"top":t=n=e.coordinate,a=(r=(i=c+ +!p*f)-g*y)-g*m,o=b;break;case"left":r=i=e.coordinate,o=(t=(n=u+ +!p*l)-g*y)-g*m,a=b;break;case"right":r=i=e.coordinate,o=(t=(n=u+ +p*l)+g*y)+g*m,a=b;break;default:t=n=e.coordinate,a=(r=(i=c+ +p*f)+g*y)+g*m,o=b}return{line:{x1:t,y1:r,x2:n,y2:i},tick:{x:o,y:a}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,n=t.orientation,r=t.mirror;switch(n){case"left":e=r?"start":"end";break;case"right":e=r?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,n=e.mirror,r="end";switch(t){case"left":case"right":r="middle";break;case"top":r=n?"start":"end";break;default:r=n?"end":"start"}return r}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,o=e.height,a=e.orientation,s=e.mirror,c=e.axisLine,f=_(_(_({},Object(y.c)(this.props)),Object(y.c)(c)),{},{fill:"none"});if("top"===a||"bottom"===a){var h=+("top"===a&&!s||"bottom"===a&&s);f=_(_({},f),{},{x1:t,y1:n+h*o,x2:t+r,y2:n+h*o})}else{var d=+("left"===a&&!s||"right"===a&&s);f=_(_({},f),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+o})}return u.a.createElement("line",w({},f,{className:l()("recharts-cartesian-axis-line",i()(c,"className"))}))}},{key:"renderTicks",value:function(e){var t=this,n=this.props,r=n.tickLine,o=n.stroke,c=n.tick,f=n.tickFormatter,h=n.unit,p=s.getTicks(_(_({},this.props),{},{ticks:e})),m=this.getTickTextAnchor(),g=this.getTickVerticalAnchor(),v=Object(y.c)(this.props),b=Object(y.c)(c),S=_(_({},v),{},{fill:"none"},Object(y.c)(r)),E=p.map((function(e,n){var E=t.getTickLineCoord(e),M=E.line,x=E.tick,k=_(_(_(_({textAnchor:m,verticalAnchor:g},v),{},{stroke:"none",fill:o},b),x),{},{index:n,payload:e,visibleTicksCount:p.length,tickFormatter:f});return u.a.createElement(d.a,w({className:"recharts-cartesian-axis-tick",key:"tick-".concat(n)},Object(y.b)(t.props,e,n)),r&&u.a.createElement("line",w({},S,M,{className:l()("recharts-cartesian-axis-tick-line",i()(r,"className"))})),c&&s.renderTickItem(c,k,"".concat(a()(f)?f(e.value,n):e.value).concat(h||"")))}));return u.a.createElement("g",{className:"recharts-cartesian-axis-ticks"},E)}},{key:"render",value:function(){var e=this.props,t=e.axisLine,n=e.width,r=e.height,i=e.ticksGenerator,o=e.className;if(e.hide)return null;var s=this.props,c=s.ticks,f=M(s,["ticks"]),h=c;return a()(i)&&(h=c&&c.length>0?i(this.props):i(f)),n<=0||r<=0||!h||!h.length?null:u.a.createElement(d.a,{className:l()("recharts-cartesian-axis",o)},t&&this.renderAxisLine(),this.renderTicks(h),m.a.renderCallByParent(this.props))}}])&&k(t.prototype,n),r&&k(t,r),s}(s.Component);I.displayName="CartesianAxis",I.defaultProps={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"}},function(e,t,n){var r,i;!function(o){if(void 0===(i="function"===typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i),!0,e.exports=o(),!!0){var a=window.Cookies,s=window.Cookies=o();s.noConflict=function(){return window.Cookies=a,s}}}((function(){function e(){for(var e=0,t={};e>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return i>0&&(e.lastNeed=i-1),i;if(--r=0)return i>0&&(e.lastNeed=i-2),i;if(--r=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"===typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"===typeof e},t.isString=function(e){return"string"===typeof e},t.isSymbol=function(e){return"symbol"===typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"===typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"===typeof e},t.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},t.isBuffer=e.isBuffer}).call(this,n(16).Buffer)},function(e,t,n){(function(t){e.exports=function(e,n){for(var r=Math.min(e.length,n.length),i=new t(r),o=0;o=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,r[i++]=e>>>16&255,r[i++]=e>>>8&255,r[i++]=255&e}else for(r[i++]=255&e,r[i++]=e>>>8&255,r[i++]=e>>>16&255,r[i++]=e>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o>>7)^(p<<14|p>>>18)^p>>>3,g=c[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[d]=m+c[d-7]+v+c[d-16]}var y=r&i^r&o^i&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&f)+u[d]+c[d];h=f,f=l,l=s,s=a+w|0,a=o,o=i,i=r,r=w+(b+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(l),t.HmacSHA256=o._createHmacHelper(l)}(Math),i.SHA256)}()},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function l(e){var t=e.children,n=e.width,r=e.height,o=e.viewBox,l=e.className,f=e.style,h=c(e,["children","width","height","viewBox","className","style"]),d=o||{width:n,height:r,x:0,y:0},p=a()("recharts-surface",l);return i.a.createElement("svg",u({},Object(s.c)(h,!0,!0),{className:p,width:n,height:r,style:f,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),version:"1.1"}),t)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return s}));var r=n(126),i=n.n(r),o=n(42),a=i.a.mark(s);function s(e,t){var n,r,s,u,c,l,f;return i.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==t){i.next=21;break}n=Object(o.a)(e),i.prev=2,n.s();case 4:if((r=n.n()).done){i.next=11;break}if(!(null!=(s=r.value)&&(s=+s)>=s)){i.next=9;break}return i.next=9,s;case 9:i.next=4;break;case 11:i.next=16;break;case 13:i.prev=13,i.t0=i.catch(2),n.e(i.t0);case 16:return i.prev=16,n.f(),i.finish(16);case 19:i.next=40;break;case 21:u=-1,c=Object(o.a)(e),i.prev=23,c.s();case 25:if((l=c.n()).done){i.next=32;break}if(f=l.value,!(null!=(f=t(f,++u,e))&&(f=+f)>=f)){i.next=30;break}return i.next=30,f;case 30:i.next=25;break;case 32:i.next=37;break;case 34:i.prev=34,i.t1=i.catch(23),c.e(i.t1);case 37:return i.prev=37,c.f(),i.finish(37);case 40:case"end":return i.stop()}}),a,null,[[2,13,16,19],[23,34,37,40]])}t.a=function(e){return null===e?NaN:+e}},function(e,t,n){"use strict";t.a=function(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"a",(function(){return b}));var r=n(0),i=n.n(r),o=n(15),a=n.n(o),s=n(97),u=n(12);function c(e){return(c="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(){return(l=Object.assign||function(e){for(var t=1;t=0?1:-1,u=n>=0?1:-1,c=r>=0&&n>=0||r<0&&n<0?1:0;if(a>0&&i instanceof Array){for(var l=[0,0,0,0],f=0;f<4;f++)l[f]=i[f]>a?a:i[f];o="M".concat(e,",").concat(t+s*l[0]),l[0]>0&&(o+="A ".concat(l[0],",").concat(l[0],",0,0,").concat(c,",").concat(e+u*l[0],",").concat(t)),o+="L ".concat(e+n-u*l[1],",").concat(t),l[1]>0&&(o+="A ".concat(l[1],",").concat(l[1],",0,0,").concat(c,",\n ").concat(e+n,",").concat(t+s*l[1])),o+="L ".concat(e+n,",").concat(t+r-s*l[2]),l[2]>0&&(o+="A ".concat(l[2],",").concat(l[2],",0,0,").concat(c,",\n ").concat(e+n-u*l[2],",").concat(t+r)),o+="L ".concat(e+u*l[3],",").concat(t+r),l[3]>0&&(o+="A ".concat(l[3],",").concat(l[3],",0,0,").concat(c,",\n ").concat(e,",").concat(t+r-s*l[3])),o+="Z"}else if(a>0&&i===+i&&i>0){var h=Math.min(a,i);o="M ".concat(e,",").concat(t+s*h,"\n A ").concat(h,",").concat(h,",0,0,").concat(c,",").concat(e+u*h,",").concat(t,"\n L ").concat(e+n-u*h,",").concat(t,"\n A ").concat(h,",").concat(h,",0,0,").concat(c,",").concat(e+n,",").concat(t+s*h,"\n L ").concat(e+n,",").concat(t+r-s*h,"\n A ").concat(h,",").concat(h,",0,0,").concat(c,",").concat(e+n-u*h,",").concat(t+r,"\n L ").concat(e+u*h,",").concat(t+r,"\n A ").concat(h,",").concat(h,",0,0,").concat(c,",").concat(e,",").concat(t+r-s*h," Z")}else o="M ".concat(e,",").concat(t," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return o},y=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,i=t.x,o=t.y,a=t.width,s=t.height;if(Math.abs(a)>0&&Math.abs(s)>0){var u=Math.min(i,i+a),c=Math.max(i,i+a),l=Math.min(o,o+s),f=Math.max(o,o+s);return n>=u&&n<=c&&r>=l&&r<=f}return!1},b=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(c,e);var t,n,r,o=p(c);function c(){var e;f(this,c);for(var t=arguments.length,n=new Array(t),r=0;r0,from:{width:o,height:c,x:n,y:r},to:{width:o,height:c,x:n,y:r},duration:g,animationEasing:m,isActive:w},(function(t){var n=t.width,r=t.height,o=t.x,a=t.y;return i.a.createElement(s.a,{canBegin:d>0,from:"0px ".concat(-1===d?1:d,"px"),to:"".concat(d,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,isActive:b,easing:m},i.a.createElement("path",l({},Object(u.c)(e.props,!0),{className:S,d:v(o,a,n,r,f),ref:function(t){e.node=t}})))})):i.a.createElement("path",l({},Object(u.c)(this.props,!0),{className:S,d:v(n,r,o,c,f)}))}}])&&h(t.prototype,n),r&&h(t,r),c}(r.PureComponent);b.defaultProps={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"}},function(e,t,n){!function(t,r){var i;e.exports=(i=n(46),function(){var e=i,t=e.lib.WordArray;function n(e,n,r){for(var i=[],o=0,a=0;a>>6-a%4*2;i[o>>>2]|=s<<24-o%4*8,o++}return t.create(i,o)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var A=n(814),T=n(122),I=n(26);function P(e){return e[0]}function R(e){return e[1]}var j=function(e,t){var n=Object(I.a)(!0),r=null,i=y,o=null;function a(a){var s,u,c,l=(a=Object(T.a)(a)).length,f=!1;for(null==r&&(o=i(c=Object(A.a)())),s=0;s<=l;++s)!(s=l;--f)s.point(g[f],v[f]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(h,c,u),v[c]=+t(h,c,u),s.point(r?+r(h,c,u):g[c],n?+n(h,c,u):v[c]))}if(d)return s=null,d+""||null}function c(){return j().defined(i).curve(a).context(o)}return e="function"===typeof e?e:void 0===e?P:Object(I.a)(+e),t="function"===typeof t?t:void 0===t?Object(I.a)(0):Object(I.a)(+t),n="function"===typeof n?n:void 0===n?R:Object(I.a)(+n),u.x=function(t){return arguments.length?(e="function"===typeof t?t:Object(I.a)(+t),r=null,u):e},u.x0=function(t){return arguments.length?(e="function"===typeof t?t:Object(I.a)(+t),u):e},u.x1=function(e){return arguments.length?(r=null==e?null:"function"===typeof e?e:Object(I.a)(+e),u):r},u.y=function(e){return arguments.length?(t="function"===typeof e?e:Object(I.a)(+e),n=null,u):t},u.y0=function(e){return arguments.length?(t="function"===typeof e?e:Object(I.a)(+e),u):t},u.y1=function(e){return arguments.length?(n=null==e?null:"function"===typeof e?e:Object(I.a)(+e),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(r).y(t)},u.defined=function(e){return arguments.length?(i="function"===typeof e?e:Object(I.a)(!!e),u):i},u.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),u):a},u.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),u):o},u},L=n(15),D=n.n(L),U=n(12),B=n(5);function F(e){return(F="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function z(){return(z=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ve(e){return e.value}function ye(e,t){return!0===e?a()(t,ve):i()(e)?a()(t,e):t}var be=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&he(e,t)}(a,e);var t,n,r,o=de(a);function a(){var e;le(this,a);for(var t=arguments.length,n=new Array(t),r=0;r=0&&n>=0?{width:t,height:n}:null}},{key:"getDefaultPosition",value:function(e){var t,n,r=this.props,i=r.layout,o=r.align,a=r.verticalAlign,s=r.margin,u=r.chartWidth,c=r.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===o&&"vertical"===i?{left:((u||0)-(this.getBBoxSnapshot()||{width:0}).width)/2}:"right"===o?{right:s&&s.right||0}:{left:s&&s.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(n="middle"===a?{top:((c||0)-(this.getBBoxSnapshot()||{height:0}).height)/2}:"bottom"===a?{bottom:s&&s.bottom||0}:{top:s&&s.top||0}),ue(ue({},t),n)}},{key:"updateBBox",value:function(){var e=this.state,t=e.boxWidth,n=e.boxHeight,r=this.props.onBBoxUpdate;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var i=this.wrapperNode.getBoundingClientRect();(Math.abs(i.width-t)>1||Math.abs(i.height-n)>1)&&this.setState({boxWidth:i.width,boxHeight:i.height},(function(){r&&r(i)}))}else-1===t&&-1===n||this.setState({boxWidth:-1,boxHeight:-1},(function(){r&&r(null)}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.content,r=t.width,o=t.height,a=t.wrapperStyle,s=t.payloadUniqBy,c=t.payload,l=ue(ue({position:"absolute",width:r||"auto",height:o||"auto"},this.getDefaultPosition(a)),a);return u.a.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(t){e.wrapperNode=t}},function(e,t){if(u.a.isValidElement(e))return u.a.cloneElement(e,t);if(i()(e))return u.a.createElement(e,t);t.ref;var n=ge(t,["ref"]);return u.a.createElement(ie,n)}(n,ue(ue({},this.props),{},{payload:ye(s,c)})))}}])&&fe(t.prototype,n),r&&fe(t,r),a}(s.PureComponent);be.displayName="Legend",be.defaultProps={iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return f}));var r=n(1),i=n(208);function o(e){var t,n=this,o=a(e.credentials||e.credentialDefaultProvider(e)),s=e.signingEscapePath,u=void 0===s||s,c=e.systemClockOffset,l=void 0===c?e.systemClockOffset||0:c,f=e.sha256;return t=e.signer?a(e.signer):function(){return a(e.region)().then((function(t){return Object(r.__awaiter)(n,void 0,void 0,(function(){return Object(r.__generator)(this,(function(n){switch(n.label){case 0:return[4,e.regionInfoProvider(t)];case 1:return[2,[n.sent()||{},t]]}}))}))})).then((function(t){var n=Object(r.__read)(t,2),a=n[0],s=n[1],c=a.signingRegion,l=a.signingService;return e.signingRegion=e.signingRegion||c||s,e.signingName=e.signingName||l||e.serviceId,new i.a({credentials:o,region:e.signingRegion,service:e.signingName,sha256:f,uriEscapePath:u})}))},Object(r.__assign)(Object(r.__assign)({},e),{systemClockOffset:l,signingEscapePath:u,credentials:o,signer:t})}function a(e){if("object"===typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var s=n(6),u=function(e){return new Date(Date.now()+e)};function c(e){return function(t,n){return function(i){return Object(r.__awaiter)(this,void 0,void 0,(function(){var o,a,c,l,f,h,d,p,m;return Object(r.__generator)(this,(function(g){switch(g.label){case 0:return s.a.isInstance(i.request)?"function"!==typeof e.signer?[3,2]:[4,e.signer()]:[2,t(i)];case 1:return a=g.sent(),[3,3];case 2:a=e.signer,g.label=3;case 3:return o=a,l=t,f=[Object(r.__assign)({},i)],m={},[4,o.sign(i.request,{signingDate:new Date(Date.now()+e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 4:return[4,l.apply(void 0,[r.__assign.apply(void 0,f.concat([(m.request=g.sent(),m)]))])];case 5:return c=g.sent(),h=c.response.headers,(d=h&&(h.date||h.Date))&&(p=Date.parse(d),v=p,y=e.systemClockOffset,Math.abs(u(y).getTime()-v)>=3e5&&(e.systemClockOffset=p-Date.now())),[2,c]}var v,y}))}))}}}var l={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},f=function(e){return{applyToStack:function(t){t.addRelativeTo(c(e),l)}}}},function(e,t,n){var r=n(309),i=n(573),o=n(110);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},function(e,t,n){var r=n(309),i=n(574),o=n(110);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return K}));var r=n(10),i=n.n(r),o=n(13),a=n.n(o),s=n(131),u=n.n(s),c=n(0),l=n.n(c),f=n(97),h=n(15),d=n.n(h),p=n(120),m=n.n(p),g=n(21),v=n.n(g),y=n(5);function b(e){return(b="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(err){i=!0,o=err}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nl[n]+i?Math.max(f,l[n]):Math.max(h,l[n])},e}return t=s,(n=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"updateBBox",value:function(){var e=this.state,t=e.boxWidth,n=e.boxHeight;if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-t)>1||Math.abs(r.height-n)>1)&&this.setState({boxWidth:r.width,boxHeight:r.height})}else-1===t&&-1===n||this.setState({boxWidth:-1,boxHeight:-1})}},{key:"render",value:function(){var e,t,n,r=this,o=this.props,s=o.payload,c=o.isAnimationActive,h=o.animationDuration,p=o.animationEasing,m=o.filterNull,g=function(e,t){return!0===e?u()(t,W):a()(e)?u()(t,e):t}(o.payloadUniqBy,m&&s&&s.length?s.filter((function(e){return!i()(e.value)})):s),v=g&&g.length,b=this.props,w=b.content,S=b.viewBox,_=b.coordinate,E=b.position,M=b.active,x=L({pointerEvents:"none",visibility:M&&v?"visible":"hidden",position:"absolute",top:0,left:0},b.wrapperStyle);if(E&&Object(y.g)(E.x)&&Object(y.g)(E.y))t=E.x,n=E.y;else{var k=this.state,O=k.boxWidth,C=k.boxHeight;O>0&&C>0&&_?(t=this.getTranslate({key:"x",tooltipDimension:O,viewBoxDimension:S.width}),n=this.getTranslate({key:"y",tooltipDimension:C,viewBoxDimension:S.height})):x.visibility="hidden"}x=L(L({},Object(f.b)({transform:this.props.useTranslate3d?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")})),x),c&&M&&(x=L(L({},Object(f.b)({transition:"transform ".concat(h,"ms ").concat(p)})),x));var A=d()(V,(D(e={},"".concat(V,"-right"),Object(y.g)(t)&&_&&Object(y.g)(_.x)&&t>=_.x),D(e,"".concat(V,"-left"),Object(y.g)(t)&&_&&Object(y.g)(_.x)&&t<_.x),D(e,"".concat(V,"-bottom"),Object(y.g)(n)&&_&&Object(y.g)(_.y)&&n>=_.y),D(e,"".concat(V,"-top"),Object(y.g)(n)&&_&&Object(y.g)(_.y)&&n<_.y),e));return l.a.createElement("div",{className:A,style:x,ref:function(e){r.wrapperNode=e}},function(e,t){return l.a.isValidElement(e)?l.a.cloneElement(e,t):a()(e)?l.a.createElement(e,t):l.a.createElement(P,t)}(w,L(L({},this.props),{},{payload:g})))}}])&&B(t.prototype,n),r&&B(t,r),s}(c.PureComponent);K.displayName="Tooltip",K.defaultProps={active:!1,allowEscapeViewBox:{x:!1,y:!1},offset:10,viewBox:{x1:0,x2:0,y1:0,y2:0},coordinate:{x:0,y:0},cursorStyle:{},separator:" : ",wrapperStyle:{},contentStyle:{},itemStyle:{},labelStyle:{},cursor:!0,trigger:"hover",isAnimationActive:!R.a.isSsr,animationEasing:"ease",animationDuration:400,filterNull:!0,useTranslate3d:!1}},function(e,t,n){"use strict";var r=n(4),i=n(7),o=n(0),a=(n(18),n(8)),s=n(9),u=n(19),c={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},l=o.forwardRef((function(e,t){var n=e.align,s=void 0===n?"inherit":n,l=e.classes,f=e.className,h=e.color,d=void 0===h?"initial":h,p=e.component,m=e.display,g=void 0===m?"initial":m,v=e.gutterBottom,y=void 0!==v&&v,b=e.noWrap,w=void 0!==b&&b,S=e.paragraph,_=void 0!==S&&S,E=e.variant,M=void 0===E?"body1":E,x=e.variantMapping,k=void 0===x?c:x,O=Object(i.a)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),C=p||(_?"p":k[M]||c[M])||"span";return o.createElement(C,Object(r.a)({className:Object(a.a)(l.root,f,"inherit"!==M&&l[M],"initial"!==d&&l["color".concat(Object(u.a)(d))],w&&l.noWrap,y&&l.gutterBottom,_&&l.paragraph,"inherit"!==s&&l["align".concat(Object(u.a)(s))],"initial"!==g&&l["display".concat(Object(u.a)(g))]),ref:t},O))}));t.a=Object(s.a)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(l)},,,function(e,t,n){var r=n(101)(Object,"create");e.exports=r},function(e,t,n){var r=n(489),i=n(490),o=n(491),a=n(492),s=n(493);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t>>24]^l[p>>>16&255]^f[m>>>8&255]^h[255&g]^t[v++],a=c[p>>>24]^l[m>>>16&255]^f[g>>>8&255]^h[255&d]^t[v++],s=c[m>>>24]^l[g>>>16&255]^f[d>>>8&255]^h[255&p]^t[v++],u=c[g>>>24]^l[d>>>16&255]^f[p>>>8&255]^h[255&m]^t[v++],d=o,p=a,m=s,g=u;return o=(r[d>>>24]<<24|r[p>>>16&255]<<16|r[m>>>8&255]<<8|r[255&g])^t[v++],a=(r[p>>>24]<<24|r[m>>>16&255]<<16|r[g>>>8&255]<<8|r[255&d])^t[v++],s=(r[m>>>24]<<24|r[g>>>16&255]<<16|r[d>>>8&255]<<8|r[255&p])^t[v++],u=(r[g>>>24]<<24|r[d>>>16&255]<<16|r[p>>>8&255]<<8|r[255&m])^t[v++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,n[a]=c,r[c]=a;var l=e[a],f=e[l],h=e[f],d=257*e[c]^16843008*c;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*h^65537*f^257*l^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=l^e[e[e[h^l]]],s^=e[e[s]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:i,INV_SUB_MIX:o}}();function c(e){this._key=i(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),i=[],o=0;o>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/t|0]<<24):t>6&&o%t===4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-t]^a}for(var c=[],l=0;l>>24]]^u.INV_SUB_MIX[1][u.SBOX[h>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[h>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&h]]}this._nRounds=n,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=r.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},c.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var n=a(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=r.allocUnsafe(16);return o.writeUInt32BE(n[0],0),o.writeUInt32BE(n[3],4),o.writeUInt32BE(n[2],8),o.writeUInt32BE(n[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=c},function(e,t,n){var r=n(20).Buffer,i=n(235);e.exports=function(e,t,n,o){if(r.isBuffer(e)||(e=r.from(e,"binary")),t&&(r.isBuffer(t)||(t=r.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=n/8,s=r.alloc(a),u=r.alloc(o||0),c=r.alloc(0);a>0||o>0;){var l=new i;l.update(c),l.update(e),t&&l.update(t),c=l.digest();var f=0;if(a>0){var h=s.length-a;f=Math.min(a,c.length),c.copy(s,h,0,f),a-=f}if(f0){var d=u.length-o,p=Math.min(o,c.length-f);c.copy(u,d,f,f+p),o-=p}}return c.fill(0),{key:s,iv:u}}},function(e,t,n){"use strict";var r=n(81),i=n(54),o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var n=e._getDoubles(),r=o(t,1,this._bitLength),i=(1<=a;l--)u=(u<<1)+r[l];c.push(u)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(a=0;a=0;c--){for(var l=0;c>=0&&0===a[c];c--)l++;if(c>=0&&l++,u=u.dblp(l),c<0)break;var f=a[c];s(0!==f),u="affine"===e.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,n,r,i){var s,u,c,l=this._wnafT1,f=this._wnafT2,h=this._wnafT3,d=0;for(s=0;s=1;s-=2){var m=s-1,g=s;if(1===l[m]&&1===l[g]){var v=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(v[1]=t[m].add(t[g]),v[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(v[1]=t[m].toJ().mixedAdd(t[g]),v[2]=t[m].add(t[g].neg())):(v[1]=t[m].toJ().mixedAdd(t[g]),v[2]=t[m].toJ().mixedAdd(t[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],b=a(n[m],n[g]);for(d=Math.max(b[0].length,d),h[m]=new Array(d),h[g]=new Array(d),u=0;u=0;s--){for(var M=0;s>=0;){var x=!0;for(u=0;u=0&&M++,_=_.dblp(M),s<0)break;for(u=0;u0?c=f[u][k-1>>1]:k<0&&(c=f[u][-k-1>>1].neg()),_="affine"===c.type?_.mixedAdd(c):_.add(c))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,r.nameRegexp);!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var a={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",tagValueProcessor:function(e,t){return e},attrValueProcessor:function(e,t){return e},stopNodes:[]};t.defaultOptions=a;var s=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];function u(e,t,n){return t&&(n.trimValues&&(t=t.trim()),t=l(t=n.tagValueProcessor(t,e),n.parseNodeValue,n.parseTrueNumberOnly)),t}function c(e,t){if(t.ignoreNameSpace){var n=e.split(":"),r="/"===e.charAt(0)?"/":"";if("xmlns"===n[0])return"";2===n.length&&(e=r+n[1])}return e}function l(e,t,n){var i;return t&&"string"===typeof e?(""===e.trim()||isNaN(e)?i="true"===e||"false"!==e&&e:(-1!==e.indexOf("0x")?i=Number.parseInt(e,16):-1!==e.indexOf(".")?(i=Number.parseFloat(e),e=e.replace(/\.?0+$/,"")):i=Number.parseInt(e,10),n&&(i=String(i)===e?i:e)),i):r.isExist(e)?e:""}t.props=s;var f=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function h(e,t){if(!t.ignoreAttributes&&"string"===typeof e){e=e.replace(/\r?\n/g," ");for(var n=r.getAllMatches(e,f),i=n.length,o={},a=0;a"===o)return{data:r,index:i};"\t"===o&&(o=" ")}r+=o}}function p(e,t,n,r){var i=e.indexOf(t,n);if(-1===i)throw new Error(r);return i+t.length-1}t.getTraversalObj=function(e,t){e=e.replace(/\r\n?/g,"\n"),t=i(t,a,s);for(var n=new o("!xml"),c=n,l="",f=0;f",f,"Closing Tag is not closed."),g=e.substring(f+2,m).trim();if(t.ignoreNameSpace){var v=g.indexOf(":");-1!==v&&(g=g.substr(v+1))}c&&(c.val?c.val=r.getValue(c.val)+""+u(g,l,t):c.val=u(g,l,t)),t.stopNodes.length&&t.stopNodes.includes(c.tagname)&&(c.child=[],void 0==c.attrsMap&&(c.attrsMap={}),c.val=e.substr(c.startIndex+1,f-c.startIndex-1)),c=c.parent,l="",f=m}else if("?"===e[f+1])f=p(e,"?>",f,"Pi Tag is not closed.");else if("!--"===e.substr(f+1,3))f=p(e,"--\x3e",f,"Comment is not closed.");else if("!D"===e.substr(f+1,2)){var y=p(e,">",f,"DOCTYPE is not closed.");f=e.substring(f,y).indexOf("[")>=0?e.indexOf("]>",f)+1:y}else if("!["===e.substr(f+1,2)){var b=p(e,"]]>",f,"CDATA is not closed.")-2,w=e.substring(f+9,b);if(l&&(c.val=r.getValue(c.val)+""+u(c.tagname,l,t),l=""),t.cdataTagName){var S=new o(t.cdataTagName,c,w);c.addChild(S),c.val=r.getValue(c.val)+t.cdataPositionChar,w&&(S.val=w)}else c.val=(c.val||"")+(w||"");f=b+2}else{var _=d(e,f+1),E=_.data,M=_.index,x=E.indexOf(" "),k=E,O=!0;if(-1!==x&&(k=E.substr(0,x).replace(/\s\s*$/,""),E=E.substr(x+1)),t.ignoreNameSpace){var C=k.indexOf(":");-1!==C&&(O=(k=k.substr(C+1))!==_.data.substr(C+1))}if(c&&l&&"!xml"!==c.tagname&&(c.val=r.getValue(c.val)+""+u(c.tagname,l,t)),E.length>0&&E.lastIndexOf("/")===E.length-1){E="/"===k[k.length-1]?k=k.substr(0,k.length-1):E.substr(0,E.length-1);var A=new o(k,c,"");k!==E&&(A.attrsMap=h(E,t)),c.addChild(A)}else{var T=new o(k,c);t.stopNodes.length&&t.stopNodes.includes(T.tagname)&&(T.startIndex=M),k!==E&&O&&(T.attrsMap=h(E,t)),c.addChild(T),c=T}l="",f=M}else l+=e[f]}return n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);function i(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},function(e,t,n){"use strict";var r=n(57),i={keyPrefix:"aws-amplify-cache",capacityInBytes:1048576,itemMaxSize:21e4,defaultTTL:2592e5,defaultPriority:5,warningThreshold:.8,storage:(new(n(407).a)).getStorage()};function o(e){var t=0;t=e.length;for(var n=e.length;n>=0;n-=1){var r=e.charCodeAt(n);r>127&&r<=2047?t+=1:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&(n-=1)}return t}function a(){return(new Date).getTime()}function s(e){return Number.isInteger?Number.isInteger(e):function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e}(e)}var u={},c=(function(){function e(){}e.clear=function(){u={}},e.getItem=function(e){return u[e]||null},e.setItem=function(e,t){u[e]=t},e.removeItem=function(e){delete u[e]}}(),n(99)),l=new c.a("StorageCache"),f=function(){function e(e){this.config=Object.assign({},e),this.cacheCurSizeKey=this.config.keyPrefix+"CurSize",this.checkConfig()}return e.prototype.getModuleName=function(){return"Cache"},e.prototype.checkConfig=function(){s(this.config.capacityInBytes)||(l.error("Invalid parameter: capacityInBytes. It should be an Integer. Setting back to default."),this.config.capacityInBytes=i.capacityInBytes),s(this.config.itemMaxSize)||(l.error("Invalid parameter: itemMaxSize. It should be an Integer. Setting back to default."),this.config.itemMaxSize=i.itemMaxSize),s(this.config.defaultTTL)||(l.error("Invalid parameter: defaultTTL. It should be an Integer. Setting back to default."),this.config.defaultTTL=i.defaultTTL),s(this.config.defaultPriority)||(l.error("Invalid parameter: defaultPriority. It should be an Integer. Setting back to default."),this.config.defaultPriority=i.defaultPriority),this.config.itemMaxSize>this.config.capacityInBytes&&(l.error("Invalid parameter: itemMaxSize. It should be smaller than capacityInBytes. Setting back to default."),this.config.itemMaxSize=i.itemMaxSize),(this.config.defaultPriority>5||this.config.defaultPriority<1)&&(l.error("Invalid parameter: defaultPriority. It should be between 1 and 5. Setting back to default."),this.config.defaultPriority=i.defaultPriority),(Number(this.config.warningThreshold)>1||Number(this.config.warningThreshold)<0)&&(l.error("Invalid parameter: warningThreshold. It should be between 0 and 1. Setting back to default."),this.config.warningThreshold=i.warningThreshold);this.config.capacityInBytes>5242880&&(l.error("Cache Capacity should be less than 5MB. Setting back to default. Setting back to default."),this.config.capacityInBytes=i.capacityInBytes)},e.prototype.fillCacheItem=function(e,t,n){var r={key:e,data:t,timestamp:a(),visitedTime:a(),priority:n.priority,expires:n.expires,type:typeof t,byteSize:0};return r.byteSize=o(JSON.stringify(r)),r.byteSize=o(JSON.stringify(r)),r},e.prototype.configure=function(e){return e?(e.keyPrefix&&l.warn("Don't try to configure keyPrefix!"),this.config=Object.assign({},this.config,e,e.Cache),this.checkConfig(),this.config):this.config},e}(),h=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),d=new c.a("Cache"),p=new(function(e){function t(t){var n=this,r=t?Object.assign({},i,t):i;return(n=e.call(this,r)||this).config.storage=r.storage,n.getItem=n.getItem.bind(n),n.setItem=n.setItem.bind(n),n.removeItem=n.removeItem.bind(n),n}return h(t,e),t.prototype._decreaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t-e).toString())},t.prototype._increaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t+e).toString())},t.prototype._refreshItem=function(e,t){return e.visitedTime=a(),this.config.storage.setItem(t,JSON.stringify(e)),e},t.prototype._isExpired=function(e){var t=this.config.storage.getItem(e),n=JSON.parse(t);return a()>=n.expires},t.prototype._removeItem=function(e,t){var n=t||JSON.parse(this.config.storage.getItem(e)).byteSize;this._decreaseCurSizeInBytes(n),this.config.storage.removeItem(e)},t.prototype._setItem=function(e,t){this._increaseCurSizeInBytes(t.byteSize);try{this.config.storage.setItem(e,JSON.stringify(t))}catch(n){this._decreaseCurSizeInBytes(t.byteSize),d.error("Failed to set item "+n)}},t.prototype._sizeToPop=function(e){var t=this.getCacheCurSize()+e-this.config.capacityInBytes,n=(1-this.config.warningThreshold)*this.config.capacityInBytes;return t>n?t:n},t.prototype._isCacheFull=function(e){return e+this.getCacheCurSize()>this.config.capacityInBytes},t.prototype._findValidKeys=function(){for(var e=[],t=[],n=0;nt.priority?-1:e.priority5)d.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var o=this.fillCacheItem(r,t,i);if(o.byteSize>this.config.itemMaxSize)d.warn("Item with key: "+e+" you are trying to put into is too big!");else try{var s=this.config.storage.getItem(r);if(s&&this._removeItem(r,JSON.parse(s).byteSize),this._isCacheFull(o.byteSize)){var u=this._findValidKeys();if(this._isCacheFull(o.byteSize)){var c=this._sizeToPop(o.byteSize);this._popOutItems(u,c)}}this._setItem(r,o)}catch(l){d.warn("setItem failed! "+l)}}}else d.warn("The value of item should not be undefined!");else d.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){d.log("Get item: key is "+e+" with options "+t);var n=null,r=this.config.keyPrefix+e;if(r===this.config.keyPrefix||r===this.cacheCurSizeKey)return d.warn("Invalid key: should not be empty or 'CurSize'"),null;try{if(null!=(n=this.config.storage.getItem(r))){if(!this._isExpired(r)){var i=JSON.parse(n);return(i=this._refreshItem(i,r)).data}this._removeItem(r,JSON.parse(n).byteSize),n=null}if(t&&void 0!==t.callback){var o=t.callback();return null!==o&&this.setItem(e,o,t),o}return null}catch(a){return d.warn("getItem failed! "+a),null}},t.prototype.removeItem=function(e){d.log("Remove item: key is "+e);var t=this.config.keyPrefix+e;if(t!==this.config.keyPrefix&&t!==this.cacheCurSizeKey)try{var n=this.config.storage.getItem(t);n&&this._removeItem(t,JSON.parse(n).byteSize)}catch(r){d.warn("removeItem failed! "+r)}},t.prototype.clear=function(){d.log("Clear Cache");for(var e=[],t=0;t=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2)}return t}return"number"===typeof e.byteLength?e.byteLength:"number"===typeof e.size?e.size:void 0}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(1),i=n(410),o=n.n(i),a=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var e,i,a,s,u,c,l,f,h;return Object(r.__generator)(this,(function(r){return e=(null===(a=null===window||void 0===window?void 0:window.navigator)||void 0===a?void 0:a.userAgent)?o.a.parse(window.navigator.userAgent):void 0,i=[["aws-sdk-js",n],["os/"+((null===(s=null===e||void 0===e?void 0:e.os)||void 0===s?void 0:s.name)||"other"),null===(u=null===e||void 0===e?void 0:e.os)||void 0===u?void 0:u.version],["lang/js"],["md/browser",(null!==(l=null===(c=null===e||void 0===e?void 0:e.browser)||void 0===c?void 0:c.name)&&void 0!==l?l:"unknown")+"_"+(null!==(h=null===(f=null===e||void 0===e?void 0:e.browser)||void 0===f?void 0:f.version)&&void 0!==h?h:"unknown")]],t&&i.push(["api/"+t,n]),[2,i]}))}))}}},function(e,t,n){"use strict";var r=n(60),i=n(64);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(65)).default)(o.createElement("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");t.default=a},function(e,t,n){"use strict";var r=n(60),i=n(64);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(65)).default)(o.createElement("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"}),"Mail");t.default=a},function(e,t,n){"use strict";var r=n(60),i=n(64);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(65)).default)(o.createElement("path",{d:"M22 3H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm3.85-4h1.64L21 16l-1.99 1.99c-1.31-.98-2.28-2.38-2.73-3.99-.18-.64-.28-1.31-.28-2s.1-1.36.28-2c.45-1.62 1.42-3.01 2.73-3.99L21 8l-1.51 2h-1.64c-.22.63-.35 1.3-.35 2s.13 1.37.35 2z"}),"ContactPhone");t.default=a},function(e,t,n){"use strict";var r=n(60),i=n(64);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(65)).default)(o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"}),"AccountCircle");t.default=a},function(e,t,n){"use strict";function r(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(60),i=n(64);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(65)).default)(o.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");t.default=a},function(e,t,n){"use strict";var r=n(60),i=n(64);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(65)).default)(o.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Crc32=t.crc32=void 0;var r=n(1);t.crc32=function(e){return(new i).update(e).digest()};var i=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,n;try{for(var i=r.__values(e),a=i.next();!a.done;a=i.next()){var s=a.value;this.checksum=this.checksum>>>8^o[255&(this.checksum^s)]}}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return this},e.prototype.digest=function(){return(4294967295^this.checksum)>>>0},e}();t.Crc32=i;var o=Uint32Array.from([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117])},function(e,t,n){"use strict";n.r(t),n.d(t,"scaleBand",(function(){return r.a})),n.d(t,"scalePoint",(function(){return r.b})),n.d(t,"scaleIdentity",(function(){return a})),n.d(t,"scaleLinear",(function(){return i.a})),n.d(t,"scaleLog",(function(){return b})),n.d(t,"scaleSymlog",(function(){return E})),n.d(t,"scaleOrdinal",(function(){return M.a})),n.d(t,"scaleImplicit",(function(){return M.b})),n.d(t,"scalePow",(function(){return A})),n.d(t,"scaleSqrt",(function(){return T})),n.d(t,"scaleRadial",(function(){return R})),n.d(t,"scaleQuantile",(function(){return V})),n.d(t,"scaleQuantize",(function(){return K})),n.d(t,"scaleThreshold",(function(){return G})),n.d(t,"scaleTime",(function(){return gn})),n.d(t,"scaleUtc",(function(){return En})),n.d(t,"scaleSequential",(function(){return Cn})),n.d(t,"scaleSequentialLog",(function(){return An})),n.d(t,"scaleSequentialPow",(function(){return In})),n.d(t,"scaleSequentialSqrt",(function(){return Pn})),n.d(t,"scaleSequentialSymlog",(function(){return Tn})),n.d(t,"scaleSequentialQuantile",(function(){return Rn})),n.d(t,"scaleDiverging",(function(){return Ln})),n.d(t,"scaleDivergingLog",(function(){return Dn})),n.d(t,"scaleDivergingPow",(function(){return Bn})),n.d(t,"scaleDivergingSqrt",(function(){return Fn})),n.d(t,"scaleDivergingSymlog",(function(){return Un})),n.d(t,"tickFormat",(function(){return zn.a}));var r=n(258),i=n(44),o=n(105);function a(e){var t;function n(e){return null==e||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,o.a),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return a(e).unknown(t)},e=arguments.length?Array.from(e,o.a):[0,1],Object(i.b)(n)}var s=n(422),u=n(839);function c(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a0){for(;d<=p;++d)for(f=1,l=n(d);fc)break;g.push(h)}}else for(;d<=p;++d)for(f=o-1,l=n(d);f>=1;--f)if(!((h=l*f)c)break;g.push(h)}2*g.length=o)&&(n=o)}}catch(err){i.e(err)}finally{i.f()}}else{var a,s=-1,u=Object(j.a)(e);try{for(u.s();!(a=u.n()).done;){var c=a.value;null!=(c=t(c,++s,e))&&(n=c)&&(n=c)}}catch(err){u.e(err)}finally{u.f()}}return n}function L(e,t){var n;if(void 0===t){var r,i=Object(j.a)(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(n>o||void 0===n&&o>=o)&&(n=o)}}catch(err){i.e(err)}finally{i.f()}}else{var a,s=-1,u=Object(j.a)(e);try{for(u.s();!(a=u.n()).done;){var c=a.value;null!=(c=t(c,++s,e))&&(n>c||void 0===n&&c>=c)&&(n=c)}}catch(err){u.e(err)}finally{u.f()}}return n}var D=n(121);function U(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length-1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:D.a;r>n;){if(r-n>600){var o=r-n+1,a=t-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1),l=Math.max(n,Math.floor(t-a*u/o+c)),f=Math.min(r,Math.floor(t+(o-a)*u/o+c));U(e,t,l,f,i)}var h=e[t],d=n,p=r;for(B(e,n,t),i(e[r],h)>0&&B(e,n,r);d0;)--p}0===i(e[n],h)?B(e,n,p):B(e,++p,r),p<=t&&(n=p+1),t<=p&&(r=p-1)}return e}function B(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}var F=n(156);function z(e,t,n){if(r=(e=Float64Array.from(Object(F.b)(e,n))).length){if((t=+t)<=0||r<2)return L(e);if(t>=1)return N(e);var r,i=(r-1)*t,o=Math.floor(i),a=N(U(e,o).subarray(0,o+1));return a+(L(e.subarray(o+1))-a)*(i-o)}}function q(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:F.a;if(r=e.length){if((t=+t)<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),a=+n(e[o],o,e),s=+n(e[o+1],o+1,e);return a+(s-a)*(i-o)}}var H=n(815);function V(){var e,t=[],n=[],r=[];function i(){var e=0,i=Math.max(1,n.length);for(r=new Array(i-1);++e0?r[i-1]:t[0],i=r?[o[r-1],n]:[o[i-1],o[i]]},s.unknown=function(t){return arguments.length?(e=t,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return K().domain([t,n]).range(a).unknown(e)},f.b.apply(Object(i.b)(s),arguments)}function G(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[Object(H.a)(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return G().domain(t).range(n).unknown(e)},f.b.apply(i,arguments)}var $=n(265),Y=new Date,X=new Date;function Z(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Y.setTime(+t),X.setTime(+r),e(Y),e(X),Math.floor(n(Y,X))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}var J=Z((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));J.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Z((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Q=J,ee=(J.range,Z((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}))),te=ee,ne=(ee.range,1e3),re=6e4,ie=36e5,oe=864e5,ae=6048e5;function se(e){return Z((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*re)/ae}))}var ue=se(0),ce=se(1),le=se(2),fe=se(3),he=se(4),de=se(5),pe=se(6),me=(ue.range,ce.range,le.range,fe.range,he.range,de.range,pe.range,Z((function(e){return e.setHours(0,0,0,0)}),(function(e,t){return e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*re)/oe}),(function(e){return e.getDate()-1}))),ge=me,ve=(me.range,Z((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*ne-e.getMinutes()*re)}),(function(e,t){e.setTime(+e+t*ie)}),(function(e,t){return(t-e)/ie}),(function(e){return e.getHours()}))),ye=ve,be=(ve.range,Z((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*ne)}),(function(e,t){e.setTime(+e+t*re)}),(function(e,t){return(t-e)/re}),(function(e){return e.getMinutes()}))),we=be,Se=(be.range,Z((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*ne)}),(function(e,t){return(t-e)/ne}),(function(e){return e.getUTCSeconds()}))),_e=Se,Ee=(Se.range,Z((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e})));Ee.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?Z((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Ee:null};var Me=Ee;Ee.range;function xe(e){return Z((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/ae}))}var ke=xe(0),Oe=xe(1),Ce=xe(2),Ae=xe(3),Te=xe(4),Ie=xe(5),Pe=xe(6),Re=(ke.range,Oe.range,Ce.range,Ae.range,Te.range,Ie.range,Pe.range,Z((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/oe}),(function(e){return e.getUTCDate()-1}))),je=Re,Ne=(Re.range,Z((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()})));Ne.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Z((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var Le=Ne;Ne.range;function De(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ue(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Be(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var Fe,ze,qe,He={"-":"",_:" ",0:"0"},Ve=/^\s*\d+/,We=/^%/,Ke=/[\\^$*+?|[\]().{}]/g;function Ge(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o68?1900:2e3),n+r[0].length):-1}function it(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ot(e,t,n){var r=Ve.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function at(e,t,n){var r=Ve.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function st(e,t,n){var r=Ve.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function ut(e,t,n){var r=Ve.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ct(e,t,n){var r=Ve.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function lt(e,t,n){var r=Ve.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ft(e,t,n){var r=Ve.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ht(e,t,n){var r=Ve.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function dt(e,t,n){var r=Ve.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function pt(e,t,n){var r=We.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function mt(e,t,n){var r=Ve.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function gt(e,t,n){var r=Ve.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function vt(e,t){return Ge(e.getDate(),t,2)}function yt(e,t){return Ge(e.getHours(),t,2)}function bt(e,t){return Ge(e.getHours()%12||12,t,2)}function wt(e,t){return Ge(1+ge.count(Q(e),e),t,3)}function St(e,t){return Ge(e.getMilliseconds(),t,3)}function _t(e,t){return St(e,t)+"000"}function Et(e,t){return Ge(e.getMonth()+1,t,2)}function Mt(e,t){return Ge(e.getMinutes(),t,2)}function xt(e,t){return Ge(e.getSeconds(),t,2)}function kt(e){var t=e.getDay();return 0===t?7:t}function Ot(e,t){return Ge(ue.count(Q(e)-1,e),t,2)}function Ct(e){var t=e.getDay();return t>=4||0===t?he(e):he.ceil(e)}function At(e,t){return e=Ct(e),Ge(he.count(Q(e),e)+(4===Q(e).getDay()),t,2)}function Tt(e){return e.getDay()}function It(e,t){return Ge(ce.count(Q(e)-1,e),t,2)}function Pt(e,t){return Ge(e.getFullYear()%100,t,2)}function Rt(e,t){return Ge((e=Ct(e)).getFullYear()%100,t,2)}function jt(e,t){return Ge(e.getFullYear()%1e4,t,4)}function Nt(e,t){var n=e.getDay();return Ge((e=n>=4||0===n?he(e):he.ceil(e)).getFullYear()%1e4,t,4)}function Lt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ge(t/60|0,"0",2)+Ge(t%60,"0",2)}function Dt(e,t){return Ge(e.getUTCDate(),t,2)}function Ut(e,t){return Ge(e.getUTCHours(),t,2)}function Bt(e,t){return Ge(e.getUTCHours()%12||12,t,2)}function Ft(e,t){return Ge(1+je.count(Le(e),e),t,3)}function zt(e,t){return Ge(e.getUTCMilliseconds(),t,3)}function qt(e,t){return zt(e,t)+"000"}function Ht(e,t){return Ge(e.getUTCMonth()+1,t,2)}function Vt(e,t){return Ge(e.getUTCMinutes(),t,2)}function Wt(e,t){return Ge(e.getUTCSeconds(),t,2)}function Kt(e){var t=e.getUTCDay();return 0===t?7:t}function Gt(e,t){return Ge(ke.count(Le(e)-1,e),t,2)}function $t(e){var t=e.getUTCDay();return t>=4||0===t?Te(e):Te.ceil(e)}function Yt(e,t){return e=$t(e),Ge(Te.count(Le(e),e)+(4===Le(e).getUTCDay()),t,2)}function Xt(e){return e.getUTCDay()}function Zt(e,t){return Ge(Oe.count(Le(e)-1,e),t,2)}function Jt(e,t){return Ge(e.getUTCFullYear()%100,t,2)}function Qt(e,t){return Ge((e=$t(e)).getUTCFullYear()%100,t,2)}function en(e,t){return Ge(e.getUTCFullYear()%1e4,t,4)}function tn(e,t){var n=e.getUTCDay();return Ge((e=n>=4||0===n?Te(e):Te.ceil(e)).getUTCFullYear()%1e4,t,4)}function nn(){return"+0000"}function rn(){return"%"}function on(e){return+e}function an(e){return Math.floor(+e/1e3)}Fe=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,u=e.shortMonths,c=Ye(i),l=Xe(i),f=Ye(o),h=Xe(o),d=Ye(a),p=Xe(a),m=Ye(s),g=Xe(s),v=Ye(u),y=Xe(u),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:vt,e:vt,f:_t,g:Rt,G:Nt,H:yt,I:bt,j:wt,L:St,m:Et,M:Mt,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:on,s:an,S:xt,u:kt,U:Ot,V:At,w:Tt,W:It,x:null,X:null,y:Pt,Y:jt,Z:Lt,"%":rn},w={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Dt,e:Dt,f:qt,g:Qt,G:tn,H:Ut,I:Bt,j:Ft,L:zt,m:Ht,M:Vt,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:on,s:an,S:Wt,u:Kt,U:Gt,V:Yt,w:Xt,W:Zt,x:null,X:null,y:Jt,Y:en,Z:nn,"%":rn},S={a:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return M(e,t,n,r)},d:st,e:st,f:dt,g:rt,G:nt,H:ct,I:ct,j:ut,L:ht,m:at,M:lt,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=l.get(r[0].toLowerCase()),n+r[0].length):-1},q:ot,Q:mt,s:gt,S:ft,u:Je,U:Qe,V:et,w:Ze,W:tt,x:function(e,t,r){return M(e,n,t,r)},X:function(e,t,n){return M(e,r,t,n)},y:rt,Y:nt,Z:it,"%":pt};function _(e,t){return function(n){var r,i,o,a=[],s=-1,u=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Ue(Be(o.y,0,1))).getUTCDay(),r=i>4||0===i?Oe.ceil(r):Oe(r),r=je.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=De(Be(o.y,0,1))).getDay(),r=i>4||0===i?ce.ceil(r):ce(r),r=ge.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Ue(Be(o.y,0,1)).getUTCDay():De(Be(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Ue(o)):De(o)}}function M(e,t,n,r){for(var i,o,a=0,s=t.length,u=n.length;a=u)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=S[i in He?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=_(n,b),b.X=_(r,b),b.c=_(t,b),w.x=_(n,w),w.X=_(r,w),w.c=_(t,w),{format:function(e){var t=_(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=_(e+="",w);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),ze=Fe.format,Fe.parse,qe=Fe.utcFormat,Fe.utcParse;var sn=1e3,un=6e4,cn=36e5,ln=864e5,fn=2592e6,hn=31536e6;function dn(e){return new Date(e)}function pn(e){return e instanceof Date?+e:+new Date(+e)}function mn(e,t,n,r,i,o,a,u,f){var h=Object(l.b)(),d=h.invert,p=h.domain,m=f(".%L"),g=f(":%S"),v=f("%I:%M"),y=f("%I %p"),b=f("%a %d"),w=f("%b %d"),S=f("%B"),_=f("%Y"),E=[[a,1,sn],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,un],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,cn],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,ln],[r,2,1728e5],[n,1,6048e5],[t,1,fn],[t,3,7776e6],[e,1,hn]];function M(s){return(a(s)-1&&delete e.headers[a]}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return e}function I(e){return function(e){if("number"===typeof e)return new Date(1e3*e);if("string"===typeof e)return Number(e)?new Date(1e3*Number(e)):new Date(e);return e}(e).toISOString().replace(/\.\d{3}Z$/,"Z")}var P=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,i=e.service,o=e.sha256,a=e.uriEscapePath,s=void 0===a||a;this.service=i,this.sha256=o,this.uriEscapePath=s,this.applyChecksum="boolean"!==typeof t||t,this.regionProvider=N(r),this.credentialProvider=L(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),Object(r.__awaiter)(this,void 0,void 0,(function(){var n,i,o,u,c,l,f,h,d,p,m,g,y,b,w,S,E,x,k,A,I,P,N,L;return Object(r.__generator)(this,(function(D){switch(D.label){case 0:return n=t.signingDate,i=void 0===n?new Date:n,o=t.expiresIn,u=void 0===o?3600:o,c=t.unsignableHeaders,l=t.unhoistableHeaders,f=t.signableHeaders,h=t.signingRegion,d=t.signingService,[4,this.credentialProvider()];case 1:return p=D.sent(),null===h||void 0===h?[3,2]:(g=h,[3,4]);case 2:return[4,this.regionProvider()];case 3:g=D.sent(),D.label=4;case 4:return m=g,y=R(i),b=y.longDate,w=y.shortDate,u>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(S=_(w,m,null!==d&&void 0!==d?d:this.service),E=function(e,t){var n,i,o;void 0===t&&(t={});var a="function"===typeof e.clone?e.clone():C(e),s=a.headers,u=a.query,c=void 0===u?{}:u;try{for(var l=Object(r.__values)(Object.keys(s)),f=l.next();!f.done;f=l.next()){var h=f.value,d=h.toLowerCase();"x-amz-"!==d.substr(0,6)||(null===(o=t.unhoistableHeaders)||void 0===o?void 0:o.has(d))||(c[h]=s[h],delete s[h])}}catch(p){n={error:p}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return Object(r.__assign)(Object(r.__assign)({},e),{headers:s,query:c})}(T(e),{unhoistableHeaders:l}),p.sessionToken&&(E.query[s]=p.sessionToken),E.query["X-Amz-Algorithm"]=v,E.query["X-Amz-Credential"]=p.accessKeyId+"/"+S,E.query["X-Amz-Date"]=b,E.query["X-Amz-Expires"]=u.toString(10),x=M(E,c,f),E.query["X-Amz-SignedHeaders"]=j(x),k=E.query,A=a,I=this.getSignature,P=[b,S,this.getSigningKey(p,m,w,d)],N=this.createCanonicalRequest,L=[E,x],[4,O(e,this.sha256)]);case 5:return[4,I.apply(this,P.concat([N.apply(this,L.concat([D.sent()]))]))];case 6:return k[A]=D.sent(),[2,E]}}))}))},e.prototype.sign=function(e,t){return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__generator)(this,(function(n){return"string"===typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]}))}))},e.prototype.signEvent=function(e,t){var n=e.headers,o=e.payload,a=t.signingDate,s=void 0===a?new Date:a,u=t.priorSignature,c=t.signingRegion,l=t.signingService;return Object(r.__awaiter)(this,void 0,void 0,(function(){var e,t,a,f,h,d,p,m,g,v,b;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return null===c||void 0===c?[3,1]:(t=c,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=r.sent(),r.label=3;case 3:return e=t,a=R(s),f=a.shortDate,h=a.longDate,d=_(f,e,null!==l&&void 0!==l?l:this.service),[4,O({headers:{},body:o},this.sha256)];case 4:return p=r.sent(),(m=new this.sha256).update(n),v=i.b,[4,m.digest()];case 5:return g=v.apply(void 0,[r.sent()]),b=[y,h,d,u,g,p].join("\n"),[2,this.signString(b,{signingDate:s,signingRegion:e,signingService:l})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,o=n.signingDate,a=void 0===o?new Date:o,s=n.signingRegion,u=n.signingService;return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,n,o,c,l,f,h,d;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[4,this.credentialProvider()];case 1:return t=r.sent(),null===s||void 0===s?[3,2]:(o=s,[3,4]);case 2:return[4,this.regionProvider()];case 3:o=r.sent(),r.label=4;case 4:return n=o,c=R(a).shortDate,h=(f=this.sha256).bind,[4,this.getSigningKey(t,n,c,u)];case 5:return(l=new(h.apply(f,[void 0,r.sent()]))).update(e),d=i.b,[4,l.digest()];case 6:return[2,d.apply(void 0,[r.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,i=n.signingDate,o=void 0===i?new Date:i,a=n.signableHeaders,s=n.unsignableHeaders,l=n.signingRegion,f=n.signingService;return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,n,i,p,m,g,v,y,b,w,S;return Object(r.__generator)(this,(function(E){switch(E.label){case 0:return[4,this.credentialProvider()];case 1:return t=E.sent(),null===l||void 0===l?[3,2]:(i=l,[3,4]);case 2:return[4,this.regionProvider()];case 3:i=E.sent(),E.label=4;case 4:return n=i,p=T(e),m=R(o),g=m.longDate,v=m.shortDate,y=_(v,n,null!==f&&void 0!==f?f:this.service),p.headers[c]=g,t.sessionToken&&(p.headers[d]=t.sessionToken),[4,O(p,this.sha256)];case 5:return b=E.sent(),!function(e,t){var n,i;e=e.toLowerCase();try{for(var o=Object(r.__values)(Object.keys(t)),a=o.next();!a.done;a=o.next())if(e===a.value.toLowerCase())return!0}catch(s){n={error:s}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return!1}(h,p.headers)&&this.applyChecksum&&(p.headers[h]=b),w=M(p,s,a),[4,this.getSignature(g,y,this.getSigningKey(t,n,v,f),this.createCanonicalRequest(p,w,b))];case 6:return S=E.sent(),p.headers[u]="AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+y+", SignedHeaders="+j(w)+", Signature="+S,[2,p]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var i=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,n,i=e.query,o=void 0===i?{}:i,a=[],s={},u=function(e){if(e.toLowerCase()===f)return"continue";a.push(e);var t=o[e];"string"===typeof t?s[e]=Object(x.a)(e)+"="+Object(x.a)(t):Array.isArray(t)&&(s[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([Object(x.a)(e)+"="+Object(x.a)(n)])}),[]).join("&"))};try{for(var c=Object(r.__values)(Object.keys(o).sort()),l=c.next();!l.done;l=c.next())u(l.value)}catch(h){t={error:h}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return a.map((function(e){return s[e]})).filter((function(e){return e})).join("&")}(e)+"\n"+i.map((function(e){return e+":"+t[e]})).join("\n")+"\n\n"+i.join(";")+"\n"+n},e.prototype.createStringToSign=function(e,t,n){return Object(r.__awaiter)(this,void 0,void 0,(function(){var o,a;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return(o=new this.sha256).update(n),[4,o.digest()];case 1:return a=r.sent(),[2,"AWS4-HMAC-SHA256\n"+e+"\n"+t+"\n"+Object(i.b)(a)]}}))}))},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,n,o){return Object(r.__awaiter)(this,void 0,void 0,(function(){var a,s,u,c,l;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[4,this.createStringToSign(e,t,o)];case 1:return a=r.sent(),c=(u=this.sha256).bind,[4,n];case 2:return(s=new(c.apply(u,[void 0,r.sent()]))).update(a),l=i.b,[4,s.digest()];case 3:return[2,l.apply(void 0,[r.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,o){return function(e,t,n,o,a){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var s,u,c,l,f,h,d,p,m;return Object(r.__generator)(this,(function(g){switch(g.label){case 0:return[4,E(e,t.secretAccessKey,t.accessKeyId)];case 1:if(s=g.sent(),(u=n+":"+o+":"+a+":"+Object(i.b)(s)+":"+t.sessionToken)in w)return[2,w[u]];for(S.push(u);S.length>50;)delete w[S.shift()];c="AWS4"+t.secretAccessKey,g.label=2;case 2:g.trys.push([2,7,8,9]),l=Object(r.__values)([n,o,a,b]),f=l.next(),g.label=3;case 3:return f.done?[3,6]:(h=f.value,[4,E(e,c,h)]);case 4:c=g.sent(),g.label=5;case 5:return f=l.next(),[3,3];case 6:return[3,9];case 7:return d=g.sent(),p={error:d},[3,9];case 8:try{f&&!f.done&&(m=l.return)&&m.call(l)}finally{if(p)throw p.error}return[7];case 9:return[2,w[u]=c]}}))}))}(this.sha256,e,n,t,o||this.service)},e}(),R=function(e){var t=I(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.substr(0,8)}},j=function(e){return Object.keys(e).sort().join(";")},N=function(e){if("string"===typeof e){var t=Promise.resolve(e);return function(){return t}}return e},L=function(e){if("object"===typeof e){var t=Promise.resolve(e);return function(){return t}}return e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){return function(){return Promise.reject(e)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(1),i={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},o=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var i,o,a,s,u,c,l,f,h;return Object(r.__generator)(this,(function(d){switch(d.label){case 0:return i=t.clientName,o=t.commandName,a=t.inputFilterSensitiveLog,s=t.logger,u=t.outputFilterSensitiveLog,[4,e(n)];case 1:return c=d.sent(),s?("function"===typeof s.info&&(l=c.output,f=l.$metadata,h=Object(r.__rest)(l,["$metadata"]),s.info({clientName:i,commandName:o,input:a(n.input),output:u(h),metadata:f})),[2,c]):[2,c]}}))}))}}),i)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(1);var i=function(e){var t,n=new URL(e),i=n.hostname,o=n.pathname,a=n.port,s=n.protocol,u=n.search;return u&&(t=function(e){var t,n,i={};if(e=e.replace(/^\?/,""))try{for(var o=Object(r.__values)(e.split("&")),a=o.next();!a.done;a=o.next()){var s=a.value,u=Object(r.__read)(s.split("="),2),c=u[0],l=u[1],f=void 0===l?null:l;c=decodeURIComponent(c),f&&(f=decodeURIComponent(f)),c in i?Array.isArray(i[c])?i[c].push(f):i[c]=[i[c],f]:i[c]=f}}catch(h){t={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i}(u)),{hostname:i,port:a?parseInt(a):void 0,protocol:s,path:o,query:t}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(587)),i=n(592),o=s(n(310)),a=s(n(595));function s(e){return e&&e.__esModule?e:{default:e}}var u=/((?:\-[a-z]+\-)?calc)/;t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;return(0,r.default)(e).walk((function(e){if("function"===e.type&&u.test(e.value)){var n=r.default.stringify(e.nodes);if(!(n.indexOf("constant")>=0||n.indexOf("env")>=0)){var s=i.parser.parse(n),c=(0,o.default)(s,t);e.type="word",e.value=(0,a.default)(e.value,c,t)}}}),!0).toString()},e.exports=t.default},function(e,t,n){"use strict";n.d(t,"a",(function(){return U}));var r=n(13),i=n.n(r),o=n(0),a=n.n(o),s=n(15),u=n.n(s),c=n(33),l=n(123),f=n(62),h=n(5),d=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r="extendDomain"),r===t},p=n(76),m=n(74),g=n(12);function v(){return(v=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&t.handleDrag(e.changedTouches[0])},t.handleDragEnd=function(){t.setState({isTravellerMoving:!1,isSlideMoving:!1}),t.detachDragEndListener()},t.handleLeaveWrapper=function(){(t.state.isTravellerMoving||t.state.isSlideMoving)&&(t.leaveTimer=window.setTimeout(t.handleDragEnd,t.props.leaveTimeOut))},t.handleEnterSlideOrTraveller=function(){t.setState({isTextActive:!0})},t.handleLeaveSlideOrTraveller=function(){t.setState({isTextActive:!1})},t.handleSlideDragStart=function(e){var n=P(e)?e.changedTouches[0]:e;t.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:n.pageX}),t.attachDragEndListener()},t.travellerDragStartHandlers={startX:t.handleTravellerDragStart.bind(T(t),"startX"),endX:t.handleTravellerDragStart.bind(T(t),"endX")},t.state={},t}return t=c,r=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=e.stroke,a=Math.floor(n+i/2)-1;return u.a.createElement(u.a.Fragment,null,u.a.createElement("rect",{x:t,y:n,width:r,height:i,fill:o,stroke:"none"}),u.a.createElement("line",{x1:t+1,y1:a,x2:t+r-1,y2:a,fill:"none",stroke:"#fff"}),u.a.createElement("line",{x1:t+1,y1:a+2,x2:t+r-1,y2:a+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,t){return u.a.isValidElement(e)?u.a.cloneElement(e,t):i()(e)?e(t):c.renderDefaultTraveller(t)}},{key:"getDerivedStateFromProps",value:function(e,t){var n=e.data,r=e.width,i=e.x,o=e.travellerWidth,s=e.updateId,u=e.startIndex,c=e.endIndex;if(n!==t.prevData||s!==t.prevUpdateId)return M({prevData:n,prevTravellerWidth:o,prevUpdateId:s,prevX:i,prevWidth:r},n&&n.length?function(e){var t=e.data,n=e.startIndex,r=e.endIndex,i=e.x,o=e.width,s=e.travellerWidth;if(!t||!t.length)return{};var u=t.length,c=Object(f.b)().domain(a()(0,u)).range([i,i+o-s]),l=c.domain().map((function(e){return c(e)}));return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,startX:c(n),endX:c(r),scale:c,scaleValues:l}}({data:n,width:r,x:i,travellerWidth:o,startIndex:u,endIndex:c}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||i!==t.prevX||o!==t.prevTravellerWidth)){t.scale.range([i,i+r-o]);var l=t.scale.domain().map((function(e){return t.scale(e)}));return{prevData:n,prevTravellerWidth:o,prevUpdateId:s,prevX:i,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:l}}return null}},{key:"getIndexInRange",value:function(e,t){for(var n=0,r=e.length-1;r-n>1;){var i=Math.floor((n+r)/2);e[i]>t?r=i:n=i}return t>=e[r]?r:n}}],(n=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var t=e.startX,n=e.endX,r=this.state.scaleValues,i=this.props,o=i.gap,a=i.data.length-1,s=Math.min(t,n),u=Math.max(t,n),l=c.getIndexInRange(r,s),f=c.getIndexInRange(r,u);return{startIndex:l-l%o,endIndex:f===a?a:f-f%o}}},{key:"getTextOfTick",value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,o=t.dataKey,a=Object(p.t)(n[e],o,e);return i()(r)?r(a,e):a}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,i=t.endX,o=this.props,a=o.x,s=o.width,u=o.travellerWidth,c=o.startIndex,l=o.endIndex,f=o.onChange,h=e.pageX-n;h>0?h=Math.min(h,a+s-u-i,a+s-u-r):h<0&&(h=Math.max(h,a-r,a-i));var d=this.getIndex({startX:r+h,endX:i+h});d.startIndex===c&&d.endIndex===l||!f||f(d),this.setState({startX:r+h,endX:i+h,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var n=P(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t,n=this.state,r=n.brushMoveStartX,i=n.movingTravellerId,o=n.endX,a=n.startX,s=this.state[i],u=this.props,c=u.x,l=u.width,f=u.travellerWidth,h=u.onChange,d=u.gap,p=u.data,m={startX:this.state.startX,endX:this.state.endX},g=e.pageX-r;g>0?g=Math.min(g,c+l-f-s):g<0&&(g=Math.max(g,c-s)),m[i]=s+g;var v=this.getIndex(m),y=v.startIndex,b=v.endIndex;this.setState((x(t={},i,s+g),x(t,"brushMoveStartX",e.pageX),t),(function(){h&&function(){var e=p.length-1;return"startX"===i&&(o>a?y%d===0:b%d===0)||oa?b%d===0:y%d===0)||o>a&&b===e}()&&h(v)}))}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,o=e.fill,a=e.stroke;return u.a.createElement("rect",{stroke:a,fill:o,x:t,y:n,width:r,height:i})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,o=e.data,a=e.children,c=e.padding,l=s.Children.only(a);return l?u.a.cloneElement(l,{x:t,y:n,width:r,height:i,margin:c,compact:!0,data:o}):null}},{key:"renderTravellerLayer",value:function(e,t){var n=this.props,r=n.y,i=n.travellerWidth,o=n.height,a=n.traveller,s=Math.max(e,this.props.x),l=M(M({},Object(w.c)(this.props)),{},{x:s,y:r,width:i,height:o});return u.a.createElement(h.a,{className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],style:{cursor:"col-resize"}},c.renderTraveller(a,l))}},{key:"renderSlide",value:function(e,t){var n=this.props,r=n.y,i=n.height,o=n.stroke,a=n.travellerWidth,s=Math.min(e,t)+a,c=Math.max(Math.abs(t-e)-a,0);return u.a.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:o,fillOpacity:.2,x:s,y:r,width:c,height:i})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,r=e.y,i=e.height,o=e.travellerWidth,a=e.stroke,s=this.state,c=s.startX,l=s.endX,f={pointerEvents:"none",fill:a};return u.a.createElement(h.a,{className:"recharts-brush-texts"},u.a.createElement(d.a,_({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,l)-5,y:r+i/2},f),this.getTextOfTick(t)),u.a.createElement(d.a,_({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,l)+o+5,y:r+i/2},f),this.getTextOfTick(n)))}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.className,r=e.children,i=e.x,o=e.y,a=e.width,s=e.height,c=e.alwaysShowText,f=this.state,d=f.startX,p=f.endX,g=f.isTextActive,w=f.isSlideMoving,S=f.isTravellerMoving;if(!t||!t.length||!Object(m.g)(i)||!Object(m.g)(o)||!Object(m.g)(a)||!Object(m.g)(s)||a<=0||s<=0)return null;var _=l()("recharts-brush",n),E=1===u.a.Children.count(r),M=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,(function(e){return e.toUpperCase()})),r=b.reduce((function(e,r){return v(v({},e),{},y({},r+n,t))}),{});return r[e]=t,r}("userSelect","none");return u.a.createElement(h.a,{className:_,onMouseMove:this.handleDrag,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:M},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(d,p),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(p,"endX"),(g||w||S||c)&&this.renderText())}}])&&k(t.prototype,n),r&&k(t,r),c}(s.PureComponent);R.displayName="Brush",R.defaultProps={height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1}},,function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(err){return!1}}()?Object.assign:function(e,t){for(var n,s,u=a(e),c=1;c=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(503),t.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(36))},function(e,t,n){var r=n(291),i=n(518)(r);e.exports=i},function(e,t,n){var r=n(510),i=n(88),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var r=n(526),i=n(88);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!==t&&n!==n:r(t,n,o,a,e,s))}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(300),i=n(553);e.exports=function e(t,n,o,a,s){var u=-1,c=t.length;for(o||(o=i),s||(s=[]);++u0&&o(l)?n>1?e(l,n-1,o,a,s):r(s,l):a||(s[s.length]=l)}return s}},function(e,t,n){(function(e){var t;!function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};t[a][0].call(c.exports,(function(e){return i(t[a][1][e]||e)}),c,c.exports,e,t,n,r)}return n[a].exports}for(var o=!1,a=0;a-1});var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object DataView]"];t.exports={isEmptyData:function(e){return"string"===typeof e?0===e.length:0===e.byteLength},convertToBuffer:function(e){return"string"===typeof e&&(e=new r(e,"utf8")),ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}}},{"buffer/":80}],12:[function(e,t,n){var r=e("./browserHashUtils");function i(e,t){this.hash=new e,this.outer=new e;var n=function(e,t){var n=r.convertToBuffer(t);if(n.byteLength>e.BLOCK_SIZE){var i=new e;i.update(n),n=i.digest()}var o=new Uint8Array(e.BLOCK_SIZE);return o.set(n),o}(e,t),i=new Uint8Array(e.BLOCK_SIZE);i.set(n);for(var o=0;o>>32-i)+n&4294967295}function u(e,t,n,r,i,o,a){return s(t&n|~t&r,e,t,i,o,a)}function c(e,t,n,r,i,o,a){return s(t&r|n&~r,e,t,i,o,a)}function l(e,t,n,r,i,o,a){return s(t^n^r,e,t,i,o,a)}function f(e,t,n,r,i,o,a){return s(n^(t|~r),e,t,i,o,a)}t.exports=a,a.BLOCK_SIZE=o,a.prototype.update=function(e){if(r.isEmptyData(e))return this;if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=r.convertToBuffer(e),n=0,i=t.byteLength;for(this.bytesHashed+=i;i>0;)this.buffer.setUint8(this.bufferLength++,t[n++]),i--,this.bufferLength===o&&(this.hashBuffer(),this.bufferLength=0);return this},a.prototype.digest=function(e){if(!this.finished){var t=this,n=t.buffer,r=t.bufferLength,a=8*t.bytesHashed;if(n.setUint8(this.bufferLength++,128),r%o>=56){for(var s=this.bufferLength;s>>0,!0),n.setUint32(60,Math.floor(a/4294967296),!0),this.hashBuffer(),this.finished=!0}var u=new DataView(new ArrayBuffer(16));for(s=0;s<4;s++)u.setUint32(4*s,this.state[s],!0);var c=new i(u.buffer,u.byteOffset,u.byteLength);return e?c.toString(e):c},a.prototype.hashBuffer=function(){var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],o=t[3];n=u(n,r,i,o,e.getUint32(0,!0),7,3614090360),o=u(o,n,r,i,e.getUint32(4,!0),12,3905402710),i=u(i,o,n,r,e.getUint32(8,!0),17,606105819),r=u(r,i,o,n,e.getUint32(12,!0),22,3250441966),n=u(n,r,i,o,e.getUint32(16,!0),7,4118548399),o=u(o,n,r,i,e.getUint32(20,!0),12,1200080426),i=u(i,o,n,r,e.getUint32(24,!0),17,2821735955),r=u(r,i,o,n,e.getUint32(28,!0),22,4249261313),n=u(n,r,i,o,e.getUint32(32,!0),7,1770035416),o=u(o,n,r,i,e.getUint32(36,!0),12,2336552879),i=u(i,o,n,r,e.getUint32(40,!0),17,4294925233),r=u(r,i,o,n,e.getUint32(44,!0),22,2304563134),n=u(n,r,i,o,e.getUint32(48,!0),7,1804603682),o=u(o,n,r,i,e.getUint32(52,!0),12,4254626195),i=u(i,o,n,r,e.getUint32(56,!0),17,2792965006),n=c(n,r=u(r,i,o,n,e.getUint32(60,!0),22,1236535329),i,o,e.getUint32(4,!0),5,4129170786),o=c(o,n,r,i,e.getUint32(24,!0),9,3225465664),i=c(i,o,n,r,e.getUint32(44,!0),14,643717713),r=c(r,i,o,n,e.getUint32(0,!0),20,3921069994),n=c(n,r,i,o,e.getUint32(20,!0),5,3593408605),o=c(o,n,r,i,e.getUint32(40,!0),9,38016083),i=c(i,o,n,r,e.getUint32(60,!0),14,3634488961),r=c(r,i,o,n,e.getUint32(16,!0),20,3889429448),n=c(n,r,i,o,e.getUint32(36,!0),5,568446438),o=c(o,n,r,i,e.getUint32(56,!0),9,3275163606),i=c(i,o,n,r,e.getUint32(12,!0),14,4107603335),r=c(r,i,o,n,e.getUint32(32,!0),20,1163531501),n=c(n,r,i,o,e.getUint32(52,!0),5,2850285829),o=c(o,n,r,i,e.getUint32(8,!0),9,4243563512),i=c(i,o,n,r,e.getUint32(28,!0),14,1735328473),n=l(n,r=c(r,i,o,n,e.getUint32(48,!0),20,2368359562),i,o,e.getUint32(20,!0),4,4294588738),o=l(o,n,r,i,e.getUint32(32,!0),11,2272392833),i=l(i,o,n,r,e.getUint32(44,!0),16,1839030562),r=l(r,i,o,n,e.getUint32(56,!0),23,4259657740),n=l(n,r,i,o,e.getUint32(4,!0),4,2763975236),o=l(o,n,r,i,e.getUint32(16,!0),11,1272893353),i=l(i,o,n,r,e.getUint32(28,!0),16,4139469664),r=l(r,i,o,n,e.getUint32(40,!0),23,3200236656),n=l(n,r,i,o,e.getUint32(52,!0),4,681279174),o=l(o,n,r,i,e.getUint32(0,!0),11,3936430074),i=l(i,o,n,r,e.getUint32(12,!0),16,3572445317),r=l(r,i,o,n,e.getUint32(24,!0),23,76029189),n=l(n,r,i,o,e.getUint32(36,!0),4,3654602809),o=l(o,n,r,i,e.getUint32(48,!0),11,3873151461),i=l(i,o,n,r,e.getUint32(60,!0),16,530742520),n=f(n,r=l(r,i,o,n,e.getUint32(8,!0),23,3299628645),i,o,e.getUint32(0,!0),6,4096336452),o=f(o,n,r,i,e.getUint32(28,!0),10,1126891415),i=f(i,o,n,r,e.getUint32(56,!0),15,2878612391),r=f(r,i,o,n,e.getUint32(20,!0),21,4237533241),n=f(n,r,i,o,e.getUint32(48,!0),6,1700485571),o=f(o,n,r,i,e.getUint32(12,!0),10,2399980690),i=f(i,o,n,r,e.getUint32(40,!0),15,4293915773),r=f(r,i,o,n,e.getUint32(4,!0),21,2240044497),n=f(n,r,i,o,e.getUint32(32,!0),6,1873313359),o=f(o,n,r,i,e.getUint32(60,!0),10,4264355552),i=f(i,o,n,r,e.getUint32(24,!0),15,2734768916),r=f(r,i,o,n,e.getUint32(52,!0),21,1309151649),n=f(n,r,i,o,e.getUint32(16,!0),6,4149444226),o=f(o,n,r,i,e.getUint32(44,!0),10,3174756917),i=f(i,o,n,r,e.getUint32(8,!0),15,718787259),r=f(r,i,o,n,e.getUint32(36,!0),21,3951481745),t[0]=n+t[0]&4294967295,t[1]=r+t[1]&4294967295,t[2]=i+t[2]&4294967295,t[3]=o+t[3]&4294967295}},{"./browserHashUtils":11,"buffer/":80}],14:[function(e,t,n){var r=e("buffer/").Buffer,i=e("./browserHashUtils");new Uint32Array([1518500249,1859775393,-1894007588,-899497514]),Math.pow(2,53);function o(){this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=new Uint32Array(80),this.offset=0,this.shift=24,this.totalLength=0}t.exports=o,o.BLOCK_SIZE=64,o.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");if(i.isEmptyData(e))return this;var t=(e=i.convertToBuffer(e)).length;this.totalLength+=8*t;for(var n=0;n14||14===this.offset&&this.shift<24)&&this.processBlock(),this.offset=14,this.shift=24,this.write(0),this.write(0),this.write(this.totalLength>0xffffffffff?this.totalLength/1099511627776:0),this.write(this.totalLength>4294967295?this.totalLength/4294967296:0);for(var t=24;t>=0;t-=8)this.write(this.totalLength>>t);var n=new r(20),i=new DataView(n.buffer);return i.setUint32(0,this.h0,!1),i.setUint32(4,this.h1,!1),i.setUint32(8,this.h2,!1),i.setUint32(12,this.h3,!1),i.setUint32(16,this.h4,!1),e?n.toString(e):n},o.prototype.processBlock=function(){for(var e=16;e<80;e++){var t=this.block[e-3]^this.block[e-8]^this.block[e-14]^this.block[e-16];this.block[e]=t<<1|t>>>31}var n,r,i=this.h0,o=this.h1,a=this.h2,s=this.h3,u=this.h4;for(e=0;e<80;e++){e<20?(n=s^o&(a^s),r=1518500249):e<40?(n=o^a^s,r=1859775393):e<60?(n=o&a|s&(o|a),r=2400959708):(n=o^a^s,r=3395469782);var c=(i<<5|i>>>27)+n+u+r+(0|this.block[e]);u=s,s=a,a=o<<30|o>>>2,o=i,i=c}for(this.h0=this.h0+i|0,this.h1=this.h1+o|0,this.h2=this.h2+a|0,this.h3=this.h3+s|0,this.h4=this.h4+u|0,this.offset=0,e=0;e<16;e++)this.block[e]=0}},{"./browserHashUtils":11,"buffer/":80}],15:[function(e,t,n){var r=e("buffer/").Buffer,i=e("./browserHashUtils"),o=64,a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=Math.pow(2,53)-1;function u(){this.state=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}t.exports=u,u.BLOCK_SIZE=o,u.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");if(i.isEmptyData(e))return this;var t=0,n=(e=i.convertToBuffer(e)).byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>s)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===o&&(this.hashBuffer(),this.bufferLength=0);return this},u.prototype.digest=function(e){if(!this.finished){var t=8*this.bytesHashed,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(n.setUint8(this.bufferLength++,128),i%o>=56){for(var a=this.bufferLength;a>>24&255,s[4*a+1]=this.state[a]>>>16&255,s[4*a+2]=this.state[a]>>>8&255,s[4*a+3]=this.state[a]>>>0&255;return e?s.toString(e):s},u.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],s=t[3],u=t[4],c=t[5],l=t[6],f=t[7],h=0;h>>17|d<<15)^(d>>>19|d<<13)^d>>>10,m=((d=this.temp[h-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[h]=(p+this.temp[h-7]|0)+(m+this.temp[h-16]|0)}var g=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&c^~u&l)|0)+(f+(a[h]+this.temp[h]|0)|0)|0,v=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&r^n&i^r&i)|0;f=l,l=c,c=u,u=s+g|0,s=i,i=r,r=n,n=g+v|0}t[0]+=n,t[1]+=r,t[2]+=i,t[3]+=s,t[4]+=u,t[5]+=c,t[6]+=l,t[7]+=f}},{"./browserHashUtils":11,"buffer/":80}],16:[function(e,t,n){(function(n){var r=e("./util");r.crypto.lib=e("./browserCryptoLib"),r.Buffer=e("buffer/").Buffer,r.url=e("url/"),r.querystring=e("querystring/"),r.realClock=e("./realclock/browserClock"),r.environment="js",r.createEventStream=e("./event-stream/buffered-create-event-stream").createEventStream,r.isBrowser=function(){return!0},r.isNode=function(){return!1};var i=e("./core");if(t.exports=i,e("./credentials"),e("./credentials/credential_provider_chain"),e("./credentials/temporary_credentials"),e("./credentials/chainable_temporary_credentials"),e("./credentials/web_identity_credentials"),e("./credentials/cognito_identity_credentials"),e("./credentials/saml_credentials"),i.XML.Parser=e("./xml/browser_parser"),e("./http/xhr"),"undefined"===typeof n)n={browser:!0}}).call(this,e("_process"))},{"./browserCryptoLib":10,"./core":18,"./credentials":19,"./credentials/chainable_temporary_credentials":20,"./credentials/cognito_identity_credentials":21,"./credentials/credential_provider_chain":22,"./credentials/saml_credentials":23,"./credentials/temporary_credentials":24,"./credentials/web_identity_credentials":25,"./event-stream/buffered-create-event-stream":27,"./http/xhr":35,"./realclock/browserClock":52,"./util":71,"./xml/browser_parser":72,_process:85,"buffer/":80,"querystring/":92,"url/":94}],17:[function(e,t,n){var r,i=e("./core");e("./credentials"),e("./credentials/credential_provider_chain"),i.Config=i.util.inherit({constructor:function(e){void 0===e&&(e={}),e=this.extractCredentials(e),i.util.each.call(this,this.keys,(function(t,n){this.set(t,e[t],n)}))},getCredentials:function(e){var t=this;function n(n){e(n,n?null:t.credentials)}function r(e,t){return new i.util.error(t||new Error,{code:"CredentialsError",message:e,name:"CredentialsError"})}t.credentials?"function"===typeof t.credentials.get?t.credentials.get((function(e){e&&(e=r("Could not load credentials from "+t.credentials.constructor.name,e)),n(e)})):function(){var e=null;t.credentials.accessKeyId&&t.credentials.secretAccessKey||(e=r("Missing credentials")),n(e)}():t.credentialProvider?t.credentialProvider.resolve((function(e,i){e&&(e=r("Could not load credentials from any providers",e)),t.credentials=i,n(e)})):n(r("No credentials to load"))},update:function(e,t){t=t||!1,e=this.extractCredentials(e),i.util.each.call(this,e,(function(e,n){(t||Object.prototype.hasOwnProperty.call(this.keys,e)||i.Service.hasService(e))&&this.set(e,n)}))},loadFromPath:function(e){this.clear();var t=JSON.parse(i.util.readFileSync(e)),n=new i.FileSystemCredentials(e),r=new i.CredentialProviderChain;return r.providers.unshift(n),r.resolve((function(e,n){if(e)throw e;t.credentials=n})),this.constructor(t),this},clear:function(){i.util.each.call(this,this.keys,(function(e){delete this[e]})),this.set("credentials",void 0),this.set("credentialProvider",void 0)},set:function(e,t,n){void 0===t?(void 0===n&&(n=this.keys[e]),this[e]="function"===typeof n?n.call(this):n):"httpOptions"===e&&this[e]?this[e]=i.util.merge(this[e],t):this[e]=t},keys:{credentials:null,credentialProvider:null,region:null,logger:null,apiVersions:{},apiVersion:null,endpoint:void 0,httpOptions:{timeout:12e4},maxRetries:void 0,maxRedirects:10,paramValidation:!0,sslEnabled:!0,s3ForcePathStyle:!1,s3BucketEndpoint:!1,s3DisableBodySigning:!0,computeChecksums:!0,convertResponseTypes:!0,correctClockSkew:!1,customUserAgent:null,dynamoDbCrc32:!0,systemClockOffset:0,signatureVersion:null,signatureCache:!0,retryDelayOptions:{},useAccelerateEndpoint:!1,clientSideMonitoring:!1,endpointDiscoveryEnabled:!1,endpointCacheSize:1e3,hostPrefixEnabled:!0,stsRegionalEndpoints:null},extractCredentials:function(e){return e.accessKeyId&&e.secretAccessKey&&((e=i.util.copy(e)).credentials=new i.Credentials(e)),e},setPromisesDependency:function(e){r=e,null===e&&"function"===typeof Promise&&(r=Promise);var t=[i.Request,i.Credentials,i.CredentialProviderChain];i.S3&&(t.push(i.S3),i.S3.ManagedUpload&&t.push(i.S3.ManagedUpload)),i.util.addPromises(t,r)},getPromisesDependency:function(){return r}}),i.config=new i.Config},{"./core":18,"./credentials":19,"./credentials/credential_provider_chain":22}],18:[function(e,t,n){var r={util:e("./util")};({}).toString(),t.exports=r,r.util.update(r,{VERSION:"2.553.0",Signers:{},Protocol:{Json:e("./protocol/json"),Query:e("./protocol/query"),Rest:e("./protocol/rest"),RestJson:e("./protocol/rest_json"),RestXml:e("./protocol/rest_xml")},XML:{Builder:e("./xml/builder"),Parser:null},JSON:{Builder:e("./json/builder"),Parser:e("./json/parser")},Model:{Api:e("./model/api"),Operation:e("./model/operation"),Shape:e("./model/shape"),Paginator:e("./model/paginator"),ResourceWaiter:e("./model/resource_waiter")},apiLoader:e("./api_loader"),EndpointCache:e("../vendor/endpoint-cache").EndpointCache}),e("./sequential_executor"),e("./service"),e("./config"),e("./http"),e("./event_listeners"),e("./request"),e("./response"),e("./resource_waiter"),e("./signers/request_signer"),e("./param_validator"),r.events=new r.SequentialExecutor,r.util.memoizedProperty(r,"endpointCache",(function(){return new r.EndpointCache(r.config.endpointCacheSize)}),!0)},{"../vendor/endpoint-cache":103,"./api_loader":9,"./config":17,"./event_listeners":33,"./http":34,"./json/builder":36,"./json/parser":37,"./model/api":38,"./model/operation":40,"./model/paginator":41,"./model/resource_waiter":42,"./model/shape":43,"./param_validator":44,"./protocol/json":46,"./protocol/query":47,"./protocol/rest":48,"./protocol/rest_json":49,"./protocol/rest_xml":50,"./request":55,"./resource_waiter":56,"./response":57,"./sequential_executor":58,"./service":59,"./signers/request_signer":63,"./util":71,"./xml/builder":73}],19:[function(e,t,n){var r=e("./core");r.Credentials=r.util.inherit({constructor:function(){if(r.util.hideProperties(this,["secretAccessKey"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],1===arguments.length&&"object"===typeof arguments[0]){var e=arguments[0].credentials||arguments[0];this.accessKeyId=e.accessKeyId,this.secretAccessKey=e.secretAccessKey,this.sessionToken=e.sessionToken}else this.accessKeyId=arguments[0],this.secretAccessKey=arguments[1],this.sessionToken=arguments[2]},expiryWindow:15,needsRefresh:function(){var e=r.util.date.getDate().getTime(),t=new Date(e+1e3*this.expiryWindow);return!!(this.expireTime&&t>this.expireTime)||(this.expired||!this.accessKeyId||!this.secretAccessKey)},get:function(e){var t=this;this.needsRefresh()?this.refresh((function(n){n||(t.expired=!1),e&&e(n)})):e&&e()},refresh:function(e){this.expired=!1,e()},coalesceRefresh:function(e,t){var n=this;1===n.refreshCallbacks.push(e)&&n.load((function(e){r.util.arrayEach(n.refreshCallbacks,(function(n){t?n(e):r.util.defer((function(){n(e)}))})),n.refreshCallbacks.length=0}))},load:function(e){e()}}),r.Credentials.addPromisesToClass=function(e){this.prototype.getPromise=r.util.promisifyMethod("get",e),this.prototype.refreshPromise=r.util.promisifyMethod("refresh",e)},r.Credentials.deletePromisesFromClass=function(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},r.util.addPromises(r.Credentials)},{"./core":18}],20:[function(e,t,n){var r=e("../core"),i=e("../../clients/sts");r.ChainableTemporaryCredentials=r.util.inherit(r.Credentials,{constructor:function(e){r.Credentials.call(this),e=e||{},this.errorCode="ChainableTemporaryCredentialsProviderFailure",this.expired=!0,this.tokenCodeFn=null;var t=r.util.copy(e.params)||{};if(t.RoleArn&&(t.RoleSessionName=t.RoleSessionName||"temporary-credentials"),t.SerialNumber){if(!e.tokenCodeFn||"function"!==typeof e.tokenCodeFn)throw new r.util.error(new Error("tokenCodeFn must be a function when params.SerialNumber is given"),{code:this.errorCode});this.tokenCodeFn=e.tokenCodeFn}var n=r.util.merge({params:t,credentials:e.masterCredentials||r.config.credentials},e.stsConfig||{});this.service=new i(n)},refresh:function(e){this.coalesceRefresh(e||r.util.fn.callback)},load:function(e){var t=this,n=t.service.config.params.RoleArn?"assumeRole":"getSessionToken";this.getTokenCode((function(r,i){var o={};r?e(r):(i&&(o.TokenCode=i),t.service[n](o,(function(n,r){n||t.service.credentialsFrom(r,t),e(n)})))}))},getTokenCode:function(e){var t=this;this.tokenCodeFn?this.tokenCodeFn(this.service.config.params.SerialNumber,(function(n,i){if(n){var o=n;return n instanceof Error&&(o=n.message),void e(r.util.error(new Error("Error fetching MFA token: "+o),{code:t.errorCode}))}e(null,i)})):e(null)}})},{"../../clients/sts":8,"../core":18}],21:[function(e,t,n){var r=e("../core"),i=e("../../clients/cognitoidentity"),o=e("../../clients/sts");r.CognitoIdentityCredentials=r.util.inherit(r.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:function(e,t){r.Credentials.call(this),this.expired=!0,this.params=e,this.data=null,this._identityId=null,this._clientConfig=r.util.copy(t||{}),this.loadCachedId();var n=this;Object.defineProperty(this,"identityId",{get:function(){return n.loadCachedId(),n._identityId||n.params.IdentityId},set:function(e){n._identityId=e}})},refresh:function(e){this.coalesceRefresh(e||r.util.fn.callback)},load:function(e){var t=this;t.createClients(),t.data=null,t._identityId=null,t.getId((function(n){n?(t.clearIdOnNotAuthorized(n),e(n)):t.params.RoleArn?t.getCredentialsFromSTS(e):t.getCredentialsForIdentity(e)}))},clearCachedId:function(){this._identityId=null,delete this.params.IdentityId;var e=this.params.IdentityPoolId,t=this.params.LoginId||"";delete this.storage[this.localStorageKey.id+e+t],delete this.storage[this.localStorageKey.providers+e+t]},clearIdOnNotAuthorized:function(e){"NotAuthorizedException"==e.code&&this.clearCachedId()},getId:function(e){var t=this;if("string"===typeof t.params.IdentityId)return e(null,t.params.IdentityId);t.cognito.getId((function(n,r){!n&&r.IdentityId?(t.params.IdentityId=r.IdentityId,e(null,r.IdentityId)):e(n)}))},loadCredentials:function(e,t){e&&t&&(t.expired=!1,t.accessKeyId=e.Credentials.AccessKeyId,t.secretAccessKey=e.Credentials.SecretKey,t.sessionToken=e.Credentials.SessionToken,t.expireTime=e.Credentials.Expiration)},getCredentialsForIdentity:function(e){var t=this;t.cognito.getCredentialsForIdentity((function(n,r){n?t.clearIdOnNotAuthorized(n):(t.cacheId(r),t.data=r,t.loadCredentials(t.data,t)),e(n)}))},getCredentialsFromSTS:function(e){var t=this;t.cognito.getOpenIdToken((function(n,r){n?(t.clearIdOnNotAuthorized(n),e(n)):(t.cacheId(r),t.params.WebIdentityToken=r.Token,t.webIdentityCredentials.refresh((function(n){n||(t.data=t.webIdentityCredentials.data,t.sts.credentialsFrom(t.data,t)),e(n)})))}))},loadCachedId:function(){var e=this;if(r.util.isBrowser()&&!e.params.IdentityId){var t=e.getStorage("id");if(t&&e.params.Logins){var n=Object.keys(e.params.Logins);0!==(e.getStorage("providers")||"").split(",").filter((function(e){return-1!==n.indexOf(e)})).length&&(e.params.IdentityId=t)}else t&&(e.params.IdentityId=t)}},createClients:function(){var e=this._clientConfig;if(this.webIdentityCredentials=this.webIdentityCredentials||new r.WebIdentityCredentials(this.params,e),!this.cognito){var t=r.util.merge({},e);t.params=this.params,this.cognito=new i(t)}this.sts=this.sts||new o(e)},cacheId:function(e){this._identityId=e.IdentityId,this.params.IdentityId=this._identityId,r.util.isBrowser()&&(this.setStorage("id",e.IdentityId),this.params.Logins&&this.setStorage("providers",Object.keys(this.params.Logins).join(",")))},getStorage:function(e){return this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]},setStorage:function(e,t){try{this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]=t}catch(n){}},storage:function(){try{var e=r.util.isBrowser()&&null!==window.localStorage&&"object"===typeof window.localStorage?window.localStorage:{};return e["aws.test-storage"]="foobar",delete e["aws.test-storage"],e}catch(t){return{}}}()})},{"../../clients/cognitoidentity":7,"../../clients/sts":8,"../core":18}],22:[function(e,t,n){var r=e("../core");r.CredentialProviderChain=r.util.inherit(r.Credentials,{constructor:function(e){this.providers=e||r.CredentialProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},resolve:function(e){var t=this;if(0===t.providers.length)return e(new Error("No providers")),t;if(1===t.resolveCallbacks.push(e)){var n=0,i=t.providers.slice(0);!function e(o,a){if(!o&&a||n===i.length)return r.util.arrayEach(t.resolveCallbacks,(function(e){e(o,a)})),void(t.resolveCallbacks.length=0);var s=i[n++];(a="function"===typeof s?s.call():s).get?a.get((function(t){e(t,t?null:a)})):e(null,a)}()}return t}}),r.CredentialProviderChain.defaultProviders=[],r.CredentialProviderChain.addPromisesToClass=function(e){this.prototype.resolvePromise=r.util.promisifyMethod("resolve",e)},r.CredentialProviderChain.deletePromisesFromClass=function(){delete this.prototype.resolvePromise},r.util.addPromises(r.CredentialProviderChain)},{"../core":18}],23:[function(e,t,n){var r=e("../core"),i=e("../../clients/sts");r.SAMLCredentials=r.util.inherit(r.Credentials,{constructor:function(e){r.Credentials.call(this),this.expired=!0,this.params=e},refresh:function(e){this.coalesceRefresh(e||r.util.fn.callback)},load:function(e){var t=this;t.createClients(),t.service.assumeRoleWithSAML((function(n,r){n||t.service.credentialsFrom(r,t),e(n)}))},createClients:function(){this.service=this.service||new i({params:this.params})}})},{"../../clients/sts":8,"../core":18}],24:[function(e,t,n){var r=e("../core"),i=e("../../clients/sts");r.TemporaryCredentials=r.util.inherit(r.Credentials,{constructor:function(e,t){r.Credentials.call(this),this.loadMasterCredentials(t),this.expired=!0,this.params=e||{},this.params.RoleArn&&(this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials")},refresh:function(e){this.coalesceRefresh(e||r.util.fn.callback)},load:function(e){var t=this;t.createClients(),t.masterCredentials.get((function(){t.service.config.credentials=t.masterCredentials,(t.params.RoleArn?t.service.assumeRole:t.service.getSessionToken).call(t.service,(function(n,r){n||t.service.credentialsFrom(r,t),e(n)}))}))},loadMasterCredentials:function(e){for(this.masterCredentials=e||r.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials;"function"!==typeof this.masterCredentials.get&&(this.masterCredentials=new r.Credentials(this.masterCredentials))},createClients:function(){this.service=this.service||new i({params:this.params})}})},{"../../clients/sts":8,"../core":18}],25:[function(e,t,n){var r=e("../core"),i=e("../../clients/sts");r.WebIdentityCredentials=r.util.inherit(r.Credentials,{constructor:function(e,t){r.Credentials.call(this),this.expired=!0,this.params=e,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null,this._clientConfig=r.util.copy(t||{})},refresh:function(e){this.coalesceRefresh(e||r.util.fn.callback)},load:function(e){var t=this;t.createClients(),t.service.assumeRoleWithWebIdentity((function(n,r){t.data=null,n||(t.data=r,t.service.credentialsFrom(r,t)),e(n)}))},createClients:function(){if(!this.service){var e=r.util.merge({},this._clientConfig);e.params=this.params,this.service=new i(e)}}})},{"../../clients/sts":8,"../core":18}],26:[function(e,t,n){(function(n){var r=e("./core"),i=e("./util"),o=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"];function a(e){var t=e.service,n=t.api||{},r=(n.operations,{});return t.config.region&&(r.region=t.config.region),n.serviceId&&(r.serviceId=n.serviceId),t.config.credentials.accessKeyId&&(r.accessKeyId=t.config.credentials.accessKeyId),r}function s(e,t,n){n&&void 0!==t&&null!==t&&"structure"===n.type&&n.required&&n.required.length>0&&i.arrayEach(n.required,(function(r){var i=n.members[r];if(!0===i.endpointDiscoveryId){var o=i.isLocationName?i.name:r;e[o]=String(t[r])}else s(e,t[r],i)}))}function u(e,t){var n={};return s(n,e.params,t),n}function c(e){var t=e.service,n=t.api,o=n.operations?n.operations[e.operation]:void 0,s=u(e,o?o.input:void 0),c=a(e);Object.keys(s).length>0&&(c=i.update(c,s),o&&(c.operation=o.name));var l=r.endpointCache.get(c);if(!l||1!==l.length||""!==l[0].Address)if(l&&l.length>0)e.httpRequest.updateEndpoint(l[0].Address);else{var f=t.makeRequest(n.endpointOperation,{Operation:o.name,Identifiers:s});h(f),f.removeListener("validate",r.EventListeners.Core.VALIDATE_PARAMETERS),f.removeListener("retry",r.EventListeners.Core.RETRY_CHECK),r.endpointCache.put(c,[{Address:"",CachePeriodInMinutes:1}]),f.send((function(e,t){t&&t.Endpoints?r.endpointCache.put(c,t.Endpoints):e&&r.endpointCache.put(c,[{Address:"",CachePeriodInMinutes:1}])}))}}var l={};function f(e,t){var n=e.service,o=n.api,s=o.operations?o.operations[e.operation]:void 0,c=s?s.input:void 0,f=u(e,c),d=a(e);Object.keys(f).length>0&&(d=i.update(d,f),s&&(d.operation=s.name));var p=r.EndpointCache.getKeyString(d),m=r.endpointCache.get(p);if(m&&1===m.length&&""===m[0].Address)return l[p]||(l[p]=[]),void l[p].push({request:e,callback:t});if(m&&m.length>0)e.httpRequest.updateEndpoint(m[0].Address),t();else{var g=n.makeRequest(o.endpointOperation,{Operation:s.name,Identifiers:f});g.removeListener("validate",r.EventListeners.Core.VALIDATE_PARAMETERS),h(g),r.endpointCache.put(p,[{Address:"",CachePeriodInMinutes:60}]),g.send((function(n,o){if(n){var a={code:"EndpointDiscoveryException",message:"Request cannot be fulfilled without specifying an endpoint",retryable:!1};if(e.response.error=i.error(n,a),r.endpointCache.remove(d),l[p]){var s=l[p];i.arrayEach(s,(function(e){e.request.response.error=i.error(n,a),e.callback()})),delete l[p]}}else if(o&&(r.endpointCache.put(p,o.Endpoints),e.httpRequest.updateEndpoint(o.Endpoints[0].Address),l[p])){s=l[p];i.arrayEach(s,(function(e){e.request.httpRequest.updateEndpoint(o.Endpoints[0].Address),e.callback()})),delete l[p]}t()}))}}function h(e){var t=e.service.api.apiVersion;t&&!e.httpRequest.headers["x-amz-api-version"]&&(e.httpRequest.headers["x-amz-api-version"]=t)}function d(e){var t=e.error,n=e.httpResponse;if(t&&("InvalidEndpointException"===t.code||421===n.statusCode)){var o=e.request,s=o.service.api.operations||{},c=u(o,s[o.operation]?s[o.operation].input:void 0),l=a(o);Object.keys(c).length>0&&(l=i.update(l,c),s[o.operation]&&(l.operation=s[o.operation].name)),r.endpointCache.remove(l)}}function p(e){return["false","0"].indexOf(e)>=0}t.exports={discoverEndpoint:function(e,t){var a=e.service||{};if(function(e){if(e._originalConfig&&e._originalConfig.endpoint&&!0===e._originalConfig.endpointDiscoveryEnabled)throw i.error(new Error,{code:"ConfigurationException",message:"Custom endpoint is supplied; endpointDiscoveryEnabled must not be true."});var t=r.config[e.serviceIdentifier]||{};return Boolean(r.config.endpoint||t.endpoint||e._originalConfig&&e._originalConfig.endpoint)}(a)||e.isPresigned())return t();if(!function(e){if(!0===(e.service||{}).config.endpointDiscoveryEnabled)return!0;if(i.isBrowser())return!1;for(var t=0;t-1&&(e[t]++,0===e[t]);t--);}o.fromNumber=function(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(e+" is too large (or, if negative, too small) to represent as an Int64");for(var t=new Uint8Array(8),n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&a(t),new o(t)},o.prototype.valueOf=function(){var e=this.bytes.slice(0),t=128&e[0];return t&&a(e),parseInt(e.toString("hex"),16)*(t?-1:1)},o.prototype.toString=function(){return String(this.valueOf())},t.exports={Int64:o}},{"../core":18}],30:[function(e,t,n){var r=e("./parse-message").parseMessage;t.exports={parseEvent:function(e,t,n){var i=r(t),o=i.headers[":message-type"];if(o){if("error"===o.value)throw function(e){var t=e.headers[":error-code"],n=e.headers[":error-message"],r=new Error(n.value||n);return r.code=r.name=t.value||t,r}(i);if("event"!==o.value)return}var a=i.headers[":event-type"],s=n.members[a.value];if(s){var u={},c=s.eventPayloadMemberName;if(c){var l=s.members[c];"binary"===l.type?u[c]=i.body:u[c]=e.parse(i.body.toString(),l)}for(var f=s.eventHeaderMemberNames,h=0;h=0)return e.httpRequest.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",t();r.util.computeSha256(o,(function(n,r){n?t(n):(e.httpRequest.headers["X-Amz-Content-Sha256"]=r,t())}))}else t()}})),e("SET_CONTENT_LENGTH","afterBuild",(function(e){var t=function(e){if(!e.service.api.operations)return"";var t=e.service.api.operations[e.operation];return t?t.authtype:""}(e),n=r.util.getRequestPayloadShape(e);if(void 0===e.httpRequest.headers["Content-Length"])try{var i=r.util.string.byteLength(e.httpRequest.body);e.httpRequest.headers["Content-Length"]=i}catch(err){if(n&&n.isStreaming){if(n.requiresLength)throw err;if(t.indexOf("unsigned-body")>=0)return void(e.httpRequest.headers["Transfer-Encoding"]="chunked");throw err}throw err}})),e("SET_HTTP_HOST","afterBuild",(function(e){e.httpRequest.headers.Host=e.httpRequest.endpoint.host})),e("RESTART","restart",(function(){var e=this.response.error;e&&e.retryable&&(this.httpRequest=new r.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount=600?this.emit("sign",[this],(function(e){e?t(e):o()})):o()})),e("HTTP_HEADERS","httpHeaders",(function(e,t,n,i){n.httpResponse.statusCode=e,n.httpResponse.statusMessage=i,n.httpResponse.headers=t,n.httpResponse.body=r.util.buffer.toBuffer(""),n.httpResponse.buffers=[],n.httpResponse.numBytes=0;var o=t.date||t.Date,a=n.request.service;if(o){var s=Date.parse(o);a.config.correctClockSkew&&a.isClockSkewed(s)&&a.applyClockOffset(s)}})),e("HTTP_DATA","httpData",(function(e,t){if(e){if(r.util.isNode()){t.httpResponse.numBytes+=e.length;var n=t.httpResponse.headers["content-length"],i={loaded:t.httpResponse.numBytes,total:n};t.request.emit("httpDownloadProgress",[i,t])}t.httpResponse.buffers.push(r.util.buffer.toBuffer(e))}})),e("HTTP_DONE","httpDone",(function(e){if(e.httpResponse.buffers&&e.httpResponse.buffers.length>0){var t=r.util.buffer.concat(e.httpResponse.buffers);e.httpResponse.body=t}delete e.httpResponse.numBytes,delete e.httpResponse.buffers})),e("FINALIZE_ERROR","retry",(function(e){e.httpResponse.statusCode&&(e.error.statusCode=e.httpResponse.statusCode,void 0===e.error.retryable&&(e.error.retryable=this.service.retryableError(e.error,this)))})),e("INVALIDATE_CREDENTIALS","retry",(function(e){if(e.error)switch(e.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":e.error.retryable=!0,e.request.service.config.credentials.expired=!0}})),e("EXPIRED_SIGNATURE","retry",(function(e){var t=e.error;t&&"string"===typeof t.code&&"string"===typeof t.message&&t.code.match(/Signature/)&&t.message.match(/expired/)&&(e.error.retryable=!0)})),e("CLOCK_SKEWED","retry",(function(e){e.error&&this.service.clockSkewError(e.error)&&this.service.config.correctClockSkew&&(e.error.retryable=!0)})),e("REDIRECT","retry",(function(e){e.error&&e.error.statusCode>=300&&e.error.statusCode<400&&e.httpResponse.headers.location&&(this.httpRequest.endpoint=new r.Endpoint(e.httpResponse.headers.location),this.httpRequest.headers.Host=this.httpRequest.endpoint.host,e.error.redirect=!0,e.error.retryable=!0)})),e("RETRY_CHECK","retry",(function(e){e.error&&(e.error.redirect&&e.redirectCount=this.HEADERS_RECEIVED&&!f&&(u.statusCode=l.status,u.headers=a.parseHeaders(l.getAllResponseHeaders()),u.emit("headers",u.statusCode,u.headers,l.statusText),f=!0),this.readyState===this.DONE&&a.finishRequest(l,u)}),!1),l.upload.addEventListener("progress",(function(e){u.emit("sendProgress",e)})),l.addEventListener("progress",(function(e){u.emit("receiveProgress",e)}),!1),l.addEventListener("timeout",(function(){o(r.util.error(new Error("Timeout"),{code:"TimeoutError"}))}),!1),l.addEventListener("error",(function(){o(r.util.error(new Error("Network Failure"),{code:"NetworkingError"}))}),!1),l.addEventListener("abort",(function(){o(r.util.error(new Error("Request aborted"),{code:"RequestAbortedError"}))}),!1),n(u),l.open(e.method,c,!1!==t.xhrAsync),r.util.each(e.headers,(function(e,t){"Content-Length"!==e&&"User-Agent"!==e&&"Host"!==e&&l.setRequestHeader(e,t)})),t.timeout&&!1!==t.xhrAsync&&(l.timeout=t.timeout),t.xhrWithCredentials&&(l.withCredentials=!0);try{l.responseType="arraybuffer"}catch(h){}try{e.body?l.send(e.body):l.send()}catch(err){if(!e.body||"object"!==typeof e.body.buffer)throw err;l.send(e.body.buffer)}return u},parseHeaders:function(e){var t={};return r.util.arrayEach(e.split(/\r?\n/),(function(e){var n=e.split(":",1)[0],r=e.substring(n.length+2);n.length>0&&(t[n.toLowerCase()]=r)})),t},finishRequest:function(e,t){var n;if("arraybuffer"===e.responseType&&e.response){var i=e.response;n=new r.util.Buffer(i.byteLength);for(var o=new Uint8Array(i),a=0;a-1?t||"":t,this.isJsonValue?JSON.parse(t):t&&"function"===typeof t.toString?t.toString():t},this.toWireFormat=function(e){return this.isJsonValue?JSON.stringify(e):e}}function d(){s.apply(this,arguments),this.toType=function(e){var t=i.base64.decode(e);if(this.isSensitive&&i.isNode()&&"function"===typeof i.Buffer.alloc){var n=i.Buffer.alloc(t.length,t);t.fill(0),t=n}return t},this.toWireFormat=i.base64.encode}function p(){d.apply(this,arguments)}function m(){s.apply(this,arguments),this.toType=function(e){return"boolean"===typeof e?e:null===e||void 0===e?null:"true"===e}}s.normalizedTypes={character:"string",double:"float",long:"integer",short:"integer",biginteger:"integer",bigdecimal:"float",blob:"binary"},s.types={structure:c,list:l,map:f,boolean:m,timestamp:function(e){var t=this;if(s.apply(this,arguments),e.timestampFormat)o(this,"timestampFormat",e.timestampFormat);else if(t.isTimestampFormatSet&&this.timestampFormat)o(this,"timestampFormat",this.timestampFormat);else if("header"===this.location)o(this,"timestampFormat","rfc822");else if("querystring"===this.location)o(this,"timestampFormat","iso8601");else if(this.api)switch(this.api.protocol){case"json":case"rest-json":o(this,"timestampFormat","unixTimestamp");break;case"rest-xml":case"query":case"ec2":o(this,"timestampFormat","iso8601")}this.toType=function(e){return null===e||void 0===e?null:"function"===typeof e.toUTCString?e:"string"===typeof e||"number"===typeof e?i.date.parseTimestamp(e):null},this.toWireFormat=function(e){return i.date.format(e,t.timestampFormat)}},float:function(){s.apply(this,arguments),this.toType=function(e){return null===e||void 0===e?null:parseFloat(e)},this.toWireFormat=this.toType},integer:function(){s.apply(this,arguments),this.toType=function(e){return null===e||void 0===e?null:parseInt(e,10)},this.toWireFormat=this.toType},string:h,base64:p,binary:d},s.resolve=function(e,t){if(e.shape){var n=t.api.shapes[e.shape];if(!n)throw new Error("Cannot find shape reference: "+e.shape);return n}return null},s.create=function(e,t,n){if(e.isShape)return e;var r=s.resolve(e,t);if(r){var i=Object.keys(e);t.documentation||(i=i.filter((function(e){return!e.match(/documentation/)})));var o=function(){r.constructor.call(this,e,t,n)};return o.prototype=r,new o}e.type||(e.members?e.type="structure":e.member?e.type="list":e.key?e.type="map":e.type="string");var a=e.type;if(s.normalizedTypes[e.type]&&(e.type=s.normalizedTypes[e.type]),s.types[e.type])return new s.types[e.type](e,t,n);throw new Error("Unrecognized shape type: "+a)},s.shapes={StructureShape:c,ListShape:l,MapShape:f,StringShape:h,BooleanShape:m,Base64Shape:p},t.exports=s},{"../util":71,"./collection":39}],44:[function(e,t,n){var r=e("./core");r.ParamValidator=r.util.inherit({constructor:function(e){!0!==e&&void 0!==e||(e={min:!0}),this.validation=e},validate:function(e,t,n){if(this.errors=[],this.validateMember(e,t||{},n||"params"),this.errors.length>1){var i=this.errors.join("\n* ");throw i="There were "+this.errors.length+" validation errors:\n* "+i,r.util.error(new Error(i),{code:"MultipleValidationErrors",errors:this.errors})}if(1===this.errors.length)throw this.errors[0];return!0},fail:function(e,t){this.errors.push(r.util.error(new Error(t),{code:e}))},validateStructure:function(e,t,n){var r;this.validateType(t,n,["object"],"structure");for(var i=0;e.required&&i= 1, but found "'+t+'" for '+n)},validatePattern:function(e,t,n){this.validation.pattern&&void 0!==e.pattern&&(new RegExp(e.pattern).test(t)||this.fail("PatternMatchError",'Provided value "'+t+'" does not match regex pattern /'+e.pattern+"/ for "+n))},validateRange:function(e,t,n,r){this.validation.min&&void 0!==e.min&&t= "+e.min+", but found "+t+" for "+n),this.validation.max&&void 0!==e.max&&t>e.max&&this.fail("MaxRangeError","Expected "+r+" <= "+e.max+", but found "+t+" for "+n)},validateEnum:function(e,t,n){this.validation.enum&&void 0!==e.enum&&-1===e.enum.indexOf(t)&&this.fail("EnumError","Found string value of "+t+", but expected "+e.enum.join("|")+" for "+n)},validateType:function(e,t,n,i){if(null===e||void 0===e)return!1;for(var o=!1,a=0;a63)throw r.error(new Error,{code:"ValidationError",message:"Hostname label length should be between 1 to 63 characters, inclusive."});if(!n.test(e))throw i.util.error(new Error,{code:"ValidationError",message:e+" is not hostname compatible."})}))}(e.httpRequest.endpoint.hostname)}return e}}},{"../core":18,"../util":71}],46:[function(e,t,n){var r=e("../util"),i=e("../json/builder"),o=e("../json/parser"),a=e("./helpers").populateHostPrefix;t.exports={buildRequest:function(e){var t=e.httpRequest,n=e.service.api,r=n.targetPrefix+"."+n.operations[e.operation].name,o=n.jsonVersion||"1.0",s=n.operations[e.operation].input,u=new i;1===o&&(o="1.0"),t.body=u.build(e.params||{},s),t.headers["Content-Type"]="application/x-amz-json-"+o,t.headers["X-Amz-Target"]=r,a(e)},extractError:function(e){var t={},n=e.httpResponse;if(t.code=n.headers["x-amzn-errortype"]||"UnknownError","string"===typeof t.code&&(t.code=t.code.split(":")[0]),n.body.length>0)try{var i=JSON.parse(n.body.toString());(i.__type||i.code)&&(t.code=(i.__type||i.code).split("#").pop()),"RequestEntityTooLarge"===t.code?t.message="Request body must be less than 1 MB":t.message=i.message||i.Message||null}catch(i){t.statusCode=n.statusCode,t.message=n.statusMessage}else t.statusCode=n.statusCode,t.message=n.statusCode.toString();e.error=r.error(new Error,t)},extractData:function(e){var t=e.httpResponse.body.toString()||"{}";if(!1===e.request.service.config.convertResponseTypes)e.data=JSON.parse(t);else{var n=e.request.service.api.operations[e.request.operation].output||{},r=new o;e.data=r.parse(t,n)}}}},{"../json/builder":36,"../json/parser":37,"../util":71,"./helpers":45}],47:[function(e,t,n){var r=e("../core"),i=e("../util"),o=e("../query/query_param_serializer"),a=e("../model/shape"),s=e("./helpers").populateHostPrefix;t.exports={buildRequest:function(e){var t=e.service.api.operations[e.operation],n=e.httpRequest;n.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",n.params={Version:e.service.api.apiVersion,Action:t.name},(new o).serialize(e.params,t.input,(function(e,t){n.params[e]=t})),n.body=i.queryParamsToString(n.params),s(e)},extractError:function(e){var t,n=e.httpResponse.body.toString();if(n.match("=0?"&":"?";var u=[];r.arrayEach(Object.keys(a).sort(),(function(e){Array.isArray(a[e])||(a[e]=[a[e]]);for(var t=0;t0){var f=(t=new r.XML.Parser).parse(a.toString(),u);i.update(e.data,f)}}}},{"../core":18,"../util":71,"./rest":48}],51:[function(e,t,n){var r=e("../util");function i(){}function o(e){return e.isQueryName||"ec2"!==e.api.protocol?e.name:e.name[0].toUpperCase()+e.name.substr(1)}function a(e,t,n,i){r.each(n.members,(function(n,r){var a=t[n];if(null!==a&&void 0!==a){var u=o(r);s(u=e?e+"."+u:u,a,r,i)}}))}function s(e,t,n,i){null!==t&&void 0!==t&&("structure"===n.type?a(e,t,n,i):"list"===n.type?function(e,t,n,i){var a=n.member||{};0!==t.length?r.arrayEach(t,(function(t,r){var u="."+(r+1);if("ec2"===n.api.protocol)u+="";else if(n.flattened){if(a.name){var c=e.split(".");c.pop(),c.push(o(a)),e=c.join(".")}}else u="."+(a.name?a.name:"member")+u;s(e+u,t,a,i)})):i.call(this,e,null)}(e,t,n,i):"map"===n.type?function(e,t,n,i){var o=1;r.each(t,(function(t,r){var a=(n.flattened?".":".entry.")+o+++".",u=a+(n.key.name||"key"),c=a+(n.value.name||"value");s(e+u,t,n.key,i),s(e+c,r,n.value,i)}))}(e,t,n,i):i(e,n.toWireFormat(t).toString()))}i.prototype.serialize=function(e,t,n){a("",e,t,n)},t.exports=i},{"../util":71}],52:[function(e,t,n){t.exports={now:function(){return"undefined"!==typeof performance&&"function"===typeof performance.now?performance.now():Date.now()}}},{}],53:[function(e,t,n){var r=e("./util"),i=e("./region_config_data.json");function o(e,t){r.each(t,(function(t,n){"globalEndpoint"!==t&&(void 0!==e.config[t]&&null!==e.config[t]||(e.config[t]=n))}))}t.exports=function(e){for(var t=function(e){var t=e.config.region,n=function(e){if(!e)return null;var t=e.split("-");return t.length<3?null:t.slice(0,t.length-2).join("-")+"-*"}(t),r=e.api.endpointPrefix;return[[t,r],[n,r],[t,"*"],[n,"*"],["*",r],["*","*"]].map((function(e){return e[0]&&e[1]?e.join("/"):null}))}(e),n=0;n=0){u=!0;var c=0}var l=function(){u&&c!==s?i.emit("error",n.util.error(new Error("Stream content length mismatch. Received "+c+" of "+s+" bytes."),{code:"StreamContentLengthMismatch"})):2===n.HttpClient.streamsApiVersion?i.end():i.emit("end")},f=a.httpResponse.createUnbufferedStream();if(2===n.HttpClient.streamsApiVersion)if(u){var h=new e.PassThrough;h._write=function(t){return t&&t.length&&(c+=t.length),e.PassThrough.prototype._write.apply(this,arguments)},h.on("end",l),i.on("error",(function(e){u=!1,f.unpipe(h),h.emit("end"),h.end()})),f.pipe(h).pipe(i,{end:!1})}else f.pipe(i);else u&&f.on("data",(function(e){e&&e.length&&(c+=e.length)})),f.on("data",(function(e){i.emit("data",e)})),f.on("end",l);f.on("error",(function(e){u=!1,i.emit("error",e)}))}})),i},emitEvent:function(e,t,r){"function"===typeof t&&(r=t,t=null),r||(r=function(){}),t||(t=this.eventParameters(e,this.response)),n.SequentialExecutor.prototype.emit.call(this,e,t,(function(e){e&&(this.response.error=e),r.call(this,e)}))},eventParameters:function(e){switch(e){case"restart":case"validate":case"sign":case"build":case"afterValidate":case"afterBuild":return[this];case"error":return[this.response.error,this.response];default:return[this.response]}},presign:function(e,t){return t||"function"!==typeof e||(t=e,e=null),(new n.Signers.Presign).sign(this.toGet(),e,t)},isPresigned:function(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},toUnauthenticated:function(){return this._unAuthenticated=!0,this.removeListener("validate",n.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",n.EventListeners.Core.SIGN),this},toGet:function(){return"query"!==this.service.api.protocol&&"ec2"!==this.service.api.protocol||(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},buildAsGet:function(e){e.httpRequest.method="GET",e.httpRequest.path=e.service.endpoint.path+"?"+e.httpRequest.body,e.httpRequest.body="",delete e.httpRequest.headers["Content-Length"],delete e.httpRequest.headers["Content-Type"]},haltHandlersOnError:function(){this._haltHandlersOnError=!0}}),n.Request.addPromisesToClass=function(e){this.prototype.promise=function(){var t=this;return this.httpRequest.appendToUserAgent("promise"),new e((function(e,n){t.on("complete",(function(t){t.error?n(t.error):e(Object.defineProperty(t.data||{},"$response",{value:t}))})),t.runTo()}))}},n.Request.deletePromisesFromClass=function(){delete this.prototype.promise},n.util.addPromises(n.Request),n.util.mixin(n.Request,n.SequentialExecutor)}).call(this,e("_process"))},{"./core":18,"./state_machine":70,_process:85,jmespath:84}],56:[function(e,t,n){var r=e("./core"),i=r.util.inherit,o=e("jmespath");function a(e){var t=e.request._waiter,n=t.config.acceptors,r=!1,i="retry";n.forEach((function(n){if(!r){var o=t.matchers[n.matcher];o&&o(e,n.expected,n.argument)&&(r=!0,i=n.state)}})),!r&&e.error&&(i="failure"),"success"===i?t.setSuccess(e):t.setError(e,"retry"===i)}r.ResourceWaiter=i({constructor:function(e,t){this.service=e,this.state=t,this.loadWaiterConfig(this.state)},service:null,state:null,config:null,matchers:{path:function(e,t,n){try{var r=o.search(e.data,n)}catch(err){return!1}return o.strictDeepEqual(r,t)},pathAll:function(e,t,n){try{var r=o.search(e.data,n)}catch(err){return!1}Array.isArray(r)||(r=[r]);var i=r.length;if(!i)return!1;for(var a=0;a-1&&n.splice(i,1)}return this},removeAllListeners:function(e){return e?delete this._events[e]:this._events={},this},emit:function(e,t,n){n||(n=function(){});var r=this.listeners(e),i=r.length;return this.callListeners(r,t,n),i>0},callListeners:function(e,t,n,i){var o=this,a=i||null;function s(i){if(i&&(a=r.util.error(a||new Error,i),o._haltHandlersOnError))return n.call(o,a);o.callListeners(e,t,n,a)}for(;e.length>0;){var u=e.shift();if(u._isAsync)return void u.apply(o,t.concat([s]));try{u.apply(o,t)}catch(err){a=r.util.error(a||new Error,err)}if(a&&o._haltHandlersOnError)return void n.call(o,a)}n.call(o,a)},addListeners:function(e){var t=this;return e._events&&(e=e._events),r.util.each(e,(function(e,n){"function"===typeof n&&(n=[n]),r.util.arrayEach(n,(function(n){t.on(e,n)}))})),t},addNamedListener:function(e,t,n,r){return this[e]=n,this.addListener(t,n,r),this},addNamedAsyncListener:function(e,t,n,r){return n._isAsync=!0,this.addNamedListener(e,t,n,r)},addNamedListeners:function(e){var t=this;return e((function(){t.addNamedListener.apply(t,arguments)}),(function(){t.addNamedAsyncListener.apply(t,arguments)})),this}}),r.SequentialExecutor.prototype.addListener=r.SequentialExecutor.prototype.on,t.exports=r.SequentialExecutor},{"./core":18}],59:[function(e,t,n){(function(n){var r=e("./core"),i=e("./model/api"),o=e("./region_config"),a=r.util.inherit,s=0;r.Service=a({constructor:function(e){if(!this.loadServiceClass)throw r.util.error(new Error,"Service must be constructed with `new' operator");var t=this.loadServiceClass(e||{});if(t){var n=r.util.copy(e),i=new t(e);return Object.defineProperty(i,"_originalConfig",{get:function(){return n},enumerable:!1,configurable:!0}),i._clientId=++s,i}this.initialize(e)},initialize:function(e){var t=r.config[this.serviceIdentifier];if(this.config=new r.Config(r.config),t&&this.config.update(t,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||o(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint),r.SequentialExecutor.call(this),r.Service.addDefaultMonitoringListeners(this),(this.config.clientSideMonitoring||r.Service._clientSideMonitoring)&&this.publisher){var i=this.publisher;this.addNamedListener("PUBLISH_API_CALL","apiCall",(function(e){n.nextTick((function(){i.eventHandler(e)}))})),this.addNamedListener("PUBLISH_API_ATTEMPT","apiCallAttempt",(function(e){n.nextTick((function(){i.eventHandler(e)}))}))}},validateService:function(){},loadServiceClass:function(e){var t=e;if(r.util.isEmpty(this.api)){if(t.apiConfig)return r.Service.defineServiceApi(this.constructor,t.apiConfig);if(this.constructor.services){(t=new r.Config(r.config)).update(e,!0);var n=t.apiVersions[this.constructor.serviceIdentifier];return n=n||t.apiVersion,this.getLatestServiceClass(n)}return null}return null},getLatestServiceClass:function(e){return e=this.getLatestServiceVersion(e),null===this.constructor.services[e]&&r.Service.defineServiceApi(this.constructor,e),this.constructor.services[e]},getLatestServiceVersion:function(e){if(!this.constructor.services||0===this.constructor.services.length)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(e?r.util.isType(e,Date)&&(e=r.util.date.iso8601(e).split("T")[0]):e="latest",Object.hasOwnProperty(this.constructor.services,e))return e;for(var t=Object.keys(this.constructor.services).sort(),n=null,i=t.length-1;i>=0;i--)if("*"!==t[i][t[i].length-1]&&(n=t[i]),t[i].substr(0,10)<=e)return n;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},api:{},defaultRetryCount:3,customizeRequests:function(e){if(e){if("function"!==typeof e)throw new Error("Invalid callback type '"+typeof e+"' provided in customizeRequests");this.customRequestHandler=e}else this.customRequestHandler=null},makeRequest:function(e,t,n){if("function"===typeof t&&(n=t,t=null),t=t||{},this.config.params){var i=this.api.operations[e];i&&(t=r.util.copy(t),r.util.each(this.config.params,(function(e,n){i.input.members[e]&&(void 0!==t[e]&&null!==t[e]||(t[e]=n))})))}var o=new r.Request(this,e,t);return this.addAllRequestListeners(o),this.attachMonitoringEmitter(o),n&&o.send(n),o},makeUnauthenticatedRequest:function(e,t,n){"function"===typeof t&&(n=t,t={});var r=this.makeRequest(e,t).toUnauthenticated();return n?r.send(n):r},waitFor:function(e,t,n){return new r.ResourceWaiter(this,e).wait(t,n)},addAllRequestListeners:function(e){for(var t=[r.events,r.EventListeners.Core,this.serviceInterface(),r.EventListeners.CorePost],n=0;n299?(i.code&&(n.FinalAwsException=i.code),i.message&&(n.FinalAwsExceptionMessage=i.message)):((i.code||i.name)&&(n.FinalSdkException=i.code||i.name),i.message&&(n.FinalSdkExceptionMessage=i.message))}return n},apiAttemptEvent:function(e){var t=e.service.api.operations[e.operation],n={Type:"ApiCallAttempt",Api:t?t.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Fqdn:e.httpRequest.endpoint.hostname,UserAgent:e.httpRequest.getUserAgent()},r=e.response;return r.httpResponse.statusCode&&(n.HttpStatusCode=r.httpResponse.statusCode),!e._unAuthenticated&&e.service.config.credentials&&e.service.config.credentials.accessKeyId&&(n.AccessKey=e.service.config.credentials.accessKeyId),r.httpResponse.headers?(e.httpRequest.headers["x-amz-security-token"]&&(n.SessionToken=e.httpRequest.headers["x-amz-security-token"]),r.httpResponse.headers["x-amzn-requestid"]&&(n.XAmznRequestId=r.httpResponse.headers["x-amzn-requestid"]),r.httpResponse.headers["x-amz-request-id"]&&(n.XAmzRequestId=r.httpResponse.headers["x-amz-request-id"]),r.httpResponse.headers["x-amz-id-2"]&&(n.XAmzId2=r.httpResponse.headers["x-amz-id-2"]),n):n},attemptFailEvent:function(e){var t=this.apiAttemptEvent(e),n=e.response,r=n.error;return n.httpResponse.statusCode>299?(r.code&&(t.AwsException=r.code),r.message&&(t.AwsExceptionMessage=r.message)):((r.code||r.name)&&(t.SdkException=r.code||r.name),r.message&&(t.SdkExceptionMessage=r.message)),t},attachMonitoringEmitter:function(e){var t,n,i,o,a,s,u=0,c=this;e.on("validate",(function(){o=r.util.realClock.now(),s=Date.now()}),true),e.on("sign",(function(){n=r.util.realClock.now(),t=Date.now(),a=e.httpRequest.region,u++}),true),e.on("validateResponse",(function(){i=Math.round(r.util.realClock.now()-n)})),e.addNamedListener("API_CALL_ATTEMPT","success",(function(){var n=c.apiAttemptEvent(e);n.Timestamp=t,n.AttemptLatency=i>=0?i:0,n.Region=a,c.emit("apiCallAttempt",[n])})),e.addNamedListener("API_CALL_ATTEMPT_RETRY","retry",(function(){var o=c.attemptFailEvent(e);o.Timestamp=t,i=i||Math.round(r.util.realClock.now()-n),o.AttemptLatency=i>=0?i:0,o.Region=a,c.emit("apiCallAttempt",[o])})),e.addNamedListener("API_CALL","complete",(function(){var t=c.apiCallEvent(e);if(t.AttemptCount=u,!(t.AttemptCount<=0)){t.Timestamp=s;var n=Math.round(r.util.realClock.now()-o);t.Latency=n>=0?n:0;var i=e.response;"number"===typeof i.retryCount&&"number"===typeof i.maxRetries&&i.retryCount>=i.maxRetries&&(t.MaxRetriesExceeded=1),c.emit("apiCall",[t])}}))},setupRequestListeners:function(e){},getSignerClass:function(e){var t,n=null,i="";e&&(i=(n=(e.service.api.operations||{})[e.operation]||null)?n.authtype:"");return t=this.config.signatureVersion?this.config.signatureVersion:"v4"===i||"v4-unsigned-body"===i?"v4":this.api.signatureVersion,r.Signers.RequestSigner.getVersion(t)},serviceInterface:function(){switch(this.api.protocol){case"ec2":case"query":return r.EventListeners.Query;case"json":return r.EventListeners.Json;case"rest-json":return r.EventListeners.RestJson;case"rest-xml":return r.EventListeners.RestXml}if(this.api.protocol)throw new Error("Invalid service `protocol' "+this.api.protocol+" in API config")},successfulResponse:function(e){return e.httpResponse.statusCode<300},numRetries:function(){return void 0!==this.config.maxRetries?this.config.maxRetries:this.defaultRetryCount},retryDelays:function(e){return r.util.calculateRetryDelay(e,this.config.retryDelayOptions)},retryableError:function(e){return!!this.timeoutError(e)||(!!this.networkingError(e)||(!!this.expiredCredentialsError(e)||(!!this.throttledError(e)||(e.statusCode>=500||403===e.statusCode))))},networkingError:function(e){return"NetworkingError"===e.code},timeoutError:function(e){return"TimeoutError"===e.code},expiredCredentialsError:function(e){return"ExpiredTokenException"===e.code},clockSkewError:function(e){switch(e.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},getSkewCorrectedDate:function(){return new Date(Date.now()+this.config.systemClockOffset)},applyClockOffset:function(e){e&&(this.config.systemClockOffset=e-Date.now())},isClockSkewed:function(e){if(e)return Math.abs(this.getSkewCorrectedDate().getTime()-e)>=3e4},throttledError:function(e){if(429===e.statusCode)return!0;switch(e.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":case"RequestThrottledException":case"TooManyRequestsException":case"TransactionInProgressException":return!0;default:return!1}},endpointFromTemplate:function(e){if("string"!==typeof e)return e;var t=e;return t=(t=(t=t.replace(/\{service\}/g,this.api.endpointPrefix)).replace(/\{region\}/g,this.config.region)).replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http")},setEndpoint:function(e){this.endpoint=new r.Endpoint(e,this.config)},paginationConfig:function(e,t){var n=this.api.operations[e].paginator;if(!n){if(t){var i=new Error;throw r.util.error(i,"No pagination configuration for "+e)}return null}return n}}),r.util.update(r.Service,{defineMethods:function(e){r.util.each(e.prototype.api.operations,(function(t){e.prototype[t]||("none"===e.prototype.api.operations[t].authtype?e.prototype[t]=function(e,n){return this.makeUnauthenticatedRequest(t,e,n)}:e.prototype[t]=function(e,n){return this.makeRequest(t,e,n)})}))},defineService:function(e,t,n){r.Service._serviceMap[e]=!0,Array.isArray(t)||(n=t,t=[]);var i=a(r.Service,n||{});if("string"===typeof e){r.Service.addVersions(i,t);var o=i.serviceIdentifier||e;i.serviceIdentifier=o}else i.prototype.api=e,r.Service.defineMethods(i);if(r.SequentialExecutor.call(this.prototype),!this.prototype.publisher&&r.util.clientSideMonitoring){var s=r.util.clientSideMonitoring.Publisher,u=(0,r.util.clientSideMonitoring.configProvider)();this.prototype.publisher=new s(u),u.enabled&&(r.Service._clientSideMonitoring=!0)}return r.SequentialExecutor.call(i.prototype),r.Service.addDefaultMonitoringListeners(i.prototype),i},addVersions:function(e,t){Array.isArray(t)||(t=[t]),e.services=e.services||{};for(var n=0;n=0))throw n.util.error(new Error,t);this.config.stsRegionalEndpoints=e.toLowerCase()},validateRegionalEndpointsFlag:function(){var e=this.config;if(e.stsRegionalEndpoints&&this.validateRegionalEndpointsFlagValue(e.stsRegionalEndpoints,{code:"InvalidConfiguration",message:'invalid "stsRegionalEndpoints" configuration. Expect "legacy" or "regional". Got "'+e.stsRegionalEndpoints+'".'}),n.util.isNode()){if(Object.prototype.hasOwnProperty.call(t.env,i)){var r=t.env.AWS_STS_REGIONAL_ENDPOINTS;this.validateRegionalEndpointsFlagValue(r,{code:"InvalidEnvironmentalVariable",message:'invalid AWS_STS_REGIONAL_ENDPOINTS environmental variable. Expect "legacy" or "regional". Got "'+t.env.AWS_STS_REGIONAL_ENDPOINTS+'".'})}var a={};try{a=n.util.getProfilesFromSharedConfig(n.util.iniLoader)[t.env.AWS_PROFILE||n.util.defaultProfile]}catch(u){}if(a&&Object.prototype.hasOwnProperty.call(a,o)){var s=a.sts_regional_endpoints;this.validateRegionalEndpointsFlagValue(s,{code:"InvalidConfiguration",message:'invalid sts_regional_endpoints profile config. Expect "legacy" or "regional". Got "'+a.sts_regional_endpoints+'".'})}}},optInRegionalEndpoint:function(){this.validateRegionalEndpointsFlag();var e=this.config;if("regional"===e.stsRegionalEndpoints){if(r(this),!this.isGlobalEndpoint)return;if(this.isGlobalEndpoint=!1,!e.region)throw n.util.error(new Error,{code:"ConfigError",message:"Missing region in config"});var t=e.endpoint.indexOf(".amazonaws.com");e.endpoint=e.endpoint.substring(0,t)+"."+e.region+e.endpoint.substring(t)}},validateService:function(){this.optInRegionalEndpoint()}})}).call(this,e("_process"))},{"../core":18,"../region_config":53,_process:85}],62:[function(e,t,n){var r=e("../core"),i=r.util.inherit,o="presigned-expires";function a(e){var t=e.httpRequest.headers[o],n=e.service.getSignerClass(e);if(delete e.httpRequest.headers["User-Agent"],delete e.httpRequest.headers["X-Amz-User-Agent"],n===r.Signers.V4){if(t>604800){throw r.util.error(new Error,{code:"InvalidExpiryTime",message:"Presigning does not support expiry time greater than a week with SigV4 signing.",retryable:!1})}e.httpRequest.headers[o]=t}else{if(n!==r.Signers.S3)throw r.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1});var i=e.service?e.service.getSkewCorrectedDate():r.util.date.getDate();e.httpRequest.headers[o]=parseInt(r.util.date.unixTimestamp(i)+t,10).toString()}}function s(e){var t=e.httpRequest.endpoint,n=r.util.urlParse(e.httpRequest.path),i={};n.search&&(i=r.util.queryStringParse(n.search.substr(1)));var a=e.httpRequest.headers.Authorization.split(" ");if("AWS"===a[0])a=a[1].split(":"),i.AWSAccessKeyId=a[0],i.Signature=a[1],r.util.each(e.httpRequest.headers,(function(e,t){e===o&&(e="Expires"),0===e.indexOf("x-amz-meta-")&&(delete i[e],e=e.toLowerCase()),i[e]=t})),delete e.httpRequest.headers[o],delete i.Authorization,delete i.Host;else if("AWS4-HMAC-SHA256"===a[0]){a.shift();var s=a.join(" ").match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];i["X-Amz-Signature"]=s,delete i.Expires}t.pathname=n.pathname,t.search=r.util.queryParamsToString(i)}r.Signers.Presign=i({sign:function(e,t,n){if(e.httpRequest.headers[o]=t||3600,e.on("build",a),e.on("sign",s),e.removeListener("afterBuild",r.EventListeners.Core.SET_CONTENT_LENGTH),e.removeListener("afterBuild",r.EventListeners.Core.COMPUTE_SHA256),e.emit("beforePresign",[e]),!n){if(e.build(),e.response.error)throw e.response.error;return r.util.urlFormat(e.httpRequest.endpoint)}e.build((function(){this.response.error?n(this.response.error):n(null,r.util.urlFormat(e.httpRequest.endpoint))}))}}),t.exports=r.Signers.Presign},{"../core":18}],63:[function(e,t,n){var r=e("../core"),i=r.util.inherit;r.Signers.RequestSigner=i({constructor:function(e){this.request=e},setServiceClientId:function(e){this.serviceClientId=e},getServiceClientId:function(){return this.serviceClientId}}),r.Signers.RequestSigner.getVersion=function(e){switch(e){case"v2":return r.Signers.V2;case"v3":return r.Signers.V3;case"s3v4":case"v4":return r.Signers.V4;case"s3":return r.Signers.S3;case"v3https":return r.Signers.V3Https}throw new Error("Unknown signing version "+e)},e("./v2"),e("./v3"),e("./v3https"),e("./v4"),e("./s3"),e("./presign")},{"../core":18,"./presign":62,"./s3":64,"./v2":65,"./v3":66,"./v3https":67,"./v4":68}],64:[function(e,t,n){var r=e("../core"),i=r.util.inherit;r.Signers.S3=i(r.Signers.RequestSigner,{subResources:{acl:1,accelerate:1,analytics:1,cors:1,lifecycle:1,delete:1,inventory:1,location:1,logging:1,metrics:1,notification:1,partNumber:1,policy:1,requestPayment:1,replication:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:function(e,t){this.request.headers["presigned-expires"]||(this.request.headers["X-Amz-Date"]=r.util.date.rfc822(t)),e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken);var n=this.sign(e.secretAccessKey,this.stringToSign()),i="AWS "+e.accessKeyId+":"+n;this.request.headers.Authorization=i},stringToSign:function(){var e=this.request,t=[];t.push(e.method),t.push(e.headers["Content-MD5"]||""),t.push(e.headers["Content-Type"]||""),t.push(e.headers["presigned-expires"]||"");var n=this.canonicalizedAmzHeaders();return n&&t.push(n),t.push(this.canonicalizedResource()),t.join("\n")},canonicalizedAmzHeaders:function(){var e=[];r.util.each(this.request.headers,(function(t){t.match(/^x-amz-/i)&&e.push(t)})),e.sort((function(e,t){return e.toLowerCase()=0?"&":"?";this.request.path+=o+r.util.queryParamsToString(i)},authorization:function(e,t){var n=[],r=this.credentialString(t);return n.push(this.algorithm+" Credential="+e.accessKeyId+"/"+r),n.push("SignedHeaders="+this.signedHeaders()),n.push("Signature="+this.signature(e,t)),n.join(", ")},signature:function(e,t){var n=i.getSigningKey(e,t.substr(0,8),this.request.region,this.serviceName,this.signatureCache);return r.util.crypto.hmac(n,this.stringToSign(t),"hex")},stringToSign:function(e){var t=[];return t.push("AWS4-HMAC-SHA256"),t.push(e),t.push(this.credentialString(e)),t.push(this.hexEncodedHash(this.canonicalString())),t.join("\n")},canonicalString:function(){var e=[],t=this.request.pathname();return"s3"!==this.serviceName&&"s3v4"!==this.signatureVersion&&(t=r.util.uriEscapePath(t)),e.push(this.request.method),e.push(t),e.push(this.request.search()),e.push(this.canonicalHeaders()+"\n"),e.push(this.signedHeaders()),e.push(this.hexEncodedBodyHash()),e.join("\n")},canonicalHeaders:function(){var e=[];r.util.each.call(this,this.request.headers,(function(t,n){e.push([t,n])})),e.sort((function(e,t){return e[0].toLowerCase()50&&delete i[o.shift()]),d},emptyCache:function(){i={},o=[]}}},{"../core":18}],70:[function(e,t,n){function r(e,t){this.currentState=t||null,this.states=e||{}}r.prototype.runTo=function(e,t,n,r){"function"===typeof e&&(r=n,n=t,t=e,e=null);var i=this,o=i.states[i.currentState];o.fn.call(n||i,r,(function(r){if(r){if(!o.fail)return t?t.call(n,r):null;i.currentState=o.fail}else{if(!o.accept)return t?t.call(n):null;i.currentState=o.accept}if(i.currentState===e)return t?t.call(n,r):null;i.runTo(e,t,n,r)}))},r.prototype.addState=function(e,t,n,r){return"function"===typeof t?(r=t,t=null,n=null):"function"===typeof n&&(r=n,n=null),this.currentState||(this.currentState=e),this.states[e]={accept:t,fail:n,fn:r},this},t.exports=r},{}],71:[function(e,t,n){(function(n,r){var i,o={environment:"nodejs",engine:function(){if(o.isBrowser()&&"undefined"!==typeof navigator)return navigator.userAgent;var e=n.platform+"/"+n.version;return n.env.AWS_EXECUTION_ENV&&(e+=" exec-env/"+n.env.AWS_EXECUTION_ENV),e},userAgent:function(){var t=o.environment,n="aws-sdk-"+t+"/"+e("./core").VERSION;return"nodejs"===t&&(n+=" "+o.engine()),n},uriEscape:function(e){var t=encodeURIComponent(e);return t=(t=t.replace(/[^A-Za-z0-9_.~\-%]+/g,escape)).replace(/[*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))},uriEscapePath:function(e){var t=[];return o.arrayEach(e.split("/"),(function(e){t.push(o.uriEscape(e))})),t.join("/")},urlParse:function(e){return o.url.parse(e)},urlFormat:function(e){return o.url.format(e)},queryStringParse:function(e){return o.querystring.parse(e)},queryParamsToString:function(e){var t=[],n=o.uriEscape,r=Object.keys(e).sort();return o.arrayEach(r,(function(r){var i=e[r],a=n(r),s=a+"=";if(Array.isArray(i)){var u=[];o.arrayEach(i,(function(e){u.push(n(e))})),s=a+"="+u.sort().join("&"+a+"=")}else void 0!==i&&null!==i&&(s=a+"="+n(i));t.push(s)})),t.join("&")},readFileSync:function(t){return o.isBrowser()?null:e("fs").readFileSync(t,"utf-8")},base64:{encode:function(e){if("number"===typeof e)throw o.error(new Error("Cannot base64 encode number "+e));return null===e||"undefined"===typeof e?e:o.buffer.toBuffer(e).toString("base64")},decode:function(e){if("number"===typeof e)throw o.error(new Error("Cannot base64 decode number "+e));return null===e||"undefined"===typeof e?e:o.buffer.toBuffer(e,"base64")}},buffer:{toBuffer:function(e,t){return"function"===typeof o.Buffer.from&&o.Buffer.from!==Uint8Array.from?o.Buffer.from(e,t):new o.Buffer(e,t)},alloc:function(e,t,n){if("number"!==typeof e)throw new Error("size passed to alloc must be a number.");if("function"===typeof o.Buffer.alloc)return o.Buffer.alloc(e,t,n);var r=new o.Buffer(e);return void 0!==t&&"function"===typeof r.fill&&r.fill(t,void 0,void 0,n),r},toStream:function(e){o.Buffer.isBuffer(e)||(e=o.buffer.toBuffer(e));var t=new o.stream.Readable,n=0;return t._read=function(r){if(n>=e.length)return t.push(null);var i=n+r;i>e.length&&(i=e.length),t.push(e.slice(n,i)),n=i},t},concat:function(e){var t,n,r=0,i=0;for(n=0;n>>8^t[255&(n^e.readUInt8(r))]}return(-1^n)>>>0},hmac:function(e,t,n,r){return n||(n="binary"),"buffer"===n&&(n=void 0),r||(r="sha256"),"string"===typeof t&&(t=o.buffer.toBuffer(t)),o.crypto.lib.createHmac(r,e).update(t).digest(n)},md5:function(e,t,n){return o.crypto.hash("md5",e,t,n)},sha256:function(e,t,n){return o.crypto.hash("sha256",e,t,n)},hash:function(e,t,n,r){var i=o.crypto.createHash(e);n||(n="binary"),"buffer"===n&&(n=void 0),"string"===typeof t&&(t=o.buffer.toBuffer(t));var a=o.arraySliceFn(t),s=o.Buffer.isBuffer(t);if(o.isBrowser()&&"undefined"!==typeof ArrayBuffer&&t&&t.buffer instanceof ArrayBuffer&&(s=!0),r&&"object"===typeof t&&"function"===typeof t.on&&!s)t.on("data",(function(e){i.update(e)})),t.on("error",(function(e){r(e)})),t.on("end",(function(){r(null,i.digest(n))}));else{if(!r||!a||s||"undefined"===typeof FileReader){o.isBrowser()&&"object"===typeof t&&!s&&(t=new o.Buffer(new Uint8Array(t)));var u=i.update(t).digest(n);return r&&r(null,u),u}var c=0,l=new FileReader;l.onerror=function(){r(new Error("Failed to read data."))},l.onload=function(){var e=new o.Buffer(new Uint8Array(l.result));i.update(e),c+=e.length,l._continueReading()},l._continueReading=function(){if(c>=t.size)r(null,i.digest(n));else{var e=c+524288;e>t.size&&(e=t.size),l.readAsArrayBuffer(a.call(t,c,e))}},l._continueReading()}},toHex:function(e){for(var t=[],n=0;n=3e5,!1),i.config.isClockSkewed},applyClockOffset:function(e){e&&(i.config.systemClockOffset=e-(new Date).getTime())},extractRequestId:function(e){var t=e.httpResponse.headers["x-amz-request-id"]||e.httpResponse.headers["x-amzn-requestid"];!t&&e.data&&e.data.ResponseMetadata&&(t=e.data.ResponseMetadata.RequestId),t&&(e.requestId=t),e.error&&(e.error.requestId=t)},addPromises:function(e,t){var n=!1;void 0===t&&i&&i.config&&(t=i.config.getPromisesDependency()),void 0===t&&"undefined"!==typeof Promise&&(t=Promise),"function"!==typeof t&&(n=!0),Array.isArray(e)||(e=[e]);for(var r=0;r=500||429===r});i&&a.retryable&&(a.retryAfter=i),u(a)}}))}),u)};i.util.defer(c)},uuid:{v4:function(){return e("uuid").v4()}},convertPayloadToString:function(e){var t=e.request,n=t.operation,r=t.service.api.operations[n].output||{};r.payload&&e.data[r.payload]&&(e.data[r.payload]=e.data[r.payload].toString())},defer:function(e){"object"===typeof n&&"function"===typeof n.nextTick?n.nextTick(e):"function"===typeof r?r(e):setTimeout(e,0)},getRequestPayloadShape:function(e){var t=e.service.api.operations;if(t){var n=(t||{})[e.operation];if(n&&n.input&&n.input.payload)return n.input.members[n.input.payload]}},getProfilesFromSharedConfig:function(e,t){var r={},i={};if(n.env[o.configOptInEnv])i=e.loadFrom({isConfig:!0,filename:n.env[o.sharedConfigFileEnv]});for(var a=e.loadFrom({filename:t||n.env[o.configOptInEnv]&&n.env[o.sharedCredentialsFileEnv]}),s=0,u=Object.keys(i);s0||r?o.toString():""},t.exports=a},{"../util":71,"./xml-node":76,"./xml-text":77}],74:[function(e,t,n){t.exports={escapeAttribute:function(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(//g,">").replace(/"/g,""")}}},{}],75:[function(e,t,n){t.exports={escapeElement:function(e){return e.replace(/&/g,"&").replace(//g,">")}}},{}],76:[function(e,t,n){var r=e("./escape-attribute").escapeAttribute;function i(e,t){void 0===t&&(t=[]),this.name=e,this.children=t,this.attributes={}}i.prototype.addAttribute=function(e,t){return this.attributes[e]=t,this},i.prototype.addChildNode=function(e){return this.children.push(e),this},i.prototype.removeAttribute=function(e){return delete this.attributes[e],this},i.prototype.toString=function(){for(var e=Boolean(this.children.length),t="<"+this.name,n=this.attributes,i=0,o=Object.keys(n);i"+this.children.map((function(e){return e.toString()})).join("")+"":"/>")},t.exports={XmlNode:i}},{"./escape-attribute":74}],77:[function(e,t,n){var r=e("./escape-element").escapeElement;function i(e){this.value=e}i.prototype.toString=function(){return r(""+this.value)},t.exports={XmlText:i}},{"./escape-element":75}],78:[function(e,t,n){"use strict";n.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},n.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,f=s>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,u=n-i;su?u:s+a));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],79:[function(e,t,n){},{}],80:[function(t,n,r){(function(e,n){"use strict";var i=t("base64-js"),o=t("ieee754"),a=t("isarray");function s(){return n.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(n.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(i)return z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return x(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,r,i,o){if(0===e.length)return-1;if("string"===typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"===typeof t&&(t=n.from(t,i)),n.isBuffer(t))return 0===t.length?-1:y(e,t,r,i,o);if("number"===typeof t)return t&=255,n.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,i,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function x(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128===(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},n.prototype.compare=function(e,t,r,i,o){if(!n.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=r)return 0;if(i>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(a,s),c=this.slice(i,o),l=e.slice(t,r),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return S(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,i,o,a){if(!n.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function j(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function L(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return i||L(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,i){return i||L(e,0,n,8),o.write(e,t,n,r,52,8),n+8}n.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t0&&(i*=256);)r+=this[e+--t]*i;return r},n.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},n.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},n.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},n.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},n.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},n.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},n.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},n.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},n.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},n.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},n.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},n.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},n.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},n.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},n.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},n.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},n.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},n.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,255,0),n.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},n.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},n.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),n.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},n.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},n.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),n.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},n.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},n.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},n.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,127,-128),n.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},n.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},n.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),n.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},n.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),n.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},n.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),n.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},n.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},n.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},n.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},n.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},n.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--o)e[o+t]=this[o+r];else if(a<1e3||!n.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,"undefined"!==typeof e?e:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},t("buffer").Buffer)},{"base64-js":78,buffer:80,ieee754:82,isarray:83}],81:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"===typeof e}function o(e){return"object"===typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,s,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}if(a(n=this._events[e]))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),r=(c=n.slice()).length,u=0;u0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"===typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var n,r,a,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){r=s;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(i(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],82:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,l=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+e[t+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[n+d]=255&a,d+=p,a/=256,c-=8);e[n+d-p]|=128*m}},{}],83:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],84:[function(e,t,n){!function(e){"use strict";function t(e){return null!==e&&"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function r(e,i){if(e===i)return!0;if(Object.prototype.toString.call(e)!==Object.prototype.toString.call(i))return!1;if(!0===t(e)){if(e.length!==i.length)return!1;for(var o=0;o":!0,"=":!0,"!":!0},B={" ":!0,"\t":!0,"\n":!0};function F(e){return e>="0"&&e<="9"||"-"===e}function z(){}z.prototype={tokenize:function(e){var t,n,r,i,o=[];for(this._current=0;this._current="a"&&i<="z"||i>="A"&&i<="Z"||"_"===i)t=this._current,n=this._consumeUnquotedIdentifier(e),o.push({type:c,value:n,start:t});else if(void 0!==D[e[this._current]])o.push({type:D[e[this._current]],value:e[this._current],start:this._current}),this._current++;else if(F(e[this._current]))r=this._consumeNumber(e),o.push(r);else if("["===e[this._current])r=this._consumeLBracket(e),o.push(r);else if('"'===e[this._current])t=this._current,n=this._consumeQuotedIdentifier(e),o.push({type:l,value:n,start:t});else if("'"===e[this._current])t=this._current,n=this._consumeRawStringLiteral(e),o.push({type:L,value:n,start:t});else if("`"===e[this._current]){t=this._current;var a=this._consumeLiteral(e);o.push({type:L,value:a,start:t})}else if(void 0!==U[e[this._current]])o.push(this._consumeOperator(e));else if(void 0!==B[e[this._current]])this._current++;else if("&"===e[this._current])t=this._current,this._current++,"&"===e[this._current]?(this._current++,o.push({type:S,value:"&&",start:t})):o.push({type:y,value:"&",start:t});else{if("|"!==e[this._current]){var s=new Error("Unknown character:"+e[this._current]);throw s.name="LexerError",s}t=this._current,this._current++,"|"===e[this._current]?(this._current++,o.push({type:w,value:"||",start:t})):o.push({type:b,value:"|",start:t})}return o},_consumeUnquotedIdentifier:function(e){var t,n=this._current;for(this._current++;this._current="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||"_"===t);)this._current++;return e.slice(n,this._current)},_consumeQuotedIdentifier:function(e){var t=this._current;this._current++;for(var n=e.length;'"'!==e[this._current]&&this._current"===n?"="===e[this._current]?(this._current++,{type:x,value:">=",start:t}):{type:E,value:">",start:t}:"="===n&&"="===e[this._current]?(this._current++,{type:_,value:"==",start:t}):void 0},_consumeLiteral:function(e){this._current++;for(var t,n=this._current,r=e.length;"`"!==e[this._current]&&this._current=0)return!0;if(["true","false","null"].indexOf(e)>=0)return!0;if(!("-0123456789".indexOf(e[0])>=0))return!1;try{return JSON.parse(e),!0}catch(t){return!1}}};var q={};function H(){}function V(e){this.runtime=e}function W(e){this._interpreter=e,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[a]}]},avg:{_func:this._functionAvg,_signature:[{types:[8]}]},ceil:{_func:this._functionCeil,_signature:[{types:[a]}]},contains:{_func:this._functionContains,_signature:[{types:[s,3]},{types:[1]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[s]},{types:[s]}]},floor:{_func:this._functionFloor,_signature:[{types:[a]}]},length:{_func:this._functionLength,_signature:[{types:[s,3,4]}]},map:{_func:this._functionMap,_signature:[{types:[6]},{types:[3]}]},max:{_func:this._functionMax,_signature:[{types:[8,9]}]},merge:{_func:this._functionMerge,_signature:[{types:[4],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[3]},{types:[6]}]},sum:{_func:this._functionSum,_signature:[{types:[8]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[s]},{types:[s]}]},min:{_func:this._functionMin,_signature:[{types:[8,9]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[3]},{types:[6]}]},type:{_func:this._functionType,_signature:[{types:[1]}]},keys:{_func:this._functionKeys,_signature:[{types:[4]}]},values:{_func:this._functionValues,_signature:[{types:[4]}]},sort:{_func:this._functionSort,_signature:[{types:[9,8]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[3]},{types:[6]}]},join:{_func:this._functionJoin,_signature:[{types:[s]},{types:[9]}]},reverse:{_func:this._functionReverse,_signature:[{types:[s,3]}]},to_array:{_func:this._functionToArray,_signature:[{types:[1]}]},to_string:{_func:this._functionToString,_signature:[{types:[1]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[1]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[1],variadic:!0}]}}}q.EOF=0,q.UnquotedIdentifier=0,q.QuotedIdentifier=0,q.Rbracket=0,q.Rparen=0,q.Comma=0,q.Rbrace=0,q.Number=0,q.Current=0,q.Expref=0,q.Pipe=1,q.Or=2,q.And=3,q.EQ=5,q.GT=5,q.LT=5,q.GTE=5,q.LTE=5,q.NE=5,q.Flatten=9,q.Star=20,q.Filter=21,q.Dot=40,q.Not=45,q.Lbrace=50,q.Lbracket=55,q.Lparen=60,H.prototype={parse:function(e){this._loadTokens(e),this.index=0;var t=this.expression(0);if(this._lookahead(0)!==u){var n=this._lookaheadToken(0),r=new Error("Unexpected token type: "+n.type+", value: "+n.value);throw r.name="ParserError",r}return t},_loadTokens:function(e){var t=(new z).tokenize(e);t.push({type:u,value:"",start:e.length}),this.tokens=t},expression:function(e){var t=this._lookaheadToken(0);this._advance();for(var n=this.nud(t),r=this._lookahead(0);e=0?this.expression(e):t===j?(this._match(j),this._parseMultiselectList()):t===R?(this._match(R),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(e){var t;if(q[this._lookahead(0)]<10)t={type:"Identity"};else if(this._lookahead(0)===j)t=this.expression(e);else if(this._lookahead(0)===T)t=this.expression(e);else{if(this._lookahead(0)!==I){var n=this._lookaheadToken(0),r=new Error("Sytanx error, unexpected token: "+n.value+"("+n.type+")");throw r.name="ParserError",r}this._match(I),t=this._parseDotRHS(e)}return t},_parseMultiselectList:function(){for(var e=[];this._lookahead(0)!==f;){var t=this.expression(0);if(e.push(t),this._lookahead(0)===d&&(this._match(d),this._lookahead(0)===f))throw new Error("Unexpected token Rbracket")}return this._match(f),{type:"MultiSelectList",children:e}},_parseMultiselectHash:function(){for(var e,t,n,r=[],i=[c,l];;){if(e=this._lookaheadToken(0),i.indexOf(e.type)<0)throw new Error("Expecting an identifier token, got: "+e.type);if(t=e.value,this._advance(),this._match(p),n={type:"KeyValuePair",name:t,value:this.expression(0)},r.push(n),this._lookahead(0)===d)this._match(d);else if(this._lookahead(0)===m){this._match(m);break}}return{type:"MultiSelectHash",children:r}}},V.prototype={search:function(e,t){return this.visit(e,t)},visit:function(e,o){var a,s,u,c,l,f,h,d,p;switch(e.type){case"Field":return null===o?null:n(o)?void 0===(f=o[e.name])?null:f:null;case"Subexpression":for(u=this.visit(e.children[0],o),p=1;p0)for(p=S;pA;p+=T)u.push(o[p]);return u;case"Projection":var I=this.visit(e.children[0],o);if(!t(I))return null;for(d=[],p=0;pl;break;case x:u=c>=l;break;case M:u=c=e&&(t=n<0?e-1:e),t}},W.prototype={callFunction:function(e,t){var n=this.functionTable[e];if(void 0===n)throw new Error("Unknown function: "+e+"()");return this._validateArgs(e,t,n._signature),n._func.call(this,t)},_validateArgs:function(e,t,n){var r,i,o,a;if(n[n.length-1].variadic){if(t.length=0;r--)n+=t[r];return n}var i=e[0].slice(0);return i.reverse(),i},_functionAbs:function(e){return Math.abs(e[0])},_functionCeil:function(e){return Math.ceil(e[0])},_functionAvg:function(e){for(var t=0,n=e[0],r=0;r=0},_functionFloor:function(e){return Math.floor(e[0])},_functionLength:function(e){return n(e[0])?Object.keys(e[0]).length:e[0].length},_functionMap:function(e){for(var t=[],n=this._interpreter,r=e[0],i=e[1],o=0;o0){if(this._getTypeName(e[0][0])===a)return Math.max.apply(Math,e[0]);for(var t=e[0],n=t[0],r=1;r0){if(this._getTypeName(e[0][0])===a)return Math.min.apply(Math,e[0]);for(var t=e[0],n=t[0],r=1;rs?1:au&&(u=n,t=i[c]);return t},_functionMinBy:function(e){for(var t,n,r=e[1],i=e[0],o=this.createKeyFunction(r,[a,s]),u=1/0,c=0;c1)for(var n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function g(e){throw RangeError(d[e])}function v(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+v((e=e.replace(h,".")).split("."),t).join(".")}function b(e){for(var t,n,r=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=m((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=m(e)})).join("")}function S(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=c)e=p(e/35);return p(r+36*e/(e+38))}function E(e){var t,n,r,i,o,a,s,l,f,h,d,m=[],v=e.length,y=0,b=128,S=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&g("not-basic"),m.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=v&&g("invalid-input"),((l=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:c)>=c||l>p((u-y)/a))&&g("overflow"),y+=l*a,!(l<(f=s<=S?1:s>=S+26?26:s-S));s+=c)a>p(u/(h=c-f))&&g("overflow"),a*=h;S=_(y-o,t=m.length+1,0==o),p(y/t)>u-b&&g("overflow"),b+=p(y/t),y%=t,m.splice(y++,0,b)}return w(m)}function M(e){var t,n,r,i,o,a,s,l,f,h,d,v,y,w,E,M=[];for(v=(e=b(e)).length,t=128,n=0,o=72,a=0;a=t&&dp((u-n)/(y=r+1))&&g("overflow"),n+=(s-t)*y,t=s,a=0;au&&g("overflow"),d==t){for(l=n,f=c;!(l<(h=f<=o?1:f>=o+26?26:f-o));f+=c)E=l-h,w=c-h,M.push(m(S(h+E%w,0))),l=p(E/w);M.push(m(S(l,0))),o=_(n,y,r==i),n=0,++r}++n,++t}return M.join("")}s={version:"1.3.2",ucs2:{decode:b,encode:w},decode:E,encode:M,toASCII:function(e){return y(e,(function(e){return f.test(e)?"xn--"+M(e):e}))},toUnicode:function(e){return y(e,(function(e){return l.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(t=function(){return s}.call(o,n,o,i))||(i.exports=t)}()}).call(this,"undefined"!==typeof e?e:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],87:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!==typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"===typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;l=0?(f=m.substr(0,g),h=m.substr(g+1)):(f=m,h=""),d=decodeURIComponent(f),p=decodeURIComponent(h),r(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],88:[function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"===typeof e?o(a(e),(function(a){var s=encodeURIComponent(r(a))+n;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(r(e))})).join(t):s+encodeURIComponent(r(e[a]))})).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r0&&u>s&&(u=s);for(var c=0;c=0?(l=p.substr(0,m),f=p.substr(m+1)):(l=p,f=""),h=decodeURIComponent(l),d=decodeURIComponent(f),r(o,h)?Array.isArray(o[h])?o[h].push(d):o[h]=[o[h],d]:o[h]=d}return o}},{}],91:[function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,i){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"===typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(r(i))+n;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(r(e))})).join(t):o+encodeURIComponent(r(e[i]))})).join(t):i?encodeURIComponent(r(i))+n+encodeURIComponent(r(e)):""}},{}],92:[function(e,t,n){arguments[4][89][0].apply(n,arguments)},{"./decode":90,"./encode":91,dup:89}],93:[function(e,t,n){(function(t,r){var i=e("process/browser.js").nextTick,o=Function.prototype.apply,a=Array.prototype.slice,s={},u=0;function c(e,t){this._id=e,this._clearFn=t}n.setTimeout=function(){return new c(o.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new c(o.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n.setImmediate="function"===typeof t?t:function(e){var t=u++,r=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,i((function(){s[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))})),t},n.clearImmediate="function"===typeof r?r:function(e){delete s[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":85,timers:93}],94:[function(e,t,n){var r=e("punycode");function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}n.parse=v,n.resolve=function(e,t){return v(e,!1,!0).resolve(t)},n.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},n.format=function(e){y(e)&&(e=v(e));return e instanceof i?e.format():i.prototype.format.call(e)},n.Url=i;var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(s),c=["%","/","?",";","#"].concat(u),l=["/","?","#"],f=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,d={javascript:!0,"javascript:":!0},p={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=e("querystring");function v(e,t,n){if(e&&b(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}function y(e){return"string"===typeof e}function b(e){return"object"===typeof e&&null!==e}function w(e){return null===e}i.prototype.parse=function(e,t,n){if(!y(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e;i=i.trim();var a=o.exec(i);if(a){var s=(a=a[0]).toLowerCase();this.protocol=s,i=i.substr(a.length)}if(n||a||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var v="//"===i.substr(0,2);!v||a&&p[a]||(i=i.substr(2),this.slashes=!0)}if(!p[a]&&(v||a&&!m[a])){for(var b,w,S=-1,_=0;_127?C+="x":C+=O[A];if(!C.match(f)){var I=x.slice(0,_),P=x.slice(_+1),R=O.match(h);R&&(I.push(R[1]),P.unshift(R[2])),P.length&&(i="/"+P.join(".")+i),this.hostname=I.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!M){var j=this.hostname.split("."),N=[];for(_=0;_0)&&n.host.split("@"))&&(n.auth=S.shift(),n.host=n.hostname=S.shift());return n.search=e.search,n.query=e.query,w(n.pathname)&&w(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!f.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var d=f.slice(-1)[0],g=(n.host||e.host)&&("."===d||".."===d)||""===d,v=0,b=f.length;b>=0;b--)"."==(d=f[b])?f.splice(b,1):".."===d?(f.splice(b,1),v++):v&&(f.splice(b,1),v--);if(!c&&!l)for(;v--;v)f.unshift("..");!c||""===f[0]||f[0]&&"/"===f[0].charAt(0)||f.unshift(""),g&&"/"!==f.join("/").substr(-1)&&f.push("");var S,_=""===f[0]||f[0]&&"/"===f[0].charAt(0);h&&(n.hostname=n.host=_?"":f.length?f.shift():"",(S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=S.shift(),n.host=n.hostname=S.shift()));return(c=c||n.host&&f.length)&&!_&&f.unshift(""),f.length?n.pathname=f.join("/"):(n.pathname=null,n.path=null),w(n.pathname)&&w(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:86,querystring:89}],95:[function(e,t,n){"function"===typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],96:[function(e,t,n){t.exports=function(e){return e&&"object"===typeof e&&"function"===typeof e.copy&&"function"===typeof e.fill&&"function"===typeof e.readUInt8}},{}],97:[function(t,n,r){(function(e,n){var i=/%[sdj%]/g;r.format=function(e){if(!v(e)){for(var t=[],n=0;n=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}})),u=r[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(t)?n.showHidden=t:t&&r._extend(n,t),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),l(n,e,n.depth)}function u(e,t){var n=s.styles[t];return n?"\x1b["+s.colors[n][0]+"m"+e+"\x1b["+s.colors[n][1]+"m":e}function c(e,t){return e}function l(e,t,n){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return v(i)||(i=l(e,i,n)),i}var o=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(v(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(g(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),_(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(t);if(0===a.length){if(E(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(b(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(S(t))return e.stylize(Date.prototype.toString.call(t),"date");if(_(t))return f(t)}var c,w="",M=!1,x=["{","}"];(d(t)&&(M=!0,x=["[","]"]),E(t))&&(w=" [Function"+(t.name?": "+t.name:"")+"]");return b(t)&&(w=" "+RegExp.prototype.toString.call(t)),S(t)&&(w=" "+Date.prototype.toUTCString.call(t)),_(t)&&(w=" "+f(t)),0!==a.length||M&&0!=t.length?n<0?b(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=M?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(c,w,x)):x[0]+w+x[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),C(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=m(n)?l(e,u.value,null):l(e,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"===typeof e}function m(e){return null===e}function g(e){return"number"===typeof e}function v(e){return"string"===typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===M(e)}function w(e){return"object"===typeof e&&null!==e}function S(e){return w(e)&&"[object Date]"===M(e)}function _(e){return w(e)&&("[object Error]"===M(e)||e instanceof Error)}function E(e){return"function"===typeof e}function M(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(t){if(y(o)&&(o=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!a[t])if(new RegExp("\\b"+t+"\\b","i").test(o)){var n=e.pid;a[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else a[t]=function(){};return a[t]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=d,r.isBoolean=p,r.isNull=m,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=v,r.isSymbol=function(e){return"symbol"===typeof e},r.isUndefined=y,r.isRegExp=b,r.isObject=w,r.isDate=S,r.isError=_,r.isFunction=E,r.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},r.isBuffer=t("./support/isBuffer");var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(){var e=new Date,t=[x(e.getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){console.log("%s - %s",O(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,t("_process"),"undefined"!==typeof e?e:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"./support/isBuffer":96,_process:85,inherits:95}],98:[function(e,t,n){var r=e("./v1"),i=e("./v4"),o=i;o.v1=r,o.v4=i,t.exports=o},{"./v1":101,"./v4":102}],99:[function(e,t,n){for(var r=[],i=0;i<256;++i)r[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var n=t||0,i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},{}],100:[function(e,t,n){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var i=new Uint8Array(16);t.exports=function(){return r(i),i}}else{var o=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},{}],101:[function(e,t,n){var r,i,o=e("./lib/rng"),a=e("./lib/bytesToUuid"),s=0,u=0;t.exports=function(e,t,n){var c=t&&n||0,l=t||[],f=(e=e||{}).node||r,h=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==h){var d=o();null==f&&(f=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==h&&(h=i=16383&(d[6]<<8|d[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:u+1,g=p-s+(m-u)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||p>s)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=p,u=m,i=h;var v=(1e4*(268435455&(p+=122192928e5))+m)%4294967296;l[c++]=v>>>24&255,l[c++]=v>>>16&255,l[c++]=v>>>8&255,l[c++]=255&v;var y=p/4294967296*1e4&268435455;l[c++]=y>>>8&255,l[c++]=255&y,l[c++]=y>>>24&15|16,l[c++]=y>>>16&255,l[c++]=h>>>8|128,l[c++]=255&h;for(var b=0;b<6;++b)l[c+b]=f[b];return t||a(l)}},{"./lib/bytesToUuid":99,"./lib/rng":100}],102:[function(e,t,n){var r=e("./lib/rng"),i=e("./lib/bytesToUuid");t.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[o+s]=a[s];return t||i(a)}},{"./lib/bytesToUuid":99,"./lib/rng":100}],103:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./utils/LRU"),i=function(){function e(e){void 0===e&&(e=1e3),this.maxSize=e,this.cache=new r.LRUCache(e)}return Object.defineProperty(e.prototype,"size",{get:function(){return this.cache.length},enumerable:!0,configurable:!0}),e.prototype.put=function(t,n){var r="string"!==typeof t?e.getKeyString(t):t,i=this.populateValue(n);this.cache.put(r,i)},e.prototype.get=function(t){var n="string"!==typeof t?e.getKeyString(t):t,r=Date.now(),i=this.cache.get(n);if(i)for(var o=0;o>>=0;break;case"x":o=o.toString(16);break;case"X":o=o.toString(16).toUpperCase()}o=/[def]/.test(u[8])&&u[3]&&o>=0?"+"+o:o,l=u[4]?"0"==u[4]?"0":u[4].charAt(1):" ",f=u[6]-String(o).length,c=u[6]?n(l,f):"",m.push(u[5]?o+c:c+o)}return m.join("")},e.cache={},e.parse=function(e){for(var t=e,n=[],r=[],i=0;t;){if(null!==(n=/^[^\x25]+/.exec(t)))r.push(n[0]);else if(null!==(n=/^\x25{2}/.exec(t)))r.push("%");else{if(null===(n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t)))throw"[sprintf] huh?";if(n[2]){i|=1;var o=[],a=n[2],s=[];if(null===(s=/^([a-z_][a-z_\d]*)/i.exec(a)))throw"[sprintf] huh?";for(o.push(s[1]);""!==(a=a.substring(s[0].length));)if(null!==(s=/^\.([a-z_][a-z_\d]*)/i.exec(a)))o.push(s[1]);else{if(null===(s=/^\[(\d+)\]/.exec(a)))throw"[sprintf] huh?";o.push(s[1])}n[2]=o}else i|=2;if(3===i)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";r.push(n)}t=t.substring(n[0].length)}return r};function t(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function n(e,t){for(var n=[];t>0;n[--t]=e);return n.join("")}this.sprintf=e,this.vsprintf=function(t,n,r){return(r=n.slice(0)).splice(0,0,t),e.apply(null,r)}}(),function(){var e=this;connect=e.connect||{},e.connect=connect,e.lily=connect;var t={TEST:"TEST",TRACE:"TRACE",DEBUG:"DEBUG",INFO:"INFO",LOG:"LOG",WARN:"WARN",ERROR:"ERROR",CRITICAL:"CRITICAL"},n={CCP:"ccp",SOFTPHONE:"softphone",CHAT:"chat",TASK:"task"},r={TEST:0,TRACE:10,DEBUG:20,INFO:30,LOG:40,WARN:50,ERROR:100,CRITICAL:200},i={TRACE:function(e){console.info(e)},DEBUG:function(e){console.info(e)},INFO:function(e){console.info(e)},LOG:function(e){console.log(e)},TEST:function(e){console.log(e)},WARN:function(e){console.warn(e)},ERROR:function(e){console.error(e)},CRITICAL:function(e){console.error(e)}},o=function(e){var t,r,i=Array.prototype.slice.call(e,0),o=i.shift();return!function(e){return-1!==Object.values(n).indexOf(e)}(o)?(t=o,r=n.CCP):(r=o,t=i.shift()),{format:t,component:r,args:i}},a=function(e,t,n,r){this.component=e,this.level=t,this.text=n,this.time=new Date,this.exception=null,this.objects=[],this.line=0,this.loggerId=r};a.fromObject=function(e){var t=new a(n.CCP,e.level,e.text,e.loggerId);return"[object Date]"===Object.prototype.toString.call(e.time)?t.time=new Date(e.time.getTime()):"number"===typeof e.time?t.time=new Date(e.time):"string"===typeof e.time?t.time=Date.parse(e.time):t.time=new Date,t.exception=e.exception,t.objects=e.objects,t};var s=function e(t){var n=/AuthToken.*\=/g;t&&"object"===typeof t&&Object.keys(t).forEach((function(r){"object"===typeof t[r]&&e(t[r]),"string"!==typeof t[r]||"url"!==r&&"text"!==r||(t[r]=t[r].replace(n,"[redacted]"))}))},u=function(e){this.type=e instanceof Error?e.name:e.code||Object.prototype.toString.call(e),this.message=e.message,this.stack=e.stack?e.stack.split("\n"):[]};a.prototype.toString=function(){return connect.sprintf("[%s] [%s]: %s",this.getTime()&&this.getTime().toISOString?this.getTime().toISOString():"???",this.getLevel(),this.getText())},a.prototype.getTime=function(){return this.time},a.prototype.getLevel=function(){return this.level},a.prototype.getText=function(){return this.text},a.prototype.getComponent=function(){return this.component},a.prototype.withException=function(e){return this.exception=new u(e),this},a.prototype.withObject=function(e){var t=connect.deepcopy(e);return s(t),this.objects.push(t),this},a.prototype.sendInternalLogToServer=function(){return connect.getLog()._serverBoundInternalLogs.push(this),this};var c=function(){this._logs=[],this._rolledLogs=[],this._logsToPush=[],this._serverBoundInternalLogs=[],this._echoLevel=r.INFO,this._logLevel=r.INFO,this._lineCount=0,this._logRollInterval=0,this._logRollTimer=null,this._loggerId=(new Date).getTime()+"-"+Math.random().toString(36).slice(2),this.setLogRollInterval(18e5)};c.prototype.setLogRollInterval=function(t){var n=this;this._logRollTimer&&t===this._logRollInterval?this.warn("Logger is already set to the given interval: %d",this._logRollInterval):(this._logRollTimer&&e.clearInterval(this._logRollTimer),this._logRollInterval=t,this._logRollTimer=e.setInterval((function(){this._rolledLogs=this._logs,this._logs=[],n.info("Log roll interval occurred.")}),this._logRollInterval))},c.prototype.setLogLevel=function(e){if(!(e in r))throw new Error("Unknown logging level: "+e);this._logLevel=r[e]},c.prototype.setEchoLevel=function(e){if(!(e in r))throw new Error("Unknown logging level: "+e);this._echoLevel=r[e]},c.prototype.write=function(e,t,n){var r=new a(e,t,n,this.getLoggerId());return s(r),this.addLogEntry(r),r},c.prototype.addLogEntry=function(e){this._logs.push(e),n.SOFTPHONE===e.component&&this._logsToPush.push(e),e.level in r&&r[e.level]>=this._logLevel&&(r[e.level]>=this._echoLevel&&i[e.getLevel()](e.toString()),e.line=this._lineCount++)},c.prototype.sendInternalLogEntryToServer=function(e){this._serverBoundInternalLogs.push(e),e.level in r&&r[e.level]>=this._logLevel&&(r[e.level]>=this._echoLevel&&i[e.getLevel()](e.toString()),e.line=this._lineCount++)},c.prototype.clearObjects=function(){for(var e=0;e=o._logLevel})));var s=new e.Blob([JSON.stringify(a,void 0,4)],["text/plain"]),u=document.createElement("a");n=n||"agent-log";u.href=e.URL.createObjectURL(s),u.download=n+".txt",document.body.appendChild(u),u.click(),document.body.removeChild(u)},c.prototype.scheduleUpstreamLogPush=function(t){connect.upstreamLogPushScheduled||(connect.upstreamLogPushScheduled=!0,e.setInterval(connect.hitch(this,this.reportMasterLogsUpStream,t),5e3))},c.prototype.reportMasterLogsUpStream=function(e){var t=this._logsToPush.slice();this._logsToPush=[],connect.ifMaster(connect.MasterTopics.SEND_LOGS,(function(){t.length>0&&e.sendUpstream(connect.EventType.SEND_LOGS,t)}))},c.prototype.getLoggerId=function(){return this._loggerId},c.prototype.scheduleDownstreamClientSideLogsPush=function(){e.setInterval(connect.hitch(this,this.pushClientSideLogsDownstream),5e3)},c.prototype.pushClientSideLogsDownstream=function(){var e=[];this._serverBoundInternalLogs.length<50||(this._serverBoundInternalLogs.length>500?e=this._serverBoundInternalLogs.splice(0,500):(e=this._serverBoundInternalLogs,this._serverBoundInternalLogs=[]),connect.publishClientSideLogs(e))};var l=function t(n){c.call(this),this.conduit=n,e.setInterval(connect.hitch(this,this._pushLogsDownstream),t.LOG_PUSH_INTERVAL),e.clearInterval(this._logRollTimer),this._logRollTimer=null};l.LOG_PUSH_INTERVAL=1e3,(l.prototype=Object.create(c.prototype)).constructor=l,l.prototype.pushLogsDownstream=function(e){var t=this;e.forEach((function(e){t.conduit.sendDownstream(connect.EventType.LOG,e)}))},l.prototype._pushLogsDownstream=function(){var e=this;this._logs.forEach((function(t){e.conduit.sendDownstream(connect.EventType.LOG,t)})),this._logs=[];for(var t=0;t1},connect.fetch=function(e,t,n,r){return r=r||5,n=n||1e3,t=t||{},new Promise((function(i,o){!function r(a){fetch(e,t).then((function(e){e.status===connect.HTTP_STATUS_CODES.SUCCESS?i(e.json()):1!==a&&(e.status>=connect.HTTP_STATUS_CODES.INTERNAL_SERVER_ERROR||e.status===connect.HTTP_STATUS_CODES.TOO_MANY_REQUESTS)?setTimeout((function(){r(--a)}),n):o(e)})).catch((function(e){o(e)}))}(r)}))},connect.backoff=function(t,n,r,i){connect.assertTrue(connect.isFunction(t),"func must be a Function");var o=this;t({success:function(e){i&&i.success&&i.success(e)},failure:function(a,s){if(r>0){var u=2*n*Math.random();e.setTimeout((function(){o.backoff(t,2*u,--r,i)}),u)}else i&&i.failure&&i.failure(a,s)}})},connect.publishMetric=function(e){connect.core.getEventBus().trigger(connect.EventType.CLIENT_METRIC,e)},connect.publishSoftphoneStats=function(e){connect.core.getEventBus().trigger(connect.EventType.SOFTPHONE_STATS,e)},connect.publishSoftphoneReport=function(e){connect.core.getEventBus().trigger(connect.EventType.SOFTPHONE_REPORT,e)},connect.publishClientSideLogs=function(e){connect.core.getEventBus().trigger(connect.EventType.CLIENT_SIDE_LOGS,e)},connect.PopupManager=function(){},connect.PopupManager.prototype.open=function(e,t,n){var r=this._getLastOpenedTimestamp(t),i=(new Date).getTime(),o=null;if(i-r>864e5){if(n){var a=n.height||578,s=n.width||433,u=n.top||0,c=n.left||0;(o=window.open("",t,"width="+s+", height="+a+", top="+u+", left="+c)).location!==e&&(o=window.open(e,t,"width="+s+", height="+a+", top="+u+", left="+c))}else(o=window.open("",t)).location!==e&&(o=window.open(e,t));this._setLastOpenedTimestamp(t,i)}return o},connect.PopupManager.prototype.clear=function(t){var n=this._getLocalStorageKey(t);e.localStorage.removeItem(n)},connect.PopupManager.prototype._getLastOpenedTimestamp=function(t){var n=this._getLocalStorageKey(t),r=e.localStorage.getItem(n);return r?parseInt(r,10):0},connect.PopupManager.prototype._setLastOpenedTimestamp=function(t,n){var r=this._getLocalStorageKey(t);e.localStorage.setItem(r,""+n)},connect.PopupManager.prototype._getLocalStorageKey=function(e){return"connectPopupManager::"+e};var n=connect.makeEnum(["granted","denied","default"]);connect.NotificationManager=function(){this.queue=[],this.permission=n.DEFAULT},connect.NotificationManager.prototype.requestPermission=function(){var t=this;"Notification"in e?e.Notification.permission===n.DENIED?(connect.getLog().warn("The user has requested to not receive notifications.").sendInternalLogToServer(),this.permission=n.DENIED):this.permission!==n.GRANTED&&e.Notification.requestPermission().then((function(e){t.permission=e,e===n.GRANTED?t._showQueued():t.queue=[]})):(connect.getLog().warn("This browser doesn't support notifications.").sendInternalLogToServer(),this.permission=n.DENIED)},connect.NotificationManager.prototype.show=function(e,t){if(this.permission===n.GRANTED)return this._showImpl({title:e,options:t});if(this.permission===n.DENIED)connect.getLog().warn("Unable to show notification.").sendInternalLogToServer().withObject({title:e,options:t});else{var r={title:e,options:t};connect.getLog().warn("Deferring notification until user decides to allow or deny.").withObject(r).sendInternalLogToServer(),this.queue.push(r)}},connect.NotificationManager.prototype._showQueued=function(){var e=this,t=this.queue.map((function(t){return e._showImpl(t)}));return this.queue=[],t},connect.NotificationManager.prototype._showImpl=function(t){var n=new e.Notification(t.title,t.options);return t.options.clicked&&(n.onclick=function(){t.options.clicked.call(n)}),n},connect.BaseError=function(t,n){e.Error.call(this,connect.vsprintf(t,n))},connect.BaseError.prototype=Object.create(Error.prototype),connect.BaseError.prototype.constructor=connect.BaseError,connect.ValueError=function(){var e=Array.prototype.slice.call(arguments,0),t=e.shift();connect.BaseError.call(this,t,e)},connect.ValueError.prototype=Object.create(connect.BaseError.prototype),connect.ValueError.prototype.constructor=connect.ValueError,connect.NotImplementedError=function(){var e=Array.prototype.slice.call(arguments,0),t=e.shift();connect.BaseError.call(this,t,e)},connect.NotImplementedError.prototype=Object.create(connect.BaseError.prototype),connect.NotImplementedError.prototype.constructor=connect.NotImplementedError,connect.StateError=function(){var e=Array.prototype.slice.call(arguments,0),t=e.shift();connect.BaseError.call(this,t,e)},connect.StateError.prototype=Object.create(connect.BaseError.prototype),connect.StateError.prototype.constructor=connect.StateError,connect.VoiceIdError=function(e,t,n){var r={};return r.type=e,r.message=t,r.stack=Error(t),r.err=n,r},connect.isCCP=function(){return"ConnectSharedWorkerConduit"===connect.core.getUpstream().name}}(),function(){connect=this.connect||{},this.connect=connect;var e="<>",t=connect.makeEnum(["acknowledge","ack_timeout","init","api_request","api_response","auth_fail","access_denied","close","configure","log","master_request","master_response","synchronize","terminate","terminated","send_logs","reload_agent_configuration","broadcast","api_metric","client_metric","softphone_stats","softphone_report","client_side_logs","server_bound_internal_log","mute","iframe_style","update_connected_ccps"]),n=connect.makeNamespacedEnum("connect",["loginPopup","sendLogs","softphone","ringtone","metrics"]),r=connect.makeNamespacedEnum("agent",["init","update","refresh","routable","not_routable","pending","contact_pending","offline","error","softphone_error","websocket_connection_lost","websocket_connection_gained","state_change","acw","mute_toggle","local_media_stream_created"]),i=connect.makeNamespacedEnum("webSocket",["init_failure","connection_open","connection_close","connection_error","connection_gain","connection_lost","subscription_update","subscription_failure","all_message","send","subscribe"]),o=connect.makeNamespacedEnum("contact",["init","refresh","destroyed","incoming","pending","connecting","connected","missed","acw","view","ended","error","accepted"]),a=connect.makeNamespacedEnum("connection",["session_init","ready_to_start_session"]),s=connect.makeNamespacedEnum("configuration",["configure","set_speaker_device","set_microphone_device","set_ringer_device","speaker_device_changed","microphone_device_changed","ringer_device_changed"]),u=function(){};u.createRequest=function(e,t,n){return{event:e,requestId:connect.randomId(),method:t,params:n}},u.createResponse=function(e,t,n,r){return{event:e,requestId:t.requestId,data:n,err:r||null}};var c=function(e,t,n){this.subMap=e,this.id=connect.randomId(),this.eventName=t,this.f=n};c.prototype.unsubscribe=function(){this.subMap.unsubscribe(this.eventName,this.id)};var l=function(){this.subIdMap={},this.subEventNameMap={}};l.prototype.subscribe=function(e,t){var n=new c(this,e,t);this.subIdMap[n.id]=n;var r=this.subEventNameMap[e]||[];return r.push(n),this.subEventNameMap[e]=r,n},l.prototype.unsubscribe=function(e,t){connect.contains(this.subEventNameMap,e)&&(this.subEventNameMap[e]=this.subEventNameMap[e].filter((function(e){return e.id!==t})),this.subEventNameMap[e].length<1&&delete this.subEventNameMap[e]),connect.contains(this.subIdMap,t)&&delete this.subIdMap[t]},l.prototype.getAllSubscriptions=function(){return connect.values(this.subEventNameMap).reduce((function(e,t){return e.concat(t)}),[])},l.prototype.getSubscriptions=function(e){return this.subEventNameMap[e]||[]};var f=function(e){var t=e||{};this.subMap=new l,this.logEvents=t.logEvents||!1};f.prototype.subscribe=function(e,t){return connect.assertNotNull(e,"eventName"),connect.assertNotNull(t,"f"),connect.assertTrue(connect.isFunction(t),"f must be a function"),this.subMap.subscribe(e,t)},f.prototype.subscribeAll=function(t){return connect.assertNotNull(t,"f"),connect.assertTrue(connect.isFunction(t),"f must be a function"),this.subMap.subscribe(e,t)},f.prototype.getSubscriptions=function(e){return this.subMap.getSubscriptions(e)},f.prototype.trigger=function(t,n){connect.assertNotNull(t,"eventName");var r=this,i=this.subMap.getSubscriptions(e),o=this.subMap.getSubscriptions(t);this.logEvents&&t!==connect.EventType.LOG&&t!==connect.EventType.MASTER_RESPONSE&&t!==connect.EventType.API_METRIC&&t!==connect.EventType.SERVER_BOUND_INTERNAL_LOG&&connect.getLog().trace("Publishing event: %s",t).sendInternalLogToServer(),t.startsWith(connect.ContactEvents.ACCEPTED)&&n&&n.contactId&&!(n instanceof connect.Contact)&&(n=new connect.Contact(n.contactId)),i.concat(o).forEach((function(e){try{e.f(n||null,t,r)}catch(i){connect.getLog().error("'%s' event handler failed.",t).withException(i).sendInternalLogToServer()}}))},f.prototype.bridge=function(){var e=this;return function(t,n){e.trigger(n,t)}},f.prototype.unsubscribeAll=function(){this.subMap.getAllSubscriptions().forEach((function(e){e.unsubscribe()}))},connect.EventBus=f,connect.EventFactory=u,connect.EventType=t,connect.AgentEvents=r,connect.ConfigurationEvents=s,connect.ConnectionEvents=a,connect.ConnnectionEvents=a,connect.ContactEvents=o,connect.WebSocketEvents=i,connect.MasterTopics=n}(),function(){var e=this;connect=e.connect||{},e.connect=connect,e.lily=connect;var t=function(){};t.prototype.send=function(e){throw new connect.NotImplementedError},t.prototype.onMessage=function(e){throw new connect.NotImplementedError};var n=function(){t.call(this)};(n.prototype=Object.create(t.prototype)).constructor=n,n.prototype.onMessage=function(e){},n.prototype.send=function(e){};var r=function(e,n){t.call(this),this.window=e,this.domain=n||"*"};(r.prototype=Object.create(t.prototype)).constructor=r,r.prototype.send=function(e){this.window.postMessage(e,this.domain)},r.prototype.onMessage=function(e){this.window.addEventListener("message",e)};var i=function(e,n,r){t.call(this),this.input=e,this.output=n,this.domain=r||"*"};(i.prototype=Object.create(t.prototype)).constructor=i,i.prototype.send=function(e){this.output.postMessage(e,this.domain)},i.prototype.onMessage=function(e){this.input.addEventListener("message",e)};var o=function(e){t.call(this),this.port=e,this.id=connect.randomId()};(o.prototype=Object.create(t.prototype)).constructor=o,o.prototype.send=function(e){this.port.postMessage(e)},o.prototype.onMessage=function(e){this.port.addEventListener("message",e)},o.prototype.getId=function(){return this.id};var a=function(e){t.call(this),this.streamMap=e?connect.index(e,(function(e){return e.getId()})):{},this.messageListeners=[]};(a.prototype=Object.create(t.prototype)).constructor=a,a.prototype.send=function(e){this.getStreams().forEach((function(t){try{t.send(e)}catch(n){}}))},a.prototype.onMessage=function(e){this.messageListeners.push(e),this.getStreams().forEach((function(t){t.onMessage(e)}))},a.prototype.addStream=function(e){this.streamMap[e.getId()]=e,this.messageListeners.forEach((function(t){e.onMessage(t)}))},a.prototype.removeStream=function(e){delete this.streamMap[e.getId()]},a.prototype.getStreams=function(e){return connect.values(this.streamMap)},a.prototype.getStreamForPort=function(e){return connect.find(this.getStreams(),(function(t){return t.port===e}))};var s=function(e,t,r){this.name=e,this.upstream=t||new n,this.downstream=r||new n,this.downstreamBus=new connect.EventBus,this.upstreamBus=new connect.EventBus,this.upstream.onMessage(connect.hitch(this,this._dispatchEvent,this.upstreamBus)),this.downstream.onMessage(connect.hitch(this,this._dispatchEvent,this.downstreamBus))};s.prototype.onUpstream=function(e,t){return connect.assertNotNull(e,"eventName"),connect.assertNotNull(t,"f"),connect.assertTrue(connect.isFunction(t),"f must be a function"),this.upstreamBus.subscribe(e,t)},s.prototype.onAllUpstream=function(e){return connect.assertNotNull(e,"f"),connect.assertTrue(connect.isFunction(e),"f must be a function"),this.upstreamBus.subscribeAll(e)},s.prototype.onDownstream=function(e,t){return connect.assertNotNull(e,"eventName"),connect.assertNotNull(t,"f"),connect.assertTrue(connect.isFunction(t),"f must be a function"),this.downstreamBus.subscribe(e,t)},s.prototype.onAllDownstream=function(e){return connect.assertNotNull(e,"f"),connect.assertTrue(connect.isFunction(e),"f must be a function"),this.downstreamBus.subscribeAll(e)},s.prototype.sendUpstream=function(e,t){connect.assertNotNull(e,"eventName"),this.upstream.send({event:e,data:t})},s.prototype.sendDownstream=function(e,t){connect.assertNotNull(e,"eventName"),this.downstream.send({event:e,data:t})},s.prototype._dispatchEvent=function(e,t){var n=t.data;n.event&&e.trigger(n.event,n.data)},s.prototype.passUpstream=function(){var e=this;return function(t,n){e.upstream.send({event:n,data:t})}},s.prototype.passDownstream=function(){var e=this;return function(t,n){e.downstream.send({event:n,data:t})}},s.prototype.shutdown=function(){this.upstreamBus.unsubscribeAll(),this.downstreamBus.unsubscribeAll()};var u=function(e,t,n,r){s.call(this,e,new i(t,n.contentWindow,r||"*"),null)};(u.prototype=Object.create(s.prototype)).constructor=u,connect.Stream=t,connect.NullStream=n,connect.WindowStream=r,connect.WindowIOStream=i,connect.PortStream=o,connect.StreamMultiplexer=a,connect.Conduit=s,connect.IFrameConduit=u}(),function(){var e=this;connect=e.connect||{},e.connect=connect,e.lily=connect,connect.ClientMethods=connect.makeEnum(["getAgentSnapshot","putAgentState","getAgentStates","getDialableCountryCodes","getRoutingProfileQueues","getAgentPermissions","getAgentConfiguration","updateAgentConfiguration","acceptContact","createOutboundContact","createTaskContact","clearContact","completeContact","destroyContact","rejectContact","notifyContactIssue","updateContactAttributes","createAdditionalConnection","destroyConnection","holdConnection","resumeConnection","toggleActiveConnections","conferenceConnections","sendClientLogs","sendDigits","sendSoftphoneCallReport","sendSoftphoneCallMetrics","getEndpoints","getNewAuthToken","createTransport"]),connect.AgentAppClientMethods={GET_SPEAKER_ID:"AgentAppService.Lcms.getContact",ENROLL_SPEAKER_IN_VOICEID:"AgentAppService.VoiceId.enrollBySession",EVALUATE_SPEAKER_WITH_VOICEID:"AgentAppService.VoiceId.evaluateSession",GET_SPEAKER_STATUS:"AgentAppService.VoiceId.describeSpeaker",OPT_OUT_VOICEID_SPEAKER:"AgentAppService.VoiceId.optOutSpeaker",DESCRIBE_VOICEID_SESSION:"AgentAppService.VoiceId.describeSession",UPDATE_VOICEID_SESSION:"AgentAppService.VoiceId.updateSession",START_VOICEID_SESSION:"AgentAppService.Nasa.startVoiceIdSession"},connect.MasterMethods=connect.makeEnum(["becomeMaster","checkMaster"]);var t=function(){};t.EMPTY_CALLBACKS={success:function(){},failure:function(){}},t.prototype.call=function(e,n,r){connect.assertNotNull(e,"method");var i=n||{},o=r||t.EMPTY_CALLBACKS;this._callImpl(e,i,o)},t.prototype._callImpl=function(e,t,n){throw new connect.NotImplementedError};var n=function(){t.call(this)};(n.prototype=Object.create(t.prototype)).constructor=n,n.prototype._callImpl=function(e,t,n){if(n&&n.failure){var r=connect.sprintf("No such method exists on NULL client: %s",e);n.failure(new connect.ValueError(r),{message:r})}};var r=function(e,n,r){t.call(this),this.conduit=e,this.requestEvent=n,this.responseEvent=r,this._requestIdCallbacksMap={},this.conduit.onUpstream(r,connect.hitch(this,this._handleResponse))};(r.prototype=Object.create(t.prototype)).constructor=r,r.prototype._callImpl=function(e,t,n){var r=connect.EventFactory.createRequest(this.requestEvent,e,t);this._requestIdCallbacksMap[r.requestId]=n,this.conduit.sendUpstream(r.event,r)},r.prototype._getCallbacksForRequest=function(e){var t=this._requestIdCallbacksMap[e]||null;return null!=t&&delete this._requestIdCallbacksMap[e],t},r.prototype._handleResponse=function(e){var t=this._getCallbacksForRequest(e.requestId);null!=t&&(e.err&&t.failure?t.failure(e.err,e.data):t.success&&t.success(e.data))};var i=function(e){r.call(this,e,connect.EventType.API_REQUEST,connect.EventType.API_RESPONSE)};(i.prototype=Object.create(r.prototype)).constructor=i;var o=function(e){r.call(this,e,connect.EventType.MASTER_REQUEST,connect.EventType.MASTER_RESPONSE)};(o.prototype=Object.create(r.prototype)).constructor=o;var a=function(e,n,r){connect.assertNotNull(e,"authCookieName"),connect.assertNotNull(n,"authToken"),connect.assertNotNull(r,"endpoint"),t.call(this),this.endpointUrl=connect.getUrlWithProtocol(r),this.authToken=n,this.authCookieName=e};(a.prototype=Object.create(t.prototype)).constructor=a,a.prototype._callImpl=function(e,t,n){var r=this,i={};i[r.authCookieName]=r.authToken;var o={method:"post",body:JSON.stringify(t||{}),headers:{Accept:"application/json","Content-Type":"application/json","X-Amz-target":e,"X-Amz-Bearer":JSON.stringify(i)}};connect.fetch(r.endpointUrl,o).then((function(e){n.success(e)})).catch((function(e){n.failure(e)}))};var s=function(e,n,r){connect.assertNotNull(e,"authToken"),connect.assertNotNull(n,"region"),t.call(this),AWS.config.credentials=new AWS.Credentials({}),AWS.config.region=n,this.authToken=e;var i=connect.getBaseUrl(),o=r||(i.includes(".awsapps.com")?i+"/connect/api":i+"/api"),a=new AWS.Endpoint(o);this.client=new AWS.Connect({endpoint:a})};(s.prototype=Object.create(t.prototype)).constructor=s,s.prototype._callImpl=function(e,t,n){var r=this,i=connect.getLog();if(connect.contains(this.client,e))t=this._translateParams(e,t),i.trace("AWSClient: --\x3e Calling operation '%s'",e).sendInternalLogToServer(),this.client[e](t).on("build",(function(e){e.httpRequest.headers["X-Amz-Bearer"]=r.authToken})).send((function(t,r){try{if(t){if(t.code===connect.CTIExceptions.UNAUTHORIZED_EXCEPTION)n.authFailure();else if(!n.accessDenied||t.code!==connect.CTIExceptions.ACCESS_DENIED_EXCEPTION&&403!==t.statusCode){var o={};o.type=t.code,o.message=t.message,o.stack=t.stack?t.stack.split("\n"):[],n.failure(o,r)}else n.accessDenied();i.trace("AWSClient: <-- Operation '%s' failed: %s",e,JSON.stringify(t)).sendInternalLogToServer()}else i.trace("AWSClient: <-- Operation '%s' succeeded.",e).withObject(r).sendInternalLogToServer(),n.success(r)}catch(a){connect.getLog().error("Failed to handle AWS API request for method %s",e).withException(a).sendInternalLogToServer()}}));else{var o=connect.sprintf("No such method exists on AWS client: %s",e);n.failure(new connect.ValueError(o),{message:o})}},s.prototype._requiresAuthenticationParam=function(e){return e!==connect.ClientMethods.COMPLETE_CONTACT&&e!==connect.ClientMethods.CLEAR_CONTACT&&e!==connect.ClientMethods.REJECT_CONTACT&&e!==connect.ClientMethods.CREATE_TASK_CONTACT},s.prototype._translateParams=function(e,t){switch(e){case connect.ClientMethods.UPDATE_AGENT_CONFIGURATION:t.configuration=this._translateAgentConfiguration(t.configuration);break;case connect.ClientMethods.SEND_SOFTPHONE_CALL_METRICS:t.softphoneStreamStatistics=this._translateSoftphoneStreamStatistics(t.softphoneStreamStatistics);break;case connect.ClientMethods.SEND_SOFTPHONE_CALL_REPORT:t.report=this._translateSoftphoneCallReport(t.report)}return this._requiresAuthenticationParam(e)&&(t.authentication={authToken:this.authToken}),t},s.prototype._translateAgentConfiguration=function(e){return{name:e.name,softphoneEnabled:e.softphoneEnabled,softphoneAutoAccept:e.softphoneAutoAccept,extension:e.extension,routingProfile:this._translateRoutingProfile(e.routingProfile),agentPreferences:e.agentPreferences}},s.prototype._translateRoutingProfile=function(e){return{name:e.name,routingProfileARN:e.routingProfileARN,defaultOutboundQueue:this._translateQueue(e.defaultOutboundQueue)}},s.prototype._translateQueue=function(e){return{queueARN:e.queueARN,name:e.name}},s.prototype._translateSoftphoneStreamStatistics=function(e){return e.forEach((function(e){"packetsCount"in e&&(e.packetCount=e.packetsCount,delete e.packetsCount)})),e},s.prototype._translateSoftphoneCallReport=function(e){return"handshakingTimeMillis"in e&&(e.handshakeTimeMillis=e.handshakingTimeMillis,delete e.handshakingTimeMillis),"preTalkingTimeMillis"in e&&(e.preTalkTimeMillis=e.preTalkingTimeMillis,delete e.preTalkingTimeMillis),"handshakingFailure"in e&&(e.handshakeFailure=e.handshakingFailure,delete e.handshakingFailure),"talkingTimeMillis"in e&&(e.talkTimeMillis=e.talkingTimeMillis,delete e.talkingTimeMillis),e.softphoneStreamStatistics=this._translateSoftphoneStreamStatistics(e.softphoneStreamStatistics),e},connect.ClientBase=t,connect.NullClient=n,connect.UpstreamConduitClient=i,connect.UpstreamConduitMasterClient=o,connect.AWSClient=s,connect.AgentAppClient=a}(),function(){var e=this;connect=e.connect||{},e.connect=connect,e.lily=connect;var t=function(e,t){connect.assertNotNull(e,"fromState"),connect.assertNotNull(t,"toState"),this.fromState=e,this.toState=t};t.prototype.getAssociations=function(e){throw connect.NotImplementedError()},t.prototype.getFromState=function(){return this.fromState},t.prototype.getToState=function(){return this.toState};var n=function(e,n,r){connect.assertNotNull(e,"fromState"),connect.assertNotNull(n,"toState"),connect.assertNotNull(r,"associations"),t.call(this,e,n),this.associations=r};(n.prototype=Object.create(t.prototype)).constructor=n,n.prototype.getAssociations=function(e){return this.associations};var r=function(e,n,r){connect.assertNotNull(e,"fromState"),connect.assertNotNull(n,"toState"),connect.assertNotNull(r,"closure"),connect.assertTrue(connect.isFunction(r),"closure must be a function"),t.call(this,e,n),this.closure=r};(r.prototype=Object.create(t.prototype)).constructor=r,r.prototype.getAssociations=function(e){return this.closure(e,this.getFromState(),this.getToState())};var i=function(){this.fromMap={}};i.ANY="<>",i.prototype.assoc=function(e,t,i){var o=this;if(!e)throw new Error("fromStateObj is not defined.");if(!t)throw new Error("toStateObj is not defined.");if(!i)throw new Error("assocObj is not defined.");return e instanceof Array?e.forEach((function(e){o.assoc(e,t,i)})):t instanceof Array?t.forEach((function(t){o.assoc(e,t,i)})):"function"===typeof i?this._addAssociation(new r(e,t,i)):i instanceof Array?this._addAssociation(new n(e,t,i)):this._addAssociation(new n(e,t,[i])),this},i.prototype.getAssociations=function(e,t,n){connect.assertNotNull(t,"fromState"),connect.assertNotNull(n,"toState");var r=[],o=this.fromMap[i.ANY]||{},a=this.fromMap[t]||{};return r=(r=r.concat(this._getAssociationsFromMap(o,e,t,n))).concat(this._getAssociationsFromMap(a,e,t,n))},i.prototype._addAssociation=function(e){var t=this.fromMap[e.getFromState()];t||(t=this.fromMap[e.getFromState()]={});var n=t[e.getToState()];n||(n=t[e.getToState()]=[]),n.push(e)},i.prototype._getAssociationsFromMap=function(e,t,n,r){return(e[i.ANY]||[]).concat(e[r]||[]).reduce((function(e,n){return e.concat(n.getAssociations(t))}),[])},connect.EventGraph=i}(),function(){var e=this;connect=e.connect||{},e.connect=connect,e.lily=connect,connect.AgentStateType=connect.makeEnum(["init","routable","not_routable","offline"]),connect.AgentStatusType=connect.AgentStateType,connect.AgentAvailStates=connect.makeEnum(["Init","Busy","AfterCallWork","CallingCustomer","Dialing","Joining","PendingAvailable","PendingBusy"]),connect.AgentErrorStates=connect.makeEnum(["Error","AgentHungUp","BadAddressAgent","BadAddressCustomer","Default","FailedConnectAgent","FailedConnectCustomer","InvalidLocale","LineEngagedAgent","LineEngagedCustomer","MissedCallAgent","MissedCallCustomer","MultipleCcpWindows","RealtimeCommunicationError"]),connect.EndpointType=connect.makeEnum(["phone_number","agent","queue"]),connect.AddressType=connect.EndpointType,connect.ConnectionType=connect.makeEnum(["agent","inbound","outbound","monitoring"]),connect.ConnectionStateType=connect.makeEnum(["init","connecting","connected","hold","disconnected"]),connect.ConnectionStatusType=connect.ConnectionStateType,connect.CONNECTION_ACTIVE_STATES=connect.set([connect.ConnectionStateType.CONNECTING,connect.ConnectionStateType.CONNECTED,connect.ConnectionStateType.HOLD]),connect.ContactStateType=connect.makeEnum(["init","incoming","pending","connecting","connected","missed","error","ended"]),connect.ContactStatusType=connect.ContactStateType,connect.CONTACT_ACTIVE_STATES=connect.makeEnum(["incoming","pending","connecting","connected"]),connect.ContactType=connect.makeEnum(["voice","queue_callback","chat","task"]),connect.ContactInitiationMethod=connect.makeEnum(["inbound","outbound","transfer","queue_transfer","callback","api","disconnect"]),connect.ChannelType=connect.makeEnum(["VOICE","CHAT","TASK"]),connect.MediaType=connect.makeEnum(["softphone","chat","task"]),connect.SoftphoneCallType=connect.makeEnum(["audio_video","video_only","audio_only","none"]),connect.SoftphoneErrorTypes=connect.makeEnum(["unsupported_browser","microphone_not_shared","signalling_handshake_failure","signalling_connection_failure","ice_collection_timeout","user_busy_error","webrtc_error","realtime_communication_error","other"]),connect.VoiceIdErrorTypes=connect.makeEnum(["no_speaker_id_found","get_speaker_id_failed","get_speaker_status_failed","opt_out_speaker_failed","start_session_failed","evaluate_speaker_failed","describe_session_failed","enroll_speaker_failed","update_speaker_id_failed","not_supported_on_conference_calls","timeout"]),connect.CTIExceptions=connect.makeEnum(["AccessDeniedException","InvalidStateException","BadEndpointException","InvalidAgentARNException","InvalidConfigurationException","InvalidContactTypeException","PaginationException","RefreshTokenExpiredException","SendDataFailedException","UnauthorizedException","QuotaExceededException"]),connect.VoiceIdStreamingStatus=connect.makeEnum(["ONGOING","ENDED"]),connect.VoiceIdAuthenticationDecision=connect.makeEnum(["ACCEPT","REJECT","NOT_ENOUGH_SPEECH","SPEAKER_NOT_ENROLLED","SPEAKER_OPTED_OUT","SPEAKER_ID_NOT_PROVIDED"]),connect.ContactFlowAuthenticationDecision=connect.makeEnum(["Authenticated","NotAuthenticated","Inconclusive","NotEnrolled","OptedOut","Error"]),connect.VoiceIdEnrollmentRequestStatus=connect.makeEnum(["NOT_ENOUGH_SPEECH","IN_PROGRESS","COMPLETED","FAILED"]);var t=function(){if(!connect.agent.initialized)throw new connect.StateError("The agent is not yet initialized!")};t.prototype._getData=function(){return connect.core.getAgentDataProvider().getAgentData()},t.prototype._createContactAPI=function(e){return new connect.Contact(e.contactId)},t.prototype.onContactPending=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.CONTACT_PENDING,e)},t.prototype.onRefresh=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.REFRESH,e)},t.prototype.onRoutable=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.ROUTABLE,e)},t.prototype.onNotRoutable=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.NOT_ROUTABLE,e)},t.prototype.onOffline=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.OFFLINE,e)},t.prototype.onError=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.ERROR,e)},t.prototype.onSoftphoneError=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.SOFTPHONE_ERROR,e)},t.prototype.onWebSocketConnectionLost=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.WEBSOCKET_CONNECTION_LOST,e)},t.prototype.onWebSocketConnectionGained=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.WEBSOCKET_CONNECTION_GAINED,e)},t.prototype.onAfterCallWork=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.ACW,e)},t.prototype.onStateChange=function(e){connect.core.getEventBus().subscribe(connect.AgentEvents.STATE_CHANGE,e)},t.prototype.onMuteToggle=function(e){connect.core.getUpstream().onUpstream(connect.AgentEvents.MUTE_TOGGLE,e)},t.prototype.onLocalMediaStreamCreated=function(e){connect.core.getUpstream().onUpstream(connect.AgentEvents.LOCAL_MEDIA_STREAM_CREATED,e)},t.prototype.onSpeakerDeviceChanged=function(e){connect.core.getUpstream().onUpstream(connect.ConfigurationEvents.SPEAKER_DEVICE_CHANGED,e)},t.prototype.onMicrophoneDeviceChanged=function(e){connect.core.getUpstream().onUpstream(connect.ConfigurationEvents.MICROPHONE_DEVICE_CHANGED,e)},t.prototype.onRingerDeviceChanged=function(e){connect.core.getUpstream().onUpstream(connect.ConfigurationEvents.RINGER_DEVICE_CHANGED,e)},t.prototype.mute=function(){connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.EventType.MUTE,data:{mute:!0}})},t.prototype.unmute=function(){connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.EventType.MUTE,data:{mute:!1}})},t.prototype.setSpeakerDevice=function(e){connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.ConfigurationEvents.SET_SPEAKER_DEVICE,data:{deviceId:e}})},t.prototype.setMicrophoneDevice=function(e){connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.ConfigurationEvents.SET_MICROPHONE_DEVICE,data:{deviceId:e}})},t.prototype.setRingerDevice=function(e){connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.ConfigurationEvents.SET_RINGER_DEVICE,data:{deviceId:e}})},t.prototype.getState=function(){return this._getData().snapshot.state},t.prototype.getAvailabilityState=function(){return this._getData().snapshot.agentAvailabilityState},t.prototype.getStatus=t.prototype.getState,t.prototype.getStateDuration=function(){return connect.now()-this._getData().snapshot.state.startTimestamp.getTime()+connect.core.getSkew()},t.prototype.getStatusDuration=t.prototype.getStateDuration,t.prototype.getPermissions=function(){return this.getConfiguration().permissions},t.prototype.getContacts=function(e){var t=this;return this._getData().snapshot.contacts.map((function(e){return t._createContactAPI(e)})).filter((function(t){return!e||t.getType()===e}))},t.prototype.getConfiguration=function(){return this._getData().configuration},t.prototype.getAgentStates=function(){return this.getConfiguration().agentStates},t.prototype.getRoutingProfile=function(){return this.getConfiguration().routingProfile},t.prototype.getChannelConcurrency=function(e){var t=this.getRoutingProfile().channelConcurrencyMap;return t||(t=Object.keys(connect.ChannelType).reduce((function(e,t){return"TASK"!==t&&(e[connect.ChannelType[t]]=1),e}),{})),e?t[e]||0:t},t.prototype.getName=function(){return this.getConfiguration().name},t.prototype.getExtension=function(){return this.getConfiguration().extension},t.prototype.getDialableCountries=function(){return this.getConfiguration().dialableCountries},t.prototype.isSoftphoneEnabled=function(){return this.getConfiguration().softphoneEnabled},t.prototype.setConfiguration=function(e,t){var n=connect.core.getClient();e&&e.agentPreferences&&!connect.isValidLocale(e.agentPreferences.locale)?t&&t.failure&&t.failure(AgentErrorStates.INVALID_LOCALE):n.call(connect.ClientMethods.UPDATE_AGENT_CONFIGURATION,{configuration:connect.assertNotNull(e,"configuration")},{success:function(e){connect.core.getUpstream().sendUpstream(connect.EventType.RELOAD_AGENT_CONFIGURATION),t.success&&t.success(e)},failure:t&&t.failure})},t.prototype.setState=function(e,t){connect.core.getClient().call(connect.ClientMethods.PUT_AGENT_STATE,{state:connect.assertNotNull(e,"state")},t)},t.prototype.setStatus=t.prototype.setState,t.prototype.connect=function(e,t){var n=connect.core.getClient(),r=new connect.Endpoint(e);delete r.endpointId,n.call(connect.ClientMethods.CREATE_OUTBOUND_CONTACT,{endpoint:connect.assertNotNull(r,"endpoint"),queueARN:t&&(t.queueARN||t.queueId)||this.getRoutingProfile().defaultOutboundQueue.queueARN},t&&{success:t.success,failure:t.failure})},t.prototype.getAllQueueARNs=function(){return this.getConfiguration().routingProfile.queues.map((function(e){return e.queueARN}))},t.prototype.getEndpoints=function(e,t,n){var r=this,i=connect.core.getClient();connect.assertNotNull(t,"callbacks"),connect.assertNotNull(t.success,"callbacks.success");var o=n||{};o.endpoints=o.endpoints||[],o.maxResults=o.maxResults||connect.DEFAULT_BATCH_SIZE,connect.isArray(e)||(e=[e]),i.call(connect.ClientMethods.GET_ENDPOINTS,{queueARNs:e,nextToken:o.nextToken||null,maxResults:o.maxResults},{success:function(n){if(n.nextToken)r.getEndpoints(e,t,{nextToken:n.nextToken,maxResults:o.maxResults,endpoints:o.endpoints.concat(n.endpoints)});else{o.endpoints=o.endpoints.concat(n.endpoints);var i=o.endpoints.map((function(e){return new connect.Endpoint(e)}));t.success({endpoints:i,addresses:i})}},failure:t.failure})},t.prototype.getAddresses=t.prototype.getEndpoints,t.prototype.toSnapshot=function(){return new connect.AgentSnapshot(this._getData())};var n=function(e){connect.Agent.call(this),this.agentData=e};(n.prototype=Object.create(t.prototype)).constructor=n,n.prototype._getData=function(){return this.agentData},n.prototype._createContactAPI=function(e){return new connect.ContactSnapshot(e)};var r=function(e){this.contactId=e};r.prototype._getData=function(){return connect.core.getAgentDataProvider().getContactData(this.getContactId())},r.prototype._createConnectionAPI=function(e){return this.getType()===connect.ContactType.CHAT?new connect.ChatConnection(this.contactId,e.connectionId):this.getType()===connect.ContactType.TASK?new connect.TaskConnection(this.contactId,e.connectionId):new connect.VoiceConnection(this.contactId,e.connectionId)},r.prototype.getEventName=function(e){return connect.core.getContactEventName(e,this.getContactId())},r.prototype.onRefresh=function(e){connect.core.getEventBus().subscribe(this.getEventName(connect.ContactEvents.REFRESH),e)},r.prototype.onIncoming=function(e){connect.core.getEventBus().subscribe(this.getEventName(connect.ContactEvents.INCOMING),e)},r.prototype.onConnecting=function(e){connect.core.getEventBus().subscribe(this.getEventName(connect.ContactEvents.CONNECTING),e)},r.prototype.onPending=function(e){connect.core.getEventBus().subscribe(this.getEventName(connect.ContactEvents.PENDING),e)},r.prototype.onAccepted=function(e){connect.core.getEventBus().subscribe(this.getEventName(connect.ContactEvents.ACCEPTED),e)},r.prototype.onMissed=function(e){connect.core.getEventBus().subscribe(this.getEventName(connect.ContactEvents.MISSED),e)},r.prototype.onEnded=function(e){var t=connect.core.getEventBus();t.subscribe(this.getEventName(connect.ContactEvents.ENDED),e),t.subscribe(this.getEventName(connect.ContactEvents.DESTROYED),e)},r.prototype.onDestroy=function(e){connect.core.getEventBus().subscribe(this.getEventName(connect.ContactEvents.DESTROYED),e)},r.prototype.onACW=function(e){connect.core.getEventBus().subscribe(this.getEventName(connect.ContactEvents.ACW),e)},r.prototype.onConnected=function(e){connect.core.getEventBus().subscribe(this.getEventName(connect.ContactEvents.CONNECTED),e)},r.prototype.onError=function(e){connect.core.getEventBus().subscribe(this.getEventName(connect.ContactEvents.ERROR),e)},r.prototype.getContactId=function(){return this.contactId},r.prototype.getOriginalContactId=function(){return this._getData().initialContactId},r.prototype.getInitialContactId=r.prototype.getOriginalContactId,r.prototype.getType=function(){return this._getData().type},r.prototype.getContactDuration=function(){return this._getData().contactDuration},r.prototype.getState=function(){return this._getData().state},r.prototype.getStatus=r.prototype.getState,r.prototype.getStateDuration=function(){return connect.now()-this._getData().state.timestamp.getTime()+connect.core.getSkew()},r.prototype.getStatusDuration=r.prototype.getStateDuration,r.prototype.getQueue=function(){return this._getData().queue},r.prototype.getQueueTimestamp=function(){return this._getData().queueTimestamp},r.prototype.getConnections=function(){var e=this;return this._getData().connections.map((function(t){return e.getType()===connect.ContactType.CHAT?new connect.ChatConnection(e.contactId,t.connectionId):e.getType()===connect.ContactType.TASK?new connect.TaskConnection(e.contactId,t.connectionId):new connect.VoiceConnection(e.contactId,t.connectionId)}))},r.prototype.getInitialConnection=function(){return connect.find(this.getConnections(),(function(e){return e.isInitialConnection()}))||null},r.prototype.getActiveInitialConnection=function(){var e=this.getInitialConnection();return null!=e&&e.isActive()?e:null},r.prototype.getThirdPartyConnections=function(){return this.getConnections().filter((function(e){return!e.isInitialConnection()&&e.getType()!==connect.ConnectionType.AGENT}))},r.prototype.getSingleActiveThirdPartyConnection=function(){return this.getThirdPartyConnections().filter((function(e){return e.isActive()}))[0]||null},r.prototype.getAgentConnection=function(){return connect.find(this.getConnections(),(function(e){var t=e.getType();return t===connect.ConnectionType.AGENT||t===connect.ConnectionType.MONITORING}))},r.prototype.getName=function(){return this._getData().name},r.prototype.getContactMetadata=function(){return this._getData().contactMetadata},r.prototype.getDescription=function(){return this._getData().description},r.prototype.getReferences=function(){return this._getData().references},r.prototype.getAttributes=function(){return this._getData().attributes},r.prototype.getContactFeatures=function(){return this._getData().contactFeatures},r.prototype.isSoftphoneCall=function(){return null!=connect.find(this.getConnections(),(function(e){return null!=e.getSoftphoneMediaInfo()}))},r.prototype._isInbound=function(){return this._getData().initiationMethod!==connect.ContactInitiationMethod.OUTBOUND},r.prototype.isInbound=function(){var e=this.getInitialConnection();return e.getMediaType()===connect.MediaType.TASK?this._isInbound():!!e&&e.getType()===connect.ConnectionType.INBOUND},r.prototype.isConnected=function(){return this.getStatus().type===connect.ContactStateType.CONNECTED},r.prototype.accept=function(e){var t=connect.core.getClient(),n=this,r=this.getContactId();t.call(connect.ClientMethods.ACCEPT_CONTACT,{contactId:r},{success:function(t){var i=connect.core.getUpstream();i.sendUpstream(connect.EventType.BROADCAST,{event:connect.ContactEvents.ACCEPTED,data:new connect.Contact(r)}),i.sendUpstream(connect.EventType.BROADCAST,{event:connect.core.getContactEventName(connect.ContactEvents.ACCEPTED,n.getContactId()),data:new connect.Contact(r)});var o=new connect.Contact(r);connect.isFirefoxBrowser()&&o.isSoftphoneCall()&&connect.core.triggerReadyToStartSessionEvent(),e&&e.success&&e.success(t)},failure:e?e.failure:null})},r.prototype.destroy=function(){connect.getLog().warn("contact.destroy() has been deprecated.")},r.prototype.reject=function(e){connect.core.getClient().call(connect.ClientMethods.REJECT_CONTACT,{contactId:this.getContactId()},e)},r.prototype.complete=function(e){connect.core.getClient().call(connect.ClientMethods.COMPLETE_CONTACT,{contactId:this.getContactId()},e)},r.prototype.clear=function(e){connect.core.getClient().call(connect.ClientMethods.CLEAR_CONTACT,{contactId:this.getContactId()},e)},r.prototype.notifyIssue=function(e,t,n){connect.core.getClient().call(connect.ClientMethods.NOTIFY_CONTACT_ISSUE,{contactId:this.getContactId(),issueCode:e,description:t},n)},r.prototype.addConnection=function(e,t){var n=connect.core.getClient(),r=new connect.Endpoint(e);delete r.endpointId,n.call(connect.ClientMethods.CREATE_ADDITIONAL_CONNECTION,{contactId:this.getContactId(),endpoint:r},t)},r.prototype.toggleActiveConnections=function(e){var t=connect.core.getClient(),n=null,r=connect.find(this.getConnections(),(function(e){return e.getStatus().type===connect.ConnectionStateType.HOLD}));if(null!=r)n=r.getConnectionId();else{var i=this.getConnections().filter((function(e){return e.isActive()}));i.length>0&&(n=i[0].getConnectionId())}t.call(connect.ClientMethods.TOGGLE_ACTIVE_CONNECTIONS,{contactId:this.getContactId(),connectionId:n},e)},r.prototype.sendSoftphoneMetrics=function(t,n){connect.core.getClient().call(connect.ClientMethods.SEND_SOFTPHONE_CALL_METRICS,{contactId:this.getContactId(),ccpVersion:e.ccpVersion,softphoneStreamStatistics:t},n),connect.publishSoftphoneStats({contactId:this.getContactId(),ccpVersion:e.ccpVersion,stats:t})},r.prototype.sendSoftphoneReport=function(t,n){connect.core.getClient().call(connect.ClientMethods.SEND_SOFTPHONE_CALL_REPORT,{contactId:this.getContactId(),ccpVersion:e.ccpVersion,report:t},n),connect.publishSoftphoneReport({contactId:this.getContactId(),ccpVersion:e.ccpVersion,report:t})},r.prototype.conferenceConnections=function(e){connect.core.getClient().call(connect.ClientMethods.CONFERENCE_CONNECTIONS,{contactId:this.getContactId()},e)},r.prototype.toSnapshot=function(){return new connect.ContactSnapshot(this._getData())};var i=function(e){connect.Contact.call(this,e.contactId),this.contactData=e};(i.prototype=Object.create(r.prototype)).constructor=i,i.prototype._getData=function(){return this.contactData},i.prototype._createConnectionAPI=function(e){return new connect.ConnectionSnapshot(e)};var o=function(e,t){this.contactId=e,this.connectionId=t,this._initMediaController()};o.prototype._getData=function(){return connect.core.getAgentDataProvider().getConnectionData(this.getContactId(),this.getConnectionId())},o.prototype.getContactId=function(){return this.contactId},o.prototype.getConnectionId=function(){return this.connectionId},o.prototype.getEndpoint=function(){return new connect.Endpoint(this._getData().endpoint)},o.prototype.getAddress=o.prototype.getEndpoint,o.prototype.getState=function(){return this._getData().state},o.prototype.getStatus=o.prototype.getState,o.prototype.getStateDuration=function(){return connect.now()-this._getData().state.timestamp.getTime()+connect.core.getSkew()},o.prototype.getStatusDuration=o.prototype.getStateDuration,o.prototype.getType=function(){return this._getData().type},o.prototype.isInitialConnection=function(){return this._getData().initial},o.prototype.isActive=function(){return connect.contains(connect.CONNECTION_ACTIVE_STATES,this.getStatus().type)},o.prototype.isConnected=function(){return this.getStatus().type===connect.ConnectionStateType.CONNECTED},o.prototype.isConnecting=function(){return this.getStatus().type===connect.ConnectionStateType.CONNECTING},o.prototype.isOnHold=function(){return this.getStatus().type===connect.ConnectionStateType.HOLD},o.prototype.getSoftphoneMediaInfo=function(){return this._getData().softphoneMediaInfo},o.prototype.getMonitorInfo=function(){return this._getData().monitoringInfo},o.prototype.destroy=function(e){connect.core.getClient().call(connect.ClientMethods.DESTROY_CONNECTION,{contactId:this.getContactId(),connectionId:this.getConnectionId()},e)},o.prototype.sendDigits=function(e,t){connect.core.getClient().call(connect.ClientMethods.SEND_DIGITS,{contactId:this.getContactId(),connectionId:this.getConnectionId(),digits:e},t)},o.prototype.hold=function(e){connect.core.getClient().call(connect.ClientMethods.HOLD_CONNECTION,{contactId:this.getContactId(),connectionId:this.getConnectionId()},e)},o.prototype.resume=function(e){connect.core.getClient().call(connect.ClientMethods.RESUME_CONNECTION,{contactId:this.getContactId(),connectionId:this.getConnectionId()},e)},o.prototype.toSnapshot=function(){return new connect.ConnectionSnapshot(this._getData())},o.prototype._initMediaController=function(){this.getMediaInfo()&&connect.core.mediaFactory.get(this).catch((function(){}))},o.prototype._isAgentConnectionType=function(){var e=this.getType();return e===connect.ConnectionType.AGENT||e===connect.ConnectionType.MONITORING},o.prototype._isAgentConnectionType=function(){var e=this.getType();return e===connect.ConnectionType.AGENT||e===connect.ConnectionType.MONITORING};var a=function(e){this.contactId=e};a.prototype.getSpeakerId=function(){var e=this;e.checkConferenceCall();var t=connect.core.getClient();return new Promise((function(n,r){t.call(connect.AgentAppClientMethods.GET_SPEAKER_ID,{contactId:e.contactId,instanceId:connect.core.getAgentDataProvider().getInstanceId(),awsAccountId:connect.core.getAgentDataProvider().getAWSAccountId()},{success:function(e){if(e.contactData.customerId){var t={speakerId:e.contactData.customerId};n(t)}else{var i=connect.VoiceIdError(connect.VoiceIdErrorTypes.NO_SPEAKER_ID_FOUND,"No speakerId assotiated with this call",err);r(i)}},failure:function(e){connect.getLog().error("Get SpeakerId failed").withObject({err:e});var t=connect.VoiceIdError(connect.VoiceIdErrorTypes.GET_SPEAKER_ID_FAILED,"Get SpeakerId failed",e);r(t)}})}))},a.prototype.getSpeakerStatus=function(){var e=this;e.checkConferenceCall();var t=connect.core.getClient();return new Promise((function(n,r){e.getSpeakerId().then((function(e){t.call(connect.AgentAppClientMethods.GET_SPEAKER_STATUS,{SpeakerId:connect.assertNotNull(e.speakerId,"speakerId"),DomainId:"ConnectDefaultDomainId"},{success:function(e){n(e)},failure:function(e){connect.getLog().error("getSpeakerStatus failed").withObject({err:e});var t=connect.VoiceIdError(connect.VoiceIdErrorTypes.GET_SPEAKER_STATUS_FAILED,"Get SpeakerStatus failed",e);r(t)}})})).catch((function(e){r(e)}))}))},a.prototype.optOutSpeaker=function(){var e=this;e.checkConferenceCall();var t=connect.core.getClient();return new Promise((function(n,r){e.getSpeakerId().then((function(e){t.call(connect.AgentAppClientMethods.OPT_OUT_VOICEID_SPEAKER,{SpeakerId:connect.assertNotNull(e.speakerId,"speakerId"),DomainId:"ConnectDefaultDomainId"},{success:function(e){connect.getLog().info("optOutSpeaker succeeded"),n(e)},failure:function(e){connect.getLog().error("optOutSpeaker failed").withObject({err:e});var t=connect.VoiceIdError(connect.VoiceIdErrorTypes.OPT_OUT_SPEAKER_FAILED,"optOutSpeaker failed.",e);r(t)}})})).catch((function(e){r(e)}))}))},a.prototype.startSession=function(){var e=this;e.checkConferenceCall();var t=connect.core.getClient();return new Promise((function(n,r){t.call(connect.AgentAppClientMethods.START_VOICEID_SESSION,{contactId:e.contactId,instanceId:connect.core.getAgentDataProvider().getInstanceId(),customerAccountId:connect.core.getAgentDataProvider().getAWSAccountId(),clientToken:AWS.util.uuid.v4()},{success:function(e){e.sessionId?n(e):r(Error("No contact id is returned from start session api."))},failure:function(e){connect.getLog().error("startVoiceIdSession failed").withObject({err:e});var t=connect.VoiceIdError(connect.VoiceIdErrorTypes.START_SESSION_FAILED,"startVoiceIdSession failed",e);r(t)}})}))},a.prototype.evaluateSpeaker=function(e){var t=this;t.checkConferenceCall();var n=connect.core.getClient(),r=connect.core.getAgentDataProvider().getContactData(this.contactId),i=120;return new Promise((function(o,a){function s(){n.call(connect.AgentAppClientMethods.EVALUATE_SPEAKER_WITH_VOICEID,{SessionNameOrId:r.initialContactId||this.contactId},{success:function(e){if(1!==i--)if(e.StreamingStatus===connect.VoiceIdStreamingStatus.ENDED&&e.AuthenticationResult.Decision===connect.VoiceIdAuthenticationDecision.NOT_ENOUGH_SPEECH)e.AuthenticationResult.Decision=connect.ContactFlowAuthenticationDecision.INCONCLUSIVE,o(e);else if(e.AuthenticationResult.Decision!==connect.VoiceIdAuthenticationDecision.NOT_ENOUGH_SPEECH){switch(e.AuthenticationResult.Decision){case connect.VoiceIdAuthenticationDecision.ACCEPT:e.AuthenticationResult.Decision=connect.ContactFlowAuthenticationDecision.AUTHENTICATED;break;case connect.VoiceIdAuthenticationDecision.REJECT:e.AuthenticationResult.Decision=connect.ContactFlowAuthenticationDecision.NOT_AUTHENTICATED;break;case connect.VoiceIdAuthenticationDecision.SPEAKER_OPTED_OUT:e.AuthenticationResult.Decision=connect.ContactFlowAuthenticationDecision.OPTED_OUT;break;case connect.VoiceIdAuthenticationDecision.SPEAKER_NOT_ENROLLED:e.AuthenticationResult.Decision=connect.ContactFlowAuthenticationDecision.NOT_ENROLLED;break;default:e.AuthenticationResult.Decision=connect.ContactFlowAuthenticationDecision.ERROR}o(e)}else setTimeout(s,1e3);else{connect.getLog().error("evaluateSpeaker timeout");var t=connect.VoiceIdError(connect.VoiceIdErrorTypes.TIMEOUT,"evaluateSpeaker timeout");a(t)}},failure:function(e){connect.getLog().error("evaluateSpeaker failed").withObject({err:e});var t=connect.VoiceIdError(connect.VoiceIdErrorTypes.EVALUATE_SPEAKER_FAILED,"evaluateSpeaker failed",e);a(t)}})}e?t.startSession().then((function(e){s()})).catch((function(e){a(e)})):s()}))},a.prototype.describeSession=function(){var e=connect.core.getClient(),t=connect.core.getAgentDataProvider().getContactData(this.contactId);return new Promise((function(n,r){e.call(connect.AgentAppClientMethods.DESCRIBE_VOICEID_SESSION,{SessionNameOrId:t.initialContactId||this.contactId},{success:function(e){n(e)},failure:function(e){connect.getLog().error("describeSession failed").withObject({err:e});var t=connect.VoiceIdError(connect.VoiceIdErrorTypes.DESCRIBE_SESSION_FAILED,"describeSession failed",e);r(t)}})}))},a.prototype.checkEnrollmentStatus=function(){var e=this,t=120;return new Promise((function(n,r){!function i(){if(1!==t--)e.describeSession().then((function(t){switch(t.Session.EnrollmentRequestDetails.Status){case connect.VoiceIdEnrollmentRequestStatus.COMPLETED:n(t);break;case connect.VoiceIdEnrollmentRequestStatus.IN_PROGRESS:setTimeout(i,5e3);break;case connect.VoiceIdEnrollmentRequestStatus.NOT_ENOUGH_SPEECH:t.Session.StreamingStatus!==connect.VoiceIdStreamingStatus.ENDED?setTimeout(i,5e3):e.startSession().then((function(e){i()})).catch((function(e,t){r(e)}));break;default:r(Error(t.Session.EnrollmentRequestDetails.Status))}}));else{connect.getLog().error("describeSession timeout");var o=connect.VoiceIdError(connect.VoiceIdErrorTypes.TIMEOUT,"describeSession timeout");r(o)}}()}))},a.prototype.enrollSpeaker=function(){var e=this;e.checkConferenceCall();var t=connect.core.getClient(),n=connect.core.getAgentDataProvider().getContactData(this.contactId);return new Promise((function(r,i){t.call(connect.AgentAppClientMethods.ENROLL_SPEAKER_IN_VOICEID,{SessionNameOrId:n.initialContactId||this.contactId},{success:function(t){t.Status===connect.VoiceIdEnrollmentRequestStatus.COMPLETED?r(t):e.checkEnrollmentStatus().then((function(e){r(e)})).catch((function(e){i(e)}))},failure:function(e){connect.getLog().error("enrollSpeaker failed").withObject({err:e});var t=connect.VoiceIdError(connect.VoiceIdErrorTypes.ENROLL_SPEAKER_FAILED,"enrollSpeaker failed",e);i(t)}})}))},a.prototype.updateSpeakerId=function(e){this.checkConferenceCall();var t=connect.core.getClient(),n=connect.core.getAgentDataProvider().getContactData(this.contactId);return new Promise((function(r,i){t.call(connect.AgentAppClientMethods.UPDATE_VOICEID_SESSION,{SessionNameOrId:n.initialContactId||this.contactId,SpeakerId:connect.assertNotNull(e,"speakerId")},{success:function(e){r(e)},failure:function(e){connect.getLog().error("updateSpeakerId failed").withObject({err:e});var t=connect.VoiceIdError(connect.VoiceIdErrorTypes.UPDATE_SPEAKER_ID_FAILED,"updateSpeakerId failed",e);i(t)}})}))},a.prototype.checkConferenceCall=function(){if(connect.core.getAgentDataProvider().getContactData(this.contactId).connections.filter((function(e){return connect.contains(connect.CONNECTION_ACTIVE_STATES,e.state.type)})).length>2)throw new connect.NotImplementedError("VoiceId is not supported for conference calls")};var s=function(e,t){this._speakerAuthenticator=new a(e),o.call(this,e,t)};(s.prototype=Object.create(o.prototype)).constructor=s,s.prototype.getSoftphoneMediaInfo=function(){return this._getData().softphoneMediaInfo},s.prototype.getMediaInfo=function(){return this._getData().softphoneMediaInfo},s.prototype.getMediaType=function(){return connect.MediaType.SOFTPHONE},s.prototype.getMediaController=function(){return connect.core.mediaFactory.get(this)},s.prototype.getVoiceIdSpeakerId=function(){return this._speakerAuthenticator.getSpeakerId()},s.prototype.getVoiceIdSpeakerStatus=function(){return this._speakerAuthenticator.getSpeakerStatus()},s.prototype.optOutVoiceIdSpeaker=function(){return this._speakerAuthenticator.optOutSpeaker()},s.prototype.evaluateSpeakerWithVoiceId=function(e){return this._speakerAuthenticator.evaluateSpeaker(e)},s.prototype.enrollSpeakerInVoiceId=function(){return this._speakerAuthenticator.enrollSpeaker()},s.prototype.updateVoiceIdSpeakerId=function(e){return this._speakerAuthenticator.updateSpeakerId(e)};var u=function(e,t){o.call(this,e,t)};(u.prototype=Object.create(o.prototype)).constructor=u,u.prototype.getMediaInfo=function(){var e=this._getData().chatMediaInfo;if(e){var t=connect.core.getAgentDataProvider().getContactData(this.contactId),n={contactId:this.contactId,initialContactId:t.initialContactId||this.contactId,participantId:this.connectionId,getConnectionToken:connect.hitch(this,this.getConnectionToken)};if(e.connectionData)try{n.participantToken=JSON.parse(e.connectionData).ConnectionAuthenticationToken}catch(r){connect.getLog().error(connect.LogComponent.CHAT,"Connection data is invalid").withObject(e).withException(r).sendInternalLogToServer(),n.participantToken=null}return n.participantToken=n.participantToken||null,n.originalInfo=this._getData().chatMediaInfo,n}return null},u.prototype.getConnectionToken=function(){client=connect.core.getClient();var e=connect.core.getAgentDataProvider().getContactData(this.contactId),t={transportType:connect.TRANSPORT_TYPES.CHAT_TOKEN,participantId:this.connectionId,contactId:e.initialContactId||this.contactId};return new Promise((function(e,n){client.call(connect.ClientMethods.CREATE_TRANSPORT,t,{success:function(t){connect.getLog().info("getConnectionToken succeeded").sendInternalLogToServer(),e(t)},failure:function(e,t){connect.getLog().error("getConnectionToken failed").sendInternalLogToServer().withObject({err:e,data:t}),n(Error("getConnectionToken failed"))}})}))},u.prototype.getMediaType=function(){return connect.MediaType.CHAT},u.prototype.getMediaController=function(){return connect.core.mediaFactory.get(this)},u.prototype._initMediaController=function(){this._isAgentConnectionType()&&connect.core.mediaFactory.get(this).catch((function(){}))};var c=function(e,t){o.call(this,e,t)};(c.prototype=Object.create(o.prototype)).constructor=c,c.prototype.getMediaType=function(){return connect.MediaType.TASK},c.prototype.getMediaInfo=function(){var e=connect.core.getAgentDataProvider().getContactData(this.contactId);return{contactId:this.contactId,initialContactId:e.initialContactId||this.contactId}},c.prototype.getMediaController=function(){return connect.core.mediaFactory.get(this)};var l=function(e){connect.Connection.call(this,e.contactId,e.connectionId),this.connectionData=e};(l.prototype=Object.create(o.prototype)).constructor=l,l.prototype._getData=function(){return this.connectionData},l.prototype._initMediaController=function(){};var f=function(e){var t=e||{};this.endpointARN=t.endpointId||t.endpointARN||null,this.endpointId=this.endpointARN,this.type=t.type||null,this.name=t.name||null,this.phoneNumber=t.phoneNumber||null,this.agentLogin=t.agentLogin||null,this.queue=t.queue||null};f.prototype.stripPhoneNumber=function(){return this.phoneNumber?this.phoneNumber.replace(/sip:([^@]*)@.*/,"$1"):""},f.byPhoneNumber=function(e,t){return new f({type:connect.EndpointType.PHONE_NUMBER,phoneNumber:e,name:t||null})};var h=function(e,t,n){this.errorType=e,this.errorMessage=t,this.endPointUrl=n};h.prototype.getErrorType=function(){return this.errorType},h.prototype.getErrorMessage=function(){return this.errorMessage},h.prototype.getEndPointUrl=function(){return this.endPointUrl},connect.agent=function(e){var t=connect.core.getEventBus().subscribe(connect.AgentEvents.INIT,e);return connect.agent.initialized&&e(new connect.Agent),t},connect.agent.initialized=!1,connect.contact=function(e){return connect.core.getEventBus().subscribe(connect.ContactEvents.INIT,e)},connect.onWebsocketInitFailure=function(e){var t=connect.core.getEventBus().subscribe(connect.WebSocketEvents.INIT_FAILURE,e);return connect.webSocketInitFailed&&e(),t},connect.ifMaster=function(e,t,n){if(connect.assertNotNull(e,"A topic must be provided."),connect.assertNotNull(t,"A true callback must be provided."),!connect.core.masterClient)return connect.getLog().warn("We can't be the master for topic '%s' because there is no master client!",e).sendInternalLogToServer(),void(n&&n());connect.core.getMasterClient().call(connect.MasterMethods.CHECK_MASTER,{topic:e},{success:function(e){e.isMaster?t():n&&n()}})},connect.becomeMaster=function(e,t,n){(connect.assertNotNull(e,"A topic must be provided."),connect.core.masterClient)?connect.core.getMasterClient().call(connect.MasterMethods.BECOME_MASTER,{topic:e},{success:function(){t&&t()}}):(connect.getLog().warn("We can't be the master for topic '%s' because there is no master client!",e),n&&n())},connect.Agent=t,connect.AgentSnapshot=n,connect.Contact=r,connect.ContactSnapshot=i,connect.Connection=s,connect.BaseConnection=o,connect.VoiceConnection=s,connect.ChatConnection=u,connect.TaskConnection=c,connect.ConnectionSnapshot=l,connect.Endpoint=f,connect.Address=f,connect.SoftphoneError=h}(),function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"use strict";var r=n(1),i="DEBUG",o="aws/subscribe",a="aws/heartbeat",s="disconnected";function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var c={assertTrue:function(e,t){if(!e)throw new Error(t)},assertNotNull:function(e,t){return c.assertTrue(null!==e&&void 0!==u(e),Object(r.sprintf)("%s must be provided",t||"A value")),e},isNonEmptyString:function(e){return"string"==typeof e&&e.length>0},assertIsList:function(e,t){if(!Array.isArray(e))throw new Error(t+" is not an array")},isFunction:function(e){return!!(e&&e.constructor&&e.call&&e.apply)},isObject:function(e){return!("object"!==u(e)||null===e)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e}},l=new RegExp("^(wss://)\\w*");c.validWSUrl=function(e){return l.test(e)},c.getSubscriptionResponse=function(e,t,n){return{topic:e,content:{status:t?"success":"failure",topics:n}}},c.assertIsObject=function(e,t){if(!c.isObject(e))throw new Error(t+" is not an object!")},c.addJitter=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t=Math.min(t,1);var n=Math.random()>.5?1:-1;return Math.floor(e+n*e*Math.random()*t)},c.isNetworkOnline=function(){return navigator.onLine},c.isNetworkFailure=function(e){return!(!e._debug||!e._debug.type)&&"NetworkingError"===e._debug.type};var f=c;function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n=this._level}},{key:"hasClientLogger",value:function(){return null!==this._clientLogger}},{key:"getLogger",value:function(e){var t=e.prefix||"";return this._logsDestination===i?this.consoleLoggerWrapper:new _(t)}},{key:"updateLoggerConfig",value:function(e){var t=e||{};this._level=t.level||b.DEBUG,this._clientLogger=t.logger||null,this._logsDestination="NULL",t.debug&&(this._logsDestination=i),t.logger&&(this._logsDestination="CLIENT_LOGGER")}}]),e}(),S=function(){function e(){m(this,e)}return v(e,[{key:"debug",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}}]),e}(),_=function(e){function t(e){var n;return m(this,t),(n=function(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,d(t).call(this))).prefix=e||"",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,S),v(t,[{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:2e3;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.numAttempts=0,this.executor=t,this.hasActiveReconnection=!1,this.defaultRetry=n}var t,n;return t=e,(n=[{key:"retry",value:function(){var e=this;this.hasActiveReconnection||(this.hasActiveReconnection=!0,setTimeout((function(){e._execute()}),this._getDelay()))}},{key:"_execute",value:function(){this.hasActiveReconnection=!1,this.executor(),this.numAttempts++}},{key:"connected",value:function(){this.numAttempts=0}},{key:"_getDelay",value:function(){var e=Math.pow(2,this.numAttempts)*this.defaultRetry;return e<=3e4?e:3e4}}])&&x(t.prototype,n),e}();n.d(t,"a",(function(){return C}));var O=function(){var e=M.getLogger({}),t=f.isNetworkOnline(),n={primary:null,secondary:null},r={reconnectWebSocket:!0,websocketInitFailed:!1,exponentialBackOffTime:1e3,exponentialTimeoutHandle:null,lifeTimeTimeoutHandle:null,webSocketInitCheckerTimeoutId:null,connState:null},i={connectWebSocketRetryCount:0,connectionAttemptStartTime:null,noOpenConnectionsTimestamp:null},u={pendingResponse:!1,intervalHandle:null},c={initFailure:new Set,getWebSocketTransport:null,subscriptionUpdate:new Set,subscriptionFailure:new Set,topic:new Map,allMessage:new Set,connectionGain:new Set,connectionLost:new Set,connectionOpen:new Set,connectionClose:new Set},l={connConfig:null,promiseHandle:null,promiseCompleted:!0},h={subscribed:new Set,pending:new Set,subscriptionHistory:new Set},d={responseCheckIntervalId:null,requestCompleted:!0,reSubscribeIntervalId:null,consecutiveFailedSubscribeAttempts:0,consecutiveNoResponseRequest:0},p=new k((function(){z()})),m=new Set([o,"aws/unsubscribe",a]),g=setInterval((function(){if(t!==f.isNetworkOnline()){if(!(t=f.isNetworkOnline()))return void V(e.info("Network offline"));var n=E();t&&(!n||w(n,WebSocket.CLOSING)||w(n,WebSocket.CLOSED))&&(V(e.info("Network online, connecting to WebSocket server")),z())}}),250),v=function(t,n){t.forEach((function(t){try{t(n)}catch(t){V(e.error("Error executing callback",t))}}))},y=function(e){if(null===e)return"NULL";switch(e.readyState){case WebSocket.CONNECTING:return"CONNECTING";case WebSocket.OPEN:return"OPEN";case WebSocket.CLOSING:return"CLOSING";case WebSocket.CLOSED:return"CLOSED";default:return"UNDEFINED"}},b=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";V(e.debug("["+t+"] Primary WebSocket: "+y(n.primary)+" | Secondary WebSocket: "+y(n.secondary)))},w=function(e,t){return e&&e.readyState===t},S=function(e){return w(e,WebSocket.OPEN)},_=function(e){return null===e||void 0===e.readyState||w(e,WebSocket.CLOSED)},E=function(){return null!==n.secondary?n.secondary:n.primary},x=function(){return S(E())},O=function(){if(u.pendingResponse)return V(e.warn("Heartbeat response not received")),clearInterval(u.intervalHandle),u.pendingResponse=!1,void z();x()?(V(e.debug("Sending heartbeat")),E().send(B(a)),u.pendingResponse=!0):(V(e.warn("Failed to send heartbeat since WebSocket is not open")),b("sendHeartBeat"),z())},C=function(){r.exponentialBackOffTime=1e3,u.pendingResponse=!1,r.reconnectWebSocket=!0,clearTimeout(r.lifeTimeTimeoutHandle),clearInterval(u.intervalHandle),clearTimeout(r.exponentialTimeoutHandle),clearTimeout(r.webSocketInitCheckerTimeoutId)},A=function(){d.consecutiveFailedSubscribeAttempts=0,d.consecutiveNoResponseRequest=0,clearInterval(d.responseCheckIntervalId),clearInterval(d.reSubscribeIntervalId)},T=function(){i.connectWebSocketRetryCount=0,i.connectionAttemptStartTime=null,i.noOpenConnectionsTimestamp=null},I=function(){try{V(e.info("WebSocket connection established!")),b("webSocketOnOpen"),null!==r.connState&&r.connState!==s||v(c.connectionGain),r.connState="connected";var t=Date.now();v(c.connectionOpen,{connectWebSocketRetryCount:i.connectWebSocketRetryCount,connectionAttemptStartTime:i.connectionAttemptStartTime,noOpenConnectionsTimestamp:i.noOpenConnectionsTimestamp,connectionEstablishedTime:t,timeToConnect:t-i.connectionAttemptStartTime,timeWithoutConnection:i.noOpenConnectionsTimestamp?t-i.noOpenConnectionsTimestamp:null}),T(),C(),E().openTimestamp=Date.now(),0===h.subscribed.size&&S(n.secondary)&&N(n.primary,"[Primary WebSocket] Closing WebSocket"),(h.subscribed.size>0||h.pending.size>0)&&(S(n.secondary)&&V(e.info("Subscribing secondary websocket to topics of primary websocket")),h.subscribed.forEach((function(e){h.subscriptionHistory.add(e),h.pending.add(e)})),h.subscribed.clear(),j()),O(),u.intervalHandle=setInterval(O,1e4);var o=1e3*l.connConfig.webSocketTransport.transportLifeTimeInSeconds;V(e.debug("Scheduling WebSocket manager reconnection, after delay "+o+" ms")),r.lifeTimeTimeoutHandle=setTimeout((function(){V(e.debug("Starting scheduled WebSocket manager reconnection")),z()}),o)}catch(t){V(e.error("Error after establishing WebSocket connection",t))}},P=function(t){b("webSocketOnError"),V(e.error("WebSocketManager Error, error_event: ",JSON.stringify(t))),z()},R=function(t){var r=JSON.parse(t.data);switch(r.topic){case o:if(V(e.debug("Subscription Message received from webSocket server",t.data)),d.requestCompleted=!0,d.consecutiveNoResponseRequest=0,"success"===r.content.status)d.consecutiveFailedSubscribeAttempts=0,r.content.topics.forEach((function(e){h.subscriptionHistory.delete(e),h.pending.delete(e),h.subscribed.add(e)})),0===h.subscriptionHistory.size?S(n.secondary)&&(V(e.info("Successfully subscribed secondary websocket to all topics of primary websocket")),N(n.primary,"[Primary WebSocket] Closing WebSocket")):j(),v(c.subscriptionUpdate,r);else{if(clearInterval(d.reSubscribeIntervalId),++d.consecutiveFailedSubscribeAttempts,5===d.consecutiveFailedSubscribeAttempts)return v(c.subscriptionFailure,r),void(d.consecutiveFailedSubscribeAttempts=0);d.reSubscribeIntervalId=setInterval((function(){j()}),500)}break;case a:V(e.debug("Heartbeat response received")),u.pendingResponse=!1;break;default:if(r.topic){if(V(e.debug("Message received for topic "+r.topic)),S(n.primary)&&S(n.secondary)&&0===h.subscriptionHistory.size&&this===n.primary)return void V(e.warn("Ignoring Message for Topic "+r.topic+", to avoid duplicates"));if(0===c.allMessage.size&&0===c.topic.size)return void V(e.warn("No registered callback listener for Topic",r.topic));v(c.allMessage,r),c.topic.has(r.topic)&&v(c.topic.get(r.topic),r)}else r.message?V(e.warn("WebSocketManager Message Error",r)):V(e.warn("Invalid incoming message",r))}},j=function t(){if(d.consecutiveNoResponseRequest>3)return V(e.warn("Ignoring subscribePendingTopics since we have exhausted max subscription retries with no response")),void v(c.subscriptionFailure,f.getSubscriptionResponse(o,!1,Array.from(h.pending)));x()?(clearInterval(d.responseCheckIntervalId),E().send(B(o,{topics:Array.from(h.pending)})),d.requestCompleted=!1,d.responseCheckIntervalId=setInterval((function(){d.requestCompleted||(++d.consecutiveNoResponseRequest,t())}),1e3)):V(e.warn("Ignoring subscribePendingTopics call since Default WebSocket is not open"))},N=function(t,n){w(t,WebSocket.CONNECTING)||w(t,WebSocket.OPEN)?t.close(1e3,n):V(e.warn("Ignoring WebSocket Close request, WebSocket State: "+y(t)))},L=function(e){N(n.primary,"[Primary] WebSocket "+e),N(n.secondary,"[Secondary] WebSocket "+e)},D=function(){i.connectWebSocketRetryCount++;var t=f.addJitter(r.exponentialBackOffTime,.3);Date.now()+t<=l.connConfig.urlConnValidTime?(V(e.debug("Scheduling WebSocket reinitialization, after delay "+t+" ms")),r.exponentialTimeoutHandle=setTimeout((function(){return q()}),t),r.exponentialBackOffTime*=2):(V(e.warn("WebSocket URL cannot be used to establish connection")),z())},U=function(t){C(),A(),V(e.error("WebSocket Initialization failed")),r.websocketInitFailed=!0,L("Terminating WebSocket Manager"),clearInterval(g),v(c.initFailure,{connectWebSocketRetryCount:i.connectWebSocketRetryCount,connectionAttemptStartTime:i.connectionAttemptStartTime,reason:t}),T()},B=function(e,t){return JSON.stringify({topic:e,content:t})},F=function(t){return!!(f.isObject(t)&&f.isObject(t.webSocketTransport)&&f.isNonEmptyString(t.webSocketTransport.url)&&f.validWSUrl(t.webSocketTransport.url)&&1e3*t.webSocketTransport.transportLifeTimeInSeconds>=3e5)||(V(e.error("Invalid WebSocket Connection Configuration",t)),!1)},z=function(){if(f.isNetworkOnline())if(r.websocketInitFailed)V(e.debug("WebSocket Init had failed, ignoring this getWebSocketConnConfig request"));else{if(l.promiseCompleted)return C(),V(e.info("Fetching new WebSocket connection configuration")),i.connectionAttemptStartTime=i.connectionAttemptStartTime||Date.now(),l.promiseCompleted=!1,l.promiseHandle=c.getWebSocketTransport(),l.promiseHandle.then((function(t){return l.promiseCompleted=!0,V(e.debug("Successfully fetched webSocket connection configuration",t)),F(t)?(l.connConfig=t,l.connConfig.urlConnValidTime=Date.now()+85e3,p.connected(),q()):(U("Invalid WebSocket connection configuration: "+t),{webSocketConnectionFailed:!0})}),(function(t){return l.promiseCompleted=!0,V(e.error("Failed to fetch webSocket connection configuration",t)),f.isNetworkFailure(t)&&(V(e.info("Retrying fetching new WebSocket connection configuration")),p.retry()),{webSocketConnectionFailed:!0}}));V(e.debug("There is an ongoing getWebSocketConnConfig request, this request will be ignored"))}else V(e.info("Network offline, ignoring this getWebSocketConnConfig request"))},q=function(){if(r.websocketInitFailed)return V(e.info("web-socket initializing had failed, aborting re-init")),{webSocketConnectionFailed:!0};if(!f.isNetworkOnline())return V(e.warn("System is offline aborting web-socket init")),{webSocketConnectionFailed:!0};V(e.info("Initializing Websocket Manager")),b("initWebSocket");try{if(F(l.connConfig)){var t=null;return S(n.primary)?(V(e.debug("Primary Socket connection is already open")),w(n.secondary,WebSocket.CONNECTING)||(V(e.debug("Establishing a secondary web-socket connection")),n.secondary=H()),t=n.secondary):(w(n.primary,WebSocket.CONNECTING)||(V(e.debug("Establishing a primary web-socket connection")),n.primary=H()),t=n.primary),r.webSocketInitCheckerTimeoutId=setTimeout((function(){S(t)||D()}),1e3),{webSocketConnectionFailed:!1}}}catch(t){return V(e.error("Error Initializing web-socket-manager",t)),U("Failed to initialize new WebSocket: "+t.message),{webSocketConnectionFailed:!0}}},H=function(){var t=new WebSocket(l.connConfig.webSocketTransport.url);return t.addEventListener("open",I),t.addEventListener("message",R),t.addEventListener("error",P),t.addEventListener("close",(function(o){return function(t,o){V(e.info("Socket connection is closed",t)),b("webSocketOnClose before-cleanup"),v(c.connectionClose,{openTimestamp:o.openTimestamp,closeTimestamp:Date.now(),connectionDuration:Date.now()-o.openTimestamp,code:t.code,reason:t.reason}),_(n.primary)&&(n.primary=null),_(n.secondary)&&(n.secondary=null),r.reconnectWebSocket&&(S(n.primary)||S(n.secondary)?_(n.primary)&&S(n.secondary)&&(V(e.info("[Primary] WebSocket Cleanly Closed")),n.primary=n.secondary,n.secondary=null):(V(e.warn("Neither primary websocket and nor secondary websocket have open connections, attempting to re-establish connection")),r.connState===s?V(e.info("Ignoring connectionLost callback invocation")):(v(c.connectionLost,{openTimestamp:o.openTimestamp,closeTimestamp:Date.now(),connectionDuration:Date.now()-o.openTimestamp,code:t.code,reason:t.reason}),i.noOpenConnectionsTimestamp=Date.now()),r.connState=s,z()),b("webSocketOnClose after-cleanup"))}(o,t)})),t},V=function(e){return e&&"function"==typeof e.sendInternalLogToServer&&e.sendInternalLogToServer(),e};this.init=function(t){if(f.assertTrue(f.isFunction(t),"transportHandle must be a function"),null===c.getWebSocketTransport)return c.getWebSocketTransport=t,z();V(e.warn("Web Socket Manager was already initialized"))},this.onInitFailure=function(e){return f.assertTrue(f.isFunction(e),"cb must be a function"),c.initFailure.add(e),r.websocketInitFailed&&e(),function(){return c.initFailure.delete(e)}},this.onConnectionOpen=function(e){return f.assertTrue(f.isFunction(e),"cb must be a function"),c.connectionOpen.add(e),function(){return c.connectionOpen.delete(e)}},this.onConnectionClose=function(e){return f.assertTrue(f.isFunction(e),"cb must be a function"),c.connectionClose.add(e),function(){return c.connectionClose.delete(e)}},this.onConnectionGain=function(e){return f.assertTrue(f.isFunction(e),"cb must be a function"),c.connectionGain.add(e),x()&&e(),function(){return c.connectionGain.delete(e)}},this.onConnectionLost=function(e){return f.assertTrue(f.isFunction(e),"cb must be a function"),c.connectionLost.add(e),r.connState===s&&e(),function(){return c.connectionLost.delete(e)}},this.onSubscriptionUpdate=function(e){return f.assertTrue(f.isFunction(e),"cb must be a function"),c.subscriptionUpdate.add(e),function(){return c.subscriptionUpdate.delete(e)}},this.onSubscriptionFailure=function(e){return f.assertTrue(f.isFunction(e),"cb must be a function"),c.subscriptionFailure.add(e),function(){return c.subscriptionFailure.delete(e)}},this.onMessage=function(e,t){return f.assertNotNull(e,"topicName"),f.assertTrue(f.isFunction(t),"cb must be a function"),c.topic.has(e)?c.topic.get(e).add(t):c.topic.set(e,new Set([t])),function(){return c.topic.get(e).delete(t)}},this.onAllMessage=function(e){return f.assertTrue(f.isFunction(e),"cb must be a function"),c.allMessage.add(e),function(){return c.allMessage.delete(e)}},this.subscribeTopics=function(e){f.assertNotNull(e,"topics"),f.assertIsList(e),e.forEach((function(e){h.subscribed.has(e)||h.pending.add(e)})),d.consecutiveNoResponseRequest=0,j()},this.sendMessage=function(t){if(f.assertIsObject(t,"payload"),void 0===t.topic||m.has(t.topic))V(e.warn("Cannot send message, Invalid topic",t));else{try{t=JSON.stringify(t)}catch(n){return void V(e.warn("Error stringify message",t))}x()?E().send(t):V(e.warn("Cannot send message, web socket connection is not open"))}},this.closeWebSocket=function(){C(),A(),r.reconnectWebSocket=!1,clearInterval(g),L("User request to close WebSocket")},this.terminateWebSocketManager=U},C={create:function(){return new O},setGlobalConfig:function(e){var t=e.loggerConfig;M.updateLoggerConfig(t)},LogLevel:b,Logger:y}},function(e,t,n){var r;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return function(e,t){var n,r,a,s,u,c,l,f,h,d=1,p=e.length,m="";for(r=0;r=0),s.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,s.width?parseInt(s.width):0);break;case"e":n=s.precision?parseFloat(n).toExponential(s.precision):parseFloat(n).toExponential();break;case"f":n=s.precision?parseFloat(n).toFixed(s.precision):parseFloat(n);break;case"g":n=s.precision?String(Number(n.toPrecision(s.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=s.precision?n.substring(0,s.precision):n;break;case"t":n=String(!!n),n=s.precision?n.substring(0,s.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=s.precision?n.substring(0,s.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=s.precision?n.substring(0,s.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=n:(!i.number.test(s.type)||f&&!s.sign?h="":(h=f?"+":"-",n=n.toString().replace(i.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",l=s.width-(h+n).length,u=s.width&&l>0?c.repeat(l):"",m+=s.align?h+n+u:"0"===c?h+u+n:u+h+n)}return m}(function(e){if(s[e])return s[e];for(var t,n=e,r=[],o=0;n;){if(null!==(t=i.text.exec(n)))r.push(t[0]);else if(null!==(t=i.modulo.exec(n)))r.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var a=[],u=t[2],c=[];if(null===(c=i.key.exec(u)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(c[1]);""!==(u=u.substring(c[0].length));)if(null!==(c=i.key_access.exec(u)))a.push(c[1]);else{if(null===(c=i.index_access.exec(u)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(c[1])}t[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return s[e]=r}(e),arguments)}function a(e,t){return o.apply(null,[e].concat(t||[]))}var s=Object.create(null);t.sprintf=o,t.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=a,void 0===(r=function(){return{sprintf:o,vsprintf:a}}.call(t,n,t,e))||(e.exports=r))}()},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"WebSocketManager",(function(){return i}));var r=n(0);e.connect=e.connect||{},connect.WebSocketManager=r.a;var i=r.a}.call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n}]),function(){var e=this;connect=e.connect||{},e.connect=connect,e.lily=connect,connect.core={},connect.core.initialized=!1,connect.version="1.6.5",connect.DEFAULT_BATCH_SIZE=500;var t="https://{alias}.awsapps.com/auth/?client_id={client_id}&redirect_uri={redirect}",n="06919f4fd8ed324e",r="/auth/authorize",i="/connect/auth/authorize";connect.numberOfConnectedCCPs=0;function o(e){var t=e.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n?]+)/gi);return t.length?t[0]:""}connect.core.checkNotInitialized=function(){connect.core.initialized&&connect.getLog().warn("Connect core already initialized, only needs to be initialized once.").sendInternalLogToServer()},connect.core.init=function(e){connect.core.eventBus=new connect.EventBus,connect.core.agentDataProvider=new l(connect.core.getEventBus()),connect.core.initClient(e),connect.core.initAgentAppClient(e),connect.core.initialized=!0},connect.core.initClient=function(e){connect.assertNotNull(e,"params");var t=connect.assertNotNull(e.authToken,"params.authToken"),n=connect.assertNotNull(e.region,"params.region"),r=e.endpoint||null;connect.core.client=new connect.AWSClient(t,n,r)},connect.core.initAgentAppClient=function(e){connect.assertNotNull(e,"params");var t=connect.assertNotNull(e.authToken,"params.authToken"),n=connect.assertNotNull(e.authCookieName,"params.authCookieName"),r=connect.assertNotNull(e.agentAppEndpoint,"params.agentAppEndpoint");connect.core.agentAppClient=new connect.AgentAppClient(n,t,r)},connect.core.terminate=function(){connect.core.client=new connect.NullClient,connect.core.agentAppClient=new connect.NullClient,connect.core.masterClient=new connect.NullClient;var e=connect.core.getEventBus();e&&e.unsubscribeAll(),connect.core.bus=new connect.EventBus,connect.core.agentDataProvider=null,connect.core.softphoneManager=null,connect.core.upstream=null,connect.core.keepaliveManager=null,connect.agent.initialized=!1,connect.core.initialized=!1},connect.core.softphoneUserMediaStream=null,connect.core.getSoftphoneUserMediaStream=function(){return connect.core.softphoneUserMediaStream},connect.core.setSoftphoneUserMediaStream=function(e){connect.core.softphoneUserMediaStream=e},connect.core.initRingtoneEngines=function(e){connect.assertNotNull(e,"params");var t=function(e){connect.assertNotNull(e,"ringtoneSettings"),connect.assertNotNull(e.voice,"ringtoneSettings.voice"),connect.assertTrue(e.voice.ringtoneUrl||e.voice.disabled,"ringtoneSettings.voice.ringtoneUrl must be provided or ringtoneSettings.voice.disabled must be true"),connect.assertNotNull(e.queue_callback,"ringtoneSettings.queue_callback"),connect.assertTrue(e.queue_callback.ringtoneUrl||e.queue_callback.disabled,"ringtoneSettings.voice.ringtoneUrl must be provided or ringtoneSettings.queue_callback.disabled must be true"),connect.core.ringtoneEngines={},connect.agent((function(t){t.onRefresh((function(){connect.ifMaster(connect.MasterTopics.RINGTONE,(function(){e.voice.disabled||connect.core.ringtoneEngines.voice||(connect.core.ringtoneEngines.voice=new connect.VoiceRingtoneEngine(e.voice),connect.getLog().info("VoiceRingtoneEngine initialized.").sendInternalLogToServer()),e.chat.disabled||connect.core.ringtoneEngines.chat||(connect.core.ringtoneEngines.chat=new connect.ChatRingtoneEngine(e.chat),connect.getLog().info("ChatRingtoneEngine initialized.").sendInternalLogToServer()),e.task.disabled||connect.core.ringtoneEngines.task||(connect.core.ringtoneEngines.task=new connect.TaskRingtoneEngine(e.task),connect.getLog().info("TaskRingtoneEngine initialized.").sendInternalLogToServer()),e.queue_callback.disabled||connect.core.ringtoneEngines.queue_callback||(connect.core.ringtoneEngines.queue_callback=new connect.QueueCallbackRingtoneEngine(e.queue_callback),connect.getLog().info("QueueCallbackRingtoneEngine initialized.").sendInternalLogToServer())}))}))})),a()},n=function(e,t){e.ringtone=e.ringtone||{},e.ringtone.voice=e.ringtone.voice||{},e.ringtone.queue_callback=e.ringtone.queue_callback||{},e.ringtone.chat=e.ringtone.chat||{disabled:!0},e.ringtone.task=e.ringtone.task||{disabled:!0},t.softphone&&(t.softphone.disableRingtone&&(e.ringtone.voice.disabled=!0,e.ringtone.queue_callback.disabled=!0),t.softphone.ringtoneUrl&&(e.ringtone.voice.ringtoneUrl=t.softphone.ringtoneUrl,e.ringtone.queue_callback.ringtoneUrl=t.softphone.ringtoneUrl)),t.chat&&(t.chat.disableRingtone&&(e.ringtone.chat.disabled=!0),t.chat.ringtoneUrl&&(e.ringtone.chat.ringtoneUrl=t.chat.ringtoneUrl)),t.ringtone&&(e.ringtone.voice=connect.merge(e.ringtone.voice,t.ringtone.voice||{}),e.ringtone.queue_callback=connect.merge(e.ringtone.queue_callback,t.ringtone.voice||{}),e.ringtone.chat=connect.merge(e.ringtone.chat,t.ringtone.chat||{}))};(n(e,e),connect.isFramed())?connect.core.getEventBus().subscribe(connect.EventType.CONFIGURE,(function(r){this.unsubscribe(),n(e,r),t(e.ringtone)})):t(e.ringtone)};var a=function(){connect.core.getEventBus().subscribe(connect.ConfigurationEvents.SET_RINGER_DEVICE,s)},s=function(e){if(0!==connect.keys(connect.core.ringtoneEngines).length&&e&&e.deviceId){var t=e.deviceId;for(var n in connect.core.ringtoneEngines)connect.core.ringtoneEngines[n].setOutputDevice(t);connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.ConfigurationEvents.RINGER_DEVICE_CHANGED,data:{deviceId:t}})}};connect.core.initSoftphoneManager=function(e){var t=e||{},n=function(e){var n=connect.merge(t.softphone||{},e);connect.agent((function(e){e.getChannelConcurrency(connect.ChannelType.VOICE)&&e.onRefresh((function(){var t=this;connect.ifMaster(connect.MasterTopics.SOFTPHONE,(function(){!connect.core.softphoneManager&&e.isSoftphoneEnabled()&&(connect.becomeMaster(connect.MasterTopics.SEND_LOGS),connect.core.softphoneManager=new connect.SoftphoneManager(n),t.unsubscribe())}))}))}))};connect.isFramed()&&!t.allowFramedSoftphone?connect.core.getEventBus().subscribe(connect.EventType.CONFIGURE,(function(e){e.softphone&&e.softphone.allowFramedSoftphone&&(this.unsubscribe(),n(e.softphone)),r(e.softphone)})):(n(t),r(t));function r(e){var n=connect.merge(t.softphone||{},e);connect.core.softphoneParams=n,connect.isFirefoxBrowser()&&(connect.core.getUpstream().onUpstream(connect.EventType.MASTER_RESPONSE,(function(e){if(e.data&&e.data.topic===connect.MasterTopics.SOFTPHONE&&e.data.takeOver&&e.data.masterId!==connect.core.portStreamId){connect.core.softphoneManager&&(connect.core.softphoneManager.onInitContactSub.unsubscribe(),delete connect.core.softphoneManager);var t=connect.core.getSoftphoneUserMediaStream();t&&(t.getTracks().forEach((function(e){e.stop()})),connect.core.setSoftphoneUserMediaStream(null))}})),connect.core.getEventBus().subscribe(connect.ConnectionEvents.READY_TO_START_SESSION,(function(){connect.ifMaster(connect.MasterTopics.SOFTPHONE,(function(){connect.core.softphoneManager&&connect.core.softphoneManager.startSession()}),(function(){connect.becomeMaster(connect.MasterTopics.SOFTPHONE,(function(){connect.agent((function(e){!connect.core.softphoneManager&&e.isSoftphoneEnabled()&&(connect.becomeMaster(connect.MasterTopics.SEND_LOGS),connect.core.softphoneManager=new connect.SoftphoneManager(n),connect.core.softphoneManager.startSession())}))}))}))})),connect.contact((function(e){connect.agent((function(t){e.onRefresh((function(e){if(connect.hasOtherConnectedCCPs()&&"visible"===document.visibilityState&&(e.getStatus().type===connect.ContactStatusType.CONNECTING||e.getStatus().type===connect.ContactStatusType.INCOMING)){var n=e.isSoftphoneCall()&&!e.isInbound(),r=e.isSoftphoneCall()&&t.getConfiguration().softphoneAutoAccept,i=e.getType()===connect.ContactType.QUEUE_CALLBACK;(n||r||i)&&connect.core.triggerReadyToStartSessionEvent()}}))}))})))}connect.agent((function(e){e.isSoftphoneEnabled()&&e.getChannelConcurrency(connect.ChannelType.VOICE)&&connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.EventType.MUTE})}))},connect.core.triggerReadyToStartSessionEvent=function(){var e=connect.core.softphoneParams&&connect.core.softphoneParams.allowFramedSoftphone;connect.isCCP()?e?connect.core.getEventBus().trigger(connect.ConnectionEvents.READY_TO_START_SESSION):connect.isFramed()?connect.core.getUpstream().sendDownstream(connect.ConnectionEvents.READY_TO_START_SESSION):connect.core.getEventBus().trigger(connect.ConnectionEvents.READY_TO_START_SESSION):e?connect.core.getUpstream().sendUpstream(connect.ConnectionEvents.READY_TO_START_SESSION):connect.core.getEventBus().trigger(connect.ConnectionEvents.READY_TO_START_SESSION)},connect.core.initPageOptions=function(e){(connect.assertNotNull(e,"params"),connect.isFramed())&&connect.core.getEventBus().subscribe(connect.EventType.CONFIGURE,(function(e){connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.ConfigurationEvents.CONFIGURE,data:e})}))},connect.core.authorize=function(e){var t=e;return t||(t=connect.core.isLegacyDomain()?i:r),connect.fetch(t,{credentials:"include"},2e3,5)},connect.core.verifyDomainAccess=function(e,t){if(connect.getLog().warn("This API will be deprecated in the next major version release"),!connect.isFramed())return Promise.resolve();var n={headers:{"X-Amz-Bearer":e}},r=null;return r=t||(connect.core.isLegacyDomain()?"/connect/whitelisted-origins":"/whitelisted-origins"),connect.fetch(r,n,2e3,5).then((function(e){var t=o(window.document.referrer);return e.whitelistedOrigins.some((function(e){return t===o(e)}))?Promise.resolve():Promise.reject()}))},connect.core.isLegacyDomain=function(e){return(e=e||window.location.href).includes(".awsapps.com")},connect.core.initSharedWorker=function(t){if(connect.core.checkNotInitialized(),!connect.core.initialized){connect.assertNotNull(t,"params");var n=connect.assertNotNull(t.sharedWorkerUrl,"params.sharedWorkerUrl"),o=connect.assertNotNull(t.authToken,"params.authToken"),a=connect.assertNotNull(t.refreshToken,"params.refreshToken"),s=connect.assertNotNull(t.authTokenExpiration,"params.authTokenExpiration"),u=connect.assertNotNull(t.region,"params.region"),f=t.endpoint||null,h=t.authorizeEndpoint;h||(h=connect.core.isLegacyDomain()?i:r);var d=t.agentAppEndpoint||null,p=t.authCookieName||null;try{connect.core.eventBus=new connect.EventBus({logEvents:!0}),connect.core.agentDataProvider=new l(connect.core.getEventBus()),connect.core.mediaFactory=new connect.MediaFactory(t);var m=new SharedWorker(n,"ConnectSharedWorker"),g=new connect.Conduit("ConnectSharedWorkerConduit",new connect.PortStream(m.port),new connect.WindowIOStream(window,parent));connect.core.upstream=g,connect.core.webSocketProvider=new c,e.onunload=function(){g.sendUpstream(connect.EventType.CLOSE),m.port.close()},connect.getLog().scheduleUpstreamLogPush(g),connect.getLog().scheduleDownstreamClientSideLogsPush(),g.onAllUpstream(connect.core.getEventBus().bridge()),g.onAllUpstream(g.passDownstream()),connect.isFramed()&&(g.onAllDownstream(connect.core.getEventBus().bridge()),g.onAllDownstream(g.passUpstream())),g.sendUpstream(connect.EventType.CONFIGURE,{authToken:o,authTokenExpiration:s,endpoint:f,refreshToken:a,region:u,authorizeEndpoint:h,agentAppEndpoint:d,authCookieName:p}),g.onUpstream(connect.EventType.ACKNOWLEDGE,(function(e){connect.getLog().info("Acknowledged by the ConnectSharedWorker!").sendInternalLogToServer(),connect.core.initialized=!0,connect.core.portStreamId=e.id,this.unsubscribe()})),g.onUpstream(connect.EventType.LOG,(function(e){e.loggerId!==connect.getLog().getLoggerId()&&connect.getLog().addLogEntry(connect.LogEntry.fromObject(e))})),g.onUpstream(connect.EventType.SERVER_BOUND_INTERNAL_LOG,(function(e){e.loggerId!==connect.getLog().getLoggerId()&&connect.getLog().sendInternalLogEntryToServer(connect.LogEntry.fromObject(e))})),g.onUpstream(connect.EventType.AUTH_FAIL,(function(e){location.reload()})),g.onUpstream(connect.EventType.UPDATE_CONNECTED_CCPS,(function(e){connect.getLog().info("Number of connected CCPs updated: "+e.length),connect.numberOfConnectedCCPs=e.length})),connect.core.client=new connect.UpstreamConduitClient(g),connect.core.masterClient=new connect.UpstreamConduitMasterClient(g),connect.core.getEventBus().subscribe(connect.EventType.TERMINATE,g.passUpstream()),connect.core.getEventBus().subscribe(connect.EventType.TERMINATED,(function(){window.location.reload(!0)})),m.port.start(),connect.core.getNotificationManager().requestPermission()}catch(v){connect.getLog().error("Failed to initialize the API shared worker, we're dead!").withException(v).sendInternalLogToServer()}}},connect.core.initCCP=function(r,i){if(connect.core.checkNotInitialized(),!connect.core.initialized){var o={};"string"===typeof i?o.ccpUrl=i:o=i,connect.assertNotNull(r,"containerDiv"),connect.assertNotNull(o.ccpUrl,"params.ccpUrl");var a=document.createElement("iframe");a.src=o.ccpUrl,a.allow="microphone; autoplay",a.style="width: 100%; height: 100%",r.appendChild(a),connect.core.eventBus=new connect.EventBus({logEvents:!1}),connect.core.agentDataProvider=new l(connect.core.getEventBus()),connect.core.mediaFactory=new connect.MediaFactory(o);var s=new connect.IFrameConduit(o.ccpUrl,window,a);a.onload=setTimeout((function(){var e={display:window.getComputedStyle(a,null).display,offsetWidth:a.offsetWidth,offsetHeight:a.offsetHeight,clientRectsLength:a.getClientRects().length};s.sendUpstream(connect.EventType.IFRAME_STYLE,e)}),1e4),connect.core.upstream=s,connect.core.webSocketProvider=new c,s.onAllUpstream(connect.core.getEventBus().bridge()),connect.core.keepaliveManager=new u(s,connect.core.getEventBus(),o.ccpSynTimeout||1e3,o.ccpAckTimeout||3e3),connect.core.iframeRefreshInterval=null,connect.core.ccpLoadTimeoutInstance=e.setTimeout((function(){connect.core.ccpLoadTimeoutInstance=null,connect.core.getEventBus().trigger(connect.EventType.ACK_TIMEOUT)}),o.ccpLoadTimeout||3e3),s.onUpstream(connect.EventType.ACKNOWLEDGE,(function(t){connect.getLog().info("Acknowledged by the CCP!").sendInternalLogToServer(),connect.core.client=new connect.UpstreamConduitClient(s),connect.core.masterClient=new connect.UpstreamConduitMasterClient(s),connect.core.portStreamId=t.id,(o.softphone||o.chat||o.pageOptions)&&s.sendUpstream(connect.EventType.CONFIGURE,{softphone:o.softphone,chat:o.chat,pageOptions:o.pageOptions}),connect.core.ccpLoadTimeoutInstance&&(e.clearTimeout(connect.core.ccpLoadTimeoutInstance),connect.core.ccpLoadTimeoutInstance=null),connect.core.keepaliveManager.start(),this.unsubscribe(),connect.core.initialized=!0,connect.core.getEventBus().trigger(connect.EventType.INIT)})),s.onUpstream(connect.EventType.LOG,(function(e){e.loggerId!==connect.getLog().getLoggerId()&&connect.getLog().addLogEntry(connect.LogEntry.fromObject(e))})),s.onUpstream(connect.EventType.SERVER_BOUND_INTERNAL_LOG,(function(e){e.loggerId!==connect.getLog().getLoggerId()&&connect.getLog().sendInternalLogEntryToServer(connect.LogEntry.fromObject(e))})),connect.core.getEventBus().subscribe(connect.EventType.ACK_TIMEOUT,(function(){if(!1!==o.loginPopup)try{var r=function(r){var i="https://lily.us-east-1.amazonaws.com/taw/auth/code";return connect.assertNotNull(i),r.loginUrl?r.loginUrl:r.alias?(log.warn("The `alias` param is deprecated and should not be expected to function properly. Please use `ccpUrl` or `loginUrl`. See https://github.com/amazon-connect/amazon-connect-streams/blob/master/README.md#connectcoreinitccp for valid parameters."),t.replace("{alias}",r.alias).replace("{client_id}",n).replace("{redirect}",e.encodeURIComponent(i))):r.ccpUrl}(o);connect.getLog().warn("ACK_TIMEOUT occurred, attempting to pop the login page if not already open.").sendInternalLogToServer(),o.loginUrl&&connect.core.getPopupManager().clear(connect.MasterTopics.LOGIN_POPUP),connect.core.loginWindow=connect.core.getPopupManager().open(r,connect.MasterTopics.LOGIN_POPUP,o.loginOptions)}catch(i){connect.getLog().error("ACK_TIMEOUT occurred but we are unable to open the login popup.").withException(i).sendInternalLogToServer()}null==connect.core.iframeRefreshInterval&&(connect.core.iframeRefreshInterval=window.setInterval((function(){a.src=o.ccpUrl}),5e3),s.onUpstream(connect.EventType.ACKNOWLEDGE,(function(){this.unsubscribe(),e.clearInterval(connect.core.iframeRefreshInterval),connect.core.iframeRefreshInterval=null,connect.core.getPopupManager().clear(connect.MasterTopics.LOGIN_POPUP),(o.loginPopupAutoClose||o.loginOptions&&o.loginOptions.autoClose)&&connect.core.loginWindow&&(connect.core.loginWindow.close(),connect.core.loginWindow=null)})))})),o.onViewContact&&connect.core.onViewContact(o.onViewContact),s.onUpstream(connect.EventType.UPDATE_CONNECTED_CCPS,(function(e){connect.numberOfConnectedCCPs=e.length})),connect.core.softphoneParams=o.softphone}};var u=function(e,t,n,r){this.conduit=e,this.eventBus=t,this.synTimeout=n,this.ackTimeout=r,this.ackTimer=null,this.synTimer=null,this.ackSub=null};u.prototype.start=function(){var t=this;this.conduit.sendUpstream(connect.EventType.SYNCHRONIZE),this.ackSub=this.conduit.onUpstream(connect.EventType.ACKNOWLEDGE,(function(){this.unsubscribe(),e.clearTimeout(t.ackTimer),t.deferStart()})),this.ackTimer=e.setTimeout((function(){t.ackSub.unsubscribe(),t.eventBus.trigger(connect.EventType.ACK_TIMEOUT),t.deferStart()}),this.ackTimeout)},u.prototype.deferStart=function(){null==this.synTimer&&(this.synTimer=e.setTimeout(connect.hitch(this,this.start),this.synTimeout))};var c=function(){var e={initFailure:new Set,subscriptionUpdate:new Set,subscriptionFailure:new Set,topic:new Map,allMessage:new Set,connectionGain:new Set,connectionLost:new Set,connectionOpen:new Set,connectionClose:new Set},t=function(e,t){e.forEach((function(e){e(t)}))};connect.core.getUpstream().onUpstream(connect.WebSocketEvents.INIT_FAILURE,(function(){t(e.initFailure)})),connect.core.getUpstream().onUpstream(connect.WebSocketEvents.CONNECTION_OPEN,(function(n){t(e.connectionOpen,n)})),connect.core.getUpstream().onUpstream(connect.WebSocketEvents.CONNECTION_CLOSE,(function(n){t(e.connectionClose,n)})),connect.core.getUpstream().onUpstream(connect.WebSocketEvents.CONNECTION_GAIN,(function(){t(e.connectionGain)})),connect.core.getUpstream().onUpstream(connect.WebSocketEvents.CONNECTION_LOST,(function(n){t(e.connectionLost,n)})),connect.core.getUpstream().onUpstream(connect.WebSocketEvents.SUBSCRIPTION_UPDATE,(function(n){t(e.subscriptionUpdate,n)})),connect.core.getUpstream().onUpstream(connect.WebSocketEvents.SUBSCRIPTION_FAILURE,(function(n){t(e.subscriptionFailure,n)})),connect.core.getUpstream().onUpstream(connect.WebSocketEvents.ALL_MESSAGE,(function(n){t(e.allMessage,n),e.topic.has(n.topic)&&t(e.topic.get(n.topic),n)})),this.sendMessage=function(e){connect.core.getUpstream().sendUpstream(connect.WebSocketEvents.SEND,e)},this.onInitFailure=function(t){return connect.assertTrue(connect.isFunction(t),"method must be a function"),e.initFailure.add(t),function(){return e.initFailure.delete(t)}},this.onConnectionOpen=function(t){return connect.assertTrue(connect.isFunction(t),"method must be a function"),e.connectionOpen.add(t),function(){return e.connectionOpen.delete(t)}},this.onConnectionClose=function(t){return connect.assertTrue(connect.isFunction(t),"method must be a function"),e.connectionClose.add(t),function(){return e.connectionClose.delete(t)}},this.onConnectionGain=function(t){return connect.assertTrue(connect.isFunction(t),"method must be a function"),e.connectionGain.add(t),function(){return e.connectionGain.delete(t)}},this.onConnectionLost=function(t){return connect.assertTrue(connect.isFunction(t),"method must be a function"),e.connectionLost.add(t),function(){return e.connectionLost.delete(t)}},this.onSubscriptionUpdate=function(t){return connect.assertTrue(connect.isFunction(t),"method must be a function"),e.subscriptionUpdate.add(t),function(){return e.subscriptionUpdate.delete(t)}},this.onSubscriptionFailure=function(t){return connect.assertTrue(connect.isFunction(t),"method must be a function"),e.subscriptionFailure.add(t),function(){return e.subscriptionFailure.delete(t)}},this.subscribeTopics=function(e){connect.assertNotNull(e,"topics"),connect.assertTrue(connect.isArray(e),"topics must be a array"),connect.core.getUpstream().sendUpstream(connect.WebSocketEvents.SUBSCRIBE,e)},this.onMessage=function(t,n){return connect.assertNotNull(t,"topicName"),connect.assertTrue(connect.isFunction(n),"method must be a function"),e.topic.has(t)?e.topic.get(t).add(n):e.topic.set(t,new Set([n])),function(){return e.topic.get(t).delete(n)}},this.onAllMessage=function(t){return connect.assertTrue(connect.isFunction(t),"method must be a function"),e.allMessage.add(t),function(){return e.allMessage.delete(t)}}},l=function(e){this.bus=e,this.bus.subscribe(connect.AgentEvents.UPDATE,connect.hitch(this,this.updateAgentData))};l.prototype.updateAgentData=function(e){var t=this.agentData;this.agentData=e,null==t&&(connect.agent.initialized=!0,this.bus.trigger(connect.AgentEvents.INIT,new connect.Agent)),this.bus.trigger(connect.AgentEvents.REFRESH,new connect.Agent),this._fireAgentUpdateEvents(t)},l.prototype.getAgentData=function(){if(null==this.agentData)throw new connect.StateError("No agent data is available yet!");return this.agentData},l.prototype.getContactData=function(e){var t=this.getAgentData(),n=connect.find(t.snapshot.contacts,(function(t){return t.contactId===e}));if(null==n)throw new connect.StateError("Contact %s no longer exists.",e);return n},l.prototype.getConnectionData=function(e,t){var n=this.getContactData(e),r=connect.find(n.connections,(function(e){return e.connectionId===t}));if(null==r)throw new connect.StateError("Connection %s for contact %s no longer exists.",t,e);return r},l.prototype.getInstanceId=function(){return this.getAgentData().configuration.routingProfile.routingProfileId.match(/instance\/([0-9a-fA-F|-]+)\//)[1]},l.prototype.getAWSAccountId=function(){return this.getAgentData().configuration.routingProfile.routingProfileId.match(/:([0-9]+):instance/)[1]},l.prototype._diffContacts=function(e){var t={added:{},removed:{},common:{},oldMap:connect.index(null==e?[]:e.snapshot.contacts,(function(e){return e.contactId})),newMap:connect.index(this.agentData.snapshot.contacts,(function(e){return e.contactId}))};return connect.keys(t.oldMap).forEach((function(e){connect.contains(t.newMap,e)?t.common[e]=t.newMap[e]:t.removed[e]=t.oldMap[e]})),connect.keys(t.newMap).forEach((function(e){connect.contains(t.oldMap,e)||(t.added[e]=t.newMap[e])})),t},l.prototype._fireAgentUpdateEvents=function(e){var t=this,n=null,r=null==e?connect.AgentAvailStates.INIT:e.snapshot.state.name,i=this.agentData.snapshot.state.name,o=null==e?connect.AgentStateType.INIT:e.snapshot.state.type,a=this.agentData.snapshot.state.type;o!==a&&connect.core.getAgentRoutingEventGraph().getAssociations(this,o,a).forEach((function(e){t.bus.trigger(e,new connect.Agent)})),r!==i&&(this.bus.trigger(connect.AgentEvents.STATE_CHANGE,{agent:new connect.Agent,oldState:r,newState:i}),connect.core.getAgentStateEventGraph().getAssociations(this,r,i).forEach((function(e){t.bus.trigger(e,new connect.Agent)}))),n=null!==e?this._diffContacts(e):{added:connect.index(this.agentData.snapshot.contacts,(function(e){return e.contactId})),removed:{},common:{},oldMap:{},newMap:connect.index(this.agentData.snapshot.contacts,(function(e){return e.contactId}))},connect.values(n.added).forEach((function(e){t.bus.trigger(connect.ContactEvents.INIT,new connect.Contact(e.contactId)),t._fireContactUpdateEvents(e.contactId,connect.ContactStateType.INIT,e.state.type)})),connect.values(n.removed).forEach((function(e){t.bus.trigger(connect.ContactEvents.DESTROYED,new connect.ContactSnapshot(e)),t.bus.trigger(connect.core.getContactEventName(connect.ContactEvents.DESTROYED,e.contactId),new connect.ContactSnapshot(e)),t._unsubAllContactEventsForContact(e.contactId)})),connect.keys(n.common).forEach((function(e){t._fireContactUpdateEvents(e,n.oldMap[e].state.type,n.newMap[e].state.type)}))},l.prototype._fireContactUpdateEvents=function(e,t,n){var r=this;t!==n&&connect.core.getContactEventGraph().getAssociations(this,t,n).forEach((function(t){r.bus.trigger(t,new connect.Contact(e)),r.bus.trigger(connect.core.getContactEventName(t,e),new connect.Contact(e))})),r.bus.trigger(connect.ContactEvents.REFRESH,new connect.Contact(e)),r.bus.trigger(connect.core.getContactEventName(connect.ContactEvents.REFRESH,e),new connect.Contact(e))},l.prototype._unsubAllContactEventsForContact=function(e){var t=this;connect.values(connect.ContactEvents).forEach((function(n){t.bus.getSubscriptions(connect.core.getContactEventName(n,e)).map((function(e){e.unsubscribe()}))}))},connect.core.onViewContact=function(e){connect.core.getUpstream().onUpstream(connect.ContactEvents.VIEW,e)},connect.core.viewContact=function(e){connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.ContactEvents.VIEW,data:{contactId:e}})},connect.core.onAccessDenied=function(e){connect.core.getUpstream().onUpstream(connect.EventType.ACCESS_DENIED,e)},connect.core.onAuthFail=function(e){connect.core.getUpstream().onUpstream(connect.EventType.AUTH_FAIL,e)},connect.core.onSoftphoneSessionInit=function(e){connect.core.getUpstream().onUpstream(connect.ConnectionEvents.SESSION_INIT,e)},connect.core.onConfigure=function(e){connect.core.getUpstream().onUpstream(connect.ConfigurationEvents.CONFIGURE,e)},connect.core.onInitialized=function(e){connect.core.getEventBus().subscribe(connect.EventType.INIT,e)},connect.core.getContactEventName=function(e,t){if(connect.assertNotNull(e,"eventName"),connect.assertNotNull(t,"contactId"),!connect.contains(connect.values(connect.ContactEvents),e))throw new connect.ValueError("%s is not a valid contact event.",e);return connect.sprintf("%s::%s",e,t)},connect.core.getEventBus=function(){return connect.core.eventBus},connect.core.getWebSocketManager=function(){return connect.core.webSocketProvider},connect.core.getAgentDataProvider=function(){return connect.core.agentDataProvider},connect.core.getLocalTimestamp=function(){return connect.core.getAgentDataProvider().getAgentData().snapshot.localTimestamp},connect.core.getSkew=function(){return connect.core.getAgentDataProvider().getAgentData().snapshot.skew},connect.core.getAgentRoutingEventGraph=function(){return connect.core.agentRoutingEventGraph},connect.core.agentRoutingEventGraph=(new connect.EventGraph).assoc(connect.EventGraph.ANY,connect.AgentStateType.ROUTABLE,connect.AgentEvents.ROUTABLE).assoc(connect.EventGraph.ANY,connect.AgentStateType.NOT_ROUTABLE,connect.AgentEvents.NOT_ROUTABLE).assoc(connect.EventGraph.ANY,connect.AgentStateType.OFFLINE,connect.AgentEvents.OFFLINE),connect.core.getAgentStateEventGraph=function(){return connect.core.agentStateEventGraph},connect.core.agentStateEventGraph=(new connect.EventGraph).assoc(connect.EventGraph.ANY,connect.values(connect.AgentErrorStates),connect.AgentEvents.ERROR).assoc(connect.EventGraph.ANY,connect.AgentAvailStates.AFTER_CALL_WORK,connect.AgentEvents.ACW),connect.core.getContactEventGraph=function(){return connect.core.contactEventGraph},connect.core.contactEventGraph=(new connect.EventGraph).assoc(connect.EventGraph.ANY,connect.ContactStateType.INCOMING,connect.ContactEvents.INCOMING).assoc(connect.EventGraph.ANY,connect.ContactStateType.PENDING,connect.ContactEvents.PENDING).assoc(connect.EventGraph.ANY,connect.ContactStateType.CONNECTING,connect.ContactEvents.CONNECTING).assoc(connect.EventGraph.ANY,connect.ContactStateType.CONNECTED,connect.ContactEvents.CONNECTED).assoc(connect.ContactStateType.CONNECTING,connect.ContactStateType.ERROR,connect.ContactEvents.MISSED).assoc(connect.ContactStateType.INCOMING,connect.ContactStateType.ERROR,connect.ContactEvents.MISSED).assoc(connect.EventGraph.ANY,connect.ContactStateType.ENDED,connect.ContactEvents.ACW).assoc(connect.values(connect.CONTACT_ACTIVE_STATES),connect.values(connect.relativeComplement(connect.CONTACT_ACTIVE_STATES,connect.ContactStateType)),connect.ContactEvents.ENDED).assoc(connect.EventGraph.ANY,connect.values(connect.AgentErrorStates),connect.ContactEvents.ERROR).assoc(connect.ContactStateType.CONNECTING,connect.ContactStateType.MISSED,connect.ContactEvents.MISSED),connect.core.getClient=function(){if(!connect.core.client)throw new connect.StateError("The connect core has not been initialized!");return connect.core.client},connect.core.client=null,connect.core.getAgentAppClient=function(){if(!connect.core.agentAppClient)throw new connect.StateError("The connect AgentApp Client has not been initialized!");return connect.core.agentAppClient},connect.core.agentAppClient=null,connect.core.getMasterClient=function(){if(!connect.core.masterClient)throw new connect.StateError("The connect master client has not been initialized!");return connect.core.masterClient},connect.core.masterClient=null,connect.core.getSoftphoneManager=function(){return connect.core.softphoneManager},connect.core.softphoneManager=null,connect.core.getNotificationManager=function(){return connect.core.notificationManager||(connect.core.notificationManager=new connect.NotificationManager),connect.core.notificationManager},connect.core.notificationManager=null,connect.core.getPopupManager=function(){return connect.core.popupManager},connect.core.popupManager=new connect.PopupManager,connect.core.getUpstream=function(){if(!connect.core.upstream)throw new connect.StateError("There is no upstream conduit!");return connect.core.upstream},connect.core.upstream=null,connect.core.AgentDataProvider=l}(),function(){var e=this,t=e.connect||{};e.connect=t,e.lily=t;var n=function(n){var r=this;if(this._prevContactId=null,t.assertNotNull(n,"ringtoneConfig"),!n.ringtoneUrl)throw new Error("ringtoneUrl is required!");e.Audio&&"undefined"!==typeof e.Promise?this._playableAudioPromise=new Promise((function(e,t){r._audio=new Audio(n.ringtoneUrl),r._audio.loop=!0,r._audio.addEventListener("canplay",(function(){r._audioPlayable=!0,e(r._audio)}))})):(this._audio=null,t.getLog().error("Unable to provide a ringtone.").sendInternalLogToServer()),r._driveRingtone()};n.prototype._driveRingtone=function(){throw new Error("Not implemented.")},n.prototype._startRingtone=function(e){this._audio&&(this._audio.play().catch((function(t){this._publishTelemetryEvent("Ringtone Playback Failure",e)})),this._publishTelemetryEvent("Ringtone Start",e))},n.prototype._stopRingtone=function(e){this._audio&&(this._audio.pause(),this._audio.currentTime=0,this._publishTelemetryEvent("Ringtone Stop",e))},n.prototype.stopRingtone=function(){this._stopRingtone()},n.prototype._ringtoneSetup=function(e){var n=this;t.ifMaster(t.MasterTopics.RINGTONE,(function(){n._startRingtone(e),n._prevContactId=e.getContactId(),e.onConnected(lily.hitch(n,n._stopRingtone)),e.onAccepted(lily.hitch(n,n._stopRingtone)),e.onEnded(lily.hitch(n,n._stopRingtone)),e.onRefresh((function(e){e.getStatus().type!==t.ContactStatusType.CONNECTING&&e.getStatus().type!==t.ContactStatusType.INCOMING&&n._stopRingtone()}))}))},n.prototype._publishTelemetryEvent=function(e,n){n&&n.getContactId()&&t.publishMetric({name:e,contactId:n.getContactId()})},n.prototype.setOutputDevice=function(t){return this._playableAudioPromise?Promise.race([this._playableAudioPromise,new Promise((function(t,n){e.setTimeout((function(){n("Timed out waiting for playable audio")}),3e3)}))]).then((function(e){return e.setSinkId?Promise.resolve(e.setSinkId(t)):Promise.reject("Not supported")})):e.Promise?Promise.reject("Not eligible ringtone owner"):void 0};var r=function(e){n.call(this,e)};(r.prototype=Object.create(n.prototype)).constructor=r,r.prototype._driveRingtone=function(){var e=this,n=function(t){t.getType()===lily.ContactType.VOICE&&t.isSoftphoneCall()&&t.isInbound()&&(e._ringtoneSetup(t),e._publishTelemetryEvent("Ringtone Connecting",t))};t.contact((function(e){e.onConnecting(n)})),(new t.Agent).getContacts().forEach((function(e){e.getStatus().type===t.ContactStatusType.CONNECTING&&n(e)}))};var i=function(e){n.call(this,e)};(i.prototype=Object.create(n.prototype)).constructor=i,i.prototype._driveRingtone=function(){var e=this,n=function(t){t.getType()===lily.ContactType.CHAT&&t.isInbound()&&(e._ringtoneSetup(t),e._publishTelemetryEvent("Chat Ringtone Connecting",t))};t.contact((function(e){e.onConnecting(n)}))};var o=function(e){n.call(this,e)};(o.prototype=Object.create(n.prototype)).constructor=o,o.prototype._driveRingtone=function(){var e=this,n=function(t){t.getType()===lily.ContactType.TASK&&t.isInbound()&&(e._ringtoneSetup(t),e._publishTelemetryEvent("Task Ringtone Connecting",t))};t.contact((function(e){e.onConnecting(n)}))};var a=function(e){n.call(this,e)};(a.prototype=Object.create(n.prototype)).constructor=a,a.prototype._driveRingtone=function(){var e=this;t.contact((function(t){t.onIncoming((function(){t.getType()===lily.ContactType.QUEUE_CALLBACK&&(e._ringtoneSetup(t),e._publishTelemetryEvent("Callback Ringtone Connecting",t))}))}))},t.VoiceRingtoneEngine=r,t.ChatRingtoneEngine=i,t.TaskRingtoneEngine=o,t.QueueCallbackRingtoneEngine=a}(),function(){var e=this;connect=e.connect||{},e.connect=connect,e.lily=connect,e.ccpVersion="V2";var t={};t[connect.SoftphoneCallType.AUDIO_ONLY]="Audio",t[connect.SoftphoneCallType.VIDEO_ONLY]="Video",t[connect.SoftphoneCallType.AUDIO_VIDEO]="AudioVideo",t[connect.SoftphoneCallType.NONE]="None";var n="audio_input",r="audio_output";({})[connect.ContactType.VOICE]="Voice";var i=[],o={},a={},s=null,u=null,c=null,l=connect.SoftphoneErrorTypes,f={},h=connect.randomId(),d=function(e){return new Promise((function(t,n){connect.core.getClient().call(connect.ClientMethods.CREATE_TRANSPORT,e,{success:function(e){t(e.softphoneTransport.softphoneMediaConnections)},failure:function(e){e.message&&e.message.includes("SoftphoneConnectionLimitBreachedException")&&x("multiple_softphone_active_sessions","Number of active sessions are more then allowed limit.",""),n(Error("requestIceAccess failed"))},authFailure:function(){n(Error("Authentication failed while requestIceAccess"))},accessDenied:function(){n(Error("Access Denied while requestIceAccess"))}})}))},p=function(e){var t=connect.core.getUpstream(),n=e.getAgentConnection();if(n){var r=n.getSoftphoneMediaInfo();r?!0===r.autoAccept?(c.info("Auto-accept is enabled, sending out Accepted event to stop ringtone..").sendInternalLogToServer(),t.sendUpstream(connect.EventType.BROADCAST,{event:connect.ContactEvents.ACCEPTED,data:new connect.Contact(e.contactId)}),t.sendUpstream(connect.EventType.BROADCAST,{event:connect.core.getContactEventName(connect.ContactEvents.ACCEPTED,e.contactId),data:new connect.Contact(e.contactId)})):c.info("Auto-accept is disabled, ringtone will be stopped by user action.").sendInternalLogToServer():c.info("Not able to retrieve the auto-accept setting from null SoftphoneMediaInfo, ignoring event publish..").sendInternalLogToServer()}else c.info("Not able to retrieve the auto-accept setting from null AgentConnection, ignoring event publish..").sendInternalLogToServer()},m=function(){connect.core.getEventBus().subscribe(connect.EventType.MUTE,b)},g=function(){connect.core.getEventBus().subscribe(connect.ConfigurationEvents.SET_SPEAKER_DEVICE,w)},v=function(){connect.core.getEventBus().subscribe(connect.ConfigurationEvents.SET_MICROPHONE_DEVICE,S)},y=function(e){delete f[e],connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.AgentEvents.MUTE_TOGGLE,data:{muted:!1}})},b=function(e){var t;if(0!==connect.keys(f).length){for(var n in e&&void 0!==e.mute&&(t=e.mute),f)if(f.hasOwnProperty(n)){var r=f[n].stream;if(r){var i=r.getAudioTracks()[0];void 0!==t?(i.enabled=!t,f[n].muted=t,t?c.info("Agent has muted the contact, connectionId - "+n).sendInternalLogToServer():c.info("Agent has unmuted the contact, connectionId - "+n).sendInternalLogToServer()):t=f[n].muted||!1}}connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.AgentEvents.MUTE_TOGGLE,data:{muted:t}})}},w=function(e){if(0!==connect.keys(f).length&&e&&e.deviceId){var t=e.deviceId,n=document.getElementById("remote-audio");try{c.info("Trying to set speaker to device "+t),n&&"function"===typeof n.setSinkId&&n.setSinkId(t)}catch(r){c.error("Failed to set speaker to device "+t)}connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.ConfigurationEvents.SPEAKER_DEVICE_CHANGED,data:{deviceId:t}})}},S=function(e){if(0!==connect.keys(f).length&&e&&e.deviceId){var t=e.deviceId,n=connect.core.getSoftphoneManager();try{navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:t}}}).then((function(e){var t=e.getAudioTracks()[0];for(var r in f)if(f.hasOwnProperty(r)){f[r].stream;n.getSession(r)._pc.getSenders()[0].replaceTrack(t).then((function(){n.replaceLocalMediaTrack(r,t)}))}}))}catch(r){c.error("Failed to set microphone device "+t)}connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.ConfigurationEvents.MICROPHONE_DEVICE_CHANGED,data:{deviceId:t}})}},_=function(e,t){if(t===connect.RTCErrors.ICE_COLLECTION_TIMEOUT){for(var n="\n",r=0;r0?t.success(e):t.failure(l.MICROPHONE_NOT_SHARED)}),(function(e){t.failure(l.MICROPHONE_NOT_SHARED)})),r}t.failure(l.UNSUPPORTED_BROWSER)},x=function(e,t,n){c.error("Softphone error occurred : ",e,t||"").sendInternalLogToServer(),connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.AgentEvents.SOFTPHONE_ERROR,data:new connect.SoftphoneError(e,t,n)})},k=function(e,t){O("Softphone Session Failed",e,{failedReason:t})},O=function(e,t,n){t&&connect.publishMetric({name:e,contactId:t,data:n})},C=function(e,t,n){O(e,t,[{name:"AgentConnectionId",value:n}]),c.info("Publish multiple session error metrics",e,"contactId "+t,"agent connectionId "+n).sendInternalLogToServer()},A=function(){return!!(connect.isOperaBrowser()&&connect.getOperaBrowserVersion()>17)||(!!(connect.isChromeBrowser()&&connect.getChromeBrowserVersion()>22)||!!(connect.isFirefoxBrowser()&&connect.getFirefoxBrowserVersion()>21))},T=function(e){var t=i.slice();i=[],t.length>0&&e.sendSoftphoneMetrics(t,{success:function(){c.info("sendSoftphoneMetrics success"+JSON.stringify(t)).sendInternalLogToServer()},failure:function(e){c.error("sendSoftphoneMetrics failed.").withObject(e).sendInternalLogToServer()}})},I=function(e){s=window.setInterval((function(){e.getUserAudioStats().then((function(e){var t=o;o=e,i.push(j(o,t,n))}),(function(e){c.debug("Failed to get user audio stats.",e).sendInternalLogToServer()})),e.getRemoteAudioStats().then((function(e){var t=a;a=e,i.push(j(a,t,r))}),(function(e){c.debug("Failed to get remote audio stats.",e).sendInternalLogToServer()}))}),1e3)},P=function(e){u=window.setInterval((function(){T(e)}),3e4)},R=function(){o=null,a=null,i=[],s=null,u=null},j=function(e,t,n){if(t&&e){var r=e.packetsLost>t.packetsLost?e.packetsLost-t.packetsLost:0,i=e.packetsCount>t.packetsCount?e.packetsCount-t.packetsCount:0;return new D(e.timestamp,r,i,n,e.audioLevel,e.jbMilliseconds,e.rttMilliseconds)}return new D(e.timestamp,e.packetsLost,e.packetsCount,n,e.audioLevel,e.jbMilliseconds,e.rttMilliseconds)},N=function(e){return null!==e&&window.clearInterval(e),null},L=function(e,t){s=N(s),u=N(u),function(e,t,i,o){t.streamStats=[U(i,n),U(o,r)];var a={callStartTime:t.sessionStartTime,callEndTime:t.sessionEndTime,gumTimeMillis:t.gumTimeMillis,initializationTimeMillis:t.initializationTimeMillis,iceCollectionTimeMillis:t.iceCollectionTimeMillis,signallingConnectTimeMillis:t.signallingConnectTimeMillis,handshakingTimeMillis:t.handshakingTimeMillis,preTalkingTimeMillis:t.preTalkingTimeMillis,talkingTimeMillis:t.talkingTimeMillis,cleanupTimeMillis:t.cleanupTimeMillis,iceCollectionFailure:t.iceCollectionFailure,signallingConnectionFailure:t.signallingConnectionFailure,handshakingFailure:t.handshakingFailure,gumOtherFailure:t.gumOtherFailure,gumTimeoutFailure:t.gumTimeoutFailure,createOfferFailure:t.createOfferFailure,setLocalDescriptionFailure:t.setLocalDescriptionFailure,userBusyFailure:t.userBusyFailure,invalidRemoteSDPFailure:t.invalidRemoteSDPFailure,noRemoteIceCandidateFailure:t.noRemoteIceCandidateFailure,setRemoteDescriptionFailure:t.setRemoteDescriptionFailure,softphoneStreamStatistics:t.streamStats};e.sendSoftphoneReport(a,{success:function(){c.info("sendSoftphoneReport success"+JSON.stringify(a)).sendInternalLogToServer()},failure:function(e){c.error("sendSoftphoneReport failed.").withObject(e).sendInternalLogToServer()}})}(e,t,U(o,n),U(a,r)),T(e)},D=function(e,t,n,r,i,o,a){this.softphoneStreamType=r,this.timestamp=e,this.packetsLost=t,this.packetsCount=n,this.audioLevel=i,this.jitterBufferMillis=o,this.roundTripTimeMillis=a},U=function(e,t){return new D((e=e||{}).timestamp,e.packetsLost,e.packetsCount,t,e.audioLevel)},B=function(e){this._originalLogger=e;var t=this;this._tee=function(e,n){return function(){var e=Array.prototype.slice.call(arguments[0]),r="";return e.forEach((function(){r+=" %s"})),n.apply(t._originalLogger,[connect.LogComponent.SOFTPHONE,r].concat(e))}}};B.prototype.debug=function(){return this._tee(1,this._originalLogger.debug)(arguments)},B.prototype.info=function(){return this._tee(2,this._originalLogger.info)(arguments)},B.prototype.log=function(){return this._tee(3,this._originalLogger.log)(arguments)},B.prototype.warn=function(){return this._tee(4,this._originalLogger.warn)(arguments)},B.prototype.error=function(){return this._tee(5,this._originalLogger.error)(arguments)},connect.SoftphoneManager=function(e){var t,n=this;c=new B(connect.getLog()),connect.RtcPeerConnectionFactory&&(t=new connect.RtcPeerConnectionFactory(c,connect.core.getWebSocketManager(),h,connect.hitch(n,d,{transportType:"softphone",softphoneClientId:h}),connect.hitch(n,x))),A()||x(l.UNSUPPORTED_BROWSER,"Connect does not support this browser. Some functionality may not work. ","");M({success:function(e){connect.isFirefoxBrowser()&&connect.core.setSoftphoneUserMediaStream(e)},failure:function(e){x(e,"Your microphone is not enabled in your browser. ","")}});m(),g(),v(),this.ringtoneEngine=null;var r={},i={};this.onInitContactSub={},this.onInitContactSub.unsubscribe=function(){};var o=!1,a=null,s=null,u=function(){o=!1,a=null,s=null};this.getSession=function(e){return r[e]},this.replaceLocalMediaTrack=function(e,t){var n=f[e].stream;if(n){var r=n.getAudioTracks()[0];r.enabled=!1,n.removeTrack(r),n.addTrack(t)}};var b=function(e){if(r.hasOwnProperty(e)){var t=r[e];new Promise((function(n,o){delete r[e],delete i[e],t.hangup()})).catch((function(t){lily.getLog().warn("Clean up the session locally "+e,t.message).sendInternalLogToServer()}))}};this.startSession=function(e,n){var l=o?a:e,h=o?s:n;if(l&&h){u(),i[h]=!0,c.info("Softphone call detected:","contactId "+l.getContactId(),"agent connectionId "+h).sendInternalLogToServer(),function(e){if(Object.keys(e).length>0){for(var t in e)e.hasOwnProperty(t)&&(C("MultiSessionHangUp",e[t].callId,t),b(t));throw new Error("duplicate session detected, refusing to setup new connection")}}(r),l.getStatus().type===connect.ContactStatusType.CONNECTING&&O("Softphone Connecting",l.getContactId()),R();var d,m=l.getAgentConnection().getSoftphoneMediaInfo(),g=E(m.callConfigJson);g.useWebSocketProvider&&(d=connect.core.getWebSocketManager());var v=new connect.RTCSession(g.signalingEndpoint,g.iceServers,m.callContextToken,c,l.getContactId(),h,d);r[h]=v,connect.core.getSoftphoneUserMediaStream()&&(v.mediaStream=connect.core.getSoftphoneUserMediaStream()),connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.ConnectionEvents.SESSION_INIT,data:{connectionId:h}}),v.onSessionFailed=function(e,t){delete r[h],delete i[h],_(e,t),k(l.getContactId(),t),L(l,e.sessionReport)},v.onSessionConnected=function(e){O("Softphone Session Connected",l.getContactId()),connect.becomeMaster(connect.MasterTopics.SEND_LOGS),I(e),P(l),p(l)},v.onSessionCompleted=function(e){O("Softphone Session Completed",l.getContactId()),delete r[h],delete i[h],L(l,e.sessionReport),y(h)},v.onLocalStreamAdded=function(e,t){f[h]={stream:t},connect.core.getUpstream().sendUpstream(connect.EventType.BROADCAST,{event:connect.AgentEvents.LOCAL_MEDIA_STREAM_CREATED,data:{connectionId:h}})},v.remoteAudioElement=document.getElementById("remote-audio"),t?v.connect(t.get(g.iceServers)):v.connect()}};var w=function(e,t){r[t]&&function(e){return e.getStatus().type===connect.ContactStatusType.ENDED||e.getStatus().type===connect.ContactStatusType.ERROR||e.getStatus().type===connect.ContactStatusType.MISSED}(e)&&(b(t),u()),!e.isSoftphoneCall()||i[t]||e.getStatus().type!==connect.ContactStatusType.CONNECTING&&e.getStatus().type!==connect.ContactStatusType.INCOMING||(connect.isFirefoxBrowser()&&connect.hasOtherConnectedCCPs()?function(e,t){o=!0,a=e,s=t}(e,t):n.startSession(e,t))},S=function(e){var t=e.getAgentConnection().connectionId;c.info("Contact detected:","contactId "+e.getContactId(),"agent connectionId "+t).sendInternalLogToServer(),i[t]||e.onRefresh((function(){w(e,t)}))};n.onInitContactSub=connect.contact(S),(new connect.Agent).getContacts().forEach((function(e){var t=e.getAgentConnection().connectionId;c.info("Contact exist in the snapshot. Reinitiate the Contact and RTC session creation for contactId"+e.getContactId(),"agent connectionId "+t).sendInternalLogToServer(),S(e),w(e,t)}))}}(),function(){var e=this;connect=e.connect||{},e.connect=connect,e.lily=connect,connect.worker={};var t=function(){this.topicMasterMap={}};t.prototype.getMaster=function(e){return connect.assertNotNull(e,"topic"),this.topicMasterMap[e]||null},t.prototype.setMaster=function(e,t){connect.assertNotNull(e,"topic"),connect.assertNotNull(t,"id"),this.topicMasterMap[e]=t},t.prototype.removeMaster=function(e){connect.assertNotNull(e,"id");var t=this;connect.entries(this.topicMasterMap).filter((function(t){return t.value===e})).forEach((function(e){delete t.topicMasterMap[e.key]}))};var n=function(e){connect.ClientBase.call(this),this.conduit=e};(n.prototype=Object.create(connect.ClientBase.prototype)).constructor=n,n.prototype._callImpl=function(e,t,n){var r=this,i=(new Date).getTime();connect.containsValue(connect.AgentAppClientMethods,e)?connect.core.getAgentAppClient()._callImpl(e,t,{success:function(t){r._recordAPILatency(e,i),n.success(t)},failure:function(t,o){r._recordAPILatency(e,i,t),n.failure(t,o)}}):connect.core.getClient()._callImpl(e,t,{success:function(t){r._recordAPILatency(e,i),n.success(t)},failure:function(t,o){r._recordAPILatency(e,i,t),n.failure(t,o)},authFailure:function(){r._recordAPILatency(e,i),n.authFailure()},accessDenied:function(){n.accessDenied&&n.accessDenied()}})},n.prototype._recordAPILatency=function(e,t,n){var r=(new Date).getTime()-t;this._sendAPIMetrics(e,r,n)},n.prototype._sendAPIMetrics=function(e,t,n){this.conduit.sendDownstream(connect.EventType.API_METRIC,{name:e,time:t,dimensions:[{name:"Category",value:"API"}],error:n})};var r=function(){var r=this;this.multiplexer=new connect.StreamMultiplexer,this.conduit=new connect.Conduit("AmazonConnectSharedWorker",null,this.multiplexer),this.client=new n(this.conduit),this.timeout=null,this.agent=null,this.nextToken=null,this.initData={},this.portConduitMap={},this.masterCoord=new t,this.logsBuffer=[],this.suppress=!1,this.forceOffline=!1;var i=null;connect.rootLogger=new connect.DownstreamConduitLogger(this.conduit),this.conduit.onDownstream(connect.EventType.SEND_LOGS,(function(e){connect.getLog().pushLogsDownstream(e),r.logsBuffer=r.logsBuffer.concat(e),r.logsBuffer.length>400&&r.handleSendLogsRequest(r.logsBuffer)})),this.conduit.onDownstream(connect.EventType.CONFIGURE,(function(t){t.authToken&&t.authToken!==r.initData.authToken&&(r.initData=t,connect.core.init(t),i?connect.getLog().info("Not Initializing a new WebsocketManager instance, since one already exists").sendInternalLogToServer():(connect.getLog().info("Creating a new Websocket connection for CCP").sendInternalLogToServer(),connect.WebSocketManager.setGlobalConfig({loggerConfig:{logger:connect.getLog()}}),(i=connect.WebSocketManager.create()).onInitFailure((function(){r.conduit.sendDownstream(connect.WebSocketEvents.INIT_FAILURE)})),i.onConnectionOpen((function(e){r.conduit.sendDownstream(connect.WebSocketEvents.CONNECTION_OPEN,e)})),i.onConnectionClose((function(e){r.conduit.sendDownstream(connect.WebSocketEvents.CONNECTION_CLOSE,e)})),i.onConnectionGain((function(){r.conduit.sendDownstream(connect.AgentEvents.WEBSOCKET_CONNECTION_GAINED),r.conduit.sendDownstream(connect.WebSocketEvents.CONNECTION_GAIN)})),i.onConnectionLost((function(e){r.conduit.sendDownstream(connect.AgentEvents.WEBSOCKET_CONNECTION_LOST,e),r.conduit.sendDownstream(connect.WebSocketEvents.CONNECTION_LOST,e)})),i.onSubscriptionUpdate((function(e){r.conduit.sendDownstream(connect.WebSocketEvents.SUBSCRIPTION_UPDATE,e)})),i.onSubscriptionFailure((function(e){r.conduit.sendDownstream(connect.WebSocketEvents.SUBSCRIPTION_FAILURE,e)})),i.onAllMessage((function(e){r.conduit.sendDownstream(connect.WebSocketEvents.ALL_MESSAGE,e)})),r.conduit.onDownstream(connect.WebSocketEvents.SEND,(function(e){i.sendMessage(e)})),r.conduit.onDownstream(connect.WebSocketEvents.SUBSCRIBE,(function(e){i.subscribeTopics(e)})),i.init(connect.hitch(r,r.getWebSocketUrl)).then((function(t){t&&!t.webSocketConnectionFailed?(connect.getLog().info("Kicking off agent polling").sendInternalLogToServer(),r.pollForAgent(),connect.getLog().info("Kicking off config polling").sendInternalLogToServer(),r.pollForAgentConfiguration({repeatForever:!0}),connect.getLog().info("Kicking off auth token polling").sendInternalLogToServer(),e.setInterval(connect.hitch(r,r.checkAuthToken),3e5)):connect.webSocketInitFailed||(r.conduit.sendDownstream(connect.WebSocketEvents.INIT_FAILURE),connect.webSocketInitFailed=!0)}))))})),this.conduit.onDownstream(connect.EventType.TERMINATE,(function(){r.handleSendLogsRequest(r.logsBuffer),connect.core.terminate(),r.conduit.sendDownstream(connect.EventType.TERMINATED)})),this.conduit.onDownstream(connect.EventType.SYNCHRONIZE,(function(){r.conduit.sendDownstream(connect.EventType.ACKNOWLEDGE)})),this.conduit.onDownstream(connect.EventType.BROADCAST,(function(e){r.conduit.sendDownstream(e.event,e.data)})),e.onconnect=function(e){var t=e.ports[0],n=new connect.PortStream(t);r.multiplexer.addStream(n),t.start();var i=new connect.Conduit(n.getId(),null,n);i.sendDownstream(connect.EventType.ACKNOWLEDGE,{id:n.getId()}),r.portConduitMap[n.getId()]=i,r.conduit.sendDownstream(connect.EventType.UPDATE_CONNECTED_CCPS,{length:Object.keys(r.portConduitMap).length}),null!==r.agent&&r.updateAgent(),i.onDownstream(connect.EventType.API_REQUEST,connect.hitch(r,r.handleAPIRequest,i)),i.onDownstream(connect.EventType.MASTER_REQUEST,connect.hitch(r,r.handleMasterRequest,i,n.getId())),i.onDownstream(connect.EventType.RELOAD_AGENT_CONFIGURATION,connect.hitch(r,r.pollForAgentConfiguration)),i.onDownstream(connect.EventType.CLOSE,(function(){r.multiplexer.removeStream(n),delete r.portConduitMap[n.getId()],r.masterCoord.removeMaster(n.getId()),r.conduit.sendDownstream(connect.EventType.UPDATE_CONNECTED_CCPS,{length:Object.keys(r.portConduitMap).length})}))}};r.prototype.pollForAgent=function(){var t=this,n=connect.hitch(t,t.handleAuthFail);this.client.call(connect.ClientMethods.GET_AGENT_SNAPSHOT,{nextToken:t.nextToken,timeout:3e4},{success:function(n){try{t.agent=t.agent||{},t.agent.snapshot=n.snapshot,t.agent.snapshot.localTimestamp=connect.now(),t.agent.snapshot.skew=t.agent.snapshot.snapshotTimestamp-t.agent.snapshot.localTimestamp,t.nextToken=n.nextToken,connect.getLog().trace("GET_AGENT_SNAPSHOT succeeded.").withObject(n).sendInternalLogToServer(),t.updateAgent()}catch(r){connect.getLog().error("Long poll failed to update agent.").withObject(n).withException(r).sendInternalLogToServer()}finally{e.setTimeout(connect.hitch(t,t.pollForAgent),100)}},failure:function(n,r){try{connect.getLog().error("Failed to get agent data.").sendInternalLogToServer().withObject({err:n,data:r})}finally{e.setTimeout(connect.hitch(t,t.pollForAgent),5e3)}},authFailure:function(){n()},accessDenied:connect.hitch(t,t.handleAccessDenied)})},r.prototype.pollForAgentConfiguration=function(t){var n=this,r=t||{},i=connect.hitch(n,n.handleAuthFail);this.client.call(connect.ClientMethods.GET_AGENT_CONFIGURATION,{},{success:function(t){var i=t.configuration;n.pollForAgentPermissions(i),n.pollForAgentStates(i),n.pollForDialableCountryCodes(i),n.pollForRoutingProfileQueues(i),r.repeatForever&&e.setTimeout(connect.hitch(n,n.pollForAgentConfiguration,r),3e4)},failure:function(t,i){try{connect.getLog().error("Failed to fetch agent configuration data.").sendInternalLogToServer().withObject({err:t,data:i})}finally{r.repeatForever&&e.setTimeout(connect.hitch(n,n.pollForAgentConfiguration),3e4,r)}},authFailure:function(){i()},accessDenied:connect.hitch(n,n.handleAccessDenied)})},r.prototype.pollForAgentStates=function(e,t){var n=this,r=t||{};r.maxResults=r.maxResults||connect.DEFAULT_BATCH_SIZE,this.client.call(connect.ClientMethods.GET_AGENT_STATES,{nextToken:r.nextToken||null,maxResults:r.maxResults},{success:function(t){t.nextToken?n.pollForAgentStates(e,{states:(r.states||[]).concat(t.states),nextToken:t.nextToken,maxResults:r.maxResults}):(e.agentStates=(r.states||[]).concat(t.states),n.updateAgentConfiguration(e))},failure:function(e,t){connect.getLog().error("Failed to fetch agent states list.").sendInternalLogToServer().withObject({err:e,data:t})},authFailure:connect.hitch(n,n.handleAuthFail),accessDenied:connect.hitch(n,n.handleAccessDenied)})},r.prototype.pollForAgentPermissions=function(e,t){var n=this,r=t||{};r.maxResults=r.maxResults||connect.DEFAULT_BATCH_SIZE,this.client.call(connect.ClientMethods.GET_AGENT_PERMISSIONS,{nextToken:r.nextToken||null,maxResults:r.maxResults},{success:function(t){t.nextToken?n.pollForAgentPermissions(e,{permissions:(r.permissions||[]).concat(t.permissions),nextToken:t.nextToken,maxResults:r.maxResults}):(e.permissions=(r.permissions||[]).concat(t.permissions),n.updateAgentConfiguration(e))},failure:function(e,t){connect.getLog().error("Failed to fetch agent permissions list.").sendInternalLogToServer().withObject({err:e,data:t})},authFailure:connect.hitch(n,n.handleAuthFail),accessDenied:connect.hitch(n,n.handleAccessDenied)})},r.prototype.pollForDialableCountryCodes=function(e,t){var n=this,r=t||{};r.maxResults=r.maxResults||connect.DEFAULT_BATCH_SIZE,this.client.call(connect.ClientMethods.GET_DIALABLE_COUNTRY_CODES,{nextToken:r.nextToken||null,maxResults:r.maxResults},{success:function(t){t.nextToken?n.pollForDialableCountryCodes(e,{countryCodes:(r.countryCodes||[]).concat(t.countryCodes),nextToken:t.nextToken,maxResults:r.maxResults}):(e.dialableCountries=(r.countryCodes||[]).concat(t.countryCodes),n.updateAgentConfiguration(e))},failure:function(e,t){connect.getLog().error("Failed to fetch dialable country codes list.").sendInternalLogToServer().withObject({err:e,data:t})},authFailure:connect.hitch(n,n.handleAuthFail),accessDenied:connect.hitch(n,n.handleAccessDenied)})},r.prototype.pollForRoutingProfileQueues=function(e,t){var n=this,r=t||{};r.maxResults=r.maxResults||connect.DEFAULT_BATCH_SIZE,this.client.call(connect.ClientMethods.GET_ROUTING_PROFILE_QUEUES,{routingProfileARN:e.routingProfile.routingProfileARN,nextToken:r.nextToken||null,maxResults:r.maxResults},{success:function(t){t.nextToken?n.pollForRoutingProfileQueues(e,{countryCodes:(r.queues||[]).concat(t.queues),nextToken:t.nextToken,maxResults:r.maxResults}):(e.routingProfile.queues=(r.queues||[]).concat(t.queues),n.updateAgentConfiguration(e))},failure:function(e,t){connect.getLog().error("Failed to fetch routing profile queues list.").sendInternalLogToServer().withObject({err:e,data:t})},authFailure:connect.hitch(n,n.handleAuthFail),accessDenied:connect.hitch(n,n.handleAccessDenied)})},r.prototype.handleAPIRequest=function(e,t){var n=this;this.client.call(t.method,t.params,{success:function(n){var r=connect.EventFactory.createResponse(connect.EventType.API_RESPONSE,t,n);e.sendDownstream(r.event,r)},failure:function(r,i){var o=connect.EventFactory.createResponse(connect.EventType.API_RESPONSE,t,i,JSON.stringify(r));e.sendDownstream(o.event,o),connect.getLog().error("'%s' API request failed",t.method).withObject({request:n.filterAuthToken(t),response:o}).withException(r).sendInternalLogToServer()},authFailure:connect.hitch(n,n.handleAuthFail)})},r.prototype.handleMasterRequest=function(e,t,n){var r=this.conduit,i=null;switch(n.method){case connect.MasterMethods.BECOME_MASTER:var o=this.masterCoord.getMaster(n.params.topic),a=Boolean(o)&&o!==t;this.masterCoord.setMaster(n.params.topic,t),i=connect.EventFactory.createResponse(connect.EventType.MASTER_RESPONSE,n,{masterId:t,takeOver:a,topic:n.params.topic}),a&&r.sendDownstream(i.event,i);break;case connect.MasterMethods.CHECK_MASTER:(o=this.masterCoord.getMaster(n.params.topic))||(this.masterCoord.setMaster(n.params.topic,t),o=t),i=connect.EventFactory.createResponse(connect.EventType.MASTER_RESPONSE,n,{masterId:o,isMaster:t===o,topic:n.params.topic});break;default:throw new Error("Unknown master method: "+n.method)}e.sendDownstream(i.event,i)},r.prototype.updateAgentConfiguration=function(e){e.permissions&&e.dialableCountries&&e.agentStates&&e.routingProfile.queues?(this.agent=this.agent||{},this.agent.configuration=e,this.updateAgent()):connect.getLog().trace("Waiting to update agent configuration until all config data has been fetched.").sendInternalLogToServer()},r.prototype.updateAgent=function(){this.agent?this.agent.snapshot?this.agent.configuration?(this.agent.snapshot.status=this.agent.state,this.agent.snapshot.contacts&&this.agent.snapshot.contacts.length>1&&this.agent.snapshot.contacts.sort((function(e,t){return e.state.timestamp.getTime()-t.state.timestamp.getTime()})),this.agent.snapshot.contacts.forEach((function(e){e.status=e.state,e.connections.forEach((function(e){e.address=e.endpoint}))})),this.agent.configuration.routingProfile.defaultOutboundQueue.queueId=this.agent.configuration.routingProfile.defaultOutboundQueue.queueARN,this.agent.configuration.routingProfile.queues.forEach((function(e){e.queueId=e.queueARN})),this.agent.snapshot.contacts.forEach((function(e){void 0!==e.queue&&(e.queue.queueId=e.queue.queueARN)})),this.agent.configuration.routingProfile.routingProfileId=this.agent.configuration.routingProfile.routingProfileARN,this.conduit.sendDownstream(connect.AgentEvents.UPDATE,this.agent)):connect.getLog().trace("Waiting to update agent until the agent configuration is available.").sendInternalLogToServer():connect.getLog().trace("Waiting to update agent until the agent snapshot is available.").sendInternalLogToServer():connect.getLog().trace("Waiting to update agent until the agent has been fully constructed.").sendInternalLogToServer()},r.prototype.getWebSocketUrl=function(){var e=this,t=connect.core.getClient(),n=connect.hitch(e,e.handleAuthFail),r=connect.hitch(e,e.handleAccessDenied);return new Promise((function(e,i){t.call(connect.ClientMethods.CREATE_TRANSPORT,{transportType:connect.TRANSPORT_TYPES.WEB_SOCKET},{success:function(t){connect.getLog().info("getWebSocketUrl succeeded").sendInternalLogToServer(),e(t)},failure:function(e,t){connect.getLog().error("getWebSocketUrl failed").sendInternalLogToServer().withObject({err:e,data:t}),i(Error("getWebSocketUrl failed"))},authFailure:function(){connect.getLog().error("getWebSocketUrl Auth Failure").sendInternalLogToServer(),i(Error("Authentication failed while getting getWebSocketUrl")),n()},accessDenied:function(){connect.getLog().error("getWebSocketUrl Access Denied Failure").sendInternalLogToServer(),i(Error("Access Denied Failure while getting getWebSocketUrl")),r()}})}))},r.prototype.handleSendLogsRequest=function(){var e=this,t=[],n=e.logsBuffer.slice();e.logsBuffer=[],n.forEach((function(e){t.push({timestamp:e.time,component:e.component,message:e.text})})),this.client.call(connect.ClientMethods.SEND_CLIENT_LOGS,{logEvents:t},{success:function(e){connect.getLog().info("SendLogs request succeeded.").sendInternalLogToServer()},failure:function(e,t){connect.getLog().error("SendLogs request failed.").withObject(t).withException(e).sendInternalLogToServer()},authFailure:connect.hitch(e,e.handleAuthFail)})},r.prototype.handleAuthFail=function(){this.conduit.sendDownstream(connect.EventType.AUTH_FAIL)},r.prototype.handleAccessDenied=function(){this.conduit.sendDownstream(connect.EventType.ACCESS_DENIED)},r.prototype.checkAuthToken=function(){var e=this,t=new Date(e.initData.authTokenExpiration),n=(new Date).getTime();t.getTime()>>32-t}function c(e,t,n,r,i,o,a){return u(e+(t&n|~t&r)+i+o|0,a)+t|0}function l(e,t,n,r,i,o,a){return u(e+(t&r|n&~r)+i+o|0,a)+t|0}function f(e,t,n,r,i,o,a){return u(e+(t^n^r)+i+o|0,a)+t|0}function h(e,t,n,r,i,o,a){return u(e+(n^(t|~r))+i+o|0,a)+t|0}r(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,i=this._c,o=this._d;n=c(n,r,i,o,e[0],3614090360,7),o=c(o,n,r,i,e[1],3905402710,12),i=c(i,o,n,r,e[2],606105819,17),r=c(r,i,o,n,e[3],3250441966,22),n=c(n,r,i,o,e[4],4118548399,7),o=c(o,n,r,i,e[5],1200080426,12),i=c(i,o,n,r,e[6],2821735955,17),r=c(r,i,o,n,e[7],4249261313,22),n=c(n,r,i,o,e[8],1770035416,7),o=c(o,n,r,i,e[9],2336552879,12),i=c(i,o,n,r,e[10],4294925233,17),r=c(r,i,o,n,e[11],2304563134,22),n=c(n,r,i,o,e[12],1804603682,7),o=c(o,n,r,i,e[13],4254626195,12),i=c(i,o,n,r,e[14],2792965006,17),n=l(n,r=c(r,i,o,n,e[15],1236535329,22),i,o,e[1],4129170786,5),o=l(o,n,r,i,e[6],3225465664,9),i=l(i,o,n,r,e[11],643717713,14),r=l(r,i,o,n,e[0],3921069994,20),n=l(n,r,i,o,e[5],3593408605,5),o=l(o,n,r,i,e[10],38016083,9),i=l(i,o,n,r,e[15],3634488961,14),r=l(r,i,o,n,e[4],3889429448,20),n=l(n,r,i,o,e[9],568446438,5),o=l(o,n,r,i,e[14],3275163606,9),i=l(i,o,n,r,e[3],4107603335,14),r=l(r,i,o,n,e[8],1163531501,20),n=l(n,r,i,o,e[13],2850285829,5),o=l(o,n,r,i,e[2],4243563512,9),i=l(i,o,n,r,e[7],1735328473,14),n=f(n,r=l(r,i,o,n,e[12],2368359562,20),i,o,e[5],4294588738,4),o=f(o,n,r,i,e[8],2272392833,11),i=f(i,o,n,r,e[11],1839030562,16),r=f(r,i,o,n,e[14],4259657740,23),n=f(n,r,i,o,e[1],2763975236,4),o=f(o,n,r,i,e[4],1272893353,11),i=f(i,o,n,r,e[7],4139469664,16),r=f(r,i,o,n,e[10],3200236656,23),n=f(n,r,i,o,e[13],681279174,4),o=f(o,n,r,i,e[0],3936430074,11),i=f(i,o,n,r,e[3],3572445317,16),r=f(r,i,o,n,e[6],76029189,23),n=f(n,r,i,o,e[9],3654602809,4),o=f(o,n,r,i,e[12],3873151461,11),i=f(i,o,n,r,e[15],530742520,16),n=h(n,r=f(r,i,o,n,e[2],3299628645,23),i,o,e[0],4096336452,6),o=h(o,n,r,i,e[7],1126891415,10),i=h(i,o,n,r,e[14],2878612391,15),r=h(r,i,o,n,e[5],4237533241,21),n=h(n,r,i,o,e[12],1700485571,6),o=h(o,n,r,i,e[3],2399980690,10),i=h(i,o,n,r,e[10],4293915773,15),r=h(r,i,o,n,e[1],2240044497,21),n=h(n,r,i,o,e[8],1873313359,6),o=h(o,n,r,i,e[15],4264355552,10),i=h(i,o,n,r,e[6],2734768916,15),r=h(r,i,o,n,e[13],1309151649,21),n=h(n,r,i,o,e[4],4149444226,6),o=h(o,n,r,i,e[11],3174756917,10),i=h(i,o,n,r,e[2],718787259,15),r=h(r,i,o,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,n){"use strict";var r=n(112).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,o){if("function"===typeof n)return e(t,null,n);n||(n={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i>>32-t}function m(e,t,n,r,i,o,a,s){return p(e+(t^n^r)+o+a|0,s)+i|0}function g(e,t,n,r,i,o,a,s){return p(e+(t&n|~t&r)+o+a|0,s)+i|0}function v(e,t,n,r,i,o,a,s){return p(e+((t|~n)^r)+o+a|0,s)+i|0}function y(e,t,n,r,i,o,a,s){return p(e+(t&r|n&~r)+o+a|0,s)+i|0}function b(e,t,n,r,i,o,a,s){return p(e+(t^(n|~r))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,S=0|this._b,_=0|this._c,E=0|this._d,M=0|this._e,x=0;x<80;x+=1){var k,O;x<16?(k=m(n,r,i,o,d,e[s[x]],f[0],c[x]),O=b(w,S,_,E,M,e[u[x]],h[0],l[x])):x<32?(k=g(n,r,i,o,d,e[s[x]],f[1],c[x]),O=y(w,S,_,E,M,e[u[x]],h[1],l[x])):x<48?(k=v(n,r,i,o,d,e[s[x]],f[2],c[x]),O=v(w,S,_,E,M,e[u[x]],h[2],l[x])):x<64?(k=y(n,r,i,o,d,e[s[x]],f[3],c[x]),O=g(w,S,_,E,M,e[u[x]],h[3],l[x])):(k=b(n,r,i,o,d,e[s[x]],f[4],c[x]),O=m(w,S,_,E,M,e[u[x]],h[4],l[x])),n=d,d=o,o=p(i,10),i=r,r=k,w=M,M=E,E=p(_,10),_=S,S=O}var C=this._b+i+E|0;this._b=this._c+o+M|0,this._c=this._d+d+w|0,this._d=this._e+n+S|0,this._e=this._a+r+_|0,this._a=C},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=r.alloc?r.alloc(20):new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},function(e,t,n){(t=e.exports=function(e){e=e.toLowerCase();var n=t[e];if(!n)throw new Error(e+" is not supported (we accept pull requests)");return new n}).sha=n(635),t.sha1=n(636),t.sha224=n(637),t.sha256=n(333),t.sha384=n(638),t.sha512=n(334)},function(e,t,n){(t=e.exports=n(335)).Stream=t,t.Readable=t,t.Writable=n(240),t.Duplex=n(102),t.Transform=n(338),t.PassThrough=n(643)},function(e,t,n){"use strict";(function(t,r,i){var o=n(176);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:o.nextTick;y.WritableState=v;var c=Object.create(n(145));c.inherits=n(17);var l={deprecate:n(331)},f=n(336),h=n(20).Buffer,d=i.Uint8Array||function(){};var p,m=n(337);function g(){}function v(e,t){s=s||n(102),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(M,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),M(e,t))}(e,n,r,t,i);else{var a=_(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||S(e,n),r?u(w,e,n,a,i):w(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||n(102),!p.call(y,this)&&!(this instanceof s))return new y(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),M(e,t)}function S(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,f=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,l,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),M(e,t)}))}function M(e,t){var n=_(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"===typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(y,f),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof v)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(r=e,h.isBuffer(r)||r instanceof d);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"===typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!==typeof n&&(n=g),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"===typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(r,a),i=!1),i}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=h.from(t,n));return t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,n){var r=this._writableState;"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,M(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(41),n(226).setImmediate,n(36))},function(e,t,n){"use strict";var r=n(53);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),r=0;r0;r--)t+=this._buffer(e,t),n+=this._flushBuffer(i,n);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,n;return e&&(t=this.update(e)),n="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(n):n},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function a(e,n){var i=function(e){var t=o(e);return{blinder:t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(n),a=n.modulus.byteLength(),s=new r(e).mul(i.blinder).umod(n.modulus),u=s.toRed(r.mont(n.prime1)),c=s.toRed(r.mont(n.prime2)),l=n.coefficient,f=n.prime1,h=n.prime2,d=u.redPow(n.exponent1).fromRed(),p=c.redPow(n.exponent2).fromRed(),m=d.isub(p).imul(l).umod(f).imul(h);return p.iadd(m).imul(i.unblinder).umod(n.modulus).toArrayLike(t,"be",a)}a.getr=o,e.exports=a}).call(this,n(16).Buffer)},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(675).Buffer}catch(C){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),u=t;u=49?c-49+10:c>=17?c-17+10:c,r(c>=0&&a0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(C){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],l=p[e];n="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(e);n=(f=f.idivn(l)).isZero()?m+n:h[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n._strip()}o.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i>8&255),n>16&255),6===o?(n>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,S=b>>>13,_=0|a[4],E=8191&_,M=_>>>13,x=0|a[5],k=8191&x,O=x>>>13,C=0|a[6],A=8191&C,T=C>>>13,I=0|a[7],P=8191&I,R=I>>>13,j=0|a[8],N=8191&j,L=j>>>13,D=0|a[9],U=8191&D,B=D>>>13,F=0|s[0],z=8191&F,q=F>>>13,H=0|s[1],V=8191&H,W=H>>>13,K=0|s[2],G=8191&K,$=K>>>13,Y=0|s[3],X=8191&Y,Z=Y>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,q))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var ve=(c+(r=r+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,z),i=(i=Math.imul(v,q))+Math.imul(y,z)|0,o=Math.imul(y,q),r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(S,z)|0,o=Math.imul(S,q),r=r+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,W)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,$)|0;var be=(c+(r=r+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,W)|0,r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,$)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var we=(c+(r=r+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(k,z),i=(i=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(E,V)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Z)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Se=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(T,z)|0,o=Math.imul(T,q),r=r+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,$)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,r=r+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var _e=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(P,z),i=(i=Math.imul(P,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,W)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(v,ne)|0,i=(i=i+Math.imul(v,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(L,z)|0,o=Math.imul(L,q),r=r+Math.imul(P,V)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,$)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Me=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(U,z),i=(i=Math.imul(U,q))+Math.imul(B,z)|0,o=Math.imul(B,q),r=r+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,W)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,$)|0,r=r+Math.imul(A,X)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Z)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var xe=(c+(r=r+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(U,V),i=(i=Math.imul(U,W))+Math.imul(B,V)|0,o=Math.imul(B,W),r=r+Math.imul(N,G)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,$)|0,r=r+Math.imul(P,X)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(k,ne)|0,i=(i=i+Math.imul(k,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(v,fe)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var ke=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(U,G),i=(i=Math.imul(U,$))+Math.imul(B,G)|0,o=Math.imul(B,$),r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Z)|0,r=r+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(r=r+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,me)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(U,X),i=(i=Math.imul(U,Z))+Math.imul(B,X)|0,o=Math.imul(B,Z),r=r+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(R,ne)|0,o=o+Math.imul(R,re)|0,r=r+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,he)|0;var Ce=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),r=r+Math.imul(N,ne)|0,i=(i=i+Math.imul(N,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,r=r+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0;var Ae=(c+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,ne),i=(i=Math.imul(U,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,r=r+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,he)|0;var Te=(c+(r=r+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(U,oe),i=(i=Math.imul(U,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Ie=(c+(r=r+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(U,ue),i=(i=Math.imul(U,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,he)|0;var Pe=(c+(r=r+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(U,fe),i=(i=Math.imul(U,he))+Math.imul(B,fe)|0,o=Math.imul(B,he);var Re=(c+(r=r+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(L,pe)|0))<<13)|0;c=((o=o+Math.imul(L,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var je=(c+(r=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,me))+Math.imul(B,pe)|0))<<13)|0;return c=((o=Math.imul(B,me))+(i>>>13)|0)+(je>>>26)|0,je&=67108863,u[0]=ge,u[1]=ve,u[2]=ye,u[3]=be,u[4]=we,u[5]=Se,u[6]=_e,u[7]=Ee,u[8]=Me,u[9]=xe,u[10]=ke,u[11]=Oe,u[12]=Ce,u[13]=Ae,u[14]=Te,u[15]=Ie,u[16]=Pe,u[17]=Re,u[18]=je,0!==c&&(u[19]=c,n.length++),n};function v(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function y(e,t,n){return v(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(g=m),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?m(this,e,t):n<1024?v(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},b.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i&1}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=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},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;0===(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new k(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function S(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}S.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},S.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},S.prototype.split=function(e,t){e.iushrn(this.n,0,t)},S.prototype.imulK=function(e){return e.imul(this.k)},i(_,S),_.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new _;else if("p224"===e)t=new E;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return w[e]=t,t},k.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},k.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,k),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(67)(e))},function(e,t,n){"use strict";var r=t;r.version=n(676).version,r.utils=n(54),r.rand=n(244),r.curve=n(358),r.curves=n(249),r.ec=n(688),r.eddsa=n(692)},function(e,t,n){"use strict";var r,i=t,o=n(250),a=n(358),s=n(54).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var n=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:n}),n}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(687)}catch(l){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},function(e,t,n){var r=t;r.utils=n(68),r.common=n(147),r.sha=n(681),r.ripemd=n(685),r.hmac=n(686),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},function(e,t,n){"use strict";(function(t){var r,i=n(16),o=i.Buffer,a={};for(r in i)i.hasOwnProperty(r)&&"SlowBuffer"!==r&&"Buffer"!==r&&(a[r]=i[r]);var s=a.Buffer={};for(r in o)o.hasOwnProperty(r)&&"allocUnsafe"!==r&&"allocUnsafeSlow"!==r&&(s[r]=o[r]);if(a.Buffer.prototype=o.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,n){if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&"undefined"===typeof e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return o(e,t,n)}),s.alloc||(s.alloc=function(e,t,n){if("number"!==typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=o(e);return t&&0!==t.length?"string"===typeof n?r.fill(t,n):r.fill(t):r.fill(0),r}),!a.kStringMaxLength)try{a.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(u){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a}).call(this,n(41))},function(e,t,n){"use strict";var r=n(253).Reporter,i=n(148).EncoderBuffer,o=n(148).DecoderBuffer,a=n(53),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function c(e,t,n){var r={};this._baseState=r,r.name=n,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}e.exports=c;var l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){var e=this._baseState,t={};l.forEach((function(n){t[n]=e[n]}));var n=new this.constructor(t.parent);return n._baseState=t,n},c.prototype._wrap=function(){var e=this._baseState;u.forEach((function(t){this[t]=function(){var n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},c.prototype._init=function(e){var t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){var t=this._baseState,n=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==n.length&&(a(null===t.children),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!==typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);var r=e[n];t[r]=n})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){c.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),s.forEach((function(e){c.prototype[e]=function(){var t=this._baseState,n=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(n),this}})),c.prototype.use=function(e){a(e);var t=this._baseState;return a(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){var t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){var t=this._baseState;return a(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){var t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},c.prototype.contains=function(e){var t=this._baseState;return a(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){var n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));var r,i=n.default,a=!0,s=null;if(null!==n.key&&(s=e.enterKey(n.key)),n.optional){var u=null;if(null!==n.explicit?u=n.explicit:null!==n.implicit?u=n.implicit:null!==n.tag&&(u=n.tag),null!==u||n.any){if(a=this._peekTag(e,u,n.any),e.isError(a))return a}else{var c=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),a=!0}catch(m){a=!1}e.restore(c)}}if(n.obj&&a&&(r=e.enterObject()),a){if(null!==n.explicit){var l=this._decodeTag(e,n.explicit);if(e.isError(l))return l;e=l}var f=e.offset;if(null===n.use&&null===n.choice){var h;n.any&&(h=e.save());var d=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(d))return d;n.any?i=e.raw(h):e=d}if(t&&t.track&&null!==n.tag&&t.track(e.path(),f,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),n.any||(i=null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(n.any||null!==n.choice||null===n.children||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){var p=new o(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(p,t)}}return n.obj&&a&&(i=e.leaveObject(r)),null===n.key||null===i&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,n.key,i),i},c.prototype._decodeGeneric=function(e,t,n){var r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],n):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){var n=this._baseState;return n.useDecoder=this._use(e,t),a(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},c.prototype._decodeChoice=function(e,t){var n=this._baseState,r=null,i=!1;return Object.keys(n.choice).some((function(o){var a=e.save(),s=n.choice[o];try{var u=s._decode(e,t);if(e.isError(u))return!1;r={type:o,value:u},i=!0}catch(c){return e.restore(a),!1}return!0}),this),i?r:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},c.prototype._encode=function(e,t,n){var r=this._baseState;if(null===r.default||r.default!==e){var i=this._encodeValue(e,t,n);if(void 0!==i&&!this._skipDefault(i,t,n))return i}},c.prototype._encodeValue=function(e,t,n){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new r);var o=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}var a=null,s=!1;if(i.any)o=this._createEncoderBuffer(e);else if(i.choice)o=this._encodeChoice(e,t);else if(i.contains)a=this._getUse(i.contains,n)._encode(e,t),s=!0;else if(i.children)a=i.children.map((function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");var r=t.enterKey(n._baseState.key);if("object"!==typeof e)return t.error("Child expected, but input is not object");var i=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),i}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(n){var r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)}),u))}else null!==i.use?o=this._getUse(i.use,n)._encode(e,t):(a=this._encodePrimitive(i.tag,e),s=!0);if(!i.any&&null===i.choice){var c=null!==i.implicit?i.implicit:i.tag,l=null===i.implicit?"universal":"context";null===c?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(c,s,l,a))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(e,t){var n=this._baseState,r=n.choice[e.type];return r||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){var n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},function(e,t,n){"use strict";var r=n(17);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,n){var r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=n)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){var t=this._reporterState,n=t.obj;return t.obj=e,n},i.prototype.error=function(e){var t,n=this._reporterState,r=e instanceof o;if(t=r?e:new o(n.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t},i.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},r(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},function(e,t,n){"use strict";function r(e){var t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);var r=e[n];t[r]=n})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=r(t.tag)},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(711).Buffer}catch(x){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","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"],f=[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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?l[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:l[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r("undefined"!==typeof a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,S=b>>>13,_=0|a[4],E=8191&_,M=_>>>13,x=0|a[5],k=8191&x,O=x>>>13,C=0|a[6],A=8191&C,T=C>>>13,I=0|a[7],P=8191&I,R=I>>>13,j=0|a[8],N=8191&j,L=j>>>13,D=0|a[9],U=8191&D,B=D>>>13,F=0|s[0],z=8191&F,q=F>>>13,H=0|s[1],V=8191&H,W=H>>>13,K=0|s[2],G=8191&K,$=K>>>13,Y=0|s[3],X=8191&Y,Z=Y>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,q))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var ve=(c+(r=r+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,z),i=(i=Math.imul(v,q))+Math.imul(y,z)|0,o=Math.imul(y,q),r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(S,z)|0,o=Math.imul(S,q),r=r+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,W)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,$)|0;var be=(c+(r=r+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,W)|0,r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,$)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var we=(c+(r=r+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(k,z),i=(i=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(E,V)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Z)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Se=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(T,z)|0,o=Math.imul(T,q),r=r+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,$)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,r=r+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var _e=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(P,z),i=(i=Math.imul(P,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,W)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(v,ne)|0,i=(i=i+Math.imul(v,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(L,z)|0,o=Math.imul(L,q),r=r+Math.imul(P,V)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,$)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Me=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(U,z),i=(i=Math.imul(U,q))+Math.imul(B,z)|0,o=Math.imul(B,q),r=r+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,W)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,$)|0,r=r+Math.imul(A,X)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Z)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var xe=(c+(r=r+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(U,V),i=(i=Math.imul(U,W))+Math.imul(B,V)|0,o=Math.imul(B,W),r=r+Math.imul(N,G)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,$)|0,r=r+Math.imul(P,X)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(k,ne)|0,i=(i=i+Math.imul(k,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(v,fe)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var ke=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(U,G),i=(i=Math.imul(U,$))+Math.imul(B,G)|0,o=Math.imul(B,$),r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Z)|0,r=r+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(r=r+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,me)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(U,X),i=(i=Math.imul(U,Z))+Math.imul(B,X)|0,o=Math.imul(B,Z),r=r+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(R,ne)|0,o=o+Math.imul(R,re)|0,r=r+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,he)|0;var Ce=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),r=r+Math.imul(N,ne)|0,i=(i=i+Math.imul(N,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,r=r+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0;var Ae=(c+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,ne),i=(i=Math.imul(U,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,r=r+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,he)|0;var Te=(c+(r=r+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(U,oe),i=(i=Math.imul(U,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Ie=(c+(r=r+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(U,ue),i=(i=Math.imul(U,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,he)|0;var Pe=(c+(r=r+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(U,fe),i=(i=Math.imul(U,he))+Math.imul(B,fe)|0,o=Math.imul(B,he);var Re=(c+(r=r+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(L,pe)|0))<<13)|0;c=((o=o+Math.imul(L,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var je=(c+(r=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,me))+Math.imul(B,pe)|0))<<13)|0;return c=((o=Math.imul(B,me))+(i>>>13)|0)+(je>>>26)|0,je&=67108863,u[0]=ge,u[1]=ve,u[2]=ye,u[3]=be,u[4]=we,u[5]=Se,u[6]=_e,u[7]=Ee,u[8]=Me,u[9]=xe,u[10]=ke,u[11]=Oe,u[12]=Ce,u[13]=Ae,u[14]=Te,u[15]=Ie,u[16]=Pe,u[17]=Re,u[18]=je,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):m(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=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},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;0===(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new w;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return v[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,E),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(67)(e))},function(e,t,n){"use strict";n.r(t),n.d(t,"locateWindow",(function(){return i}));var r={};function i(){return"undefined"!==typeof window?window:"undefined"!==typeof self?self:r}},function(e,t,n){"use strict";var r=n(99),i=n(823),o=n(622),a=n(837),s=n(214),u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function c(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var l=function(){return(l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]/g,">").replace(/"/g,""")+'"'))}}catch(c){e={error:c}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return r+(n?">"+this.children.map((function(e){return e.toString()})).join("")+"":"/>")},e}();var Qr=function(){function e(e){this.value=e}return e.prototype.toString=function(){return(""+this.value).replace(/&/g,"&").replace(//g,">")},e}(),ei=n(414),ti=function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c;return h(this,(function(f){switch(f.label){case 0:return r=[l({},e)],c={},[4,Mi(e.body,t)];case 1:switch(n=l.apply(void 0,r.concat([(c.body=f.sent(),c)])),o="UnknownError",o=xi(e,n.body),o){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":return[3,2]}return[3,4];case 2:return a=[{}],[4,di(n,t)];case 3:return i=l.apply(void 0,[l.apply(void 0,a.concat([f.sent()])),{name:o,$metadata:Si(e)}]),[3,5];case 4:s=n.body,o=s.code||s.Code||o,i=l(l({},s),{name:""+o,message:s.message||s.Message||o,$fault:"client",$metadata:Si(e)}),f.label=5;case 5:return u=i.message||i.Message||o,i.message=u,delete i.Message,[2,Promise.reject(Object.assign(new Error(u),i))]}}))}))},ni=function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u;return h(this,(function(c){switch(c.label){case 0:return r=[l({},e)],u={},[4,Mi(e.body,t)];case 1:return n=l.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=xi(e,n.body),a=n.body,o=a.code||a.Code||o,i=l(l({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:Si(e)}),s=i.message||i.Message||o,i.message=s,delete i.Message,[2,Promise.reject(Object.assign(new Error(s),i))]}}))}))},ri=function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u;return h(this,(function(c){switch(c.label){case 0:return r=[l({},e)],u={},[4,Mi(e.body,t)];case 1:return n=l.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=xi(e,n.body),a=n.body,o=a.code||a.Code||o,i=l(l({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:Si(e)}),s=i.message||i.Message||o,i.message=s,delete i.Message,[2,Promise.reject(Object.assign(new Error(s),i))]}}))}))},ii=function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u;return h(this,(function(c){switch(c.label){case 0:return r=[l({},e)],u={},[4,Mi(e.body,t)];case 1:return n=l.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=xi(e,n.body),a=n.body,o=a.code||a.Code||o,i=l(l({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:Si(e)}),s=i.message||i.Message||o,i.message=s,delete i.Message,[2,Promise.reject(Object.assign(new Error(s),i))]}}))}))},oi=function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,f;return h(this,(function(h){switch(h.label){case 0:return r=[l({},e)],f={},[4,Mi(e.body,t)];case 1:switch(n=l.apply(void 0,r.concat([(f.body=h.sent(),f)])),o="UnknownError",o=xi(e,n.body),o){case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":return[3,2];case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":return[3,4]}return[3,6];case 2:return a=[{}],[4,li(n,t)];case 3:return i=l.apply(void 0,[l.apply(void 0,a.concat([h.sent()])),{name:o,$metadata:Si(e)}]),[3,7];case 4:return s=[{}],[4,hi(n,t)];case 5:return i=l.apply(void 0,[l.apply(void 0,s.concat([h.sent()])),{name:o,$metadata:Si(e)}]),[3,7];case 6:u=n.body,o=u.code||u.Code||o,i=l(l({},u),{name:""+o,message:u.message||u.Message||o,$fault:"client",$metadata:Si(e)}),h.label=7;case 7:return c=i.message||i.Message||o,i.message=c,delete i.Message,[2,Promise.reject(Object.assign(new Error(c),i))]}}))}))},ai=function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c;return h(this,(function(f){switch(f.label){case 0:return r=[l({},e)],c={},[4,Mi(e.body,t)];case 1:switch(n=l.apply(void 0,r.concat([(c.body=f.sent(),c)])),o="UnknownError",o=xi(e,n.body),o){case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":return[3,2]}return[3,4];case 2:return a=[{}],[4,fi(n,t)];case 3:return i=l.apply(void 0,[l.apply(void 0,a.concat([f.sent()])),{name:o,$metadata:Si(e)}]),[3,5];case 4:s=n.body,o=s.code||s.Code||o,i=l(l({},s),{name:""+o,message:s.message||s.Message||o,$fault:"client",$metadata:Si(e)}),f.label=5;case 5:return u=i.message||i.Message||o,i.message=u,delete i.Message,[2,Promise.reject(Object.assign(new Error(u),i))]}}))}))},si=function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u;return h(this,(function(c){switch(c.label){case 0:return r=[l({},e)],u={},[4,Mi(e.body,t)];case 1:return n=l.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=xi(e,n.body),a=n.body,o=a.code||a.Code||o,i=l(l({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:Si(e)}),s=i.message||i.Message||o,i.message=s,delete i.Message,[2,Promise.reject(Object.assign(new Error(s),i))]}}))}))},ui=function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u;return h(this,(function(c){switch(c.label){case 0:return r=[l({},e)],u={},[4,Mi(e.body,t)];case 1:return n=l.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=xi(e,n.body),a=n.body,o=a.code||a.Code||o,i=l(l({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:Si(e)}),s=i.message||i.Message||o,i.message=s,delete i.Message,[2,Promise.reject(Object.assign(new Error(s),i))]}}))}))},ci=function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u;return h(this,(function(c){switch(c.label){case 0:return r=[l({},e)],u={},[4,Mi(e.body,t)];case 1:return n=l.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=xi(e,n.body),a=n.body,o=a.code||a.Code||o,i=l(l({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:Si(e)}),s=i.message||i.Message||o,i.message=s,delete i.Message,[2,Promise.reject(Object.assign(new Error(s),i))]}}))}))},li=function(e,t){return f(void 0,void 0,void 0,(function(){var t,n;return h(this,(function(r){return t={name:"InvalidObjectState",$fault:"client",$metadata:Si(e),AccessTier:void 0,StorageClass:void 0},void 0!==(n=e.body).AccessTier&&(t.AccessTier=n.AccessTier),void 0!==n.StorageClass&&(t.StorageClass=n.StorageClass),[2,t]}))}))},fi=function(e,t){return f(void 0,void 0,void 0,(function(){var t;return h(this,(function(n){return t={name:"NoSuchBucket",$fault:"client",$metadata:Si(e)},e.body,[2,t]}))}))},hi=function(e,t){return f(void 0,void 0,void 0,(function(){var t;return h(this,(function(n){return t={name:"NoSuchKey",$fault:"client",$metadata:Si(e)},e.body,[2,t]}))}))},di=function(e,t){return f(void 0,void 0,void 0,(function(){var t;return h(this,(function(n){return t={name:"NoSuchUpload",$fault:"client",$metadata:Si(e)},e.body,[2,t]}))}))},pi=function(e,t){var n=new Jr("CompletedMultipartUpload");void 0!==e.Parts&&null!==e.Parts&&mi(e.Parts,t).map((function(e){e=e.withName("Part"),n.addChildNode(e)}));return n},mi=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){var n=new Jr("CompletedPart");if(void 0!==e.ETag&&null!==e.ETag){var r=new Jr("ETag").addChildNode(new Qr(e.ETag)).withName("ETag");n.addChildNode(r)}void 0!==e.PartNumber&&null!==e.PartNumber&&(r=new Jr("PartNumber").addChildNode(new Qr(String(e.PartNumber))).withName("PartNumber"),n.addChildNode(r));return n}(e).withName("member")}))},gi=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){var n={Prefix:void 0};return void 0!==e.Prefix&&(n.Prefix=e.Prefix),n}(e)}))},vi=function(e,t){var n={ID:void 0,DisplayName:void 0};return void 0!==e.ID&&(n.ID=e.ID),void 0!==e.DisplayName&&(n.DisplayName=e.DisplayName),n},yi=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){var n={Key:void 0,LastModified:void 0,ETag:void 0,Size:void 0,StorageClass:void 0,Owner:void 0};return void 0!==e.Key&&(n.Key=e.Key),void 0!==e.LastModified&&(n.LastModified=new Date(e.LastModified)),void 0!==e.ETag&&(n.ETag=e.ETag),void 0!==e.Size&&(n.Size=parseInt(e.Size)),void 0!==e.StorageClass&&(n.StorageClass=e.StorageClass),void 0!==e.Owner&&(n.Owner=bi(e.Owner,t)),n}(e,t)}))},bi=function(e,t){var n={DisplayName:void 0,ID:void 0};return void 0!==e.DisplayName&&(n.DisplayName=e.DisplayName),void 0!==e.ID&&(n.ID=e.ID),n},wi=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){var n={PartNumber:void 0,LastModified:void 0,ETag:void 0,Size:void 0};return void 0!==e.PartNumber&&(n.PartNumber=parseInt(e.PartNumber)),void 0!==e.LastModified&&(n.LastModified=new Date(e.LastModified)),void 0!==e.ETag&&(n.ETag=e.ETag),void 0!==e.Size&&(n.Size=parseInt(e.Size)),n}(e)}))},Si=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},_i=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},Ei=function(e){return void 0!==e&&null!==e&&""!==e&&(!Object.getOwnPropertyNames(e).includes("length")||0!=e.length)&&(!Object.getOwnPropertyNames(e).includes("size")||0!=e.size)},Mi=function(e,t){return function(e,t){return _i(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){if(e.length){var t=Object(ei.parse)(e,{attributeNamePrefix:"",ignoreAttributes:!1,parseNodeValue:!1,tagValueProcessor:function(e,t){return e.replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<")}}),n=Object.keys(t)[0],r=t[n];return r["#text"]&&(r[n]=r["#text"],delete r["#text"]),Object(Yr.g)(r)}return{}}))},xi=function(e,t){return void 0!==t.Code?t.Code:404==e.statusCode?"NotFound":""},ki=function(e){return"string"===typeof e&&0===e.indexOf("arn:")&&e.split(":").length>=6},Oi=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Ci=/(\d+\.){3}\d+/,Ai=/\.\./,Ti=/\./,Ii=/^(.+\.)?s3[.-]([a-z0-9-]+)\./,Pi=/^s3(-external-1)?\.amazonaws\.com$/,Ri="amazonaws.com",ji=function(e){return Li(e)?e.replace(/fips-|-fips/,""):e},Ni=function(e){var t=e.match(Ii);return[t[2],e.replace(new RegExp("^"+t[0]),"")]},Li=function(e){return e.startsWith("fips-")||e.endsWith("-fips")},Di=function(e,t){return e===t||ji(e)===t||e===ji(t)},Ui=function(e,t){if(void 0===t&&(t={tlsCompatible:!0}),e.length>=64||!/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/.test(e)||/(\d+\.){3}\d+/.test(e)||/[.-]{2}/.test(e)||(null===t||void 0===t?void 0:t.tlsCompatible)&&Ti.test(e))throw new Error("Invalid DNS label "+e)},Bi=function(e){var t=e.isCustomEndpoint,n=(e.baseHostname,e.dualstackEndpoint),r=e.accelerateEndpoint;if(t){if(n)throw new Error("Dualstack endpoint is not supported with custom endpoint");if(r)throw new Error("Accelerate endpoint is not supported with custom endpoint")}return function(e){return"string"===typeof e.bucketName}(e)?zi(Object(Zr.__assign)(Object(Zr.__assign)({},e),{isCustomEndpoint:t})):Fi(Object(Zr.__assign)(Object(Zr.__assign)({},e),{isCustomEndpoint:t}))},Fi=function(e){var t,n=e.isCustomEndpoint,r=e.baseHostname,i=Object(Zr.__read)(n?[e.clientRegion,r]:(t=r,Pi.test(t)?[t.replace(".amazonaws.com",""),Ri]:Ni(t)),2),o=i[0],a=i[1],s=e.pathStyleEndpoint,u=e.dualstackEndpoint,c=void 0!==u&&u,l=e.accelerateEndpoint,f=void 0!==l&&l,h=e.tlsCompatible,d=void 0===h||h,p=e.useArnRegion,m=e.bucketName,g=e.clientPartition,v=void 0===g?"aws":g,y=e.clientSigningRegion,b=void 0===y?o:y;!function(e){if(e.pathStyleEndpoint)throw new Error("Path-style S3 endpoint is not supported when bucket is an ARN");if(e.accelerateEndpoint)throw new Error("Accelerate endpoint is not supported when bucket is an ARN");if(!e.tlsCompatible)throw new Error("HTTPS is required when bucket is an ARN")}({pathStyleEndpoint:s,accelerateEndpoint:f,tlsCompatible:d});var w=m.service,S=m.partition,_=m.accountId,E=m.region,M=m.resource;!function(e){if("s3"!==e&&"s3-outposts"!==e)throw new Error("Expect 's3' or 's3-outposts' in ARN service component")}(w),function(e,t){if(e!==t.clientPartition)throw new Error('Partition in ARN is incompatible, got "'+e+'" but expected "'+t.clientPartition+'"')}(S,{clientPartition:v}),function(e){if(!/[0-9]{12}/.exec(e))throw new Error("Access point ARN accountID does not match regex '[0-9]{12}'")}(_),function(e,t){if(""===e)throw new Error("ARN region is empty");if(!t.useArnRegion&&!Di(e,t.clientRegion)&&!Di(e,t.clientSigningRegion))throw new Error("Region in ARN is incompatible, got "+e+" but expected "+t.clientRegion);if(t.useArnRegion&&Li(e))throw new Error("Endpoint does not support FIPS region")}(E,{useArnRegion:p,clientRegion:o,clientSigningRegion:b});var x=function(e){var t=e.includes(":")?":":"/",n=Object(Zr.__read)(e.split(t)),r=n[0],i=n.slice(1);if("accesspoint"===r){if(1!==i.length||""===i[0])throw new Error("Access Point ARN should have one resource accesspoint"+t+"{accesspointname}");return{accesspointName:i[0]}}if("outpost"===r){if(!i[0]||"accesspoint"!==i[1]||!i[2]||3!==i.length)throw new Error("Outpost ARN should have resource outpost"+t+"{outpostId}"+t+"accesspoint"+t+"{accesspointName}");var o=Object(Zr.__read)(i,3),a=o[0];return o[1],{outpostId:a,accesspointName:o[2]}}throw new Error("ARN resource should begin with 'accesspoint"+t+"' or 'outpost"+t+"'")}(M),k=x.accesspointName,O=x.outpostId;Ui(k+"-"+_,{tlsCompatible:d});var C=p?E:o,A=p?E:b;return O?(function(e){if("s3-outposts"!==e)throw new Error("Expect 's3-posts' in Outpost ARN service component")}(w),Ui(O,{tlsCompatible:d}),function(e){if(e)throw new Error("Dualstack endpoint is not supported with Outpost")}(c),function(e){if(Li(null!==e&&void 0!==e?e:""))throw new Error("FIPS region is not supported with Outpost, got "+e)}(C),{bucketEndpoint:!0,hostname:k+"-"+_+"."+O+(n?"":".s3-outposts."+C)+"."+a,signingRegion:A,signingService:"s3-outposts"}):(function(e){if("s3"!==e)throw new Error("Expect 's3' in Accesspoint ARN service component")}(w),{bucketEndpoint:!0,hostname:k+"-"+_+(n?"":".s3-accesspoint"+(c?".dualstack":"")+"."+C)+"."+a,signingRegion:A})},zi=function(e){var t,n=e.accelerateEndpoint,r=void 0!==n&&n,i=e.clientRegion,o=e.baseHostname,a=e.bucketName,s=e.dualstackEndpoint,u=void 0!==s&&s,c=e.pathStyleEndpoint,l=void 0!==c&&c,f=e.tlsCompatible,h=void 0===f||f,d=e.isCustomEndpoint,p=void 0!==d&&d,m=Object(Zr.__read)(p?[i,o]:(t=o,Pi.test(t)?["us-east-1",Ri]:Ni(t)),2),g=m[0],v=m[1];return l||!function(e){return Oi.test(e)&&!Ci.test(e)&&!Ai.test(e)}(a)||h&&Ti.test(a)?{bucketEndpoint:!1,hostname:u?"s3.dualstack."+g+"."+v:o}:(r?o="s3-accelerate"+(u?".dualstack":"")+"."+v:u&&(o="s3.dualstack."+g+"."+v),{bucketEndpoint:!0,hostname:a+"."+o})},qi=function(e){return function(t,n){return function(r){return Object(Zr.__awaiter)(void 0,void 0,void 0,(function(){var i,o,a,s,u,c,l,f,h,d,p,m,g,v,y,b,w,S;return Object(Zr.__generator)(this,(function(_){switch(_.label){case 0:return i=r.input.Bucket,o=e.bucketEndpoint,a=r.request,Xr.a.isInstance(a)?e.bucketEndpoint?(a.hostname=i,[3,7]):[3,1]:[3,8];case 1:return ki(i)?(s=function(e){var t=e.split(":");if(t.length<6||"arn"!==t[0])throw new Error("Malformed ARN");var n=Object(Zr.__read)(t);return{partition:n[1],service:n[2],region:n[3],accountId:n[4],resource:n.slice(5).join(":")}}(i),u=ji,[4,e.region()]):[3,5];case 2:return v=u.apply(void 0,[_.sent()]),[4,e.regionInfoProvider(v)];case 3:return c=_.sent()||{},l=c.partition,f=c.signingRegion,h=void 0===f?v:f,[4,e.useArnRegion()];case 4:return d=_.sent(),p=Bi({bucketName:s,baseHostname:a.hostname,accelerateEndpoint:e.useAccelerateEndpoint,dualstackEndpoint:e.useDualstackEndpoint,pathStyleEndpoint:e.forcePathStyle,tlsCompatible:"https:"===a.protocol,useArnRegion:d,clientPartition:l,clientSigningRegion:h,clientRegion:v,isCustomEndpoint:e.isCustomEndpoint}),w=p.hostname,S=p.bucketEndpoint,m=p.signingRegion,g=p.signingService,m&&m!==h&&(n.signing_region=m),g&&"s3"!==g&&(n.signing_service=g),a.hostname=w,o=S,[3,7];case 5:return y=ji,[4,e.region()];case 6:v=y.apply(void 0,[_.sent()]),b=Bi({bucketName:i,clientRegion:v,baseHostname:a.hostname,accelerateEndpoint:e.useAccelerateEndpoint,dualstackEndpoint:e.useDualstackEndpoint,pathStyleEndpoint:e.forcePathStyle,tlsCompatible:"https:"===a.protocol,isCustomEndpoint:e.isCustomEndpoint}),w=b.hostname,S=b.bucketEndpoint,a.hostname=w,o=S,_.label=7;case 7:o&&(a.path=a.path.replace(/^(\/)?[^\/]+/,""),""===a.path&&(a.path="/")),_.label=8;case 8:return[2,t(Object(Zr.__assign)(Object(Zr.__assign)({},r),{request:a}))]}}))}))}}},Hi={tags:["BUCKET_ENDPOINT"],name:"bucketEndpointMiddleware",relation:"before",toMiddleware:"hostHeaderMiddleware",override:!0},Vi=function(e){return{applyToStack:function(t){t.addRelativeTo(qi(e),Hi)}}};var Wi=n(34);var Ki={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Gi=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(Zr.__awaiter)(t,void 0,void 0,(function(){var t,i,o,a,s,u,c,l,f,h,d,p,m,g,v,y,b;return Object(Zr.__generator)(this,(function(w){switch(w.label){case 0:t=Object(Zr.__assign)({},r.input),i=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}],w.label=1;case 1:w.trys.push([1,6,7,8]),o=Object(Zr.__values)(i),a=o.next(),w.label=2;case 2:return a.done?[3,5]:(s=a.value,(u=t[s.target])?(c=ArrayBuffer.isView(u)?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):"string"===typeof u?e.utf8Decoder(u):new Uint8Array(u),l=e.base64Encoder(c),(f=new e.md5).update(c),h=[Object(Zr.__assign)({},t)],(b={})[s.target]=l,d=s.hash,m=(p=e).base64Encoder,[4,f.digest()]):[3,4]);case 3:t=Zr.__assign.apply(void 0,h.concat([(b[d]=m.apply(p,[w.sent()]),b)])),w.label=4;case 4:return a=o.next(),[3,2];case 5:return[3,8];case 6:return g=w.sent(),v={error:g},[3,8];case 7:try{a&&!a.done&&(y=o.return)&&y.call(o)}finally{if(v)throw v.error}return[7];case 8:return[2,n(Object(Zr.__assign)(Object(Zr.__assign)({},r),{input:t}))]}}))}))}}}(e),Ki)}}},$i=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Wi.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Gi(t)),this.middlewareStack.use(Vi(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"S3Client",commandName:"GetObjectCommand",inputFilterSensitiveLog:sn.filterSensitiveLog,outputFilterSensitiveLog:an.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,f;return h(this,(function(h){switch(h.label){case 0:if(n=l(l(l(l(l(l(l(l(l(l({},Ei(e.IfMatch)&&{"if-match":e.IfMatch}),Ei(e.IfModifiedSince)&&{"if-modified-since":Object(Yr.d)(e.IfModifiedSince).toString()}),Ei(e.IfNoneMatch)&&{"if-none-match":e.IfNoneMatch}),Ei(e.IfUnmodifiedSince)&&{"if-unmodified-since":Object(Yr.d)(e.IfUnmodifiedSince).toString()}),Ei(e.Range)&&{range:e.Range}),Ei(e.SSECustomerAlgorithm)&&{"x-amz-server-side-encryption-customer-algorithm":e.SSECustomerAlgorithm}),Ei(e.SSECustomerKey)&&{"x-amz-server-side-encryption-customer-key":e.SSECustomerKey}),Ei(e.SSECustomerKeyMD5)&&{"x-amz-server-side-encryption-customer-key-md5":e.SSECustomerKeyMD5}),Ei(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),Ei(e.ExpectedBucketOwner)&&{"x-amz-expected-bucket-owner":e.ExpectedBucketOwner}),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(Yr.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(Yr.e)(e)})).join("/")),o=l(l(l(l(l(l(l(l({"x-id":"GetObject"},void 0!==e.ResponseCacheControl&&{"response-cache-control":e.ResponseCacheControl}),void 0!==e.ResponseContentDisposition&&{"response-content-disposition":e.ResponseContentDisposition}),void 0!==e.ResponseContentEncoding&&{"response-content-encoding":e.ResponseContentEncoding}),void 0!==e.ResponseContentLanguage&&{"response-content-language":e.ResponseContentLanguage}),void 0!==e.ResponseContentType&&{"response-content-type":e.ResponseContentType}),void 0!==e.ResponseExpires&&{"response-expires":(e.ResponseExpires.toISOString().split(".")[0]+"Z").toString()}),void 0!==e.VersionId&&{versionId:e.VersionId}),void 0!==e.PartNumber&&{partNumber:e.PartNumber.toString()}),[4,t.endpoint()];case 1:return a=h.sent(),s=a.hostname,u=a.protocol,c=void 0===u?"https":u,f=a.port,[2,new Xr.a({protocol:c,hostname:s,port:f,method:"GET",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r;return h(this,(function(i){return 200!==e.statusCode&&e.statusCode>=300?[2,oi(e,t)]:(n={$metadata:Si(e),AcceptRanges:void 0,Body:void 0,BucketKeyEnabled:void 0,CacheControl:void 0,ContentDisposition:void 0,ContentEncoding:void 0,ContentLanguage:void 0,ContentLength:void 0,ContentRange:void 0,ContentType:void 0,DeleteMarker:void 0,ETag:void 0,Expiration:void 0,Expires:void 0,LastModified:void 0,Metadata:void 0,MissingMeta:void 0,ObjectLockLegalHoldStatus:void 0,ObjectLockMode:void 0,ObjectLockRetainUntilDate:void 0,PartsCount:void 0,ReplicationStatus:void 0,RequestCharged:void 0,Restore:void 0,SSECustomerAlgorithm:void 0,SSECustomerKeyMD5:void 0,SSEKMSKeyId:void 0,ServerSideEncryption:void 0,StorageClass:void 0,TagCount:void 0,VersionId:void 0,WebsiteRedirectLocation:void 0},void 0!==e.headers["x-amz-delete-marker"]&&(n.DeleteMarker="true"===e.headers["x-amz-delete-marker"]),void 0!==e.headers["accept-ranges"]&&(n.AcceptRanges=e.headers["accept-ranges"]),void 0!==e.headers["x-amz-expiration"]&&(n.Expiration=e.headers["x-amz-expiration"]),void 0!==e.headers["x-amz-restore"]&&(n.Restore=e.headers["x-amz-restore"]),void 0!==e.headers["last-modified"]&&(n.LastModified=new Date(e.headers["last-modified"])),void 0!==e.headers["content-length"]&&(n.ContentLength=parseInt(e.headers["content-length"],10)),void 0!==e.headers.etag&&(n.ETag=e.headers.etag),void 0!==e.headers["x-amz-missing-meta"]&&(n.MissingMeta=parseInt(e.headers["x-amz-missing-meta"],10)),void 0!==e.headers["x-amz-version-id"]&&(n.VersionId=e.headers["x-amz-version-id"]),void 0!==e.headers["cache-control"]&&(n.CacheControl=e.headers["cache-control"]),void 0!==e.headers["content-disposition"]&&(n.ContentDisposition=e.headers["content-disposition"]),void 0!==e.headers["content-encoding"]&&(n.ContentEncoding=e.headers["content-encoding"]),void 0!==e.headers["content-language"]&&(n.ContentLanguage=e.headers["content-language"]),void 0!==e.headers["content-range"]&&(n.ContentRange=e.headers["content-range"]),void 0!==e.headers["content-type"]&&(n.ContentType=e.headers["content-type"]),void 0!==e.headers.expires&&(n.Expires=new Date(e.headers.expires)),void 0!==e.headers["x-amz-website-redirect-location"]&&(n.WebsiteRedirectLocation=e.headers["x-amz-website-redirect-location"]),void 0!==e.headers["x-amz-server-side-encryption"]&&(n.ServerSideEncryption=e.headers["x-amz-server-side-encryption"]),void 0!==e.headers["x-amz-server-side-encryption-customer-algorithm"]&&(n.SSECustomerAlgorithm=e.headers["x-amz-server-side-encryption-customer-algorithm"]),void 0!==e.headers["x-amz-server-side-encryption-customer-key-md5"]&&(n.SSECustomerKeyMD5=e.headers["x-amz-server-side-encryption-customer-key-md5"]),void 0!==e.headers["x-amz-server-side-encryption-aws-kms-key-id"]&&(n.SSEKMSKeyId=e.headers["x-amz-server-side-encryption-aws-kms-key-id"]),void 0!==e.headers["x-amz-server-side-encryption-bucket-key-enabled"]&&(n.BucketKeyEnabled="true"===e.headers["x-amz-server-side-encryption-bucket-key-enabled"]),void 0!==e.headers["x-amz-storage-class"]&&(n.StorageClass=e.headers["x-amz-storage-class"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),void 0!==e.headers["x-amz-replication-status"]&&(n.ReplicationStatus=e.headers["x-amz-replication-status"]),void 0!==e.headers["x-amz-mp-parts-count"]&&(n.PartsCount=parseInt(e.headers["x-amz-mp-parts-count"],10)),void 0!==e.headers["x-amz-tagging-count"]&&(n.TagCount=parseInt(e.headers["x-amz-tagging-count"],10)),void 0!==e.headers["x-amz-object-lock-mode"]&&(n.ObjectLockMode=e.headers["x-amz-object-lock-mode"]),void 0!==e.headers["x-amz-object-lock-retain-until-date"]&&(n.ObjectLockRetainUntilDate=new Date(e.headers["x-amz-object-lock-retain-until-date"])),void 0!==e.headers["x-amz-object-lock-legal-hold"]&&(n.ObjectLockLegalHoldStatus=e.headers["x-amz-object-lock-legal-hold"]),Object.keys(e.headers).forEach((function(t){void 0===n.Metadata&&(n.Metadata={}),t.startsWith("x-amz-meta-")&&(n.Metadata[t.substring(11)]=e.headers[t])})),r=e.body,n.Body=r,[2,Promise.resolve(n)])}))}))}(e,t)},t}(Yr.b),Yi=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Wi.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Vi(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"S3Client",commandName:"DeleteObjectCommand",inputFilterSensitiveLog:J.filterSensitiveLog,outputFilterSensitiveLog:Z.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,f;return h(this,(function(h){switch(h.label){case 0:if(n=l(l(l(l({},Ei(e.MFA)&&{"x-amz-mfa":e.MFA}),Ei(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),Ei(e.BypassGovernanceRetention)&&{"x-amz-bypass-governance-retention":e.BypassGovernanceRetention.toString()}),Ei(e.ExpectedBucketOwner)&&{"x-amz-expected-bucket-owner":e.ExpectedBucketOwner}),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(Yr.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(Yr.e)(e)})).join("/")),o=l({"x-id":"DeleteObject"},void 0!==e.VersionId&&{versionId:e.VersionId}),[4,t.endpoint()];case 1:return a=h.sent(),s=a.hostname,u=a.protocol,c=void 0===u?"https":u,f=a.port,[2,new Xr.a({protocol:c,hostname:s,port:f,method:"DELETE",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n;return h(this,(function(r){switch(r.label){case 0:return 204!==e.statusCode&&e.statusCode>=300?[2,ii(e,t)]:(n={$metadata:Si(e),DeleteMarker:void 0,RequestCharged:void 0,VersionId:void 0},void 0!==e.headers["x-amz-delete-marker"]&&(n.DeleteMarker="true"===e.headers["x-amz-delete-marker"]),void 0!==e.headers["x-amz-version-id"]&&(n.VersionId=e.headers["x-amz-version-id"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),[4,_i(e.body,t)]);case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Yr.b),Xi=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Wi.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Vi(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"S3Client",commandName:"ListObjectsCommand",inputFilterSensitiveLog:Zn.filterSensitiveLog,outputFilterSensitiveLog:Xn.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,f;return h(this,(function(h){switch(h.label){case 0:if(n=l(l({},Ei(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),Ei(e.ExpectedBucketOwner)&&{"x-amz-expected-bucket-owner":e.ExpectedBucketOwner}),r="/{Bucket}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");return r=r.replace("{Bucket}",Object(Yr.e)(i)),o=l(l(l(l(l({},void 0!==e.Delimiter&&{delimiter:e.Delimiter}),void 0!==e.EncodingType&&{"encoding-type":e.EncodingType}),void 0!==e.Marker&&{marker:e.Marker}),void 0!==e.MaxKeys&&{"max-keys":e.MaxKeys.toString()}),void 0!==e.Prefix&&{prefix:e.Prefix}),[4,t.endpoint()];case 1:return a=h.sent(),s=a.hostname,u=a.protocol,c=void 0===u?"https":u,f=a.port,[2,new Xr.a({protocol:c,hostname:s,port:f,method:"GET",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r;return h(this,(function(i){switch(i.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,ai(e,t)]:(n={$metadata:Si(e),CommonPrefixes:void 0,Contents:void 0,Delimiter:void 0,EncodingType:void 0,IsTruncated:void 0,Marker:void 0,MaxKeys:void 0,Name:void 0,NextMarker:void 0,Prefix:void 0},[4,Mi(e.body,t)]);case 1:return""===(r=i.sent()).CommonPrefixes&&(n.CommonPrefixes=[]),void 0!==r.CommonPrefixes&&(n.CommonPrefixes=gi(Object(Yr.f)(r.CommonPrefixes),t)),""===r.Contents&&(n.Contents=[]),void 0!==r.Contents&&(n.Contents=yi(Object(Yr.f)(r.Contents),t)),void 0!==r.Delimiter&&(n.Delimiter=r.Delimiter),void 0!==r.EncodingType&&(n.EncodingType=r.EncodingType),void 0!==r.IsTruncated&&(n.IsTruncated="true"==r.IsTruncated),void 0!==r.Marker&&(n.Marker=r.Marker),void 0!==r.MaxKeys&&(n.MaxKeys=parseInt(r.MaxKeys)),void 0!==r.Name&&(n.Name=r.Name),void 0!==r.NextMarker&&(n.NextMarker=r.NextMarker),void 0!==r.Prefix&&(n.Prefix=r.Prefix),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Yr.b),Zi=n(415),Ji=n(196),Qi=n(206),eo=n(40),to=function(){function e(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}return e.fromNumber=function(t){if(t>0x8000000000000000||t<-0x8000000000000000)throw new Error(t+" is too large (or, if negative, too small) to represent as an Int64");for(var n=new Uint8Array(8),r=7,i=Math.abs(Math.round(t));r>-1&&i>0;r--,i/=256)n[r]=i;return t<0&&no(n),new e(n)},e.prototype.valueOf=function(){var e=this.bytes.slice(0),t=128&e[0];return t&&no(e),parseInt(Object(eo.b)(e),16)*(t?-1:1)},e.prototype.toString=function(){return String(this.valueOf())},e}();function no(e){for(var t=0;t<8;t++)e[t]^=255;for(t=7;t>-1&&(e[t]++,0===e[t]);t--);}var ro,io=function(){function e(e,t){this.toUtf8=e,this.fromUtf8=t}return e.prototype.format=function(e){var t,n,r,i,o=[];try{for(var a=Object(Zr.__values)(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=this.fromUtf8(u);o.push(Uint8Array.from([c.byteLength]),c,this.formatHeaderValue(e[u]))}}catch(m){t={error:m}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}var l=new Uint8Array(o.reduce((function(e,t){return e+t.byteLength}),0)),f=0;try{for(var h=Object(Zr.__values)(o),d=h.next();!d.done;d=h.next()){var p=d.value;l.set(p,f),f+=p.byteLength}}catch(g){r={error:g}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return l},e.prototype.formatHeaderValue=function(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":var t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":var n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":var r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":var i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);var o=new Uint8Array(i.buffer);return o.set(e.value,3),o;case"string":var a=this.fromUtf8(e.value),s=new DataView(new ArrayBuffer(3+a.byteLength));s.setUint8(0,7),s.setUint16(1,a.byteLength,!1);var u=new Uint8Array(s.buffer);return u.set(a,3),u;case"timestamp":var c=new Uint8Array(9);return c[0]=8,c.set(to.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!mo.test(e.value))throw new Error("Invalid UUID received: "+e.value);var l=new Uint8Array(17);return l[0]=9,l.set(Object(eo.a)(e.value.replace(/\-/g,"")),1),l}},e.prototype.parse=function(e){for(var t={},n=0;n=a?r():o.readAsArrayBuffer(e.slice(s,Math.min(a,s+n)))}o.addEventListener("load",(function(e){var n=e.target.result;t(new Uint8Array(n)),s+=n.byteLength,u()})),u()}))}var _o=n(209),Eo=n(61),Mo=64,xo=[1732584193,4023233417,2562383102,271733878],ko=function(){function e(){this.state=Uint32Array.from(xo),this.buffer=new DataView(new ArrayBuffer(Mo)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(!function(e){if("string"===typeof e)return 0===e.length;return 0===e.byteLength}(e)){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=function(e){if("string"===typeof e)return Object(Eo.fromUtf8)(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)}(e),n=0,r=t.byteLength;for(this.bytesHashed+=r;r>0;)this.buffer.setUint8(this.bufferLength++,t[n++]),r--,this.bufferLength===Mo&&(this.hashBuffer(),this.bufferLength=0)}},e.prototype.digest=function(){return Object(Zr.__awaiter)(this,void 0,void 0,(function(){var e,t,n,r,i,o,a;return Object(Zr.__generator)(this,(function(s){if(!this.finished){if(t=(e=this).buffer,n=e.bufferLength,r=e.bytesHashed,i=8*r,t.setUint8(this.bufferLength++,128),n%Mo>=56){for(a=this.bufferLength;a>>0,!0),t.setUint32(60,Math.floor(i/4294967296),!0),this.hashBuffer(),this.finished=!0}for(o=new DataView(new ArrayBuffer(16)),a=0;a<4;a++)o.setUint32(4*a,this.state[a],!0);return[2,new Uint8Array(o.buffer,o.byteOffset,o.byteLength)]}))}))},e.prototype.hashBuffer=function(){var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],o=t[3];n=Co(n,r,i,o,e.getUint32(0,!0),7,3614090360),o=Co(o,n,r,i,e.getUint32(4,!0),12,3905402710),i=Co(i,o,n,r,e.getUint32(8,!0),17,606105819),r=Co(r,i,o,n,e.getUint32(12,!0),22,3250441966),n=Co(n,r,i,o,e.getUint32(16,!0),7,4118548399),o=Co(o,n,r,i,e.getUint32(20,!0),12,1200080426),i=Co(i,o,n,r,e.getUint32(24,!0),17,2821735955),r=Co(r,i,o,n,e.getUint32(28,!0),22,4249261313),n=Co(n,r,i,o,e.getUint32(32,!0),7,1770035416),o=Co(o,n,r,i,e.getUint32(36,!0),12,2336552879),i=Co(i,o,n,r,e.getUint32(40,!0),17,4294925233),r=Co(r,i,o,n,e.getUint32(44,!0),22,2304563134),n=Co(n,r,i,o,e.getUint32(48,!0),7,1804603682),o=Co(o,n,r,i,e.getUint32(52,!0),12,4254626195),i=Co(i,o,n,r,e.getUint32(56,!0),17,2792965006),n=Ao(n,r=Co(r,i,o,n,e.getUint32(60,!0),22,1236535329),i,o,e.getUint32(4,!0),5,4129170786),o=Ao(o,n,r,i,e.getUint32(24,!0),9,3225465664),i=Ao(i,o,n,r,e.getUint32(44,!0),14,643717713),r=Ao(r,i,o,n,e.getUint32(0,!0),20,3921069994),n=Ao(n,r,i,o,e.getUint32(20,!0),5,3593408605),o=Ao(o,n,r,i,e.getUint32(40,!0),9,38016083),i=Ao(i,o,n,r,e.getUint32(60,!0),14,3634488961),r=Ao(r,i,o,n,e.getUint32(16,!0),20,3889429448),n=Ao(n,r,i,o,e.getUint32(36,!0),5,568446438),o=Ao(o,n,r,i,e.getUint32(56,!0),9,3275163606),i=Ao(i,o,n,r,e.getUint32(12,!0),14,4107603335),r=Ao(r,i,o,n,e.getUint32(32,!0),20,1163531501),n=Ao(n,r,i,o,e.getUint32(52,!0),5,2850285829),o=Ao(o,n,r,i,e.getUint32(8,!0),9,4243563512),i=Ao(i,o,n,r,e.getUint32(28,!0),14,1735328473),n=To(n,r=Ao(r,i,o,n,e.getUint32(48,!0),20,2368359562),i,o,e.getUint32(20,!0),4,4294588738),o=To(o,n,r,i,e.getUint32(32,!0),11,2272392833),i=To(i,o,n,r,e.getUint32(44,!0),16,1839030562),r=To(r,i,o,n,e.getUint32(56,!0),23,4259657740),n=To(n,r,i,o,e.getUint32(4,!0),4,2763975236),o=To(o,n,r,i,e.getUint32(16,!0),11,1272893353),i=To(i,o,n,r,e.getUint32(28,!0),16,4139469664),r=To(r,i,o,n,e.getUint32(40,!0),23,3200236656),n=To(n,r,i,o,e.getUint32(52,!0),4,681279174),o=To(o,n,r,i,e.getUint32(0,!0),11,3936430074),i=To(i,o,n,r,e.getUint32(12,!0),16,3572445317),r=To(r,i,o,n,e.getUint32(24,!0),23,76029189),n=To(n,r,i,o,e.getUint32(36,!0),4,3654602809),o=To(o,n,r,i,e.getUint32(48,!0),11,3873151461),i=To(i,o,n,r,e.getUint32(60,!0),16,530742520),n=Io(n,r=To(r,i,o,n,e.getUint32(8,!0),23,3299628645),i,o,e.getUint32(0,!0),6,4096336452),o=Io(o,n,r,i,e.getUint32(28,!0),10,1126891415),i=Io(i,o,n,r,e.getUint32(56,!0),15,2878612391),r=Io(r,i,o,n,e.getUint32(20,!0),21,4237533241),n=Io(n,r,i,o,e.getUint32(48,!0),6,1700485571),o=Io(o,n,r,i,e.getUint32(12,!0),10,2399980690),i=Io(i,o,n,r,e.getUint32(40,!0),15,4293915773),r=Io(r,i,o,n,e.getUint32(4,!0),21,2240044497),n=Io(n,r,i,o,e.getUint32(32,!0),6,1873313359),o=Io(o,n,r,i,e.getUint32(60,!0),10,4264355552),i=Io(i,o,n,r,e.getUint32(24,!0),15,2734768916),r=Io(r,i,o,n,e.getUint32(52,!0),21,1309151649),n=Io(n,r,i,o,e.getUint32(16,!0),6,4149444226),o=Io(o,n,r,i,e.getUint32(44,!0),10,3174756917),i=Io(i,o,n,r,e.getUint32(8,!0),15,718787259),r=Io(r,i,o,n,e.getUint32(36,!0),21,3951481745),t[0]=n+t[0]&4294967295,t[1]=r+t[1]&4294967295,t[2]=i+t[2]&4294967295,t[3]=o+t[3]&4294967295},e}();function Oo(e,t,n,r,i,o){return((t=(t+e&4294967295)+(r+o&4294967295)&4294967295)<>>32-i)+n&4294967295}function Co(e,t,n,r,i,o,a){return Oo(t&n|~t&r,e,t,i,o,a)}function Ao(e,t,n,r,i,o,a){return Oo(t&r|n&~r,e,t,i,o,a)}function To(e,t,n,r,i,o,a){return Oo(t^n^r,e,t,i,o,a)}function Io(e,t,n,r,i,o,a){return Oo(n^(t|~r),e,t,i,o,a)}var Po=n(78),Ro=n(96),jo=n(197),No=n(198),Lo="s3.{region}.amazonaws.com",Do=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),Uo=new Set(["cn-north-1","cn-northwest-1"]),Bo=new Set(["us-iso-east-1"]),Fo=new Set(["us-isob-east-1"]),zo=new Set(["us-gov-east-1","us-gov-west-1"]),qo={apiVersion:"2006-03-01",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"af-south-1":n={hostname:"s3.af-south-1.amazonaws.com",partition:"aws"};break;case"ap-east-1":n={hostname:"s3.ap-east-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-1":n={hostname:"s3.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"s3.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"s3.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"s3.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"s3.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"aws-global":n={hostname:"s3.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"ca-central-1":n={hostname:"s3.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"s3.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"cn-northwest-1":n={hostname:"s3.cn-northwest-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"s3.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"s3.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-south-1":n={hostname:"s3.eu-south-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"s3.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"s3.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"s3.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-gov-west-1":n={hostname:"s3-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"me-south-1":n={hostname:"s3.me-south-1.amazonaws.com",partition:"aws"};break;case"s3-external-1":n={hostname:"s3-external-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"sa-east-1":n={hostname:"s3.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"s3.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"s3.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-east-1":n={hostname:"s3.us-gov-east-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-gov-west-1":n={hostname:"s3.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-iso-east-1":n={hostname:"s3.us-iso-east-1.c2s.ic.gov",partition:"aws-iso"};break;case"us-isob-east-1":n={hostname:"s3.us-isob-east-1.sc2s.sgov.gov",partition:"aws-iso-b"};break;case"us-west-1":n={hostname:"s3.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"s3.us-west-2.amazonaws.com",partition:"aws"};break;default:Do.has(e)&&(n={hostname:Lo.replace("{region}",e),partition:"aws"}),Uo.has(e)&&(n={hostname:"s3.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Bo.has(e)&&(n={hostname:"s3.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Fo.has(e)&&(n={hostname:"s3.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),zo.has(e)&&(n={hostname:"s3.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:Lo.replace("{region}",e),partition:"aws"})}return Promise.resolve(l({signingService:"s3"},n))},serviceId:"S3",signingEscapePath:!1,urlParser:n(211).a,useArnRegion:!1},Ho=l(l({},qo),{runtime:"browser",base64Decoder:Ro.a,base64Encoder:Ro.b,bodyLengthChecker:jo.a,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:Object(No.a)({serviceId:qo.serviceId,clientVersion:Zi.version}),eventStreamSerdeProvider:function(e){return new yo(e)},maxAttempts:Po.a,md5:ko,region:Object(_o.a)("Region is missing"),requestHandler:new wo.a,sha256:Ji.Sha256,streamCollector:wo.b,streamHasher:function(e,t){return Object(Zr.__awaiter)(this,void 0,void 0,(function(){var n;return Object(Zr.__generator)(this,(function(r){switch(r.label){case 0:return n=new e,[4,So(t,(function(e){n.update(e)}))];case 1:return r.sent(),[2,n.digest()]}}))}))},utf8Decoder:Eo.fromUtf8,utf8Encoder:Eo.toUtf8}),Vo=n(137),Wo=n(195);var Ko={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Go=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(Zr.__awaiter)(t,void 0,void 0,(function(){var t;return Object(Zr.__generator)(this,(function(i){return t=r.request,Xr.a.isInstance(t)&&t.body&&"node"===e.runtime&&(t.headers=Object(Zr.__assign)(Object(Zr.__assign)({},t.headers),{Expect:"100-continue"})),[2,n(Object(Zr.__assign)(Object(Zr.__assign)({},r),{request:t}))]}))}))}}}(e),Ko)}}},$o=n(133),Yo=n(210);var Xo={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Zo=function(e){return{applyToStack:function(e){e.add(function(){var e=this;return function(t){return function(n){return Object(Zr.__awaiter)(e,void 0,void 0,(function(){var e,r;return Object(Zr.__generator)(this,(function(i){if("string"===typeof(e=n.input.Bucket)&&!ki(e)&&e.indexOf("/")>=0)throw(r=new Error("Bucket name shouldn't contain '/', received '"+e+"'")).name="InvalidBucketName",r;return[2,t(Object(Zr.__assign)({},n))]}))}))}}}(),Xo)}}},Jo={step:"build",tags:["USE_REGIONAL_ENDPOINT","S3"],name:"useRegionalEndpointMiddleware",override:!0},Qo=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Object(Zr.__awaiter)(void 0,void 0,void 0,(function(){var r,i;return Object(Zr.__generator)(this,(function(o){switch(o.label){case 0:return r=n.request,!Xr.a.isInstance(r)||e.isCustomEndpoint?[2,t(Object(Zr.__assign)({},n))]:"s3.amazonaws.com"!==r.hostname?[3,1]:(r.hostname="s3.us-east-1.amazonaws.com",[3,3]);case 1:return i="aws-global",[4,e.region()];case 2:i===o.sent()&&(r.hostname="s3.amazonaws.com"),o.label=3;case 3:return[2,t(Object(Zr.__assign)({},n))]}}))}))}}}(e),Jo)}}},ea=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},ta=function(e,t){return ea(e,t).then((function(e){return t.utf8Encoder(e)}))},na={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ra=function(e){return{applyToStack:function(t){t.addRelativeTo(function(e){return function(t){return function(n){return Object(Zr.__awaiter)(void 0,void 0,void 0,(function(){var r,i,o,a,s,u,c;return Object(Zr.__generator)(this,(function(l){switch(l.label){case 0:return[4,t(n)];case 1:return r=l.sent(),i=r.response,Xr.b.isInstance(i)?(o=i.statusCode,a=i.body,o<200&&o>=300?[2,r]:[4,ea(a,e)]):[2,r];case 2:return s=l.sent(),[4,ta(s,e)];case 3:if(u=l.sent(),0===s.length)throw(c=new Error("S3 aborted request")).name="InternalError",c;return u&&u.match("")&&(i.statusCode=400),i.body=s,[2,r]}}))}))}}}(e),na)}}},ia=n(162),oa=n(135),aa=function(e){function t(t){var n,r=this,i=l(l({},Ho),t),o=Object(Vo.b)(i),a=Object(Vo.a)(o),s=Object(ia.b)(a),u=Object(Po.c)(s),c=function(e){var t=e.bucketEndpoint,n=void 0!==t&&t,r=e.forcePathStyle,i=void 0!==r&&r,o=e.useAccelerateEndpoint,a=void 0!==o&&o,s=e.useDualstackEndpoint,u=void 0!==s&&s,c=e.useArnRegion,l=void 0!==c&&c;return Object(Zr.__assign)(Object(Zr.__assign)({},e),{bucketEndpoint:n,forcePathStyle:i,useAccelerateEndpoint:a,useDualstackEndpoint:u,useArnRegion:"function"===typeof l?l:function(){return Promise.resolve(l)}})}(Object($o.b)(u)),f=Object(oa.b)(c),h=(n=f,Object(Zr.__assign)(Object(Zr.__assign)({},n),{eventStreamMarshaller:n.eventStreamSerdeProvider(n)}));return(r=e.call(this,h)||this).config=h,r.middlewareStack.use(Object(ia.a)(r.config)),r.middlewareStack.use(Object(Po.b)(r.config)),r.middlewareStack.use(Object(Wo.a)(r.config)),r.middlewareStack.use(Object($o.a)(r.config)),r.middlewareStack.use(Object(Yo.a)(r.config)),r.middlewareStack.use(Zo(r.config)),r.middlewareStack.use(Qo(r.config)),r.middlewareStack.use(Go(r.config)),r.middlewareStack.use(Object(oa.a)(r.config)),r}return c(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(Yr.a),sa=n(124);function ua(e){var t=e.port,n=e.query,r=e.protocol,i=e.path,o=e.hostname;r&&":"!==r.substr(-1)&&(r+=":"),t&&(o+=":"+t),i&&"/"!==i.charAt(0)&&(i="/"+i);var a=n?Object(sa.a)(n):"";return a&&"?"!==a[0]&&(a="?"+a),r+"//"+o+i+a}function ca(e,t){return Object(Zr.__awaiter)(this,void 0,void 0,(function(){var n,r,i=this;return Object(Zr.__generator)(this,(function(o){switch(o.label){case 0:return n=function(e){return function(e){return Object(Zr.__awaiter)(i,void 0,void 0,(function(){return Object(Zr.__generator)(this,(function(t){return[2,{output:{request:e.request},response:void 0}]}))}))}},(r=e.middlewareStack.clone()).add(n,{step:"build",priority:"low"}),[4,t.resolveMiddleware(r,e.config,void 0)(t).then((function(e){return e.output.request}))];case 1:return[2,o.sent()]}}))}))}var la=n(208),fa=function(){function e(e){var t=Object(Zr.__assign)({service:e.signingName||e.service||"s3",uriEscapePath:e.uriEscapePath||!1},e);this.signer=new la.a(t)}return e.prototype.presign=function(e,t){void 0===t&&(t={});var n=t.unsignableHeaders,r=void 0===n?new Set:n,i=t.unhoistableHeaders,o=void 0===i?new Set:i,a=Object(Zr.__rest)(t,["unsignableHeaders","unhoistableHeaders"]);return Object(Zr.__awaiter)(this,void 0,void 0,(function(){return Object(Zr.__generator)(this,(function(t){return r.add("content-type"),Object.keys(e.headers).map((function(e){return e.toLowerCase()})).filter((function(e){return e.startsWith("x-amz-server-side-encryption")})).forEach((function(e){o.add(e)})),e.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",e.headers.host||(e.headers.host=e.hostname),[2,this.signer.presign(e,Object(Zr.__assign)({expiresIn:900,unsignableHeaders:r,unhoistableHeaders:o},a))]}))}))},e}(),ha=n(77),da=n.n(ha),pa=function(e){var t="function"===typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ma=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},ga=new r.a("axios-http-handler"),va="sendProgress";var ya=function(e,t){var n,r;try{for(var i=pa(Object.entries(e)),o=i.next();!o.done;o=i.next()){var a=ma(o.value,2),s=a[0],u=a[1];s!==t&&s.toUpperCase()===t.toUpperCase()&&(e[t]=u,delete e[s])}}catch(c){n={error:c}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},ba=[function(e,t){return n=e,"undefined"!==typeof Blob&&n instanceof Blob?(ya(t,"Content-Type"),ya(t,"Accept"),e):da.a.defaults.transformRequest[0].call(null,e,t);var n}],wa=function(){function e(e,t,n){void 0===e&&(e={}),this.httpOptions=e,this.emitter=t,this.cancelTokenSource=n}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=this.httpOptions.requestTimeout,r=this.emitter,i=e.path;if(e.query){var o=Object(sa.a)(e.query);o&&(i+="?"+o)}var a=e.port,u=e.protocol+"//"+e.hostname+(a?":"+a:"")+i,c={};c.url=u,c.method=e.method,c.headers=e.headers,delete c.headers.host,e.body?c.data=e.body:c.headers["Content-Type"]&&(c.data=null),r&&(c.onUploadProgress=function(e){r.emit(va,e),ga.debug(e)}),this.cancelTokenSource&&(c.cancelToken=this.cancelTokenSource.token),c.responseType="blob",s.a.isReactNative&&(c.transformRequest=ba);var l=[da.a.request(c).then((function(e){return{response:new Xr.b({headers:e.headers,statusCode:e.status,body:e.data})}})).catch((function(e){throw ga.error(e),e})),Sa(n)];return Promise.race(l)},e}();function Sa(e){return void 0===e&&(e=0),new Promise((function(t,n){e&&setTimeout((function(){var t=new Error("Request did not complete within "+e+" ms");t.name="TimeoutError",n(t)}),e)}))}var _a,Ea,Ma,xa,ka,Oa,Ca,Aa,Ta,Ia,Pa,Ra,ja,Na,La,Da,Ua,Ba,Fa,za,qa,Ha,Va,Wa,Ka,Ga,$a,Ya,Xa,Za,Ja,Qa,es,ts,ns=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Wi.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Gi(t)),this.middlewareStack.use(Vi(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"S3Client",commandName:"PutObjectCommand",inputFilterSensitiveLog:Rr.filterSensitiveLog,outputFilterSensitiveLog:Pr.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,f,d,p;return h(this,(function(h){switch(h.label){case 0:if(n=l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l({"content-type":"application/octet-stream"},Ei(e.ACL)&&{"x-amz-acl":e.ACL}),Ei(e.CacheControl)&&{"cache-control":e.CacheControl}),Ei(e.ContentDisposition)&&{"content-disposition":e.ContentDisposition}),Ei(e.ContentEncoding)&&{"content-encoding":e.ContentEncoding}),Ei(e.ContentLanguage)&&{"content-language":e.ContentLanguage}),Ei(e.ContentLength)&&{"content-length":e.ContentLength.toString()}),Ei(e.ContentMD5)&&{"content-md5":e.ContentMD5}),Ei(e.ContentType)&&{"content-type":e.ContentType}),Ei(e.Expires)&&{expires:Object(Yr.d)(e.Expires).toString()}),Ei(e.GrantFullControl)&&{"x-amz-grant-full-control":e.GrantFullControl}),Ei(e.GrantRead)&&{"x-amz-grant-read":e.GrantRead}),Ei(e.GrantReadACP)&&{"x-amz-grant-read-acp":e.GrantReadACP}),Ei(e.GrantWriteACP)&&{"x-amz-grant-write-acp":e.GrantWriteACP}),Ei(e.ServerSideEncryption)&&{"x-amz-server-side-encryption":e.ServerSideEncryption}),Ei(e.StorageClass)&&{"x-amz-storage-class":e.StorageClass}),Ei(e.WebsiteRedirectLocation)&&{"x-amz-website-redirect-location":e.WebsiteRedirectLocation}),Ei(e.SSECustomerAlgorithm)&&{"x-amz-server-side-encryption-customer-algorithm":e.SSECustomerAlgorithm}),Ei(e.SSECustomerKey)&&{"x-amz-server-side-encryption-customer-key":e.SSECustomerKey}),Ei(e.SSECustomerKeyMD5)&&{"x-amz-server-side-encryption-customer-key-md5":e.SSECustomerKeyMD5}),Ei(e.SSEKMSKeyId)&&{"x-amz-server-side-encryption-aws-kms-key-id":e.SSEKMSKeyId}),Ei(e.SSEKMSEncryptionContext)&&{"x-amz-server-side-encryption-context":e.SSEKMSEncryptionContext}),Ei(e.BucketKeyEnabled)&&{"x-amz-server-side-encryption-bucket-key-enabled":e.BucketKeyEnabled.toString()}),Ei(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),Ei(e.Tagging)&&{"x-amz-tagging":e.Tagging}),Ei(e.ObjectLockMode)&&{"x-amz-object-lock-mode":e.ObjectLockMode}),Ei(e.ObjectLockRetainUntilDate)&&{"x-amz-object-lock-retain-until-date":(e.ObjectLockRetainUntilDate.toISOString().split(".")[0]+"Z").toString()}),Ei(e.ObjectLockLegalHoldStatus)&&{"x-amz-object-lock-legal-hold":e.ObjectLockLegalHoldStatus}),Ei(e.ExpectedBucketOwner)&&{"x-amz-expected-bucket-owner":e.ExpectedBucketOwner}),void 0!==e.Metadata&&Object.keys(e.Metadata).reduce((function(t,n){var r;return l(l({},t),((r={})["x-amz-meta-"+n.toLowerCase()]=e.Metadata[n],r))}),{})),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(Yr.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(Yr.e)(e)})).join("/")),o={"x-id":"PutObject"},void 0!==e.Body&&(s=e.Body,a=s),[4,t.endpoint()];case 1:return u=h.sent(),c=u.hostname,f=u.protocol,d=void 0===f?"https":f,p=u.port,[2,new Xr.a({protocol:d,hostname:c,port:p,method:"PUT",headers:n,path:r,query:o,body:a})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n;return h(this,(function(r){switch(r.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,ui(e,t)]:(n={$metadata:Si(e),BucketKeyEnabled:void 0,ETag:void 0,Expiration:void 0,RequestCharged:void 0,SSECustomerAlgorithm:void 0,SSECustomerKeyMD5:void 0,SSEKMSEncryptionContext:void 0,SSEKMSKeyId:void 0,ServerSideEncryption:void 0,VersionId:void 0},void 0!==e.headers["x-amz-expiration"]&&(n.Expiration=e.headers["x-amz-expiration"]),void 0!==e.headers.etag&&(n.ETag=e.headers.etag),void 0!==e.headers["x-amz-server-side-encryption"]&&(n.ServerSideEncryption=e.headers["x-amz-server-side-encryption"]),void 0!==e.headers["x-amz-version-id"]&&(n.VersionId=e.headers["x-amz-version-id"]),void 0!==e.headers["x-amz-server-side-encryption-customer-algorithm"]&&(n.SSECustomerAlgorithm=e.headers["x-amz-server-side-encryption-customer-algorithm"]),void 0!==e.headers["x-amz-server-side-encryption-customer-key-md5"]&&(n.SSECustomerKeyMD5=e.headers["x-amz-server-side-encryption-customer-key-md5"]),void 0!==e.headers["x-amz-server-side-encryption-aws-kms-key-id"]&&(n.SSEKMSKeyId=e.headers["x-amz-server-side-encryption-aws-kms-key-id"]),void 0!==e.headers["x-amz-server-side-encryption-context"]&&(n.SSEKMSEncryptionContext=e.headers["x-amz-server-side-encryption-context"]),void 0!==e.headers["x-amz-server-side-encryption-bucket-key-enabled"]&&(n.BucketKeyEnabled="true"===e.headers["x-amz-server-side-encryption-bucket-key-enabled"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),[4,_i(e.body,t)]);case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Yr.b),rs=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Wi.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Gi(t)),this.middlewareStack.use(Vi(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"S3Client",commandName:"CreateMultipartUploadCommand",inputFilterSensitiveLog:D.filterSensitiveLog,outputFilterSensitiveLog:L.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,f;return h(this,(function(h){switch(h.label){case 0:if(n=l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l({},Ei(e.ACL)&&{"x-amz-acl":e.ACL}),Ei(e.CacheControl)&&{"cache-control":e.CacheControl}),Ei(e.ContentDisposition)&&{"content-disposition":e.ContentDisposition}),Ei(e.ContentEncoding)&&{"content-encoding":e.ContentEncoding}),Ei(e.ContentLanguage)&&{"content-language":e.ContentLanguage}),Ei(e.ContentType)&&{"content-type":e.ContentType}),Ei(e.Expires)&&{expires:Object(Yr.d)(e.Expires).toString()}),Ei(e.GrantFullControl)&&{"x-amz-grant-full-control":e.GrantFullControl}),Ei(e.GrantRead)&&{"x-amz-grant-read":e.GrantRead}),Ei(e.GrantReadACP)&&{"x-amz-grant-read-acp":e.GrantReadACP}),Ei(e.GrantWriteACP)&&{"x-amz-grant-write-acp":e.GrantWriteACP}),Ei(e.ServerSideEncryption)&&{"x-amz-server-side-encryption":e.ServerSideEncryption}),Ei(e.StorageClass)&&{"x-amz-storage-class":e.StorageClass}),Ei(e.WebsiteRedirectLocation)&&{"x-amz-website-redirect-location":e.WebsiteRedirectLocation}),Ei(e.SSECustomerAlgorithm)&&{"x-amz-server-side-encryption-customer-algorithm":e.SSECustomerAlgorithm}),Ei(e.SSECustomerKey)&&{"x-amz-server-side-encryption-customer-key":e.SSECustomerKey}),Ei(e.SSECustomerKeyMD5)&&{"x-amz-server-side-encryption-customer-key-md5":e.SSECustomerKeyMD5}),Ei(e.SSEKMSKeyId)&&{"x-amz-server-side-encryption-aws-kms-key-id":e.SSEKMSKeyId}),Ei(e.SSEKMSEncryptionContext)&&{"x-amz-server-side-encryption-context":e.SSEKMSEncryptionContext}),Ei(e.BucketKeyEnabled)&&{"x-amz-server-side-encryption-bucket-key-enabled":e.BucketKeyEnabled.toString()}),Ei(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),Ei(e.Tagging)&&{"x-amz-tagging":e.Tagging}),Ei(e.ObjectLockMode)&&{"x-amz-object-lock-mode":e.ObjectLockMode}),Ei(e.ObjectLockRetainUntilDate)&&{"x-amz-object-lock-retain-until-date":(e.ObjectLockRetainUntilDate.toISOString().split(".")[0]+"Z").toString()}),Ei(e.ObjectLockLegalHoldStatus)&&{"x-amz-object-lock-legal-hold":e.ObjectLockLegalHoldStatus}),Ei(e.ExpectedBucketOwner)&&{"x-amz-expected-bucket-owner":e.ExpectedBucketOwner}),void 0!==e.Metadata&&Object.keys(e.Metadata).reduce((function(t,n){var r;return l(l({},t),((r={})["x-amz-meta-"+n.toLowerCase()]=e.Metadata[n],r))}),{})),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(Yr.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(Yr.e)(e)})).join("/")),o={uploads:""},[4,t.endpoint()];case 1:return a=h.sent(),s=a.hostname,u=a.protocol,c=void 0===u?"https":u,f=a.port,[2,new Xr.a({protocol:c,hostname:s,port:f,method:"POST",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r;return h(this,(function(i){switch(i.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,ri(e,t)]:(n={$metadata:Si(e),AbortDate:void 0,AbortRuleId:void 0,Bucket:void 0,BucketKeyEnabled:void 0,Key:void 0,RequestCharged:void 0,SSECustomerAlgorithm:void 0,SSECustomerKeyMD5:void 0,SSEKMSEncryptionContext:void 0,SSEKMSKeyId:void 0,ServerSideEncryption:void 0,UploadId:void 0},void 0!==e.headers["x-amz-abort-date"]&&(n.AbortDate=new Date(e.headers["x-amz-abort-date"])),void 0!==e.headers["x-amz-abort-rule-id"]&&(n.AbortRuleId=e.headers["x-amz-abort-rule-id"]),void 0!==e.headers["x-amz-server-side-encryption"]&&(n.ServerSideEncryption=e.headers["x-amz-server-side-encryption"]),void 0!==e.headers["x-amz-server-side-encryption-customer-algorithm"]&&(n.SSECustomerAlgorithm=e.headers["x-amz-server-side-encryption-customer-algorithm"]),void 0!==e.headers["x-amz-server-side-encryption-customer-key-md5"]&&(n.SSECustomerKeyMD5=e.headers["x-amz-server-side-encryption-customer-key-md5"]),void 0!==e.headers["x-amz-server-side-encryption-aws-kms-key-id"]&&(n.SSEKMSKeyId=e.headers["x-amz-server-side-encryption-aws-kms-key-id"]),void 0!==e.headers["x-amz-server-side-encryption-context"]&&(n.SSEKMSEncryptionContext=e.headers["x-amz-server-side-encryption-context"]),void 0!==e.headers["x-amz-server-side-encryption-bucket-key-enabled"]&&(n.BucketKeyEnabled="true"===e.headers["x-amz-server-side-encryption-bucket-key-enabled"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),[4,Mi(e.body,t)]);case 1:return void 0!==(r=i.sent()).Bucket&&(n.Bucket=r.Bucket),void 0!==r.Key&&(n.Key=r.Key),void 0!==r.UploadId&&(n.UploadId=r.UploadId),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Yr.b);(_a||(_a={})).filterSensitiveLog=function(e){return l({},e)},(Ea||(Ea={})).filterSensitiveLog=function(e){return l(l({},e),e.Encryption&&{Encryption:$r.filterSensitiveLog(e.Encryption)})},(Ma||(Ma={})).filterSensitiveLog=function(e){return l(l({},e),e.S3&&{S3:Ea.filterSensitiveLog(e.S3)})},function(e){e.IGNORE="IGNORE",e.NONE="NONE",e.USE="USE"}(xa||(xa={})),(ka||(ka={})).filterSensitiveLog=function(e){return l({},e)},function(e){e.DOCUMENT="DOCUMENT",e.LINES="LINES"}(Oa||(Oa={})),(Ca||(Ca={})).filterSensitiveLog=function(e){return l({},e)},(Aa||(Aa={})).filterSensitiveLog=function(e){return l({},e)},(Ta||(Ta={})).filterSensitiveLog=function(e){return l({},e)},function(e){e.ALWAYS="ALWAYS",e.ASNEEDED="ASNEEDED"}(Ia||(Ia={})),(Pa||(Pa={})).filterSensitiveLog=function(e){return l({},e)},(Ra||(Ra={})).filterSensitiveLog=function(e){return l({},e)},(ja||(ja={})).filterSensitiveLog=function(e){return l({},e)},(Na||(Na={})).filterSensitiveLog=function(e){return l({},e)},function(e){e.SELECT="SELECT"}(La||(La={})),(Da||(Da={})).filterSensitiveLog=function(e){return l(l({},e),e.OutputLocation&&{OutputLocation:Ma.filterSensitiveLog(e.OutputLocation)})},(Ua||(Ua={})).filterSensitiveLog=function(e){return l(l({},e),e.RestoreRequest&&{RestoreRequest:Da.filterSensitiveLog(e.RestoreRequest)})},(Ba||(Ba={})).filterSensitiveLog=function(e){return l({},e)},(Fa||(Fa={})).filterSensitiveLog=function(e){return l({},e)},(za||(za={})).filterSensitiveLog=function(e){return l({},e)},(qa||(qa={})).filterSensitiveLog=function(e){return l({},e)},(Ha||(Ha={})).filterSensitiveLog=function(e){return l({},e)},(Va||(Va={})).filterSensitiveLog=function(e){return l({},e)},(Wa||(Wa={})).filterSensitiveLog=function(e){return l({},e)},function(e){e.visit=function(e,t){return void 0!==e.Records?t.Records(e.Records):void 0!==e.Stats?t.Stats(e.Stats):void 0!==e.Progress?t.Progress(e.Progress):void 0!==e.Cont?t.Cont(e.Cont):void 0!==e.End?t.End(e.End):t._(e.$unknown[0],e.$unknown[1])},e.filterSensitiveLog=function(e){var t;return void 0!==e.Records?{Records:Ha.filterSensitiveLog(e.Records)}:void 0!==e.Stats?{Stats:Wa.filterSensitiveLog(e.Stats)}:void 0!==e.Progress?{Progress:qa.filterSensitiveLog(e.Progress)}:void 0!==e.Cont?{Cont:Ba.filterSensitiveLog(e.Cont)}:void 0!==e.End?{End:Fa.filterSensitiveLog(e.End)}:void 0!==e.$unknown?((t={})[e.$unknown[0]]="UNKNOWN",t):void 0}}(Ka||(Ka={})),(Ga||(Ga={})).filterSensitiveLog=function(e){return l(l({},e),e.Payload&&{Payload:"STREAMING_CONTENT"})},($a||($a={})).filterSensitiveLog=function(e){return l({},e)},(Ya||(Ya={})).filterSensitiveLog=function(e){return l({},e)},(Xa||(Xa={})).filterSensitiveLog=function(e){return l(l({},e),e.SSECustomerKey&&{SSECustomerKey:Yr.c})},(Za||(Za={})).filterSensitiveLog=function(e){return l(l({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:Yr.c})},(Ja||(Ja={})).filterSensitiveLog=function(e){return l(l({},e),e.SSECustomerKey&&{SSECustomerKey:Yr.c})},(Qa||(Qa={})).filterSensitiveLog=function(e){return l({},e)},(es||(es={})).filterSensitiveLog=function(e){return l(l({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:Yr.c})},(ts||(ts={})).filterSensitiveLog=function(e){return l(l(l({},e),e.SSECustomerKey&&{SSECustomerKey:Yr.c}),e.CopySourceSSECustomerKey&&{CopySourceSSECustomerKey:Yr.c})};var is=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Wi.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Gi(t)),this.middlewareStack.use(Vi(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"S3Client",commandName:"UploadPartCommand",inputFilterSensitiveLog:Ja.filterSensitiveLog,outputFilterSensitiveLog:Za.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,f,d,p;return h(this,(function(h){switch(h.label){case 0:if(n=l(l(l(l(l(l(l({"content-type":"application/octet-stream"},Ei(e.ContentLength)&&{"content-length":e.ContentLength.toString()}),Ei(e.ContentMD5)&&{"content-md5":e.ContentMD5}),Ei(e.SSECustomerAlgorithm)&&{"x-amz-server-side-encryption-customer-algorithm":e.SSECustomerAlgorithm}),Ei(e.SSECustomerKey)&&{"x-amz-server-side-encryption-customer-key":e.SSECustomerKey}),Ei(e.SSECustomerKeyMD5)&&{"x-amz-server-side-encryption-customer-key-md5":e.SSECustomerKeyMD5}),Ei(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),Ei(e.ExpectedBucketOwner)&&{"x-amz-expected-bucket-owner":e.ExpectedBucketOwner}),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(Yr.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(Yr.e)(e)})).join("/")),o=l(l({"x-id":"UploadPart"},void 0!==e.PartNumber&&{partNumber:e.PartNumber.toString()}),void 0!==e.UploadId&&{uploadId:e.UploadId}),void 0!==e.Body&&(s=e.Body,a=s),[4,t.endpoint()];case 1:return u=h.sent(),c=u.hostname,f=u.protocol,d=void 0===f?"https":f,p=u.port,[2,new Xr.a({protocol:d,hostname:c,port:p,method:"PUT",headers:n,path:r,query:o,body:a})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n;return h(this,(function(r){switch(r.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,ci(e,t)]:(n={$metadata:Si(e),BucketKeyEnabled:void 0,ETag:void 0,RequestCharged:void 0,SSECustomerAlgorithm:void 0,SSECustomerKeyMD5:void 0,SSEKMSKeyId:void 0,ServerSideEncryption:void 0},void 0!==e.headers["x-amz-server-side-encryption"]&&(n.ServerSideEncryption=e.headers["x-amz-server-side-encryption"]),void 0!==e.headers.etag&&(n.ETag=e.headers.etag),void 0!==e.headers["x-amz-server-side-encryption-customer-algorithm"]&&(n.SSECustomerAlgorithm=e.headers["x-amz-server-side-encryption-customer-algorithm"]),void 0!==e.headers["x-amz-server-side-encryption-customer-key-md5"]&&(n.SSECustomerKeyMD5=e.headers["x-amz-server-side-encryption-customer-key-md5"]),void 0!==e.headers["x-amz-server-side-encryption-aws-kms-key-id"]&&(n.SSEKMSKeyId=e.headers["x-amz-server-side-encryption-aws-kms-key-id"]),void 0!==e.headers["x-amz-server-side-encryption-bucket-key-enabled"]&&(n.BucketKeyEnabled="true"===e.headers["x-amz-server-side-encryption-bucket-key-enabled"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),[4,_i(e.body,t)]);case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Yr.b),os=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Wi.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(ra(t)),this.middlewareStack.use(Vi(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"S3Client",commandName:"CompleteMultipartUploadCommand",inputFilterSensitiveLog:k.filterSensitiveLog,outputFilterSensitiveLog:E.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,f,d,p;return h(this,(function(h){switch(h.label){case 0:if(n=l(l({"content-type":"application/xml"},Ei(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),Ei(e.ExpectedBucketOwner)&&{"x-amz-expected-bucket-owner":e.ExpectedBucketOwner}),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(Yr.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(Yr.e)(e)})).join("/")),o=l({},void 0!==e.UploadId&&{uploadId:e.UploadId}),void 0!==e.MultipartUpload&&(s=pi(e.MultipartUpload,t),a='',s.addAttribute("xmlns","http://s3.amazonaws.com/doc/2006-03-01/"),a+=s.toString()),[4,t.endpoint()];case 1:return u=h.sent(),c=u.hostname,f=u.protocol,d=void 0===f?"https":f,p=u.port,[2,new Xr.a({protocol:d,hostname:c,port:p,method:"POST",headers:n,path:r,query:o,body:a})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r;return h(this,(function(i){switch(i.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,ni(e,t)]:(n={$metadata:Si(e),Bucket:void 0,BucketKeyEnabled:void 0,ETag:void 0,Expiration:void 0,Key:void 0,Location:void 0,RequestCharged:void 0,SSEKMSKeyId:void 0,ServerSideEncryption:void 0,VersionId:void 0},void 0!==e.headers["x-amz-expiration"]&&(n.Expiration=e.headers["x-amz-expiration"]),void 0!==e.headers["x-amz-server-side-encryption"]&&(n.ServerSideEncryption=e.headers["x-amz-server-side-encryption"]),void 0!==e.headers["x-amz-version-id"]&&(n.VersionId=e.headers["x-amz-version-id"]),void 0!==e.headers["x-amz-server-side-encryption-aws-kms-key-id"]&&(n.SSEKMSKeyId=e.headers["x-amz-server-side-encryption-aws-kms-key-id"]),void 0!==e.headers["x-amz-server-side-encryption-bucket-key-enabled"]&&(n.BucketKeyEnabled="true"===e.headers["x-amz-server-side-encryption-bucket-key-enabled"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),[4,Mi(e.body,t)]);case 1:return void 0!==(r=i.sent()).Bucket&&(n.Bucket=r.Bucket),void 0!==r.ETag&&(n.ETag=r.ETag),void 0!==r.Key&&(n.Key=r.Key),void 0!==r.Location&&(n.Location=r.Location),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Yr.b),as=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Wi.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Vi(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"S3Client",commandName:"AbortMultipartUploadCommand",inputFilterSensitiveLog:m.filterSensitiveLog,outputFilterSensitiveLog:p.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,f;return h(this,(function(h){switch(h.label){case 0:if(n=l(l({},Ei(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),Ei(e.ExpectedBucketOwner)&&{"x-amz-expected-bucket-owner":e.ExpectedBucketOwner}),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(Yr.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(Yr.e)(e)})).join("/")),o=l({"x-id":"AbortMultipartUpload"},void 0!==e.UploadId&&{uploadId:e.UploadId}),[4,t.endpoint()];case 1:return a=h.sent(),s=a.hostname,u=a.protocol,c=void 0===u?"https":u,f=a.port,[2,new Xr.a({protocol:c,hostname:s,port:f,method:"DELETE",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n;return h(this,(function(r){switch(r.label){case 0:return 204!==e.statusCode&&e.statusCode>=300?[2,ti(e,t)]:(n={$metadata:Si(e),RequestCharged:void 0},void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),[4,_i(e.body,t)]);case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Yr.b),ss=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Wi.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Vi(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"S3Client",commandName:"ListPartsCommand",inputFilterSensitiveLog:ar.filterSensitiveLog,outputFilterSensitiveLog:or.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,f;return h(this,(function(h){switch(h.label){case 0:if(n=l(l({},Ei(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),Ei(e.ExpectedBucketOwner)&&{"x-amz-expected-bucket-owner":e.ExpectedBucketOwner}),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(Yr.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(Yr.e)(e)})).join("/")),o=l(l(l({"x-id":"ListParts"},void 0!==e.MaxParts&&{"max-parts":e.MaxParts.toString()}),void 0!==e.PartNumberMarker&&{"part-number-marker":e.PartNumberMarker}),void 0!==e.UploadId&&{uploadId:e.UploadId}),[4,t.endpoint()];case 1:return a=h.sent(),s=a.hostname,u=a.protocol,c=void 0===u?"https":u,f=a.port,[2,new Xr.a({protocol:c,hostname:s,port:f,method:"GET",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return f(void 0,void 0,void 0,(function(){var n,r;return h(this,(function(i){switch(i.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,si(e,t)]:(n={$metadata:Si(e),AbortDate:void 0,AbortRuleId:void 0,Bucket:void 0,Initiator:void 0,IsTruncated:void 0,Key:void 0,MaxParts:void 0,NextPartNumberMarker:void 0,Owner:void 0,PartNumberMarker:void 0,Parts:void 0,RequestCharged:void 0,StorageClass:void 0,UploadId:void 0},void 0!==e.headers["x-amz-abort-date"]&&(n.AbortDate=new Date(e.headers["x-amz-abort-date"])),void 0!==e.headers["x-amz-abort-rule-id"]&&(n.AbortRuleId=e.headers["x-amz-abort-rule-id"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),[4,Mi(e.body,t)]);case 1:return void 0!==(r=i.sent()).Bucket&&(n.Bucket=r.Bucket),void 0!==r.Initiator&&(n.Initiator=vi(r.Initiator,t)),void 0!==r.IsTruncated&&(n.IsTruncated="true"==r.IsTruncated),void 0!==r.Key&&(n.Key=r.Key),void 0!==r.MaxParts&&(n.MaxParts=parseInt(r.MaxParts)),void 0!==r.NextPartNumberMarker&&(n.NextPartNumberMarker=r.NextPartNumberMarker),void 0!==r.Owner&&(n.Owner=bi(r.Owner,t)),void 0!==r.PartNumberMarker&&(n.PartNumberMarker=r.PartNumberMarker),""===r.Part&&(n.Parts=[]),void 0!==r.Part&&(n.Parts=wi(Object(Yr.f)(r.Part),t)),void 0!==r.StorageClass&&(n.StorageClass=r.StorageClass),void 0!==r.UploadId&&(n.UploadId=r.UploadId),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Yr.b),us=n(84),cs=function(){return(cs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)throw new Error("Multi Part upload clean up failed");return[2]}}))}))},e.prototype.removeEventListener=function(e){e.emitter.removeAllListeners(va)},e.prototype.setupEventListener=function(e){var t=this;e.emitter.on(va,(function(n){t.progressChanged(e.partNumber,n.loaded-e._lastUploadedBytes),e._lastUploadedBytes=n.loaded}))},e.prototype.progressChanged=function(e,t){this.bytesUploaded+=t,this.emitter.emit(va,{loaded:this.bytesUploaded,total:this.totalBytesToUpload,part:e,key:this.params.Key})},e.prototype.byteLength=function(e){if(null===e||void 0===e)return 0;if("number"===typeof e.byteLength)return e.byteLength;if("number"===typeof e.length)return e.length;if("number"===typeof e.size)return e.size;if("string"!==typeof e.path)throw new Error("Cannot determine length of "+e)},e.prototype.validateAndSanitizeBody=function(e){return ls(this,void 0,void 0,(function(){return fs(this,(function(t){return this.isGenericObject(e)?[2,JSON.stringify(e)]:[2,e]}))}))},e.prototype.isGenericObject=function(e){if(null!==e&&"object"===typeof e)try{return!(this.byteLength(e)>=0)}catch(t){return!0}return!1},e.prototype._createNewS3Client=function(e,t){return ls(this,void 0,void 0,(function(){var n,r,i,o,a,u;return fs(this,(function(c){switch(c.label){case 0:return[4,this._getCredentials()];case 1:return n=c.sent(),r=e.region,i=e.dangerouslyConnectToHttpEndpointForTesting,o=e.cancelTokenSource,a={},i&&(a={endpoint:"http://localhost:20005",tls:!1,bucketEndpoint:!1,forcePathStyle:!0}),(u=new aa(cs(cs({region:r,credentials:n},a),{requestHandler:new wa({},t,o),customUserAgent:Object(s.b)()}))).middlewareStack.remove("contentLengthMiddleware"),[2,u]}}))}))},e.prototype._getCredentials=function(){return a.a.get().then((function(e){if(!e)return!1;var t=a.a.shear(e);return hs.debug("set credentials for storage",t),t})).catch((function(e){return hs.warn("ensure credentials error",e),!1}))},e}(),ps=function(){return(ps=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},xs=new r.a("StorageClass"),ks="AWSS3",Os=function(){function e(){this._config={},this._pluggables=[],this._cancelTokenSourceMap=new WeakMap,xs.debug("Storage Options",this._config),this.get=this.get.bind(this),this.put=this.put.bind(this),this.remove=this.remove.bind(this),this.list=this.list.bind(this)}return e.prototype.getModuleName=function(){return"Storage"},e.prototype.addPluggable=function(e){if(e&&"Storage"===e.getCategory()){this._pluggables.push(e);return e.configure(this._config[e.getProviderName()])}},e.prototype.getPluggable=function(e){var t=this._pluggables.find((function(t){return t.getProviderName()===e}));return void 0===t?(xs.debug("No plugin found with providerName",e),null):t},e.prototype.removePluggable=function(e){this._pluggables=this._pluggables.filter((function(t){return t.getProviderName()!==e}))},e.prototype.configure=function(e){var t=this;if(xs.debug("configure Storage"),!e)return this._config;var n=i.a.parseMobilehubConfig(e),r=Object.keys(n.Storage),o=["bucket","region","level","track","customPrefix","serverSideEncryption","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","SSEKMSKeyId"],a=function(e){return o.some((function(t){return t===e}))};return r&&r.find((function(e){return a(e)}))&&!n.Storage.AWSS3&&(n.Storage.AWSS3={}),Object.entries(n.Storage).map((function(e){var t=Ms(e,2),r=t[0],i=t[1];r&&a(r)&&void 0!==i&&(n.Storage.AWSS3[r]=i,delete n.Storage[r])})),Object.keys(n.Storage).forEach((function(e){"string"!==typeof n.Storage[e]&&(t._config[e]=Ss(Ss({},t._config[e]),n.Storage[e]))})),this._pluggables.forEach((function(e){e.configure(t._config[e.getProviderName()])})),0===this._pluggables.length&&this.addPluggable(new ws),this._config},e.prototype.getCancellableTokenSource=function(){return da.a.CancelToken.source()},e.prototype.updateRequestToBeCancellable=function(e,t){this._cancelTokenSourceMap.set(e,t)},e.prototype.cancel=function(e,t){var n=this._cancelTokenSourceMap.get(e);n?n.cancel(t):xs.debug("The request does not map to any cancel token")},e.prototype.get=function(e,t){var n=(t||{}).provider,r=void 0===n?ks:n,i=this._pluggables.find((function(e){return e.getProviderName()===r}));if(void 0===i)return xs.debug("No plugin found with providerName",r),Promise.reject("No plugin found in Storage for the provider");var o=this.getCancellableTokenSource(),a=i.get(e,Ss(Ss({},t),{cancelTokenSource:o}));return this.updateRequestToBeCancellable(a,o),a},e.prototype.isCancelError=function(e){return da.a.isCancel(e)},e.prototype.put=function(e,t,n){var r=(n||{}).provider,i=void 0===r?ks:r,o=this._pluggables.find((function(e){return e.getProviderName()===i}));if(void 0===o)return xs.debug("No plugin found with providerName",i),Promise.reject("No plugin found in Storage for the provider");var a=this.getCancellableTokenSource(),s=o.put(e,t,Ss(Ss({},n),{cancelTokenSource:a}));return this.updateRequestToBeCancellable(s,a),s},e.prototype.remove=function(e,t){return _s(this,void 0,void 0,(function(){var n,r,i;return Es(this,(function(o){return n=(t||{}).provider,r=void 0===n?ks:n,void 0===(i=this._pluggables.find((function(e){return e.getProviderName()===r})))?(xs.debug("No plugin found with providerName",r),[2,Promise.reject("No plugin found in Storage for the provider")]):[2,i.remove(e,t)]}))}))},e.prototype.list=function(e,t){return _s(this,void 0,void 0,(function(){var n,r,i;return Es(this,(function(o){return n=(t||{}).provider,r=void 0===n?ks:n,void 0===(i=this._pluggables.find((function(e){return e.getProviderName()===r})))?(xs.debug("No plugin found with providerName",r),[2,Promise.reject("No plugin found in Storage for the provider")]):[2,i.list(e,t)]}))}))},e}(),Cs=n(57),As=function(){return(As=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=t||n<0||g&&e-p>=l}function S(){var e=i();if(w(e))return _(e);h=setTimeout(S,function(e){var n=t-(e-d);return g?s(n,l-(e-p)):n}(e))}function _(e){return h=void 0,v&&u?y(e):(u=c=void 0,f)}function E(){var e=i(),n=w(e);if(u=arguments,c=this,d=e,n){if(void 0===h)return b(d);if(g)return clearTimeout(h),h=setTimeout(S,t),y(d)}return void 0===h&&(h=setTimeout(S,t)),f}return t=o(t)||0,r(n)&&(m=!!n.leading,l=(g="maxWait"in n)?a(o(n.maxWait)||0,t):l,v="trailing"in n?!!n.trailing:v),E.cancel=function(){void 0!==h&&clearTimeout(h),p=0,u=d=c=h=void 0},E.flush=function(){return void 0===h?f:_(i())},E}},function(e,t,n){var r=n(87),i=n(88);e.exports=function(e){return"number"==typeof e||i(e)&&"[object Number]"==r(e)}},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function i(e){if(!(t=r.exec(e)))throw new Error("invalid format: "+e);var t;return new o({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}i.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}},function(e,t,n){"use strict";var r=n(121);t.a=function(e){var t=e,n=e;function i(e,t,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;n(e[o],t)<0?r=o+1:i=o}return r}return 1===e.length&&(t=function(t,n){return e(t)-n},n=function(e){return function(t,n){return Object(r.a)(e(t),n)}}(e)),{left:i,center:function(e,n,r,o){null==r&&(r=0),null==o&&(o=e.length);var a=i(e,n,r,o-1);return a>r&&t(e[a-1],n)>-t(e[a],n)?a-1:a},right:function(e,t,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;n(e[o],t)>0?i=o:r=o+1}return r}}}},function(e,t,n){"use strict";(function(e){var r=n(0),i=n.n(r),o=n(37),a=n(267),s=n.n(a),u=1073741823,c="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:{};function l(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}var f=i.a.createContext||function(e,t){var n,i,a="__create-react-context-"+function(){var e="__global_unique_id__";return c[e]=(c[e]||0)+1}()+"__",f=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=l(t.props.value),t}Object(o.a)(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[a]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,i=e.value;((o=r)===(a=i)?0!==o||1/o===1/a:o!==o&&a!==a)?n=0:(n="function"===typeof t?t(r,i):u,0!==(n|=0)&&this.emitter.set(e.value,n))}var o,a},r.render=function(){return this.props.children},n}(r.Component);f.childContextTypes=((n={})[a]=s.a.object.isRequired,n);var h=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!==((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}Object(o.a)(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=void 0===t||null===t?u:t},r.componentDidMount=function(){this.context[a]&&this.context[a].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=void 0===e||null===e?u:e},r.componentWillUnmount=function(){this.context[a]&&this.context[a].off(this.onUpdate)},r.getValue=function(){return this.context[a]?this.context[a].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(r.Component);return h.contextTypes=((i={})[a]=s.a.object,i),{Provider:f,Consumer:h}};t.a=f}).call(this,n(36))},function(e,t,n){e.exports=n(748)()},function(e,t,n){var r=n(750);e.exports=d,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=h;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,a=0,s="",l=t&&t.delimiter||"/";null!=(n=i.exec(e));){var f=n[0],h=n[1],d=n.index;if(s+=e.slice(a,d),a=d+f.length,h)s+=h[1];else{var p=e[a],m=n[2],g=n[3],v=n[4],y=n[5],b=n[6],w=n[7];s&&(r.push(s),s="");var S=null!=m&&null!=p&&p!==m,_="+"===b||"*"===b,E="?"===b||"*"===b,M=n[2]||l,x=v||y;r.push({name:g||o++,prefix:m||"",delimiter:M,optional:E,repeat:_,partial:S,asterisk:!!w,pattern:x?c(x):w?".*":"[^"+u(M)+"]+?"})}}return a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,i=void 0!==r&&r,o=t.center,s=void 0===o?a||t.pulsate:o,u=t.fakeElement,c=void 0!==u&&u;if("mousedown"===e.type&&v.current)v.current=!1;else{"touchstart"===e.type&&(v.current=!0);var l,f,h,d=c?null:w.current,p=d?d.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)l=Math.round(p.width/2),f=Math.round(p.height/2);else{var m=e.touches?e.touches[0]:e,g=m.clientX,_=m.clientY;l=Math.round(g-p.left),f=Math.round(_-p.top)}if(s)(h=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(h+=1);else{var E=2*Math.max(Math.abs((d?d.clientWidth:0)-l),l)+2,M=2*Math.max(Math.abs((d?d.clientHeight:0)-f),f)+2;h=Math.sqrt(Math.pow(E,2)+Math.pow(M,2))}e.touches?null===b.current&&(b.current=function(){S({pulsate:i,rippleX:l,rippleY:f,rippleSize:h,cb:n})},y.current=setTimeout((function(){b.current&&(b.current(),b.current=null)}),80)):S({pulsate:i,rippleX:l,rippleY:f,rippleSize:h,cb:n})}}),[a,S]),M=o.useCallback((function(){_({},{pulsate:!0})}),[_]),k=o.useCallback((function(e,t){if(clearTimeout(y.current),"touchend"===e.type&&b.current)return e.persist(),b.current(),b.current=null,void(y.current=setTimeout((function(){k(e,t)})));b.current=null,p((function(e){return e.length>0?e.slice(1):e})),g.current=t}),[]);return o.useImperativeHandle(t,(function(){return{pulsate:M,start:_,stop:k}}),[M,_,k]),o.createElement("span",Object(r.a)({className:Object(u.a)(s.root,c),ref:w},l),o.createElement(E,{component:null,exit:!0},h))})),O=Object(f.a)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(o.memo(k)),C=o.forwardRef((function(e,t){var n=e.action,a=e.buttonRef,f=e.centerRipple,d=void 0!==f&&f,p=e.children,m=e.classes,g=e.className,v=e.component,y=void 0===v?"button":v,b=e.disabled,w=void 0!==b&&b,S=e.disableRipple,_=void 0!==S&&S,E=e.disableTouchRipple,M=void 0!==E&&E,x=e.focusRipple,k=void 0!==x&&x,C=e.focusVisibleClassName,A=e.onBlur,T=e.onClick,I=e.onFocus,P=e.onFocusVisible,R=e.onKeyDown,j=e.onKeyUp,N=e.onMouseDown,L=e.onMouseLeave,D=e.onMouseUp,U=e.onTouchEnd,B=e.onTouchMove,F=e.onTouchStart,z=e.onDragLeave,q=e.tabIndex,H=void 0===q?0:q,V=e.TouchRippleProps,W=e.type,K=void 0===W?"button":W,G=Object(i.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),$=o.useRef(null);var Y=o.useRef(null),X=o.useState(!1),Z=X[0],J=X[1];w&&Z&&J(!1);var Q=Object(h.a)(),ee=Q.isFocusVisible,te=Q.onBlurVisible,ne=Q.ref;function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M;return Object(l.a)((function(r){return t&&t(r),!n&&Y.current&&Y.current[e](r),!0}))}o.useImperativeHandle(n,(function(){return{focusVisible:function(){J(!0),$.current.focus()}}}),[]),o.useEffect((function(){Z&&k&&!_&&Y.current.pulsate()}),[_,k,Z]);var ie=re("start",N),oe=re("stop",z),ae=re("stop",D),se=re("stop",(function(e){Z&&e.preventDefault(),L&&L(e)})),ue=re("start",F),ce=re("stop",U),le=re("stop",B),fe=re("stop",(function(e){Z&&(te(e),J(!1)),A&&A(e)}),!1),he=Object(l.a)((function(e){$.current||($.current=e.currentTarget),ee(e)&&(J(!0),P&&P(e)),I&&I(e)})),de=function(){var e=s.findDOMNode($.current);return y&&"button"!==y&&!("A"===e.tagName&&e.href)},pe=o.useRef(!1),me=Object(l.a)((function(e){k&&!pe.current&&Z&&Y.current&&" "===e.key&&(pe.current=!0,e.persist(),Y.current.stop(e,(function(){Y.current.start(e)}))),e.target===e.currentTarget&&de()&&" "===e.key&&e.preventDefault(),R&&R(e),e.target===e.currentTarget&&de()&&"Enter"===e.key&&!w&&(e.preventDefault(),T&&T(e))})),ge=Object(l.a)((function(e){k&&" "===e.key&&Y.current&&Z&&!e.defaultPrevented&&(pe.current=!1,e.persist(),Y.current.stop(e,(function(){Y.current.pulsate(e)}))),j&&j(e),T&&e.target===e.currentTarget&&de()&&" "===e.key&&!e.defaultPrevented&&T(e)})),ve=y;"button"===ve&&G.href&&(ve="a");var ye={};"button"===ve?(ye.type=K,ye.disabled=w):("a"===ve&&G.href||(ye.role="button"),ye["aria-disabled"]=w);var be=Object(c.a)(a,t),we=Object(c.a)(ne,$),Se=Object(c.a)(be,we),_e=o.useState(!1),Ee=_e[0],Me=_e[1];o.useEffect((function(){Me(!0)}),[]);var xe=Ee&&!_&&!w;return o.createElement(ve,Object(r.a)({className:Object(u.a)(m.root,g,Z&&[m.focusVisible,C],w&&m.disabled),onBlur:fe,onClick:T,onFocus:he,onKeyDown:me,onKeyUp:ge,onMouseDown:ie,onMouseLeave:se,onMouseUp:ae,onDragLeave:oe,onTouchEnd:ce,onTouchMove:le,onTouchStart:ue,ref:Se,tabIndex:w?-1:H},ye,G),p,xe?o.createElement(O,Object(r.a)({ref:Y,center:d},V)):null)}));t.a=Object(f.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(C)},,,,,,,,,,,,,,,function(e,t,n){e.exports=n(461)()},function(e,t,n){e.exports=n(467)()},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(36))},function(e,t,n){var r=n(471),i=n(43),o=n(109),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?NaN:+e}},function(e,t,n){var r=n(21),i=n(221),o=n(475),a=n(290);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(t){}try{return e+""}catch(t){}}return""}},function(e,t,n){var r=n(499);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(506),i=n(174);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){(function(e){var r=n(66),i=n(511),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u}).call(this,n(67)(e))},function(e,t,n){var r=n(512),i=n(294),o=n(513),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){var r=n(170),i=n(521),o=n(522),a=n(523),s=n(524),u=n(525);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,e.exports=c},function(e,t,n){var r=n(297),i=n(298),o=n(299);e.exports=function(e,t,n,a,s,u){var c=1&n,l=e.length,f=t.length;if(l!=f&&!(c&&f>l))return!1;var h=u.get(e),d=u.get(t);if(h&&d)return h==t&&d==e;var p=-1,m=!0,g=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++p=0||(i[n]=e[n]);return i}(t,["children"]);if(delete r.in,delete r.mountOnEnter,delete r.unmountOnExit,delete r.appear,delete r.enter,delete r.exit,delete r.timeout,delete r.addEndListener,delete r.onEnter,delete r.onEntering,delete r.onEntered,delete r.onExit,delete r.onExiting,delete r.onExited,"function"===typeof n)return n(e,r);var o=i.default.Children.only(n);return i.default.cloneElement(o,r)},r}(i.default.Component);function p(){}d.contextTypes={transitionGroup:r.object},d.childContextTypes={transitionGroup:function(){}},d.propTypes={},d.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:p,onEntering:p,onEntered:p,onExit:p,onExiting:p,onExited:p},d.UNMOUNTED=0,d.EXITED=1,d.ENTERING=2,d.ENTERED=3,d.EXITING=4;var m=(0,a.polyfill)(d);t.default=m},function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function i(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!==n&&void 0!==n?n:null}.bind(this))}function o(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!==typeof e.getDerivedStateFromProps&&"function"!==typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,s=null;if("function"===typeof t.componentWillMount?n="componentWillMount":"function"===typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"===typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"===typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"===typeof t.componentWillUpdate?s="componentWillUpdate":"function"===typeof t.UNSAFE_componentWillUpdate&&(s="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==s){var u=e.displayName||e.name,c="function"===typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+u+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==s?"\n "+s:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"===typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=i),"function"===typeof t.getSnapshotBeforeUpdate){if("function"!==typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=o;var l=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;l.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",(function(){return a})),r.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0},function(e,t,n){"use strict";t.__esModule=!0,t.classNamesShape=t.timeoutsShape=void 0;var r;(r=n(14))&&r.__esModule;t.timeoutsShape=null;t.classNamesShape=null},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=s(n(14)),i=s(n(0)),o=n(312),a=n(604);function s(e){return e&&e.__esModule?e:{default:e}}function u(){return(u=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,["component","childFactory"]),o=l(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?o:i.default.createElement(t,r,o)},r}(i.default.Component);f.childContextTypes={transitionGroup:r.default.object.isRequired},f.propTypes={},f.defaultProps={component:"div",childFactory:function(e){return e}};var h=(0,o.polyfill)(f);t.default=h,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){s.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){s.headers[e]=r.merge(o)})),e.exports=s}).call(this,n(41))},function(e,t,n){"use strict";var r=n(50),i=n(611),o=n(613),a=n(316),s=n(614),u=n(617),c=n(618),l=n(320);e.exports=function(e){return new Promise((function(t,n){var f=e.data,h=e.headers;r.isFormData(f)&&delete h["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";h.Authorization="Basic "+btoa(p+":"+m)}var g=s(e.baseURL,e.url);if(d.open(e.method.toUpperCase(),a(g,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in d?u(d.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:e,request:d};i(t,n,o),d=null}},d.onabort=function(){d&&(n(l("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){n(l("Network Error",e,null,d)),d=null},d.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var v=(e.withCredentials||c(g))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;v&&(h[e.xsrfHeaderName]=v)}if("setRequestHeader"in d&&r.forEach(h,(function(e,t){"undefined"===typeof f&&"content-type"===t.toLowerCase()?delete h[t]:d.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),e.responseType)try{d.responseType=e.responseType}catch(y){if("json"!==e.responseType)throw y}"function"===typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),n(e),d=null)})),f||(f=null),d.send(f)}))}},function(e,t,n){"use strict";var r=n(612);e.exports=function(e,t,n,i,o){var a=new Error(e);return r(a,t,n,i,o)}},function(e,t,n){"use strict";var r=n(50);e.exports=function(e,t){t=t||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function u(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function c(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=u(void 0,e[i])):n[i]=u(e[i],t[i])}r.forEach(i,(function(e){r.isUndefined(t[e])||(n[e]=u(void 0,t[e]))})),r.forEach(o,c),r.forEach(a,(function(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=u(void 0,e[i])):n[i]=u(void 0,t[i])})),r.forEach(s,(function(r){r in t?n[r]=u(e[r],t[r]):r in e&&(n[r]=u(void 0,e[r]))}));var l=i.concat(o).concat(a).concat(s),f=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(f,c),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";var r=n(626).Buffer,i=n(325).Transform;function o(e){i.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}n(17)(o,i),o.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(err){r=err}n(r)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(err){t=err}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!r.isBuffer(e)&&"string"!==typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(e)||(e=r.from(e,t));for(var n=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,n){(t=e.exports=n(326)).Stream=t,t.Readable=t,t.Writable=n(330),t.Duplex=n(113),t.Transform=n(332),t.PassThrough=n(633),t.finished=n(236),t.pipeline=n(634)},function(e,t,n){"use strict";(function(t,r){var i;e.exports=x,x.ReadableState=M;n(84).EventEmitter;var o=function(e,t){return e.listeners(t).length},a=n(327),s=n(16).Buffer,u=t.Uint8Array||function(){};var c,l=n(627);c=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,d,p=n(628),m=n(328),g=n(329).getHighWaterMark,v=n(112).codes,y=v.ERR_INVALID_ARG_TYPE,b=v.ERR_STREAM_PUSH_AFTER_EOF,w=v.ERR_METHOD_NOT_IMPLEMENTED,S=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(17)(x,a);var _=m.errorOrDestroy,E=["error","close","destroy","pause","resume"];function M(e,t,r){i=i||n(113),e=e||{},"boolean"!==typeof r&&(r=t instanceof i),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",r),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=n(144).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function x(e){if(i=i||n(113),!(this instanceof x))return new x(e);var t=this instanceof i;this._readableState=new M(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function k(e,t,n,r,i){c("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}(e,a);else if(i||(o=function(e,t){var n;r=t,s.isBuffer(r)||r instanceof u||"string"===typeof t||void 0===t||e.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],t));var r;return n}(a,t)),o)_(e,o);else if(a.objectMode||t&&t.length>0)if("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)a.endEmitted?_(e,new S):O(e,a,t,!0);else if(a.ended)_(e,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?O(e,a,t,!1):P(e,a)):O(e,a,t,!1)}else r||(a.reading=!1,P(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(I,e))}function I(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function P(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){c("readable nexttick read 0"),e.read(0)}function L(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function B(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(F,t,e))}function F(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function z(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):T(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&B(this),null;var r,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&B(this)),null!==r&&this.emit("data",r),r},x.prototype._read=function(e){_(this,new w("_read()"))},x.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:g;function s(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",s),n.removeListener("end",u),n.removeListener("end",g),n.removeListener("data",h),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){c("onend"),e.end()}i.endEmitted?r.nextTick(a):n.once("end",a),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,D(e))}}(n);e.on("drain",l);var f=!1;function h(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==z(i.pipes,e))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function d(t){c("onerror",t),g(),e.removeListener("error",d),0===o(e,"error")&&_(e,t)}function p(){e.removeListener("finish",m),g()}function m(){c("onfinish"),e.removeListener("close",p),g()}function g(){c("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",p),e.once("finish",m),e.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?T(this):i.reading||r.nextTick(N,this))),n},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(j,this),n},x.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(j,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(L,e,t))}(this,e)),e.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),n.decoder&&(i=n.decoder.write(i)),!n.objectMode||null!==i&&void 0!==i)&&((n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause())))})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o-1))throw new S(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,n){n(new m("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,n){var i=this._writableState;return"function"===typeof e?(n=e,e=null,t=null):"function"===typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,I(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=f.destroy,x.prototype._undestroy=f.undestroy,x.prototype._destroy=function(e,t){t(e)}}).call(this,n(36),n(41))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(r){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(36))},function(e,t,n){"use strict";e.exports=l;var r=n(112).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n(113);function c(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new o);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,v=0;v<16;++v)n[v]=e.readInt32BE(4*v);for(;v<64;++v)n[v]=0|(((t=n[v-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[v-7]+d(n[v-15])+n[v-16];for(var y=0;y<64;++y){var b=g+h(u)+c(u,p,m)+a[y]+n[y]|0,w=f(r)+l(r,i,o)|0;g=m,m=p,p=u,u=s+b|0,s=o,o=i,i=r,r=b+w|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,n){var r=n(17),i=n(114),o=n(20).Buffer,a=[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],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function f(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function h(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function v(e,t){return e>>>0>>0?1:0}r(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,y=0|this._gh,b=0|this._hh,w=0|this._al,S=0|this._bl,_=0|this._cl,E=0|this._dl,M=0|this._el,x=0|this._fl,k=0|this._gl,O=0|this._hl,C=0;C<32;C+=2)t[C]=e.readInt32BE(4*C),t[C+1]=e.readInt32BE(4*C+4);for(;C<160;C+=2){var A=t[C-30],T=t[C-30+1],I=d(A,T),P=p(T,A),R=m(A=t[C-4],T=t[C-4+1]),j=g(T,A),N=t[C-14],L=t[C-14+1],D=t[C-32],U=t[C-32+1],B=P+L|0,F=I+N+v(B,P)|0;F=(F=F+R+v(B=B+j|0,j)|0)+D+v(B=B+U|0,U)|0,t[C]=F,t[C+1]=B}for(var z=0;z<160;z+=2){F=t[z],B=t[z+1];var q=l(n,r,i),H=l(w,S,_),V=f(n,w),W=f(w,n),K=h(s,M),G=h(M,s),$=a[z],Y=a[z+1],X=c(s,u,y),Z=c(M,x,k),J=O+G|0,Q=b+K+v(J,O)|0;Q=(Q=(Q=Q+X+v(J=J+Z|0,Z)|0)+$+v(J=J+Y|0,Y)|0)+F+v(J=J+B|0,B)|0;var ee=W+H|0,te=V+q+v(ee,W)|0;b=y,O=k,y=u,k=x,u=s,x=M,s=o+Q+v(M=E+J|0,E)|0,o=i,E=_,i=r,_=S,r=n,S=w,n=Q+te+v(w=J+ee|0,J)|0}this._al=this._al+w|0,this._bl=this._bl+S|0,this._cl=this._cl+_|0,this._dl=this._dl+E|0,this._el=this._el+M|0,this._fl=this._fl+x|0,this._gl=this._gl+k|0,this._hl=this._hl+O|0,this._ah=this._ah+n+v(this._al,w)|0,this._bh=this._bh+r+v(this._bl,S)|0,this._ch=this._ch+i+v(this._cl,_)|0,this._dh=this._dh+o+v(this._dl,E)|0,this._eh=this._eh+s+v(this._el,M)|0,this._fh=this._fh+u+v(this._fl,x)|0,this._gh=this._gh+y+v(this._gl,k)|0,this._hh=this._hh+b+v(this._hl,O)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,n){"use strict";(function(t,r){var i=n(176);e.exports=b;var o,a=n(323);b.ReadableState=y;n(84).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(336),c=n(20).Buffer,l=t.Uint8Array||function(){};var f=Object.create(n(145));f.inherits=n(17);var h=n(640),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var p,m=n(641),g=n(337);f.inherits(b,u);var v=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var r=t instanceof(o=o||n(102));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n(144).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function b(e){if(o=o||n(102),!(this instanceof b))return new b(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,n,r,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,M(e)}(e,a)):(i||(o=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof l||"string"===typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):S(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?S(e,a,t,!1):k(e,a)):S(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function M(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(x,e):x(e))}function x(e){d("emit readable"),e.emit("readable"),T(e)}function k(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(O,e,t))}function O(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function j(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):M(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&P(this),null;var r,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?I(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&P(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:b;function c(t,r){d("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,d("cleanup"),e.removeListener("close",v),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",g),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",m),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){d("onend"),e.end()}o.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",c);var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,T(e))}}(n);e.on("drain",f);var h=!1;var p=!1;function m(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==j(o.pipes,e))&&!h&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function g(t){d("onerror",t),b(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",y),b()}function y(){d("onfinish"),e.removeListener("close",v),b()}function b(){d("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,n){if("function"===typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",g),e.once("close",v),e.once("finish",y),e.emit("pipe",n),o.flowing||(d("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;on)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.lengthn||t!==t)throw new TypeError("Bad key length")}},function(e,t,n){(function(t){var n;if(t.browser)n="utf-8";else if(t.version){n=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";e.exports=n}).call(this,n(41))},function(e,t,n){var r=n(340),i=n(237),o=n(238),a=n(20).Buffer,s=n(343),u=n(344),c=n(346),l=a.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(e,t,n){var s=function(e){function t(t){return o(e).update(t).digest()}function n(e){return(new i).update(e).digest()}return"rmd160"===e||"ripemd160"===e?n:"md5"===e?r:t}(e),u="sha512"===e||"sha384"===e?128:64;t.length>u?t=s(t):t.length>>0},t.writeUInt32BE=function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},t.ip=function(e,t,n,r){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}n[r+0]=i>>>0,n[r+1]=o>>>0},t.rip=function(e,t,n,r){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;n[r+0]=i>>>0,n[r+1]=o>>>0},t.pc1=function(e,t,n,r){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;n[r+0]=i>>>0,n[r+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,n,i){for(var o=0,a=0,s=r.length>>>1,u=0;u>>r[u]&1;for(u=s;u>>r[u]&1;n[i+0]=o>>>0,n[i+1]=a>>>0},t.expand=function(e,t,n){var r=0,i=0;r=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)r<<=6,r|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[n+0]=r>>>0,t[n+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var n=0,r=0;r<4;r++){n<<=4,n|=i[64*r+(e>>>18-6*r&63)]}for(r=0;r<4;r++){n<<=4,n|=i[256+64*r+(t>>>18-6*r&63)]}return n>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,n=0;n>>o[n]&1;return t>>>0},t.padSplit=function(e,t,n){for(var r=e.toString(2);r.length>>1];n=o.r28shl(n,s),i=o.r28shl(i,s),o.pc2(n,i,e.keys,a)}},u.prototype._update=function(e,t,n,r){var i=this._desState,a=o.readUInt32BE(e,t),s=o.readUInt32BE(e,t+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(n,a,r),o.writeUInt32BE(n,s,r+4)},u.prototype._pad=function(e,t){for(var n=e.length-t,r=t;r>>0,a=h}o.rip(s,a,r,i)},u.prototype._decrypt=function(e,t,n,r,i){for(var a=n,s=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],l=e.keys[u+1];o.expand(a,e.tmp,0),c^=e.tmp[0],l^=e.tmp[1];var f=o.substitute(c,l),h=a;a=(s^o.permute(f))>>>0,s=h}o.rip(a,s,r,i)}},function(e,t,n){var r=n(146),i=n(20).Buffer,o=n(350);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}t.encrypt=function(e,t){var n=Math.ceil(t.length/16),o=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*n)]);for(var s=0;se;)n.ishrn(1);if(n.isEven()&&n.iadd(s),n.testn(1)||n.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;n.mod(l).cmp(f);)n.iadd(d)}else for(;n.mod(o).cmp(h);)n.iadd(d);if(g(p=n.shrn(1))&&g(n)&&v(p)&&v(n)&&a.test(p)&&a.test(n))return n}}},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function o(e,t,n){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(667).Buffer}catch(x){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","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"],f=[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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?l[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:l[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r("undefined"!==typeof a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,S=b>>>13,_=0|a[4],E=8191&_,M=_>>>13,x=0|a[5],k=8191&x,O=x>>>13,C=0|a[6],A=8191&C,T=C>>>13,I=0|a[7],P=8191&I,R=I>>>13,j=0|a[8],N=8191&j,L=j>>>13,D=0|a[9],U=8191&D,B=D>>>13,F=0|s[0],z=8191&F,q=F>>>13,H=0|s[1],V=8191&H,W=H>>>13,K=0|s[2],G=8191&K,$=K>>>13,Y=0|s[3],X=8191&Y,Z=Y>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,q))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var ve=(c+(r=r+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,z),i=(i=Math.imul(v,q))+Math.imul(y,z)|0,o=Math.imul(y,q),r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(S,z)|0,o=Math.imul(S,q),r=r+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,W)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,$)|0;var be=(c+(r=r+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,W)|0,r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,$)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var we=(c+(r=r+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(k,z),i=(i=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(E,V)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Z)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Se=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(T,z)|0,o=Math.imul(T,q),r=r+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,$)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,r=r+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var _e=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(P,z),i=(i=Math.imul(P,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,W)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(v,ne)|0,i=(i=i+Math.imul(v,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(L,z)|0,o=Math.imul(L,q),r=r+Math.imul(P,V)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,$)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Me=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(U,z),i=(i=Math.imul(U,q))+Math.imul(B,z)|0,o=Math.imul(B,q),r=r+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,W)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,$)|0,r=r+Math.imul(A,X)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Z)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var xe=(c+(r=r+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(U,V),i=(i=Math.imul(U,W))+Math.imul(B,V)|0,o=Math.imul(B,W),r=r+Math.imul(N,G)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,$)|0,r=r+Math.imul(P,X)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(k,ne)|0,i=(i=i+Math.imul(k,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(v,fe)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var ke=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(U,G),i=(i=Math.imul(U,$))+Math.imul(B,G)|0,o=Math.imul(B,$),r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Z)|0,r=r+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(r=r+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,me)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(U,X),i=(i=Math.imul(U,Z))+Math.imul(B,X)|0,o=Math.imul(B,Z),r=r+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(R,ne)|0,o=o+Math.imul(R,re)|0,r=r+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,he)|0;var Ce=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),r=r+Math.imul(N,ne)|0,i=(i=i+Math.imul(N,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,r=r+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0;var Ae=(c+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,ne),i=(i=Math.imul(U,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,r=r+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,he)|0;var Te=(c+(r=r+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(U,oe),i=(i=Math.imul(U,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Ie=(c+(r=r+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(U,ue),i=(i=Math.imul(U,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,he)|0;var Pe=(c+(r=r+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(U,fe),i=(i=Math.imul(U,he))+Math.imul(B,fe)|0,o=Math.imul(B,he);var Re=(c+(r=r+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(L,pe)|0))<<13)|0;c=((o=o+Math.imul(L,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var je=(c+(r=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,me))+Math.imul(B,pe)|0))<<13)|0;return c=((o=Math.imul(B,me))+(i>>>13)|0)+(je>>>26)|0,je&=67108863,u[0]=ge,u[1]=ve,u[2]=ye,u[3]=be,u[4]=we,u[5]=Se,u[6]=_e,u[7]=Ee,u[8]=Me,u[9]=xe,u[10]=ke,u[11]=Oe,u[12]=Ce,u[13]=Ae,u[14]=Te,u[15]=Ie,u[16]=Pe,u[17]=Re,u[18]=je,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):m(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=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},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;0===(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new w;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return v[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,E),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(67)(e))},function(e,t,n){var r=n(668),i=n(244);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),n=Math.ceil(t/8);do{var i=new r(this.rand.generate(n))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var n=t.sub(e);return e.add(this._randbelow(n))},o.prototype.test=function(e,t,n){var i=e.bitLength(),o=r.mont(e),a=new r(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var c=e.shrn(u),l=s.toRed(o);t>0;t--){var f=this._randrange(new r(2),s);n&&n(f);var h=f.toRed(o).redPow(c);if(0!==h.cmp(a)&&0!==h.cmp(l)){for(var d=1;d0;t--){var l=this._randrange(new r(2),a),f=e.gcd(l);if(0!==f.cmpn(1))return f;var h=l.toRed(i).redPow(u);if(0!==h.cmp(o)&&0!==h.cmp(c)){for(var d=1;d>8,a=255&i;o?n.push(o,a):n.push(a)}return n},r.zero2=i,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,n){"use strict";var r=t;r.base=n(179),r.short=n(678),r.mont=n(679),r.edwards=n(680)},function(e,t,n){"use strict";var r=n(68).rotr32;function i(e,t,n){return e&t^~e&n}function o(e,t,n){return e&t^e&n^t&n}function a(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?i(t,n,r):1===e||3===e?a(t,n,r):2===e?o(t,n,r):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},function(e,t,n){"use strict";var r=n(68),i=n(147),o=n(359),a=n(53),s=r.sum32,u=r.sum32_4,c=r.sum32_5,l=o.ch32,f=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,g=i.BlockHash,v=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}r.inherits(y,g),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function u(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function c(e,t,n,r){for(var i=0,o=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"===typeof e)return this._initNumber(e,t,n);if("object"===typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)i=u(e,t,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2===0?t+1:t;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","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"],f=[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],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;n.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}n.words[c]=0|f,u=0|l}return 0!==u?n.words[c]=0|u:n.length--,n.strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?l[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?m+n:l[c-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return r("undefined"!==typeof a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0===(8191&t)&&(n+=13,t>>>=13),0===(127&t)&&(n+=7,t>>>=7),0===(15&t)&&(n+=4,t>>>=4),0===(3&t)&&(n+=2,t>>>=2),0===(1&t)&&n++,n},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,S=b>>>13,_=0|a[4],E=8191&_,M=_>>>13,x=0|a[5],k=8191&x,O=x>>>13,C=0|a[6],A=8191&C,T=C>>>13,I=0|a[7],P=8191&I,R=I>>>13,j=0|a[8],N=8191&j,L=j>>>13,D=0|a[9],U=8191&D,B=D>>>13,F=0|s[0],z=8191&F,q=F>>>13,H=0|s[1],V=8191&H,W=H>>>13,K=0|s[2],G=8191&K,$=K>>>13,Y=0|s[3],X=8191&Y,Z=Y>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,me=de>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(c+(r=Math.imul(f,z))|0)+((8191&(i=(i=Math.imul(f,q))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,q))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(m,z)|0,o=Math.imul(m,q);var ve=(c+(r=r+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(v,z),i=(i=Math.imul(v,q))+Math.imul(y,z)|0,o=Math.imul(y,q),r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0;var ye=(c+(r=r+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,$)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(w,z),i=(i=Math.imul(w,q))+Math.imul(S,z)|0,o=Math.imul(S,q),r=r+Math.imul(v,V)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,W)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,$)|0;var be=(c+(r=r+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,X)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(E,z),i=(i=Math.imul(E,q))+Math.imul(M,z)|0,o=Math.imul(M,q),r=r+Math.imul(w,V)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,W)|0,r=r+Math.imul(v,G)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,$)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Z)|0;var we=(c+(r=r+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(k,z),i=(i=Math.imul(k,q))+Math.imul(O,z)|0,o=Math.imul(O,q),r=r+Math.imul(E,V)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,W)|0,r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,$)|0,r=r+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Z)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0;var Se=(c+(r=r+Math.imul(f,ne)|0)|0)+((8191&(i=(i=i+Math.imul(f,re)|0)+Math.imul(h,ne)|0))<<13)|0;c=((o=o+Math.imul(h,re)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(T,z)|0,o=Math.imul(T,q),r=r+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,W)|0,r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,$)|0,r=r+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Z)|0,r=r+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,r=r+Math.imul(p,ne)|0,i=(i=i+Math.imul(p,re)|0)+Math.imul(m,ne)|0,o=o+Math.imul(m,re)|0;var _e=(c+(r=r+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(P,z),i=(i=Math.imul(P,q))+Math.imul(R,z)|0,o=Math.imul(R,q),r=r+Math.imul(A,V)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,W)|0,r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,$)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,ee)|0,r=r+Math.imul(v,ne)|0,i=(i=i+Math.imul(v,re)|0)+Math.imul(y,ne)|0,o=o+Math.imul(y,re)|0,r=r+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(c+(r=r+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(N,z),i=(i=Math.imul(N,q))+Math.imul(L,z)|0,o=Math.imul(L,q),r=r+Math.imul(P,V)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,W)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,$)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Z)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(S,ne)|0,o=o+Math.imul(S,re)|0,r=r+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,r=r+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0;var Me=(c+(r=r+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(U,z),i=(i=Math.imul(U,q))+Math.imul(B,z)|0,o=Math.imul(B,q),r=r+Math.imul(N,V)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,W)|0,r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,$)|0,r=r+Math.imul(A,X)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Z)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,r=r+Math.imul(E,ne)|0,i=(i=i+Math.imul(E,re)|0)+Math.imul(M,ne)|0,o=o+Math.imul(M,re)|0,r=r+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,r=r+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,r=r+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var xe=(c+(r=r+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(U,V),i=(i=Math.imul(U,W))+Math.imul(B,V)|0,o=Math.imul(B,W),r=r+Math.imul(N,G)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,$)|0,r=r+Math.imul(P,X)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Z)|0,r=r+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,r=r+Math.imul(k,ne)|0,i=(i=i+Math.imul(k,re)|0)+Math.imul(O,ne)|0,o=o+Math.imul(O,re)|0,r=r+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,r=r+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,r=r+Math.imul(v,fe)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var ke=(c+(r=r+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(U,G),i=(i=Math.imul(U,$))+Math.imul(B,G)|0,o=Math.imul(B,$),r=r+Math.imul(N,X)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Z)|0,r=r+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,r=r+Math.imul(A,ne)|0,i=(i=i+Math.imul(A,re)|0)+Math.imul(T,ne)|0,o=o+Math.imul(T,re)|0,r=r+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,r=r+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,r=r+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var Oe=(c+(r=r+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,me)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(U,X),i=(i=Math.imul(U,Z))+Math.imul(B,X)|0,o=Math.imul(B,Z),r=r+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,ee)|0,r=r+Math.imul(P,ne)|0,i=(i=i+Math.imul(P,re)|0)+Math.imul(R,ne)|0,o=o+Math.imul(R,re)|0,r=r+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,r=r+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,r=r+Math.imul(E,fe)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,he)|0;var Ce=(c+(r=r+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(B,Q)|0,o=Math.imul(B,ee),r=r+Math.imul(N,ne)|0,i=(i=i+Math.imul(N,re)|0)+Math.imul(L,ne)|0,o=o+Math.imul(L,re)|0,r=r+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,r=r+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,r=r+Math.imul(k,fe)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(O,fe)|0,o=o+Math.imul(O,he)|0;var Ae=(c+(r=r+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(U,ne),i=(i=Math.imul(U,re))+Math.imul(B,ne)|0,o=Math.imul(B,re),r=r+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,r=r+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,r=r+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(T,fe)|0,o=o+Math.imul(T,he)|0;var Te=(c+(r=r+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(U,oe),i=(i=Math.imul(U,ae))+Math.imul(B,oe)|0,o=Math.imul(B,ae),r=r+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,ce)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,ce)|0,r=r+Math.imul(P,fe)|0,i=(i=i+Math.imul(P,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Ie=(c+(r=r+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(T,pe)|0))<<13)|0;c=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(U,ue),i=(i=Math.imul(U,ce))+Math.imul(B,ue)|0,o=Math.imul(B,ce),r=r+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(L,fe)|0,o=o+Math.imul(L,he)|0;var Pe=(c+(r=r+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,me)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(U,fe),i=(i=Math.imul(U,he))+Math.imul(B,fe)|0,o=Math.imul(B,he);var Re=(c+(r=r+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(L,pe)|0))<<13)|0;c=((o=o+Math.imul(L,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var je=(c+(r=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,me))+Math.imul(B,pe)|0))<<13)|0;return c=((o=Math.imul(B,me))+(i>>>13)|0)+(je>>>26)|0,je&=67108863,u[0]=ge,u[1]=ve,u[2]=ye,u[3]=be,u[4]=we,u[5]=Se,u[6]=_e,u[7]=Ee,u[8]=Me,u[9]=xe,u[10]=ke,u[11]=Oe,u[12]=Ce,u[13]=Ae,u[14]=Te,u[15]=Ie,u[16]=Pe,u[17]=Re,u[18]=je,0!==c&&(u[19]=c,n.length++),n};function m(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=d),o.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=s,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,e,t):m(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=o.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>i}return t}(e);if(0===t.length)return new o(1);for(var n=this,r=0;r=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=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},o.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),i=e,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var s,u=r.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|r.words[i.length+f])+(0|r.words[i.length+f-1]);for(h=Math.min(h/a|0,67108863),r._ishlnsubmul(i,h,f);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,f),r.isZero()||(r.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},o.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(s),a.isub(u)):(n.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:n.iushln(c)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;0===(n.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(n.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var o=t;t=n,n=o}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){ri&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(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)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(b,y),b.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new w;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return v[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;r--){for(var c=t.words[r],l=u-1;l>=0;l--){var f=c>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===r&&0===l)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}u=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,E),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(67)(e))},function(e,t,n){"use strict";var r=t;r.der=n(365),r.pem=n(698)},function(e,t,n){"use strict";var r=n(17),i=n(251).Buffer,o=n(252),a=n(254);function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){o.call(this,"der",e)}function c(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},r(u,o),u.prototype._encodeComposite=function(e,t,n,r){var o=function(e,t,n,r){var i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(a.tagByName.hasOwnProperty(e))i=a.tagByName[e];else{if("number"!==typeof e||(0|e)!==e)return r.error("Unknown tag: "+e);i=e}if(i>=31)return r.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=a.tagClassByName[n||"universal"]<<6}(e,t,n,this.reporter);if(r.length<128){var s=i.alloc(2);return s[0]=o,s[1]=r.length,this._createEncoderBuffer([s,r])}for(var u=1,c=r.length;c>=256;c>>=8)u++;var l=i.alloc(2+u);l[0]=o,l[1]=128|u;for(var f=1+u,h=r.length;h>0;f--,h>>=8)l[f]=255&h;return this._createEncoderBuffer([l,r])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var n=i.alloc(2*e.length),r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var a=0,s=0;s=128;u>>=7)a++}for(var c=i.alloc(a),l=c.length-1,f=e.length-1;f>=0;f--){var h=e[f];for(c[l--]=127&h;(h>>=7)>0;)c[l--]=128|127&h}return this._createEncoderBuffer(c)},u.prototype._encodeTime=function(e,t){var n,r=new Date(e);return"gentime"===t?n=[c(r.getUTCFullYear()),c(r.getUTCMonth()+1),c(r.getUTCDate()),c(r.getUTCHours()),c(r.getUTCMinutes()),c(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[c(r.getUTCFullYear()%100),c(r.getUTCMonth()+1),c(r.getUTCDate()),c(r.getUTCHours()),c(r.getUTCMinutes()),c(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"===typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!==typeof e&&!i.isBuffer(e)){var n=e.toArray();!e.sign&&128&n[0]&&n.unshift(0),e=i.from(n)}if(i.isBuffer(e)){var r=e.length;0===e.length&&r++;var o=i.alloc(r);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var a=1,s=e;s>=256;s>>=8)a++;for(var u=new Array(a),c=u.length-1;c>=0;c--)u[c]=255&e,e>>=8;return 128&u[0]&&u.unshift(0),this._createEncoderBuffer(i.from(u))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"===typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,n){var r,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(r=0;r>6],i=0===(32&n);if(31===(31&n)){var o=n;for(n=0;128===(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;n<<=7,n|=127&o}}else n&=31;return{cls:r,primitive:i,tag:n,tagStr:s.tag[n]}}function f(e,t,n){var r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(0===(128&r))return r;var i=127&r;if(i>4)return e.error("length octect is too long");r=0;for(var o=0;o>>2]|=e[i]<<24-i%4*8;t.call(this,r,n)}else t.apply(this,arguments)}).prototype=e}}(),i.lib.WordArray)}()},function(e,t,n){"use strict";n.r(t),t.default=function(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},u=function e(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:e,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var c in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){o.push(t=t.toLowerCase()),a.push([t,n]),s[t]=s[t]?s[t]+","+n:n})),n(u())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)}))}},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(377),i=n(378),o=n(61),a=n(256),s=function(){function e(e){e?(this.operation=function(e){return new Promise((function(t,n){var r=a.locateWindow().msCrypto.subtle.importKey("raw",u(e),i.SHA_256_HMAC_ALGO,!1,["sign"]);r.oncomplete=function(){r.result&&t(r.result),n("ImportKey completed without importing key.")},r.onerror=function(){n("ImportKey failed to import key.")}}))}(e).then((function(e){return a.locateWindow().msCrypto.subtle.sign(i.SHA_256_HMAC_ALGO,e)})),this.operation.catch((function(){}))):this.operation=Promise.resolve(a.locateWindow().msCrypto.subtle.digest("SHA-256"))}return e.prototype.update=function(e){var t=this;r.isEmptyData(e)||(this.operation=this.operation.then((function(n){return n.onerror=function(){t.operation=Promise.reject(new Error("Error encountered updating hash"))},n.process(u(e)),n})),this.operation.catch((function(){})))},e.prototype.digest=function(){return this.operation.then((function(e){return new Promise((function(t,n){e.onerror=function(){n("Error encountered finalizing hash")},e.oncomplete=function(){e.result&&t(new Uint8Array(e.result)),n("Error encountered finalizing hash")},e.finish()}))}))},e}();function u(e){return"string"===typeof e?o.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"===typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:"SHA-256"},t.SHA_256_HMAC_ALGO={name:"HMAC",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(61),i=n(377),o=n(378),a=n(256),s=function(){function e(e){this.toHash=new Uint8Array(0),void 0!==e&&(this.key=new Promise((function(t,n){a.locateWindow().crypto.subtle.importKey("raw",u(e),o.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,n)})),this.key.catch((function(){})))}return e.prototype.update=function(e){if(!i.isEmptyData(e)){var t=u(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then((function(t){return a.locateWindow().crypto.subtle.sign(o.SHA_256_HMAC_ALGO,t,e.toHash).then((function(e){return new Uint8Array(e)}))})):i.isEmptyData(this.toHash)?Promise.resolve(o.EMPTY_DATA_SHA_256):Promise.resolve().then((function(){return a.locateWindow().crypto.subtle.digest(o.SHA_256_HASH,e.toHash)})).then((function(e){return Promise.resolve(new Uint8Array(e))}))},e}();function u(e){return"string"===typeof e?r.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([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]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},function(e,t,n){"use strict";e.exports=n(735)},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(1)),r(n(2)),r(n(3)),r(n(4)),r(n(5)),r(n(6)),r(n(7)),r(n(8)),r(n(9)),r(n(10)),r(n(11)),r(n(12)),r(n(13))},function(e,t,n){e.exports={a:"Anchor__a___1_Iz8"}},function(e,t,n){e.exports={button:"Button__button___vS7Mv",signInButton:"Button__signInButton___3bUH-",googleSignInButton:"Button__googleSignInButton___1YiCu",signInButtonIcon:"Button__signInButtonIcon___ihN75",auth0SignInButton:"Button__auth0SignInButton___znnCj",facebookSignInButton:"Button__facebookSignInButton___34Txh",amazonSignInButton:"Button__amazonSignInButton___2EMtl",oAuthSignInButton:"Button__oAuthSignInButton___3UGOl",signInButtonContent:"Button__signInButtonContent___xqTXJ"}},function(e,t,n){e.exports={formContainer:"Form__formContainer___1GA3x",formSection:"Form__formSection___1PPvW",formField:"Form__formField___38Ikl",formRow:"Form__formRow___2mwRs"}},function(e,t,n){e.exports={hint:"Hint__hint___2XngB"}},function(e,t,n){e.exports={input:"Input__input___3e_bf",inputLabel:"Input__inputLabel___3VF0S",label:"Input__label___23sO8",radio:"Input__radio___2hllK"}},function(e,t,n){e.exports={navBar:"Nav__navBar___xtCFA",navRight:"Nav__navRight___1QG2J",nav:"Nav__nav___2Dx2Y",navItem:"Nav__navItem___1LtFQ"}},function(e,t,n){e.exports={photoPickerButton:"PhotoPicker__photoPickerButton___2XdVn",photoPlaceholder:"PhotoPicker__photoPlaceholder___2JXO4",photoPlaceholderIcon:"PhotoPicker__photoPlaceholderIcon___3Et71"}},function(e,t,n){e.exports={container:"Section__container___3YYTG",actionRow:"Section__actionRow___2LWSU",sectionHeader:"Section__sectionHeader___2djyg",sectionHeaderHint:"Section__sectionHeaderHint___3Wxdc",sectionBody:"Section__sectionBody___ihqqd",sectionHeaderContent:"Section__sectionHeaderContent___1UCqa",sectionFooter:"Section__sectionFooter___1T54C",sectionFooterPrimaryContent:"Section__sectionFooterPrimaryContent___2r9ZX",sectionFooterSecondaryContent:"Section__sectionFooterSecondaryContent___Nj41Q"}},function(e,t,n){e.exports={selectInput:"SelectInput__selectInput___3efO4"}},function(e,t,n){e.exports={strike:"Strike__strike___1XV1b",strikeContent:"Strike__strikeContent___10gLb"}},function(e,t,n){e.exports={toast:"Toast__toast___XXr3v",toastClose:"Toast__toastClose___18lU4"}},function(e,t,n){e.exports={totpQrcode:"Totp__totpQrcode___1crLx"}},function(e,t,n){e.exports={sumerianSceneContainer:"XR__sumerianSceneContainer___3nVMt",sumerianScene:"XR__sumerianScene___2Tt7-",loadingOverlay:"XR__loadingOverlay___IbqcI",loadingContainer:"XR__loadingContainer___2Itxb",loadingLogo:"XR__loadingLogo___Ub7xQ",loadingSceneName:"XR__loadingSceneName___3__ne",loadingBar:"XR__loadingBar___2vcke",loadingBarFill:"XR__loadingBarFill___3M-D9",sceneErrorText:"XR__sceneErrorText___2y0tp",sceneBar:"XR__sceneBar___2ShrP",sceneName:"XR__sceneName___1ApHr",sceneActions:"XR__sceneActions___7plGs",actionButton:"XR__actionButton___2poIM",tooltip:"XR__tooltip___UYyhn",actionIcon:"XR__actionIcon___2qnd2",autoShowTooltip:"XR__autoShowTooltip___V1QH7"}}])},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(385);function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Object(r.a)(e,t)}},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void n(c)}s.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,u,"next",e)}function u(e){r(a,i,o,s,u,"throw",e)}s(void 0)}))}}n.d(t,"a",(function(){return i}))},function(e,t,n){"use strict";var r=n(60),i=n(64);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(65)).default)(o.createElement("path",{d:"M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z"}),"Dashboard");t.default=a},function(e,t,n){"use strict";var r=n(60),i=n(64);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(65)).default)(o.createElement("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"}),"People");t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(500),i=n(0),o=n(25),a=n(501),s=n(502);function u(e){return e&&"object"===typeof e&&"default"in e?e:{default:e}}var c=u(r),l=u(i),f=u(a),h=u(s),d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function p(e,t){function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var m=function(){return(m=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function J(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?a:n&&n.props&&n.props.data&&n.props.data.length>0?n.props.data:e&&e.length&&Object(z.g)(i)&&Object(z.g)(o)?e.slice(i,o+1):[]},ge=function(e,t,n,r){var i=e.graphicalItems,o=e.tooltipAxis,a=me(t,e);return n<0||!i||!i.length||n>=a.length?null:i.reduce((function(e,t){if(t.props.hide)return e;var i,s=t.props.data;if(o.dataKey&&!o.allowDuplicatedCategory){var u=void 0===s?a:s;i=Object(z.a)(u,o.dataKey,r)}else i=s&&s[n]||a[n];return i?[].concat(ie(e),[Object(q.s)(t,i)]):e}),[])},ve=function(e,t,n,r){var i=r||{x:e.chartX,y:e.chartY},o=function(e,t){return"horizontal"===t?e.x:"vertical"===t?e.y:"centric"===t?e.angle:e.radius}(i,n),a=e.orderedTooltipTicks,s=e.tooltipAxis,u=e.tooltipTicks,c=Object(q.b)(o,a,u,s);if(c>=0&&u){var l=u[c]&&u[c].value;return{activeTooltipIndex:c,activeLabel:l,activePayload:ge(e,t,c,l),activeCoordinate:function(e,t,n,r){var i=t.find((function(e){return e&&e.index===n}));if(i){if("horizontal"===e)return{x:i.coordinate,y:r.y};if("vertical"===e)return{x:r.x,y:i.coordinate};if("centric"===e){var o=i.coordinate,a=r.radius;return ue(ue(ue({},r),Object(V.c)(r.cx,r.cy,a,o)),{},{angle:o,radius:a})}var s=i.coordinate,u=r.angle;return ue(ue(ue({},r),Object(V.c)(r.cx,r.cy,s,u)),{},{angle:u,radius:s})}return fe}(n,a,c,i)}}return null},ye=function(e,t){var n=t.axisType,r=void 0===n?"xAxis":n,i=t.AxisComp,o=t.graphicalItems,a=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,c=e.children,l="".concat(r,"Id"),f=Object(D.a)(c,i),h={};return f&&f.length?h=function(e,t){var n=t.axes,r=t.graphicalItems,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,c=e.layout,l=e.children,f=e.stackOffset,h=Object(q.u)(c,i);return n.reduce((function(t,n){var d=n.props,p=d.type,m=d.dataKey,g=d.allowDataOverflow,y=d.allowDuplicatedCategory,w=d.scale,S=d.ticks,_=n.props[o],E=me(e.data,{graphicalItems:r.filter((function(e){return e.props[o]===_})),dataStartIndex:s,dataEndIndex:u}),M=E.length;if(!t[_]){var x,k,O;if(m){if(x=Object(q.j)(E,m,p),"category"===p&&h){var C=Object(z.d)(x);y&&C?(k=x,x=v()(0,M)):y||(x=Object(q.v)(n.props.domain,x,n).reduce((function(e,t){return e.indexOf(t)>=0?e:[].concat(ie(e),[t])}),[]))}else if("category"===p)x=y?x.filter((function(e){return""!==e&&!b()(e)})):Object(q.v)(n.props.domain,x,n).reduce((function(e,t){return e.indexOf(t)>=0||""===t||b()(t)?e:[].concat(ie(e),[t])}),[]);else if("number"===p){var A=Object(q.w)(E,r.filter((function(e){return e.props[o]===_&&!e.props.hide})),m,i);A&&(x=A)}!h||"number"!==p&&"auto"===w||(O=Object(q.j)(E,m,"category"))}else x=h?v()(0,M):a&&a[_]&&a[_].hasStack&&"number"===p?"expand"===f?[0,1]:Object(q.l)(a[_].stackGroups,s,u):Object(q.k)(E,r.filter((function(e){return e.props[o]===_&&!e.props.hide})),p,!0);if("number"===p)x=Object(H.a)(l,x,_,i,S),n.props.domain&&(x=Object(q.y)(n.props.domain,x,g));else if("category"===p&&n.props.domain){var T=n.props.domain;x.every((function(e){return T.indexOf(e)>=0}))&&(x=T)}return ue(ue({},t),{},ce({},_,ue(ue({},n.props),{},{axisType:i,domain:x,categoricalDomain:O,duplicateDomain:k,originalDomain:n.props.domain,isCategorical:h,layout:c})))}return t}),{})}(e,{axes:f,graphicalItems:o,axisType:r,axisIdKey:l,stackGroups:a,dataStartIndex:s,dataEndIndex:u}):o&&o.length&&(h=function(e,t){var n=t.graphicalItems,r=t.Axis,i=t.axisType,o=t.axisIdKey,a=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,c=e.layout,l=e.children,f=me(e.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:u}),h=f.length,d=Object(q.u)(c,i),p=-1;return n.reduce((function(e,t){var g,y=t.props[o];return e[y]?e:(p++,d?g=v()(0,h):a&&a[y]&&a[y].hasStack?(g=Object(q.l)(a[y].stackGroups,s,u),g=Object(H.a)(l,g,y,i)):(g=Object(q.y)(r.defaultProps.domain,Object(q.k)(f,n.filter((function(e){return e.props[o]===y&&!e.props.hide})),"number"),r.defaultProps.allowDataOverflow),g=Object(H.a)(l,g,y,i)),ue(ue({},e),{},ce({},y,ue(ue({axisType:i},r.defaultProps),{},{hide:!0,orientation:m()(le,"".concat(i,".").concat(p%2),null),domain:g,originalDomain:r.defaultProps.domain,isCategorical:d,layout:c}))))}),{})}(e,{Axis:i,graphicalItems:o,axisType:r,axisIdKey:l,stackGroups:a,dataStartIndex:s,dataEndIndex:u})),h},be=function(e){var t=e.children,n=e.defaultShowTooltip,r=Object(D.b)(t,B.a.displayName);return{chartX:0,chartY:0,dataStartIndex:r&&r.props&&r.props.startIndex||0,dataEndIndex:r&&r.props&&r.props.endIndex||e.data&&e.data.length-1||0,activeTooltipIndex:-1,isTooltipActive:!b()(n)&&n}},we=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Se=function(e){var t,n,r=e.chartName,i=e.GraphicalChild,a=e.defaultTooltipEventType,u=void 0===a?"axis":a,l=e.validateTooltipEventTypes,h=void 0===l?["axis"]:l,p=e.axisComponents,g=e.legendContent,v=e.formatAxisMap,y=e.defaultProps,w=function(e,t){var n=t.graphicalItems,r=t.stackGroups,i=t.offset,o=t.updateId,a=t.dataStartIndex,s=t.dataEndIndex,u=e.barSize,c=e.layout,l=e.barGap,f=e.barCategoryGap,h=e.maxBarSize,d=we(c),m=d.numericAxisName,g=d.cateAxisName,v=function(e){return!(!e||!e.length)&&e.some((function(e){var t=Object(D.c)(e&&e.type);return t&&t.indexOf("Bar")>=0}))}(n)&&Object(q.g)({barSize:u,stackGroups:r}),y=[];return n.forEach((function(n,u){var d=me(e.data,{dataStartIndex:a,dataEndIndex:s},n),w=n.props,S=w.dataKey,_=w.maxBarSize,E=n.props["".concat(m,"Id")],M=n.props["".concat(g,"Id")],x=p.reduce((function(e,r){var i,o=t["".concat(r.axisType,"Map")],a=n.props["".concat(r.axisType,"Id")],s=o&&o[a];return ue(ue({},e),{},(ce(i={},r.axisType,s),ce(i,"".concat(r.axisType,"Ticks"),Object(q.q)(s)),i))}),{}),k=x[g],O=x["".concat(g,"Ticks")],C=r&&r[E]&&r[E].hasStack&&Object(q.p)(n,r[E].stackGroups),A=Object(D.c)(n.type).indexOf("Bar")>=0,T=Object(q.e)(k,O),I=[];if(A){var P=Object(q.e)(k,O,!0),R=b()(_)?h:_;I=Object(q.f)({barGap:l,barCategoryGap:f,bandSize:P!==T?P:T,sizeList:v[M],maxBarSize:R}),P!==T&&(I=I.map((function(e){return ue(ue({},e),{},{position:ue(ue({},e.position),{},{offset:e.position.offset-P/2})})})))}var j,N=n&&n.type&&n.type.getComposedData;N&&y.push({props:ue(ue({},N(ue(ue({},x),{},{displayedData:d,props:e,dataKey:S,item:n,bandSize:T,barPosition:I,offset:i,stackedData:C,layout:c,dataStartIndex:a,dataEndIndex:s}))),{},(j={key:n.key||"item-".concat(u)},ce(j,m,x[m]),ce(j,g,x[g]),ce(j,"animationId",o),j)),childIndex:Object(D.f)(n,e.children),item:n})})),y},_=function(e,t){var n=e.props,o=e.dataStartIndex,a=e.dataEndIndex,s=e.updateId;if(!Object(D.h)({props:n}))return null;var u=n.children,c=n.layout,l=n.stackOffset,f=n.data,h=n.reverseStackOrder,g=we(c),y=g.numericAxisName,b=g.cateAxisName,S=Object(D.a)(u,i),_=Object(q.o)(f,S,"".concat(y,"Id"),"".concat(b,"Id"),l,h),E=p.reduce((function(e,t){var r="".concat(t.axisType,"Map");return ue(ue({},e),{},ce({},r,ye(n,ue(ue({},t),{},{graphicalItems:S,stackGroups:t.axisType===y&&_,dataStartIndex:o,dataEndIndex:a}))))}),{}),M=function(e,t){var n=e.props,r=e.graphicalItems,i=e.xAxisMap,o=void 0===i?{}:i,a=e.yAxisMap,s=void 0===a?{}:a,u=n.width,c=n.height,l=n.children,f=n.margin||{},h=Object(D.b)(l,B.a.displayName),d=Object(D.b)(l,I.a.displayName),p=Object.keys(s).reduce((function(e,t){var n=s[t],r=n.orientation;return n.mirror||n.hide?e:ue(ue({},e),{},ce({},r,e[r]+n.width))}),{left:f.left||0,right:f.right||0}),g=Object.keys(o).reduce((function(e,t){var n=o[t],r=n.orientation;return n.mirror||n.hide?e:ue(ue({},e),{},ce({},r,m()(e,"".concat(r))+n.height))}),{top:f.top||0,bottom:f.bottom||0}),v=ue(ue({},g),p),y=v.bottom;return h&&(v.bottom+=h.props.height||B.a.defaultProps.height),d&&t&&(v=Object(q.a)(v,r,n,t)),ue(ue({brushBottom:y},v),{},{width:u-v.left-v.right,height:c-v.top-v.bottom})}(ue(ue({},E),{},{props:n,graphicalItems:S}),null===t||void 0===t?void 0:t.legendBBox);Object.keys(E).forEach((function(e){E[e]=v(n,E[e],M,e.replace("Map",""),r)}));var x=function(e){var t=Object(z.b)(e),n=Object(q.q)(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:d()(n,(function(e){return e.coordinate})),tooltipAxis:t,tooltipAxisBandSize:Object(q.e)(t)}}(E["".concat(b,"Map")]),k=w(n,ue(ue({},E),{},{dataStartIndex:o,dataEndIndex:a,updateId:s,graphicalItems:S,stackGroups:_,offset:M}));return ue(ue({formatedGraphicalItems:k,graphicalItems:S,offset:M,stackGroups:_},x),E)};return n=t=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Q(e,t)}(l,e);var t,n,i,a=ee(l);function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=a.call(this,e)).uniqueChartId=void 0,t.clipPathId=void 0,t.legendInstance=void 0,t.deferId=void 0,t.container=void 0,t.clearDeferId=function(){!b()(t.deferId)&&pe&&pe(t.deferId),t.deferId=null},t.handleLegendBBoxUpdate=function(e){if(e&&t.legendInstance){var n=t.state,r=n.dataStartIndex,i=n.dataEndIndex,o=n.updateId;t.setState(ue({legendBBox:e},_({props:t.props,dataStartIndex:r,dataEndIndex:i,updateId:o},ue(ue({},t.state),{},{legendBBox:e}))))}},t.handleReceiveSyncEvent=function(e,n,r){t.props.syncId===e&&n!==t.uniqueChartId&&(t.clearDeferId(),t.deferId=de&&de(t.applySyncEvent.bind(ne(t),r)))},t.handleBrushChange=function(e){var n=e.startIndex,r=e.endIndex;if(n!==t.state.dataStartIndex||r!==t.state.dataEndIndex){var i=t.state.updateId;t.setState((function(){return ue({dataStartIndex:n,dataEndIndex:r},_({props:t.props,dataStartIndex:n,dataEndIndex:r,updateId:i},t.state))})),t.triggerSyncEvent({dataStartIndex:n,dataEndIndex:r})}},t.handleMouseEnter=function(e){var n=t.props.onMouseEnter,r=t.getMouseInfo(e);if(r){var i=ue(ue({},r),{},{isTooltipActive:!0});t.setState(i),t.triggerSyncEvent(i),c()(n)&&n(i,e)}},t.triggeredAfterMouseMove=function(e){var n=t.props.onMouseMove,r=t.getMouseInfo(e),i=r?ue(ue({},r),{},{isTooltipActive:!0}):{isTooltipActive:!1};t.setState(i),t.triggerSyncEvent(i),c()(n)&&n(i,e)},t.handleItemMouseEnter=function(e){t.setState((function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}}))},t.handleItemMouseLeave=function(){t.setState((function(){return{isTooltipActive:!1}}))},t.handleMouseMove=function(e){e&&c()(e.persist)&&e.persist(),t.triggeredAfterMouseMove(e)},t.handleMouseLeave=function(e){var n=t.props.onMouseLeave,r={isTooltipActive:!1};t.setState(r),t.triggerSyncEvent(r),c()(n)&&n(r,e),t.cancelThrottledTriggerAfterMouseMove()},t.handleOuterEvent=function(e){var n=Object(D.d)(e),r=m()(t.props,"".concat(n));n&&c()(r)&&r(/.*touch.*/i.test(n)?t.getMouseInfo(e.changedTouches[0]):t.getMouseInfo(e),e)},t.handleClick=function(e){var n=t.props.onClick,r=t.getMouseInfo(e);if(r){var i=ue(ue({},r),{},{isTooltipActive:!0});t.setState(i),t.triggerSyncEvent(i),c()(n)&&n(i,e)}},t.handleMouseDown=function(e){var n=t.props.onMouseDown;c()(n)&&n(t.getMouseInfo(e),e)},t.handleMouseUp=function(e){var n=t.props.onMouseUp;c()(n)&&n(t.getMouseInfo(e),e)},t.handleTouchMove=function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleMouseMove(e.changedTouches[0])},t.handleTouchStart=function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleMouseDown(e.changedTouches[0])},t.handleTouchEnd=function(e){null!=e.changedTouches&&e.changedTouches.length>0&&t.handleMouseUp(e.changedTouches[0])},t.verticalCoordinatesGenerator=function(e){var t=e.xAxis,n=e.width,r=e.height,i=e.offset;return Object(q.i)(U.a.getTicks(ue(ue(ue({},U.a.defaultProps),t),{},{ticks:Object(q.q)(t,!0),viewBox:{x:0,y:0,width:n,height:r}})),i.left,i.left+i.width)},t.horizontalCoordinatesGenerator=function(e){var t=e.yAxis,n=e.width,r=e.height,i=e.offset;return Object(q.i)(U.a.getTicks(ue(ue(ue({},U.a.defaultProps),t),{},{ticks:Object(q.q)(t,!0),viewBox:{x:0,y:0,width:n,height:r}})),i.top,i.top+i.height)},t.axesTicksGenerator=function(e){return Object(q.q)(e,!0)},t.renderCursor=function(e){var n=t.state,i=n.isTooltipActive,o=n.activeCoordinate,a=n.activePayload,s=n.offset,u=n.activeTooltipIndex,c=t.getTooltipEventType();if(!e||!e.props.cursor||!i||!o||"axis"!==c)return null;var l,f=t.props.layout,h=P.a;if("ScatterChart"===r)l=o,h=R.a;else if("BarChart"===r)l=t.getCursorRectangle(),h=L.a;else if("radial"===f){var d=t.getCursorPoints(),p=d.cx,m=d.cy,g=d.radius;l={cx:p,cy:m,startAngle:d.startAngle,endAngle:d.endAngle,innerRadius:g,outerRadius:g},h=j.a}else l={points:t.getCursorPoints()},h=P.a;var v=e.key||"_recharts-cursor",y=ue(ue(ue(ue({stroke:"#ccc",pointerEvents:"none"},s),l),Object(G.c)(e.props.cursor)),{},{payload:a,payloadIndex:u,key:v,className:"recharts-tooltip-cursor"});return Object(M.isValidElement)(e.props.cursor)?Object(M.cloneElement)(e.props.cursor,y):Object(M.createElement)(h,y)},t.renderPolarAxis=function(e,n,r){var i=m()(e,"type.axisType"),o=m()(t.state,"".concat(i,"Map"))[e.props["".concat(i,"Id")]];return Object(M.cloneElement)(e,ue(ue({},o),{},{className:i,key:e.key||"".concat(n,"-").concat(r),ticks:Object(q.q)(o,!0)}))},t.renderXAxis=function(e,n,r){var i=t.state.xAxisMap[e.props.xAxisId];return t.renderAxis(i,e,n,r)},t.renderYAxis=function(e,n,r){var i=t.state.yAxisMap[e.props.yAxisId];return t.renderAxis(i,e,n,r)},t.renderGrid=function(e){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,u=t.props,c=u.width,l=u.height,f=Object(z.b)(r),h=s()(i,(function(e){return o()(e.domain,he)}))||Object(z.b)(i),d=e.props||{};return Object(M.cloneElement)(e,{key:e.key||"grid",x:Object(z.g)(d.x)?d.x:a.left,y:Object(z.g)(d.y)?d.y:a.top,width:Object(z.g)(d.width)?d.width:a.width,height:Object(z.g)(d.height)?d.height:a.height,xAxis:f,yAxis:h,offset:a,chartWidth:c,chartHeight:l,verticalCoordinatesGenerator:d.verticalCoordinatesGenerator||t.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:d.horizontalCoordinatesGenerator||t.horizontalCoordinatesGenerator})},t.renderPolarGrid=function(e){var n=e.props,r=n.radialLines,i=n.polarAngles,o=n.polarRadius,a=t.state,s=a.radiusAxisMap,u=a.angleAxisMap,c=Object(z.b)(s),l=Object(z.b)(u),f=l.cx,h=l.cy,d=l.innerRadius,p=l.outerRadius;e.props;return Object(M.cloneElement)(e,{polarAngles:E()(i)?i:Object(q.q)(l,!0).map((function(e){return e.coordinate})),polarRadius:E()(o)?o:Object(q.q)(c,!0).map((function(e){return e.coordinate})),cx:f,cy:h,innerRadius:d,outerRadius:p,key:e.key||"polar-grid",radialLines:r})},t.renderLegend=function(){var e=t.state.formatedGraphicalItems,n=t.props,r=n.children,i=n.width,o=n.height,a=t.props.margin||{},s=i-(a.left||0)-(a.right||0),u=Object(q.m)({children:r,formatedGraphicalItems:e,legendWidth:s,legendContent:g});if(!u)return null;var c=u.item,l=Z(u,["item"]);return Object(M.cloneElement)(c,ue(ue({},l),{},{chartWidth:i,chartHeight:o,margin:a,ref:function(e){t.legendInstance=e},onBBoxUpdate:t.handleLegendBBoxUpdate}))},t.renderTooltip=function(){var e=t.props.children,n=Object(D.b)(e,T.a.displayName);if(!n)return null;var r=t.state,i=r.isTooltipActive,o=r.activeCoordinate,a=r.activePayload,s=r.activeLabel,u=r.offset;return Object(M.cloneElement)(n,{viewBox:ue(ue({},u),{},{x:u.left,y:u.top}),active:i,label:s,payload:i?a:[],coordinate:o})},t.renderBrush=function(e){var n=t.props,r=n.margin,i=n.data,o=t.state,a=o.offset,s=o.dataStartIndex,u=o.dataEndIndex,c=o.updateId;return Object(M.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:Object(q.d)(t.handleBrushChange,null,e.props.onChange),data:i,x:Object(z.g)(e.props.x)?e.props.x:a.left,y:Object(z.g)(e.props.y)?e.props.y:a.top+a.height+a.brushBottom-(r.bottom||0),width:Object(z.g)(e.props.width)?e.props.width:a.width,startIndex:s,endIndex:u,updateId:"brush-".concat(c)})},t.renderReferenceElement=function(e,n,r){if(!e)return null;var i=ne(t).clipPathId,o=t.state,a=o.xAxisMap,s=o.yAxisMap,u=o.offset,c=e.props,l=c.xAxisId,f=c.yAxisId;return Object(M.cloneElement)(e,{key:e.key||"".concat(n,"-").concat(r),xAxis:a[l],yAxis:s[f],viewBox:{x:u.left,y:u.top,width:u.width,height:u.height},clipPathId:i})},t.renderActivePoints=function(e){var t=e.item,n=e.activePoint,r=e.basePoint,i=e.childIndex,o=e.isRange,a=[],s=t.props.key,u=t.item.props,c=u.activeDot,f=ue(ue({index:i,dataKey:u.dataKey,cx:n.x,cy:n.y,r:4,fill:Object(q.n)(t.item),strokeWidth:2,stroke:"#fff",payload:n.payload,value:n.value,key:"".concat(s,"-activePoint-").concat(i)},Object(G.c)(c)),Object(G.a)(c));return a.push(l.renderActiveDot(c,f)),r?a.push(l.renderActiveDot(c,ue(ue({},f),{},{cx:r.x,cy:r.y,key:"".concat(s,"-basePoint-").concat(i)}))):o&&a.push(null),a},t.renderGraphicChild=function(e,n,r){var i=t.filterFormatItem(e,n,r);if(!i)return null;var o=t.getTooltipEventType(),a=t.state,s=a.isTooltipActive,u=a.tooltipAxis,c=a.activeTooltipIndex,l=a.activeLabel,f=t.props.children,h=Object(D.b)(f,T.a.displayName),d=i.props,p=d.points,m=d.isRange,g=d.baseLine,v=i.item.props,y=v.activeDot,w=!v.hide&&s&&h&&y&&c>=0,S={};"axis"!==o&&h&&"click"===h.props.trigger?S={onClick:Object(q.d)(t.handleItemMouseEnter,null,e.props.onCLick)}:"axis"!==o&&(S={onMouseLeave:Object(q.d)(t.handleItemMouseLeave,null,e.props.onMouseLeave),onMouseEnter:Object(q.d)(t.handleItemMouseEnter,null,e.props.onMouseEnter)});var _=Object(M.cloneElement)(e,ue(ue({},i.props),S));if(w){var E,x;if(u.dataKey&&!u.allowDuplicatedCategory){var k="function"===typeof u.dataKey?function(e){return"function"===typeof u.dataKey?u.dataKey(e.payload):null}:"payload.".concat(u.dataKey.toString());E=Object(z.a)(p,k,l),x=m&&g&&Object(z.a)(g,k,l)}else E=p[c],x=m&&g&&g[c];if(!b()(E))return[_].concat(ie(t.renderActivePoints({item:i,activePoint:E,basePoint:x,childIndex:c,isRange:m})))}return m?[_,null,null]:[_,null]},t.renderCustomized=function(e){return Object(M.cloneElement)(e,ue(ue({},t.props),t.state))},t.uniqueChartId=b()(e.id)?Object(z.j)("recharts"):e.id,t.clipPathId="".concat(t.uniqueChartId,"-clip"),e.throttleDelay&&(t.triggeredAfterMouseMove=f()(t.triggeredAfterMouseMove,e.throttleDelay)),t.state={},t}return t=l,(n=[{key:"componentDidMount",value:function(){b()(this.props.syncId)||this.addListener()}},{key:"componentDidUpdate",value:function(e){b()(e.syncId)&&!b()(this.props.syncId)&&this.addListener(),!b()(e.syncId)&&b()(this.props.syncId)&&this.removeListener()}},{key:"componentWillUnmount",value:function(){this.clearDeferId(),b()(this.props.syncId)||this.removeListener(),this.cancelThrottledTriggerAfterMouseMove()}},{key:"cancelThrottledTriggerAfterMouseMove",value:function(){"function"===typeof this.triggeredAfterMouseMove.cancel&&this.triggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=Object(D.b)(this.props.children,T.a.displayName);if(e&&S()(e.props.shared)){var t=e.props.shared?"axis":"item";return h.indexOf(t)>=0?t:u}return u}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t=Object(F.b)(this.container),n=Object(F.a)(e,t),r=this.inRange(n.chartX,n.chartY);if(!r)return null;var i=this.state,o=i.xAxisMap,a=i.yAxisMap;if("axis"!==this.getTooltipEventType()&&o&&a){var s=Object(z.b)(o).scale,u=Object(z.b)(a).scale,c=s&&s.invert?s.invert(n.chartX):null,l=u&&u.invert?u.invert(n.chartY):null;return ue(ue({},n),{},{xValue:c,yValue:l})}var f=ve(this.state,this.props.data,this.props.layout,r);return f?ue(ue({},n),f):null}},{key:"getCursorRectangle",value:function(){var e=this.props.layout,t=this.state,n=t.activeCoordinate,r=t.offset,i=t.tooltipAxisBandSize,o=i/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===e?n.x-o:r.left+.5,y:"horizontal"===e?r.top+.5:n.y-o,width:"horizontal"===e?i:r.width-1,height:"horizontal"===e?r.height-1:i}}},{key:"getCursorPoints",value:function(){var e,t,n,r,i=this.props.layout,o=this.state,a=o.activeCoordinate,s=o.offset;if("horizontal"===i)n=e=a.x,t=s.top,r=s.top+s.height;else if("vertical"===i)r=t=a.y,e=s.left,n=s.left+s.width;else if(!b()(a.cx)||!b()(a.cy)){if("centric"!==i){var u=a.cx,c=a.cy,l=a.radius,f=a.startAngle,h=a.endAngle;return{points:[Object(V.c)(u,c,l,f),Object(V.c)(u,c,l,h)],cx:u,cy:c,radius:l,startAngle:f,endAngle:h}}var d=a.cx,p=a.cy,m=a.innerRadius,g=a.outerRadius,v=a.angle,y=Object(V.c)(d,p,m,v),w=Object(V.c)(d,p,g,v);e=y.x,t=y.y,n=w.x,r=w.y}return[{x:e,y:t},{x:n,y:r}]}},{key:"inRange",value:function(e,t){var n=this.props.layout;if("horizontal"===n||"vertical"===n){var r=this.state.offset;return e>=r.left&&e<=r.left+r.width&&t>=r.top&&t<=r.top+r.height?{x:e,y:t}:null}var i=this.state,o=i.angleAxisMap,a=i.radiusAxisMap;if(o&&a){var s=Object(z.b)(o);return Object(V.b)({x:e,y:t},s)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=Object(D.b)(e,T.a.displayName),r={};return n&&"axis"===t&&(r="click"===n.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}),ue(ue({},Object(G.a)(this.props,this.handleOuterEvent)),r)}},{key:"addListener",value:function(){K.b.on(K.a,this.handleReceiveSyncEvent),K.b.setMaxListeners&&K.b._maxListeners&&K.b.setMaxListeners(K.b._maxListeners+1)}},{key:"removeListener",value:function(){K.b.removeListener(K.a,this.handleReceiveSyncEvent),K.b.setMaxListeners&&K.b._maxListeners&&K.b.setMaxListeners(K.b._maxListeners-1)}},{key:"triggerSyncEvent",value:function(e){var t=this.props.syncId;b()(t)||K.b.emit(K.a,t,this.uniqueChartId,e)}},{key:"applySyncEvent",value:function(e){var t=this.props,n=t.layout,r=t.syncMethod,i=this.state.updateId,o=e.dataStartIndex,a=e.dataEndIndex;if(b()(e.dataStartIndex)&&b()(e.dataEndIndex))if(b()(e.activeTooltipIndex))this.setState(e);else{var s=e.chartX,u=e.chartY,c=e.activeTooltipIndex,l=this.state,f=l.offset,h=l.tooltipTicks;if(!f)return;if("function"===typeof r)c=r(h,e);else if("value"===r){c=-1;for(var d=0;d180),",").concat(+(o>s),",\n ").concat(f.x,",").concat(f.y,"\n ");if(r>0){var d=Object(u.c)(t,n,r,o),p=Object(u.c)(t,n,r,s);h+="L ".concat(p.x,",").concat(p.y,"\n A ").concat(r,",").concat(r,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(o<=s),",\n ").concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(t,",").concat(n," Z");return h},w=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(u,e);var t,n,r,o=m(u);function u(){return h(this,u),o.apply(this,arguments)}return t=u,(n=[{key:"render",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.innerRadius,o=e.outerRadius,u=e.cornerRadius,l=e.forceCornerRadius,h=e.cornerIsExternal,d=e.startAngle,p=e.endAngle,m=e.className;if(o0&&Math.abs(d-p)<360?function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,a=e.forceCornerRadius,s=e.cornerIsExternal,u=e.startAngle,l=e.endAngle,f=Object(c.i)(l-u),h=y({cx:t,cy:n,radius:i,angle:u,sign:f,cornerRadius:o,cornerIsExternal:s}),d=h.circleTangency,p=h.lineTangency,m=h.theta,g=y({cx:t,cy:n,radius:i,angle:l,sign:-f,cornerRadius:o,cornerIsExternal:s}),v=g.circleTangency,w=g.lineTangency,S=g.theta,_=s?Math.abs(u-l):Math.abs(u-l)-m-S;if(_<0)return a?"M ".concat(p.x,",").concat(p.y,"\n a").concat(o,",").concat(o,",0,0,1,").concat(2*o,",0\n a").concat(o,",").concat(o,",0,0,1,").concat(2*-o,",0\n "):b({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:u,endAngle:l});var E="M ".concat(p.x,",").concat(p.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(d.x,",").concat(d.y,"\n A").concat(i,",").concat(i,",0,").concat(+(_>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(w.x,",").concat(w.y,"\n ");if(r>0){var M=y({cx:t,cy:n,radius:r,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:s}),x=M.circleTangency,k=M.lineTangency,O=M.theta,C=y({cx:t,cy:n,radius:r,angle:l,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:s}),A=C.circleTangency,T=C.lineTangency,I=C.theta,P=s?Math.abs(u-l):Math.abs(u-l)-O-I;if(P<0&&0===o)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+="L".concat(T.x,",").concat(T.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(A.x,",").concat(A.y,"\n A").concat(r,",").concat(r,",0,").concat(+(P>180),",").concat(+(f>0),",").concat(x.x,",").concat(x.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(k.x,",").concat(k.y,"Z")}else E+="L".concat(t,",").concat(n,"Z");return E}({cx:t,cy:n,innerRadius:r,outerRadius:o,cornerRadius:Math.min(S,w/2),forceCornerRadius:l,cornerIsExternal:h,startAngle:d,endAngle:p}):b({cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:d,endAngle:p}),i.a.createElement("path",f({},Object(s.c)(this.props,!0),{className:v,d:g}))}}])&&d(t.prototype,n),r&&d(t,r),u}(r.PureComponent);w.defaultProps={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1}},function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,n,r,o){if("function"!==typeof n)throw new TypeError("The listener must be a function");var s=new a(n,r||e,o),u=i?i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0===--e._eventsCount?e._events=new o:delete e._events[t]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},c.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),a=Math.max(i,o),s=0,u=e.map([t,n],(function(t){var n=a-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(s=a-Math.min(i,o)),a-=1;a>=s;){if(u[0][a]>u[1][a])return 1;if(u[0][a]===u[1][a]){if(a===s)return 0;a-=1}else if(u[0][a]1?i-1:0),a=1;a0){var a=Object.keys(n),u=s.default.find(a,(function(e){return t.isOS(e)}));if(u){var c=this.satisfies(n[u]);if(void 0!==c)return c}var l=s.default.find(a,(function(e){return t.isPlatform(e)}));if(l){var f=this.satisfies(n[l]);if(void 0!==f)return f}}if(o>0){var h=Object.keys(i),d=s.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==d)return this.compareVersion(i[d])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=c,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=a,e.exports=t.default}})},function(e){e.exports=JSON.parse('{"name":"@aws-sdk/client-cognito-identity","description":"AWS SDK for JavaScript Cognito Identity Client for Node.js, Browser and React Native","version":"3.6.1","scripts":{"clean":"yarn remove-definitions && yarn remove-dist && yarn remove-documentation","build-documentation":"yarn remove-documentation && typedoc ./","prepublishOnly":"yarn build","pretest":"yarn build:cjs","remove-definitions":"rimraf ./types","remove-dist":"rimraf ./dist","remove-documentation":"rimraf ./docs","test:unit":"mocha **/cjs/**/*.spec.js","test:e2e":"mocha **/cjs/**/*.ispec.js && karma start karma.conf.js","test":"yarn test:unit","build:cjs":"tsc -p tsconfig.json","build:es":"tsc -p tsconfig.es.json","build":"yarn build:cjs && yarn build:es","postbuild":"downlevel-dts types types/ts3.4"},"main":"./dist/cjs/index.js","types":"./types/index.d.ts","module":"./dist/es/index.js","browser":{"./runtimeConfig":"./runtimeConfig.browser"},"react-native":{"./runtimeConfig":"./runtimeConfig.native"},"sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"^1.0.0","@aws-crypto/sha256-js":"^1.0.0","@aws-sdk/config-resolver":"3.6.1","@aws-sdk/credential-provider-node":"3.6.1","@aws-sdk/fetch-http-handler":"3.6.1","@aws-sdk/hash-node":"3.6.1","@aws-sdk/invalid-dependency":"3.6.1","@aws-sdk/middleware-content-length":"3.6.1","@aws-sdk/middleware-host-header":"3.6.1","@aws-sdk/middleware-logger":"3.6.1","@aws-sdk/middleware-retry":"3.6.1","@aws-sdk/middleware-serde":"3.6.1","@aws-sdk/middleware-signing":"3.6.1","@aws-sdk/middleware-stack":"3.6.1","@aws-sdk/middleware-user-agent":"3.6.1","@aws-sdk/node-config-provider":"3.6.1","@aws-sdk/node-http-handler":"3.6.1","@aws-sdk/protocol-http":"3.6.1","@aws-sdk/smithy-client":"3.6.1","@aws-sdk/types":"3.6.1","@aws-sdk/url-parser":"3.6.1","@aws-sdk/url-parser-native":"3.6.1","@aws-sdk/util-base64-browser":"3.6.1","@aws-sdk/util-base64-node":"3.6.1","@aws-sdk/util-body-length-browser":"3.6.1","@aws-sdk/util-body-length-node":"3.6.1","@aws-sdk/util-user-agent-browser":"3.6.1","@aws-sdk/util-user-agent-node":"3.6.1","@aws-sdk/util-utf8-browser":"3.6.1","@aws-sdk/util-utf8-node":"3.6.1","tslib":"^2.0.0"},"devDependencies":{"@aws-sdk/client-documentation-generator":"3.6.1","@aws-sdk/client-iam":"3.6.1","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^12.7.5","downlevel-dts":"0.7.0","jest":"^26.1.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.1.2"},"engines":{"node":">=10.0.0"},"typesVersions":{"<4.0":{"types/*":["types/ts3.4/*"]}},"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-cognito-identity"}}')},function(e,t,n){"use strict";var r=n(60),i=n(64);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i(n(0)),a=(0,r(n(65)).default)(o.createElement("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOutlined");t.default=a},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(99),i=n(51),o=n(57),a=function(){function e(){this._logger=new r.a("ServiceWorker")}return Object.defineProperty(e.prototype,"serviceWorker",{get:function(){return this._serviceWorker},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this;return void 0===e&&(e="/service-worker.js"),void 0===t&&(t="/"),this._logger.debug("registering "+e),this._logger.debug("registering service worker with scope "+t),new Promise((function(r,i){if(!navigator||!("serviceWorker"in navigator))return i(new Error("Service Worker not available"));navigator.serviceWorker.register(e,{scope:t}).then((function(e){return e.installing?n._serviceWorker=e.installing:e.waiting?n._serviceWorker=e.waiting:e.active&&(n._serviceWorker=e.active),n._registration=e,n._setupListeners(),n._logger.debug("Service Worker Registration Success: "+e),r(e)})).catch((function(e){return n._logger.debug("Service Worker Registration Failed "+e),i(e)}))}))},e.prototype.enablePush=function(e){var t=this;if(!this._registration)throw new Error("Service Worker not registered");return this._publicKey=e,new Promise((function(n,r){if(!Object(i.b)().isBrowser)return r(new Error("Service Worker not available"));t._registration.pushManager.getSubscription().then((function(r){if(!r)return t._logger.debug("User is NOT subscribed to push"),t._registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t._urlB64ToUint8Array(e)}).then((function(e){t._subscription=e,t._logger.debug("User subscribed: "+JSON.stringify(e)),n(e)})).catch((function(e){t._logger.error(e)}));t._subscription=r,t._logger.debug("User is subscribed to push: "+JSON.stringify(r)),n(r)}))}))},e.prototype._urlB64ToUint8Array=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),i=0;i=10.0.0"},"typesVersions":{"<4.0":{"types/*":["types/ts3.4/*"]}},"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-s3"}}')},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(35),i=n(37),o=n(0),a=n.n(o),s=n(59),u=(n(742),n(4)),c=n(47),l=n(52),f=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i=0&&this.changeListeners.splice(t,1)},e}(),m=n(51),g=Object(m.b)().isBrowser,v=function(){function e(e){void 0===e&&(e={}),this.cookies=new p,this.store=g?window.localStorage:Object.create(null),this.cookies=e.req?new p(e.req.headers.cookie):new p,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)})).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){switch(this.setLocalItem(e,t),e.split(".").pop()){case"LastAuthUser":case"accessToken":case"idToken":this.setUniversalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}(),y=n(407);var b,w=n(57),S=function(){function e(e){var t=e||{},n=t.ValidationData,r=t.Username,i=t.Password,o=t.AuthParameters,a=t.ClientMetadata;this.validationData=n||{},this.authParameters=o||{},this.clientMetadata=a||{},this.username=r,this.password=i}var t=e.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},e}(),_=n(16),E=n(46),M=n.n(E),x=(n(372),n(152)),k=n.n(x),O=n(132),C=n.n(O);function A(){if(b){if("function"===typeof b.getRandomValues)try{return b.getRandomValues(new Uint32Array(1))[0]}catch(err){}if("function"===typeof b.randomBytes)try{return b.randomBytes(4).readInt32LE()}catch(err){}}throw new Error("Native crypto module could not be used to get secure random number.")}"undefined"!==typeof window&&window.crypto&&(b=window.crypto),!b&&"undefined"!==typeof window&&window.msCrypto&&(b=window.msCrypto);var T,I=function(){function e(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length}var t=e.prototype;return t.random=function(t){for(var n=[],r=0;r>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")}(this)},e}(),P=R;function R(e,t){null!=e&&this.fromString(e,t)}function j(){return new R(null)}var N="undefined"!==typeof navigator;N&&"Microsoft Internet Explorer"==navigator.appName?(R.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var u=32767&this[e],c=this[e++]>>15,l=s*u+c*a;i=((u=a*u+((32767&l)<<15)+n[r]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),n[r++]=1073741823&u}return i},T=30):N&&"Netscape"!=navigator.appName?(R.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},T=26):(R.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var u=16383&this[e],c=this[e++]>>14,l=s*u+c*a;i=((u=a*u+((16383&l)<<14)+n[r]+i)>>28)+(l>>14)+s*c,n[r++]=268435455&u}return i},T=28),R.prototype.DB=T,R.prototype.DM=(1<>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function H(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(t,t),t},H.prototype.revert=function(e){var t=j();return e.copyTo(t),this.reduce(t),t},H.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},H.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},H.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},R.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},R.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},R.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var a=F(e,r);a<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<>this.DB-o):this[this.t-1]|=a<=this.DB&&(o-=this.DB))}this.clamp(),i&&R.ZERO.subTo(this,this)},R.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},R.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},R.prototype.drShiftTo=function(e,t){for(var n=e;n=0;--n)t[n+a+1]=this[n]>>i|s,s=(this[n]&o)<=0;--n)t[n]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},R.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<>r;for(var a=n+1;a>r;r>0&&(t[this.t-n-1]|=(this.s&o)<>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},R.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i=0;)e[n]=0;for(n=0;n=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},R.prototype.divRemTo=function(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t0?(r.lShiftTo(u,o),i.lShiftTo(u,n)):(r.copyTo(o),i.copyTo(n));var c=o.t,l=o[c-1];if(0!=l){var f=l*(1<1?o[c-2]>>this.F2:0),h=this.FV/f,d=(1<=0&&(n[n.t++]=1,n.subTo(v,n)),R.ONE.dlShiftTo(c,v),v.subTo(o,o);o.t=0;){var y=n[--m]==l?this.DM:Math.floor(n[m]*h+(n[m-1]+p)*d);if((n[m]+=o.am(0,y,n,g,0,c))0&&n.rShiftTo(u,n),a<0&&R.ZERO.subTo(n,n)}}},R.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},R.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},R.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");t=2}var n,r=(1<0)for(s>s)>0&&(i=!0,o=B(n));a>=0;)s>(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=B(n));return i?o:"0"},R.prototype.negate=function(){var e=j();return R.ZERO.subTo(this,e),e},R.prototype.abs=function(){return this.s<0?this.negate():this},R.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},R.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+q(this[this.t-1]^this.s&this.DM)},R.prototype.mod=function(e){var t=j();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(R.ZERO)>0&&e.subTo(t,t),t},R.prototype.equals=function(e){return 0==this.compareTo(e)},R.prototype.add=function(e){var t=j();return this.addTo(e,t),t},R.prototype.subtract=function(e){var t=j();return this.subTo(e,t),t},R.prototype.multiply=function(e){var t=j();return this.multiplyTo(e,t),t},R.prototype.divide=function(e){var t=j();return this.divRemTo(e,t,null),t},R.prototype.modPow=function(e,t,n){var r,i=e.bitLength(),o=z(1),a=new H(t);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6;var s=new Array,u=3,c=r-1,l=(1<1){var f=j();for(a.sqrTo(s[1],f);u<=l;)s[u]=j(),a.mulTo(f,s[u-2],s[u]),u+=2}var h,d,p=e.t-1,m=!0,g=j();for(i=q(e[p])-1;p>=0;){for(i>=c?h=e[p]>>i-c&l:(h=(e[p]&(1<0&&(h|=e[p-1]>>this.DB+i-c)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--p),m)s[h].copyTo(o),m=!1;else{for(;u>1;)a.sqrTo(o,g),a.sqrTo(g,o),u-=2;u>0?a.sqrTo(o,g):(d=o,o=g,g=d),a.mulTo(g,s[h],o)}for(;p>=0&&0==(e[p]&1<0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Te="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Ie=function(e,t,n){u.a.dispatch("auth",{event:e,data:t,message:n},"Auth",Te)},Pe=new s.a("OAuth"),Re=function(){function e(e){var t=e.config,n=e.cognitoClientId,r=e.scopes,i=void 0===r?[]:r;if(this._urlOpener=t.urlOpener||xe,this._config=t,this._cognitoClientId=n,!this.isValidScopes(i))throw Error("scopes must be a String Array");this._scopes=i}return e.prototype.isValidScopes=function(e){return Array.isArray(e)&&e.every((function(e){return"string"===typeof e}))},e.prototype.oauthSignIn=function(e,t,n,i,o,a){void 0===e&&(e="code"),void 0===o&&(o=r.Cognito);var s=this._generateState(32),u=a?s+"-"+a.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join(""):s;!function(e){window.sessionStorage.setItem("oauth_state",e)}(u);var c,l=this._generateRandom(128);c=l,window.sessionStorage.setItem("ouath_pkce_key",c);var f=this._generateChallenge(l),h=this._scopes.join(" "),d="https://"+t+"/oauth2/authorize?"+Object.entries(ke(ke({redirect_uri:n,response_type:e,client_id:i,identity_provider:o,scope:h,state:u},"code"===e?{code_challenge:f}:{}),"code"===e?{code_challenge_method:"S256"}:{})).map((function(e){var t=Ae(e,2),n=t[0],r=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(r)})).join("&");Pe.debug("Redirecting to "+d),this._urlOpener(d,n)},e.prototype._handleCodeFlow=function(e){return Oe(this,void 0,void 0,(function(){var t,n,r,i,o,s,u,c,l,f,h,d,p,m;return Ce(this,(function(g){switch(g.label){case 0:return t=(Object(Me.parse)(e).query||"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n,r=Ae(t,2),i=r[0],o=r[1];return ke(ke({},e),((n={})[i]=o,n))}),{code:void 0}).code,n=Object(Me.parse)(e).pathname||"/",r=Object(Me.parse)(this._config.redirectSignIn).pathname||"/",t&&n===r?(i="https://"+this._config.domain+"/oauth2/token",Ie("codeFlow",{},"Retrieving tokens from "+i),o=a(this._config)?this._cognitoClientId:this._config.clientID,s=a(this._config)?this._config.redirectSignIn:this._config.redirectUri,u=function(){var e=window.sessionStorage.getItem("ouath_pkce_key");return window.sessionStorage.removeItem("ouath_pkce_key"),e}(),c=ke({grant_type:"authorization_code",code:t,client_id:o,redirect_uri:s},u?{code_verifier:u}:{}),Pe.debug("Calling token endpoint: "+i+" with",c),l=Object.entries(c).map((function(e){var t=Ae(e,2),n=t[0],r=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(r)})).join("&"),[4,fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l})]):[2];case 1:return[4,g.sent().json()];case 2:if(f=g.sent(),h=f.access_token,d=f.refresh_token,p=f.id_token,m=f.error)throw new Error(m);return[2,{accessToken:h,refreshToken:d,idToken:p}]}}))}))},e.prototype._handleImplicitFlow=function(e){return Oe(this,void 0,void 0,(function(){var t,n,r;return Ce(this,(function(i){return t=(Object(Me.parse)(e).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n,r=Ae(t,2),i=r[0],o=r[1];return ke(ke({},e),((n={})[i]=o,n))}),{id_token:void 0,access_token:void 0}),n=t.id_token,r=t.access_token,Ie("implicitFlow",{},"Got tokens from "+e),Pe.debug("Retrieving implicit tokens from "+e+" with"),[2,{accessToken:r,idToken:n,refreshToken:null}]}))}))},e.prototype.handleAuthResponse=function(e){return Oe(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return Ce(this,(function(u){switch(u.label){case 0:if(u.trys.push([0,5,,6]),t=e?ke(ke({},(Object(Me.parse)(e).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=Ae(t,2),r=n[0],i=n[1];return e[r]=i,e}),{})),(Object(Me.parse)(e).query||"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=Ae(t,2),r=n[0],i=n[1];return e[r]=i,e}),{})):{},n=t.error,r=t.error_description,n)throw new Error(r);return i=this._validateState(t),Pe.debug("Starting "+this._config.responseType+" flow with "+e),"code"!==this._config.responseType?[3,2]:(o=[{}],[4,this._handleCodeFlow(e)]);case 1:return[2,ke.apply(void 0,[ke.apply(void 0,o.concat([u.sent()])),{state:i}])];case 2:return a=[{}],[4,this._handleImplicitFlow(e)];case 3:return[2,ke.apply(void 0,[ke.apply(void 0,a.concat([u.sent()])),{state:i}])];case 4:return[3,6];case 5:throw s=u.sent(),Pe.error("Error handling auth response.",s),s;case 6:return[2]}}))}))},e.prototype._validateState=function(e){if(e){var t=function(){var e=window.sessionStorage.getItem("oauth_state");return window.sessionStorage.removeItem("oauth_state"),e}(),n=e.state;if(t&&t!==n)throw new Error("Invalid state in OAuth flow");return n}},e.prototype.signOut=function(){return Oe(this,void 0,void 0,(function(){var e,t,n;return Ce(this,(function(r){return e="https://"+this._config.domain+"/logout?",t=a(this._config)?this._cognitoClientId:this._config.oauth.clientID,n=a(this._config)?this._config.redirectSignOut:this._config.returnTo,e+=Object.entries({client_id:t,logout_uri:encodeURIComponent(n)}).map((function(e){var t=Ae(e,2);return t[0]+"="+t[1]})).join("&"),Ie("oAuthSignOut",{oAuth:"signOut"},"Signing out from "+e),Pe.debug("Signing out from "+e),[2,this._urlOpener(e)]}))}))},e.prototype._generateState=function(e){for(var t="",n=e,r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";n>0;--n)t+=r[Math.round(Math.random()*(r.length-1))];return t},e.prototype._generateChallenge=function(e){return this._base64URL(k()(e))},e.prototype._base64URL=function(e){return e.toString(ee.a).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype._generateRandom=function(e){var t=new Uint8Array(e);if("undefined"!==typeof window&&window.crypto)window.crypto.getRandomValues(t);else for(var n=0;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},He=new s.a("AuthClass"),Ve="aws.cognito.signin.user.admin",We="undefined"!==typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Ke=function(e,t,n){u.a.dispatch("auth",{event:e,data:t,message:n},"Auth",We)},Ge=new(function(){function e(e){var t=this;this.userPool=null,this.user=null,this.oAuthFlowInProgress=!1,this.Credentials=c.a,this.wrapRefreshSessionCallback=function(e){return function(t,n){return n?Ke("tokenRefresh",void 0,"New token retrieved"):Ke("tokenRefresh_failure",t,"Failed to retrieve new token"),e(t,n)}},this.configure(e),this.currentCredentials=this.currentCredentials.bind(this),this.currentUserCredentials=this.currentUserCredentials.bind(this),u.a.listen("auth",(function(e){switch(e.payload.event){case"signIn":t._storage.setItem("amplify-signin-with-hostedUI","false");break;case"signOut":t._storage.removeItem("amplify-signin-with-hostedUI");break;case"cognitoHostedUI":t._storage.setItem("amplify-signin-with-hostedUI","true")}}))}return e.prototype.getModuleName=function(){return"Auth"},e.prototype.configure=function(e){var t=this;if(!e)return this._config||{};He.debug("configure Auth");var n=Object.assign({},this._config,l.a.parseMobilehubConfig(e).Auth,e);this._config=n;var r=this._config,i=r.userPoolId,o=r.userPoolWebClientId,s=r.cookieStorage,u=r.oauth,c=r.region,f=r.identityPoolId,h=r.mandatorySignIn,d=r.refreshHandlers,p=r.identityPoolRegion,g=r.clientMetadata,b=r.endpoint;if(this._config.storage){if(!this._isValidAuthStorage(this._config.storage))throw He.error("The storage in the Auth config is not valid!"),new Error("Empty storage object");this._storage=this._config.storage}else this._storage=s?new Ee(s):e.ssr?new v:(new y.a).getStorage();if(this._storageSync=Promise.resolve(),"function"===typeof this._storage.sync&&(this._storageSync=this._storage.sync()),i){var w={UserPoolId:i,ClientId:o,endpoint:b};w.Storage=this._storage,this.userPool=new Se(w,this.wrapRefreshSessionCallback)}this.Credentials.configure({mandatorySignIn:h,region:p||c,userPoolId:i,identityPoolId:f,refreshHandlers:d,storage:this._storage});var S=u?a(this._config.oauth)?u:u.awsCognito:void 0;if(S){var _=Object.assign({cognitoClientId:o,UserPoolId:i,domain:S.domain,scopes:S.scope,redirectSignIn:S.redirectSignIn,redirectSignOut:S.redirectSignOut,responseType:S.responseType,Storage:this._storage,urlOpener:S.urlOpener,clientMetadata:g},S.options);this._oAuthHandler=new Re({scopes:_.scopes,config:_,cognitoClientId:_.cognitoClientId});var E={};!function(e){if(m.a.browserOrNode().isBrowser&&window.location)e({url:window.location.href});else if(!m.a.browserOrNode().isNode)throw new Error("Not supported")}((function(e){var n=e.url;E[n]||(E[n]=!0,t._handleAuthResponse(n))}))}return Ke("configured",null,"The Auth category has been configured successfully"),this._config},e.prototype.signUp=function(e){for(var t=this,n=[],r=1;r>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?E(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?E(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=h.exec(e))?new k(t[1],t[2],t[3],1):(t=d.exec(e))?new k(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=p.exec(e))?E(t[1],t[2],t[3],t[4]):(t=m.exec(e))?E(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=g.exec(e))?T(t[1],t[2]/100,t[3]/100,1):(t=v.exec(e))?T(t[1],t[2]/100,t[3]/100,t[4]):y.hasOwnProperty(e)?_(y[e]):"transparent"===e?new k(NaN,NaN,NaN,0):null}function _(e){return new k(e>>16&255,e>>8&255,255&e,1)}function E(e,t,n,r){return r<=0&&(e=t=n=NaN),new k(e,t,n,r)}function M(e){return e instanceof o||(e=S(e)),e?new k((e=e.rgb()).r,e.g,e.b,e.opacity):new k}function x(e,t,n,r){return 1===arguments.length?M(e):new k(e,t,n,null==r?1:r)}function k(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function O(){return"#"+A(this.r)+A(this.g)+A(this.b)}function C(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function A(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function T(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new P(e,t,n,r)}function I(e){if(e instanceof P)return new P(e.h,e.s,e.l,e.opacity);if(e instanceof o||(e=S(e)),!e)return new P;if(e instanceof P)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,u=a-i,c=(a+i)/2;return u?(s=t===a?(n-r)/u+6*(n0&&c<1?0:s,new P(s,u,c,e.opacity)}function P(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function R(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function j(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}r(o,S,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:b,formatHex:b,formatHsl:function(){return I(this).formatHsl()},formatRgb:w,toString:w}),r(k,x,i(o,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new k(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?a:Math.pow(a,e),new k(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:O,formatHex:O,formatRgb:C,toString:C})),r(P,(function(e,t,n,r){return 1===arguments.length?I(e):new P(e,t,n,null==r?1:r)}),i(o,{brighter:function(e){return e=null==e?s:Math.pow(s,e),new P(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?a:Math.pow(a,e),new P(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new k(R(e>=240?e-240:e+120,i,r),R(e,i,r),R(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var N=function(e){return function(){return e}};function L(e,t){return function(n){return e+n*t}}function D(e){return 1===(e=+e)?U:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):N(isNaN(t)?n:t)}}function U(e,t){var n=t-e;return n?L(e,n):N(isNaN(e)?t:e)}var B=function e(t){var n=D(t);function r(e,t){var r=n((e=x(e)).r,(t=x(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=U(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function F(e){return function(t){var n,r,i=t.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],a=r>0?e[r-1]:2*i-o,s=ro&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Object(W.a)(n,r)})),o=$.lastIndex;return oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var j={valueAccessor:function(e){return _()(e.value)?w()(e.value):e.value}};function N(e){var t=e.data,n=e.valueAccessor,r=e.dataKey,i=e.clockWise,o=e.id,a=e.textBreakAll,s=R(e,["data","valueAccessor","dataKey","clockWise","id","textBreakAll"]);return t&&t.length?l.a.createElement(g.a,{className:"recharts-label-list"},t.map((function(e,t){var c=u()(r)?n(e,t):Object(x.t)(e&&e.payload,r),f=u()(o)?{}:{id:"".concat(o,"-").concat(t)};return l.a.createElement(E.a,A({},Object(k.c)(e,!0),s,f,{parentViewBox:e.parentViewBox,index:t,value:c,textBreakAll:a,viewBox:E.a.parseViewBox(u()(i)?e:I(I({},e),{},{clockWise:i})),key:"label-".concat(t)}))}))):null}function L(e,t){return e?!0===e?l.a.createElement(N,{key:"labelList-implicit",data:t}):l.a.isValidElement(e)||a()(e)?l.a.createElement(N,{key:"labelList-implicit",data:t,content:e}):y()(e)?l.a.createElement(N,A({data:t},e,{key:"labelList-implicit"})):null:null}function D(){return(D=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function z(e){var t=e.offset,n=e.layout,r=e.width,i=e.dataKey,o=e.data,a=e.dataPointFormatter,s=e.xAxis,u=e.yAxis,c=F(e,["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"]),f=Object(k.c)(c),h=o.map((function(e,o){var c=a(e,i),h=c.x,d=c.y,p=c.value,m=c.errorVal;if(!m)return null;var v,y,b=[];if(Array.isArray(m)){var w=U(m,2);v=w[0],y=w[1]}else v=y=m;if("vertical"===n){var S=s.scale,_=d+t,E=_+r,M=_-r,x=S(p-v),k=S(p+y);b.push({x1:k,y1:E,x2:k,y2:M}),b.push({x1:x,y1:_,x2:k,y2:_}),b.push({x1:x,y1:E,x2:x,y2:M})}else if("horizontal"===n){var O=u.scale,C=h+t,A=C-r,T=C+r,I=O(p-v),P=O(p+y);b.push({x1:A,y1:P,x2:T,y2:P}),b.push({x1:C,y1:I,x2:C,y2:P}),b.push({x1:A,y1:I,x2:T,y2:I})}return l.a.createElement(g.a,D({className:"recharts-errorBar",key:"bar-".concat(o)},f),b.map((function(e,t){return l.a.createElement("line",D({},e,{key:"line-".concat(t)}))})))}));return l.a.createElement(g.a,{className:"recharts-errorBars"},h)}N.displayName="LabelList",N.renderCallByParent=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=Object(M.a)(r,N.displayName).map((function(e,n){return Object(c.cloneElement)(e,{data:t,key:"labelList-".concat(n)})}));if(!n)return i;var o=L(e.label,t);return[o].concat(O(i))},N.defaultProps=j,z.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"},z.displayName="ErrorBar";var q=n(5),H=n(71);function V(e){return(V="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function K(){return(K=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);no){u=[].concat(X(n.slice(0,c)),[o-l]);break}var f=u.length%2===0?[0,a]:[a];return[].concat(X(s.repeat(n,i)),X(u),f).map((function(e){return"".concat(e,"px")})).join(", ")},e.id=Object(q.j)("recharts-line-"),e.pathRef=function(t){e.mainCurve=t},e.handleAnimationEnd=function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()},e.handleAnimationStart=function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()},e}return t=s,r=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var n=e.length%2!==0?[].concat(X(e),[0]):e,r=[],i=0;i0||!i()(s,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:"render",value:function(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,o=e.xAxis,a=e.yAxis,s=e.top,c=e.left,f=e.width,h=e.height,p=e.isAnimationActive,m=e.id;if(t||!r||!r.length)return null;var v=this.state.isAnimationFinished,y=1===r.length,b=d()("recharts-line",i),w=o&&o.allowDataOverflow||a&&a.allowDataOverflow,S=u()(m)?this.id:m;return l.a.createElement(g.a,{className:b},w?l.a.createElement("defs",null,l.a.createElement("clipPath",{id:"clipPath-".concat(S)},l.a.createElement("rect",{x:c,y:s,width:f,height:h}))):null,!y&&this.renderCurve(w,S),this.renderErrorBar(),(y||n)&&this.renderDots(w,S),(!p||v)&&N.renderCallByParent(this.props,r))}}])&&Q(t.prototype,n),r&&Q(t,r),s}(c.PureComponent);ie.displayName="Line",ie.defaultProps={xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!H.a.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1},ie.getComposedData=function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,a=e.dataKey,s=e.bandSize,c=e.displayedData,l=e.offset,f=t.layout;return $({points:c.map((function(e,t){var c=Object(x.t)(e,a);return"horizontal"===f?{x:Object(x.h)({axis:n,ticks:i,bandSize:s,entry:e,index:t}),y:u()(c)?null:r.scale(c),value:c,payload:e}:{x:u()(c)?null:n.scale(c),y:Object(x.h)({axis:r,ticks:o,bandSize:s,entry:e,index:t}),value:c,payload:e}})),layout:f},l)}},function(e,t,n){"use strict";function r(e){for(var t="https://material-ui.com/production-error/?code="+e,n=1;n=0?(u>=r?10:u>=i?5:u>=o?2:1)*Math.pow(10,s):-Math.pow(10,-s)/(u>=r?10:u>=i?5:u>=o?2:1)}function s(e,t,n){var a=Math.abs(t-e)/Math.max(0,n),s=Math.pow(10,Math.floor(Math.log(a)/Math.LN10)),u=a/s;return u>=r?s*=10:u>=i?s*=5:u>=o&&(s*=2),t0)return[e];if((r=t0){var c=Math.round(e/s),l=Math.round(t/s);for(c*st&&--l,o=new Array(i=l-c+1);++ut&&--h,o=new Array(i=h-f+1);++u