factom
Version:
Library to build applications on the Factom blockchain
2 lines • 336 kB
JavaScript
/*! For license information please see factom.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.factom=e():t.factom=e()}(self,(function(){return(()=>{var t={7228:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0},2858:t=>{t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},9873:(t,e,r)=>{var n=r(7228);t.exports=function(t){if(Array.isArray(t))return n(t)},t.exports.default=t.exports,t.exports.__esModule=!0},1506:t=>{t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},8926:t=>{function e(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(i,o){var s=t.apply(r,n);function a(t){e(s,i,o,a,u,"next",t)}function u(t){e(s,i,o,a,u,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},4575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},9100:(t,e,r)=>{var n=r(9489),i=r(7067);function o(e,r,s){return i()?(t.exports=o=Reflect.construct,t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=o=function(t,e,r){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return r&&n(o,r.prototype),o},t.exports.default=t.exports,t.exports.__esModule=!0),o.apply(null,arguments)}t.exports=o,t.exports.default=t.exports,t.exports.__esModule=!0},3913:t=>{function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t},t.exports.default=t.exports,t.exports.__esModule=!0},9713:t=>{t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},6525:(t,e,r)=>{var n=r(8331);function i(){return"undefined"!=typeof Reflect&&Reflect.get?(t.exports=i=Reflect.get,t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=i=function(t,e,r){var i=n(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},t.exports.default=t.exports,t.exports.__esModule=!0),i.apply(this,arguments)}t.exports=i,t.exports.default=t.exports,t.exports.__esModule=!0},9754:t=>{function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,e(r)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},2205:(t,e,r)=>{var n=r(9489);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},5318:t=>{t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},430:t=>{t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")},t.exports.default=t.exports,t.exports.__esModule=!0},7067:t=>{t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.default=t.exports,t.exports.__esModule=!0},6860:t=>{t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},3884:t=>{t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);s=!0);}catch(t){a=!0,i=t}finally{try{s||null==r.return||r.return()}finally{if(a)throw i}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0},521:t=>{t.exports=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.")},t.exports.default=t.exports,t.exports.__esModule=!0},8206:t=>{t.exports=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.")},t.exports.default=t.exports,t.exports.__esModule=!0},8585:(t,e,r)=>{var n=r(8).default,i=r(1506);t.exports=function(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)},t.exports.default=t.exports,t.exports.__esModule=!0},9489:t=>{function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,e(r,n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},3038:(t,e,r)=>{var n=r(2858),i=r(3884),o=r(379),s=r(521);t.exports=function(t,e){return n(t)||i(t,e)||o(t,e)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},8331:(t,e,r)=>{var n=r(9754);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t},t.exports.default=t.exports,t.exports.__esModule=!0},319:(t,e,r)=>{var n=r(9873),i=r(6860),o=r(379),s=r(8206);t.exports=function(t){return n(t)||i(t)||o(t)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},8:t=>{function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(r)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},379:(t,e,r)=>{var n=r(7228);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},5957:(t,e,r)=>{var n=r(9754),i=r(9489),o=r(430),s=r(9100);function a(e){var r="function"==typeof Map?new Map:void 0;return t.exports=a=function(t){if(null===t||!o(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return s(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},t.exports.default=t.exports,t.exports.__esModule=!0,a(e)}t.exports=a,t.exports.default=t.exports,t.exports.__esModule=!0},7757:(t,e,r)=>{t.exports=r(5666)},9669:(t,e,r)=>{t.exports=r(1609)},5448:(t,e,r)=>{"use strict";var n=r(4867),i=r(6026),o=r(4372),s=r(5327),a=r(4097),u=r(4109),c=r(7985),l=r(5061),h=r(5655),f=r(5263);t.exports=function(t){return new Promise((function(e,r){var p,d=t.data,y=t.headers,g=t.responseType;function v(){t.cancelToken&&t.cancelToken.unsubscribe(p),t.signal&&t.signal.removeEventListener("abort",p)}n.isFormData(d)&&delete y["Content-Type"];var m=new XMLHttpRequest;if(t.auth){var _=t.auth.username||"",b=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";y.Authorization="Basic "+btoa(_+":"+b)}var w=a(t.baseURL,t.url);function E(){if(m){var n="getAllResponseHeaders"in m?u(m.getAllResponseHeaders()):null,o={data:g&&"text"!==g&&"json"!==g?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:t,request:m};i((function(t){e(t),v()}),(function(t){r(t),v()}),o),m=null}}if(m.open(t.method.toUpperCase(),s(w,t.params,t.paramsSerializer),!0),m.timeout=t.timeout,"onloadend"in m?m.onloadend=E:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(E)},m.onabort=function(){m&&(r(l("Request aborted",t,"ECONNABORTED",m)),m=null)},m.onerror=function(){r(l("Network Error",t,null,m)),m=null},m.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",n=t.transitional||h.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(l(e,t,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",m)),m=null},n.isStandardBrowserEnv()){var x=(t.withCredentials||c(w))&&t.xsrfCookieName?o.read(t.xsrfCookieName):void 0;x&&(y[t.xsrfHeaderName]=x)}"setRequestHeader"in m&&n.forEach(y,(function(t,e){void 0===d&&"content-type"===e.toLowerCase()?delete y[e]:m.setRequestHeader(e,t)})),n.isUndefined(t.withCredentials)||(m.withCredentials=!!t.withCredentials),g&&"json"!==g&&(m.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&m.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(p=function(t){m&&(r(!t||t&&t.type?new f("canceled"):t),m.abort(),m=null)},t.cancelToken&&t.cancelToken.subscribe(p),t.signal&&(t.signal.aborted?p():t.signal.addEventListener("abort",p))),d||(d=null),m.send(d)}))}},1609:(t,e,r)=>{"use strict";var n=r(4867),i=r(1849),o=r(321),s=r(7185),a=function t(e){var r=new o(e),a=i(o.prototype.request,r);return n.extend(a,o.prototype,r),n.extend(a,r),a.create=function(r){return t(s(e,r))},a}(r(5655));a.Axios=o,a.Cancel=r(5263),a.CancelToken=r(4972),a.isCancel=r(6502),a.VERSION=r(7288).version,a.all=function(t){return Promise.all(t)},a.spread=r(8713),a.isAxiosError=r(6268),t.exports=a,t.exports.default=a},5263:t=>{"use strict";function e(t){this.message=t}e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,t.exports=e},4972:(t,e,r)=>{"use strict";var n=r(5263);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;this.promise.then((function(t){if(r._listeners){var e,n=r._listeners.length;for(e=0;e<n;e++)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t){r.reason||(r.reason=new n(t),e(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},i.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},6502:t=>{"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},321:(t,e,r)=>{"use strict";var n=r(4867),i=r(5327),o=r(782),s=r(3572),a=r(7185),u=r(4875),c=u.validators;function l(t){this.defaults=t,this.interceptors={request:new o,response:new o}}l.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&u.assertOptions(e,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function(t){o.push(t.fulfilled,t.rejected)})),!n){var l=[s,void 0];for(Array.prototype.unshift.apply(l,r),l=l.concat(o),i=Promise.resolve(t);l.length;)i=i.then(l.shift(),l.shift());return i}for(var h=t;r.length;){var f=r.shift(),p=r.shift();try{h=f(h)}catch(t){p(t);break}}try{i=s(h)}catch(t){return Promise.reject(t)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},l.prototype.getUri=function(t){return t=a(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(t){l.prototype[t]=function(e,r){return this.request(a(r||{},{method:t,url:e,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(t){l.prototype[t]=function(e,r,n){return this.request(a(n||{},{method:t,url:e,data:r}))}})),t.exports=l},782:(t,e,r)=>{"use strict";var n=r(4867);function i(){this.handlers=[]}i.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){n.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},4097:(t,e,r)=>{"use strict";var n=r(1793),i=r(7303);t.exports=function(t,e){return t&&!n(e)?i(t,e):e}},5061:(t,e,r)=>{"use strict";var n=r(481);t.exports=function(t,e,r,i,o){var s=new Error(t);return n(s,e,r,i,o)}},3572:(t,e,r)=>{"use strict";var n=r(4867),i=r(8527),o=r(6502),s=r(5655),a=r(5263);function u(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new a("canceled")}t.exports=function(t){return u(t),t.headers=t.headers||{},t.data=i.call(t,t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||s.adapter)(t).then((function(e){return u(t),e.data=i.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(u(t),e&&e.response&&(e.response.data=i.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},481:t=>{"use strict";t.exports=function(t,e,r,n,i){return t.config=e,r&&(t.code=r),t.request=n,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}},7185:(t,e,r)=>{"use strict";var n=r(4867);t.exports=function(t,e){e=e||{};var r={};function i(t,e){return n.isPlainObject(t)&&n.isPlainObject(e)?n.merge(t,e):n.isPlainObject(e)?n.merge({},e):n.isArray(e)?e.slice():e}function o(r){return n.isUndefined(e[r])?n.isUndefined(t[r])?void 0:i(void 0,t[r]):i(t[r],e[r])}function s(t){if(!n.isUndefined(e[t]))return i(void 0,e[t])}function a(r){return n.isUndefined(e[r])?n.isUndefined(t[r])?void 0:i(void 0,t[r]):i(void 0,e[r])}function u(r){return r in e?i(t[r],e[r]):r in t?i(void 0,t[r]):void 0}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return n.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=c[t]||o,i=e(t);n.isUndefined(i)&&e!==u||(r[t]=i)})),r}},6026:(t,e,r)=>{"use strict";var n=r(5061);t.exports=function(t,e,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?e(n("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)}},8527:(t,e,r)=>{"use strict";var n=r(4867),i=r(5655);t.exports=function(t,e,r){var o=this||i;return n.forEach(r,(function(r){t=r.call(o,t,e)})),t}},5655:(t,e,r)=>{"use strict";var n=r(4867),i=r(6016),o=r(481),s={"Content-Type":"application/x-www-form-urlencoded"};function a(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var u,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=r(5448)),u),transformRequest:[function(t,e){return i(e,"Accept"),i(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t)?t:n.isArrayBufferView(t)?t.buffer:n.isURLSearchParams(t)?(a(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):n.isObject(t)||e&&"application/json"===e["Content-Type"]?(a(e,"application/json"),function(t,e,r){if(n.isString(t))try{return(0,JSON.parse)(t),n.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||c.transitional,r=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,s=!r&&"json"===this.responseType;if(s||i&&n.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw o(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){c.headers[t]=n.merge(s)})),t.exports=c},7288:t=>{t.exports={version:"0.24.0"}},1849:t=>{"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}}},5327:(t,e,r)=>{"use strict";var n=r(4867);function i(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var o;if(r)o=r(e);else if(n.isURLSearchParams(e))o=e.toString();else{var s=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),s.push(i(e)+"="+i(t))})))})),o=s.join("&")}if(o){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}},7303:t=>{"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},4372:(t,e,r)=>{"use strict";var n=r(4867);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,r,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:t=>{"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},6268:t=>{"use strict";t.exports=function(t){return"object"==typeof t&&!0===t.isAxiosError}},7985:(t,e,r)=>{"use strict";var n=r(4867);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=i(window.location.href),function(e){var r=n.isString(e)?i(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},6016:(t,e,r)=>{"use strict";var n=r(4867);t.exports=function(t,e){n.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))}},4109:(t,e,r)=>{"use strict";var n=r(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,r,o,s={};return t?(n.forEach(t.split("\n"),(function(t){if(o=t.indexOf(":"),e=n.trim(t.substr(0,o)).toLowerCase(),r=n.trim(t.substr(o+1)),e){if(s[e]&&i.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([r]):s[e]?s[e]+", "+r:r}})),s):s}},8713:t=>{"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},4875:(t,e,r)=>{"use strict";var n=r(7288).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){i[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));var o={};i.transitional=function(t,e,r){function i(t,e){return"[Axios v"+n+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(r,n,s){if(!1===t)throw new Error(i(n," has been removed"+(e?" in "+e:"")));return e&&!o[n]&&(o[n]=!0,console.warn(i(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,n,s)}},t.exports={assertOptions:function(t,e,r){if("object"!=typeof t)throw new TypeError("options must be an object");for(var n=Object.keys(t),i=n.length;i-- >0;){var o=n[i],s=e[o];if(s){var a=t[o],u=void 0===a||s(a,o,t);if(!0!==u)throw new TypeError("option "+o+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},4867:(t,e,r)=>{"use strict";var n=r(1849),i=Object.prototype.toString;function o(t){return"[object Array]"===i.call(t)}function s(t){return void 0===t}function a(t){return null!==t&&"object"==typeof t}function u(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function c(t){return"[object Function]"===i.call(t)}function l(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),o(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:o,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:function(t){return null!==t&&!s(t)&&null!==t.constructor&&!s(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:c,isStream:function(t){return a(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:l,merge:function t(){var e={};function r(r,n){u(e[n])&&u(r)?e[n]=t(e[n],r):u(r)?e[n]=t({},r):o(r)?e[n]=r.slice():e[n]=r}for(var n=0,i=arguments.length;n<i;n++)l(arguments[n],r);return e},extend:function(t,e,r){return l(e,(function(e,i){t[i]=r&&"function"==typeof e?n(e,r):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},7145:(t,e,r)=>{"use strict";var n=r(5318),i=n(r(7757)),o=n(r(4575)),s=n(r(1506)),a=n(r(2205)),u=n(r(8585)),c=n(r(9754)),l=n(r(5957)),h=n(r(8926));var f=r(6624),p=r(4420).toHex;function d(t,e,r,n,o,s){if(!e||!r)return f.reject(new y("Invalid argument: hash or chain ID is missing",s,e));var a=o||60,u=Date.now();return new f((function(o,c){var l=setInterval((0,h.default)(i.default.mark((function h(){var f,p,d;return i.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,t.call("ack",{hash:e,chainid:r}).catch((function(t){clearInterval(l),f=t}));case 3:if(p=i.sent,!f){i.next=6;break}return i.abrupt("return",c(new y(f,s,e)));case 6:if("Unknown"===(d=n?p[n].status:p.status)||"NotConfirmed"===d){i.next=10;break}return clearInterval(l),i.abrupt("return",o(d));case 10:if(!(Date.now()-u>1e3*a)){i.next=13;break}return clearInterval(l),i.abrupt("return",c(new y("Timeout",s,e)));case 13:i.next=19;break;case 15:return i.prev=15,i.t0=i.catch(0),clearInterval(l),i.abrupt("return",c(new y("Unexpected error: "+i.t0.message,s,e)));case 19:case"end":return i.stop()}}),h,null,[[0,15]])}))),500)}))}var y=function(t){(0,a.default)(i,t);var e,r,n=(e=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,c.default)(e);if(r){var i=(0,c.default)(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return(0,u.default)(this,t)});function i(t,e,r){var a;return(0,o.default)(this,i),(a=n.call(this,"Acknowledgement of type [".concat(e,"] failed for [").concat(r,"]: ").concat(t))).ackType=e,a.hash=r,Error.captureStackTrace&&Error.captureStackTrace((0,s.default)(a),i),a}return i}((0,l.default)(Error));t.exports={waitOnCommitAck:function(t,e,r){return d(t,e,"c","commitdata",r,"entry-commit")},waitOnRevealAck:function(t,e,r,n){return d(t,e,p(r),"entrydata",n,"entry-reveal")},waitOnFactoidTransactionAck:function(t,e,r){return d(t,e,"f",null,r,"factoid-transaction")}}},7570:(t,e,r)=>{"use strict";var n=r(5318),i=n(r(7757)),o=n(r(8)),s=n(r(8926)),a=r(6624),u=r(4420).isIterable,c=r(2403).chainExists,l=r(7145),h=l.waitOnCommitAck,f=l.waitOnRevealAck,p=r(8092).getPublicAddress,d=r(5299),y=d.Chain,g=d.composeChainCommit,v=d.composeChainCommitDelegateSig,m=d.composeChainReveal,_=r(636),b=_.Entry,w=_.composeEntryCommit,E=_.composeEntryCommitDelegateSig,x=_.composeEntryReveal;function k(t,e,r,n){return C.apply(this,arguments)}function C(){return(C=(0,s.default)(i.default.mark((function t(e,r,n,s){var a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,c(e,r.id);case 2:if(!t.sent){t.next=4;break}throw new Error("Chain ".concat(r.idHex," already exists."));case 4:if("object"!==(0,o.default)(s)||"function"!=typeof s.sign){t.next=10;break}return t.next=7,v(r,n,s.sign).then((function(t){return t.toString("hex")}));case 7:a=t.sent,t.next=11;break;case 10:a=g(r,n).toString("hex");case 11:return t.abrupt("return",T({factomd:e,commitApiCall:"commit-chain",commit:a,ackTimeout:R(s)}));case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function S(t,e,r,n){return A.apply(this,arguments)}function A(){return(A=(0,s.default)(i.default.mark((function t(e,r,n,s){var a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.chainId.length){t.next=2;break}throw new Error("Entry should contain a chain id to be committed");case 2:if("object"!==(0,o.default)(s)||"function"!=typeof s.sign){t.next=8;break}return t.next=5,E(r,n,s.sign).then((function(t){return t.toString("hex")}));case 5:a=t.sent,t.next=9;break;case 8:a=w(r,n).toString("hex");case 9:return t.abrupt("return",T({factomd:e,commitApiCall:"commit-entry",commit:a,ackTimeout:R(s)}));case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function R(t){return"object"===(0,o.default)(t)?t.ackTimeout:"number"==typeof t?t:void 0}function T(t){return O.apply(this,arguments)}function O(){return(O=(0,s.default)(i.default.mark((function t(e){var r,n,o,s,a,u,c;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.factomd,n=e.commit,o=e.commitApiCall,s=e.ackTimeout,a=void 0===s?60:s,u=!1,t.next=4,r.call(o,{message:n}).catch((function(t){if(-32011!==t.code)throw t;u=!0}));case 4:if(!((c=t.sent)&&a>=0)){t.next=8;break}return t.next=8,h(r,c.txid,a);case 8:return t.abrupt("return",{txId:c?c.txid:void 0,repeatedCommit:u});case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function B(t,e,r){return P(t,e,m,"reveal-chain",r)}function j(t,e,r){if(!e.chainId.length)throw new Error("Entry should contain a chain id to be revealed");return P(t,e,x,"reveal-entry",r)}function P(t,e,r,n){return I.apply(this,arguments)}function I(){return I=(0,s.default)(i.default.mark((function t(e,r,n,o){var s,a,u,c=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=c.length>4&&void 0!==c[4]?c[4]:60,a=n(r).toString("hex"),t.next=4,e.call(o,{entry:a});case 4:if(u=t.sent,!(s>=0)){t.next=8;break}return t.next=8,f(e,u.entryhash,u.chainid,s);case 8:return t.abrupt("return",{chainId:u.chainid,entryHash:u.entryhash});case 9:case"end":return t.stop()}}),t)}))),I.apply(this,arguments)}function F(t,e,r,n){switch(e.constructor){case b:return M(t,e,r,n);case y:return L(t,e,r,n);default:throw new Error("Argument of `add` is not an instance of Chain or Entry")}}function L(t,e,r,n){return N(t,e,k,B,r,n)}function M(t,e,r,n){return U.apply(this,arguments)}function U(){return(U=(0,s.default)(i.default.mark((function t(e,r,n,o){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.chainId.length){t.next=2;break}throw new Error("Entry should contain a chain id to be added to the blockchain");case 2:return t.abrupt("return",N(e,r,S,j,n,o));case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function N(t,e,r,n,i){return D.apply(this,arguments)}function D(){return D=(0,s.default)(i.default.mark((function t(e,r,n,o,s){var u,c,l,h,f,p,d=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((u=d.length>5&&void 0!==d[5]?d[5]:{}).skipFundValidation){t.next=4;break}return t.next=4,V(e,s,r.ecCost());case 4:if(c=u.commitTimeout||60,l=u.revealTimeout||60,!(c<0)){t.next=14;break}return t.next=9,a.all([n(e,r,s,{ackTimeout:c,sign:u.sign}),o(e,r,l)]);case 9:p=t.sent,h=p[0],f=p[1],t.next=20;break;case 14:return t.next=16,n(e,r,s,{ackTimeout:c,sign:u.sign});case 16:return h=t.sent,t.next=19,o(e,r,l);case 19:f=t.sent;case 20:return t.abrupt("return",Object.assign({},h,f));case 21:case"end":return t.stop()}}),t)}))),D.apply(this,arguments)}function H(t,e,r){return q.apply(this,arguments)}function q(){return q=(0,s.default)(i.default.mark((function t(e,r,n){var o,s,u,c=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((o=c.length>3&&void 0!==c[3]?c[3]:{}).skipFundValidation){t.next=6;break}return o.skipFundValidation=!0,s=r.reduce((function(t,e){return t+e.ecCost()}),0),t.next=6,V(e,n,s);case 6:return u=o.chunkSize||o.concurrency||200,t.abrupt("return",a.map(r,(function(t){return F(e,t,n,o)}),{concurrency:u}));case 8:case"end":return t.stop()}}),t)}))),q.apply(this,arguments)}function V(t,e,r){return z.apply(this,arguments)}function z(){return(z=(0,s.default)(i.default.mark((function t(e,r,n){var o,s,a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=p(r),t.next=3,e.call("entry-credit-balance",{address:o});case 3:if(s=t.sent,!((a=s.balance)<n)){t.next=7;break}throw new Error("".concat(o," current balance (").concat(a," EC) is not sufficient to pay the total cost of ").concat(n," EC."));case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var K=H,W=H;t.exports={add:function(t,e,r,n){return u(e)?H(t,e,r,n):F(t,e,r,n)},addChain:L,addChains:W,addEntry:M,addEntries:K,commit:function(t,e,r,n){switch(e.constructor){case b:return S(t,e,r,n);case y:return k(t,e,r,n);default:throw new Error("Argument of `commit` is not an instance of Chain or Entry")}},commitEntry:S,commitChain:k,reveal:function(t,e,r){switch(e.constructor){case b:return j(t,e,r);case y:return B(t,e,r);default:throw new Error("Argument of `reveal` is not an instance of Chain or Entry")}},revealEntry:j,revealChain:B}},8092:(t,e,r)=>{"use strict";var n=r(6177),i=r(780),o=r(4420),s=o.RCD_TYPE_1,a=o.secretToPublicKey,u=o.sha256d,c=r(5694),l=c.FACTOID_PUBLIC_PREFIX,h=c.FACTOID_PRIVATE_PREFIX,f=c.ENTRYCREDIT_PUBLIC_PREFIX,p=c.ENTRYCREDIT_PRIVATE_PREFIX,d=c.VALID_PREFIXES,y=c.PUBLIC_ADDRESS_VALID_PREFIXES,g=c.PRIVATE_ADDRESS_VALID_PREFIXES,v=c.EC_ADDRESS_VALID_PREFIXES,m=c.FCT_ADDRESS_VALID_PREFIXES;function _(t){try{if(!d.has(t.slice(0,2)))return!1;var e=Buffer.from(n.decode(t));return 38===e.length&&!!u(e.slice(0,34)).slice(0,4).equals(e.slice(34,38))}catch(t){return!1}}function b(t){return _(t)&&"FA"===t.substring(0,2)}function w(t){return C(t,l,!0)}function E(t){return C(t,h)}function x(t){return C(t,f)}function k(t){return C(t,p)}function C(t,e,r){var i=Buffer.from(t,"hex");if(32!==i.length)throw new Error("Key ".concat(i," is not 32 bytes long."));var o=Buffer.concat([e,r?S(i):i]),s=u(o).slice(0,4);return n.encode(Buffer.concat([o,s]))}function S(t){return u(Buffer.concat([s,t]))}t.exports={isValidAddress:_,addressToKey:function(t){if(!_(t))throw new Error("Invalid address ".concat(t,"."));if(t.startsWith("FA"))throw new Error("A public Factoid address does not hold a public key but a RCD hash. Use addressToRcdHash function instead.");return Buffer.from(n.decode(t).slice(2,34))},addressToRcdHash:function(t){if(!b(t))throw new Error("Address ".concat(t," is not a valid public Factoid address"));return Buffer.from(n.decode(t).slice(2,34))},isValidPublicAddress:function(t){return _(t)&&y.has(t.substring(0,2))},isValidPrivateAddress:function(t){return _(t)&&g.has(t.substring(0,2))},isValidEcAddress:function(t){return _(t)&&v.has(t.substring(0,2))},isValidPublicEcAddress:function(t){return _(t)&&"EC"===t.substring(0,2)},isValidPrivateEcAddress:function(t){return _(t)&&"Es"===t.substring(0,2)},isValidFctAddress:function(t){return _(t)&&m.has(t.substring(0,2))},isValidPublicFctAddress:b,isValidPrivateFctAddress:function(t){return _(t)&&"Fs"===t.substring(0,2)},getPublicAddress:function(t){if(!_(t))throw new Error("Invalid address ".concat(t,"."));if("s"!==t[1])return t;var e=n.decode(t).slice(2,34),r=a(e);return"F"===t[0]?w(r):x(r)},keyToPublicFctAddress:w,rcdHashToPublicFctAddress:function(t){return C(t,l)},seedToPrivateFctAddress:E,keyToPublicEcAddress:x,seedToPrivateEcAddress:k,generateRandomFctAddress:function(){var t=i.randomBytes(32);return{public:w(i.sign.keyPair.fromSeed(t).publicKey),private:E(t)}},generateRandomEcAddress:function(){var t=i.randomBytes(32);return{public:x(i.sign.keyPair.fromSeed(t).publicKey),private:k(t)}}}},8920:(t,e,r)=>{"use strict";var n=r(5318),i=n(r(6525)),o=n(r(3913)),s=n(r(8)),a=n(r(4575)),u=n(r(1506)),c=n(r(2205)),l=n(r(8585)),h=n(r(9754)),f=n(r(5957));function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,h.default)(t);if(e){var i=(0,h.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}var d=r(9669),y=r(9267).Agent,g=r(6624),v=r(9353),m=new Set(["holding-queue","network-info","predictive-fer","audit-servers","federated-servers","configuration","process-list","authorities","reload-configuration","drop-rate","set-drop-rate","delay","set-delay","summary","messages"]),_={retries:3,factor:2,minTimeout:500,maxTimeout:2e3},b=function(t){(0,c.default)(r,t);var e=p(r);function r(t,n,i){var o;(0,a.default)(this,r);var c=["API call to [".concat(t,"] ")];return"object"===(0,s.default)(n)&&c.push("with params ".concat(JSON.stringify(n)," ")),c.push("got rejected: ".concat(i.message," (code: ").concat(i.code,")")),(o=e.call(this,c.join(""))).code=i.code,o.data=i.data,Error.captureStackTrace&&Error.captureStackTrace((0,u.default)(o),r),o}return r}((0,f.default)(Error)),w=function(){function t(e,r){(0,a.default)(this,t);var n,i=e.host||"localhost",o=e.protocol||"http",s=e.port||r,u={baseURL:"".concat(o,"://").concat(i,":").concat(s),headers:{"Content-Type":"application/json"}};"string"==typeof e.user&&""!==e.user&&(u.auth={username:e.user,password:e.password||""},u.withCredentials=!0),"https"===o&&void 0!==e.rejectUnauthorized&&(u.httpsAgent=new y({rejectUnauthorized:e.rejectUnauthorized})),e.timeout&&(u.timeout=parseInt(e.timeout)),this.httpCli=d.create(u),this.path=e.path||"/v2",this.apiCounter=(n=0,function(){return++n}),this.retry=e.retry||_,this.cookies={}}return(0,o.default)(t,[{key:"_processCookieHeader",value:function(t){var e=this;Array.isArray(t)&&(t.map((function(t){return t.split(";")[0]})).forEach((function(t){var r=t.split("=");e.cookies[r[0]]=r[1]})),this.httpCli.defaults.headers.Cookie=Object.entries(this.cookies).map((function(t){return"".concat(t[0],"=").concat(t[1])})).join(";"))}},{key:"call",value:function(t,e,r,n){var i=this,o=n||{},a=o.timeout,u=o.retry;return new g((function(n,o){var c=v.operation(u||i.retry),l={jsonrpc:"2.0",id:i.apiCounter(),method:e,params:r};c.attempt((function(){i.httpCli.post(t,l,{timeout:a}).then((function(t){i._processCookieHeader(t.headers["set-cookie"]),n(t.data.result)})).catch((function(t){return function(t){var e,r=t.error,n=t.reject,i=t.method,o=t.params,a=t.operation;if(r.response){var u=r.response.data;switch(r.response.status){case 400:return"object"===(0,s.default)(u.error)?n(new b(i,o,u.error)):n(new Error(u));case 401:return n(new Error(r.response.data));default:e="object"===(0,s.default)(u)?JSON.stringify(u):u}}else e=r.message;var c=new Error(e);if(!a.retry(c))return n(a.mainError())}({error:t,reject:o,method:e,params:r,operation:c})}))}))}))}}]),t}(),E=function(t){(0,c.default)(r,t);var e=p(r);function r(t){var n;(0,a.default)(this,r);var i=t||{};return(n=e.call(this,i,8088)).debugPath=i.debugPath||"/debug",n}return(0,o.default)(r,[{key:"call",value:function(t,e,n){var o=m.has(t)?this.debugPath:this.path;return(0,i.default)((0,h.default)(r.prototype),"call",this).call(this,o,t,e,n)}}]),r}(w),x=function(t){(0,c.default)(r,t);var e=p(r);function r(t){(0,a.default)(this,r);var n=t||{};return e.call(this,n,8089)}return(0,o.default)(r,[{key:"call",value:function(t,e,n){return(0,i.default)((0,h.default)(r.prototype),"call",this).call(this,this.path,t,e,n)}}]),r}(w);t.exports={FactomdCli:E,WalletdCli:x}},8876:(t,e,r)=>{"use strict";var n=r(5318),i=n(r(3913)),o=n(r(4575));function s(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}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 o,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var u=r(9672).Transaction,c=r(8092),l=c.keyToPublicEcAddress,h=c.rcdHashToPublicFctAddress,f=r(5694),p=f.ADMIN_ID_TO_CODE,d=f.ADMIN_BLOCKS_CHAIN_ID,y=f.ENTRY_CREDIT_BLOCKS_CHAIN_ID,g=f.FACTOID_BLOCKS_CHAIN_ID,v=function(){function t(e){(0,o.default)(this,t);var r=e.ablock;this.backReferenceHash=r.backreferencehash,this.lookupHash=r.lookuphash;var n=r.header;this.directoryBlockHeight=n.dbheight,this.previousBackReferenceHash=n.prevbackrefhash,this.headerExpansionSize=n.headerexpansionsize,this.headerExpansionArea=n.headerexpansionarea,this.bodySize=n.bodysize,this.entries=r.abentries.map(m),Object.freeze(this)}return(0,i.default)(t,[{key:"getEntriesOfTypes",value:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=new Set(e);return this.entries.filter((function(t){return n.has(t.adminId)||n.has(t.adminCode)}))}}]),t}();function m(t){var e={adminId:t.adminidtype,adminCode:p.get(t.adminidtype)},r={};switch(e.adminId){case 1:r.identityChainId=t.identityadminchainid,r.previousDirectoryBlockSignature={publicKey:t.prevdbsig.pub,signature:t.prevdbsig.sig};break;case 2:case 3:r.identityChainId=t.identitychainid,r.matryoshkaHash=t.mhash;break;case 4:r.amount=t.amount;break;case 5:case 6:case 7:r.identityChainId=t.identitychainid,r.directoryBlockHeight=t.dbheight;break;case 8:r.identityChainId=t.identitychainid,r.keyPriority=t.keypriority,r.publicKey=t.publickey,r.directoryBlockHeight=t.dbheight;break;case 9:r.identityChainId=t.identitychainid,r.keyPriority=t.keypriority,r.keyType=t.keytype,r.ecdsaPublicKey=t.ecdsapublickey;break;case 11:r.outputs=t.Outputs.map((function(t){return{address:t.useraddress,rcdHash:t.address,amount:t.amount}}));break;case 12:r.descriptorHeight=t.descriptor_height,r.descriptorIndex=t.DescriptorIndex;break;case 13:r.identityChainId=t.IdentityChainID,r.rcdHash=t.FactoidAddress,r.factoidAddress=h(t.FactoidAddress);break;case 14:r.identityChainId=t.IdentityChainID,r.efficiency=t.Efficiency/100}return Object.assign(e,r)}var _=function(){function t(e){var r=this;(0,o.default)(this,t);var n=e.fblock;this.keyMR=n.keymr,this.bodyMR=n.bodymr,this.previousBlockKeyMR=n.prevkeymr,this.ledgerKeyMR=n.ledgerkeymr,this.previousLedgerKeyMR=n.prevledgerkeymr,this.entryCreditRate=n.exchrate,this.directoryBlockHeight=n.dbheight,this.transactions=n.transactions.map((function(t){return new u(t,{factoidBlockKeyMR:r.keyMR,directoryBlockHeight:r.directoryBlockHeight})}))}return(0,i.default)(t,[{key:"getCoinbaseTransaction",value:function(){return this.transactions[0]}}]),t}(),b=function(){function t(e){(0,o.default)(this,t);var r=e.ecblock;this.headerHash=r.headerhash,this.fullHash=r.fullhash;var n=r.header;this.headerExpansionArea=n.headerexpansionarea,this.bodyHash=n.bodyhash,this.previousHeaderHash=n.prevheaderhash,this.previousFullHash=n.prevfullhash,this.directoryBlockHeight=n.dbheight,this.bodySize=n.bodysize,this.objectCount=n.objectcount,this.minuteIndexes=[0],this.commits=[];var i,a=s(r.body.entries);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(Object.prototype.hasOwnProperty.call(u,"number"))this.minuteIndexes.push(this.commits.length);else{if(Object.prototype.hasOwnProperty.call(u,"serverindexnumber"))continue;if(Object.prototype.hasOwnProperty.call(u,"numec"))continue;this.commits.push({version:u.version,millis:parseInt(u.millitime,16),entryHash:u.entryhash,credits:u.credits,ecPublicKey:l(u.ecpubkey),signature:u.sig})}}}catch(t){a.e(t)}finally{a.f()}Object.freeze(this)}return(0,i.default)(t,[{key:"getCommitsForMinute",value:function(t){if(t<1||t>=this.minuteIndexes.length)throw new RangeError("Minute out of range [1, ".concat(this.minuteIndexes.length-1,"]"));return this.commits.slice(this.minuteIndexes[t-1],this.minuteIndexes[t])}}]),t}();t.exports={DirectoryBlock:function t(e,r){(0,o.default)(this,t);var n=[];if(e.dblock){var i=e.dblock;this.keyMR=i.keymr,this.height=i.header.dbheight,this.previousBlockKeyMR=i.header.prevkeymr,this.timestamp=60*i.header.timestamp,n=i.dbentries,this.fullHash=i.dbhash,this.previousFullHash=i.header.prevfullhash,this.bodyKeyMR=i.header.bodymr}else this.keyMR=r,this.height=e.header.sequencenumber,this.previousBlockKeyMR=e.header.prevblockkeymr,this.timestamp=e.header.timestamp,n=e.entryblocklist;this.entryBlockRefs=[];var a,u=s(n);try{for(u.s();!(a=u.n()).done;){var c=a.value;switch(c.chainid){case d:this.adminBlockRef=c.keymr;break;case y:this.entryCreditBlockRef=c.keymr;break;case g:this.factoidBlockRef=c.keymr;break;default:this.entryBlockRefs.push({chainId:c.chainid,keyMR:c.keymr})}}}catch(t){u.e(t)}finally{u.f()}Object.freeze(this)},EntryBlock:function t(e,r){(0,o.default)(this,t),this.keyMR=r;var n=e.header;this.directoryBlockHeight=n.dbheight,this.timestamp=n.timestamp,this.previousBlockKeyMR=n.prevkeymr,this.chainId=n.chainid,this.sequenceNumber=n.blocksequencenumber,this.entryRefs=e.entrylist.map((function(t){return{entryHash:t.entryhash,timestamp:t.timestamp}})),Object.freeze(this)},AdminBlock:v,FactoidBlock:_,EntryCreditBlock:b}},5299:(t,e,r)=>{"use strict";var n=r(5318),i=n(r(7757)),o=n(r(8926)),s=n(r(4575)),a=n(r(3913)),u=r(780).sign,c=r(8092),l=c.addressToKey,h=c.isValidPrivateEcAddress,f=c.isValidPublicEcAddress,p=r(636).Entry,d=r(4420),y=d.sha256,g=d.sha256d,v=r(5694),m=v.CHAIN_CREATION_COST,_=v.CHAIN_REGEX,b=function(){function t(e){if((0,s.default)(this,t),e instanceof p){var r=R(e);this.firstEntry=p.builder(e).chainId(r).build(),this.id=r}else{if(!(e.firstEntry instanceof p))throw new Error("Argument of Chain constructor must be an instance of Entry or Chain.");var n=R(e.firstEntry);this.firstEntry=p.builder(e.firstEntry).chainId(n).build(),this.id=n}Object.freeze(this)}return(0,a.default)(t,[{key:"idHex",get:function(){return this.id.toString("hex")}},{key:"ecCost",value:function(){return m+this.firstEntry.ecCost()}},{key:"toObject",value:function(){return{firstEntry:this.firstEntry.toObject(),id:this.idHex}}}]),t}();function w(t,e,r){A(t);var n,i,o=k(t);if(h(e)){var s=l(e),a=u.keyPair.fromSeed(s);n=Buffer.from(a.publicKey),i=Buffer.from(u.detached(o,a.secretKey))}else{if(!f(e))throw new Error("".concat(e," is not a valid EC address"));if(!r)throw new Error("Signature of the commit missing.");if(console.warn("composeChainCommit with signature is deprecated. Use composeEntryCommitDelegateSig."),n=l(e),i=Buffer.from(r,"hex"),!u.detached.verify(o,i,n))throw new Error("Invalid signature manually provided for the chain commit. (first entry timestamp not fixed?)")}return Buffer.concat([o,n,i])}function E(t,e,r){return x.apply(this,arguments)}function x(){return(x=(0,o.default)(i.default.mark((function t(e,r,n){var o,s,a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(A(e),f(r)){t.next=3;break}throw new Error("".concat(r," is not a valid public EC address"));case 3:if("function"==typeof n){t.next=5;break}throw new Error("sign must be a function");case 5:return o=k(e),t.t0=Buffer,t.next=9,n(o,r);case 9:if(t.t1=t.sent,s=t.t0.from.call(t.t0,t.t1,"hex"),a=l(r),u.detached.verify(o,s,a)){t.next=14;break}throw new Error("Invalid signature manually returned by the signing function for the chain commit.");case 14:return t.abrupt("return",Buffer.concat([o,a,s]));case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(t){A(t);var e=t.firstEntry,r=e.hash(),n=Buffer.alloc(104);return n.writeInt8(0),n.writeIntBE(e.timestamp||Date.now(),1,6),g(t.id).copy(n,7),g(Buffer.concat([r,t.id])).copy(n,39),r.copy(n,71),n.writeInt8(t.ecCost(),103),n}function C(t){return A(t),t.firstEntry.marshalBinary()}function S(){return(S=(0,o.default)(i.default.mark((function t(e,r,n){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,E(e,r,n);case 2:return t.t0=t.sent,t.t1=C(e),t.abrupt("return",{commit:t.t0,reveal:t.t1});case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function A(t){if(!(t instanceof b))throw new Error("Argument must be an instance of Chain")}function R(t){var e=t.extIds.map(y),r=Buffer.concat(e);return y(r)}t.exports={Chain:b,computeChainTxId:function(t){return A(t),y(k(t))},computeChainId:R,composeChainCommit:w,composeChainCommitDelegateSig:E,composeChainReveal:C,composeChain:function(t,e,r){return{commit:w(t,e,r),reveal:C(t)}},composeChainDelegateSig:function(t,e,r){return S.apply(this,arguments)},composeChainLedger:k,validateChainInstance:A,isValidChainId:function(t){return"string"==typeof t&&t.match(_)}}},5694:t=>{"use strict";var e="000000000000000000000000000000000000000000000000000000000000000a",r="000000000000000000000000000000000000000000000000000000000000000c",n="000000000000000000000000000000000000000000000000000000000000000f",i=new Map([[1,"DIRECTORY_BLOCK_SIGNATURE"],[2,"REVEAL_MATRYOSHKA_HASH"],[3,"ADD_REPLACE_MATRYOSHKA_HASH"],[4,"INCREASE_SERVER_COUNT"],[5,"ADD_FEDERATED_SERVER"],[6,"ADD_AUDIT_SERVER"],[7,"REMOVE_FEDERATED_SERVER"],[8,"ADD_FEDERATED_SERVER_SIGNING_KEY"],[9,"ADD_FEDERATED_SERVER_BITCOIN_ANCHOR_KEY"],[10,"SERVER_FAULT_HANDOFF"],[11,"COINBASE_DESCRIPTOR"],[12,"COINBASE_DESCRIPTOR_CANCEL"],[13,"ADD_AUTHORITY_FACTOID_ADDRESS"],[14,"ADD_AUTHORITY_EFFICIENCY"]]);t.exports={MAX_TRANSACTION_SIZE:10240,MAX_ENTRY_PAYLOAD_SIZE:10240,MAX_ENTRY_SIZE:10275,CHAIN_CREATION_COST:10,NULL_HASH:"0000000000000000000000000000000000000000000000000000000000000000",ADMIN_BLOCKS_CHAIN_ID:e,ENTRY_CREDIT_BLOCKS_CHAIN_ID:r,FACTOID_BLOCKS_CHAIN_ID:n,RESERVED_CHAIN_IDS:new Set([e,r,n]),VALID_PREFIXES:new Set(["Fs","FA","EC","Es"]),PUBLIC_ADDRESS_VALID_PREFIXES:new Set(["FA","EC"]),PRIVATE_ADDRESS_VALID_PREFIXES:new Set(["Fs","Es"]),EC_ADDRESS_VALID_PREFIXES:new Set(["EC","Es"]),FCT_ADDRESS_VALID_PREFIXES:new Set(["FA","Fs"]),FACTOID_PUBLIC_PREFIX:Buffer.from("5fb1","hex"),FACTOID_PRIVATE_PREFIX:Buffer.from("6478","hex"),ENTRYCREDIT_PUBLIC_PREFIX:Buffer.f