parse 8.4.0 → 8.5.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parse.js +9 -2
- package/dist/parse.min.js +1 -1
- package/dist/parse.weapp.js +9 -2
- package/dist/parse.weapp.min.js +1 -1
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/ParseFile.js +8 -1
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/ParseFile.js +8 -1
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/ParseFile.js +4 -1
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/ParseFile.js +8 -1
- package/package.json +1 -1
- package/types/ParseFile.d.ts +15 -0
package/dist/parse.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function _mergeNamespaces(e,t){for(var r=0;r<t.length;r++){const i=t[r];if("string"!=typeof i&&!Array.isArray(i))for(const t in i)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(i,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>i[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function getDefaultExportFromCjs$1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var browser$e={exports:{}},process=browser$e.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports$1=browser$e.exports;const process$1=getDefaultExportFromCjs$1(browserExports$1),config={IS_NODE:void 0!==process$1&&!!process$1.versions&&!!process$1.versions.node&&!process$1.versions.electron,REQUEST_ATTEMPT_LIMIT:5,REQUEST_BATCH_SIZE:20,REQUEST_HEADERS:{},SERVER_URL:"https://api.parse.com/1",LIVEQUERY_SERVER_URL:null,ENCRYPTED_KEY:null,VERSION:"js8.4.0",APPLICATION_ID:null,JAVASCRIPT_KEY:null,MAINTENANCE_KEY:null,MASTER_KEY:null,USE_MASTER_KEY:!1,PERFORM_USER_REWRITE:!0,FORCE_REVOCABLE_SESSION:!1,ENCRYPTED_USER:!1,IDEMPOTENCY:!1,ALLOW_CUSTOM_OBJECT_ID:!1,PARSE_ERRORS:[],NODE_LOGGING:!1};function requireMethods(e,t,r){t.forEach((t=>{if("function"!=typeof r[t])throw new Error(`${e} must implement ${t}()`)}))}const CoreManager={get:function(e){if(Object.hasOwn(config,e))return config[e];throw new Error("Configuration key not found: "+e)},set:function(e,t){config[e]=t},setIfNeeded:function(e,t){return Object.hasOwn(config,e)||(config[e]=t),config[e]},setAnalyticsController(e){requireMethods("AnalyticsController",["track"],e),config.AnalyticsController=e},getAnalyticsController:()=>config.AnalyticsController,setCloudController(e){requireMethods("CloudController",["run","getJobsData","startJob"],e),config.CloudController=e},getCloudController:()=>config.CloudController,setConfigController(e){requireMethods("ConfigController",["current","get","save"],e),config.ConfigController=e},getConfigController:()=>config.ConfigController,setCryptoController(e){requireMethods("CryptoController",["encrypt","decrypt"],e),config.CryptoController=e},getCryptoController:()=>config.CryptoController,setEventEmitter(e){config.EventEmitter=e},getEventEmitter:()=>config.EventEmitter,setFileController(e){requireMethods("FileController",["saveFile","saveBase64"],e),config.FileController=e},setEventuallyQueue(e){requireMethods("EventuallyQueue",["poll","save","destroy"],e),config.EventuallyQueue=e},getEventuallyQueue:()=>config.EventuallyQueue,getFileController:()=>config.FileController,setInstallationController(e){requireMethods("InstallationController",["currentInstallationId","currentInstallation","updateInstallationOnDisk"],e),config.InstallationController=e},getInstallationController:()=>config.InstallationController,setLiveQuery(e){config.LiveQuery=e},getLiveQuery:()=>config.LiveQuery,setObjectController(e){requireMethods("ObjectController",["save","fetch","destroy"],e),config.ObjectController=e},getObjectController:()=>config.ObjectController,setObjectStateController(e){requireMethods("ObjectStateController",["getState","initializeState","removeState","getServerData","setServerData","getPendingOps","setPendingOp","pushPendingState","popPendingState","mergeFirstPendingState","getObjectCache","estimateAttribute","estimateAttributes","commitServerChanges","enqueueTask","clearAllState"],e),config.ObjectStateController=e},getObjectStateController:()=>config.ObjectStateController,setPushController(e){requireMethods("PushController",["send"],e),config.PushController=e},getPushController:()=>config.PushController,setQueryController(e){requireMethods("QueryController",["find","aggregate"],e),config.QueryController=e},getQueryController:()=>config.QueryController,setRESTController(e){requireMethods("RESTController",["request","ajax"],e),config.RESTController=e},getRESTController:()=>config.RESTController,setSchemaController(e){requireMethods("SchemaController",["get","create","update","delete","send","purge"],e),config.SchemaController=e},getSchemaController:()=>config.SchemaController,setSessionController(e){requireMethods("SessionController",["getSession"],e),config.SessionController=e},getSessionController:()=>config.SessionController,setStorageController(e){e.async?requireMethods("An async StorageController",["getItemAsync","setItemAsync","removeItemAsync","getAllKeysAsync"],e):requireMethods("A synchronous StorageController",["getItem","setItem","removeItem","getAllKeys"],e),config.StorageController=e},setLocalDatastoreController(e){requireMethods("LocalDatastoreController",["pinWithName","fromPinWithName","unPinWithName","getAllContents","clear"],e),config.LocalDatastoreController=e},getLocalDatastoreController:()=>config.LocalDatastoreController,setLocalDatastore(e){config.LocalDatastore=e},getLocalDatastore:()=>config.LocalDatastore,getStorageController:()=>config.StorageController,setAsyncStorage(e){config.AsyncStorage=e},getAsyncStorage:()=>config.AsyncStorage,setWebSocketController(e){config.WebSocketController=e},getWebSocketController:()=>config.WebSocketController,setUserController(e){requireMethods("UserController",["setCurrentUser","currentUser","currentUserAsync","signUp","logIn","become","logOut","me","requestPasswordReset","upgradeToRevocableSession","requestEmailVerification","verifyPassword","linkWith"],e),config.UserController=e},getUserController:()=>config.UserController,setLiveQueryController(e){requireMethods("LiveQueryController",["setDefaultLiveQueryClient","getDefaultLiveQueryClient","_clearCachedDefaultClient"],e),config.LiveQueryController=e},getLiveQueryController:()=>config.LiveQueryController,setHooksController(e){requireMethods("HooksController",["create","get","update","remove"],e),config.HooksController=e},getHooksController:()=>config.HooksController,setParseOp(e){config.ParseOp=e},getParseOp:()=>config.ParseOp,setParseObject(e){config.ParseObject=e},getParseObject:()=>config.ParseObject,setParseQuery(e){config.ParseQuery=e},getParseQuery:()=>config.ParseQuery,setParseRole(e){config.ParseRole=e},getParseRole:()=>config.ParseRole,setParseUser(e){config.ParseUser=e},getParseUser:()=>config.ParseUser};var buffer$1={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function byteLength(e){var t=getLens(e),r=t[0],i=t[1];return 3*(r+i)/4-i}function _byteLength(e,t,r){return 3*(t+r)/4-r}function toByteArray(e){var t,r,i=getLens(e),n=i[0],o=i[1],s=new Arr(_byteLength(e,n,o)),a=0,u=o>0?n-4:n;for(r=0;r<u;r+=4)t=revLookup[e.charCodeAt(r)]<<18|revLookup[e.charCodeAt(r+1)]<<12|revLookup[e.charCodeAt(r+2)]<<6|revLookup[e.charCodeAt(r+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===o&&(t=revLookup[e.charCodeAt(r)]<<2|revLookup[e.charCodeAt(r+1)]>>4,s[a++]=255&t),1===o&&(t=revLookup[e.charCodeAt(r)]<<10|revLookup[e.charCodeAt(r+1)]<<4|revLookup[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[63&e]}function encodeChunk(e,t,r){for(var i,n=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),n.push(tripletToBase64(i));return n.join("")}function fromByteArray(e){for(var t,r=e.length,i=r%3,n=[],o=16383,s=0,a=r-i;s<a;s+=o)n.push(encodeChunk(e,s,s+o>a?a:s+o));return 1===i?(t=e[r-1],n.push(lookup[t>>2]+lookup[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),n.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var ieee754={read:function(e,t,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,h=u>>1,f=-7,l=r?n-1:0,c=r?-1:1,d=e[t+l];for(l+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+e[t+l],l+=c,f-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=h}return(d?-1:1)*s*Math.pow(2,o-i)},write:function(e,t,r,i,n,o){var s,a,u,h=8*o-n-1,f=(1<<h)-1,l=f>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?c/u:c*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,n),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;e[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;e[r+d]=255&s,d+=p,s/=256,h-=8);e[r+d-p]|=128*m}};!function(e){const t=base64Js,r=ieee754,i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=h,e.SlowBuffer=function(e){+e!=e&&(e=0);return h.alloc(+e)},e.INSPECT_MAX_BYTES=50;const n=2147483647;e.kMaxLength=n;const{Uint8Array:o,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;function u(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new o(e);return Object.setPrototypeOf(t,h.prototype),t}function h(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return f(e,t,r)}function f(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!h.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let i=u(r);const n=i.write(e,t);n!==r&&(i=i.slice(0,n));return i}(e,t);if(s.isView(e))return function(e){if(Q(e,o)){const t=new o(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,s)||e&&Q(e.buffer,s))return p(e,t,r);if(void 0!==a&&(Q(e,a)||e&&Q(e.buffer,a)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return h.from(i,t,r);const n=function(e){if(h.isBuffer(e)){const t=0|m(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Z(e.length)?u(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return h.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),u(e<0?0:0|m(e))}function d(e){const t=e.length<0?0:0|m(e.length),r=u(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===r?new o(e):void 0===r?new o(e,t):new o(e,t,r),Object.setPrototypeOf(i,h.prototype),i}function m(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function g(e,t){if(h.isBuffer(e))return e.length;if(s.isView(e)||Q(e,s))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return i?-1:G(e).length;t=(""+t).toLowerCase(),n=!0}}function y(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return q(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function b(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=h.from(t,i)),h.isBuffer(t))return 0===t.length?-1:w(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof o.prototype.indexOf?n?o.prototype.indexOf.call(e,t,r):o.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,i,n){let o,s=1,a=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){let i=-1;for(o=r;o<a;o++)if(h(e,o)===h(t,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===u)return i*s}else-1!==i&&(o-=o-i),i=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let i=0;i<u;i++)if(h(e,o+i)!==h(t,i)){r=!1;break}if(r)return o}return-1}function _(e,t,r,i){r=Number(r)||0;const n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;const o=t.length;let s;for(i>o/2&&(i=o/2),s=0;s<i;++s){const i=parseInt(t.substr(2*s,2),16);if(Z(i))return s;e[r+s]=i}return s}function M(e,t,r,i){return V(G(t,e.length-r),e,r,i)}function S(e,t,r,i){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function E(e,t,r,i){return V(J(t),e,r,i)}function R(e,t,r,i){return V(function(e,t){let r,i,n;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function A(e,r,i){return 0===r&&i===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,i))}function q(e,t,r){r=Math.min(e.length,r);const i=[];let n=t;for(;n<r;){const t=e[n];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(n+s<=r){let r,i,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[n+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[n+1],i=e[n+2],128==(192&r)&&128==(192&i)&&(u=(15&t)<<12|(63&r)<<6|63&i,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[n+1],i=e[n+2],a=e[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}return function(e){const t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);let r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=C));return r}(i)}h.TYPED_ARRAY_SUPPORT=function(){try{const e=new o(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,o.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),h.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),h.poolSize=8192,h.from=function(e,t,r){return f(e,t,r)},Object.setPrototypeOf(h.prototype,o.prototype),Object.setPrototypeOf(h,o),h.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}(e,t,r)},h.allocUnsafe=function(e){return c(e)},h.allocUnsafeSlow=function(e){return c(e)},h.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==h.prototype},h.compare=function(e,t){if(Q(e,o)&&(e=h.from(e,e.offset,e.byteLength)),Q(t,o)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(e)||!h.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},h.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return h.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const i=h.allocUnsafe(t);let n=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,o))n+t.length>i.length?(h.isBuffer(t)||(t=h.from(t)),t.copy(i,n)):o.prototype.set.call(i,t,n);else{if(!h.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,n)}n+=t.length}return i},h.byteLength=g,h.prototype._isBuffer=!0,h.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},h.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},h.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},h.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?q(this,0,e):y.apply(this,arguments)},h.prototype.toLocaleString=h.prototype.toString,h.prototype.equals=function(e){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===h.compare(this,e)},h.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(h.prototype[i]=h.prototype.inspect),h.prototype.compare=function(e,t,r,i,n){if(Q(e,o)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0);const u=Math.min(s,a),f=this.slice(i,n),l=e.slice(t,r);for(let e=0;e<u;++e)if(f[e]!==l[e]){s=f[e],a=l[e];break}return s<a?-1:a<s?1:0},h.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},h.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},h.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},h.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return M(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function P(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function B(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function I(e,t,r){const i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i<r;++i)n+=Y[e[i]];return n}function O(e,t,r){const i=e.slice(t,r);let n="";for(let e=0;e<i.length-1;e+=2)n+=String.fromCharCode(i[e]+256*i[e+1]);return n}function k(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,i,n,o){if(!h.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function N(e,t,r,i,n){z(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function x(e,t,r,i,n){z(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function j(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $(e,t,i,n,o){return t=+t,i>>>=0,o||j(e,0,i,4),r.write(e,t,i,n,23,4),i+4}function D(e,t,i,n,o){return t=+t,i>>>=0,o||j(e,0,i,8),r.write(e,t,i,n,52,8),i+8}h.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,h.prototype),i},h.prototype.readUintLE=h.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let i=this[e],n=1,o=0;for(;++o<t&&(n*=256);)i+=this[e+o]*n;return i},h.prototype.readUintBE=h.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},h.prototype.readUint8=h.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readBigUInt64LE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),h.prototype.readBigUInt64BE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),h.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let i=this[e],n=1,o=0;for(;++o<t&&(n*=256);)i+=this[e+o]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},h.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let i=t,n=1,o=this[e+--i];for(;i>0&&(n*=256);)o+=this[e+--i]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*t)),o},h.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readBigInt64LE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),h.prototype.readBigInt64BE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),h.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),r.read(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),r.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),r.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),r.read(this,e,!1,52,8)},h.prototype.writeUintLE=h.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=1,o=0;for(this[t]=255&e;++o<r&&(n*=256);)this[t+o]=e/n&255;return t+r},h.prototype.writeUintBE=h.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=r-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+r},h.prototype.writeUint8=h.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeBigUInt64LE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeBigUInt64BE=X((function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}let n=0,o=1,s=0;for(this[t]=255&e;++n<r&&(o*=256);)e<0&&0===s&&0!==this[t+n-1]&&(s=1),this[t+n]=(e/o|0)-s&255;return t+r},h.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}let n=r-1,o=1,s=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/o|0)-s&255;return t+r},h.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},h.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},h.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeBigInt64LE=X((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeBigInt64BE=X((function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeFloatLE=function(e,t,r){return $(this,e,t,!0,r)},h.prototype.writeFloatBE=function(e,t,r){return $(this,e,t,!1,r)},h.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},h.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},h.prototype.copy=function(e,t,r,i){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);const n=i-r;return this===e&&"function"==typeof o.prototype.copyWithin?this.copyWithin(t,r,i):o.prototype.set.call(e,this.subarray(r,i),t),n},h.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!h.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{const o=h.isBuffer(e)?e:h.from(e,i),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=o[n%s]}return this};const U={};function L(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function F(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function z(e,t,r,i,n,o){if(e>r||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||W(t,e.length-(r+1))}(i,n,o)}function K(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){if(Math.floor(e)!==e)throw K(e,r),new U.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}L("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),L("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),L("ERR_OUT_OF_RANGE",(function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=F(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=F(n)),n+="n"),i+=` It must be ${t}. Received ${n}`,i}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const i=e.length;let n=null;const o=[];for(let s=0;s<i;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,i){let n;for(n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function X(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}}(buffer$1);const Buffer=buffer$1.Buffer;var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var events$1={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events$1.exports;hasRequiredEvents=1;var e,t="object"==typeof Reflect?Reflect:null,r=t&&"function"==typeof t.apply?t.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function n(){n.init.call(this)}events$1.exports=n,events$1.exports.once=function(e,t){return new Promise((function(r,i){function n(r){e.removeListener(t,o),i(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}p(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&p(e,"error",t,r)}(e,n,{once:!0})}))},n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?n.defaultMaxListeners:e._maxListeners}function u(e,t,r,i){var n,o,u,h;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),u=o[t]),void 0===u)u=o[t]=r,++e._eventsCount;else if("function"==typeof u?u=o[t]=i?[r,u]:[u,r]:i?u.unshift(r):u.push(r),(n=a(e))>0&&u.length>n&&!u.warned){u.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=u.length,h=f,console&&console.warn&&console.warn(h)}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 f(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=h.bind(i);return n.listener=r,i.wrapFn=n,n}function l(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):d(n,n.length)}function c(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function p(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(o){i.once&&e.removeEventListener(t,n),r(o)}))}}return Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),n.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},n.prototype.getMaxListeners=function(){return a(this)},n.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var h=u.length,f=d(u,h);for(i=0;i<h;++i)r(f[i],this,t)}return!0},n.prototype.addListener=function(e,t){return u(this,e,t,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(e,t){return u(this,e,t,!0)},n.prototype.once=function(e,t){return s(t),this.on(e,f(this,e,t)),this},n.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,f(this,e,t)),this},n.prototype.removeListener=function(e,t){var r,i,n,o,a;if(s(t),void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,a||t)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,o=Object.keys(r);for(i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},n.prototype.listeners=function(e){return l(this,e,!0)},n.prototype.rawListeners=function(e){return l(this,e,!1)},n.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},n.prototype.listenerCount=c,n.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},events$1.exports}var inherits_browser={exports:{}},hasRequiredInherits_browser,streamBrowser$1,hasRequiredStreamBrowser$1;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,"function"==typeof Object.create?inherits_browser.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),inherits_browser.exports}function requireStreamBrowser$1(){return hasRequiredStreamBrowser$1?streamBrowser$1:(hasRequiredStreamBrowser$1=1,streamBrowser$1=requireEvents().EventEmitter)}var dist={},hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});for(var t={},r={byteLength:function(e){var t=u(e),r=t[0],i=t[1];return 3*(r+i)/4-i},toByteArray:function(e){var t,r,i=u(e),s=i[0],a=i[1],h=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],h[f++]=t>>16&255,h[f++]=t>>8&255,h[f++]=255&t;2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,h[f++]=255&t);1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,h[f++]=t>>8&255,h[f++]=255&t);return h},fromByteArray:function(e){for(var t,r=e.length,n=r%3,o=[],s=16383,a=0,u=r-n;a<u;a+=s)o.push(h(e,a,a+s>u?u:a+s));1===n?(t=e[r-1],o.push(i[t>>2]+i[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],o.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return o.join("")}},i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)i[a]=s[a],n[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function h(e,t,r){for(var n,o,s=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(i[(o=n)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63;var f={read:function(e,t,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,h=u>>1,f=-7,l=r?n-1:0,c=r?-1:1,d=e[t+l];for(l+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+e[t+l],l+=c,f-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=h}return(d?-1:1)*s*Math.pow(2,o-i)},write:function(e,t,r,i,n,o){var s,a,u,h=8*o-n-1,f=(1<<h)-1,l=f>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?c/u:c*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,n),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;e[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;e[r+d]=255&s,d+=p,s/=256,h-=8);e[r+d-p]|=128*m}};!function(e){const t=r,i=f,n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:s,ArrayBuffer:a,SharedArrayBuffer:u}=globalThis;function h(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new s(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return p(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|b(e,t);let i=h(r);const n=i.write(e,t);n!==r&&(i=i.slice(0,n));return i}(e,t);if(a.isView(e))return function(e){if(Y(e,s)){const t=new s(e);return g(t.buffer,t.byteOffset,t.byteLength)}return m(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,a)||e&&Y(e.buffer,a))return g(e,t,r);if(void 0!==u&&(Y(e,u)||e&&Y(e.buffer,u)))return g(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return l.from(i,t,r);const n=function(e){if(l.isBuffer(e)){const t=0|y(e.length),r=h(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||X(e.length)?h(0):m(e);if("Buffer"===e.type&&Array.isArray(e.data))return m(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function p(e){return d(e),h(e<0?0:0|y(e))}function m(e){const t=e.length<0?0:0|y(e.length),r=h(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function g(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===r?new s(e):void 0===r?new s(e,t):new s(e,t,r),Object.setPrototypeOf(i,l.prototype),i}function y(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function b(e,t){if(l.isBuffer(e))return e.length;if(a.isView(e)||Y(e,a))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(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(n)return i?-1:V(e).length;t=(""+t).toLowerCase(),n=!0}}function v(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function w(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function _(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:M(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof s.prototype.indexOf?n?s.prototype.indexOf.call(e,t,r):s.prototype.lastIndexOf.call(e,t,r):M(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function M(e,t,r,i,n){let o,s=1,a=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){let i=-1;for(o=r;o<a;o++)if(h(e,o)===h(t,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===u)return i*s}else-1!==i&&(o-=o-i),i=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let i=0;i<u;i++)if(h(e,o+i)!==h(t,i)){r=!1;break}if(r)return o}return-1}function S(e,t,r,i){r=Number(r)||0;const n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;const o=t.length;let s;for(i>o/2&&(i=o/2),s=0;s<i;++s){const i=parseInt(t.substr(2*s,2),16);if(X(i))return s;e[r+s]=i}return s}function E(e,t,r,i){return Z(V(t,e.length-r),e,r,i)}function R(e,t,r,i){return Z(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function A(e,t,r,i){return Z(Q(t),e,r,i)}function q(e,t,r,i){return Z(function(e,t){let r,i,n;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function C(e,r,i){return 0===r&&i===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,i))}function P(e,t,r){r=Math.min(e.length,r);const i=[];let n=t;for(;n<r;){const t=e[n];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(n+s<=r){let r,i,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[n+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[n+1],i=e[n+2],128==(192&r)&&128==(192&i)&&(u=(15&t)<<12|(63&r)<<6|63&i,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[n+1],i=e[n+2],a=e[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}return function(e){const t=e.length;if(t<=B)return String.fromCharCode.apply(String,e);let r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=B));return r}(i)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new s(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,s.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,s.prototype),Object.setPrototypeOf(l,s),l.alloc=function(e,t,r){return function(e,t,r){return d(e),e<=0?h(e):void 0!==t?"string"==typeof r?h(e).fill(t,r):h(e).fill(t):h(e)}(e,t,r)},l.allocUnsafe=function(e){return p(e)},l.allocUnsafeSlow=function(e){return p(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Y(e,s)&&(e=l.from(e,e.offset,e.byteLength)),Y(t,s)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const i=l.allocUnsafe(t);let n=0;for(r=0;r<e.length;++r){let t=e[r];if(Y(t,s))n+t.length>i.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(i,n)):s.prototype.set.call(i,t,n);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,n)}n+=t.length}return i},l.byteLength=b,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)w(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?P(this,0,e):v.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(l.prototype[n]=l.prototype.inspect),l.prototype.compare=function(e,t,r,i,n){if(Y(e,s)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0);const u=Math.min(o,a),h=this.slice(i,n),f=e.slice(t,r);for(let e=0;e<u;++e)if(h[e]!==f[e]){o=h[e],a=f[e];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return _(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return _(this,e,t,r,!1)},l.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return R(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const B=4096;function I(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function O(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function k(e,t,r){const i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i<r;++i)n+=ee[e[i]];return n}function T(e,t,r){const i=e.slice(t,r);let n="";for(let e=0;e<i.length-1;e+=2)n+=String.fromCharCode(i[e]+256*i[e+1]);return n}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,i,n,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function j(e,t,r,i,n){W(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function $(e,t,r,i,n){W(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function D(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,o){return t=+t,r>>>=0,o||D(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,o){return t=+t,r>>>=0,o||D(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,l.prototype),i},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e],n=1,o=0;for(;++o<t&&(n*=256);)i+=this[e+o]*n;return i},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=te((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),l.prototype.readBigUInt64BE=te((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e],n=1,o=0;for(;++o<t&&(n*=256);)i+=this[e+o]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=t,n=1,o=this[e+--i];for(;i>0&&(n*=256);)o+=this[e+--i]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=te((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=te((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=1,o=0;for(this[t]=255&e;++o<r&&(n*=256);)this[t+o]=e/n&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=r-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=te((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=te((function(e,t=0){return $(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}let n=0,o=1,s=0;for(this[t]=255&e;++n<r&&(o*=256);)e<0&&0===s&&0!==this[t+n-1]&&(s=1),this[t+n]=(e/o|0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}let n=r-1,o=1,s=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/o|0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=te((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=te((function(e,t=0){return $(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,i){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);const n=i-r;return this===e&&"function"==typeof s.prototype.copyWithin?this.copyWithin(t,r,i):s.prototype.set.call(e,this.subarray(r,i),t),n},l.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{const o=l.isBuffer(e)?e:l.from(e,i),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=o[n%s]}return this};const F={};function z(e,t,r){F[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function K(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function W(e,t,r,i,n,o){if(e>r||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`,new F.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(i,n,o)}function H(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new F.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),z("ERR_OUT_OF_RANGE",(function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=K(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=K(n)),n+="n"),i+=` It must be ${t}. Received ${n}`,i}),RangeError);const J=/[^+/0-9A-Za-z-_]/g;function V(e,t){let r;t=t||1/0;const i=e.length;let n=null;const o=[];for(let s=0;s<i;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Q(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,t,r,i){let n;for(n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const ee=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function te(e){return"undefined"==typeof BigInt?re:e}function re(){throw new Error("BigInt not supported")}}(t);const l=t.Buffer;e.Blob=t.Blob,e.BlobOptions=t.BlobOptions,e.Buffer=t.Buffer,e.File=t.File,e.FileOptions=t.FileOptions,e.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,e.SlowBuffer=t.SlowBuffer,e.TranscodeEncoding=t.TranscodeEncoding,e.atob=t.atob,e.btoa=t.btoa,e.constants=t.constants,e.default=l,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode}(dist)),dist}var util$1={},types={},shams$1,hasRequiredShams$1,shams,hasRequiredShams,esObjectAtoms,hasRequiredEsObjectAtoms,esErrors,hasRequiredEsErrors,_eval,hasRequired_eval,range,hasRequiredRange,ref,hasRequiredRef,syntax,hasRequiredSyntax,type,hasRequiredType,uri,hasRequiredUri,abs,hasRequiredAbs,floor,hasRequiredFloor,max,hasRequiredMax,min,hasRequiredMin,pow,hasRequiredPow,round,hasRequiredRound,_isNaN,hasRequired_isNaN,sign$1,hasRequiredSign$1,gOPD,hasRequiredGOPD,gopd,hasRequiredGopd,esDefineProperty,hasRequiredEsDefineProperty,hasSymbols,hasRequiredHasSymbols,Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf,Object_getPrototypeOf,hasRequiredObject_getPrototypeOf,implementation,hasRequiredImplementation,functionBind,hasRequiredFunctionBind,functionCall,hasRequiredFunctionCall,functionApply,hasRequiredFunctionApply,reflectApply,hasRequiredReflectApply,actualApply,hasRequiredActualApply,callBindApplyHelpers,hasRequiredCallBindApplyHelpers,get$1,hasRequiredGet,getProto,hasRequiredGetProto,hasown,hasRequiredHasown,getIntrinsic,hasRequiredGetIntrinsic,callBound,hasRequiredCallBound,isArguments,hasRequiredIsArguments,isRegex,hasRequiredIsRegex,safeRegexTest,hasRequiredSafeRegexTest,isGeneratorFunction,hasRequiredIsGeneratorFunction,isCallable,hasRequiredIsCallable,forEach,hasRequiredForEach,possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames,availableTypedArrays,hasRequiredAvailableTypedArrays;function requireShams$1(){return hasRequiredShams$1?shams$1:(hasRequiredShams$1=1,shams$1=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0})}function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var e=requireShams$1();return shams=function(){return e()&&!!Symbol.toStringTag}}function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms?esObjectAtoms:(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object)}function requireEsErrors(){return hasRequiredEsErrors?esErrors:(hasRequiredEsErrors=1,esErrors=Error)}function require_eval(){return hasRequired_eval?_eval:(hasRequired_eval=1,_eval=EvalError)}function requireRange(){return hasRequiredRange?range:(hasRequiredRange=1,range=RangeError)}function requireRef(){return hasRequiredRef?ref:(hasRequiredRef=1,ref=ReferenceError)}function requireSyntax(){return hasRequiredSyntax?syntax:(hasRequiredSyntax=1,syntax=SyntaxError)}function requireType(){return hasRequiredType?type:(hasRequiredType=1,type=TypeError)}function requireUri(){return hasRequiredUri?uri:(hasRequiredUri=1,uri=URIError)}function requireAbs(){return hasRequiredAbs?abs:(hasRequiredAbs=1,abs=Math.abs)}function requireFloor(){return hasRequiredFloor?floor:(hasRequiredFloor=1,floor=Math.floor)}function requireMax(){return hasRequiredMax?max:(hasRequiredMax=1,max=Math.max)}function requireMin(){return hasRequiredMin?min:(hasRequiredMin=1,min=Math.min)}function requirePow(){return hasRequiredPow?pow:(hasRequiredPow=1,pow=Math.pow)}function requireRound(){return hasRequiredRound?round:(hasRequiredRound=1,round=Math.round)}function require_isNaN(){return hasRequired_isNaN?_isNaN:(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(e){return e!=e})}function requireSign$1(){if(hasRequiredSign$1)return sign$1;hasRequiredSign$1=1;var e=require_isNaN();return sign$1=function(t){return e(t)||0===t?t:t<0?-1:1}}function requireGOPD(){return hasRequiredGOPD?gOPD:(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor)}function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var e=requireGOPD();if(e)try{e([],"length")}catch(t){e=null}return gopd=e}function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}return esDefineProperty=e}function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var e="undefined"!=typeof Symbol&&Symbol,t=requireShams$1();return hasSymbols=function(){return"function"==typeof e&&("function"==typeof Symbol&&("symbol"==typeof e("foo")&&("symbol"==typeof Symbol("bar")&&t())))}}function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf?Reflect_getPrototypeOf:(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null)}function requireObject_getPrototypeOf(){return hasRequiredObject_getPrototypeOf?Object_getPrototypeOf:(hasRequiredObject_getPrototypeOf=1,Object_getPrototypeOf=requireEsObjectAtoms().getPrototypeOf||null)}function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var e=Object.prototype.toString,t=Math.max,r=function(e,t){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var n=0;n<t.length;n+=1)r[n+e.length]=t[n];return r};return implementation=function(i){var n=this;if("function"!=typeof n||"[object Function]"!==e.apply(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var o,s=function(e,t){for(var r=[],i=t,n=0;i<e.length;i+=1,n+=1)r[n]=e[i];return r}(arguments,1),a=t(0,n.length-s.length),u=[],h=0;h<a;h++)u[h]="$"+h;if(o=Function("binder","return function ("+function(e,t){for(var r="",i=0;i<e.length;i+=1)r+=e[i],i+1<e.length&&(r+=t);return r}(u,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof o){var e=n.apply(this,r(s,arguments));return Object(e)===e?e:this}return n.apply(i,r(s,arguments))})),n.prototype){var f=function(){};f.prototype=n.prototype,o.prototype=new f,f.prototype=null}return o},implementation}function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var e=requireImplementation();return functionBind=Function.prototype.bind||e}function requireFunctionCall(){return hasRequiredFunctionCall?functionCall:(hasRequiredFunctionCall=1,functionCall=Function.prototype.call)}function requireFunctionApply(){return hasRequiredFunctionApply?functionApply:(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply)}function requireReflectApply(){return hasRequiredReflectApply?reflectApply:(hasRequiredReflectApply=1,reflectApply="undefined"!=typeof Reflect&&Reflect&&Reflect.apply)}function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireFunctionCall(),i=requireReflectApply();return actualApply=i||e.call(r,t)}function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var e=requireFunctionBind(),t=requireType(),r=requireFunctionCall(),i=requireActualApply();return callBindApplyHelpers=function(n){if(n.length<1||"function"!=typeof n[0])throw new t("a function is required");return i(e,r,n)}}function requireGet(){if(hasRequiredGet)return get$1;hasRequiredGet=1;var e,t=requireCallBindApplyHelpers(),r=requireGopd();try{e=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var i=!!e&&r&&r(Object.prototype,"__proto__"),n=Object,o=n.getPrototypeOf;return get$1=i&&"function"==typeof i.get?t([i.get]):"function"==typeof o&&function(e){return o(null==e?e:n(e))}}function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var e=requireReflect_getPrototypeOf(),t=requireObject_getPrototypeOf(),r=requireGet();return getProto=e?function(t){return e(t)}:t?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return t(e)}:r?function(e){return r(e)}:null}function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=requireFunctionBind();return hasown=r.call(e,t)}function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;var e;hasRequiredGetIntrinsic=1;var t=requireEsObjectAtoms(),r=requireEsErrors(),i=require_eval(),n=requireRange(),o=requireRef(),s=requireSyntax(),a=requireType(),u=requireUri(),h=requireAbs(),f=requireFloor(),l=requireMax(),c=requireMin(),d=requirePow(),p=requireRound(),m=requireSign$1(),g=Function,y=function(e){try{return g('"use strict"; return ('+e+").constructor;")()}catch(e){}},b=requireGopd(),v=requireEsDefineProperty(),w=function(){throw new a},_=b?function(){try{return w}catch(e){try{return b(arguments,"callee").get}catch(e){return w}}}():w,M=requireHasSymbols()(),S=requireGetProto(),E=requireObject_getPrototypeOf(),R=requireReflect_getPrototypeOf(),A=requireFunctionApply(),q=requireFunctionCall(),C={},P="undefined"!=typeof Uint8Array&&S?S(Uint8Array):e,B={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&S?S([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":"undefined"==typeof Atomics?e:Atomics,"%BigInt%":"undefined"==typeof BigInt?e:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?e:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":i,"%Float16Array%":"undefined"==typeof Float16Array?e:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?e:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?e:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?e:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":C,"%Int8Array%":"undefined"==typeof Int8Array?e:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?e:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&S?S(S([][Symbol.iterator]())):e,"%JSON%":"object"==typeof JSON?JSON:e,"%Map%":"undefined"==typeof Map?e:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&M&&S?S((new Map)[Symbol.iterator]()):e,"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?e:Promise,"%Proxy%":"undefined"==typeof Proxy?e:Proxy,"%RangeError%":n,"%ReferenceError%":o,"%Reflect%":"undefined"==typeof Reflect?e:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?e:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&M&&S?S((new Set)[Symbol.iterator]()):e,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&S?S(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":_,"%TypedArray%":P,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?e:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?e:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?e:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?e:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?e:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?e:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?e:WeakSet,"%Function.prototype.call%":q,"%Function.prototype.apply%":A,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":E,"%Math.abs%":h,"%Math.floor%":f,"%Math.max%":l,"%Math.min%":c,"%Math.pow%":d,"%Math.round%":p,"%Math.sign%":m,"%Reflect.getPrototypeOf%":R};if(S)try{null.error}catch(e){var I=S(S(e));B["%Error.prototype%"]=I}var O=function e(t){var r;if("%AsyncFunction%"===t)r=y("async function () {}");else if("%GeneratorFunction%"===t)r=y("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=y("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&S&&(r=S(n.prototype))}return B[t]=r,r},k={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},T=requireFunctionBind(),N=requireHasown(),x=T.call(q,Array.prototype.concat),j=T.call(A,Array.prototype.splice),$=T.call(q,String.prototype.replace),D=T.call(q,String.prototype.slice),U=T.call(q,RegExp.prototype.exec),L=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F=/\\(\\)?/g,z=function(e,t){var r,i=e;if(N(k,i)&&(i="%"+(r=k[i])[0]+"%"),N(B,i)){var n=B[i];if(n===C&&(n=O(i)),void 0===n&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new s("intrinsic "+e+" does not exist!")};return getIntrinsic=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,e))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=D(e,0,1),r=D(e,-1);if("%"===t&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new s("invalid intrinsic syntax, expected opening `%`");var i=[];return $(e,L,(function(e,t,r,n){i[i.length]=r?$(n,F,"$1"):t||e})),i}(e),i=r.length>0?r[0]:"",n=z("%"+i+"%",t),o=n.name,u=n.value,h=!1,f=n.alias;f&&(i=f[0],j(r,x([0,1],f)));for(var l=1,c=!0;l<r.length;l+=1){var d=r[l],p=D(d,0,1),m=D(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===m||"'"===m||"`"===m)&&p!==m)throw new s("property names with quotes must have matching quotes");if("constructor"!==d&&c||(h=!0),N(B,o="%"+(i+="."+d)+"%"))u=B[o];else if(null!=u){if(!(d in u)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(b&&l+1>=r.length){var g=b(u,d);u=(c=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:u[d]}else c=N(u,d),u=u[d];c&&!h&&(B[o]=u)}}return u},getIntrinsic}function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var e=requireGetIntrinsic(),t=requireCallBindApplyHelpers(),r=t([e("%String.prototype.indexOf%")]);return callBound=function(i,n){var o=e(i,!!n);return"function"==typeof o&&r(i,".prototype.")>-1?t([o]):o}}function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var e=requireShams()(),t=requireCallBound()("Object.prototype.toString"),r=function(r){return!(e&&r&&"object"==typeof r&&Symbol.toStringTag in r)&&"[object Arguments]"===t(r)},i=function(e){return!!r(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==t(e)&&"callee"in e&&"[object Function]"===t(e.callee)},n=function(){return r(arguments)}();return r.isLegacyArguments=i,isArguments=n?r:i}function requireIsRegex(){if(hasRequiredIsRegex)return isRegex;hasRequiredIsRegex=1;var e,t=requireCallBound(),r=requireShams()(),i=requireHasown(),n=requireGopd();if(r){var o=t("RegExp.prototype.exec"),s={},a=function(){throw s},u={toString:a,valueOf:a};"symbol"==typeof Symbol.toPrimitive&&(u[Symbol.toPrimitive]=a),e=function(e){if(!e||"object"!=typeof e)return!1;var t=n(e,"lastIndex");if(!(t&&i(t,"value")))return!1;try{o(e,u)}catch(e){return e===s}}}else{var h=t("Object.prototype.toString");e=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===h(e)}}return isRegex=e}function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var e=requireCallBound(),t=requireIsRegex(),r=e("RegExp.prototype.exec"),i=requireType();return safeRegexTest=function(e){if(!t(e))throw new i("`regex` must be a RegExp");return function(t){return null!==r(e,t)}}}function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var e,t=requireCallBound(),r=requireSafeRegexTest()(/^\s*(?:function)?\*/),i=requireShams()(),n=requireGetProto(),o=t("Object.prototype.toString"),s=t("Function.prototype.toString");return isGeneratorFunction=function(t){if("function"!=typeof t)return!1;if(r(s(t)))return!0;if(!i)return"[object GeneratorFunction]"===o(t);if(!n)return!1;if(void 0===e){var a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(e){}}();e=!!a&&n(a)}return n(t)===e}}function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var e,t,r=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw t}}),t={},i((function(){throw 42}),null,e)}catch(e){e!==t&&(i=null)}else i=null;var n=/^\s*class\b/,o=function(e){try{var t=r.call(e);return n.test(t)}catch(e){return!1}},s=function(e){try{return!o(e)&&(r.call(e),!0)}catch(e){return!1}},a=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,h=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var l=document.all;a.call(l)===a.call(document.all)&&(f=function(e){if((h||!e)&&(void 0===e||"object"==typeof e))try{var t=a.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}return isCallable=i?function(r){if(f(r))return!0;if(!r)return!1;if("function"!=typeof r&&"object"!=typeof r)return!1;try{i(r,null,e)}catch(e){if(e!==t)return!1}return!o(r)&&s(r)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(u)return s(e);if(o(e))return!1;var t=a.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}}function requireForEach(){if(hasRequiredForEach)return forEach;hasRequiredForEach=1;var e=requireIsCallable(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty;return forEach=function(i,n,o){if(!e(n))throw new TypeError("iterator must be a function");var s,a;arguments.length>=3&&(s=o),a=i,"[object Array]"===t.call(a)?function(e,t,i){for(var n=0,o=e.length;n<o;n++)r.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))}(i,n,s):"string"==typeof i?function(e,t,r){for(var i=0,n=e.length;i<n;i++)null==r?t(e.charAt(i),i,e):t.call(r,e.charAt(i),i,e)}(i,n,s):function(e,t,i){for(var n in e)r.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))}(i,n,s)},forEach}function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames?possibleTypedArrayNames:(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"])}function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var e=requirePossibleTypedArrayNames(),t="undefined"==typeof globalThis?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var r=[],i=0;i<e.length;i++)"function"==typeof t[e[i]]&&(r[r.length]=e[i]);return r}}var callBind={exports:{}},defineDataProperty,hasRequiredDefineDataProperty,hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors,setFunctionLength,hasRequiredSetFunctionLength,applyBind,hasRequiredApplyBind,hasRequiredCallBind,whichTypedArray,hasRequiredWhichTypedArray,isTypedArray,hasRequiredIsTypedArray,hasRequiredTypes,isBufferBrowser,hasRequiredIsBufferBrowser,hasRequiredUtil$1,buffer_list,hasRequiredBuffer_list,destroy_1$1,hasRequiredDestroy$1;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var e=requireEsDefineProperty(),t=requireSyntax(),r=requireType(),i=requireGopd();return defineDataProperty=function(n,o,s){if(!n||"object"!=typeof n&&"function"!=typeof n)throw new r("`obj` must be an object or a function`");if("string"!=typeof o&&"symbol"!=typeof o)throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new r("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,f=arguments.length>6&&arguments[6],l=!!i&&i(n,o);if(e)e(n,o,{configurable:null===h&&l?l.configurable:!h,enumerable:null===a&&l?l.enumerable:!a,value:s,writable:null===u&&l?l.writable:!u});else{if(!f&&(a||u||h))throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");n[o]=s}},defineDataProperty}function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var e=requireEsDefineProperty(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return 1!==e([],"length",{value:1}).length}catch(e){return!0}},hasPropertyDescriptors_1=t}function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var e=requireGetIntrinsic(),t=requireDefineDataProperty(),r=requireHasPropertyDescriptors()(),i=requireGopd(),n=requireType(),o=e("%Math.floor%");return setFunctionLength=function(e,s){if("function"!=typeof e)throw new n("`fn` is not a function");if("number"!=typeof s||s<0||s>4294967295||o(s)!==s)throw new n("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],u=!0,h=!0;if("length"in e&&i){var f=i(e,"length");f&&!f.configurable&&(u=!1),f&&!f.writable&&(h=!1)}return(u||h||!a)&&(r?t(e,"length",s,!0,!0):t(e,"length",s)),e},setFunctionLength}function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireActualApply();return applyBind=function(){return r(e,t,arguments)},applyBind}function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,e=callBind,t=requireSetFunctionLength(),r=requireEsDefineProperty(),i=requireCallBindApplyHelpers(),n=requireApplyBind(),e.exports=function(e){var r=i(arguments),n=e.length-(arguments.length-1);return t(r,1+(n>0?n:0),!0)},r?r(e.exports,"apply",{value:n}):e.exports.apply=n),callBind.exports;var e,t,r,i,n}function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var e=requireForEach(),t=requireAvailableTypedArrays(),r=requireCallBind(),i=requireCallBound(),n=requireGopd(),o=requireGetProto(),s=i("Object.prototype.toString"),a=requireShams()(),u="undefined"==typeof globalThis?commonjsGlobal:globalThis,h=t(),f=i("String.prototype.slice"),l=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},c={__proto__:null};e(h,a&&n&&o?function(e){var t=new u[e];if(Symbol.toStringTag in t&&o){var i=o(t),s=n(i,Symbol.toStringTag);if(!s&&i){var a=o(i);s=n(a,Symbol.toStringTag)}c["$"+e]=r(s.get)}}:function(e){var t=new u[e],i=t.slice||t.set;i&&(c["$"+e]=r(i))});return whichTypedArray=function(t){if(!t||"object"!=typeof t)return!1;if(!a){var r=f(s(t),8,-1);return l(h,r)>-1?r:"Object"===r&&function(t){var r=!1;return e(c,(function(e,i){if(!r)try{e(t),r=f(i,1)}catch(e){}})),r}(t)}return n?function(t){var r=!1;return e(c,(function(e,i){if(!r)try{"$"+e(t)===i&&(r=f(i,1))}catch(e){}})),r}(t):null}}function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray;hasRequiredIsTypedArray=1;var e=requireWhichTypedArray();return isTypedArray=function(t){return!!e(t)}}function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(e){var t=requireIsArguments(),r=requireIsGeneratorFunction(),i=requireWhichTypedArray(),n=requireIsTypedArray();function o(e){return e.call.bind(e)}var s="undefined"!=typeof BigInt,a="undefined"!=typeof Symbol,u=o(Object.prototype.toString),h=o(Number.prototype.valueOf),f=o(String.prototype.valueOf),l=o(Boolean.prototype.valueOf);if(s)var c=o(BigInt.prototype.valueOf);if(a)var d=o(Symbol.prototype.valueOf);function p(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===u(e)}function g(e){return"[object Set]"===u(e)}function y(e){return"[object WeakMap]"===u(e)}function b(e){return"[object WeakSet]"===u(e)}function v(e){return"[object ArrayBuffer]"===u(e)}function w(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===u(e)}function M(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=n,e.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},e.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):n(e)||M(e)},e.isUint8Array=function(e){return"Uint8Array"===i(e)},e.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},e.isUint16Array=function(e){return"Uint16Array"===i(e)},e.isUint32Array=function(e){return"Uint32Array"===i(e)},e.isInt8Array=function(e){return"Int8Array"===i(e)},e.isInt16Array=function(e){return"Int16Array"===i(e)},e.isInt32Array=function(e){return"Int32Array"===i(e)},e.isFloat32Array=function(e){return"Float32Array"===i(e)},e.isFloat64Array=function(e){return"Float64Array"===i(e)},e.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},e.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),e.isSet=function(e){return"undefined"!=typeof Set&&(g.working?g(e):e instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),e.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},b.working="undefined"!=typeof WeakSet&&b(new WeakSet),e.isWeakSet=function(e){return b(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),e.isArrayBuffer=w,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=M;var S="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function E(e){return"[object SharedArrayBuffer]"===u(e)}function R(e){return void 0!==S&&(void 0===E.working&&(E.working=E(new S)),E.working?E(e):e instanceof S)}function A(e){return p(e,h)}function q(e){return p(e,f)}function C(e){return p(e,l)}function P(e){return s&&p(e,c)}function B(e){return a&&p(e,d)}e.isSharedArrayBuffer=R,e.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},e.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},e.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},e.isGeneratorObject=function(e){return"[object Generator]"===u(e)},e.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},e.isNumberObject=A,e.isStringObject=q,e.isBooleanObject=C,e.isBigIntObject=P,e.isSymbolObject=B,e.isBoxedPrimitive=function(e){return A(e)||q(e)||C(e)||P(e)||B(e)},e.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(w(e)||R(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))}(types)),types}function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser?isBufferBrowser:(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8})}function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,function(e){var t={},r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},i=0;i<t.length;i++)r[t[i]]=Object.getOwnPropertyDescriptor(e,t[i]);return r},i=/%[sdj%]/g;e.format=function(e){if(!y(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(a(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),u=n[r];r<o;u=n[++r])m(u)||!w(u)?s+=" "+u:s+=" "+a(u);return s},e.deprecate=function(t,r){if(void 0!==process$1&&!0===process$1.noDeprecation)return t;if(void 0===process$1)return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(process$1.throwDeprecation)throw new Error(r);process$1.traceDeprecation?console.trace(r):console.error(r),i=!0}return t.apply(this,arguments)}};var n={},o=/^$/;if(t.NODE_DEBUG){var s=t.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+s+"$","i")}function a(t,r){var i={seen:[],stylize:h};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),p(r)?i.showHidden=r:r&&e._extend(i,r),b(i.showHidden)&&(i.showHidden=!1),b(i.depth)&&(i.depth=2),b(i.colors)&&(i.colors=!1),b(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=u),f(i,t,i.depth)}function u(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function h(e,t){return e}function f(t,r,i){if(t.customInspect&&r&&S(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(i,t);return y(n)||(n=f(t,n,i)),n}var o=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"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")}(t,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),M(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(S(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(v(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return t.stylize(Date.prototype.toString.call(r),"date");if(M(r))return l(r)}var h,w="",E=!1,R=["{","}"];(d(r)&&(E=!0,R=["[","]"]),S(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return v(r)&&(w=" "+RegExp.prototype.toString.call(r)),_(r)&&(w=" "+Date.prototype.toUTCString.call(r)),M(r)&&(w=" "+l(r)),0!==s.length||E&&0!=r.length?i<0?v(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),h=E?function(e,t,r,i,n){for(var o=[],s=0,a=t.length;s<a;++s)q(t,String(s))?o.push(c(e,t,r,i,String(s),!0)):o.push("");return n.forEach((function(n){n.match(/^\d+$/)||o.push(c(e,t,r,i,n,!0))})),o}(t,r,i,a,s):s.map((function(e){return c(t,r,i,a,e,E)})),t.seen.pop(),function(e,t,r){var i=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(i>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(h,w,R)):R[0]+w+R[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,r,i,n,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),q(i,n)||(s="["+n+"]"),a||(e.seen.indexOf(u.value)<0?(a=m(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),b(s)){if(o&&n.match(/^\d+$/))return a;(s=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}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 y(e){return"string"==typeof e}function b(e){return void 0===e}function v(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function _(e){return w(e)&&"[object Date]"===E(e)}function M(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function R(e){return e<10?"0"+e.toString(10):e.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!n[t])if(o.test(t)){var r=process$1.pid;n[t]=function(){var i=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,i)}}else n[t]=function(){};return n[t]},e.inspect=a,a.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]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=requireTypes(),e.isArray=d,e.isBoolean=p,e.isNull=m,e.isNullOrUndefined=function(e){return null==e},e.isNumber=g,e.isString=y,e.isSymbol=function(e){return"symbol"==typeof e},e.isUndefined=b,e.isRegExp=v,e.types.isRegExp=v,e.isObject=w,e.isDate=_,e.types.isDate=_,e.isError=M,e.types.isNativeError=M,e.isFunction=S,e.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},e.isBuffer=requireIsBufferBrowser();var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){var t,r;console.log("%s - %s",(r=[R((t=new Date).getHours()),R(t.getMinutes()),R(t.getSeconds())].join(":"),[t.getDate(),A[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=requireInherits_browser(),e._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e};var C="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}e.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(C&&e[C]){var t;if("function"!=typeof(t=e[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,i=new Promise((function(e,i){t=e,r=i})),n=[],o=0;o<arguments.length;o++)n.push(arguments[o]);n.push((function(e,i){e?r(e):t(i)}));try{e.apply(this,n)}catch(e){r(e)}return i}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),C&&Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,r(e))},e.promisify.custom=C,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var n=this,o=function(){return i.apply(n,arguments)};e.apply(this,t).then((function(e){process$1.nextTick(o.bind(null,null,e))}),(function(e){process$1.nextTick(P.bind(null,e,o))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,r(e)),t}}(util$1)),util$1}function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function t(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?e(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function n(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}hasRequiredBuffer_list=1;var o=requireDist().Buffer,s=requireUtil$1().inspect,a=s&&s.custom||"inspect";return buffer_list=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return i(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,i,n=o.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,r=n,i=a,o.prototype.copy.call(t,r,i),a+=s.data.length,s=s.next;return n}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,i=t.data;for(e-=i.length;t=t.next;){var n=t.data,o=e>n.length?n.length:e;if(o===n.length?i+=n:i+=n.slice(0,e),0===(e-=o)){o===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,s=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,s),0===(e-=s)){s===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(s));break}++i}return this.length-=i,t}},{key:a,value:function(e,r){return s(this,t(t({},r),{},{depth:0,customInspect:!1}))}}]),e}()}function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$1;function e(e,i){r(e,i),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}return hasRequiredDestroy$1=1,destroy_1$1={destroy:function(i,n){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(n?n(i):i&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1.nextTick(r,this,i)):process$1.nextTick(r,this,i)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(i||null,(function(r){!n&&r?o._writableState?o._writableState.errorEmitted?process$1.nextTick(t,o):(o._writableState.errorEmitted=!0,process$1.nextTick(e,o,r)):process$1.nextTick(e,o,r):n?(process$1.nextTick(t,o),n(r)):process$1.nextTick(t,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}}}var errorsBrowser={},hasRequiredErrorsBrowser,state,hasRequiredState,browser$d,hasRequiredBrowser$c,_stream_writable$1,hasRequired_stream_writable$1,_stream_duplex$1,hasRequired_stream_duplex$1;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;var e={};function t(t,r,i){i||(i=Error);var n=function(e){var t,i;function n(t,i,n){return e.call(this,function(e,t,i){return"string"==typeof r?r:r(e,t,i)}(t,i,n))||this}return i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i,n}(i);n.prototype.name=i.name,n.prototype.code=t,e[t]=n}function r(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}return t("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),t("ERR_INVALID_ARG_TYPE",(function(e,t,i){var n,o,s;if("string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(r(t,"type"));else{var a=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(a," ").concat(n," ").concat(r(t,"type"))}return s+=". Received type ".concat(typeof i)}),TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=e,errorsBrowser}function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var e=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;return state={getHighWaterMark:function(t,r,i,n){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(r,n,i);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new e(n?i:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}}function requireBrowser$c(){if(hasRequiredBrowser$c)return browser$d;function e(e){try{if(!commonjsGlobal.localStorage)return!1}catch(e){return!1}var t=commonjsGlobal.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}return hasRequiredBrowser$c=1,browser$d=function(t,r){if(e("noDeprecation"))return t;var i=!1;return function(){if(!i){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return t.apply(this,arguments)}},browser$d}function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var i=e.entry;e.entry=null;for(;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}(t,e)}}var t;hasRequired_stream_writable$1=1,_stream_writable$1=_,_.WritableState=w;var r={deprecate:requireBrowser$c()},i=requireStreamBrowser$1(),n=requireDist().Buffer,o=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var s,a=requireDestroy$1(),u=requireState().getHighWaterMark,h=requireErrorsBrowser().codes,f=h.ERR_INVALID_ARG_TYPE,l=h.ERR_METHOD_NOT_IMPLEMENTED,c=h.ERR_MULTIPLE_CALLBACK,d=h.ERR_STREAM_CANNOT_PIPE,p=h.ERR_STREAM_DESTROYED,m=h.ERR_STREAM_NULL_VALUES,g=h.ERR_STREAM_WRITE_AFTER_END,y=h.ERR_UNKNOWN_ENCODING,b=a.errorOrDestroy;function v(){}function w(r,i,n){t=t||require_stream_duplex$1(),r=r||{},"boolean"!=typeof n&&(n=i instanceof t),this.objectMode=!!r.objectMode,n&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=u(this,r,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===r.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=r.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 r=e._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new c;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,n){--t.pendingcb,r?(process$1.nextTick(n,i),process$1.nextTick(q,e,t),e._writableState.errorEmitted=!0,b(e,i)):(n(i),e._writableState.errorEmitted=!0,b(e,i),q(e,t))}(e,r,i,t,n);else{var o=R(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||E(e,r),i?process$1.nextTick(S,e,r,o,n):S(e,r,o,n)}}(i,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==r.emitClose,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function _(e){var r=this instanceof(t=t||require_stream_duplex$1());if(!r&&!s.call(_,this))return new _(e);this._writableState=new w(e,this,r),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)),i.call(this)}function M(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new p("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function S(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),q(e,t)}function E(t,r){r.bufferProcessing=!0;var i=r.bufferedRequest;if(t._writev&&i&&i.next){var n=r.bufferedRequestCount,o=new Array(n),s=r.corkedRequestsFree;s.entry=i;for(var a=0,u=!0;i;)o[a]=i,i.isBuf||(u=!1),i=i.next,a+=1;o.allBuffers=u,M(t,r,!0,r.length,o,"",s.finish),r.pendingcb++,r.lastBufferedRequest=null,s.next?(r.corkedRequestsFree=s.next,s.next=null):r.corkedRequestsFree=new e(r),r.bufferedRequestCount=0}else{for(;i;){var h=i.chunk,f=i.encoding,l=i.callback;if(M(t,r,!1,r.objectMode?1:h.length,h,f,l),i=i.next,r.bufferedRequestCount--,r.writing)break}null===i&&(r.lastBufferedRequest=null)}r.bufferedRequest=i,r.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(r){t.pendingcb--,r&&b(e,r),t.prefinished=!0,e.emit("prefinish"),q(e,t)}))}function q(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process$1.nextTick(A,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}return requireInherits_browser()(_,i),w.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(w.prototype,"buffer",{get:r.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]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===_&&(e&&e._writableState instanceof w)}})):s=function(e){return e instanceof this},_.prototype.pipe=function(){b(this,new d)},_.prototype.write=function(e,t,r){var i,s=this._writableState,a=!1,u=!s.objectMode&&(i=e,n.isBuffer(i)||i instanceof o);return u&&!n.isBuffer(e)&&(e=function(e){return n.from(e)}(e)),"function"==typeof t&&(r=t,t=null),u?t="buffer":t||(t=s.defaultEncoding),"function"!=typeof r&&(r=v),s.ending?function(e,t){var r=new g;b(e,r),process$1.nextTick(t,r)}(this,r):(u||function(e,t,r,i){var n;return null===r?n=new m:"string"==typeof r||t.objectMode||(n=new f("chunk",["string","Buffer"],r)),!n||(b(e,n),process$1.nextTick(i,n),!1)}(this,s,e,r))&&(s.pendingcb++,a=function(e,t,r,i,o,s){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=n.from(t,r));return t}(t,i,o);i!==a&&(r=!0,o="buffer",i=a)}var u=t.objectMode?1:i.length;t.length+=u;var h=t.length<t.highWaterMark;h||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:o,isBuf:r,callback:s,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else M(e,t,!1,u,i,o,s);return h}(this,s,u,e,t,r)),a},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||E(this,e))},_.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new y(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(e,t,r){r(new l("_write()"))},_.prototype._writev=null,_.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,q(e,t),r&&(t.finished?process$1.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),_.prototype.destroy=a.destroy,_.prototype._undestroy=a.undestroy,_.prototype._destroy=function(e,t){t(e)},_stream_writable$1}function require_stream_duplex$1(){if(hasRequired_stream_duplex$1)return _stream_duplex$1;hasRequired_stream_duplex$1=1;var e=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};_stream_duplex$1=s;var t=require_stream_readable$1(),r=require_stream_writable$1();requireInherits_browser()(s,t);for(var i=e(r.prototype),n=0;n<i.length;n++){var o=i[n];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(e){if(!(this instanceof s))return new s(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||process$1.nextTick(u,this)}function u(e){e.end()}return Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),_stream_duplex$1}var string_decoder={},safeBuffer$a={exports:{}},hasRequiredSafeBuffer$a,hasRequiredString_decoder,endOfStream,hasRequiredEndOfStream,async_iterator,hasRequiredAsync_iterator,fromBrowser,hasRequiredFromBrowser,_stream_readable$1,hasRequired_stream_readable$1,_stream_transform$1,hasRequired_stream_transform$1,_stream_passthrough$1,hasRequired_stream_passthrough$1,pipeline_1,hasRequiredPipeline,streamBrowserify,hasRequiredStreamBrowserify;function requireSafeBuffer$a(){return hasRequiredSafeBuffer$a||(hasRequiredSafeBuffer$a=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$a,safeBuffer$a.exports)),safeBuffer$a.exports}function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var e=requireSafeBuffer$a().Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var i;switch(this.encoding=function(r){var i=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof i&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return i||r}(r),this.encoding){case"utf16le":this.text=o,this.end=s,i=4;break;case"utf8":this.fillLast=n,i=4;break;case"base64":this.text=a,this.end=u,i=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(i)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r: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 o(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function a(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function u(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 f(e){return e&&e.length?this.write(e):""}return string_decoder.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=i(t[n]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if(o=i(t[n]),o>=0)return o>0&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if(o=i(t[n]),o>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},r.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},string_decoder}function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var e=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}return endOfStream=function r(i,n,o){if("function"==typeof n)return r(i,null,n);n||(n={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}(o||t);var s=n.readable||!1!==n.readable&&i.readable,a=n.writable||!1!==n.writable&&i.writable,u=function(){i.writable||f()},h=i._writableState&&i._writableState.finished,f=function(){a=!1,h=!0,s||o.call(i)},l=i._readableState&&i._readableState.endEmitted,c=function(){s=!1,l=!0,a||o.call(i)},d=function(e){o.call(i,e)},p=function(){var t;return s&&!l?(i._readableState&&i._readableState.ended||(t=new e),o.call(i,t)):a&&!h?(i._writableState&&i._writableState.ended||(t=new e),o.call(i,t)):void 0},m=function(){i.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(i)?a&&!i._writableState&&(i.on("end",u),i.on("close",u)):(i.on("complete",f),i.on("abort",p),i.req?m():i.on("request",m)),i.on("end",c),i.on("finish",f),!1!==n.error&&i.on("error",d),i.on("close",p),function(){i.removeListener("complete",f),i.removeListener("abort",p),i.removeListener("request",m),i.req&&i.req.removeListener("finish",f),i.removeListener("end",u),i.removeListener("close",u),i.removeListener("finish",f),i.removeListener("end",c),i.removeListener("error",d),i.removeListener("close",p)}},endOfStream}function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;var e;function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hasRequiredAsync_iterator=1;var r=requireEndOfStream(),i=Symbol("lastResolve"),n=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),a=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function f(e,t){return{value:e,done:t}}function l(e){var t=e[i];if(null!==t){var r=e[h].read();null!==r&&(e[a]=null,e[i]=null,e[n]=null,t(f(r,!1)))}}function c(e){process$1.nextTick(l,e)}var d=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((t(e={get stream(){return this[h]},next:function(){var e=this,t=this[o];if(null!==t)return Promise.reject(t);if(this[s])return Promise.resolve(f(void 0,!0));if(this[h].destroyed)return new Promise((function(t,r){process$1.nextTick((function(){e[o]?r(e[o]):t(f(void 0,!0))}))}));var r,i=this[a];if(i)r=new Promise(function(e,t){return function(r,i){e.then((function(){t[s]?r(f(void 0,!0)):t[u](r,i)}),i)}}(i,this));else{var n=this[h].read();if(null!==n)return Promise.resolve(f(n,!1));r=new Promise(this[u])}return this[a]=r,r}},Symbol.asyncIterator,(function(){return this})),t(e,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(f(void 0,!0))}))}))})),e),d);return async_iterator=function(e){var l,d=Object.create(p,(t(l={},h,{value:e,writable:!0}),t(l,i,{value:null,writable:!0}),t(l,n,{value:null,writable:!0}),t(l,o,{value:null,writable:!0}),t(l,s,{value:e._readableState.endEmitted,writable:!0}),t(l,u,{value:function(e,t){var r=d[h].read();r?(d[a]=null,d[i]=null,d[n]=null,e(f(r,!1))):(d[i]=e,d[n]=t)},writable:!0}),l));return d[a]=null,r(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=d[n];return null!==t&&(d[a]=null,d[i]=null,d[n]=null,t(e)),void(d[o]=e)}var r=d[i];null!==r&&(d[a]=null,d[i]=null,d[n]=null,r(f(void 0,!0))),d[s]=!0})),e.on("readable",c.bind(null,d)),d}}function requireFromBrowser(){return hasRequiredFromBrowser?fromBrowser:(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")})}function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;var e;hasRequired_stream_readable$1=1,_stream_readable$1=_,_.ReadableState=w,requireEvents().EventEmitter;var t=function(e,t){return e.listeners(t).length},r=requireStreamBrowser$1(),i=requireDist().Buffer,n=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var o,s=requireUtil$1();o=s&&s.debuglog?s.debuglog("stream"):function(){};var a,u,h,f=requireBuffer_list(),l=requireDestroy$1(),c=requireState().getHighWaterMark,d=requireErrorsBrowser().codes,p=d.ERR_INVALID_ARG_TYPE,m=d.ERR_STREAM_PUSH_AFTER_EOF,g=d.ERR_METHOD_NOT_IMPLEMENTED,y=d.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;requireInherits_browser()(_,r);var b=l.errorOrDestroy,v=["error","close","destroy","pause","resume"];function w(t,r,i){e=e||require_stream_duplex$1(),t=t||{},"boolean"!=typeof i&&(i=r instanceof e),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=c(this,t,"readableHighWaterMark",i),this.buffer=new f,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!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(a||(a=requireString_decoder().StringDecoder),this.decoder=new a(t.encoding),this.encoding=t.encoding)}function _(t){if(e=e||require_stream_duplex$1(),!(this instanceof _))return new _(t);var i=this instanceof e;this._readableState=new w(t,this,i),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),r.call(this)}function M(e,t,r,s,a){o("readableAddChunk",t);var u,h=e._readableState;if(null===t)h.reading=!1,function(e,t){if(o("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,q(e)))}(e,h);else if(a||(u=function(e,t){var r;o=t,i.isBuffer(o)||o instanceof n||"string"==typeof t||void 0===t||e.objectMode||(r=new p("chunk",["string","Buffer","Uint8Array"],t));var o;return r}(h,t)),u)b(e,u);else if(h.objectMode||t&&t.length>0)if("string"==typeof t||h.objectMode||Object.getPrototypeOf(t)===i.prototype||(t=function(e){return i.from(e)}(t)),s)h.endEmitted?b(e,new y):S(e,h,t,!0);else if(h.ended)b(e,new m);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(t=h.decoder.write(t),h.objectMode||0!==t.length?S(e,h,t,!1):C(e,h)):S(e,h,t,!1)}else s||(h.reading=!1,C(e,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function S(e,t,r,i){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&A(e)),C(e,t)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=l.destroy,_.prototype._undestroy=l.undestroy,_.prototype._destroy=function(e,t){t(e)},_.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=i.from(e,t),t=""),r=!0),M(this,e,t,!1,r)},_.prototype.unshift=function(e){return M(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){a||(a=requireString_decoder().StringDecoder);var t=new a(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var E=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=E?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 A(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,process$1.nextTick(q,e))}function q(e){var t=e._readableState;o("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,k(e)}function C(e,t){t.readingMore||(t.readingMore=!0,process$1.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function B(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){o("readable nexttick read 0"),e.read(0)}function O(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),k(e),t.flowing&&!t.reading&&e.read(0)}function k(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function N(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process$1.nextTick(x,t,e))}function x(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function j(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}return _.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):A(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&N(this),null;var i,n=t.needReadable;return o("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",n=!0),t.ended||t.reading?o("reading or ended",n=!1):n&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(i=e>0?T(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),r!==e&&t.ended&&N(this)),null!==i&&this.emit("data",i),i},_.prototype._read=function(e){b(this,new g("_read()"))},_.prototype.pipe=function(e,r){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,r);var s=(!r||!1!==r.end)&&e!==process$1.stdout&&e!==process$1.stderr?u:m;function a(t,r){o("onunpipe"),t===i&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",h),e.removeListener("error",c),e.removeListener("unpipe",a),i.removeListener("end",u),i.removeListener("end",m),i.removeListener("data",l),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function u(){o("onend"),e.end()}n.endEmitted?process$1.nextTick(s):i.once("end",s),e.on("unpipe",a);var h=function(e){return function(){var r=e._readableState;o("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&t(e,"data")&&(r.flowing=!0,k(e))}}(i);e.on("drain",h);var f=!1;function l(t){o("ondata");var r=e.write(t);o("dest.write",r),!1===r&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==j(n.pipes,e))&&!f&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),i.pause())}function c(r){o("onerror",r),m(),e.removeListener("error",c),0===t(e,"error")&&b(e,r)}function d(){e.removeListener("finish",p),m()}function p(){o("onfinish"),e.removeListener("close",d),m()}function m(){o("unpipe"),i.unpipe(e)}return i.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",d),e.once("finish",p),e.emit("pipe",i),n.flowing||(o("pipe resume"),i.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=j(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},_.prototype.on=function(e,t){var i=r.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?A(this):n.reading||process$1.nextTick(I,this))),i},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(e,t){var i=r.prototype.removeListener.call(this,e,t);return"readable"===e&&process$1.nextTick(B,this),i},_.prototype.removeAllListeners=function(e){var t=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process$1.nextTick(B,this),t},_.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process$1.nextTick(O,e,t))}(this,e)),e.paused=!1,this},_.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var n in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(o("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(i=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var s=0;s<v.length;s++)e.on(v[s],this.emit.bind(this,v[s]));return this._read=function(t){o("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"==typeof Symbol&&(_.prototype[Symbol.asyncIterator]=function(){return void 0===u&&(u=requireAsync_iterator()),u(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),_._fromList=T,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(_.from=function(e,t){return void 0===h&&(h=requireFromBrowser()),h(_,e,t)}),_stream_readable$1}function require_stream_transform$1(){if(hasRequired_stream_transform$1)return _stream_transform$1;hasRequired_stream_transform$1=1,_stream_transform$1=a;var e=requireErrorsBrowser().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,i=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=e.ERR_TRANSFORM_WITH_LENGTH_0,o=require_stream_duplex$1();function s(e,t){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(null===n)return this.emit("error",new r);i.writechunk=null,i.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);o.call(this,e),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function u(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new n;if(e._transformState.transforming)throw new i;return e.push(null)}return requireInherits_browser()(a,o),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,o.prototype.push.call(this,e,t)},a.prototype._transform=function(e,r,i){i(new t("_transform()"))},a.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},a.prototype._destroy=function(e,t){o.prototype._destroy.call(this,e,(function(e){t(e)}))},_stream_transform$1}function require_stream_passthrough$1(){if(hasRequired_stream_passthrough$1)return _stream_passthrough$1;hasRequired_stream_passthrough$1=1,_stream_passthrough$1=t;var e=require_stream_transform$1();function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return requireInherits_browser()(t,e),t.prototype._transform=function(e,t,r){r(null,e)},_stream_passthrough$1}function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;var e;hasRequiredPipeline=1;var t=requireErrorsBrowser().codes,r=t.ERR_MISSING_ARGS,i=t.ERR_STREAM_DESTROYED;function n(e){if(e)throw e}function o(e){e()}function s(e,t){return e.pipe(t)}return pipeline_1=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];var h,f=function(e){return e.length?"function"!=typeof e[e.length-1]?n:e.pop():n}(a);if(Array.isArray(a[0])&&(a=a[0]),a.length<2)throw new r("streams");var l=a.map((function(t,r){var n=r<a.length-1;return function(t,r,n,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;t.on("close",(function(){s=!0})),void 0===e&&(e=requireEndOfStream()),e(t,{readable:r,writable:n},(function(e){if(e)return o(e);s=!0,o()}));var a=!1;return function(e){if(!s&&!a)return a=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new i("pipe"))}}(t,n,r>0,(function(e){h||(h=e),e&&l.forEach(o),n||(l.forEach(o),f(h))}))}));return a.reduce(s)},pipeline_1}function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=t;var e=requireEvents().EventEmitter;function t(){e.call(this)}return requireInherits_browser()(t,e),t.Readable=require_stream_readable$1(),t.Writable=require_stream_writable$1(),t.Duplex=require_stream_duplex$1(),t.Transform=require_stream_transform$1(),t.PassThrough=require_stream_passthrough$1(),t.finished=requireEndOfStream(),t.pipeline=requirePipeline(),t.Stream=t,t.prototype.pipe=function(t,r){var i=this;function n(e){t.writable&&!1===t.write(e)&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}i.on("data",n),t.on("drain",o),t._isStdio||r&&!1===r.end||(i.on("end",a),i.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function h(t){if(f(),0===e.listenerCount(this,"error"))throw t}function f(){i.removeListener("data",n),t.removeListener("drain",o),i.removeListener("end",a),i.removeListener("close",u),i.removeListener("error",h),t.removeListener("error",h),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return i.on("error",h),t.on("error",h),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t},streamBrowserify}requireStreamBrowserify();const _ParseError=class extends Error{constructor(e,t){super(t),this.code=e;let r=t;CoreManager.get("PARSE_ERRORS").forEach((t=>{t.code===e&&t.code&&(r=t.message)})),Object.defineProperty(this,"message",{enumerable:!0,value:r})}toString(){return"ParseError: "+this.code+" "+this.message}};_ParseError.OTHER_CAUSE=-1,_ParseError.INTERNAL_SERVER_ERROR=1,_ParseError.CONNECTION_FAILED=100,_ParseError.OBJECT_NOT_FOUND=101,_ParseError.INVALID_QUERY=102,_ParseError.INVALID_CLASS_NAME=103,_ParseError.MISSING_OBJECT_ID=104,_ParseError.INVALID_KEY_NAME=105,_ParseError.INVALID_POINTER=106,_ParseError.INVALID_JSON=107,_ParseError.COMMAND_UNAVAILABLE=108,_ParseError.NOT_INITIALIZED=109,_ParseError.INCORRECT_TYPE=111,_ParseError.INVALID_CHANNEL_NAME=112,_ParseError.PUSH_MISCONFIGURED=115,_ParseError.OBJECT_TOO_LARGE=116,_ParseError.OPERATION_FORBIDDEN=119,_ParseError.CACHE_MISS=120,_ParseError.INVALID_NESTED_KEY=121,_ParseError.INVALID_FILE_NAME=122,_ParseError.INVALID_ACL=123,_ParseError.TIMEOUT=124,_ParseError.INVALID_EMAIL_ADDRESS=125,_ParseError.MISSING_CONTENT_TYPE=126,_ParseError.MISSING_CONTENT_LENGTH=127,_ParseError.INVALID_CONTENT_LENGTH=128,_ParseError.FILE_TOO_LARGE=129,_ParseError.FILE_SAVE_ERROR=130,_ParseError.DUPLICATE_VALUE=137,_ParseError.INVALID_ROLE_NAME=139,_ParseError.EXCEEDED_QUOTA=140,_ParseError.SCRIPT_FAILED=141,_ParseError.VALIDATION_ERROR=142,_ParseError.INVALID_IMAGE_DATA=143,_ParseError.UNSAVED_FILE_ERROR=151,_ParseError.INVALID_PUSH_TIME_ERROR=152,_ParseError.FILE_DELETE_ERROR=153,_ParseError.FILE_DELETE_UNNAMED_ERROR=161,_ParseError.REQUEST_LIMIT_EXCEEDED=155,_ParseError.DUPLICATE_REQUEST=159,_ParseError.INVALID_EVENT_NAME=160,_ParseError.INVALID_VALUE=162,_ParseError.USERNAME_MISSING=200,_ParseError.PASSWORD_MISSING=201,_ParseError.USERNAME_TAKEN=202,_ParseError.EMAIL_TAKEN=203,_ParseError.EMAIL_MISSING=204,_ParseError.EMAIL_NOT_FOUND=205,_ParseError.SESSION_MISSING=206,_ParseError.MUST_CREATE_USER_THROUGH_SIGNUP=207,_ParseError.ACCOUNT_ALREADY_LINKED=208,_ParseError.INVALID_SESSION_TOKEN=209,_ParseError.MFA_ERROR=210,_ParseError.MFA_TOKEN_REQUIRED=211,_ParseError.LINKED_ID_MISSING=250,_ParseError.INVALID_LINKED_SESSION=251,_ParseError.UNSUPPORTED_SERVICE=252,_ParseError.INVALID_SCHEMA_OPERATION=255,_ParseError.AGGREGATE_ERROR=600,_ParseError.FILE_READ_ERROR=601,_ParseError.X_DOMAIN_REQUEST=602;let ParseError=_ParseError,NodeReadable;function b64Digit(e){if(e<26)return String.fromCharCode(65+e);if(e<52)return String.fromCharCode(e-26+97);if(e<62)return String.fromCharCode(e-52+48);if(62===e)return"+";if(63===e)return"/";throw new TypeError("Tried to encode large digit "+e+" in base64.")}class ParseFile{constructor(e,t,r,i,n){const o=r||"";if(this._name=e,this._metadata=i||{},this._tags=n||{},void 0!==t)if(void 0!==Buffer&&Buffer.isBuffer(t))this._source={format:"buffer",buffer:t,type:o};else if(null!==t&&"object"==typeof t&&"function"==typeof t.pipe&&"function"==typeof t.read)this._source={format:"stream",stream:t,type:o};else if("undefined"!=typeof ReadableStream&&t instanceof ReadableStream)this._source={format:"stream",stream:t,type:o};else if(Array.isArray(t)||t instanceof Uint8Array)this._data=ParseFile.encodeBase64(t),this._source={format:"base64",base64:this._data,type:o};else if("undefined"!=typeof Blob&&t instanceof Blob)this._source={format:"file",file:t,type:o};else if(t&&"string"==typeof t.uri&&void 0!==t.uri)this._source={format:"uri",uri:t.uri,type:o};else{if(!t||"string"!=typeof t.base64)throw new TypeError("Cannot create a Parse.File with that data.");{const e=t.base64.split(",").slice(-1)[0],r=o||t.base64.split(";").slice(0,1)[0].split(":").slice(1,2)[0]||"text/plain";this._data=e,this._source={format:"base64",base64:e,type:r}}}}async getData(e){if(e=e||{},this._data)return this._data;if("buffer"===this._source?.format)return this._data=this._source.buffer.toString("base64"),this._data;if(!this._url)throw new Error("Cannot retrieve data for unsaved ParseFile.");e.requestTask=e=>this._requestTask=e;const t=CoreManager.getFileController(),r=await t.download(this._url,e);return this._data=r.base64,this._data}name(){return this._name}url(e){if(e=e||{},this._url)return e.forceSecure?this._url.replace(/^http:\/\//i,"https://"):this._url}metadata(){return this._metadata}tags(){return this._tags}directory(){return this._directory}save(e){(e=e||{}).requestTask=e=>this._requestTask=e,e.metadata=this._metadata,e.tags=this._tags,e.directory=this._directory;const t=CoreManager.getFileController();if(!this._previousSave)if("buffer"===this._source.format||"stream"===this._source.format){if("stream"===this._source.format&&!t.saveBinary)throw new Error("Cannot save a stream-based file without saveBinary support on the FileController.");const r=this._metadata&&Object.keys(this._metadata).length>0||this._tags&&Object.keys(this._tags).length>0||!!this._directory;if(!t.saveBinary||"stream"!==this._source.format&&r){if("buffer"===this._source.format){const r={format:"base64",base64:this._source.buffer.toString("base64"),type:this._source.type};this._previousSave=t.saveBase64(this._name,r,e).then((e=>(this._name=e.name,this._url=e.url,this._requestTask=null,this)))}}else this._previousSave=t.saveBinary(this._name,this._source,e).then((e=>(this._name=e.name,this._url=e.url,this._data=null,this._requestTask=null,this)))}else"file"===this._source.format?this._previousSave=t.saveFile(this._name,this._source,e).then((e=>(this._name=e.name,this._url=e.url,this._data=null,this._requestTask=null,this))):"uri"===this._source.format?this._previousSave=t.download(this._source.uri,e).then((r=>{if(!r||!r.base64)return{};const i={format:"base64",base64:r.base64,type:r.contentType};return this._data=r.base64,this._requestTask=null,t.saveBase64(this._name,i,e)})).then((e=>(this._name=e.name,this._url=e.url,this._requestTask=null,this))):this._previousSave=t.saveBase64(this._name,this._source,e).then((e=>(this._name=e.name,this._url=e.url,this._requestTask=null,this)));if(this._previousSave)return this._previousSave}cancel(){this._requestTask&&"function"==typeof this._requestTask.abort&&(this._requestTask._aborted=!0,this._requestTask.abort()),this._requestTask=null}destroy(e={}){if(!this._name)throw new ParseError(ParseError.FILE_DELETE_UNNAMED_ERROR,"Cannot delete an unnamed file.");const t={useMasterKey:!0};Object.hasOwn(e,"useMasterKey")&&(t.useMasterKey=!!e.useMasterKey);return CoreManager.getFileController().deleteFile(this._name,t).then((()=>(this._data=void 0,this._requestTask=null,this)))}toJSON(){return{__type:"File",name:this._name,url:this._url}}equals(e){return this===e||e instanceof ParseFile&&this.name()===e.name()&&this.url()===e.url()&&void 0!==this.url()}setMetadata(e){e&&"object"==typeof e&&Object.keys(e).forEach((t=>{this.addMetadata(t,e[t])}))}addMetadata(e,t){"string"==typeof e&&(this._metadata[e]=t)}setTags(e){e&&"object"==typeof e&&Object.keys(e).forEach((t=>{this.addTag(t,e[t])}))}addTag(e,t){"string"==typeof e&&(this._tags[e]=t)}setDirectory(e){"string"==typeof e&&e.length>0&&(this._directory=e)}static fromJSON(e){if("File"!==e.__type)throw new TypeError("JSON object does not represent a ParseFile");const t=new ParseFile(e.name);return t._url=e.url,t}static encodeBase64(e){const t=[];t.length=Math.ceil(e.length/3);for(let r=0;r<t.length;r++){const i=e[3*r],n=e[3*r+1]||0,o=e[3*r+2]||0,s=3*r+1<e.length,a=3*r+2<e.length;t[r]=[b64Digit(i>>2&63),b64Digit(i<<4&48|n>>4&15),s?b64Digit(n<<2&60|o>>6&3):"=",a?b64Digit(63&o):"="].join("")}return t.join("")}}const DefaultController$a={saveFile:async function(e,t,r){if("file"!==t.format)throw new Error("saveFile can only be used with File-type sources.");const i=await new Promise(((e,r)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=e=>r(e),i.readAsDataURL(t.file)})),[n,o]=i.split(","),s={format:"base64",base64:o||n,type:t.type||(t.file?t.file.type:void 0)};return await DefaultController$a.saveBase64(e,s,r)},saveBase64:function(e,t,r={}){if("base64"!==t.format)throw new Error("saveBase64 can only be used with Base64-type sources.");const i={base64:t.base64,fileData:{metadata:{...r.metadata},tags:{...r.tags},...r.directory?{directory:r.directory}:{}}};delete r.metadata,delete r.tags,delete r.directory,t.type&&(i._ContentType=t.type);const n="files/"+e;return CoreManager.getRESTController().request("POST",n,i,r)},saveBinary:async function(e,t,r={}){if("buffer"!==t.format&&"stream"!==t.format)throw new Error("saveBinary can only be used with Buffer or Stream sources.");const i={"X-Parse-Application-ID":CoreManager.get("APPLICATION_ID"),"X-Parse-Upload-Mode":"stream"};i["Content-Type"]=(t.type||"application/octet-stream").replace(/[\r\n]/g,""),r.directory&&(i["X-Parse-File-Directory"]=r.directory.replace(/[\r\n]/g,"")),r.metadata&&Object.keys(r.metadata).length>0&&(i["X-Parse-File-Metadata"]=JSON.stringify(r.metadata)),r.tags&&Object.keys(r.tags).length>0&&(i["X-Parse-File-Tags"]=JSON.stringify(r.tags));const n=CoreManager.get("JAVASCRIPT_KEY");n&&(i["X-Parse-JavaScript-Key"]=n);let o,s=r.useMasterKey;if(void 0===s&&(s=CoreManager.get("USE_MASTER_KEY")),s){if(!CoreManager.get("MASTER_KEY"))throw new Error("Cannot use the Master Key, it has not been provided.");delete i["X-Parse-JavaScript-Key"],i["X-Parse-Master-Key"]=CoreManager.get("MASTER_KEY")}if(r.sessionToken)i["X-Parse-Session-Token"]=r.sessionToken;else{const e=CoreManager.getUserController();if(e){const t=await e.currentUserAsync();if(t){const e=t.getSessionToken();e&&(i["X-Parse-Session-Token"]=e)}}}if("buffer"===t.format)o=t.buffer;else if("stream"===t.format){const e=t.stream;o="function"==typeof e.pipe&&"function"==typeof e.read?NodeReadable.toWeb(e):e}let a=CoreManager.get("SERVER_URL");return"/"!==a[a.length-1]&&(a+="/"),a+="files/"+encodeURIComponent(e),CoreManager.getRESTController().ajax("POST",a,o,i,r).then((({response:e})=>e))},download:async function(e,t){const r=new AbortController;t.requestTask(r);const{signal:i}=r;try{const r=await fetch(e,{signal:i}),n=r.body.getReader(),o=+r.headers.get("Content-Length")||0,s=r.headers.get("Content-Type");if(0===o)return t.progress?.(null,null,null),{base64:"",contentType:s};let a=0;const u=[];for(;;){const{done:e,value:r}=await n.read();if(e)break;u.push(r),a+=r?.length||0,t.progress?.(a/o,a,o)}const h=new Uint8Array(a);let f=0;for(const e of u)h.set(e,f),f+=e.length;return{base64:ParseFile.encodeBase64(h),contentType:s}}catch(e){if("AbortError"===e.name)return{};throw e}},deleteFile:function(e,t){const r={"X-Parse-Application-ID":CoreManager.get("APPLICATION_ID")};t.useMasterKey&&(r["X-Parse-Master-Key"]=CoreManager.get("MASTER_KEY"));let i=CoreManager.get("SERVER_URL");return"/"!==i[i.length-1]&&(i+="/"),i+="files/"+e,CoreManager.getRESTController().ajax("DELETE",i,"",r).catch((e=>e&&"SyntaxError: Unexpected end of JSON input"!==e.toString()?CoreManager.getRESTController().handleError(e):Promise.resolve()))}};CoreManager.setFileController(DefaultController$a);class ParseGeoPoint{constructor(e,t){Array.isArray(e)?(ParseGeoPoint._validate(e[0],e[1]),this._latitude=e[0],this._longitude=e[1]):"object"==typeof e?(ParseGeoPoint._validate(e.latitude,e.longitude),this._latitude=e.latitude,this._longitude=e.longitude):void 0!==e&&void 0!==t?(ParseGeoPoint._validate(e,t),this._latitude=e,this._longitude=t):(this._latitude=0,this._longitude=0)}get latitude(){return this._latitude}set latitude(e){ParseGeoPoint._validate(e,this.longitude),this._latitude=e}get longitude(){return this._longitude}set longitude(e){ParseGeoPoint._validate(this.latitude,e),this._longitude=e}toJSON(){return ParseGeoPoint._validate(this._latitude,this._longitude),{__type:"GeoPoint",latitude:this._latitude,longitude:this._longitude}}equals(e){return e instanceof ParseGeoPoint&&this.latitude===e.latitude&&this.longitude===e.longitude}radiansTo(e){const t=Math.PI/180,r=this.latitude*t,i=this.longitude*t,n=e.latitude*t,o=r-n,s=i-e.longitude*t,a=Math.sin(o/2),u=Math.sin(s/2);let h=a*a+Math.cos(r)*Math.cos(n)*u*u;return h=Math.min(1,h),2*Math.asin(Math.sqrt(h))}kilometersTo(e){return 6371*this.radiansTo(e)}milesTo(e){return 3958.8*this.radiansTo(e)}static _validate(e,t){if(isNaN(e)||isNaN(t)||"number"!=typeof e||"number"!=typeof t)throw new TypeError("GeoPoint latitude and longitude must be valid numbers");if(e<-90)throw new TypeError("GeoPoint latitude out of bounds: "+e+" < -90.0.");if(e>90)throw new TypeError("GeoPoint latitude out of bounds: "+e+" > 90.0.");if(t<-180)throw new TypeError("GeoPoint longitude out of bounds: "+t+" < -180.0.");if(t>180)throw new TypeError("GeoPoint longitude out of bounds: "+t+" > 180.0.")}static current(e){return new Promise(((t,r)=>{navigator.geolocation.getCurrentPosition((e=>{t(new ParseGeoPoint(e.coords.latitude,e.coords.longitude))}),r,e)}))}}class ParsePolygon{constructor(e){this._coordinates=ParsePolygon._validate(e)}get coordinates(){return this._coordinates}set coordinates(e){this._coordinates=ParsePolygon._validate(e)}toJSON(){return ParsePolygon._validate(this._coordinates),{__type:"Polygon",coordinates:this._coordinates}}equals(e){if(!(e instanceof ParsePolygon)||this.coordinates.length!==e.coordinates.length)return!1;let t=!0;for(let r=1;r<this._coordinates.length;r+=1)if(this._coordinates[r][0]!=e.coordinates[r][0]||this._coordinates[r][1]!=e.coordinates[r][1]){t=!1;break}return t}containsPoint(e){let t=this._coordinates[0][0],r=this._coordinates[0][0],i=this._coordinates[0][1],n=this._coordinates[0][1];for(let e=1;e<this._coordinates.length;e+=1){const o=this._coordinates[e];t=Math.min(o[0],t),r=Math.max(o[0],r),i=Math.min(o[1],i),n=Math.max(o[1],n)}if(e.latitude<t||e.latitude>r||e.longitude<i||e.longitude>n)return!1;let o=!1;for(let t=0,r=this._coordinates.length-1;t<this._coordinates.length;r=t++){const i=this._coordinates[t][0],n=this._coordinates[t][1],s=this._coordinates[r][0],a=this._coordinates[r][1];n>e.longitude!=a>e.longitude&&e.latitude<(s-i)*(e.longitude-n)/(a-n)+i&&(o=!o)}return o}static _validate(e){if(!Array.isArray(e))throw new TypeError("Coordinates must be an Array");if(e.length<3)throw new TypeError("Polygon must have at least 3 GeoPoints or Points");const t=[];for(let r=0;r<e.length;r+=1){const i=e[r];let n;if(i instanceof ParseGeoPoint)n=i;else{if(!Array.isArray(i)||2!==i.length)throw new TypeError("Coordinates must be an Array of GeoPoints or Points");n=new ParseGeoPoint(i[0],i[1])}t.push([n.latitude,n.longitude])}return t}}class ParseRelation{constructor(e,t){this.parent=e,this.key=t,this.targetClassName=null}_ensureParentAndKey(e,t){if(this.key=this.key||t,this.key!==t)throw new Error("Internal Error. Relation retrieved from two different keys.");if(this.parent){if(this.parent.className!==e.className)throw new Error("Internal Error. Relation retrieved from two different Objects.");if(this.parent.id){if(this.parent.id!==e.id)throw new Error("Internal Error. Relation retrieved from two different Objects.")}else e.id&&(this.parent=e)}else this.parent=e}add(e){Array.isArray(e)||(e=[e]);const{RelationOp:t}=CoreManager.getParseOp(),r=new t(e,[]),i=this.parent;if(!i)throw new Error("Cannot add to a Relation without a parent");return 0===e.length||(i.set(this.key,r),this.targetClassName=r._targetClassName),i}remove(e){Array.isArray(e)||(e=[e]);const{RelationOp:t}=CoreManager.getParseOp(),r=new t([],e);if(!this.parent)throw new Error("Cannot remove from a Relation without a parent");0!==e.length&&(this.parent.set(this.key,r),this.targetClassName=r._targetClassName)}toJSON(){return{__type:"Relation",className:this.targetClassName}}query(){let e;const t=this.parent;if(!t)throw new Error("Cannot construct a query for a Relation without a parent");const r=CoreManager.getParseQuery();return this.targetClassName?e=new r(this.targetClassName):(e=new r(t.className),e._extraOptions.redirectClassNameForKey=this.key),e._addCondition("$relatedTo","object",{__type:"Pointer",className:t.className,objectId:t.id}),e._addCondition("$relatedTo","key",this.key),e}}function isDangerousKey(e){const t=["__proto__","constructor","prototype"];if(t.includes(e))return!0;if(e.includes(".")){return e.split(".").some((e=>t.includes(e)))}return!1}function decode(e){if(null===e||"object"!=typeof e||e instanceof Date)return e;if(Array.isArray(e)){const t=[];return e.forEach(((e,r)=>{t[r]=decode(e)})),t}if("string"==typeof e.__op){const{opFromJSON:t}=CoreManager.getParseOp();return t(e)}const t=CoreManager.getParseObject();if("Pointer"===e.__type&&e.className)return t.fromJSON(e);if("Object"===e.__type&&e.className)return t.fromJSON(e);if("Relation"===e.__type){const t=new ParseRelation(null,null);return t.targetClassName=e.className,t}if("Date"===e.__type)return new Date(e.iso);if("File"===e.__type)return ParseFile.fromJSON(e);if("GeoPoint"===e.__type)return new ParseGeoPoint({latitude:e.latitude,longitude:e.longitude});if("Polygon"===e.__type)return new ParsePolygon(e.coordinates);const r={};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){if(isDangerousKey(t))continue;r[t]=decode(e[t])}return r}const PUBLIC_KEY$1="*";class ParseACL{constructor(e){if(this.permissionsById={},e&&"object"==typeof e){if(e instanceof CoreManager.getParseUser())this.setReadAccess(e,!0),this.setWriteAccess(e,!0);else for(const t in e){const r=e[t];this.permissionsById[t]={};for(const e in r){const i=r[e];if("read"!==e&&"write"!==e)throw new TypeError("Tried to create an ACL with an invalid permission type.");if("boolean"!=typeof i)throw new TypeError("Tried to create an ACL with an invalid permission value.");this.permissionsById[t][e]=i}}}else if("function"==typeof e)throw new TypeError("ParseACL constructed with a function. Did you forget ()?")}toJSON(){const e={};for(const t in this.permissionsById)e[t]=this.permissionsById[t];return e}equals(e){if(!(e instanceof ParseACL))return!1;const t=Object.keys(this.permissionsById),r=Object.keys(e.permissionsById);if(t.length!==r.length)return!1;for(const t in this.permissionsById){if(!e.permissionsById[t])return!1;if(this.permissionsById[t].read!==e.permissionsById[t].read)return!1;if(this.permissionsById[t].write!==e.permissionsById[t].write)return!1}return!0}_setAccess(e,t,r){const i=CoreManager.getParseRole();if(t instanceof CoreManager.getParseUser())t=t.id;else if(t instanceof i){const e=t.getName();if(!e)throw new TypeError("Role must have a name");t="role:"+e}if("string"!=typeof t)throw new TypeError("userId must be a string.");if("boolean"!=typeof r)throw new TypeError("allowed must be either true or false.");let n=this.permissionsById[t];if(!n){if(!r)return;n={},this.permissionsById[t]=n}r?this.permissionsById[t][e]=!0:(delete n[e],0===Object.keys(n).length&&delete this.permissionsById[t])}_getAccess(e,t){const r=CoreManager.getParseRole();if(t instanceof CoreManager.getParseUser()){if(!(t=t.id))throw new Error("Cannot get access for a ParseUser without an ID")}else if(t instanceof r){const e=t.getName();if(!e)throw new TypeError("Role must have a name");t="role:"+e}const i=this.permissionsById[t];return!!i&&!!i[e]}setReadAccess(e,t){this._setAccess("read",e,t)}getReadAccess(e){return this._getAccess("read",e)}setWriteAccess(e,t){this._setAccess("write",e,t)}getWriteAccess(e){return this._getAccess("write",e)}setPublicReadAccess(e){this.setReadAccess(PUBLIC_KEY$1,e)}getPublicReadAccess(){return this.getReadAccess(PUBLIC_KEY$1)}setPublicWriteAccess(e){this.setWriteAccess(PUBLIC_KEY$1,e)}getPublicWriteAccess(){return this.getWriteAccess(PUBLIC_KEY$1)}getRoleReadAccess(e){if(e instanceof CoreManager.getParseRole()&&(e=e.getName()),"string"!=typeof e)throw new TypeError("role must be a ParseRole or a String");return this.getReadAccess("role:"+e)}getRoleWriteAccess(e){if(e instanceof CoreManager.getParseRole()&&(e=e.getName()),"string"!=typeof e)throw new TypeError("role must be a ParseRole or a String");return this.getWriteAccess("role:"+e)}setRoleReadAccess(e,t){if(e instanceof CoreManager.getParseRole()&&(e=e.getName()),"string"!=typeof e)throw new TypeError("role must be a ParseRole or a String");this.setReadAccess("role:"+e,t)}setRoleWriteAccess(e,t){if(e instanceof CoreManager.getParseRole()&&(e=e.getName()),"string"!=typeof e)throw new TypeError("role must be a ParseRole or a String");this.setWriteAccess("role:"+e,t)}}function encode$1(e,t,r,i,n){if(e instanceof CoreManager.getParseObject()){if(t)throw new Error("Parse Objects not allowed here");const o=e.id?e.className+":"+e.id:e;return r||!i||i.indexOf(o)>-1||e.dirty()||Object.keys(e._getServerData()).length<1?n&&e._getId().startsWith("local")?e.toOfflinePointer():e.toPointer():(i=i.concat(o),e._toFullJSON(i,n))}const{Op:o}=CoreManager.getParseOp();if(e instanceof o||e instanceof ParseACL||e instanceof ParseGeoPoint||e instanceof ParsePolygon||e instanceof ParseRelation)return e.toJSON();if(e instanceof ParseFile){if(!e.url())throw new Error("Tried to encode an unsaved file.");return e.toJSON()}if("[object Date]"===Object.prototype.toString.call(e)){if(isNaN(e))throw new Error("Tried to encode an invalid date.");return{__type:"Date",iso:e.toJSON()}}if("[object RegExp]"===Object.prototype.toString.call(e)&&"string"==typeof e.source)return e.source;if(Array.isArray(e))return e.map((e=>encode$1(e,t,r,i,n)));if(e&&"object"==typeof e){const o={};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(isDangerousKey(s))continue;o[s]=encode$1(e[s],t,r,i,n)}return o}return e}function encode(e,t,r,i,n){return encode$1(e,!!t,!!r,i||[],n)}var CryptoJS_1,hasRequiredCryptoJS;function requireCryptoJS(){if(hasRequiredCryptoJS)return CryptoJS_1;hasRequiredCryptoJS=1;let e=function(e){var t={},r=t.lib={},i=function(){},n=r.Base={extend:function(e){i.prototype=this;var t=new i;return e&&t.mixIn(e),t.hasOwnProperty("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)}},o=r.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,r=e.words,i=this.sigBytes;if(e=e.sigBytes,this.clamp(),i%4)for(var n=0;n<e;n++)t[i+n>>>2]|=(r[n>>>2]>>>24-n%4*8&255)<<24-(i+n)%4*8;else if(65535<r.length)for(n=0;n<e;n+=4)t[i+n>>>2]=r[n>>>2];else t.push.apply(t,r);return this.sigBytes+=e,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=n.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r=[],i=0;i<t;i+=4)r.push(4294967296*e.random()|0);return new o.init(r,t)}}),s=t.enc={},a=s.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var r=[],i=0;i<e;i++){var n=t[i>>>2]>>>24-i%4*8&255;r.push((n>>>4).toString(16)),r.push((15&n).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i+=2)r[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new o.init(r,t/2)}},u=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var r=[],i=0;i<e;i++)r.push(String.fromCharCode(t[i>>>2]>>>24-i%4*8&255));return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new o.init(r,t)}},h=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,i=r.words,n=r.sigBytes,s=this.blockSize,a=n/(4*s);if(t=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,n=e.min(4*t,n),t){for(var u=0;u<t;u+=s)this._doProcessBlock(i,u);u=i.splice(0,t),r.sigBytes-=n}return new o.init(u,n)},clone:function(){var e=n.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=f.extend({cfg:n.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new l.HMAC.init(e,r).finalize(t)}}});var l=t.algo={};return t}(Math);var t,r;return r=(t=e).lib.WordArray,t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,i=this._map;e.clamp(),e=[];for(var n=0;n<r;n+=3)for(var o=(t[n>>>2]>>>24-n%4*8&255)<<16|(t[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|t[n+2>>>2]>>>24-(n+2)%4*8&255,s=0;4>s&&n+.75*s<r;s++)e.push(i.charAt(o>>>6*(3-s)&63));if(t=i.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var t=e.length,i=this._map;(n=i.charAt(64))&&-1!=(n=e.indexOf(n))&&(t=n);for(var n=[],o=0,s=0;s<t;s++)if(s%4){var a=i.indexOf(e.charAt(s-1))<<s%4*2,u=i.indexOf(e.charAt(s))>>>6-s%4*2;n[o>>>2]|=(a|u)<<24-o%4*8,o++}return r.create(n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(t){function r(e,t,r,i,n,o,s){return((e=e+(t&r|~t&i)+n+s)<<o|e>>>32-o)+t}function i(e,t,r,i,n,o,s){return((e=e+(t&i|r&~i)+n+s)<<o|e>>>32-o)+t}function n(e,t,r,i,n,o,s){return((e=e+(t^r^i)+n+s)<<o|e>>>32-o)+t}function o(e,t,r,i,n,o,s){return((e=e+(r^(t|~i))+n+s)<<o|e>>>32-o)+t}for(var s=e,a=(h=s.lib).WordArray,u=h.Hasher,h=s.algo,f=[],l=0;64>l;l++)f[l]=4294967296*t.abs(t.sin(l+1))|0;h=h.MD5=u.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var s=0;16>s;s++){var a=e[u=t+s];e[u]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}s=this._hash.words;var u=e[t+0],h=(a=e[t+1],e[t+2]),l=e[t+3],c=e[t+4],d=e[t+5],p=e[t+6],m=e[t+7],g=e[t+8],y=e[t+9],b=e[t+10],v=e[t+11],w=e[t+12],_=e[t+13],M=e[t+14],S=e[t+15],E=r(E=s[0],q=s[1],A=s[2],R=s[3],u,7,f[0]),R=r(R,E,q,A,a,12,f[1]),A=r(A,R,E,q,h,17,f[2]),q=r(q,A,R,E,l,22,f[3]);E=r(E,q,A,R,c,7,f[4]),R=r(R,E,q,A,d,12,f[5]),A=r(A,R,E,q,p,17,f[6]),q=r(q,A,R,E,m,22,f[7]),E=r(E,q,A,R,g,7,f[8]),R=r(R,E,q,A,y,12,f[9]),A=r(A,R,E,q,b,17,f[10]),q=r(q,A,R,E,v,22,f[11]),E=r(E,q,A,R,w,7,f[12]),R=r(R,E,q,A,_,12,f[13]),A=r(A,R,E,q,M,17,f[14]),E=i(E,q=r(q,A,R,E,S,22,f[15]),A,R,a,5,f[16]),R=i(R,E,q,A,p,9,f[17]),A=i(A,R,E,q,v,14,f[18]),q=i(q,A,R,E,u,20,f[19]),E=i(E,q,A,R,d,5,f[20]),R=i(R,E,q,A,b,9,f[21]),A=i(A,R,E,q,S,14,f[22]),q=i(q,A,R,E,c,20,f[23]),E=i(E,q,A,R,y,5,f[24]),R=i(R,E,q,A,M,9,f[25]),A=i(A,R,E,q,l,14,f[26]),q=i(q,A,R,E,g,20,f[27]),E=i(E,q,A,R,_,5,f[28]),R=i(R,E,q,A,h,9,f[29]),A=i(A,R,E,q,m,14,f[30]),E=n(E,q=i(q,A,R,E,w,20,f[31]),A,R,d,4,f[32]),R=n(R,E,q,A,g,11,f[33]),A=n(A,R,E,q,v,16,f[34]),q=n(q,A,R,E,M,23,f[35]),E=n(E,q,A,R,a,4,f[36]),R=n(R,E,q,A,c,11,f[37]),A=n(A,R,E,q,m,16,f[38]),q=n(q,A,R,E,b,23,f[39]),E=n(E,q,A,R,_,4,f[40]),R=n(R,E,q,A,u,11,f[41]),A=n(A,R,E,q,l,16,f[42]),q=n(q,A,R,E,p,23,f[43]),E=n(E,q,A,R,y,4,f[44]),R=n(R,E,q,A,w,11,f[45]),A=n(A,R,E,q,S,16,f[46]),E=o(E,q=n(q,A,R,E,h,23,f[47]),A,R,u,6,f[48]),R=o(R,E,q,A,m,10,f[49]),A=o(A,R,E,q,M,15,f[50]),q=o(q,A,R,E,d,21,f[51]),E=o(E,q,A,R,w,6,f[52]),R=o(R,E,q,A,l,10,f[53]),A=o(A,R,E,q,b,15,f[54]),q=o(q,A,R,E,a,21,f[55]),E=o(E,q,A,R,g,6,f[56]),R=o(R,E,q,A,S,10,f[57]),A=o(A,R,E,q,p,15,f[58]),q=o(q,A,R,E,_,21,f[59]),E=o(E,q,A,R,c,6,f[60]),R=o(R,E,q,A,v,10,f[61]),A=o(A,R,E,q,h,15,f[62]),q=o(q,A,R,E,y,21,f[63]);s[0]=s[0]+E|0,s[1]=s[1]+q|0,s[2]=s[2]+A|0,s[3]=s[3]+R|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296);for(r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(r.length+1),this._process(),r=(e=this._hash).words,i=0;4>i;i++)n=r[i],r[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8);return e},clone:function(){var e=u.clone.call(this);return e._hash=this._hash.clone(),e}}),s.MD5=u._createHelper(h),s.HmacMD5=u._createHmacHelper(h)}(Math),function(){var t,r=e,i=(t=r.lib).Base,n=t.WordArray,o=(t=r.algo).EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=(a=this.cfg).hasher.create(),i=n.create(),o=i.words,s=a.keySize,a=a.iterations;o.length<s;){u&&r.update(u);var u=r.update(e).finalize(t);r.reset();for(var h=1;h<a;h++)u=r.finalize(u),r.reset();i.concat(u)}return i.sigBytes=4*s,i}});r.EvpKDF=function(e,t,r){return o.create(r).compute(e,t)}}(),e.lib.Cipher||function(){var t=(d=e).lib,r=t.Base,i=t.WordArray,n=t.BufferedBlockAlgorithm,o=d.enc.Base64,s=d.algo.EvpKDF,a=t.Cipher=n.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,r,i){return("string"==typeof r?p:c).encrypt(e,t,r,i)},decrypt:function(t,r,i){return("string"==typeof r?p:c).decrypt(e,t,r,i)}}}});t.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=d.mode={},h=function(e,t,r){var i=this._iv;i?this._iv=undefined:i=this._prevBlock;for(var n=0;n<r;n++)e[t+n]^=i[n]},f=(t.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();f.Encryptor=f.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;h.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),f.Decryptor=f.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,n=e.slice(t,t+i);r.decryptBlock(e,t),h.call(this,e,t,i),this._prevBlock=n}}),u=u.CBC=f,f=(d.pad={}).Pkcs7={pad:function(e,t){for(var r,n=(r=(r=4*t)-e.sigBytes%r)<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(n);r=i.create(o,r),e.concat(r)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=a.extend({cfg:a.cfg.extend({mode:u,padding:f}),reset:function(){a.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=t.createEncryptor;else r=t.createDecryptor,this._minBufferSize=1;this._mode=r.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var l=t.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),c=(u=(d.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?i.create([1398893684,1701076831]).concat(e).concat(t):t).toString(o)},parse:function(e){var t=(e=o.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var r=i.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return l.create({ciphertext:e,salt:r})}},t.SerializableCipher=r.extend({cfg:r.extend({format:u}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i);return t=n.finalize(t),n=n.cfg,l.create({ciphertext:t,key:r,iv:n.iv,algorithm:e,mode:n.mode,padding:n.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(r,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),d=(d.kdf={}).OpenSSL={execute:function(e,t,r,n){return n||(n=i.random(8)),e=s.create({keySize:t+r}).compute(e,n),r=i.create(e.words.slice(t),4*r),e.sigBytes=4*t,l.create({key:e,iv:r,salt:n})}},p=t.PasswordBasedCipher=c.extend({cfg:c.cfg.extend({kdf:d}),encrypt:function(e,t,r,i){return r=(i=this.cfg.extend(i)).kdf.execute(r,e.keySize,e.ivSize),i.iv=r.iv,(e=c.encrypt.call(this,e,t,r.key,i)).mixIn(r),e},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),r=i.kdf.execute(r,e.keySize,e.ivSize,t.salt),i.iv=r.iv,c.decrypt.call(this,e,t,r.key,i)}})}(),function(){for(var t=e,r=t.lib.BlockCipher,i=t.algo,n=[],o=[],s=[],a=[],u=[],h=[],f=[],l=[],c=[],d=[],p=[],m=0;256>m;m++)p[m]=128>m?m<<1:m<<1^283;var g=0,y=0;for(m=0;256>m;m++){var b=(b=y^y<<1^y<<2^y<<3^y<<4)>>>8^255&b^99;n[g]=b,o[b]=g;var v=p[g],w=p[v],_=p[w],M=257*p[b]^16843008*b;s[g]=M<<24|M>>>8,a[g]=M<<16|M>>>16,u[g]=M<<8|M>>>24,h[g]=M,M=16843009*_^65537*w^257*v^16843008*g,f[b]=M<<24|M>>>8,l[b]=M<<16|M>>>16,c[b]=M<<8|M>>>24,d[b]=M,g?(g=v^p[p[p[_^v]]],y^=p[p[y]]):g=y=1}var S=[0,1,2,4,8,16,32,64,128,27,54];i=i.AES=r.extend({_doReset:function(){for(var e=(r=this._key).words,t=r.sigBytes/4,r=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],o=0;o<r;o++)if(o<t)i[o]=e[o];else{var s=i[o-1];o%t?6<t&&4==o%t&&(s=n[s>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s]):(s=n[(s=s<<8|s>>>24)>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s],s^=S[o/t|0]<<24),i[o]=i[o-t]^s}for(e=this._invKeySchedule=[],t=0;t<r;t++)o=r-t,s=t%4?i[o]:i[o-4],e[t]=4>t||4>=o?s:f[n[s>>>24]]^l[n[s>>>16&255]]^c[n[s>>>8&255]]^d[n[255&s]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,u,h,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,l,c,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,o,s,a){for(var u=this._nRounds,h=e[t]^r[0],f=e[t+1]^r[1],l=e[t+2]^r[2],c=e[t+3]^r[3],d=4,p=1;p<u;p++){var m=i[h>>>24]^n[f>>>16&255]^o[l>>>8&255]^s[255&c]^r[d++],g=i[f>>>24]^n[l>>>16&255]^o[c>>>8&255]^s[255&h]^r[d++],y=i[l>>>24]^n[c>>>16&255]^o[h>>>8&255]^s[255&f]^r[d++];c=i[c>>>24]^n[h>>>16&255]^o[f>>>8&255]^s[255&l]^r[d++],h=m,f=g,l=y}m=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[l>>>8&255]<<8|a[255&c])^r[d++],g=(a[f>>>24]<<24|a[l>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^r[d++],y=(a[l>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[d++],c=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&l])^r[d++],e[t]=m,e[t+1]=g,e[t+2]=y,e[t+3]=c},keySize:8});t.AES=r._createHelper(i)}(),CryptoJS_1=e}requireCryptoJS();var aes$3={exports:{}};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var core$1={exports:{}},cryptoBrowserify={},browser$c={exports:{}},safeBuffer$9={exports:{}},hasRequiredSafeBuffer$9,hasRequiredBrowser$b;function requireSafeBuffer$9(){return hasRequiredSafeBuffer$9||(hasRequiredSafeBuffer$9=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$9,safeBuffer$9.exports)),safeBuffer$9.exports}function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$c.exports;hasRequiredBrowser$b=1;var e=65536,t=4294967295;var r=requireSafeBuffer$9().Buffer,i=commonjsGlobal.crypto||commonjsGlobal.msCrypto;return i&&i.getRandomValues?browser$c.exports=function(n,o){if(n>t)throw new RangeError("requested too many random bytes");var s=r.allocUnsafe(n);if(n>0)if(n>e)for(var a=0;a<n;a+=e)i.getRandomValues(s.slice(a,a+e));else i.getRandomValues(s);if("function"==typeof o)return process$1.nextTick((function(){o(null,s)}));return s}:browser$c.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},browser$c.exports}var safeBuffer$8={exports:{}},hasRequiredSafeBuffer$8,hashBase$1,hasRequiredHashBase$1,md5_js,hasRequiredMd5_js,ripemd160$1,hasRequiredRipemd160$1;function requireSafeBuffer$8(){return hasRequiredSafeBuffer$8||(hasRequiredSafeBuffer$8=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$8,safeBuffer$8.exports)),safeBuffer$8.exports}function requireHashBase$1(){if(hasRequiredHashBase$1)return hashBase$1;hasRequiredHashBase$1=1;var e=requireSafeBuffer$8().Buffer,t=requireStreamBrowserify().Transform;function r(r){t.call(this),this._block=e.allocUnsafe(r),this._blockSize=r,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}requireInherits_browser()(r,t),r.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},r.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)};var i="undefined"!=typeof Uint8Array,n="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&ArrayBuffer.isView&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return r.prototype.update=function(t,r){if(this._finalized)throw new Error("Digest already called");t=function(t,r){if(t instanceof e)return t;if("string"==typeof t)return e.from(t,r);if(n&&ArrayBuffer.isView(t)){if(0===t.byteLength)return e.alloc(0);var o=e.from(t.buffer,t.byteOffset,t.byteLength);if(o.byteLength===t.byteLength)return o}if(i&&t instanceof Uint8Array)return e.from(t);if(e.isBuffer(t)&&t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))return e.from(t);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}(t,r);for(var o=this._block,s=0;this._blockOffset+t.length-s>=this._blockSize;){for(var a=this._blockOffset;a<this._blockSize;)o[a++]=t[s++];this._update(),this._blockOffset=0}for(;s<t.length;)o[this._blockOffset++]=t[s++];for(var u=0,h=8*t.length;h>0;++u)this._length[u]+=h,(h=this._length[u]/4294967296|0)>0&&(this._length[u]-=4294967296*h);return this},r.prototype._update=function(){throw new Error("_update is not implemented")},r.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 r=0;r<4;++r)this._length[r]=0;return t},r.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$1=r}function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var e=requireInherits_browser(),t=requireHashBase$1(),r=requireSafeBuffer$9().Buffer,i=new Array(16);function n(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function o(e,t){return e<<t|e>>>32-t}function s(e,t,r,i,n,s,a){return o(e+(t&r|~t&i)+n+s|0,a)+t|0}function a(e,t,r,i,n,s,a){return o(e+(t&i|r&~i)+n+s|0,a)+t|0}function u(e,t,r,i,n,s,a){return o(e+(t^r^i)+n+s|0,a)+t|0}function h(e,t,r,i,n,s,a){return o(e+(r^(t|~i))+n+s|0,a)+t|0}return e(n,t),n.prototype._update=function(){for(var e=i,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,o=this._c,f=this._d;r=s(r,n,o,f,e[0],3614090360,7),f=s(f,r,n,o,e[1],3905402710,12),o=s(o,f,r,n,e[2],606105819,17),n=s(n,o,f,r,e[3],3250441966,22),r=s(r,n,o,f,e[4],4118548399,7),f=s(f,r,n,o,e[5],1200080426,12),o=s(o,f,r,n,e[6],2821735955,17),n=s(n,o,f,r,e[7],4249261313,22),r=s(r,n,o,f,e[8],1770035416,7),f=s(f,r,n,o,e[9],2336552879,12),o=s(o,f,r,n,e[10],4294925233,17),n=s(n,o,f,r,e[11],2304563134,22),r=s(r,n,o,f,e[12],1804603682,7),f=s(f,r,n,o,e[13],4254626195,12),o=s(o,f,r,n,e[14],2792965006,17),r=a(r,n=s(n,o,f,r,e[15],1236535329,22),o,f,e[1],4129170786,5),f=a(f,r,n,o,e[6],3225465664,9),o=a(o,f,r,n,e[11],643717713,14),n=a(n,o,f,r,e[0],3921069994,20),r=a(r,n,o,f,e[5],3593408605,5),f=a(f,r,n,o,e[10],38016083,9),o=a(o,f,r,n,e[15],3634488961,14),n=a(n,o,f,r,e[4],3889429448,20),r=a(r,n,o,f,e[9],568446438,5),f=a(f,r,n,o,e[14],3275163606,9),o=a(o,f,r,n,e[3],4107603335,14),n=a(n,o,f,r,e[8],1163531501,20),r=a(r,n,o,f,e[13],2850285829,5),f=a(f,r,n,o,e[2],4243563512,9),o=a(o,f,r,n,e[7],1735328473,14),r=u(r,n=a(n,o,f,r,e[12],2368359562,20),o,f,e[5],4294588738,4),f=u(f,r,n,o,e[8],2272392833,11),o=u(o,f,r,n,e[11],1839030562,16),n=u(n,o,f,r,e[14],4259657740,23),r=u(r,n,o,f,e[1],2763975236,4),f=u(f,r,n,o,e[4],1272893353,11),o=u(o,f,r,n,e[7],4139469664,16),n=u(n,o,f,r,e[10],3200236656,23),r=u(r,n,o,f,e[13],681279174,4),f=u(f,r,n,o,e[0],3936430074,11),o=u(o,f,r,n,e[3],3572445317,16),n=u(n,o,f,r,e[6],76029189,23),r=u(r,n,o,f,e[9],3654602809,4),f=u(f,r,n,o,e[12],3873151461,11),o=u(o,f,r,n,e[15],530742520,16),r=h(r,n=u(n,o,f,r,e[2],3299628645,23),o,f,e[0],4096336452,6),f=h(f,r,n,o,e[7],1126891415,10),o=h(o,f,r,n,e[14],2878612391,15),n=h(n,o,f,r,e[5],4237533241,21),r=h(r,n,o,f,e[12],1700485571,6),f=h(f,r,n,o,e[3],2399980690,10),o=h(o,f,r,n,e[10],4293915773,15),n=h(n,o,f,r,e[1],2240044497,21),r=h(r,n,o,f,e[8],1873313359,6),f=h(f,r,n,o,e[15],4264355552,10),o=h(o,f,r,n,e[6],2734768916,15),n=h(n,o,f,r,e[13],1309151649,21),r=h(r,n,o,f,e[4],4149444226,6),f=h(f,r,n,o,e[11],3174756917,10),o=h(o,f,r,n,e[2],718787259,15),n=h(n,o,f,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+o|0,this._d=this._d+f|0},n.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.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},md5_js=n}function requireRipemd160$1(){if(hasRequiredRipemd160$1)return ripemd160$1;hasRequiredRipemd160$1=1;var e=requireDist().Buffer,t=requireInherits_browser(),r=requireHashBase$1(),i=new Array(16),n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],o=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],s=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],a=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],u=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function f(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function l(e,t){return e<<t|e>>>32-t}function c(e,t,r,i,n,o,s,a){return l(e+(t^r^i)+o+s|0,a)+n|0}function d(e,t,r,i,n,o,s,a){return l(e+(t&r|~t&i)+o+s|0,a)+n|0}function p(e,t,r,i,n,o,s,a){return l(e+((t|~r)^i)+o+s|0,a)+n|0}function m(e,t,r,i,n,o,s,a){return l(e+(t&i|r&~i)+o+s|0,a)+n|0}function g(e,t,r,i,n,o,s,a){return l(e+(t^(r|~i))+o+s|0,a)+n|0}return t(f,r),f.prototype._update=function(){for(var e=i,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,f=0|this._b,y=0|this._c,b=0|this._d,v=0|this._e,w=0|this._a,_=0|this._b,M=0|this._c,S=0|this._d,E=0|this._e,R=0;R<80;R+=1){var A,q;R<16?(A=c(r,f,y,b,v,e[n[R]],u[0],s[R]),q=g(w,_,M,S,E,e[o[R]],h[0],a[R])):R<32?(A=d(r,f,y,b,v,e[n[R]],u[1],s[R]),q=m(w,_,M,S,E,e[o[R]],h[1],a[R])):R<48?(A=p(r,f,y,b,v,e[n[R]],u[2],s[R]),q=p(w,_,M,S,E,e[o[R]],h[2],a[R])):R<64?(A=m(r,f,y,b,v,e[n[R]],u[3],s[R]),q=d(w,_,M,S,E,e[o[R]],h[3],a[R])):(A=g(r,f,y,b,v,e[n[R]],u[4],s[R]),q=c(w,_,M,S,E,e[o[R]],h[4],a[R])),r=v,v=b,b=l(y,10),y=f,f=A,w=E,E=S,S=l(M,10),M=_,_=q}var C=this._b+y+S|0;this._b=this._c+b+E|0,this._c=this._d+v+w|0,this._d=this._e+r+_|0,this._e=this._a+f+M|0,this._a=C},f.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 t=e.alloc?e.alloc(20):new e(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},ripemd160$1=f}var sha_js={exports:{}},safeBuffer$7={exports:{}},hasRequiredSafeBuffer$7;function requireSafeBuffer$7(){return hasRequiredSafeBuffer$7||(hasRequiredSafeBuffer$7=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$7,safeBuffer$7.exports)),safeBuffer$7.exports}var safeBuffer$6={exports:{}},hasRequiredSafeBuffer$6,isarray$1,hasRequiredIsarray$1,typedArrayBuffer,hasRequiredTypedArrayBuffer,toBuffer,hasRequiredToBuffer$1,hash$1,hasRequiredHash$1,sha$1,hasRequiredSha$1,sha1$2,hasRequiredSha1$1,sha256$1,hasRequiredSha256,sha224$1,hasRequiredSha224,sha512$1,hasRequiredSha512,sha384$1,hasRequiredSha384,hasRequiredSha_js;function requireSafeBuffer$6(){return hasRequiredSafeBuffer$6||(hasRequiredSafeBuffer$6=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$6,safeBuffer$6.exports)),safeBuffer$6.exports}function requireIsarray$1(){if(hasRequiredIsarray$1)return isarray$1;hasRequiredIsarray$1=1;var e={}.toString;return isarray$1=Array.isArray||function(t){return"[object Array]"==e.call(t)}}function requireTypedArrayBuffer(){if(hasRequiredTypedArrayBuffer)return typedArrayBuffer;hasRequiredTypedArrayBuffer=1;var e=requireType(),t=requireCallBound()("TypedArray.prototype.buffer",!0),r=requireIsTypedArray();return typedArrayBuffer=t||function(t){if(!r(t))throw new e("Not a Typed Array");return t.buffer}}function requireToBuffer$1(){if(hasRequiredToBuffer$1)return toBuffer;hasRequiredToBuffer$1=1;var e=requireSafeBuffer$6().Buffer,t=requireIsarray$1(),r=requireTypedArrayBuffer(),i=ArrayBuffer.isView||function(e){try{return r(e),!0}catch(e){return!1}},n="undefined"!=typeof Uint8Array,o="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,s=o&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return toBuffer=function(r,a){if(r instanceof e)return r;if("string"==typeof r)return e.from(r,a);if(o&&i(r)){if(0===r.byteLength)return e.alloc(0);if(s){var u=e.from(r.buffer,r.byteOffset,r.byteLength);if(u.byteLength===r.byteLength)return u}var h=r instanceof Uint8Array?r:new Uint8Array(r.buffer,r.byteOffset,r.byteLength),f=e.from(h);if(f.length===r.byteLength)return f}if(n&&r instanceof Uint8Array)return e.from(r);var l=t(r);if(l)for(var c=0;c<r.length;c+=1){var d=r[c];if("number"!=typeof d||d<0||d>255||~~d!==d)throw new RangeError("Array items must be numbers in the range 0-255.")}if(l||e.isBuffer(r)&&r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r))return e.from(r);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}function requireHash$1(){if(hasRequiredHash$1)return hash$1;hasRequiredHash$1=1;var e=requireSafeBuffer$7().Buffer,t=requireToBuffer$1();function r(t,r){this._block=e.alloc(t),this._finalSize=r,this._blockSize=t,this._len=0}return r.prototype.update=function(e,r){e=t(e,r||"utf8");for(var i=this._block,n=this._blockSize,o=e.length,s=this._len,a=0;a<o;){for(var u=s%n,h=Math.min(o-a,n-u),f=0;f<h;f++)i[u+f]=e[a+f];a+=h,(s+=h)%n==0&&this._update(i)}return this._len+=o,this},r.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$1=r}function requireSha$1(){if(hasRequiredSha$1)return sha$1;hasRequiredSha$1=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$7().Buffer,i=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function o(){this.init(),this._w=n,t.call(this,64,56)}function s(e){return e<<30|e>>>2}function a(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}return e(o,t),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,u=0|this._c,h=0|this._d,f=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var c=0;c<80;++c){var d=~~(c/20),p=0|((t=n)<<5|t>>>27)+a(d,o,u,h)+f+r[c]+i[d];f=h,h=u,u=s(o),o=n,n=p}this._a=n+this._a|0,this._b=o+this._b|0,this._c=u+this._c|0,this._d=h+this._d|0,this._e=f+this._e|0},o.prototype._hash=function(){var e=r.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},sha$1=o}function requireSha1$1(){if(hasRequiredSha1$1)return sha1$2;hasRequiredSha1$1=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$7().Buffer,i=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function o(){this.init(),this._w=n,t.call(this,64,56)}function s(e){return e<<5|e>>>27}function a(e){return e<<30|e>>>2}function u(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}return e(o,t),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,h=0|this._c,f=0|this._d,l=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=(t=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|t>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=s(n)+u(p,o,h,f)+l+r[d]+i[p]|0;l=f,f=h,h=a(o),o=n,n=m}this._a=n+this._a|0,this._b=o+this._b|0,this._c=h+this._c|0,this._d=f+this._d|0,this._e=l+this._e|0},o.prototype._hash=function(){var e=r.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},sha1$2=o}function requireSha256(){if(hasRequiredSha256)return sha256$1;hasRequiredSha256=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$7().Buffer,i=[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],n=new Array(64);function o(){this.init(),this._w=n,t.call(this,64,56)}function s(e,t,r){return r^e&(t^r)}function a(e,t,r){return e&t|r&(e|t)}function u(e){return(e>>>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 f(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}return e(o,t),o.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},o.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,l=0|this._c,c=0|this._d,d=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,y=0;y<16;++y)r[y]=e.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((t=r[y-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[y-7]+f(r[y-15])+r[y-16];for(var b=0;b<64;++b){var v=g+h(d)+s(d,p,m)+i[b]+r[b]|0,w=u(n)+a(n,o,l)|0;g=m,m=p,p=d,d=c+v|0,c=l,l=o,o=n,n=v+w|0}this._a=n+this._a|0,this._b=o+this._b|0,this._c=l+this._c|0,this._d=c+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},o.prototype._hash=function(){var e=r.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},sha256$1=o}function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var e=requireInherits_browser(),t=requireSha256(),r=requireHash$1(),i=requireSafeBuffer$7().Buffer,n=new Array(64);function o(){this.init(),this._w=n,r.call(this,64,56)}return e(o,t),o.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},o.prototype._hash=function(){var e=i.allocUnsafe(28);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},sha224$1=o}function requireSha512(){if(hasRequiredSha512)return sha512$1;hasRequiredSha512=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$7().Buffer,i=[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],n=new Array(160);function o(){this.init(),this._w=n,t.call(this,128,112)}function s(e,t,r){return r^e&(t^r)}function a(e,t,r){return e&t|r&(e|t)}function u(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 f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function c(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function d(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function p(e,t){return e>>>0<t>>>0?1:0}return e(o,t),o.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},o.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,o=0|this._ch,m=0|this._dh,g=0|this._eh,y=0|this._fh,b=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,M=0|this._cl,S=0|this._dl,E=0|this._el,R=0|this._fl,A=0|this._gl,q=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 P=t[C-30],B=t[C-30+1],I=f(P,B),O=l(B,P),k=c(P=t[C-4],B=t[C-4+1]),T=d(B,P),N=t[C-14],x=t[C-14+1],j=t[C-32],$=t[C-32+1],D=O+x|0,U=I+N+p(D,O)|0;U=(U=U+k+p(D=D+T|0,T)|0)+j+p(D=D+$|0,$)|0,t[C]=U,t[C+1]=D}for(var L=0;L<160;L+=2){U=t[L],D=t[L+1];var F=a(r,n,o),z=a(w,_,M),K=u(r,w),W=u(w,r),H=h(g,E),G=h(E,g),J=i[L],V=i[L+1],Q=s(g,y,b),Z=s(E,R,A),Y=q+G|0,X=v+H+p(Y,q)|0;X=(X=(X=X+Q+p(Y=Y+Z|0,Z)|0)+J+p(Y=Y+V|0,V)|0)+U+p(Y=Y+D|0,D)|0;var ee=W+z|0,te=K+F+p(ee,W)|0;v=b,q=A,b=y,A=R,y=g,R=E,g=m+X+p(E=S+Y|0,S)|0,m=o,S=M,o=n,M=_,n=r,_=w,r=X+te+p(w=Y+ee|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+M|0,this._dl=this._dl+S|0,this._el=this._el+E|0,this._fl=this._fl+R|0,this._gl=this._gl+A|0,this._hl=this._hl+q|0,this._ah=this._ah+r+p(this._al,w)|0,this._bh=this._bh+n+p(this._bl,_)|0,this._ch=this._ch+o+p(this._cl,M)|0,this._dh=this._dh+m+p(this._dl,S)|0,this._eh=this._eh+g+p(this._el,E)|0,this._fh=this._fh+y+p(this._fl,R)|0,this._gh=this._gh+b+p(this._gl,A)|0,this._hh=this._hh+v+p(this._hl,q)|0},o.prototype._hash=function(){var e=r.allocUnsafe(64);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+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},sha512$1=o}function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var e=requireInherits_browser(),t=requireSha512(),r=requireHash$1(),i=requireSafeBuffer$7().Buffer,n=new Array(160);function o(){this.init(),this._w=n,r.call(this,128,112)}return e(o,t),o.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},o.prototype._hash=function(){var e=i.allocUnsafe(48);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+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),e},sha384$1=o}function requireSha_js(){return hasRequiredSha_js||(hasRequiredSha_js=1,(e=sha_js).exports=function(t){var r=t.toLowerCase(),i=e.exports[r];if(!i)throw new Error(r+" is not supported (we accept pull requests)");return new i},e.exports.sha=requireSha$1(),e.exports.sha1=requireSha1$1(),e.exports.sha224=requireSha224(),e.exports.sha256=requireSha256(),e.exports.sha384=requireSha384(),e.exports.sha512=requireSha512()),sha_js.exports;var e}var safeBuffer$5={exports:{}},hasRequiredSafeBuffer$5,cipherBase,hasRequiredCipherBase,browser$b,hasRequiredBrowser$a,legacy,hasRequiredLegacy,md5$3,hasRequiredMd5$2,browser$a,hasRequiredBrowser$9;function requireSafeBuffer$5(){return hasRequiredSafeBuffer$5||(hasRequiredSafeBuffer$5=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$5,safeBuffer$5.exports)),safeBuffer$5.exports}function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var e=requireSafeBuffer$5().Buffer,t=requireStreamBrowserify().Transform,r=requireString_decoder().StringDecoder;function i(e){t.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}requireInherits_browser()(i,t);var n="undefined"!=typeof Uint8Array,o="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&ArrayBuffer.isView&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return i.prototype.update=function(t,r,i){var s=function(t,r){if(t instanceof e)return t;if("string"==typeof t)return e.from(t,r);if(o&&ArrayBuffer.isView(t)){if(0===t.byteLength)return e.alloc(0);var i=e.from(t.buffer,t.byteOffset,t.byteLength);if(i.byteLength===t.byteLength)return i}if(n&&t instanceof Uint8Array)return e.from(t);if(e.isBuffer(t)&&t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))return e.from(t);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}(t,r),a=this._update(s);return this.hashMode?this:(i&&(a=this._toString(a,i)),a)},i.prototype.setAutoPadding=function(){},i.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},i.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},i.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},i.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},i.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},i.prototype._finalOrDigest=function(t){var r=this.__final()||e.alloc(0);return t&&(r=this._toString(r,t,!0)),r},i.prototype._toString=function(e,t,i){if(this._decoder||(this._decoder=new r(t),this._encoding=t),this._encoding!==t)throw new Error("can’t switch encodings");var n=this._decoder.write(e);return i&&(n+=this._decoder.end()),n},cipherBase=i}function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$b;hasRequiredBrowser$a=1;var e=requireInherits_browser(),t=requireMd5_js(),r=requireRipemd160$1(),i=requireSha_js(),n=requireCipherBase();function o(e){n.call(this,"digest"),this._hash=e}return e(o,n),o.prototype._update=function(e){this._hash.update(e)},o.prototype._final=function(){return this._hash.digest()},browser$b=function(e){return"md5"===(e=e.toLowerCase())?new t:"rmd160"===e||"ripemd160"===e?new r:new o(i(e))}}function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var e=requireInherits_browser(),t=requireSafeBuffer$9().Buffer,r=requireCipherBase(),i=t.alloc(128),n=64;function o(e,o){r.call(this,"digest"),"string"==typeof o&&(o=t.from(o)),this._alg=e,this._key=o,o.length>n?o=e(o):o.length<n&&(o=t.concat([o,i],n));for(var s=this._ipad=t.allocUnsafe(n),a=this._opad=t.allocUnsafe(n),u=0;u<n;u++)s[u]=54^o[u],a[u]=92^o[u];this._hash=[s]}return e(o,r),o.prototype._update=function(e){this._hash.push(e)},o.prototype._final=function(){var e=this._alg(t.concat(this._hash));return this._alg(t.concat([this._opad,e]))},legacy=o}function requireMd5$2(){if(hasRequiredMd5$2)return md5$3;hasRequiredMd5$2=1;var e=requireMd5_js();return md5$3=function(t){return(new e).update(t).digest()}}function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$a;hasRequiredBrowser$9=1;var e=requireInherits_browser(),t=requireLegacy(),r=requireCipherBase(),i=requireSafeBuffer$9().Buffer,n=requireMd5$2(),o=requireRipemd160$1(),s=requireSha_js(),a=i.alloc(128);function u(e,t){r.call(this,"digest"),"string"==typeof t&&(t=i.from(t));var n="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>n)?t=("rmd160"===e?new o:s(e)).update(t).digest():t.length<n&&(t=i.concat([t,a],n));for(var u=this._ipad=i.allocUnsafe(n),h=this._opad=i.allocUnsafe(n),f=0;f<n;f++)u[f]=54^t[f],h[f]=92^t[f];this._hash="rmd160"===e?new o:s(e),this._hash.update(u)}return e(u,r),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new o:s(this._alg)).update(this._opad).update(e).digest()},browser$a=function(e,r){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new u("rmd160",r):"md5"===e?new t(n,r):new u(e,r)}}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},sha256={sign:"ecdsa",hash:"sha256",id:""},sha224={sign:"ecdsa",hash:"sha224",id:""},sha384={sign:"ecdsa",hash:"sha384",id:""},sha512={sign:"ecdsa",hash:"sha512",id:""},DSA={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption:sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:sha512WithRSAEncryption,"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:sha256,sha224:sha224,sha384:sha384,sha512:sha512,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:DSA,"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:ripemd160WithRSA,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos?algos:(hasRequiredAlgos=1,algos=require$$6)}var browser$9={},safeBuffer$4={exports:{}},hasRequiredSafeBuffer$4,precondition,hasRequiredPrecondition,defaultEncoding_1,hasRequiredDefaultEncoding,makeHash,hasRequiredMakeHash,md5$2,hasRequiredMd5$1,hashBase,hasRequiredHashBase,ripemd160,hasRequiredRipemd160,toBuffer_1,hasRequiredToBuffer,syncBrowser,hasRequiredSyncBrowser,async,hasRequiredAsync,hasRequiredBrowser$8;function requireSafeBuffer$4(){return hasRequiredSafeBuffer$4||(hasRequiredSafeBuffer$4=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$4,safeBuffer$4.exports)),safeBuffer$4.exports}function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var e=Math.pow(2,30)-1;return precondition=function(t,r){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>e||r!=r)throw new TypeError("Bad key length")}}function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;var e;if(hasRequiredDefaultEncoding=1,commonjsGlobal.process&&commonjsGlobal.process.browser)e="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){e=parseInt(process$1.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else e="utf-8";return defaultEncoding_1=e}function requireMakeHash(){if(hasRequiredMakeHash)return makeHash;hasRequiredMakeHash=1;var e=new Buffer(4);e.fill(0);return makeHash=function(t,r){var i=r(function(t){if(t.length%4!=0){var r=t.length+(4-t.length%4);t=Buffer.concat([t,e],r)}for(var i=new Array(t.length>>>2),n=0,o=0;n<t.length;n+=4,o++)i[o]=t.readInt32LE(n);return i}(t),8*t.length);t=new Buffer(16);for(var n=0;n<i.length;n++)t.writeInt32LE(i[n],n<<2,!0);return t}}function requireMd5$1(){if(hasRequiredMd5$1)return md5$2;hasRequiredMd5$1=1;var e=requireMakeHash();function t(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,u=-271733879,h=-1732584194,f=271733878,l=0;l<e.length;l+=16){var c=r,d=u,p=h,m=f;r=i(r,u,h,f,e[l+0],7,-680876936),f=i(f,r,u,h,e[l+1],12,-389564586),h=i(h,f,r,u,e[l+2],17,606105819),u=i(u,h,f,r,e[l+3],22,-1044525330),r=i(r,u,h,f,e[l+4],7,-176418897),f=i(f,r,u,h,e[l+5],12,1200080426),h=i(h,f,r,u,e[l+6],17,-1473231341),u=i(u,h,f,r,e[l+7],22,-45705983),r=i(r,u,h,f,e[l+8],7,1770035416),f=i(f,r,u,h,e[l+9],12,-1958414417),h=i(h,f,r,u,e[l+10],17,-42063),u=i(u,h,f,r,e[l+11],22,-1990404162),r=i(r,u,h,f,e[l+12],7,1804603682),f=i(f,r,u,h,e[l+13],12,-40341101),h=i(h,f,r,u,e[l+14],17,-1502002290),r=n(r,u=i(u,h,f,r,e[l+15],22,1236535329),h,f,e[l+1],5,-165796510),f=n(f,r,u,h,e[l+6],9,-1069501632),h=n(h,f,r,u,e[l+11],14,643717713),u=n(u,h,f,r,e[l+0],20,-373897302),r=n(r,u,h,f,e[l+5],5,-701558691),f=n(f,r,u,h,e[l+10],9,38016083),h=n(h,f,r,u,e[l+15],14,-660478335),u=n(u,h,f,r,e[l+4],20,-405537848),r=n(r,u,h,f,e[l+9],5,568446438),f=n(f,r,u,h,e[l+14],9,-1019803690),h=n(h,f,r,u,e[l+3],14,-187363961),u=n(u,h,f,r,e[l+8],20,1163531501),r=n(r,u,h,f,e[l+13],5,-1444681467),f=n(f,r,u,h,e[l+2],9,-51403784),h=n(h,f,r,u,e[l+7],14,1735328473),r=o(r,u=n(u,h,f,r,e[l+12],20,-1926607734),h,f,e[l+5],4,-378558),f=o(f,r,u,h,e[l+8],11,-2022574463),h=o(h,f,r,u,e[l+11],16,1839030562),u=o(u,h,f,r,e[l+14],23,-35309556),r=o(r,u,h,f,e[l+1],4,-1530992060),f=o(f,r,u,h,e[l+4],11,1272893353),h=o(h,f,r,u,e[l+7],16,-155497632),u=o(u,h,f,r,e[l+10],23,-1094730640),r=o(r,u,h,f,e[l+13],4,681279174),f=o(f,r,u,h,e[l+0],11,-358537222),h=o(h,f,r,u,e[l+3],16,-722521979),u=o(u,h,f,r,e[l+6],23,76029189),r=o(r,u,h,f,e[l+9],4,-640364487),f=o(f,r,u,h,e[l+12],11,-421815835),h=o(h,f,r,u,e[l+15],16,530742520),r=s(r,u=o(u,h,f,r,e[l+2],23,-995338651),h,f,e[l+0],6,-198630844),f=s(f,r,u,h,e[l+7],10,1126891415),h=s(h,f,r,u,e[l+14],15,-1416354905),u=s(u,h,f,r,e[l+5],21,-57434055),r=s(r,u,h,f,e[l+12],6,1700485571),f=s(f,r,u,h,e[l+3],10,-1894986606),h=s(h,f,r,u,e[l+10],15,-1051523),u=s(u,h,f,r,e[l+1],21,-2054922799),r=s(r,u,h,f,e[l+8],6,1873313359),f=s(f,r,u,h,e[l+15],10,-30611744),h=s(h,f,r,u,e[l+6],15,-1560198380),u=s(u,h,f,r,e[l+13],21,1309151649),r=s(r,u,h,f,e[l+4],6,-145523070),f=s(f,r,u,h,e[l+11],10,-1120210379),h=s(h,f,r,u,e[l+2],15,718787259),u=s(u,h,f,r,e[l+9],21,-343485551),r=a(r,c),u=a(u,d),h=a(h,p),f=a(f,m)}return[r,u,h,f]}function r(e,t,r,i,n,o){return a((s=a(a(t,e),a(i,o)))<<(u=n)|s>>>32-u,r);var s,u}function i(e,t,i,n,o,s,a){return r(t&i|~t&n,e,t,o,s,a)}function n(e,t,i,n,o,s,a){return r(t&n|i&~n,e,t,o,s,a)}function o(e,t,i,n,o,s,a){return r(t^i^n,e,t,o,s,a)}function s(e,t,i,n,o,s,a){return r(i^(t|~n),e,t,o,s,a)}function a(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}return md5$2=function(r){return e(r,t)}}function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var e=requireStreamBrowserify().Transform;function t(t){e.call(this),this._block=new Buffer(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return requireInherits_browser()(t,e),t.prototype._transform=function(e,t,r){var i=null;try{"buffer"!==t&&(e=new Buffer(e,t)),this.update(e)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this._digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(e)||(e=new Buffer(e,t||"binary"));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)r[n++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var o=0,s=8*e.length;s>0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},t.prototype._update=function(e){throw new Error("_update is not implemented")},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return void 0!==e&&(t=t.toString(e)),t},t.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=t}function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var e=requireInherits_browser(),t=requireHashBase();function r(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function i(e,t){return e<<t|e>>>32-t}function n(e,t,r,n,o,s,a,u){return i(e+(t^r^n)+s+a|0,u)+o|0}function o(e,t,r,n,o,s,a,u){return i(e+(t&r|~t&n)+s+a|0,u)+o|0}function s(e,t,r,n,o,s,a,u){return i(e+((t|~r)^n)+s+a|0,u)+o|0}function a(e,t,r,n,o,s,a,u){return i(e+(t&n|r&~n)+s+a|0,u)+o|0}function u(e,t,r,n,o,s,a,u){return i(e+(t^(r|~n))+s+a|0,u)+o|0}return e(r,t),r.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,h=this._b,f=this._c,l=this._d,c=this._e;r=n(r,h,f,l,c,e[0],0,11),c=n(c,r,h,f=i(f,10),l,e[1],0,14),l=n(l,c,r,h=i(h,10),f,e[2],0,15),f=n(f,l,c,r=i(r,10),h,e[3],0,12),h=n(h,f,l,c=i(c,10),r,e[4],0,5),r=n(r,h,f,l=i(l,10),c,e[5],0,8),c=n(c,r,h,f=i(f,10),l,e[6],0,7),l=n(l,c,r,h=i(h,10),f,e[7],0,9),f=n(f,l,c,r=i(r,10),h,e[8],0,11),h=n(h,f,l,c=i(c,10),r,e[9],0,13),r=n(r,h,f,l=i(l,10),c,e[10],0,14),c=n(c,r,h,f=i(f,10),l,e[11],0,15),l=n(l,c,r,h=i(h,10),f,e[12],0,6),f=n(f,l,c,r=i(r,10),h,e[13],0,7),h=n(h,f,l,c=i(c,10),r,e[14],0,9),c=o(c,r=n(r,h,f,l=i(l,10),c,e[15],0,8),h,f=i(f,10),l,e[7],1518500249,7),l=o(l,c,r,h=i(h,10),f,e[4],1518500249,6),f=o(f,l,c,r=i(r,10),h,e[13],1518500249,8),h=o(h,f,l,c=i(c,10),r,e[1],1518500249,13),r=o(r,h,f,l=i(l,10),c,e[10],1518500249,11),c=o(c,r,h,f=i(f,10),l,e[6],1518500249,9),l=o(l,c,r,h=i(h,10),f,e[15],1518500249,7),f=o(f,l,c,r=i(r,10),h,e[3],1518500249,15),h=o(h,f,l,c=i(c,10),r,e[12],1518500249,7),r=o(r,h,f,l=i(l,10),c,e[0],1518500249,12),c=o(c,r,h,f=i(f,10),l,e[9],1518500249,15),l=o(l,c,r,h=i(h,10),f,e[5],1518500249,9),f=o(f,l,c,r=i(r,10),h,e[2],1518500249,11),h=o(h,f,l,c=i(c,10),r,e[14],1518500249,7),r=o(r,h,f,l=i(l,10),c,e[11],1518500249,13),l=s(l,c=o(c,r,h,f=i(f,10),l,e[8],1518500249,12),r,h=i(h,10),f,e[3],1859775393,11),f=s(f,l,c,r=i(r,10),h,e[10],1859775393,13),h=s(h,f,l,c=i(c,10),r,e[14],1859775393,6),r=s(r,h,f,l=i(l,10),c,e[4],1859775393,7),c=s(c,r,h,f=i(f,10),l,e[9],1859775393,14),l=s(l,c,r,h=i(h,10),f,e[15],1859775393,9),f=s(f,l,c,r=i(r,10),h,e[8],1859775393,13),h=s(h,f,l,c=i(c,10),r,e[1],1859775393,15),r=s(r,h,f,l=i(l,10),c,e[2],1859775393,14),c=s(c,r,h,f=i(f,10),l,e[7],1859775393,8),l=s(l,c,r,h=i(h,10),f,e[0],1859775393,13),f=s(f,l,c,r=i(r,10),h,e[6],1859775393,6),h=s(h,f,l,c=i(c,10),r,e[13],1859775393,5),r=s(r,h,f,l=i(l,10),c,e[11],1859775393,12),c=s(c,r,h,f=i(f,10),l,e[5],1859775393,7),f=a(f,l=s(l,c,r,h=i(h,10),f,e[12],1859775393,5),c,r=i(r,10),h,e[1],2400959708,11),h=a(h,f,l,c=i(c,10),r,e[9],2400959708,12),r=a(r,h,f,l=i(l,10),c,e[11],2400959708,14),c=a(c,r,h,f=i(f,10),l,e[10],2400959708,15),l=a(l,c,r,h=i(h,10),f,e[0],2400959708,14),f=a(f,l,c,r=i(r,10),h,e[8],2400959708,15),h=a(h,f,l,c=i(c,10),r,e[12],2400959708,9),r=a(r,h,f,l=i(l,10),c,e[4],2400959708,8),c=a(c,r,h,f=i(f,10),l,e[13],2400959708,9),l=a(l,c,r,h=i(h,10),f,e[3],2400959708,14),f=a(f,l,c,r=i(r,10),h,e[7],2400959708,5),h=a(h,f,l,c=i(c,10),r,e[15],2400959708,6),r=a(r,h,f,l=i(l,10),c,e[14],2400959708,8),c=a(c,r,h,f=i(f,10),l,e[5],2400959708,6),l=a(l,c,r,h=i(h,10),f,e[6],2400959708,5),h=u(h,f=a(f,l,c,r=i(r,10),h,e[2],2400959708,12),l,c=i(c,10),r,e[4],2840853838,9),r=u(r,h,f,l=i(l,10),c,e[0],2840853838,15),c=u(c,r,h,f=i(f,10),l,e[5],2840853838,5),l=u(l,c,r,h=i(h,10),f,e[9],2840853838,11),f=u(f,l,c,r=i(r,10),h,e[7],2840853838,6),h=u(h,f,l,c=i(c,10),r,e[12],2840853838,8),r=u(r,h,f,l=i(l,10),c,e[2],2840853838,13),c=u(c,r,h,f=i(f,10),l,e[10],2840853838,12),l=u(l,c,r,h=i(h,10),f,e[14],2840853838,5),f=u(f,l,c,r=i(r,10),h,e[1],2840853838,12),h=u(h,f,l,c=i(c,10),r,e[3],2840853838,13),r=u(r,h,f,l=i(l,10),c,e[8],2840853838,14),c=u(c,r,h,f=i(f,10),l,e[11],2840853838,11),l=u(l,c,r,h=i(h,10),f,e[6],2840853838,8),f=u(f,l,c,r=i(r,10),h,e[15],2840853838,5),h=u(h,f,l,c=i(c,10),r,e[13],2840853838,6),l=i(l,10);var d=this._a,p=this._b,m=this._c,g=this._d,y=this._e;d=u(d,p,m,g,y,e[5],1352829926,8),y=u(y,d,p,m=i(m,10),g,e[14],1352829926,9),g=u(g,y,d,p=i(p,10),m,e[7],1352829926,9),m=u(m,g,y,d=i(d,10),p,e[0],1352829926,11),p=u(p,m,g,y=i(y,10),d,e[9],1352829926,13),d=u(d,p,m,g=i(g,10),y,e[2],1352829926,15),y=u(y,d,p,m=i(m,10),g,e[11],1352829926,15),g=u(g,y,d,p=i(p,10),m,e[4],1352829926,5),m=u(m,g,y,d=i(d,10),p,e[13],1352829926,7),p=u(p,m,g,y=i(y,10),d,e[6],1352829926,7),d=u(d,p,m,g=i(g,10),y,e[15],1352829926,8),y=u(y,d,p,m=i(m,10),g,e[8],1352829926,11),g=u(g,y,d,p=i(p,10),m,e[1],1352829926,14),m=u(m,g,y,d=i(d,10),p,e[10],1352829926,14),p=u(p,m,g,y=i(y,10),d,e[3],1352829926,12),y=a(y,d=u(d,p,m,g=i(g,10),y,e[12],1352829926,6),p,m=i(m,10),g,e[6],1548603684,9),g=a(g,y,d,p=i(p,10),m,e[11],1548603684,13),m=a(m,g,y,d=i(d,10),p,e[3],1548603684,15),p=a(p,m,g,y=i(y,10),d,e[7],1548603684,7),d=a(d,p,m,g=i(g,10),y,e[0],1548603684,12),y=a(y,d,p,m=i(m,10),g,e[13],1548603684,8),g=a(g,y,d,p=i(p,10),m,e[5],1548603684,9),m=a(m,g,y,d=i(d,10),p,e[10],1548603684,11),p=a(p,m,g,y=i(y,10),d,e[14],1548603684,7),d=a(d,p,m,g=i(g,10),y,e[15],1548603684,7),y=a(y,d,p,m=i(m,10),g,e[8],1548603684,12),g=a(g,y,d,p=i(p,10),m,e[12],1548603684,7),m=a(m,g,y,d=i(d,10),p,e[4],1548603684,6),p=a(p,m,g,y=i(y,10),d,e[9],1548603684,15),d=a(d,p,m,g=i(g,10),y,e[1],1548603684,13),g=s(g,y=a(y,d,p,m=i(m,10),g,e[2],1548603684,11),d,p=i(p,10),m,e[15],1836072691,9),m=s(m,g,y,d=i(d,10),p,e[5],1836072691,7),p=s(p,m,g,y=i(y,10),d,e[1],1836072691,15),d=s(d,p,m,g=i(g,10),y,e[3],1836072691,11),y=s(y,d,p,m=i(m,10),g,e[7],1836072691,8),g=s(g,y,d,p=i(p,10),m,e[14],1836072691,6),m=s(m,g,y,d=i(d,10),p,e[6],1836072691,6),p=s(p,m,g,y=i(y,10),d,e[9],1836072691,14),d=s(d,p,m,g=i(g,10),y,e[11],1836072691,12),y=s(y,d,p,m=i(m,10),g,e[8],1836072691,13),g=s(g,y,d,p=i(p,10),m,e[12],1836072691,5),m=s(m,g,y,d=i(d,10),p,e[2],1836072691,14),p=s(p,m,g,y=i(y,10),d,e[10],1836072691,13),d=s(d,p,m,g=i(g,10),y,e[0],1836072691,13),y=s(y,d,p,m=i(m,10),g,e[4],1836072691,7),m=o(m,g=s(g,y,d,p=i(p,10),m,e[13],1836072691,5),y,d=i(d,10),p,e[8],2053994217,15),p=o(p,m,g,y=i(y,10),d,e[6],2053994217,5),d=o(d,p,m,g=i(g,10),y,e[4],2053994217,8),y=o(y,d,p,m=i(m,10),g,e[1],2053994217,11),g=o(g,y,d,p=i(p,10),m,e[3],2053994217,14),m=o(m,g,y,d=i(d,10),p,e[11],2053994217,14),p=o(p,m,g,y=i(y,10),d,e[15],2053994217,6),d=o(d,p,m,g=i(g,10),y,e[0],2053994217,14),y=o(y,d,p,m=i(m,10),g,e[5],2053994217,6),g=o(g,y,d,p=i(p,10),m,e[12],2053994217,9),m=o(m,g,y,d=i(d,10),p,e[2],2053994217,12),p=o(p,m,g,y=i(y,10),d,e[13],2053994217,9),d=o(d,p,m,g=i(g,10),y,e[9],2053994217,12),y=o(y,d,p,m=i(m,10),g,e[7],2053994217,5),g=o(g,y,d,p=i(p,10),m,e[10],2053994217,15),p=n(p,m=o(m,g,y,d=i(d,10),p,e[14],2053994217,8),g,y=i(y,10),d,e[12],0,8),d=n(d,p,m,g=i(g,10),y,e[15],0,5),y=n(y,d,p,m=i(m,10),g,e[10],0,12),g=n(g,y,d,p=i(p,10),m,e[4],0,9),m=n(m,g,y,d=i(d,10),p,e[1],0,12),p=n(p,m,g,y=i(y,10),d,e[5],0,5),d=n(d,p,m,g=i(g,10),y,e[8],0,14),y=n(y,d,p,m=i(m,10),g,e[7],0,6),g=n(g,y,d,p=i(p,10),m,e[6],0,8),m=n(m,g,y,d=i(d,10),p,e[2],0,13),p=n(p,m,g,y=i(y,10),d,e[13],0,6),d=n(d,p,m,g=i(g,10),y,e[14],0,5),y=n(y,d,p,m=i(m,10),g,e[0],0,15),g=n(g,y,d,p=i(p,10),m,e[3],0,13),m=n(m,g,y,d=i(d,10),p,e[9],0,11),p=n(p,m,g,y=i(y,10),d,e[11],0,11),g=i(g,10);var b=this._b+f+g|0;this._b=this._c+l+y|0,this._c=this._d+c+d|0,this._d=this._e+r+p|0,this._e=this._a+h+m|0,this._a=b},r.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=new Buffer(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},ripemd160=r}function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer_1;hasRequiredToBuffer=1;var e=requireSafeBuffer$4().Buffer,t=requireToBuffer$1(),r="undefined"!=typeof Uint8Array,i=r&&"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView;return toBuffer_1=function(n,o,s){if("string"==typeof n||e.isBuffer(n)||r&&n instanceof Uint8Array||i&&i(n))return t(n,o);throw new TypeError(s+" must be a string, a Buffer, a Uint8Array, or a DataView")}}function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var e=requireMd5$1(),t=requireRipemd160(),r=requireSha_js(),i=requireSafeBuffer$4().Buffer,n=requirePrecondition(),o=requireDefaultEncoding(),s=requireToBuffer(),a=i.alloc(128),u={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},h={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function f(e){return(new t).update(e).digest()}function l(t,n,o){var s=function(t){return"rmd160"===t||"ripemd160"===t?f:"md5"===t?e:function(e){return r(t).update(e).digest()}}(t),h="sha512"===t||"sha384"===t?128:64;n.length>h?n=s(n):n.length<h&&(n=i.concat([n,a],h));for(var l=i.allocUnsafe(h+u[t]),c=i.allocUnsafe(h+u[t]),d=0;d<h;d++)l[d]=54^n[d],c[d]=92^n[d];var p=i.allocUnsafe(h+o+4);l.copy(p,0,0,h),this.ipad1=p,this.ipad2=l,this.opad=c,this.alg=t,this.blocksize=h,this.hash=s,this.size=u[t]}return l.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},syncBrowser=function(e,t,r,a,f){n(r,a),e=s(e,o,"Password"),t=s(t,o,"Salt");var c=(f||"sha1").toLowerCase(),d=h[c]||c,p=u[d];if("number"!=typeof p||!p)throw new TypeError("Digest algorithm not supported: "+f);var m=new l(d,e,t.length),g=i.allocUnsafe(a),y=i.allocUnsafe(t.length+4);t.copy(y,0,0,t.length);for(var b=0,v=p,w=Math.ceil(a/v),_=1;_<=w;_++){y.writeUInt32BE(_,t.length);for(var M=m.run(y,m.ipad1),S=M,E=1;E<r;E++){S=m.run(S,m.ipad2);for(var R=0;R<v;R++)M[R]^=S[R]}M.copy(g,b),b+=v}return g}}function requireAsync(){if(hasRequiredAsync)return async;hasRequiredAsync=1;var e,t,r=requireSafeBuffer$4().Buffer,i=requirePrecondition(),n=requireDefaultEncoding(),o=requireSyncBrowser(),s=requireToBuffer(),a=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,u={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function f(){return t||(t=commonjsGlobal.process&&commonjsGlobal.process.nextTick?commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?commonjsGlobal.setImmediate:commonjsGlobal.setTimeout)}function l(e,t,i,n,o){return a.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return a.deriveBits({name:"PBKDF2",salt:t,iterations:i,hash:{name:o}},e,n<<3)})).then((function(e){return r.from(e)}))}return async=function(t,c,d,p,m,g){"function"==typeof m&&(g=m,m=void 0);var y=u[(m=m||"sha1").toLowerCase()];if(y&&"function"==typeof commonjsGlobal.Promise){if(i(d,p),t=s(t,n,"Password"),c=s(c,n,"Salt"),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){f()((function(){t(null,e)}))}),(function(e){f()((function(){t(e)}))}))}(function(t){if(commonjsGlobal.process&&!commonjsGlobal.process.browser)return Promise.resolve(!1);if(!a||!a.importKey||!a.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var i=l(e=e||r.alloc(8),e,10,128,t).then((function(){return!0}),(function(){return!1}));return h[t]=i,i}(y).then((function(e){return e?l(t,c,d,p,y):o(t,c,d,p,m)})),g)}else f()((function(){var e;try{e=o(t,c,d,p,m)}catch(e){return void g(e)}g(null,e)}))}}function requireBrowser$8(){return hasRequiredBrowser$8||(hasRequiredBrowser$8=1,browser$9.pbkdf2=requireAsync(),browser$9.pbkdf2Sync=requireSyncBrowser()),browser$9}var browser$8={},des$1={},utils$3={},hasRequiredUtils$3,minimalisticAssert,hasRequiredMinimalisticAssert,cipher,hasRequiredCipher,des,hasRequiredDes$1;function requireUtils$3(){if(hasRequiredUtils$3)return utils$3;hasRequiredUtils$3=1,utils$3.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},utils$3.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},utils$3.ip=function(e,t,r,i){for(var n=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)n<<=1,n|=t>>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=e>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1}r[i+0]=n>>>0,r[i+1]=o>>>0},utils$3.rip=function(e,t,r,i){for(var n=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)n<<=1,n|=t>>>a+s&1,n<<=1,n|=e>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=t>>>a+s&1,o<<=1,o|=e>>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},utils$3.pc1=function(e,t,r,i){for(var n=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)n<<=1,n|=t>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=e>>a+s&1}for(a=0;a<=24;a+=8)n<<=1,n|=t>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},utils$3.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var e=[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];utils$3.pc2=function(t,r,i,n){for(var o=0,s=0,a=e.length>>>1,u=0;u<a;u++)o<<=1,o|=t>>>e[u]&1;for(u=a;u<e.length;u++)s<<=1,s|=r>>>e[u]&1;i[n+0]=o>>>0,i[n+1]=s>>>0},utils$3.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=e>>>o&63;for(o=11;o>=3;o-=4)n|=e>>>o&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var t=[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];utils$3.substitute=function(e,r){for(var i=0,n=0;n<4;n++){i<<=4,i|=t[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){i<<=4,i|=t[256+64*n+(r>>>18-6*n&63)]}return i>>>0};var r=[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];return utils$3.permute=function(e){for(var t=0,i=0;i<r.length;i++)t<<=1,t|=e>>>r[i]&1;return t>>>0},utils$3.padSplit=function(e,t,r){for(var i=e.toString(2);i.length<t;)i="0"+i;for(var n=[],o=0;o<t;o+=r)n.push(i.slice(o,o+r));return n.join(" ")},utils$3}function requireMinimalisticAssert(){if(hasRequiredMinimalisticAssert)return minimalisticAssert;function e(e,t){if(!e)throw new Error(t||"Assertion failed")}return hasRequiredMinimalisticAssert=1,minimalisticAssert=e,e.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)},minimalisticAssert}function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var e=requireMinimalisticAssert();function t(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}return cipher=t,t.prototype._init=function(){},t.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},t.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),i=0;i<r;i++)this.buffer[this.bufferOff+i]=e[t+i];return this.bufferOff+=r,r},t.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},t.prototype._updateEncrypt=function(e){var t=0,r=0,i=(this.bufferOff+e.length)/this.blockSize|0,n=new Array(i*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(n,r)));for(var o=e.length-(e.length-t)%this.blockSize;t<o;t+=this.blockSize)this._update(e,t,n,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return n},t.prototype._updateDecrypt=function(e){for(var t=0,r=0,i=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,n=new Array(i*this.blockSize);i>0;i--)t+=this._buffer(e,t),r+=this._flushBuffer(n,r);return t+=this._buffer(e,t),n},t.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},t.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},t.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},t.prototype._unpad=function(e){return e},t.prototype._finalDecrypt=function(){e.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)},cipher}function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var e=requireMinimalisticAssert(),t=requireInherits_browser(),r=requireUtils$3(),i=requireCipher();function n(){this.tmp=new Array(2),this.keys=null}function o(e){i.call(this,e);var t=new n;this._desState=t,this.deriveKeys(t,e.key)}t(o,i),des=o,o.create=function(e){return new o(e)};var s=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return o.prototype.deriveKeys=function(t,i){t.keys=new Array(32),e.equal(i.length,this.blockSize,"Invalid key length");var n=r.readUInt32BE(i,0),o=r.readUInt32BE(i,4);r.pc1(n,o,t.tmp,0),n=t.tmp[0],o=t.tmp[1];for(var a=0;a<t.keys.length;a+=2){var u=s[a>>>1];n=r.r28shl(n,u),o=r.r28shl(o,u),r.pc2(n,o,t.keys,a)}},o.prototype._update=function(e,t,i,n){var o=this._desState,s=r.readUInt32BE(e,t),a=r.readUInt32BE(e,t+4);r.ip(s,a,o.tmp,0),s=o.tmp[0],a=o.tmp[1],"encrypt"===this.type?this._encrypt(o,s,a,o.tmp,0):this._decrypt(o,s,a,o.tmp,0),s=o.tmp[0],a=o.tmp[1],r.writeUInt32BE(i,s,n),r.writeUInt32BE(i,a,n+4)},o.prototype._pad=function(e,t){if(!1===this.padding)return!1;for(var r=e.length-t,i=t;i<e.length;i++)e[i]=r;return!0},o.prototype._unpad=function(t){if(!1===this.padding)return t;for(var r=t[t.length-1],i=t.length-r;i<t.length;i++)e.equal(t[i],r);return t.slice(0,t.length-r)},o.prototype._encrypt=function(e,t,i,n,o){for(var s=t,a=i,u=0;u<e.keys.length;u+=2){var h=e.keys[u],f=e.keys[u+1];r.expand(a,e.tmp,0),h^=e.tmp[0],f^=e.tmp[1];var l=r.substitute(h,f),c=a;a=(s^r.permute(l))>>>0,s=c}r.rip(a,s,n,o)},o.prototype._decrypt=function(e,t,i,n,o){for(var s=i,a=t,u=e.keys.length-2;u>=0;u-=2){var h=e.keys[u],f=e.keys[u+1];r.expand(s,e.tmp,0),h^=e.tmp[0],f^=e.tmp[1];var l=r.substitute(h,f),c=s;s=(a^r.permute(l))>>>0,a=c}r.rip(s,a,n,o)},des}var cbc$1={},hasRequiredCbc$1,ede,hasRequiredEde,hasRequiredDes,browserifyDes,hasRequiredBrowserifyDes;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var e=requireMinimalisticAssert(),t=requireInherits_browser(),r={};function i(t){e.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var r=0;r<this.iv.length;r++)this.iv[r]=t[r]}return cbc$1.instantiate=function(e){function i(t){e.call(this,t),this._cbcInit()}t(i,e);for(var n=Object.keys(r),o=0;o<n.length;o++){var s=n[o];i.prototype[s]=r[s]}return i.create=function(e){return new i(e)},i},r._cbcInit=function(){var e=new i(this.options.iv);this._cbcState=e},r._update=function(e,t,r,i){var n=this._cbcState,o=this.constructor.super_.prototype,s=n.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=e[t+a];o._update.call(this,s,0,r,i);for(a=0;a<this.blockSize;a++)s[a]=r[i+a]}else{o._update.call(this,e,t,r,i);for(a=0;a<this.blockSize;a++)r[i+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=e[t+a]}},cbc$1}function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var e=requireMinimalisticAssert(),t=requireInherits_browser(),r=requireCipher(),i=requireDes$1();function n(t,r){e.equal(r.length,24,"Invalid key length");var n=r.slice(0,8),o=r.slice(8,16),s=r.slice(16,24);this.ciphers="encrypt"===t?[i.create({type:"encrypt",key:n}),i.create({type:"decrypt",key:o}),i.create({type:"encrypt",key:s})]:[i.create({type:"decrypt",key:s}),i.create({type:"encrypt",key:o}),i.create({type:"decrypt",key:n})]}function o(e){r.call(this,e);var t=new n(this.type,this.options.key);this._edeState=t}return t(o,r),ede=o,o.create=function(e){return new o(e)},o.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},o.prototype._pad=i.prototype._pad,o.prototype._unpad=i.prototype._unpad,ede}function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils$3(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var e=requireCipherBase(),t=requireDes(),r=requireInherits_browser(),i=requireSafeBuffer$9().Buffer,n={"des-ede3-cbc":t.CBC.instantiate(t.EDE),"des-ede3":t.EDE,"des-ede-cbc":t.CBC.instantiate(t.EDE),"des-ede":t.EDE,"des-cbc":t.CBC.instantiate(t.DES),"des-ecb":t.DES};function o(t){e.call(this);var r,o=t.mode.toLowerCase(),s=n[o];r=t.decrypt?"decrypt":"encrypt";var a=t.key;i.isBuffer(a)||(a=i.from(a)),"des-ede"!==o&&"des-ede-cbc"!==o||(a=i.concat([a,a.slice(0,8)]));var u=t.iv;i.isBuffer(u)||(u=i.from(u)),this._des=s.create({key:a,iv:u,type:r})}return n.des=n["des-cbc"],n.des3=n["des-ede3-cbc"],browserifyDes=o,r(o,e),o.prototype._update=function(e){return i.from(this._des.update(e))},o.prototype._final=function(){return i.from(this._des.final())},browserifyDes}var browser$7={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(e,t){return e._cipher.encryptBlock(t)},ecb.decrypt=function(e,t){return e._cipher.decryptBlock(t)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor,hasRequiredCbc;function requireBufferXor(){return hasRequiredBufferXor?bufferXor:(hasRequiredBufferXor=1,bufferXor=function(e,t){for(var r=Math.min(e.length,t.length),i=new Buffer(r),n=0;n<r;++n)i[n]=e[n]^t[n];return i})}function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var e=requireBufferXor();return cbc.encrypt=function(t,r){var i=e(r,t._prev);return t._prev=t._cipher.encryptBlock(i),t._prev},cbc.decrypt=function(t,r){var i=t._prev;t._prev=r;var n=t._cipher.decryptBlock(r);return e(n,i)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var e=requireSafeBuffer$9().Buffer,t=requireBufferXor();function r(r,i,n){var o=i.length,s=t(i,r._cache);return r._cache=r._cache.slice(o),r._prev=e.concat([r._prev,n?i:s]),s}return cfb.encrypt=function(t,i,n){for(var o,s=e.allocUnsafe(0);i.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=e.allocUnsafe(0)),!(t._cache.length<=i.length)){s=e.concat([s,r(t,i,n)]);break}o=t._cache.length,s=e.concat([s,r(t,i.slice(0,o),n)]),i=i.slice(o)}return s},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var e=requireSafeBuffer$9().Buffer;function t(t,r,i){var n=t._cipher.encryptBlock(t._prev)[0]^r;return t._prev=e.concat([t._prev.slice(1),e.from([i?r:n])]),n}return cfb8.encrypt=function(r,i,n){for(var o=i.length,s=e.allocUnsafe(o),a=-1;++a<o;)s[a]=t(r,i[a],n);return s},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var e=requireSafeBuffer$9().Buffer;function t(e,t,i){for(var n,o,s=-1,a=0;++s<8;)n=t&1<<7-s?128:0,a+=(128&(o=e._cipher.encryptBlock(e._prev)[0]^n))>>s%8,e._prev=r(e._prev,i?n:o);return a}function r(t,r){var i=t.length,n=-1,o=e.allocUnsafe(t.length);for(t=e.concat([t,e.from([r])]);++n<i;)o[n]=t[n]<<1|t[n+1]>>7;return o}return cfb1.encrypt=function(r,i,n){for(var o=i.length,s=e.allocUnsafe(o),a=-1;++a<o;)s[a]=t(r,i[a],n);return s},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var e=requireBufferXor();function t(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}return ofb.encrypt=function(r,i){for(;r._cache.length<i.length;)r._cache=Buffer.concat([r._cache,t(r)]);var n=r._cache.slice(0,i.length);return r._cache=r._cache.slice(i.length),e(i,n)},ofb}var ctr={},incr32_1,hasRequiredIncr32,hasRequiredCtr;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;return hasRequiredIncr32=1,incr32_1=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}}function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var e=requireBufferXor(),t=requireSafeBuffer$9().Buffer,r=requireIncr32();function i(e){var t=e._cipher.encryptBlockRaw(e._prev);return r(e._prev),t}return ctr.encrypt=function(r,n){var o=Math.ceil(n.length/16),s=r._cache.length;r._cache=t.concat([r._cache,t.allocUnsafe(16*o)]);for(var a=0;a<o;a++){var u=i(r),h=s+16*a;r._cache.writeUInt32BE(u[0],h+0),r._cache.writeUInt32BE(u[1],h+4),r._cache.writeUInt32BE(u[2],h+8),r._cache.writeUInt32BE(u[3],h+12)}var f=r._cache.slice(0,n.length);return r._cache=r._cache.slice(n.length),e(n,f)},ctr}const aes128={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},require$$2={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:aes128,aes192:aes192,aes256:aes256,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var e={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},t=require$$2;for(var r in t)t[r].module=e[t[r].mode];return modes_1=t}var aes$2={},hasRequiredAes$1,ghash,hasRequiredGhash,authCipher,hasRequiredAuthCipher,streamCipher,hasRequiredStreamCipher,evp_bytestokey,hasRequiredEvp_bytestokey,hasRequiredEncrypter;function requireAes$1(){if(hasRequiredAes$1)return aes$2;hasRequiredAes$1=1;var e=requireSafeBuffer$9().Buffer;function t(t){e.isBuffer(t)||(t=e.from(t));for(var r=t.length/4|0,i=new Array(r),n=0;n<r;n++)i[n]=t.readUInt32BE(4*n);return i}function r(e){for(;0<e.length;e++)e[0]=0}function i(e,t,r,i,n){for(var o,s,a,u,h=r[0],f=r[1],l=r[2],c=r[3],d=e[0]^t[0],p=e[1]^t[1],m=e[2]^t[2],g=e[3]^t[3],y=4,b=1;b<n;b++)o=h[d>>>24]^f[p>>>16&255]^l[m>>>8&255]^c[255&g]^t[y++],s=h[p>>>24]^f[m>>>16&255]^l[g>>>8&255]^c[255&d]^t[y++],a=h[m>>>24]^f[g>>>16&255]^l[d>>>8&255]^c[255&p]^t[y++],u=h[g>>>24]^f[d>>>16&255]^l[p>>>8&255]^c[255&m]^t[y++],d=o,p=s,m=a,g=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[y++],s=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&d])^t[y++],a=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^t[y++],u=(i[g>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^t[y++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var n=[0,1,2,4,8,16,32,64,128,27,54],o=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var h=a^a<<1^a<<2^a<<3^a<<4;h=h>>>8^255&h^99,r[s]=h,i[h]=s;var f=e[s],l=e[f],c=e[l],d=257*e[h]^16843008*h;n[0][s]=d<<24|d>>>8,n[1][s]=d<<16|d>>>16,n[2][s]=d<<8|d>>>24,n[3][s]=d,d=16843009*c^65537*l^257*f^16843008*s,o[0][h]=d<<24|d>>>8,o[1][h]=d<<16|d>>>16,o[2][h]=d<<8|d>>>24,o[3][h]=d,0===s?s=a=1:(s=f^e[e[e[c^f]]],a^=e[e[a]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function s(e){this._key=t(e),this._reset()}return s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),s=[],a=0;a<t;a++)s[a]=e[a];for(a=t;a<i;a++){var u=s[a-1];a%t==0?(u=u<<8|u>>>24,u=o.SBOX[u>>>24]<<24|o.SBOX[u>>>16&255]<<16|o.SBOX[u>>>8&255]<<8|o.SBOX[255&u],u^=n[a/t|0]<<24):t>6&&a%t==4&&(u=o.SBOX[u>>>24]<<24|o.SBOX[u>>>16&255]<<16|o.SBOX[u>>>8&255]<<8|o.SBOX[255&u]),s[a]=s[a-t]^u}for(var h=[],f=0;f<i;f++){var l=i-f,c=s[l-(f%4?0:4)];h[f]=f<4||l<=4?c:o.INV_SUB_MIX[0][o.SBOX[c>>>24]]^o.INV_SUB_MIX[1][o.SBOX[c>>>16&255]]^o.INV_SUB_MIX[2][o.SBOX[c>>>8&255]]^o.INV_SUB_MIX[3][o.SBOX[255&c]]}this._nRounds=r,this._keySchedule=s,this._invKeySchedule=h},s.prototype.encryptBlockRaw=function(e){return i(e=t(e),this._keySchedule,o.SUB_MIX,o.SBOX,this._nRounds)},s.prototype.encryptBlock=function(t){var r=this.encryptBlockRaw(t),i=e.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[1],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[3],12),i},s.prototype.decryptBlock=function(r){var n=(r=t(r))[1];r[1]=r[3],r[3]=n;var s=i(r,this._invKeySchedule,o.INV_SUB_MIX,o.INV_SBOX,this._nRounds),a=e.allocUnsafe(16);return a.writeUInt32BE(s[0],0),a.writeUInt32BE(s[3],4),a.writeUInt32BE(s[2],8),a.writeUInt32BE(s[1],12),a},s.prototype.scrub=function(){r(this._keySchedule),r(this._invKeySchedule),r(this._key)},aes$2.AES=s,aes$2}function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var e=requireSafeBuffer$9().Buffer,t=e.alloc(16,0);function r(t){var r=e.allocUnsafe(16);return r.writeUInt32BE(t[0]>>>0,0),r.writeUInt32BE(t[1]>>>0,4),r.writeUInt32BE(t[2]>>>0,8),r.writeUInt32BE(t[3]>>>0,12),r}function i(t){this.h=t,this.state=e.alloc(16,0),this.cache=e.allocUnsafe(0)}return i.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},i.prototype._multiply=function(){for(var e,t,i,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],o=[0,0,0,0],s=-1;++s<128;){for(!!(this.state[~~(s/8)]&1<<7-s%8)&&(o[0]^=n[0],o[1]^=n[1],o[2]^=n[2],o[3]^=n[3]),i=!!(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,i&&(n[0]=n[0]^225<<24)}this.state=r(o)},i.prototype.update=function(t){var r;for(this.cache=e.concat([this.cache,t]);this.cache.length>=16;)r=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(r)},i.prototype.final=function(i,n){return this.cache.length&&this.ghash(e.concat([this.cache,t],16)),this.ghash(r([0,i,0,n])),this.state},ghash=i}function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var e=requireAes$1(),t=requireSafeBuffer$9().Buffer,r=requireCipherBase(),i=requireInherits_browser(),n=requireGhash(),o=requireBufferXor(),s=requireIncr32();function a(i,o,a,u){r.call(this);var h=t.alloc(4,0);this._cipher=new e.AES(o);var f=this._cipher.encryptBlock(h);this._ghash=new n(f),a=function(e,r,i){if(12===r.length)return e._finID=t.concat([r,t.from([0,0,0,1])]),t.concat([r,t.from([0,0,0,2])]);var o=new n(i),a=r.length,u=a%16;o.update(r),u&&(u=16-u,o.update(t.alloc(u,0))),o.update(t.alloc(8,0));var h=8*a,f=t.alloc(8);f.writeUIntBE(h,0,8),o.update(f),e._finID=o.state;var l=t.from(e._finID);return s(l),l}(this,a,f),this._prev=t.from(a),this._cache=t.allocUnsafe(0),this._secCache=t.allocUnsafe(0),this._decrypt=u,this._alen=0,this._len=0,this._mode=i,this._authTag=null,this._called=!1}return i(a,r),a.prototype._update=function(e){if(!this._called&&this._alen){var r=16-this._alen%16;r<16&&(r=t.alloc(r,0),this._ghash.update(r))}this._called=!0;var i=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(i),this._len+=e.length,i},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=o(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n<i;++n)r+=e[n]^t[n];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},a.prototype.getAuthTag=function(){if(this._decrypt||!t.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},a.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},a.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},authCipher=a}function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var e=requireAes$1(),t=requireSafeBuffer$9().Buffer,r=requireCipherBase();function i(i,n,o,s){r.call(this),this._cipher=new e.AES(n),this._prev=t.from(o),this._cache=t.allocUnsafe(0),this._secCache=t.allocUnsafe(0),this._decrypt=s,this._mode=i}return requireInherits_browser()(i,r),i.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},i.prototype._final=function(){this._cipher.scrub()},streamCipher=i}function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var e=requireSafeBuffer$9().Buffer,t=requireMd5_js();return evp_bytestokey=function(r,i,n,o){if(e.isBuffer(r)||(r=e.from(r,"binary")),i&&(e.isBuffer(i)||(i=e.from(i,"binary")),8!==i.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=n/8,a=e.alloc(s),u=e.alloc(o||0),h=e.alloc(0);s>0||o>0;){var f=new t;f.update(h),f.update(r),i&&f.update(i),h=f.digest();var l=0;if(s>0){var c=a.length-s;l=Math.min(s,h.length),h.copy(a,c,0,l),s-=l}if(l<h.length&&o>0){var d=u.length-o,p=Math.min(o,h.length-l);h.copy(u,d,l,l+p),o-=p}}return h.fill(0),{key:a,iv:u}}}function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var e=requireModes$1(),t=requireAuthCipher(),r=requireSafeBuffer$9().Buffer,i=requireStreamCipher(),n=requireCipherBase(),o=requireAes$1(),s=requireEvp_bytestokey();function a(e,t,i){n.call(this),this._cache=new h,this._cipher=new o.AES(t),this._prev=r.from(i),this._mode=e,this._autopadding=!0}requireInherits_browser()(a,n),a.prototype._update=function(e){var t,i;this._cache.add(e);for(var n=[];t=this._cache.get();)i=this._mode.encrypt(this,t),n.push(i);return r.concat(n)};var u=r.alloc(16,16);function h(){this.cache=r.allocUnsafe(0)}function f(n,o,s){var u=e[n.toLowerCase()];if(!u)throw new TypeError("invalid suite type");if("string"==typeof o&&(o=r.from(o)),o.length!==u.key/8)throw new TypeError("invalid key length "+o.length);if("string"==typeof s&&(s=r.from(s)),"GCM"!==u.mode&&s.length!==u.iv)throw new TypeError("invalid iv length "+s.length);return"stream"===u.type?new i(u.module,o,s):"auth"===u.type?new t(u.module,o,s):new a(u.module,o,s)}return a.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(u))throw this._cipher.scrub(),new Error("data not multiple of block length")},a.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=r.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=r.allocUnsafe(e),i=-1;++i<e;)t.writeUInt8(e,i);return r.concat([this.cache,t])},encrypter.createCipheriv=f,encrypter.createCipher=function(t,r){var i=e[t.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var n=s(r,!1,i.key,i.iv);return f(t,n.key,n.iv)},encrypter}var decrypter={},hasRequiredDecrypter,hasRequiredBrowser$7;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var e=requireAuthCipher(),t=requireSafeBuffer$9().Buffer,r=requireModes$1(),i=requireStreamCipher(),n=requireCipherBase(),o=requireAes$1(),s=requireEvp_bytestokey();function a(e,r,i){n.call(this),this._cache=new u,this._last=void 0,this._cipher=new o.AES(r),this._prev=t.from(i),this._mode=e,this._autopadding=!0}function u(){this.cache=t.allocUnsafe(0)}function h(n,o,s){var u=r[n.toLowerCase()];if(!u)throw new TypeError("invalid suite type");if("string"==typeof s&&(s=t.from(s)),"GCM"!==u.mode&&s.length!==u.iv)throw new TypeError("invalid iv length "+s.length);if("string"==typeof o&&(o=t.from(o)),o.length!==u.key/8)throw new TypeError("invalid key length "+o.length);return"stream"===u.type?new i(u.module,o,s,!0):"auth"===u.type?new e(u.module,o,s,!0):new a(u.module,o,s)}return requireInherits_browser()(a,n),a.prototype._update=function(e){var r,i;this._cache.add(e);for(var n=[];r=this._cache.get(this._autopadding);)i=this._mode.decrypt(this,r),n.push(i);return t.concat(n)},a.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},a.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},u.prototype.add=function(e){this.cache=t.concat([this.cache,e])},u.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},u.prototype.flush=function(){if(this.cache.length)return this.cache},decrypter.createDecipher=function(e,t){var i=r[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var n=s(t,!1,i.key,i.iv);return h(e,n.key,n.iv)},decrypter.createDecipheriv=h,decrypter}function requireBrowser$7(){if(hasRequiredBrowser$7)return browser$7;hasRequiredBrowser$7=1;var e=requireEncrypter(),t=requireDecrypter(),r=require$$2;return browser$7.createCipher=browser$7.Cipher=e.createCipher,browser$7.createCipheriv=browser$7.Cipheriv=e.createCipheriv,browser$7.createDecipher=browser$7.Decipher=t.createDecipher,browser$7.createDecipheriv=browser$7.Decipheriv=t.createDecipheriv,browser$7.listCiphers=browser$7.getCiphers=function(){return Object.keys(r)},browser$7}var modes={},hasRequiredModes,hasRequiredBrowser$6;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,(e=modes)["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}),modes;var e}function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$8;hasRequiredBrowser$6=1;var e=requireBrowserifyDes(),t=requireBrowser$7(),r=requireModes$1(),i=requireModes(),n=requireEvp_bytestokey();function o(n,o,s){if(n=n.toLowerCase(),r[n])return t.createCipheriv(n,o,s);if(i[n])return new e({key:o,iv:s,mode:n});throw new TypeError("invalid suite type")}function s(n,o,s){if(n=n.toLowerCase(),r[n])return t.createDecipheriv(n,o,s);if(i[n])return new e({key:o,iv:s,mode:n,decrypt:!0});throw new TypeError("invalid suite type")}return browser$8.createCipher=browser$8.Cipher=function(e,t){var s,a;if(e=e.toLowerCase(),r[e])s=r[e].key,a=r[e].iv;else{if(!i[e])throw new TypeError("invalid suite type");s=8*i[e].key,a=i[e].iv}var u=n(t,!1,s,a);return o(e,u.key,u.iv)},browser$8.createCipheriv=browser$8.Cipheriv=o,browser$8.createDecipher=browser$8.Decipher=function(e,t){var o,a;if(e=e.toLowerCase(),r[e])o=r[e].key,a=r[e].iv;else{if(!i[e])throw new TypeError("invalid suite type");o=8*i[e].key,a=i[e].iv}var u=n(t,!1,o,a);return s(e,u.key,u.iv)},browser$8.createDecipheriv=browser$8.Decipheriv=s,browser$8.listCiphers=browser$8.getCiphers=function(){return Object.keys(i).concat(t.getCiphers())},browser$8}var browser$6={},bn$d={exports:{}},bn$c=bn$d.exports,hasRequiredBn$6;function requireBn$6(){return hasRequiredBn$6||(hasRequiredBn$6=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$d,bn$c)),bn$d.exports}var bn$b={exports:{}},bn$a=bn$b.exports,hasRequiredBn$5;function requireBn$5(){return hasRequiredBn$5||(hasRequiredBn$5=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$b,bn$a)),bn$b.exports}var brorand={exports:{}},hasRequiredBrorand,mr,hasRequiredMr,generatePrime,hasRequiredGeneratePrime;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;var e;function t(e){this.rand=e}if(hasRequiredBrorand=1,brorand.exports=function(r){return e||(e=new t(null)),e.generate(r)},brorand.exports.Rand=t,t.prototype.generate=function(e){return this._rand(e)},t.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=requireCryptoBrowserify();if("function"!=typeof r.randomBytes)throw new Error("Not supported");t.prototype._rand=function(e){return r.randomBytes(e)}}catch(e){}return brorand.exports}function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var e=requireBn$5(),t=requireBrorand();function r(e){this.rand=e||new t.Rand}return mr=r,r.create=function(e){return new r(e)},r.prototype._randbelow=function(t){var r=t.bitLength(),i=Math.ceil(r/8);do{var n=new e(this.rand.generate(i))}while(n.cmp(t)>=0);return n},r.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},r.prototype.test=function(t,r,i){var n=t.bitLength(),o=e.mont(t),s=new e(1).toRed(o);r||(r=Math.max(1,n/48|0));for(var a=t.subn(1),u=0;!a.testn(u);u++);for(var h=t.shrn(u),f=a.toRed(o);r>0;r--){var l=this._randrange(new e(2),a);i&&i(l);var c=l.toRed(o).redPow(h);if(0!==c.cmp(s)&&0!==c.cmp(f)){for(var d=1;d<u;d++){if(0===(c=c.redSqr()).cmp(s))return!1;if(0===c.cmp(f))break}if(d===u)return!1}}return!0},r.prototype.getDivisor=function(t,r){var i=t.bitLength(),n=e.mont(t),o=new e(1).toRed(n);r||(r=Math.max(1,i/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var u=t.shrn(a),h=s.toRed(n);r>0;r--){var f=this._randrange(new e(2),s),l=t.gcd(f);if(0!==l.cmpn(1))return l;var c=f.toRed(n).redPow(u);if(0!==c.cmp(o)&&0!==c.cmp(h)){for(var d=1;d<a;d++){if(0===(c=c.redSqr()).cmp(o))return c.fromRed().subn(1).gcd(t);if(0===c.cmp(h))break}if(d===a)return(c=c.redSqr()).fromRed().subn(1).gcd(t)}}return!1},mr}function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var e=requireBrowser$b();generatePrime=p,p.simpleSieve=c,p.fermatTest=d;var t=requireBn$6(),r=new t(24),i=new(requireMr()),n=new t(1),o=new t(2),s=new t(5);new t(16),new t(8);var a=new t(10),u=new t(3);new t(7);var h=new t(11),f=new t(4);new t(12);var l=null;function c(e){for(var t=function(){if(null!==l)return l;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var i=Math.ceil(Math.sqrt(r)),n=0;n<t&&e[n]<=i&&r%e[n]!=0;n++);t!==n&&e[n]<=i||(e[t++]=r)}return l=e,e}(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function d(e){var r=t.mont(e);return 0===o.toRed(r).redPow(e.subn(1)).fromRed().cmpn(1)}function p(l,p){if(l<16)return new t(2===p||5===p?[140,123]:[140,39]);var m,g;for(p=new t(p);;){for(m=new t(e(Math.ceil(l/8)));m.bitLength()>l;)m.ishrn(1);if(m.isEven()&&m.iadd(n),m.testn(1)||m.iadd(o),p.cmp(o)){if(!p.cmp(s))for(;m.mod(a).cmp(u);)m.iadd(f)}else for(;m.mod(r).cmp(h);)m.iadd(f);if(c(g=m.shrn(1))&&c(m)&&d(g)&&d(m)&&i.test(g)&&i.test(m))return m}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1:modp1,modp2:modp2,modp5:modp5,modp14:modp14,modp15:modp15,modp16:modp16,modp17:modp17,modp18:modp18};var dh,hasRequiredDh,hasRequiredBrowser$5;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var e=requireBn$6(),t=new(requireMr()),r=new e(24),i=new e(11),n=new e(10),o=new e(3),s=new e(7),a=requireGeneratePrime(),u=requireBrowser$b();function h(t,r){return r=r||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,r)),this._pub=new e(t),this}function f(t,r){return r=r||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,r)),this._priv=new e(t),this}dh=c;var l={};function c(t,r,i){this.setGenerator(r),this.__prime=new e(t),this._prime=e.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,i?(this.setPublicKey=h,this.setPrivateKey=f):this._primeCode=8}function d(e,t){var r=new Buffer(e.toArray());return t?r.toString(t):r}return Object.defineProperty(c.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,u){var h=u.toString("hex"),f=[h,e.toString(16)].join("_");if(f in l)return l[f];var c,d=0;if(e.isEven()||!a.simpleSieve||!a.fermatTest(e)||!t.test(e))return d+=1,d+="02"===h||"05"===h?8:4,l[f]=d,d;switch(t.test(e.shrn(1))||(d+=2),h){case"02":e.mod(r).cmp(i)&&(d+=8);break;case"05":(c=e.mod(n)).cmp(o)&&c.cmp(s)&&(d+=8);break;default:d+=4}return l[f]=d,d}(this.__prime,this.__gen)),this._primeCode}}),c.prototype.generateKeys=function(){return this._priv||(this._priv=new e(u(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},c.prototype.computeSecret=function(t){var r=(t=(t=new e(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new Buffer(r.toArray()),n=this.getPrime();if(i.length<n.length){var o=new Buffer(n.length-i.length);o.fill(0),i=Buffer.concat([o,i])}return i},c.prototype.getPublicKey=function(e){return d(this._pub,e)},c.prototype.getPrivateKey=function(e){return d(this._priv,e)},c.prototype.getPrime=function(e){return d(this.__prime,e)},c.prototype.getGenerator=function(e){return d(this._gen,e)},c.prototype.setGenerator=function(t,r){return r=r||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,r)),this.__gen=t,this._gen=new e(t),this},dh}function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$6;hasRequiredBrowser$5=1;var e=requireGeneratePrime(),t=require$$1$1,r=requireDh();var i={binary:!0,hex:!0,base64:!0};return browser$6.DiffieHellmanGroup=browser$6.createDiffieHellmanGroup=browser$6.getDiffieHellman=function(e){var i=new Buffer(t[e].prime,"hex"),n=new Buffer(t[e].gen,"hex");return new r(i,n)},browser$6.createDiffieHellman=browser$6.DiffieHellman=function t(n,o,s,a){return Buffer.isBuffer(o)||void 0===i[o]?t(n,"binary",o,s):(o=o||"binary",a=a||"binary",s=s||new Buffer([2]),Buffer.isBuffer(s)||(s=new Buffer(s,a)),"number"==typeof n?new r(e(n,s),s,!0):(Buffer.isBuffer(n)||(n=new Buffer(n,o)),new r(n,s,!0)))},browser$6}var safeBuffer$3={exports:{}},hasRequiredSafeBuffer$3;function requireSafeBuffer$3(){return hasRequiredSafeBuffer$3||(hasRequiredSafeBuffer$3=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$3,safeBuffer$3.exports)),safeBuffer$3.exports}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs,isarray,hasRequiredIsarray,streamBrowser,hasRequiredStreamBrowser;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;return hasRequiredProcessNextickArgs=1,void 0===process$1||!process$1.version||0===process$1.version.indexOf("v0.")||0===process$1.version.indexOf("v1.")&&0!==process$1.version.indexOf("v1.8.")?processNextickArgs.exports={nextTick:function(e,t,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var n,o,s=arguments.length;switch(s){case 0:case 1:return process$1.nextTick(e);case 2:return process$1.nextTick((function(){e.call(null,t)}));case 3:return process$1.nextTick((function(){e.call(null,t,r)}));case 4:return process$1.nextTick((function(){e.call(null,t,r,i)}));default:for(n=new Array(s-1),o=0;o<n.length;)n[o++]=arguments[o];return process$1.nextTick((function(){e.apply(null,n)}))}}}:processNextickArgs.exports=process$1,processNextickArgs.exports}function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var e={}.toString;return isarray=Array.isArray||function(t){return"[object Array]"==e.call(t)}}function requireStreamBrowser(){return hasRequiredStreamBrowser?streamBrowser:(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter)}var safeBuffer$2={exports:{}},hasRequiredSafeBuffer$2;function requireSafeBuffer$2(){return hasRequiredSafeBuffer$2||(hasRequiredSafeBuffer$2=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$2,safeBuffer$2.exports)),safeBuffer$2.exports}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;function e(e){return Object.prototype.toString.call(e)}return hasRequiredUtil=1,util.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},util.isBoolean=function(e){return"boolean"==typeof e},util.isNull=function(e){return null===e},util.isNullOrUndefined=function(e){return null==e},util.isNumber=function(e){return"number"==typeof e},util.isString=function(e){return"string"==typeof e},util.isSymbol=function(e){return"symbol"==typeof e},util.isUndefined=function(e){return void 0===e},util.isRegExp=function(t){return"[object RegExp]"===e(t)},util.isObject=function(e){return"object"==typeof e&&null!==e},util.isDate=function(t){return"[object Date]"===e(t)},util.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},util.isFunction=function(e){return"function"==typeof e},util.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},util.isBuffer=requireDist().Buffer.isBuffer,util}var BufferList={exports:{}},hasRequiredBufferList,destroy_1,hasRequiredDestroy,_stream_writable,hasRequired_stream_writable,_stream_duplex,hasRequired_stream_duplex,_stream_readable,hasRequired_stream_readable,_stream_transform,hasRequired_stream_transform,_stream_passthrough,hasRequired_stream_passthrough,hasRequiredReadableBrowser;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,e=BufferList,t=requireSafeBuffer$2().Buffer,r=requireUtil$1(),e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return t.alloc(0);for(var r,i,n,o=t.allocUnsafe(e>>>0),s=this.head,a=0;s;)r=s.data,i=o,n=a,r.copy(i,n),a+=s.data.length,s=s.next;return o},e}(),r&&r.inspect&&r.inspect.custom&&(e.exports.prototype[r.inspect.custom]=function(){var e=r.inspect({length:this.length});return this.constructor.name+" "+e})),BufferList.exports;var e,t,r}function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var e=requireProcessNextickArgs();function t(e,t){e.emit("error",t)}return destroy_1={destroy:function(r,i){var n=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(i?i(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(t,this,r)):e.nextTick(t,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,(function(r){!i&&r?n._writableState?n._writableState.errorEmitted||(n._writableState.errorEmitted=!0,e.nextTick(t,n,r)):e.nextTick(t,n,r):i&&i(r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}}function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var e=requireProcessNextickArgs();function t(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var i=e.entry;e.entry=null;for(;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}(t,e)}}_stream_writable=d;var r,i=!process$1.browser&&["v0.10","v0.9."].indexOf(process$1.version.slice(0,5))>-1?setImmediate:e.nextTick;d.WritableState=c;var n=Object.create(requireUtil());n.inherits=requireInherits_browser();var o={deprecate:requireBrowser$c()},s=requireStreamBrowser(),a=requireSafeBuffer$2().Buffer,u=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var h,f=requireDestroy();function l(){}function c(n,o){r=r||require_stream_duplex(),n=n||{};var s=o instanceof r;this.objectMode=!!n.objectMode,s&&(this.objectMode=this.objectMode||!!n.writableObjectMode);var a=n.highWaterMark,u=n.writableHighWaterMark,h=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:s&&(u||0===u)?u:h,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===n.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,r){var n=t._writableState,o=n.sync,s=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),r)!function(t,r,i,n,o){--r.pendingcb,i?(e.nextTick(o,n),e.nextTick(v,t,r),t._writableState.errorEmitted=!0,t.emit("error",n)):(o(n),t._writableState.errorEmitted=!0,t.emit("error",n),v(t,r))}(t,n,o,r,s);else{var a=y(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||g(t,n),o?i(m,t,n,a,s):m(t,n,a,s)}}(o,t)},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 t(this)}function d(e){if(r=r||require_stream_duplex(),!(h.call(d,this)||this instanceof r))return new d(e);this._writableState=new c(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)),s.call(this)}function p(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function m(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),v(e,t)}function g(e,r){r.bufferProcessing=!0;var i=r.bufferedRequest;if(e._writev&&i&&i.next){var n=r.bufferedRequestCount,o=new Array(n),s=r.corkedRequestsFree;s.entry=i;for(var a=0,u=!0;i;)o[a]=i,i.isBuf||(u=!1),i=i.next,a+=1;o.allBuffers=u,p(e,r,!0,r.length,o,"",s.finish),r.pendingcb++,r.lastBufferedRequest=null,s.next?(r.corkedRequestsFree=s.next,s.next=null):r.corkedRequestsFree=new t(r),r.bufferedRequestCount=0}else{for(;i;){var h=i.chunk,f=i.encoding,l=i.callback;if(p(e,r,!1,r.objectMode?1:h.length,h,f,l),i=i.next,r.bufferedRequestCount--,r.writing)break}null===i&&(r.lastBufferedRequest=null)}r.bufferedRequest=i,r.bufferProcessing=!1}function y(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function b(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),v(e,t)}))}function v(t,r){var i=y(r);return i&&(!function(t,r){r.prefinished||r.finalCalled||("function"==typeof t._final?(r.pendingcb++,r.finalCalled=!0,e.nextTick(b,t,r)):(r.prefinished=!0,t.emit("prefinish")))}(t,r),0===r.pendingcb&&(r.finished=!0,t.emit("finish"))),i}return n.inherits(d,s),c.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(c.prototype,"buffer",{get:o.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]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(d,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===d&&(e&&e._writableState instanceof c)}})):h=function(e){return e instanceof this},d.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},d.prototype.write=function(t,r,i){var n,o=this._writableState,s=!1,h=!o.objectMode&&(n=t,a.isBuffer(n)||n instanceof u);return h&&!a.isBuffer(t)&&(t=function(e){return a.from(e)}(t)),"function"==typeof r&&(i=r,r=null),h?r="buffer":r||(r=o.defaultEncoding),"function"!=typeof i&&(i=l),o.ended?function(t,r){var i=new Error("write after end");t.emit("error",i),e.nextTick(r,i)}(this,i):(h||function(t,r,i,n){var o=!0,s=!1;return null===i?s=new TypeError("May not write null values to stream"):"string"==typeof i||void 0===i||r.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),e.nextTick(n,s),o=!1),o}(this,o,t,i))&&(o.pendingcb++,s=function(e,t,r,i,n,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=a.from(t,r));return t}(t,i,n);i!==s&&(r=!0,n="buffer",i=s)}var u=t.objectMode?1:i.length;t.length+=u;var h=t.length<t.highWaterMark;h||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else p(e,t,!1,u,i,n,o);return h}(this,o,h,t,r,i)),s},d.prototype.cork=function(){this._writableState.corked++},d.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||g(this,e))},d.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),d.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},d.prototype._writev=null,d.prototype.end=function(t,r,i){var n=this._writableState;"function"==typeof t?(i=t,t=null,r=null):"function"==typeof r&&(i=r,r=null),null!=t&&this.write(t,r),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,r,i){r.ending=!0,v(t,r),i&&(r.finished?e.nextTick(i):t.once("finish",i));r.ended=!0,t.writable=!1}(this,n,i)},Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),d.prototype.destroy=f.destroy,d.prototype._undestroy=f.undestroy,d.prototype._destroy=function(e,t){this.end(),t(e)},_stream_writable}function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var e=requireProcessNextickArgs(),t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};_stream_duplex=u;var r=Object.create(requireUtil());r.inherits=requireInherits_browser();var i=require_stream_readable(),n=require_stream_writable();r.inherits(u,i);for(var o=t(n.prototype),s=0;s<o.length;s++){var a=o[s];u.prototype[a]||(u.prototype[a]=n.prototype[a])}function u(e){if(!(this instanceof u))return new u(e);i.call(this,e),n.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||e.nextTick(f,this)}function f(e){e.end()}return Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),u.prototype._destroy=function(t,r){this.push(null),this.end(),e.nextTick(r,t)},_stream_duplex}function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var e=requireProcessNextickArgs();_stream_readable=m;var t,r=requireIsarray();m.ReadableState=p,requireEvents().EventEmitter;var i=function(e,t){return e.listeners(t).length},n=requireStreamBrowser(),o=requireSafeBuffer$2().Buffer,s=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a=Object.create(requireUtil());a.inherits=requireInherits_browser();var u=requireUtil$1(),h=void 0;h=u&&u.debuglog?u.debuglog("stream"):function(){};var f,l=requireBufferList(),c=requireDestroy();a.inherits(m,n);var d=["error","close","destroy","pause","resume"];function p(e,r){e=e||{};var i=r instanceof(t=t||require_stream_duplex());this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new l,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&&(f||(f=requireString_decoder().StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function m(e){if(t=t||require_stream_duplex(),!(this instanceof m))return new m(e);this._readableState=new p(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function g(e,t,r,i,n){var a,u=e._readableState;null===t?(u.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,w(e)}(e,u)):(n||(a=function(e,t){var r;i=t,o.isBuffer(i)||i instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var i;return r}(u,t)),a?e.emit("error",a):u.objectMode||t&&t.length>0?("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),i?u.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):y(e,u,t,!0):u.ended?e.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?y(e,u,t,!1):M(e,u)):y(e,u,t,!1))):i||(u.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(u)}function y(e,t,r,i){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&w(e)),M(e,t)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),m.prototype.destroy=c.destroy,m.prototype._undestroy=c.undestroy,m.prototype._destroy=function(e,t){this.push(null),t(e)},m.prototype.push=function(e,t){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=o.from(e,t),t=""),r=!0),g(this,e,t,!1,r)},m.prototype.unshift=function(e){return g(this,e,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(e){return f||(f=requireString_decoder().StringDecoder),this._readableState.decoder=new f(e),this._readableState.encoding=e,this};var b=8388608;function v(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=b?e=b:(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 w(t){var r=t._readableState;r.needReadable=!1,r.emittedReadable||(h("emitReadable",r.flowing),r.emittedReadable=!0,r.sync?e.nextTick(_,t):_(t))}function _(e){h("emit readable"),e.emit("readable"),A(e)}function M(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(S,t,r))}function S(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function E(e){h("readable nexttick read 0"),e.read(0)}function R(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function q(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):i=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,i=1,n=r.data;e-=n.length;for(;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(s===o.length?n+=o:n+=o.slice(0,e),0===(e-=s)){s===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++i}return t.length-=i,n}(e,t):function(e,t){var r=o.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var s=i.data,a=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,a),0===(e-=a)){a===s.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=s.slice(a));break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function C(t){var r=t._readableState;if(r.length>0)throw new Error('"endReadable()" called on non-empty stream');r.endEmitted||(r.ended=!0,e.nextTick(P,r,t))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function B(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}return m.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):w(this),null;if(0===(e=v(e,t))&&t.ended)return 0===t.length&&C(this),null;var i,n=t.needReadable;return h("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",n=!0),t.ended||t.reading?h("reading or ended",n=!1):n&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=v(r,t))),null===(i=e>0?q(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==i&&this.emit("data",i),i},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(t,n){var o=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,h("pipe count=%d opts=%j",s.pipesCount,n);var a=(!n||!1!==n.end)&&t!==process$1.stdout&&t!==process$1.stderr?f:b;function u(e,r){h("onunpipe"),e===o&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),t.removeListener("close",g),t.removeListener("finish",y),t.removeListener("drain",l),t.removeListener("error",m),t.removeListener("unpipe",u),o.removeListener("end",f),o.removeListener("end",b),o.removeListener("data",p),c=!0,!s.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function f(){h("onend"),t.end()}s.endEmitted?e.nextTick(a):o.once("end",a),t.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,A(e))}}(o);t.on("drain",l);var c=!1;var d=!1;function p(e){h("ondata"),d=!1,!1!==t.write(e)||d||((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==B(s.pipes,t))&&!c&&(h("false write response, pause",s.awaitDrain),s.awaitDrain++,d=!0),o.pause())}function m(e){h("onerror",e),b(),t.removeListener("error",m),0===i(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",y),b()}function y(){h("onfinish"),t.removeListener("close",g),b()}function b(){h("unpipe"),o.unpipe(t)}return o.on("data",p),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(t,"error",m),t.once("close",g),t.once("finish",y),t.emit("pipe",o),s.flowing||(h("pipe resume"),o.resume()),t},m.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=B(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},m.prototype.on=function(t,r){var i=n.prototype.on.call(this,t,r);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var o=this._readableState;o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.emittedReadable=!1,o.reading?o.length&&w(this):e.nextTick(E,this))}return i},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!0,function(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(R,t,r))}(this,t)),this},m.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var n in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(h("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(i=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var o=0;o<d.length;o++)e.on(d[o],this.emit.bind(this,d[o]));return this._read=function(t){h("wrapped _read",t),i&&(i=!1,e.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=q,_stream_readable}function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=i;var e=require_stream_duplex(),t=Object.create(requireUtil());function r(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function i(t){if(!(this instanceof i))return new i(t);e.call(this,t),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",n)}function n(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){o(e,t,r)})):o(this,null,null)}function o(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}return t.inherits=requireInherits_browser(),t.inherits(i,e),i.prototype.push=function(t,r){return this._transformState.needTransform=!1,e.prototype.push.call(this,t,r)},i.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},i.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},i.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},i.prototype._destroy=function(t,r){var i=this;e.prototype._destroy.call(this,t,(function(e){r(e),i.emit("close")}))},_stream_transform}function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=r;var e=require_stream_transform(),t=Object.create(requireUtil());function r(t){if(!(this instanceof r))return new r(t);e.call(this,t)}return t.inherits=requireInherits_browser(),t.inherits(r,e),r.prototype._transform=function(e,t,r){r(null,e)},_stream_passthrough}function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,e=readableBrowser,t=readableBrowser.exports,(t=e.exports=require_stream_readable()).Stream=t,t.Readable=t,t.Writable=require_stream_writable(),t.Duplex=require_stream_duplex(),t.Transform=require_stream_transform(),t.PassThrough=require_stream_passthrough()),readableBrowser.exports;var e,t}var sign={exports:{}},bn$9={exports:{}},bn$8=bn$9.exports,hasRequiredBn$4;function requireBn$4(){return hasRequiredBn$4||(hasRequiredBn$4=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+e)}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,i,n){for(var o=0,s=0,a=Math.min(e.length,i),u=t;u<a;u++){var h=e.charCodeAt(u)-48;o*=n,s=h>=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&s<n,"Invalid character"),o+=s}return o}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype._move=function(e){h(e,this)},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){n.prototype.inspect=f}else n.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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"],c=[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],d=[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 p(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r._strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?l[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var h=c[e],f=d[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(e);i=(p=p.idivn(f)).isZero()?m+i:l[h-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){this._strip();var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},n.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this._strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}Math.imul||(m=p),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?g(this,e,t):y(this,e,t)},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),y(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var i=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&i);i>>=26,i+=o/67108864|0,i+=s>>>26,this.words[n]=67108863&s}return 0!==i&&(this.words[n]=i,this.length++),t?this.ineg():this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=e.words[i]>>>n&1}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this._strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var i=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(i*n+(0|this.words[o]))%e;return t?-n:n},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*i;this.words[n]=o/e|0,i=o%e}return this._strip(),t?this.ineg():this},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new E(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=n._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 R(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}v.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(w,v),w.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(_,v),i(M,v),i(S,v),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new _;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return b[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(!(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):(h(e,e.umod(this.m)._forceRed(this)),e)},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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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 i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},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},n.mont=function(e){return new R(e)},i(R,E),R.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},R.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},R.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},R.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},R.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$9,bn$8)),bn$9.exports}var safeBuffer$1={exports:{}},hasRequiredSafeBuffer$1,browserifyRsa,hasRequiredBrowserifyRsa;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var e=requireBn$4(),t=requireBrowser$b(),r=requireSafeBuffer$1().Buffer;function i(r){var i,n=r.modulus.byteLength();do{i=new e(t(n))}while(i.cmp(r.modulus)>=0||!i.umod(r.prime1)||!i.umod(r.prime2));return i}function n(t,n){var o=function(t){var r=i(t);return{blinder:r.toRed(e.mont(t.modulus)).redPow(new e(t.publicExponent)).fromRed(),unblinder:r.invm(t.modulus)}}(n),s=n.modulus.byteLength(),a=new e(t).mul(o.blinder).umod(n.modulus),u=a.toRed(e.mont(n.prime1)),h=a.toRed(e.mont(n.prime2)),f=n.coefficient,l=n.prime1,c=n.prime2,d=u.redPow(n.exponent1).fromRed(),p=h.redPow(n.exponent2).fromRed(),m=d.isub(p).imul(f).umod(l).imul(c);return p.iadd(m).imul(o.unblinder).umod(n.modulus).toArrayLike(r,"be",s)}return n.getr=i,browserifyRsa=n}var elliptic={};const version="6.6.1",require$$0={version:version};var utils$2={},bn$7={exports:{}},bn$6=bn$7.exports,hasRequiredBn$3;function requireBn$3(){return hasRequiredBn$3||(hasRequiredBn$3=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$7,bn$6)),bn$7.exports}var utils$1={},hasRequiredUtils$2,hasRequiredUtils$1;function requireUtils$2(){return hasRequiredUtils$2||(hasRequiredUtils$2=1,function(e){var t=e;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",i=0;i<e.length;i++)t+=r(e[i].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},t.zero2=r,t.toHex=i,t.encode=function(e,t){return"hex"===t?i(e):e}}(utils$1)),utils$1}function requireUtils$1(){return hasRequiredUtils$1||(hasRequiredUtils$1=1,e=utils$2,t=requireBn$3(),r=requireMinimalisticAssert(),i=requireUtils$2(),e.assert=r,e.toArray=i.toArray,e.zero2=i.zero2,e.toHex=i.toHex,e.encode=i.encode,e.getNAF=function(e,t,r){var i,n=new Array(Math.max(e.bitLength(),r)+1);for(i=0;i<n.length;i+=1)n[i]=0;var o=1<<t+1,s=e.clone();for(i=0;i<n.length;i++){var a,u=s.andln(o-1);s.isOdd()?(a=u>(o>>1)-1?(o>>1)-u:u,s.isubn(a)):a=0,n[i]=a,s.iushrn(1)}return n},e.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var s,a,u=e.andln(3)+n&3,h=t.andln(3)+o&3;3===u&&(u=-1),3===h&&(h=-1),s=1&u?3!=(i=e.andln(7)+n&7)&&5!==i||2!==h?u:-u:0,r[0].push(s),a=1&h?3!=(i=t.andln(7)+o&7)&&5!==i||2!==u?h:-h:0,r[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},e.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(e){return new t(e,"hex","le")}),utils$2;var e,t,r,i}var curve={},base$1,hasRequiredBase$1,short,hasRequiredShort,mont,hasRequiredMont,edwards,hasRequiredEdwards,hasRequiredCurve;function requireBase$1(){if(hasRequiredBase$1)return base$1;hasRequiredBase$1=1;var e=requireBn$3(),t=requireUtils$1(),r=t.getNAF,i=t.getJSF,n=t.assert;function o(t,r){this.type=t,this.p=new e(r.p,16),this.red=r.prime?e.red(r.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=r.n&&new e(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.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 i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(e,t){this.curve=e,this.type=t,this.precomputed=null}return base$1=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){n(e.precomputed);var i=e._getDoubles(),o=r(t,1,this._bitLength),s=(1<<i.step+1)-(i.step%2==0?2:1);s/=3;var a,u,h=[];for(a=0;a<o.length;a+=i.step){u=0;for(var f=a+i.step-1;f>=a;f--)u=(u<<1)+o[f];h.push(u)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a<h.length;a++)(u=h[a])===d?c=c.mixedAdd(i.points[a]):u===-d&&(c=c.mixedAdd(i.points[a].neg()));l=l.add(c)}return l.toP()},o.prototype._wnafMul=function(e,t){var i=4,o=e._getNAFPoints(i);i=o.wnd;for(var s=o.points,a=r(t,i,this._bitLength),u=this.jpoint(null,null,null),h=a.length-1;h>=0;h--){for(var f=0;h>=0&&0===a[h];h--)f++;if(h>=0&&f++,u=u.dblp(f),h<0)break;var l=a[h];n(0!==l),u="affine"===e.type?l>0?u.mixedAdd(s[l-1>>1]):u.mixedAdd(s[-l-1>>1].neg()):l>0?u.add(s[l-1>>1]):u.add(s[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},o.prototype._wnafMulAdd=function(e,t,n,o,s){var a,u,h,f=this._wnafT1,l=this._wnafT2,c=this._wnafT3,d=0;for(a=0;a<o;a++){var p=(h=t[a])._getNAFPoints(e);f[a]=p.wnd,l[a]=p.points}for(a=o-1;a>=1;a-=2){var m=a-1,g=a;if(1===f[m]&&1===f[g]){var y=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(y[1]=t[m].add(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].add(t[g].neg())):(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=i(n[m],n[g]);for(d=Math.max(v[0].length,d),c[m]=new Array(d),c[g]=new Array(d),u=0;u<d;u++){var w=0|v[0][u],_=0|v[1][u];c[m][u]=b[3*(w+1)+(_+1)],c[g][u]=0,l[m]=y}}else c[m]=r(n[m],f[m],this._bitLength),c[g]=r(n[g],f[g],this._bitLength),d=Math.max(c[m].length,d),d=Math.max(c[g].length,d)}var M=this.jpoint(null,null,null),S=this._wnafT4;for(a=d;a>=0;a--){for(var E=0;a>=0;){var R=!0;for(u=0;u<o;u++)S[u]=0|c[u][a],0!==S[u]&&(R=!1);if(!R)break;E++,a--}if(a>=0&&E++,M=M.dblp(E),a<0)break;for(u=0;u<o;u++){var A=S[u];0!==A&&(A>0?h=l[u][A-1>>1]:A<0&&(h=l[u][-A-1>>1].neg()),M="affine"===h.type?M.mixedAdd(h):M.add(h))}}for(a=0;a<o;a++)l[a]=null;return s?M:M.toP()},o.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,r){e=t.toArray(e,r);var i=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*i)return 6===e[0]?n(e[e.length-1]%2==0):7===e[0]&&n(e[e.length-1]%2==1),this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));if((2===e[0]||3===e[0])&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),3===e[0]);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(e){return this.encode(e,!0)},s.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},s.prototype.encode=function(e,r){return t.encode(this._encode(r),e)},s.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},s.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},s.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var o=0;o<e;o++)i=i.dbl();r.push(i)}return{step:e,points:r}},s.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t},base$1}function requireShort(){if(hasRequiredShort)return short;hasRequiredShort=1;var e=requireUtils$1(),t=requireBn$3(),r=requireInherits_browser(),i=requireBase$1(),n=e.assert;function o(e){i.call(this,"short",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function s(e,r,n,o){i.BasePoint.call(this,e,"affine"),null===r&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(r,16),this.y=new t(n,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function a(e,r,n,o){i.BasePoint.call(this,e,"jacobian"),null===r&&null===n&&null===o?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(r,16),this.y=new t(n,16),this.z=new t(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(o,i),short=o,o.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,i;if(e.beta)r=new t(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);r=(r=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(e.lambda)i=new t(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))?i=s[0]:(i=s[1],n(0===this.g.mul(i).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:i,basis:e.basis?e.basis.map((function(e){return{a:new t(e.a,16),b:new t(e.b,16)}})):this._getEndoBasis(i)}}},o.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:t.mont(e),i=new t(2).toRed(r).redInvm(),n=i.redNeg(),o=new t(3).toRed(r).redNeg().redSqrt().redMul(i);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},o.prototype._getEndoBasis=function(e){for(var r,i,n,o,s,a,u,h,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=e,d=this.n.clone(),p=new t(1),m=new t(0),g=new t(0),y=new t(1),b=0;0!==c.cmpn(0);){var v=d.div(c);h=d.sub(v.mul(c)),f=g.sub(v.mul(p));var w=y.sub(v.mul(m));if(!n&&h.cmp(l)<0)r=u.neg(),i=p,n=h.neg(),o=f;else if(n&&2==++b)break;u=h,d=c,c=h,g=p,p=f,y=m,m=w}s=h.neg(),a=f;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=r,a=i),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),u=n.mul(r.b),h=o.mul(i.b);return{k1:e.sub(s).sub(a),k2:u.add(h).neg()}},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(0!==n.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(r&&!o||!r&&o)&&(n=n.redNeg()),this.point(e,n)},o.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),i[2*o]=a,i[2*o+1]=u,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,i,n,2*o,r),f=0;f<2*o;f++)i[f]=null,n[f]=null;return h},r(s,i.BasePoint),o.prototype.point=function(e,t,r){return new s(this,e,t,r)},o.prototype.pointFromJSON=function(e,t){return s.fromJSON(this,e,t)},s.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},s.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},s.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var o=t[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return this.inf},s.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},s.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.prototype.mul=function(e){return e=new t(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},s.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},s.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},s.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},s.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(a,i.BasePoint),o.prototype.jpoint=function(e,t,r){return new a(this,e,t,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),f=h.redMul(a),l=i.redMul(h),c=u.redSqr().redIAdd(f).redISub(l).redISub(l),d=u.redMul(l.redISub(c)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(c,d,p)},a.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),f=r.redMul(u),l=a.redSqr().redIAdd(h).redISub(f).redISub(f),c=a.redMul(f.redISub(l)).redISub(n.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(l,c,d)},a.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),h=s.redAdd(s);for(t=0;t<e;t++){var f=o.redSqr(),l=h.redSqr(),c=l.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(i.redMul(u)),p=o.redMul(l),m=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=d.redMul(g);y=y.redIAdd(y).redISub(c);var b=h.redMul(a);t+1<e&&(u=u.redMul(c)),o=m,a=b,h=y}return this.curve.jpoint(o,h.redMul(n),a)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i),u=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=u,t=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),c=l.redSqr(),d=this.x.redAdd(l).redSqr().redISub(f).redISub(c);d=d.redIAdd(d);var p=f.redAdd(f).redIAdd(f),m=p.redSqr(),g=c.redIAdd(c);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},a.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);e=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),c=this.x.redMul(l),d=this.x.redSub(f).redMul(this.x.redAdd(f));d=d.redAdd(d).redIAdd(d);var p=c.redIAdd(c),m=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var g=l.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=d.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},a.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(n)),u=t.redAdd(t),h=(u=u.redIAdd(u)).redMul(s),f=a.redSqr().redISub(h.redAdd(h)),l=h.redISub(f),c=s.redSqr();c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=a.redMul(l).redISub(c),p=r.redAdd(r).redMul(i);return this.curve.jpoint(f,d,p)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),o=n.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(i),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=i.redIAdd(i);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),f=t.redMul(h);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(a).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var c=this.y.redMul(h.redMul(u.redISub(h)).redISub(s.redMul(a)));c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(l,c,d)},a.prototype.mul=function(e,r){return e=new t(e,r),this.curve._wnafMul(this,e)},a.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},a.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},a.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},short}function requireMont(){if(hasRequiredMont)return mont;hasRequiredMont=1;var e=requireBn$3(),t=requireInherits_browser(),r=requireBase$1(),i=requireUtils$1();function n(t){r.call(this,"mont",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(t,i,n){r.BasePoint.call(this,t,"projective"),null===i&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(i,16),this.z=new e(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(n,r),mont=n,n.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},t(o,r.BasePoint),n.prototype.decodePoint=function(e,t){return this.point(i.toArray(e,t),1)},n.prototype.point=function(e,t){return new o(this,e,t)},n.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=n.redMul(i),a=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},o.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont}function requireEdwards(){if(hasRequiredEdwards)return edwards;hasRequiredEdwards=1;var e=requireUtils$1(),t=requireBn$3(),r=requireInherits_browser(),i=requireBase$1(),n=e.assert;function o(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,i.call(this,"edwards",e),this.a=new t(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),n(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function s(e,r,n,o,s){i.BasePoint.call(this,e,"projective"),null===r&&null===n&&null===o?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(r,16),this.y=new t(n,16),this.z=o?new t(o,16):this.curve.one,this.t=s&&new t(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(o,i),edwards=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),o=this.one.redSub(this.c2.redMul(this.d).redMul(i)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(r&&!u||!r&&u)&&(a=a.redNeg()),this.point(e,a)},o.prototype.pointFromY=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),o=i.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)},o.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},r(s,i.BasePoint),o.prototype.pointFromJSON=function(e){return s.fromJSON(this,e)},o.prototype.point=function(e,t,r,i){return new s(this,e,t,r,i)},s.fromJSON=function(e,t){return new s(e,t[0],t[1],t[2])},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},s.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),s=o.redSub(r),a=i.redSub(t),u=n.redMul(s),h=o.redMul(a),f=n.redMul(a),l=s.redMul(o);return this.curve.point(u,h,l,f)},s.prototype._projDbl=function(){var e,t,r,i,n,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var h=(i=this.curve._mulA(a)).redAdd(u);this.zOne?(e=s.redSub(a).redSub(u).redMul(h.redSub(this.curve.two)),t=h.redMul(i.redSub(u)),r=h.redSqr().redSub(h).redSub(h)):(n=this.z.redSqr(),o=h.redSub(n).redISub(n),e=s.redSub(a).redISub(u).redMul(o),t=h.redMul(i.redSub(u)),r=h.redMul(o))}else i=a.redAdd(u),n=this.curve._mulC(this.z).redSqr(),o=i.redSub(n).redSub(n),e=this.curve._mulC(s.redISub(i)).redMul(o),t=this.curve._mulC(i).redMul(a.redISub(u)),r=i.redMul(o);return this.curve.point(e,t,r)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=n.redSub(i),a=n.redAdd(i),u=r.redAdd(t),h=o.redMul(s),f=a.redMul(u),l=o.redMul(u),c=s.redMul(a);return this.curve.point(h,f,c,l)},s.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),u=n.redSub(a),h=n.redAdd(a),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),l=i.redMul(u).redMul(f);return this.curve.twisted?(t=i.redMul(h).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(h)):(t=i.redMul(h).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(h)),this.curve.point(l,t,r)},s.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},s.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},s.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},s.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},s.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add,edwards}function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,(e=curve).base=requireBase$1(),e.short=requireShort(),e.mont=requireMont(),e.edwards=requireEdwards()),curve;var e}var curves={},hash={},utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var e=requireMinimalisticAssert(),t=requireInherits_browser();function r(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function i(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}return utils.inherits=t,utils.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)i.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var s=e.charCodeAt(o);s<128?i[n++]=s:s<2048?(i[n++]=s>>6|192,i[n++]=63&s|128):r(e,o)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++o)),i[n++]=s>>18|240,i[n++]=s>>12&63|128,i[n++]=s>>6&63|128,i[n++]=63&s|128):(i[n++]=s>>12|224,i[n++]=s>>6&63|128,i[n++]=63&s|128)}else for(o=0;o<e.length;o++)i[o]=0|e[o];return i},utils.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t},utils.htonl=i,utils.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];"little"===t&&(s=i(s)),r+=o(s.toString(16))}return r},utils.zero2=n,utils.zero8=o,utils.join32=function(t,r,i,n){var o=i-r;e(o%4==0);for(var s=new Array(o/4),a=0,u=r;a<s.length;a++,u+=4){var h;h="big"===n?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=h>>>0}return s},utils.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];"big"===t?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},utils.rotr32=function(e,t){return e>>>t|e<<32-t},utils.rotl32=function(e,t){return e<<t|e>>>32-t},utils.sum32=function(e,t){return e+t>>>0},utils.sum32_3=function(e,t,r){return e+t+r>>>0},utils.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},utils.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},utils.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,s=(o<i?1:0)+r+n;e[t]=s>>>0,e[t+1]=o},utils.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},utils.sum64_lo=function(e,t,r,i){return t+i>>>0},utils.sum64_4_hi=function(e,t,r,i,n,o,s,a){var u=0,h=t;return u+=(h=h+i>>>0)<t?1:0,u+=(h=h+o>>>0)<o?1:0,e+r+n+s+(u+=(h=h+a>>>0)<a?1:0)>>>0},utils.sum64_4_lo=function(e,t,r,i,n,o,s,a){return t+i+o+a>>>0},utils.sum64_5_hi=function(e,t,r,i,n,o,s,a,u,h){var f=0,l=t;return f+=(l=l+i>>>0)<t?1:0,f+=(l=l+o>>>0)<o?1:0,f+=(l=l+a>>>0)<a?1:0,e+r+n+s+u+(f+=(l=l+h>>>0)<h?1:0)>>>0},utils.sum64_5_lo=function(e,t,r,i,n,o,s,a,u,h){return t+i+o+a+h>>>0},utils.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},utils.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},utils.shr64_hi=function(e,t,r){return e>>>r},utils.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},utils}var common$1={},hasRequiredCommon$1;function requireCommon$1(){if(hasRequiredCommon$1)return common$1;hasRequiredCommon$1=1;var e=requireUtils(),t=requireMinimalisticAssert();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return common$1.BlockHash=r,r.prototype.update=function(t,r){if(t=e.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var i=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-i,t.length),0===this.pending.length&&(this.pending=null),t=e.join32(t,0,t.length-i,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},r.prototype.digest=function(e){return this.update(this._pad()),t(null===this.pending),this._digest(e)},r.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i},common$1}var sha={},common={},hasRequiredCommon,_1,hasRequired_1,_256,hasRequired_256,_224,hasRequired_224,_512,hasRequired_512,_384,hasRequired_384,hasRequiredSha;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;var e=requireUtils().rotr32;function t(e,t,r){return e&t^~e&r}function r(e,t,r){return e&t^e&r^t&r}function i(e,t,r){return e^t^r}return common.ft_1=function(e,n,o,s){return 0===e?t(n,o,s):1===e||3===e?i(n,o,s):2===e?r(n,o,s):void 0},common.ch32=t,common.maj32=r,common.p32=i,common.s0_256=function(t){return e(t,2)^e(t,13)^e(t,22)},common.s1_256=function(t){return e(t,6)^e(t,11)^e(t,25)},common.g0_256=function(t){return e(t,7)^e(t,18)^t>>>3},common.g1_256=function(t){return e(t,17)^e(t,19)^t>>>10},common}function require_1(){if(hasRequired_1)return _1;hasRequired_1=1;var e=requireUtils(),t=requireCommon$1(),r=requireCommon(),i=e.rotl32,n=e.sum32,o=e.sum32_5,s=r.ft_1,a=t.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(h,a),_1=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,a=0;a<16;a++)r[a]=e[t+a];for(;a<r.length;a++)r[a]=i(r[a-3]^r[a-8]^r[a-14]^r[a-16],1);var h=this.h[0],f=this.h[1],l=this.h[2],c=this.h[3],d=this.h[4];for(a=0;a<r.length;a++){var p=~~(a/20),m=o(i(h,5),s(p,f,l,c),d,r[a],u[p]);d=c,c=l,l=i(f,30),f=h,h=m}this.h[0]=n(this.h[0],h),this.h[1]=n(this.h[1],f),this.h[2]=n(this.h[2],l),this.h[3]=n(this.h[3],c),this.h[4]=n(this.h[4],d)},h.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},_1}function require_256(){if(hasRequired_256)return _256;hasRequired_256=1;var e=requireUtils(),t=requireCommon$1(),r=requireCommon(),i=requireMinimalisticAssert(),n=e.sum32,o=e.sum32_4,s=e.sum32_5,a=r.ch32,u=r.maj32,h=r.s0_256,f=r.s1_256,l=r.g0_256,c=r.g1_256,d=t.BlockHash,p=[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 m(){if(!(this instanceof m))return new m;d.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return e.inherits(m,d),_256=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(e,t){for(var r=this.W,d=0;d<16;d++)r[d]=e[t+d];for(;d<r.length;d++)r[d]=o(c(r[d-2]),r[d-7],l(r[d-15]),r[d-16]);var p=this.h[0],m=this.h[1],g=this.h[2],y=this.h[3],b=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(i(this.k.length===r.length),d=0;d<r.length;d++){var M=s(_,f(b),a(b,v,w),this.k[d],r[d]),S=n(h(p),u(p,m,g));_=w,w=v,v=b,b=n(y,M),y=g,g=m,m=p,p=n(M,S)}this.h[0]=n(this.h[0],p),this.h[1]=n(this.h[1],m),this.h[2]=n(this.h[2],g),this.h[3]=n(this.h[3],y),this.h[4]=n(this.h[4],b),this.h[5]=n(this.h[5],v),this.h[6]=n(this.h[6],w),this.h[7]=n(this.h[7],_)},m.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},_256}function require_224(){if(hasRequired_224)return _224;hasRequired_224=1;var e=requireUtils(),t=require_256();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return e.inherits(r,t),_224=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,7),"big"):e.split32(this.h.slice(0,7),"big")},_224}function require_512(){if(hasRequired_512)return _512;hasRequired_512=1;var e=requireUtils(),t=requireCommon$1(),r=requireMinimalisticAssert(),i=e.rotr64_hi,n=e.rotr64_lo,o=e.shr64_hi,s=e.shr64_lo,a=e.sum64,u=e.sum64_hi,h=e.sum64_lo,f=e.sum64_4_hi,l=e.sum64_4_lo,c=e.sum64_5_hi,d=e.sum64_5_lo,p=t.BlockHash,m=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function g(){if(!(this instanceof g))return new g;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function y(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function b(e,t,r,i,n,o){var s=t&i^~t&o;return s<0&&(s+=4294967296),s}function v(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function w(e,t,r,i,n,o){var s=t&i^t&o^i&o;return s<0&&(s+=4294967296),s}function _(e,t){var r=i(e,t,28)^i(t,e,2)^i(t,e,7);return r<0&&(r+=4294967296),r}function M(e,t){var r=n(e,t,28)^n(t,e,2)^n(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=i(e,t,14)^i(e,t,18)^i(t,e,9);return r<0&&(r+=4294967296),r}function E(e,t){var r=n(e,t,14)^n(e,t,18)^n(t,e,9);return r<0&&(r+=4294967296),r}function R(e,t){var r=i(e,t,1)^i(e,t,8)^o(e,t,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=n(e,t,1)^n(e,t,8)^s(e,t,7);return r<0&&(r+=4294967296),r}function q(e,t){var r=i(e,t,19)^i(t,e,29)^o(e,t,6);return r<0&&(r+=4294967296),r}function C(e,t){var r=n(e,t,19)^n(t,e,29)^s(e,t,6);return r<0&&(r+=4294967296),r}return e.inherits(g,p),_512=g,g.blockSize=1024,g.outSize=512,g.hmacStrength=192,g.padLength=128,g.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=q(r[i-4],r[i-3]),o=C(r[i-4],r[i-3]),s=r[i-14],a=r[i-13],u=R(r[i-30],r[i-29]),h=A(r[i-30],r[i-29]),c=r[i-32],d=r[i-31];r[i]=f(n,o,s,a,u,h,c,d),r[i+1]=l(n,o,s,a,u,h,c,d)}},g.prototype._update=function(e,t){this._prepareBlock(e,t);var i=this.W,n=this.h[0],o=this.h[1],s=this.h[2],f=this.h[3],l=this.h[4],p=this.h[5],m=this.h[6],g=this.h[7],R=this.h[8],A=this.h[9],q=this.h[10],C=this.h[11],P=this.h[12],B=this.h[13],I=this.h[14],O=this.h[15];r(this.k.length===i.length);for(var k=0;k<i.length;k+=2){var T=I,N=O,x=S(R,A),j=E(R,A),$=y(R,A,q,C,P),D=b(R,A,q,C,P,B),U=this.k[k],L=this.k[k+1],F=i[k],z=i[k+1],K=c(T,N,x,j,$,D,U,L,F,z),W=d(T,N,x,j,$,D,U,L,F,z);T=_(n,o),N=M(n,o),x=v(n,o,s,f,l),j=w(n,o,s,f,l,p);var H=u(T,N,x,j),G=h(T,N,x,j);I=P,O=B,P=q,B=C,q=R,C=A,R=u(m,g,K,W),A=h(g,g,K,W),m=l,g=p,l=s,p=f,s=n,f=o,n=u(K,W,H,G),o=h(K,W,H,G)}a(this.h,0,n,o),a(this.h,2,s,f),a(this.h,4,l,p),a(this.h,6,m,g),a(this.h,8,R,A),a(this.h,10,q,C),a(this.h,12,P,B),a(this.h,14,I,O)},g.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},_512}function require_384(){if(hasRequired_384)return _384;hasRequired_384=1;var e=requireUtils(),t=require_512();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return e.inherits(r,t),_384=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,12),"big"):e.split32(this.h.slice(0,12),"big")},_384}function requireSha(){return hasRequiredSha||(hasRequiredSha=1,sha.sha1=require_1(),sha.sha224=require_224(),sha.sha256=require_256(),sha.sha384=require_384(),sha.sha512=require_512()),sha}var ripemd={},hasRequiredRipemd,hmac$2,hasRequiredHmac$1,hasRequiredHash,secp256k1,hasRequiredSecp256k1,hasRequiredCurves,hmacDrbg,hasRequiredHmacDrbg,key$1,hasRequiredKey$1,signature$1,hasRequiredSignature$1,ec,hasRequiredEc,key,hasRequiredKey,signature,hasRequiredSignature,eddsa,hasRequiredEddsa,hasRequiredElliptic;function requireRipemd(){if(hasRequiredRipemd)return ripemd;hasRequiredRipemd=1;var e=requireUtils(),t=requireCommon$1(),r=e.rotl32,i=e.sum32,n=e.sum32_3,o=e.sum32_4,s=t.BlockHash;function a(){if(!(this instanceof a))return new a;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function f(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}e.inherits(a,s),ripemd.ripemd160=a,a.blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(e,t){for(var s=this.h[0],a=this.h[1],m=this.h[2],g=this.h[3],y=this.h[4],b=s,v=a,w=m,_=g,M=y,S=0;S<80;S++){var E=i(r(o(s,u(S,a,m,g),e[l[S]+t],h(S)),d[S]),y);s=y,y=g,g=r(m,10),m=a,a=E,E=i(r(o(b,u(79-S,v,w,_),e[c[S]+t],f(S)),p[S]),M),b=M,M=_,_=r(w,10),w=v,v=E}E=n(this.h[1],m,_),this.h[1]=n(this.h[2],g,M),this.h[2]=n(this.h[3],y,b),this.h[3]=n(this.h[4],s,v),this.h[4]=n(this.h[0],a,w),this.h[0]=E},a.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"little"):e.split32(this.h,"little")};var l=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],d=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return ripemd}function requireHmac$1(){if(hasRequiredHmac$1)return hmac$2;hasRequiredHmac$1=1;var e=requireUtils(),t=requireMinimalisticAssert();function r(t,i,n){if(!(this instanceof r))return new r(t,i,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(e.toArray(i,n))}return hmac$2=r,r.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),t(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=(new this.Hash).update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=(new this.Hash).update(e)},r.prototype.update=function(e,t){return this.inner.update(e,t),this},r.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},hmac$2}function requireHash(){return hasRequiredHash||(hasRequiredHash=1,(e=hash).utils=requireUtils(),e.common=requireCommon$1(),e.sha=requireSha(),e.ripemd=requireRipemd(),e.hmac=requireHmac$1(),e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160),hash;var e}function requireSecp256k1(){return hasRequiredSecp256k1?secp256k1:(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,function(e){var t,r=e,i=requireHash(),n=requireCurve(),o=requireUtils$1().assert;function s(e){"short"===e.type?this.curve=new n.short(e):"edwards"===e.type?this.curve=new n.edwards(e):this.curve=new n.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var i=new s(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=s,a("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:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:i.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"]}),a("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:i.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),a("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:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=requireSecp256k1()}catch(e){t=void 0}a("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:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(curves)),curves}function requireHmacDrbg(){if(hasRequiredHmacDrbg)return hmacDrbg;hasRequiredHmacDrbg=1;var e=requireHash(),t=requireUtils$2(),r=requireMinimalisticAssert();function i(e){if(!(this instanceof i))return new i(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=t.toArray(e.entropy,e.entropyEnc||"hex"),o=t.toArray(e.nonce,e.nonceEnc||"hex"),s=t.toArray(e.pers,e.persEnc||"hex");r(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,o,s)}return hmacDrbg=i,i.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new e.hmac(this.hash,this.K)},i.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(e,i,n,o){"string"!=typeof i&&(o=n,n=i,i=null),e=t.toArray(e,i),n=t.toArray(n,o),r(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},i.prototype.generate=function(e,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(n=i,i=r,r=null),i&&(i=t.toArray(i,n||"hex"),this._update(i));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(i),this._reseed++,t.encode(s,r)},hmacDrbg}function requireKey$1(){if(hasRequiredKey$1)return key$1;hasRequiredKey$1=1;var e=requireBn$3(),t=requireUtils$1().assert;function r(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}return key$1=r,r.fromPublic=function(e,t,i){return t instanceof r?t:new r(e,{pub:t,pubEnc:i})},r.fromPrivate=function(e,t,i){return t instanceof r?t:new r(e,{priv:t,privEnc:i})},r.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},r.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(t,r){this.priv=new e(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(e,r){if(e.x||e.y)return"mont"===this.ec.curve.type?t(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||t(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,r)},r.prototype.derive=function(e){return e.validate()||t(e.validate(),"public point not validated"),e.mul(this.priv).getX()},r.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},r.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},key$1}function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1;var e=requireBn$3(),t=requireUtils$1(),r=t.assert;function i(t,n){if(t instanceof i)return t;this._importDER(t,n)||(r(t.r&&t.s,"Signature without r or s"),this.r=new e(t.r,16),this.s=new e(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function n(){this.place=0}function o(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;if(0===e[t.place])return!1;for(var n=0,o=0,s=t.place;o<i;o++,s++)n<<=8,n|=e[s],n>>>=0;return!(n<=127)&&(t.place=s,n)}function s(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function a(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}return signature$1=i,i.prototype._importDER=function(r,i){r=t.toArray(r,i);var s=new n;if(48!==r[s.place++])return!1;var a=o(r,s);if(!1===a)return!1;if(a+s.place!==r.length)return!1;if(2!==r[s.place++])return!1;var u=o(r,s);if(!1===u)return!1;if(128&r[s.place])return!1;var h=r.slice(s.place,u+s.place);if(s.place+=u,2!==r[s.place++])return!1;var f=o(r,s);if(!1===f)return!1;if(r.length!==f+s.place)return!1;if(128&r[s.place])return!1;var l=r.slice(s.place,f+s.place);if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new e(h),this.s=new e(l),this.recoveryParam=null,!0},i.prototype.toDER=function(e){var r=this.r.toArray(),i=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&i[0]&&(i=[0].concat(i)),r=s(r),i=s(i);!(i[0]||128&i[1]);)i=i.slice(1);var n=[2];a(n,r.length),(n=n.concat(r)).push(2),a(n,i.length);var o=n.concat(i),u=[48];return a(u,o.length),u=u.concat(o),t.encode(u,e)},signature$1}function requireEc(){if(hasRequiredEc)return ec;hasRequiredEc=1;var e=requireBn$3(),t=requireHmacDrbg(),r=requireUtils$1(),i=requireCurves(),n=requireBrorand(),o=r.assert,s=requireKey$1(),a=requireSignature$1();function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(o(Object.prototype.hasOwnProperty.call(i,e),"Unknown curve "+e),e=i[e]),e instanceof i.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}return ec=u,u.prototype.keyPair=function(e){return new s(this,e)},u.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},u.prototype.genKeyPair=function(r){r||(r={});for(var i=new t({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||n(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),s=this.n.sub(new e(2));;){var a=new e(i.generate(o));if(!(a.cmp(s)>0))return a.iaddn(1),this.keyFromPrivate(a)}},u.prototype._truncateToN=function(t,r,i){var n;if(e.isBN(t)||"number"==typeof t)n=(t=new e(t,16)).byteLength();else if("object"==typeof t)n=t.length,t=new e(t,16);else{var o=t.toString();n=o.length+1>>>1,t=new e(o,16)}"number"!=typeof i&&(i=8*n);var s=i-this.n.bitLength();return s>0&&(t=t.ushrn(s)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},u.prototype.sign=function(r,i,n,s){if("object"==typeof n&&(s=n,n=null),s||(s={}),"string"!=typeof r&&"number"!=typeof r&&!e.isBN(r)){o("object"==typeof r&&r&&"number"==typeof r.length,"Expected message to be an array-like, a hex string, or a BN instance"),o(r.length>>>0===r.length);for(var u=0;u<r.length;u++)o((255&r[u])===r[u])}i=this.keyFromPrivate(i,n),r=this._truncateToN(r,!1,s.msgBitLength),o(!r.isNeg(),"Can not sign a negative message");var h=this.n.byteLength(),f=i.getPrivate().toArray("be",h),l=r.toArray("be",h);o(new e(l).eq(r),"Can not sign message");for(var c=new t({hash:this.hash,entropy:f,nonce:l,pers:s.pers,persEnc:s.persEnc||"utf8"}),d=this.n.sub(new e(1)),p=0;;p++){var m=s.k?s.k(p):new e(c.generate(this.n.byteLength()));if(!((m=this._truncateToN(m,!0)).cmpn(1)<=0||m.cmp(d)>=0)){var g=this.g.mul(m);if(!g.isInfinity()){var y=g.getX(),b=y.umod(this.n);if(0!==b.cmpn(0)){var v=m.invm(this.n).mul(b.mul(i.getPrivate()).iadd(r));if(0!==(v=v.umod(this.n)).cmpn(0)){var w=(g.getY().isOdd()?1:0)|(0!==y.cmp(b)?2:0);return s.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),w^=1),new a({r:b,s:v,recoveryParam:w})}}}}}},u.prototype.verify=function(e,t,r,i,n){n||(n={}),e=this._truncateToN(e,!1,n.msgBitLength),r=this.keyFromPublic(r,i);var o=(t=new a(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var u,h=s.invm(this.n),f=h.mul(e).umod(this.n),l=h.mul(o).umod(this.n);return this.curve._maxwellTrick?!(u=this.g.jmulAdd(f,r.getPublic(),l)).isInfinity()&&u.eqXToP(o):!(u=this.g.mulAdd(f,r.getPublic(),l)).isInfinity()&&0===u.getX().umod(this.n).cmp(o)},u.prototype.recoverPubKey=function(t,r,i,n){o((3&i)===i,"The recovery param is more than two bits"),r=new a(r,n);var s=this.n,u=new e(t),h=r.r,f=r.s,l=1&i,c=i>>1;if(h.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");h=c?this.curve.pointFromX(h.add(this.curve.n),l):this.curve.pointFromX(h,l);var d=r.r.invm(s),p=s.sub(u).mul(d).umod(s),m=f.mul(d).umod(s);return this.g.mulAdd(p,h,m)},u.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new a(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")},ec}function requireKey(){if(hasRequiredKey)return key;hasRequiredKey=1;var e=requireUtils$1(),t=e.assert,r=e.parseBytes,i=e.cachedProperty;function n(e,t){this.eddsa=e,this._secret=r(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=r(t.pub)}return n.fromPublic=function(e,t){return t instanceof n?t:new n(e,{pub:t})},n.fromSecret=function(e,t){return t instanceof n?t:new n(e,{secret:t})},n.prototype.secret=function(){return this._secret},i(n,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),i(n,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),i(n,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),i(n,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),i(n,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),i(n,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),n.prototype.sign=function(e){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},n.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},n.prototype.getSecret=function(r){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),r)},n.prototype.getPublic=function(t){return e.encode(this.pubBytes(),t)},key=n}function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var e=requireBn$3(),t=requireUtils$1(),r=t.assert,i=t.cachedProperty,n=t.parseBytes;function o(t,i){this.eddsa=t,"object"!=typeof i&&(i=n(i)),Array.isArray(i)&&(r(i.length===2*t.encodingLength,"Signature has invalid size"),i={R:i.slice(0,t.encodingLength),S:i.slice(t.encodingLength)}),r(i.R&&i.S,"Signature without R or S"),t.isPoint(i.R)&&(this._R=i.R),i.S instanceof e&&(this._S=i.S),this._Rencoded=Array.isArray(i.R)?i.R:i.Rencoded,this._Sencoded=Array.isArray(i.S)?i.S:i.Sencoded}return i(o,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),i(o,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),i(o,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),i(o,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},signature=o}function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;var e=requireHash(),t=requireCurves(),r=requireUtils$1(),i=r.assert,n=r.parseBytes,o=requireKey(),s=requireSignature();function a(r){if(i("ed25519"===r,"only tested with ed25519 so far"),!(this instanceof a))return new a(r);r=t[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=e.sha512}return eddsa=a,a.prototype.sign=function(e,t){e=n(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),o=this.g.mul(i),s=this.encodePoint(o),a=this.hashInt(s,r.pubBytes(),e).mul(r.priv()),u=i.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:u,Rencoded:s})},a.prototype.verify=function(e,t,r){if(e=n(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var i=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),i.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(i.pub().mul(o)).eq(s)},a.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return r.intFromLE(e.digest()).umod(this.curve.n)},a.prototype.keyFromPublic=function(e){return o.fromPublic(this,e)},a.prototype.keyFromSecret=function(e){return o.fromSecret(this,e)},a.prototype.makeSignature=function(e){return e instanceof s?e:new s(this,e)},a.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},a.prototype.decodePoint=function(e){var t=(e=r.parseBytes(e)).length-1,i=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),o=r.intFromLE(i);return this.curve.pointFromY(o,n)},a.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},a.prototype.decodeInt=function(e){return r.intFromLE(e)},a.prototype.isPoint=function(e){return e instanceof this.pointClass},eddsa}function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,(e=elliptic).version=require$$0.version,e.utils=requireUtils$1(),e.rand=requireBrorand(),e.curve=requireCurve(),e.curves=requireCurves(),e.ec=requireEc(),e.eddsa=requireEddsa()),elliptic;var e}var asn1$1={},asn1={},bn$5={exports:{}},bn$4=bn$5.exports,hasRequiredBn$2;function requireBn$2(){return hasRequiredBn$2||(hasRequiredBn$2=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$5,bn$4)),bn$5.exports}var api={},vmBrowserify={},hasRequiredVmBrowserify,hasRequiredApi;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,function(exports$1){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(e){return function(e,t,r){e[t]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports$1.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,i=r.eval,n=r.execScript;!i&&n&&(n.call(r,"null"),i=r.eval),forEach(Object_keys(e),(function(t){r[t]=e[t]})),forEach(globals,(function(t){e[t]&&(r[t]=e[t])}));var o=Object_keys(r),s=i.call(r,this.code);return forEach(Object_keys(r),(function(t){(t in e||-1===indexOf(o,t))&&(e[t]=r[t])})),forEach(globals,(function(t){t in e||defineProp(e,t,r[t])})),document.body.removeChild(t),s},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return e&&forEach(Object_keys(t),(function(r){e[r]=t[r]})),r},forEach(Object_keys(Script.prototype),(function(e){exports$1[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}})),exports$1.isContext=function(e){return e instanceof Context},exports$1.createScript=function(e){return exports$1.Script(e)},exports$1.createContext=Script.createContext=function(e){var t=new Context;return"object"==typeof e&&forEach(Object_keys(e),(function(r){t[r]=e[r]})),t}}(vmBrowserify)),vmBrowserify}function requireApi(){return hasRequiredApi||(hasRequiredApi=1,function(e){var t=requireAsn1$1(),r=requireInherits_browser();function i(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}e.define=function(e,t){return new i(e,t)},i.prototype._createNamed=function(e){var t;try{t=requireVmBrowserify().runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return r(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},i.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(t.decoders[e])),this.decoders[e]},i.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},i.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(t.encoders[e])),this.encoders[e]},i.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}}(api)),api}var base={},reporter={},hasRequiredReporter;function requireReporter(){if(hasRequiredReporter)return reporter;hasRequiredReporter=1;var e=requireInherits_browser();function t(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function r(e,t){this.path=e,this.rethrow(t)}return reporter.Reporter=t,t.prototype.isError=function(e){return e instanceof r},t.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},t.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},t.prototype.enterKey=function(e){return this._reporterState.path.push(e)},t.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},t.prototype.leaveKey=function(e,t,r){var i=this._reporterState;this.exitKey(e),null!==i.obj&&(i.obj[t]=r)},t.prototype.path=function(){return this._reporterState.path.join("/")},t.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},t.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},t.prototype.error=function(e){var t,i=this._reporterState,n=e instanceof r;if(t=n?e:new r(i.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!i.options.partial)throw t;return n||i.errors.push(t),t},t.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},e(r,Error),r.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,r),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this},reporter}var buffer={},hasRequiredBuffer,node,hasRequiredNode,hasRequiredBase;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;var e=requireInherits_browser(),t=requireBase().Reporter,r=requireDist().Buffer;function i(e,i){t.call(this,i),r.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function n(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof n||(e=new n(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=r.byteLength(e);else{if(!r.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}return e(i,t),buffer.DecoderBuffer=i,i.prototype.save=function(){return{offset:this.offset,reporter:t.prototype.save.call(this)}},i.prototype.restore=function(e){var r=new i(this.base);return r.offset=e.offset,r.length=this.offset,this.offset=e.offset,t.prototype.restore.call(this,e.reporter),r},i.prototype.isEmpty=function(){return this.offset===this.length},i.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},i.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new i(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},i.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},buffer.EncoderBuffer=n,n.prototype.join=function(e,t){return e||(e=new r(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(e,t),t+=r.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):r.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e},buffer}function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var e=requireBase().Reporter,t=requireBase().EncoderBuffer,r=requireBase().DecoderBuffer,i=requireMinimalisticAssert(),n=["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"],o=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(n);function s(e,t){var r={};this._baseState=r,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())}node=s;var a=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return s.prototype.clone=function(){var e=this._baseState,t={};a.forEach((function(r){t[r]=e[r]}));var r=new this.constructor(t.parent);return r._baseState=t,r},s.prototype._wrap=function(){var e=this._baseState;o.forEach((function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},s.prototype._init=function(e){var t=this._baseState;i(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),i.equal(t.children.length,1,"Root node can have only one child")},s.prototype._useArgs=function(e){var t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(i(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(i(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(r){r==(0|r)&&(r|=0);var i=e[r];t[i]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){s.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),n.forEach((function(e){s.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return i(null===t.tag),t.tag=e,this._useArgs(r),this}})),s.prototype.use=function(e){i(e);var t=this._baseState;return i(null===t.use),t.use=e,this},s.prototype.optional=function(){return this._baseState.optional=!0,this},s.prototype.def=function(e){var t=this._baseState;return i(null===t.default),t.default=e,t.optional=!0,this},s.prototype.explicit=function(e){var t=this._baseState;return i(null===t.explicit&&null===t.implicit),t.explicit=e,this},s.prototype.implicit=function(e){var t=this._baseState;return i(null===t.explicit&&null===t.implicit),t.implicit=e,this},s.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},s.prototype.key=function(e){var t=this._baseState;return i(null===t.key),t.key=e,this},s.prototype.any=function(){return this._baseState.any=!0,this},s.prototype.choice=function(e){var t=this._baseState;return i(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},s.prototype.contains=function(e){var t=this._baseState;return i(null===t.use),t.contains=e,this},s.prototype._decode=function(e,t){var i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,t));var n,o=i.default,s=!0,a=null;if(null!==i.key&&(a=e.enterKey(i.key)),i.optional){var u=null;if(null!==i.explicit?u=i.explicit:null!==i.implicit?u=i.implicit:null!==i.tag&&(u=i.tag),null!==u||i.any){if(s=this._peekTag(e,u,i.any),e.isError(s))return s}else{var h=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),s=!0}catch(e){s=!1}e.restore(h)}}if(i.obj&&s&&(n=e.enterObject()),s){if(null!==i.explicit){var f=this._decodeTag(e,i.explicit);if(e.isError(f))return f;e=f}var l=e.offset;if(null===i.use&&null===i.choice){if(i.any)h=e.save();var c=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(c))return c;i.any?o=e.raw(h):e=c}if(t&&t.track&&null!==i.tag&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(o=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(o))return o;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(r){r._decode(e,t)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){var d=new r(o);o=this._getUse(i.contains,e._reporterState.obj)._decode(d,t)}}return i.obj&&s&&(o=e.leaveObject(n)),null===i.key||null===o&&!0!==s?null!==a&&e.exitKey(a):e.leaveKey(a,i.key,o),o},s.prototype._decodeGeneric=function(e,t,r){var i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},s.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),i(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},s.prototype._decodeChoice=function(e,t){var r=this._baseState,i=null,n=!1;return Object.keys(r.choice).some((function(o){var s=e.save(),a=r.choice[o];try{var u=a._decode(e,t);if(e.isError(u))return!1;i={type:o,value:u},n=!0}catch(t){return e.restore(s),!1}return!0}),this),n?i:e.error("Choice not matched")},s.prototype._createEncoderBuffer=function(e){return new t(e,this.reporter)},s.prototype._encode=function(e,t,r){var i=this._baseState;if(null===i.default||i.default!==e){var n=this._encodeValue(e,t,r);if(void 0!==n&&!this._skipDefault(n,t,r))return n}},s.prototype._encodeValue=function(t,r,i){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,r||new e);var o=null;if(this.reporter=r,n.optional&&void 0===t){if(null===n.default)return;t=n.default}var s=null,a=!1;if(n.any)o=this._createEncoderBuffer(t);else if(n.choice)o=this._encodeChoice(t,r);else if(n.contains)s=this._getUse(n.contains,i)._encode(t,r),a=!0;else if(n.children)s=n.children.map((function(e){if("null_"===e._baseState.tag)return e._encode(null,r,t);if(null===e._baseState.key)return r.error("Child should have a key");var i=r.enterKey(e._baseState.key);if("object"!=typeof t)return r.error("Child expected, but input is not object");var n=e._encode(t[e._baseState.key],r,t);return r.leaveKey(i),n}),this).filter((function(e){return e})),s=this._createEncoderBuffer(s);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return r.error("Too many args for : "+n.tag);if(!Array.isArray(t))return r.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(e){var i=this._baseState;return this._getUse(i.args[0],t)._encode(e,r)}),u))}else null!==n.use?o=this._getUse(n.use,i)._encode(t,r):(s=this._encodePrimitive(n.tag,t),a=!0);if(!n.any&&null===n.choice){var h=null!==n.implicit?n.implicit:n.tag,f=null===n.implicit?"universal":"context";null===h?null===n.use&&r.error("Tag could be omitted only for .use()"):null===n.use&&(o=this._encodeComposite(h,a,f,s))}return null!==n.explicit&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o},s.prototype._encodeChoice=function(e,t){var r=this._baseState,n=r.choice[e.type];return n||i(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},s.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.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,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},s.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},s.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)},node}function requireBase(){return hasRequiredBase||(hasRequiredBase=1,(e=base).Reporter=requireReporter().Reporter,e.DecoderBuffer=requireBuffer().DecoderBuffer,e.EncoderBuffer=requireBuffer().EncoderBuffer,e.Node=requireNode()),base;var e}var constants={},der={},hasRequiredDer$2,hasRequiredConstants;function requireDer$2(){return hasRequiredDer$2||(hasRequiredDer$2=1,e=der,t=requireConstants(),e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t._reverse(e.tagClass),e.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"},e.tagByName=t._reverse(e.tag)),der;var e,t}function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,(e=constants)._reverse=function(e){var t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);var i=e[r];t[i]=r})),t},e.der=requireDer$2()),constants;var e}var decoders={},der_1$1,hasRequiredDer$1,pem$1,hasRequiredPem$1,hasRequiredDecoders;function requireDer$1(){if(hasRequiredDer$1)return der_1$1;hasRequiredDer$1=1;var e=requireInherits_browser(),t=requireAsn1$1(),r=t.base,i=t.bignum,n=t.constants.der;function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new s,this.tree._init(e.body)}function s(e){r.Node.call(this,"der",e)}function a(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var i=n.tagClass[r>>6],o=!(32&r);if(31&~r)r&=31;else{var s=r;for(r=0;!(128&~s);){if(s=e.readUInt8(t),e.isError(s))return s;r<<=7,r|=127&s}}return{cls:i,primitive:o,tag:r,tagStr:n.tag[r]}}function u(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(!(128&i))return i;var n=127&i;if(n>4)return e.error("length octect is too long");i=0;for(var o=0;o<n;o++){i<<=8;var s=e.readUInt8(r);if(e.isError(s))return s;i|=s}return i}return der_1$1=o,o.prototype.decode=function(e,t){return e instanceof r.DecoderBuffer||(e=new r.DecoderBuffer(e,t)),this.tree._decode(e,t)},e(s,r.Node),s.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;var i=e.save(),n=a(e,'Failed to peek tag: "'+t+'"');return e.isError(n)?n:(e.restore(i),n.tag===t||n.tagStr===t||n.tagStr+"of"===t||r)},s.prototype._decodeTag=function(e,t,r){var i=a(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;var n=u(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!r&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(i.primitive||null!==n)return e.skip(n,'Failed to match body of: "'+t+'"');var o=e.save(),s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(s)?s:(n=e.offset-o.offset,e.restore(o),e.skip(n,'Failed to match body of: "'+t+'"'))},s.prototype._skipUntilEnd=function(e,t){for(;;){var r=a(e,t);if(e.isError(r))return r;var i,n=u(e,r.primitive,t);if(e.isError(n))return n;if(i=r.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===r.tagStr)break}},s.prototype._decodeList=function(e,t,r,i){for(var n=[];!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var s=r.decode(e,"der",i);if(e.isError(s)&&o)break;n.push(s)}return n},s.prototype._decodeStr=function(e,t){if("bitstr"===t){var r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}if("bmpstr"===t){var i=e.raw();if(i.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var n="",o=0;o<i.length/2;o++)n+=String.fromCharCode(i.readUInt16BE(2*o));return n}if("numstr"===t){var s=e.raw().toString("ascii");return this._isNumstr(s)?s:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var a=e.raw().toString("ascii");return this._isPrintstr(a)?a:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},s.prototype._decodeObjid=function(e,t,r){for(var i,n=[],o=0;!e.isEmpty();){var s=e.readUInt8();o<<=7,o|=127&s,128&s||(n.push(o),o=0)}128&s&&n.push(o);var a=n[0]/40|0,u=n[0]%40;if(i=r?n:[a,u].concat(n.slice(1)),t){var h=t[i.join(" ")];void 0===h&&(h=t[i.join(".")]),void 0!==h&&(i=h)}return i},s.prototype._decodeTime=function(e,t){var r=e.raw().toString();if("gentime"===t)var i=0|r.slice(0,4),n=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");i=0|r.slice(0,2),n=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),u=0|r.slice(10,12);i=i<70?2e3+i:1900+i}return Date.UTC(i,n-1,o,s,a,u,0)},s.prototype._decodeNull=function(e){return null},s.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},s.prototype._decodeInt=function(e,t){var r=e.raw(),n=new i(r);return t&&(n=t[n.toString(10)]||n),n},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree},der_1$1}function requirePem$1(){if(hasRequiredPem$1)return pem$1;hasRequiredPem$1=1;var e=requireInherits_browser(),t=requireDist().Buffer,r=requireDer$1();function i(e){r.call(this,e),this.enc="pem"}return e(i,r),pem$1=i,i.prototype.decode=function(e,i){for(var n=e.toString().split(/[\r\n]+/g),o=i.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,u=-1,h=0;h<n.length;h++){var f=n[h].match(s);if(null!==f&&f[2]===o){if(-1!==a){if("END"!==f[1])break;u=h;break}if("BEGIN"!==f[1])break;a=h}}if(-1===a||-1===u)throw new Error("PEM section not found for: "+o);var l=n.slice(a+1,u).join("");l.replace(/[^a-z0-9\+\/=]+/gi,"");var c=new t(l,"base64");return r.prototype.decode.call(this,c,i)},pem$1}function requireDecoders(){return hasRequiredDecoders||(hasRequiredDecoders=1,(e=decoders).der=requireDer$1(),e.pem=requirePem$1()),decoders;var e}var encoders={},der_1,hasRequiredDer,pem,hasRequiredPem,hasRequiredEncoders,hasRequiredAsn1$1,certificate,hasRequiredCertificate,hasRequiredAsn1;function requireDer(){if(hasRequiredDer)return der_1;hasRequiredDer=1;var e=requireInherits_browser(),t=requireDist().Buffer,r=requireAsn1$1(),i=r.base,n=r.constants.der;function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new s,this.tree._init(e.body)}function s(e){i.Node.call(this,"der",e)}function a(e){return e<10?"0"+e:e}return der_1=o,o.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},e(s,i.Node),s.prototype._encodeComposite=function(e,r,i,o){var s,a=function(e,t,r,i){var o;"seqof"===e?e="seq":"setof"===e&&(e="set");if(n.tagByName.hasOwnProperty(e))o=n.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return i.error("Unknown tag: "+e);o=e}if(o>=31)return i.error("Multi-octet tag encoding unsupported");t||(o|=32);return o|=n.tagClassByName[r||"universal"]<<6,o}(e,r,i,this.reporter);if(o.length<128)return(s=new t(2))[0]=a,s[1]=o.length,this._createEncoderBuffer([s,o]);for(var u=1,h=o.length;h>=256;h>>=8)u++;(s=new t(2+u))[0]=a,s[1]=128|u;h=1+u;for(var f=o.length;f>0;h--,f>>=8)s[h]=255&f;return this._createEncoderBuffer([s,o])},s.prototype._encodeStr=function(e,r){if("bitstr"===r)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===r){for(var i=new t(2*e.length),n=0;n<e.length;n++)i.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(i)}return"numstr"===r?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===r?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(r)||"objDesc"===r?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+r+" unsupported")},s.prototype._encodeObjid=function(e,r,i){if("string"==typeof e){if(!r)return this.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=r[e].split(/[\s\.]+/g);for(var n=0;n<e.length;n++)e[n]|=0}else if(Array.isArray(e)){e=e.slice();for(n=0;n<e.length;n++)e[n]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!i){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(n=0;n<e.length;n++){var s=e[n];for(o++;s>=128;s>>=7)o++}var a=new t(o),u=a.length-1;for(n=e.length-1;n>=0;n--){s=e[n];for(a[u--]=127&s;(s>>=7)>0;)a[u--]=128|127&s}return this._createEncoderBuffer(a)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[a(i.getFullYear()),a(i.getUTCMonth()+1),a(i.getUTCDate()),a(i.getUTCHours()),a(i.getUTCMinutes()),a(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[a(i.getFullYear()%100),a(i.getUTCMonth()+1),a(i.getUTCDate()),a(i.getUTCHours()),a(i.getUTCMinutes()),a(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(e,r){if("string"==typeof e){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=r[e]}if("number"!=typeof e&&!t.isBuffer(e)){var i=e.toArray();!e.sign&&128&i[0]&&i.unshift(0),e=new t(i)}if(t.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new t(n);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]);n=1;for(var s=e;s>=256;s>>=8)n++;for(s=(o=new Array(n)).length-1;s>=0;s--)o[s]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new t(o))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0},der_1}function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var e=requireInherits_browser(),t=requireDer();function r(e){t.call(this,e),this.enc="pem"}return e(r,t),pem=r,r.prototype.encode=function(e,r){for(var i=t.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+r.label+"-----"],o=0;o<i.length;o+=64)n.push(i.slice(o,o+64));return n.push("-----END "+r.label+"-----"),n.join("\n")},pem}function requireEncoders(){return hasRequiredEncoders||(hasRequiredEncoders=1,(e=encoders).der=requireDer(),e.pem=requirePem()),encoders;var e}function requireAsn1$1(){return hasRequiredAsn1$1||(hasRequiredAsn1$1=1,(e=asn1).bignum=requireBn$2(),e.define=requireApi().define,e.base=requireBase(),e.constants=requireConstants(),e.decoders=requireDecoders(),e.encoders=requireEncoders()),asn1;var e}function requireCertificate(){if(hasRequiredCertificate)return certificate;hasRequiredCertificate=1;var e=requireAsn1$1(),t=e.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),r=e.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),i=e.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),n=e.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())})),o=e.define("RelativeDistinguishedName",(function(){this.setof(r)})),s=e.define("RDNSequence",(function(){this.seqof(o)})),a=e.define("Name",(function(){this.choice({rdnSequence:this.use(s)})})),u=e.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(t),this.key("notAfter").use(t))})),h=e.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),f=e.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(i),this.key("issuer").use(a),this.key("validity").use(u),this.key("subject").use(a),this.key("subjectPublicKeyInfo").use(n),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),l=e.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(f),this.key("signatureAlgorithm").use(i),this.key("signatureValue").bitstr())}));return certificate=l}function requireAsn1(){if(hasRequiredAsn1)return asn1$1;hasRequiredAsn1=1;var e=requireAsn1$1();asn1$1.certificate=requireCertificate();var t=e.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));asn1$1.RSAPrivateKey=t;var r=e.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));asn1$1.RSAPublicKey=r;var i=e.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),n=e.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())}));asn1$1.PublicKey=n;var o=e.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(i),this.key("subjectPrivateKey").octstr())}));asn1$1.PrivateKey=o;var s=e.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));asn1$1.EncryptedPrivateKey=s;var a=e.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));asn1$1.DSAPrivateKey=a,asn1$1.DSAparam=e.define("DSAparam",(function(){this.int()}));var u=e.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})})),h=e.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(u),this.key("publicKey").optional().explicit(1).bitstr())}));return asn1$1.ECPrivateKey=h,asn1$1.signature=e.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})),asn1$1}const require$$1={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var safeBuffer={exports:{}},hasRequiredSafeBuffer,fixProc,hasRequiredFixProc,parseAsn1,hasRequiredParseAsn1;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer,safeBuffer.exports)),safeBuffer.exports}function requireFixProc(){if(hasRequiredFixProc)return fixProc;hasRequiredFixProc=1;var e=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,t=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,i=requireEvp_bytestokey(),n=requireBrowser$7(),o=requireSafeBuffer().Buffer;return fixProc=function(s,a){var u,h=s.toString(),f=h.match(e);if(f){var l="aes"+f[1],c=o.from(f[2],"hex"),d=o.from(f[3].replace(/[\r\n]/g,""),"base64"),p=i(a,c.slice(0,8),parseInt(f[1],10)).key,m=[],g=n.createDecipheriv(l,p,c);m.push(g.update(d)),m.push(g.final()),u=o.concat(m)}else{var y=h.match(r);u=o.from(y[2].replace(/[\r\n]/g,""),"base64")}return{tag:h.match(t)[1],data:u}}}function requireParseAsn1(){if(hasRequiredParseAsn1)return parseAsn1;hasRequiredParseAsn1=1;var e=requireAsn1(),t=require$$1,r=requireFixProc(),i=requireBrowser$7(),n=requireBrowser$8(),o=requireSafeBuffer().Buffer;function s(s){var a;"object"!=typeof s||o.isBuffer(s)||(a=s.passphrase,s=s.key),"string"==typeof s&&(s=o.from(s));var u,h,f=r(s,a),l=f.tag,c=f.data;switch(l){case"CERTIFICATE":h=e.certificate.decode(c,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(h||(h=e.PublicKey.decode(c,"der")),u=h.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return e.RSAPublicKey.decode(h.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return h.subjectPrivateKey=h.subjectPublicKey,{type:"ec",data:h};case"1.2.840.10040.4.1":return h.algorithm.params.pub_key=e.DSAparam.decode(h.subjectPublicKey.data,"der"),{type:"dsa",data:h.algorithm.params};default:throw new Error("unknown key id "+u)}case"ENCRYPTED PRIVATE KEY":c=function(e,r){var s=e.algorithm.decrypt.kde.kdeparams.salt,a=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),u=t[e.algorithm.decrypt.cipher.algo.join(".")],h=e.algorithm.decrypt.cipher.iv,f=e.subjectPrivateKey,l=parseInt(u.split("-")[1],10)/8,c=n.pbkdf2Sync(r,s,a,l,"sha1"),d=i.createDecipheriv(u,c,h),p=[];return p.push(d.update(f)),p.push(d.final()),o.concat(p)}(c=e.EncryptedPrivateKey.decode(c,"der"),a);case"PRIVATE KEY":switch(u=(h=e.PrivateKey.decode(c,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return e.RSAPrivateKey.decode(h.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:h.algorithm.curve,privateKey:e.ECPrivateKey.decode(h.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return h.algorithm.params.priv_key=e.DSAparam.decode(h.subjectPrivateKey,"der"),{type:"dsa",params:h.algorithm.params};default:throw new Error("unknown key id "+u)}case"RSA PUBLIC KEY":return e.RSAPublicKey.decode(c,"der");case"RSA PRIVATE KEY":return e.RSAPrivateKey.decode(c,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:e.DSAPrivateKey.decode(c,"der")};case"EC PRIVATE KEY":return{curve:(c=e.ECPrivateKey.decode(c,"der")).parameters.value,privateKey:c.privateKey};default:throw new Error("unknown key type "+l)}}return s.signature=e.signature,parseAsn1=s}const require$$4={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var hasRequiredSign,verify_1,hasRequiredVerify,browser$5,hasRequiredBrowser$4;function requireSign(){if(hasRequiredSign)return sign.exports;hasRequiredSign=1;var e=requireSafeBuffer$3().Buffer,t=requireBrowser$9(),r=requireBrowserifyRsa(),i=requireElliptic().ec,n=requireBn$4(),o=requireParseAsn1(),s=require$$4;function a(r,i,n,o){if((r=e.from(r.toArray())).length<i.byteLength()){var s=e.alloc(i.byteLength()-r.length);r=e.concat([s,r])}var a=n.length,h=function(t,r){t=u(t,r),t=t.mod(r);var i=e.from(t.toArray());if(i.length<r.byteLength()){var n=e.alloc(r.byteLength()-i.length);i=e.concat([n,i])}return i}(n,i),f=e.alloc(a);f.fill(1);var l=e.alloc(a);return l=t(o,l).update(f).update(e.from([0])).update(r).update(h).digest(),f=t(o,l).update(f).digest(),{k:l=t(o,l).update(f).update(e.from([1])).update(r).update(h).digest(),v:f=t(o,l).update(f).digest()}}function u(e,t){var r=new n(e),i=(e.length<<3)-t.bitLength();return i>0&&r.ishrn(i),r}function h(r,i,n){var o,s;do{for(o=e.alloc(0);8*o.length<r.bitLength();)i.v=t(n,i.k).update(i.v).digest(),o=e.concat([o,i.v]);s=u(o,r),i.k=t(n,i.k).update(i.v).update(e.from([0])).digest(),i.v=t(n,i.k).update(i.v).digest()}while(-1!==s.cmp(r));return s}function f(e,t,r,i){return e.toRed(n.mont(r)).redPow(t).fromRed().mod(i)}return sign.exports=function(t,l,c,d,p){var m=o(l);if(m.curve){if("ecdsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");return function(t,r){var n=s[r.curve.join(".")];if(!n)throw new Error("unknown curve "+r.curve.join("."));var o=new i(n).keyFromPrivate(r.privateKey),a=o.sign(t);return e.from(a.toDER())}(t,m)}if("dsa"===m.type){if("dsa"!==d)throw new Error("wrong private key type");return function(t,r,i){var o,s=r.params.priv_key,l=r.params.p,c=r.params.q,d=r.params.g,p=new n(0),m=u(t,c).mod(c),g=!1,y=a(s,c,t,i);for(;!1===g;)p=f(d,o=h(c,y,i),l,c),0===(g=o.invm(c).imul(m.add(s.mul(p))).mod(c)).cmpn(0)&&(g=!1,p=new n(0));return function(t,r){t=t.toArray(),r=r.toArray(),128&t[0]&&(t=[0].concat(t));128&r[0]&&(r=[0].concat(r));var i=t.length+r.length+4,n=[48,i,2,t.length];return n=n.concat(t,[2,r.length],r),e.from(n)}(p,g)}(t,m,c)}if("rsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");if(void 0!==l.padding&&1!==l.padding)throw new Error("illegal or unsupported padding mode");t=e.concat([p,t]);for(var g=m.modulus.byteLength(),y=[0,1];t.length+y.length+1<g;)y.push(255);y.push(0);for(var b=-1;++b<t.length;)y.push(t[b]);return r(y,m)},sign.exports.getKey=a,sign.exports.makeKey=h,sign.exports}function requireVerify(){if(hasRequiredVerify)return verify_1;hasRequiredVerify=1;var e=requireSafeBuffer$3().Buffer,t=requireBn$4(),r=requireElliptic().ec,i=requireParseAsn1(),n=require$$4;function o(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=0)throw new Error("invalid sig")}return verify_1=function(s,a,u,h,f){var l=i(u);if("ec"===l.type){if("ecdsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");return function(e,t,i){var o=n[i.data.algorithm.curve.join(".")];if(!o)throw new Error("unknown curve "+i.data.algorithm.curve.join("."));var s=new r(o),a=i.data.subjectPrivateKey.data;return s.verify(t,e,a)}(s,a,l)}if("dsa"===l.type){if("dsa"!==h)throw new Error("wrong public key type");return function(e,r,n){var s=n.data.p,a=n.data.q,u=n.data.g,h=n.data.pub_key,f=i.signature.decode(e,"der"),l=f.s,c=f.r;o(l,a),o(c,a);var d=t.mont(s),p=l.invm(a),m=u.toRed(d).redPow(new t(r).mul(p).mod(a)).fromRed().mul(h.toRed(d).redPow(c.mul(p).mod(a)).fromRed()).mod(s).mod(a);return 0===m.cmp(c)}(s,a,l)}if("rsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");a=e.concat([f,a]);for(var c=l.modulus.byteLength(),d=[1],p=0;a.length+d.length+2<c;)d.push(255),p+=1;d.push(0);for(var m=-1;++m<a.length;)d.push(a[m]);d=e.from(d);var g=t.mont(l.modulus);s=(s=new t(s).toRed(g)).redPow(new t(l.publicExponent)),s=e.from(s.fromRed().toArray());var y=p<8?1:0;for(c=Math.min(s.length,d.length),s.length!==d.length&&(y=1),m=-1;++m<c;)y|=s[m]^d[m];return 0===y}}function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$5;hasRequiredBrowser$4=1;var e=requireSafeBuffer$3().Buffer,t=requireBrowser$a(),r=requireReadableBrowser(),i=requireInherits_browser(),n=requireSign(),o=requireVerify(),s=require$$6;function a(e){r.Writable.call(this);var i=s[e];if(!i)throw new Error("Unknown message digest");this._hashType=i.hash,this._hash=t(i.hash),this._tag=i.id,this._signType=i.sign}function u(e){r.Writable.call(this);var i=s[e];if(!i)throw new Error("Unknown message digest");this._hash=t(i.hash),this._tag=i.id,this._signType=i.sign}function h(e){return new a(e)}function f(e){return new u(e)}return Object.keys(s).forEach((function(t){s[t].id=e.from(s[t].id,"hex"),s[t.toLowerCase()]=s[t]})),i(a,r.Writable),a.prototype._write=function(e,t,r){this._hash.update(e),r()},a.prototype.update=function(t,r){return this._hash.update("string"==typeof t?e.from(t,r):t),this},a.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),i=n(r,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i},i(u,r.Writable),u.prototype._write=function(e,t,r){this._hash.update(e),r()},u.prototype.update=function(t,r){return this._hash.update("string"==typeof t?e.from(t,r):t),this},u.prototype.verify=function(t,r,i){var n="string"==typeof r?e.from(r,i):r;this.end();var s=this._hash.digest();return o(n,s,t,this._signType,this._tag)},browser$5={Sign:h,Verify:f,createSign:h,createVerify:f}}var bn$3={exports:{}},bn$2=bn$3.exports,hasRequiredBn$1,browser$4,hasRequiredBrowser$3;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$3,bn$2)),bn$3.exports}function requireBrowser$3(){if(hasRequiredBrowser$3)return browser$4;hasRequiredBrowser$3=1;var e=requireElliptic(),t=requireBn$1();browser$4=function(e){return new i(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function i(t){this.curveType=r[t],this.curveType||(this.curveType={name:t}),this.curve=new e.ec(this.curveType.name),this.keys=void 0}function n(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new Buffer(e);if(r&&i.length<r){var n=new Buffer(r-i.length);n.fill(0),i=Buffer.concat([n,i])}return t?i.toString(t):i}return r.p224=r.secp224r1,r.p256=r.secp256r1=r.prime256v1,r.p192=r.secp192r1=r.prime192v1,r.p384=r.secp384r1,r.p521=r.secp521r1,i.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},i.prototype.computeSecret=function(e,t,r){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),n(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},i.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),n(r,e)},i.prototype.getPrivateKey=function(e){return n(this.keys.getPrivate(),e)},i.prototype.setPublicKey=function(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this.keys._importPublic(e),this},i.prototype.setPrivateKey=function(e,r){r=r||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,r));var i=new t(e);return i=i.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(i),this},browser$4}var browser$3={},mgf,hasRequiredMgf,xor,hasRequiredXor;function requireMgf(){if(hasRequiredMgf)return mgf;hasRequiredMgf=1;var e=requireBrowser$a(),t=requireSafeBuffer$9().Buffer;function r(e){var r=t.allocUnsafe(4);return r.writeUInt32BE(e,0),r}return mgf=function(i,n){for(var o,s=t.alloc(0),a=0;s.length<n;)o=r(a++),s=t.concat([s,e("sha1").update(i).update(o).digest()]);return s.slice(0,n)}}function requireXor(){return hasRequiredXor?xor:(hasRequiredXor=1,xor=function(e,t){for(var r=e.length,i=-1;++i<r;)e[i]^=t[i];return e})}var bn$1={exports:{}},bn=bn$1.exports,hasRequiredBn,withPublic_1,hasRequiredWithPublic,publicEncrypt,hasRequiredPublicEncrypt,privateDecrypt,hasRequiredPrivateDecrypt,hasRequiredBrowser$2;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$1,bn)),bn$1.exports}function requireWithPublic(){if(hasRequiredWithPublic)return withPublic_1;hasRequiredWithPublic=1;var e=requireBn(),t=requireSafeBuffer$9().Buffer;return withPublic_1=function(r,i){return t.from(r.toRed(e.mont(i.modulus)).redPow(new e(i.publicExponent)).fromRed().toArray())}}function requirePublicEncrypt(){if(hasRequiredPublicEncrypt)return publicEncrypt;hasRequiredPublicEncrypt=1;var e=requireParseAsn1(),t=requireBrowser$b(),r=requireBrowser$a(),i=requireMgf(),n=requireXor(),o=requireBn(),s=requireWithPublic(),a=requireBrowserifyRsa(),u=requireSafeBuffer$9().Buffer;return publicEncrypt=function(h,f,l){var c;c=h.padding?h.padding:l?1:4;var d,p=e(h);if(4===c)d=function(e,s){var a=e.modulus.byteLength(),h=s.length,f=r("sha1").update(u.alloc(0)).digest(),l=f.length,c=2*l;if(h>a-c-2)throw new Error("message too long");var d=u.alloc(a-h-c-2),p=a-l-1,m=t(l),g=n(u.concat([f,d,u.alloc(1,1),s],p),i(m,p)),y=n(m,i(g,l));return new o(u.concat([u.alloc(1),y,g],a))}(p,f);else if(1===c)d=function(e,r,i){var n,s=r.length,a=e.modulus.byteLength();if(s>a-11)throw new Error("message too long");n=i?u.alloc(a-s-3,255):function(e){var r,i=u.allocUnsafe(e),n=0,o=t(2*e),s=0;for(;n<e;)s===o.length&&(o=t(2*e),s=0),(r=o[s++])&&(i[n++]=r);return i}(a-s-3);return new o(u.concat([u.from([0,i?1:2]),n,u.alloc(1),r],a))}(p,f,l);else{if(3!==c)throw new Error("unknown padding");if((d=new o(f)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return l?a(d,p):s(d,p)}}function requirePrivateDecrypt(){if(hasRequiredPrivateDecrypt)return privateDecrypt;hasRequiredPrivateDecrypt=1;var e=requireParseAsn1(),t=requireMgf(),r=requireXor(),i=requireBn(),n=requireBrowserifyRsa(),o=requireBrowser$a(),s=requireWithPublic(),a=requireSafeBuffer$9().Buffer;return privateDecrypt=function(u,h,f){var l;l=u.padding?u.padding:f?1:4;var c,d=e(u),p=d.modulus.byteLength();if(h.length>p||new i(h).cmp(d.modulus)>=0)throw new Error("decryption error");c=f?s(new i(h),d):n(h,d);var m=a.alloc(p-c.length);if(c=a.concat([m,c],p),4===l)return function(e,i){var n=e.modulus.byteLength(),s=o("sha1").update(a.alloc(0)).digest(),u=s.length;if(0!==i[0])throw new Error("decryption error");var h=i.slice(1,u+1),f=i.slice(u+1),l=r(h,t(f,u)),c=r(f,t(l,n-u-1));if(function(e,t){e=a.from(e),t=a.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n<i;)r+=e[n]^t[n];return r}(s,c.slice(0,u)))throw new Error("decryption error");var d=u;for(;0===c[d];)d++;if(1!==c[d++])throw new Error("decryption error");return c.slice(d)}(d,c);if(1===l)return function(e,t,r){var i=t.slice(0,2),n=2,o=0;for(;0!==t[n++];)if(n>=t.length){o++;break}var s=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(n)}(0,c,f);if(3===l)return c;throw new Error("unknown padding")}}function requireBrowser$2(){return hasRequiredBrowser$2||(hasRequiredBrowser$2=1,(e=browser$3).publicEncrypt=requirePublicEncrypt(),e.privateDecrypt=requirePrivateDecrypt(),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}),browser$3;var e}var browser$2={},hasRequiredBrowser$1,hasRequiredCryptoBrowserify;function requireBrowser$1(){if(hasRequiredBrowser$1)return browser$2;function e(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}hasRequiredBrowser$1=1;var t=requireSafeBuffer$9(),r=requireBrowser$b(),i=t.Buffer,n=t.kMaxLength,o=commonjsGlobal.crypto||commonjsGlobal.msCrypto,s=Math.pow(2,32)-1;function a(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>s||e<0)throw new TypeError("offset must be a uint32");if(e>n||e>t)throw new RangeError("offset out of range")}function u(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>s||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>n)throw new RangeError("buffer too small")}function h(e,t,i,n){if(process$1.browser){var s=e.buffer,a=new Uint8Array(s,t,i);return o.getRandomValues(a),n?void process$1.nextTick((function(){n(null,e)})):e}if(!n)return r(i).copy(e,t),e;r(i,(function(r,i){if(r)return n(r);i.copy(e,t),n(null,e)}))}return o&&o.getRandomValues||!process$1.browser?(browser$2.randomFill=function(e,t,r,n){if(!(i.isBuffer(e)||e instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)n=t,t=0,r=e.length;else if("function"==typeof r)n=r,r=e.length-t;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return a(t,e.length),u(r,t,e.length),h(e,t,r,n)},browser$2.randomFillSync=function(e,t,r){void 0===t&&(t=0);if(!(i.isBuffer(e)||e instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');a(t,e.length),void 0===r&&(r=e.length-t);return u(r,t,e.length),h(e,t,r)}):(browser$2.randomFill=e,browser$2.randomFillSync=e),browser$2}function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=requireBrowser$b(),cryptoBrowserify.createHash=cryptoBrowserify.Hash=requireBrowser$a(),cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=requireBrowser$9();var e=requireAlgos(),t=Object.keys(e),r=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(t);cryptoBrowserify.getHashes=function(){return r};var i=requireBrowser$8();cryptoBrowserify.pbkdf2=i.pbkdf2,cryptoBrowserify.pbkdf2Sync=i.pbkdf2Sync;var n=requireBrowser$6();cryptoBrowserify.Cipher=n.Cipher,cryptoBrowserify.createCipher=n.createCipher,cryptoBrowserify.Cipheriv=n.Cipheriv,cryptoBrowserify.createCipheriv=n.createCipheriv,cryptoBrowserify.Decipher=n.Decipher,cryptoBrowserify.createDecipher=n.createDecipher,cryptoBrowserify.Decipheriv=n.Decipheriv,cryptoBrowserify.createDecipheriv=n.createDecipheriv,cryptoBrowserify.getCiphers=n.getCiphers,cryptoBrowserify.listCiphers=n.listCiphers;var o=requireBrowser$5();cryptoBrowserify.DiffieHellmanGroup=o.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=o.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=o.getDiffieHellman,cryptoBrowserify.createDiffieHellman=o.createDiffieHellman,cryptoBrowserify.DiffieHellman=o.DiffieHellman;var s=requireBrowser$4();cryptoBrowserify.createSign=s.createSign,cryptoBrowserify.Sign=s.Sign,cryptoBrowserify.createVerify=s.createVerify,cryptoBrowserify.Verify=s.Verify,cryptoBrowserify.createECDH=requireBrowser$3();var a=requireBrowser$2();cryptoBrowserify.publicEncrypt=a.publicEncrypt,cryptoBrowserify.privateEncrypt=a.privateEncrypt,cryptoBrowserify.publicDecrypt=a.publicDecrypt,cryptoBrowserify.privateDecrypt=a.privateDecrypt;var u=requireBrowser$1();return cryptoBrowserify.randomFill=u.randomFill,cryptoBrowserify.randomFillSync=u.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/browserify/crypto-browserify")},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var core=core$1.exports,hasRequiredCore;function requireCore(){return hasRequiredCore||(hasRequiredCore=1,core$1.exports=(e=e||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==commonjsGlobal&&commonjsGlobal.crypto&&(r=commonjsGlobal.crypto),!r&&"function"==typeof commonjsRequire)try{r=requireCryptoBrowserify()}catch(e){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),o={},s=o.lib={},a=s.Base=function(){return{extend:function(e){var t=n(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)}}}(),u=s.WordArray=a.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,i=this.sigBytes,n=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o<n;o++){var s=r[o>>>2]>>>24-o%4*8&255;t[i+o>>>2]|=s<<24-(i+o)%4*8}else for(var a=0;a<n;a+=4)t[i+a>>>2]=r[a>>>2];return this.sigBytes+=n,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(i());return new u.init(t,e)}}),h=o.enc={},f=h.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n<r;n++){var o=t[n>>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i+=2)r[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new u.init(r,t/2)}},l=h.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n<r;n++){var o=t[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new u.init(r,t)}},c=h.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},d=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,i=this._data,n=i.words,o=i.sigBytes,s=this.blockSize,a=o/(4*s),h=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,f=e.min(4*h,o);if(h){for(var l=0;l<h;l+=s)this._doProcessBlock(n,l);r=n.splice(0,h),i.sigBytes-=f}return new u.init(r,f)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new p.HMAC.init(e,r).finalize(t)}}});var p=o.algo={};return o}(Math),e)),core$1.exports;var e}var encBase64$1={exports:{}},encBase64=encBase64$1.exports,hasRequiredEncBase64;function requireEncBase64(){return hasRequiredEncBase64||(hasRequiredEncBase64=1,encBase64$1.exports=(e=requireCore(),function(){var t=e,r=t.lib.WordArray;function i(e,t,i){for(var n=[],o=0,s=0;s<t;s++)if(s%4){var a=i[e.charCodeAt(s-1)]<<s%4*2|i[e.charCodeAt(s)]>>>6-s%4*2;n[o>>>2]|=a<<24-o%4*8,o++}return r.create(n,o)}t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,i=this._map;e.clamp();for(var n=[],o=0;o<r;o+=3)for(var s=(t[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,a=0;a<4&&o+.75*a<r;a++)n.push(i.charAt(s>>>6*(3-a)&63));var u=i.charAt(64);if(u)for(;n.length%4;)n.push(u);return n.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o<r.length;o++)n[r.charCodeAt(o)]=o}var s=r.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return i(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64)),encBase64$1.exports;var e}var md5$1={exports:{}},md5=md5$1.exports,hasRequiredMd5;function requireMd5(){return hasRequiredMd5||(hasRequiredMd5=1,md5$1.exports=(e=requireCore(),function(t){var r=e,i=r.lib,n=i.WordArray,o=i.Hasher,s=r.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=s.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var i=t+r,n=e[i];e[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,s=e[t+0],u=e[t+1],d=e[t+2],p=e[t+3],m=e[t+4],g=e[t+5],y=e[t+6],b=e[t+7],v=e[t+8],w=e[t+9],_=e[t+10],M=e[t+11],S=e[t+12],E=e[t+13],R=e[t+14],A=e[t+15],q=o[0],C=o[1],P=o[2],B=o[3];q=h(q,C,P,B,s,7,a[0]),B=h(B,q,C,P,u,12,a[1]),P=h(P,B,q,C,d,17,a[2]),C=h(C,P,B,q,p,22,a[3]),q=h(q,C,P,B,m,7,a[4]),B=h(B,q,C,P,g,12,a[5]),P=h(P,B,q,C,y,17,a[6]),C=h(C,P,B,q,b,22,a[7]),q=h(q,C,P,B,v,7,a[8]),B=h(B,q,C,P,w,12,a[9]),P=h(P,B,q,C,_,17,a[10]),C=h(C,P,B,q,M,22,a[11]),q=h(q,C,P,B,S,7,a[12]),B=h(B,q,C,P,E,12,a[13]),P=h(P,B,q,C,R,17,a[14]),q=f(q,C=h(C,P,B,q,A,22,a[15]),P,B,u,5,a[16]),B=f(B,q,C,P,y,9,a[17]),P=f(P,B,q,C,M,14,a[18]),C=f(C,P,B,q,s,20,a[19]),q=f(q,C,P,B,g,5,a[20]),B=f(B,q,C,P,_,9,a[21]),P=f(P,B,q,C,A,14,a[22]),C=f(C,P,B,q,m,20,a[23]),q=f(q,C,P,B,w,5,a[24]),B=f(B,q,C,P,R,9,a[25]),P=f(P,B,q,C,p,14,a[26]),C=f(C,P,B,q,v,20,a[27]),q=f(q,C,P,B,E,5,a[28]),B=f(B,q,C,P,d,9,a[29]),P=f(P,B,q,C,b,14,a[30]),q=l(q,C=f(C,P,B,q,S,20,a[31]),P,B,g,4,a[32]),B=l(B,q,C,P,v,11,a[33]),P=l(P,B,q,C,M,16,a[34]),C=l(C,P,B,q,R,23,a[35]),q=l(q,C,P,B,u,4,a[36]),B=l(B,q,C,P,m,11,a[37]),P=l(P,B,q,C,b,16,a[38]),C=l(C,P,B,q,_,23,a[39]),q=l(q,C,P,B,E,4,a[40]),B=l(B,q,C,P,s,11,a[41]),P=l(P,B,q,C,p,16,a[42]),C=l(C,P,B,q,y,23,a[43]),q=l(q,C,P,B,w,4,a[44]),B=l(B,q,C,P,S,11,a[45]),P=l(P,B,q,C,A,16,a[46]),q=c(q,C=l(C,P,B,q,d,23,a[47]),P,B,s,6,a[48]),B=c(B,q,C,P,b,10,a[49]),P=c(P,B,q,C,R,15,a[50]),C=c(C,P,B,q,g,21,a[51]),q=c(q,C,P,B,S,6,a[52]),B=c(B,q,C,P,p,10,a[53]),P=c(P,B,q,C,_,15,a[54]),C=c(C,P,B,q,u,21,a[55]),q=c(q,C,P,B,v,6,a[56]),B=c(B,q,C,P,A,10,a[57]),P=c(P,B,q,C,y,15,a[58]),C=c(C,P,B,q,E,21,a[59]),q=c(q,C,P,B,m,6,a[60]),B=c(B,q,C,P,M,10,a[61]),P=c(P,B,q,C,d,15,a[62]),C=c(C,P,B,q,w,21,a[63]),o[0]=o[0]+q|0,o[1]=o[1]+C|0,o[2]=o[2]+P|0,o[3]=o[3]+B|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296),s=i;r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,u=a.words,h=0;h<4;h++){var f=u[h];u[h]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function h(e,t,r,i,n,o,s){var a=e+(t&r|~t&i)+n+s;return(a<<o|a>>>32-o)+t}function f(e,t,r,i,n,o,s){var a=e+(t&i|r&~i)+n+s;return(a<<o|a>>>32-o)+t}function l(e,t,r,i,n,o,s){var a=e+(t^r^i)+n+s;return(a<<o|a>>>32-o)+t}function c(e,t,r,i,n,o,s){var a=e+(r^(t|~i))+n+s;return(a<<o|a>>>32-o)+t}r.MD5=o._createHelper(u),r.HmacMD5=o._createHmacHelper(u)}(Math),e.MD5)),md5$1.exports;var e}var evpkdf$1={exports:{}},sha1$1={exports:{}},sha1=sha1$1.exports,hasRequiredSha1;function requireSha1(){return hasRequiredSha1||(hasRequiredSha1=1,sha1$1.exports=(a=requireCore(),t=(e=a).lib,r=t.WordArray,i=t.Hasher,n=e.algo,o=[],s=n.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],s=r[2],a=r[3],u=r[4],h=0;h<80;h++){if(h<16)o[h]=0|e[t+h];else{var f=o[h-3]^o[h-8]^o[h-14]^o[h-16];o[h]=f<<1|f>>>31}var l=(i<<5|i>>>27)+u+o[h];l+=h<20?1518500249+(n&s|~n&a):h<40?1859775393+(n^s^a):h<60?(n&s|n&a|s&a)-1894007588:(n^s^a)-899497514,u=a,a=s,s=n<<30|n>>>2,n=i,i=l}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),e.SHA1=i._createHelper(s),e.HmacSHA1=i._createHmacHelper(s),a.SHA1)),sha1$1.exports;var e,t,r,i,n,o,s,a}var hmac$1={exports:{}},hmac=hmac$1.exports,hasRequiredHmac;function requireHmac(){return hasRequiredHmac||(hasRequiredHmac=1,hmac$1.exports=(e=requireCore(),r=(t=e).lib.Base,i=t.enc.Utf8,void(t.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,u=s.words,h=0;h<r;h++)a[h]^=1549556828,u[h]^=909522486;o.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))),hmac$1.exports;var e,t,r,i}var evpkdf=evpkdf$1.exports,hasRequiredEvpkdf;function requireEvpkdf(){return hasRequiredEvpkdf||(hasRequiredEvpkdf=1,evpkdf$1.exports=(a=requireCore(),requireSha1(),requireHmac(),t=(e=a).lib,r=t.Base,i=t.WordArray,n=e.algo,o=n.MD5,s=n.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,o=n.hasher.create(),s=i.create(),a=s.words,u=n.keySize,h=n.iterations;a.length<u;){r&&o.update(r),r=o.update(e).finalize(t),o.reset();for(var f=1;f<h;f++)r=o.finalize(r),o.reset();s.concat(r)}return s.sigBytes=4*u,s}}),e.EvpKDF=function(e,t,r){return s.create(r).compute(e,t)},a.EvpKDF)),evpkdf$1.exports;var e,t,r,i,n,o,s,a}var cipherCore$1={exports:{}},cipherCore=cipherCore$1.exports,hasRequiredCipherCore;function requireCipherCore(){return hasRequiredCipherCore||(hasRequiredCipherCore=1,cipherCore$1.exports=(e=requireCore(),requireEvpkdf(),void(e.lib.Cipher||function(t){var r=e,i=r.lib,n=i.Base,o=i.WordArray,s=i.BufferedBlockAlgorithm,a=r.enc;a.Utf8;var u=a.Base64,h=r.algo.EvpKDF,f=i.Cipher=s.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?v:y}return function(t){return{encrypt:function(r,i,n){return e(i).encrypt(t,r,i,n)},decrypt:function(r,i,n){return e(i).decrypt(t,r,i,n)}}}}()});i.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=r.mode={},c=i.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=l.CBC=function(){var e=c.extend();function r(e,r,i){var n,o=this._iv;o?(n=o,this._iv=t):n=this._prevBlock;for(var s=0;s<i;s++)e[r+s]^=n[s]}return e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;r.call(this,e,t,n),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),e.Decryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,o=e.slice(t,t+n);i.decryptBlock(e,t),r.call(this,e,t,n),this._prevBlock=o}}),e}(),p=(r.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,i=r-e.sigBytes%r,n=i<<24|i<<16|i<<8|i,s=[],a=0;a<i;a+=4)s.push(n);var u=o.create(s,i);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};i.BlockCipher=f.extend({cfg:f.cfg.extend({mode:d,padding:p}),reset:function(){var e;f.reset.call(this);var t=this.cfg,r=t.iv,i=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(i,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var m=i.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(r.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(u)},parse:function(e){var t,r=u.parse(e),i=r.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=o.create(i.slice(2,4)),i.splice(0,4),r.sigBytes-=16),m.create({ciphertext:r,salt:t})}},y=i.SerializableCipher=n.extend({cfg:n.extend({format:g}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),o=n.finalize(t),s=n.cfg;return m.create({ciphertext:o,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(r,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(r.kdf={}).OpenSSL={execute:function(e,t,r,i,n){if(i||(i=o.random(8)),n)s=h.create({keySize:t+r,hasher:n}).compute(e,i);else var s=h.create({keySize:t+r}).compute(e,i);var a=o.create(s.words.slice(t),4*r);return s.sigBytes=4*t,m.create({key:s,iv:a,salt:i})}},v=i.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:b}),encrypt:function(e,t,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,e.keySize,e.ivSize,i.salt,i.hasher);i.iv=n.iv;var o=y.encrypt.call(this,e,t,n.key,i);return o.mixIn(n),o},decrypt:function(e,t,r,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var n=i.kdf.execute(r,e.keySize,e.ivSize,t.salt,i.hasher);return i.iv=n.iv,y.decrypt.call(this,e,t,n.key,i)}})}()))),cipherCore$1.exports;var e}var aes$1=aes$3.exports,hasRequiredAes;function requireAes(){return hasRequiredAes||(hasRequiredAes=1,aes$3.exports=(e=requireCore(),requireEncBase64(),requireMd5(),requireEvpkdf(),requireCipherCore(),function(){var t=e,r=t.lib.BlockCipher,i=t.algo,n=[],o=[],s=[],a=[],u=[],h=[],f=[],l=[],c=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,i=0;for(t=0;t<256;t++){var p=i^i<<1^i<<2^i<<3^i<<4;p=p>>>8^255&p^99,n[r]=p,o[p]=r;var m=e[r],g=e[m],y=e[g],b=257*e[p]^16843008*p;s[r]=b<<24|b>>>8,a[r]=b<<16|b>>>16,u[r]=b<<8|b>>>24,h[r]=b,b=16843009*y^65537*g^257*m^16843008*r,f[p]=b<<24|b>>>8,l[p]=b<<16|b>>>16,c[p]=b<<8|b>>>24,d[p]=b,r?(r=m^e[e[e[y^m]]],i^=e[e[i]]):r=i=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=i.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,i=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s<i;s++)s<r?o[s]=t[s]:(h=o[s-1],s%r?r>6&&s%r==4&&(h=n[h>>>24]<<24|n[h>>>16&255]<<16|n[h>>>8&255]<<8|n[255&h]):(h=n[(h=h<<8|h>>>24)>>>24]<<24|n[h>>>16&255]<<16|n[h>>>8&255]<<8|n[255&h],h^=p[s/r|0]<<24),o[s]=o[s-r]^h);for(var a=this._invKeySchedule=[],u=0;u<i;u++){if(s=i-u,u%4)var h=o[s];else h=o[s-4];a[u]=u<4||s<=4?h:f[n[h>>>24]]^l[n[h>>>16&255]]^c[n[h>>>8&255]]^d[n[255&h]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,u,h,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,l,c,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,o,s,a){for(var u=this._nRounds,h=e[t]^r[0],f=e[t+1]^r[1],l=e[t+2]^r[2],c=e[t+3]^r[3],d=4,p=1;p<u;p++){var m=i[h>>>24]^n[f>>>16&255]^o[l>>>8&255]^s[255&c]^r[d++],g=i[f>>>24]^n[l>>>16&255]^o[c>>>8&255]^s[255&h]^r[d++],y=i[l>>>24]^n[c>>>16&255]^o[h>>>8&255]^s[255&f]^r[d++],b=i[c>>>24]^n[h>>>16&255]^o[f>>>8&255]^s[255&l]^r[d++];h=m,f=g,l=y,c=b}m=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[l>>>8&255]<<8|a[255&c])^r[d++],g=(a[f>>>24]<<24|a[l>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^r[d++],y=(a[l>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[d++],b=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&l])^r[d++],e[t]=m,e[t+1]=g,e[t+2]=y,e[t+3]=b},keySize:8});t.AES=r._createHelper(m)}(),e.AES)),aes$3.exports;var e}var aesExports=requireAes();const aes=getDefaultExportFromCjs(aesExports),__CJS__import__1__$2=_mergeNamespaces({__proto__:null,default:aes},[aesExports]);var encUtf8$2={exports:{}},encUtf8$1=encUtf8$2.exports,hasRequiredEncUtf8;function requireEncUtf8(){return hasRequiredEncUtf8||(hasRequiredEncUtf8=1,encUtf8$2.exports=requireCore().enc.Utf8),encUtf8$2.exports}var encUtf8Exports=requireEncUtf8();const encUtf8=getDefaultExportFromCjs(encUtf8Exports),__CJS__import__2__=_mergeNamespaces({__proto__:null,default:encUtf8},[encUtf8Exports]);let AES,ENC;AES=aes||__CJS__import__1__$2,ENC=encUtf8||__CJS__import__2__;const CryptoController={encrypt:(e,t)=>AES.encrypt(JSON.stringify(e),t).toString(),decrypt:(e,t)=>AES.decrypt(e,t).toString(ENC)};function canBeSerialized(e){if(!(e instanceof CoreManager.getParseObject()))return!0;const t=e.attributes;for(const e in t){if(!canBeSerializedHelper(t[e]))return!1}return!0}function canBeSerializedHelper(e){if("object"!=typeof e)return!0;if(e instanceof ParseRelation)return!0;if(e instanceof CoreManager.getParseObject())return!!e.id;if(e instanceof ParseFile)return!!e.url();if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(!canBeSerializedHelper(e[t]))return!1;return!0}for(const t in e)if(!canBeSerializedHelper(e[t]))return!1;return!0}const encoded={"&":"&","<":"<",">":">","/":"/","'":"'",'"':"""};function escape$1(e){return e.replace(/[&<>\/'"]/g,(function(e){return encoded[e]}))}function parseDate(e){const t=new RegExp("^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2})T([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})(.([0-9]+))?Z$").exec(e);if(!t)return null;const r=parseInt(t[1])||0,i=(parseInt(t[2])||1)-1,n=parseInt(t[3])||0,o=parseInt(t[4])||0,s=parseInt(t[5])||0,a=parseInt(t[6])||0,u=parseInt(t[8])||0;return new Date(Date.UTC(r,i,n,o,s,a,u))}function resolvingPromise(){let e,t;const r=new Promise(((r,i)=>{e=r,t=i}));return r.resolve=e,r.reject=t,r}function when(e){let t;const r=Array.isArray(e);t=r?e:arguments;let i=t.length,n=!1;const o=[],s=r?[o]:o,a=[];if(o.length=t.length,a.length=t.length,0===i)return Promise.resolve(s);const u=resolvingPromise(),h=function(){i--,i<=0&&(n?u.reject(a):u.resolve(s))},f=function(e,t){e&&"function"==typeof e.then?e.then((function(e){o[t]=e,h()}),(function(e){a[t]=e,n=!0,h()})):(o[t]=e,h())};for(let e=0;e<t.length;e++)f(t[e],e);return u}function continueWhile(e,t){return e()?t().then((()=>continueWhile(e,t))):Promise.resolve()}const DEFAULT_PIN="_default",PIN_PREFIX="parsePin_",OBJECT_PREFIX="Parse_LDS_";function isLocalDatastoreKey(e){return!(!e||e!==DEFAULT_PIN&&!e.startsWith(PIN_PREFIX)&&!e.startsWith(OBJECT_PREFIX))}let uuid;requireCryptoBrowserify(),uuid=()=>globalThis.crypto.randomUUID();const uuidv4=uuid;function arrayContainsObject(e,t){if(e.indexOf(t)>-1)return!0;const r=CoreManager.getParseObject();for(let i=0;i<e.length;i++)if(e[i]instanceof r&&e[i].className===t.className&&e[i]._getId()===t._getId())return!0;return!1}function unique(e){const t=[];return e.forEach((e=>{e instanceof CoreManager.getParseObject()?arrayContainsObject(t,e)||t.push(e):t.indexOf(e)<0&&t.push(e)})),t}function opFromJSON(e){if(!e||!e.__op)return null;switch(e.__op){case"Delete":return new UnsetOp;case"Increment":return new IncrementOp(e.amount);case"Add":return new AddOp(decode(e.objects));case"AddUnique":return new AddUniqueOp(decode(e.objects));case"Remove":return new RemoveOp(decode(e.objects));case"AddRelation":{const t=decode(e.objects);return Array.isArray(t)?new RelationOp(t,[]):new RelationOp([],[])}case"RemoveRelation":{const t=decode(e.objects);return Array.isArray(t)?new RelationOp([],t):new RelationOp([],[])}case"Batch":{let t=[],r=[];for(let i=0;i<e.ops.length;i++)"AddRelation"===e.ops[i].__op?t=t.concat(decode(e.ops[i].objects)):"RemoveRelation"===e.ops[i].__op&&(r=r.concat(decode(e.ops[i].objects)));return new RelationOp(t,r)}}return null}class Op{applyTo(e){}mergeWith(e){}toJSON(e){}}class SetOp extends Op{constructor(e){super(),this._value=e}applyTo(){return this._value}mergeWith(){return new SetOp(this._value)}toJSON(e){return encode(this._value,!1,!0,void 0,e)}}class UnsetOp extends Op{applyTo(){}mergeWith(){return new UnsetOp}toJSON(){return{__op:"Delete"}}}class IncrementOp extends Op{constructor(e){if(super(),"number"!=typeof e)throw new TypeError("Increment Op must be initialized with a numeric amount.");this._amount=e}applyTo(e){if(void 0===e)return this._amount;if("number"!=typeof e)throw new TypeError("Cannot increment a non-numeric value.");return this._amount+e}mergeWith(e){if(!e)return this;if(e instanceof SetOp)return new SetOp(this.applyTo(e._value));if(e instanceof UnsetOp)return new SetOp(this._amount);if(e instanceof IncrementOp)return new IncrementOp(this.applyTo(e._amount));throw new Error("Cannot merge Increment Op with the previous Op")}toJSON(){return{__op:"Increment",amount:this._amount}}}class AddOp extends Op{constructor(e){super(),this._value=Array.isArray(e)?e:[e]}applyTo(e){if(null==e)return this._value;if(Array.isArray(e))return e.concat(this._value);throw new Error("Cannot add elements to a non-array value")}mergeWith(e){if(!e)return this;if(e instanceof SetOp)return new SetOp(this.applyTo(e._value));if(e instanceof UnsetOp)return new SetOp(this._value);if(e instanceof AddOp)return new AddOp(this.applyTo(e._value));throw new Error("Cannot merge Add Op with the previous Op")}toJSON(){return{__op:"Add",objects:encode(this._value,!1,!0)}}}class AddUniqueOp extends Op{constructor(e){super(),this._value=unique(Array.isArray(e)?e:[e])}applyTo(e){if(null==e)return this._value||[];if(Array.isArray(e)){const t=CoreManager.getParseObject(),r=[];return this._value.forEach((i=>{i instanceof t?arrayContainsObject(e,i)||r.push(i):e.indexOf(i)<0&&r.push(i)})),e.concat(r)}throw new Error("Cannot add elements to a non-array value")}mergeWith(e){if(!e)return this;if(e instanceof SetOp)return new SetOp(this.applyTo(e._value));if(e instanceof UnsetOp)return new SetOp(this._value);if(e instanceof AddUniqueOp)return new AddUniqueOp(this.applyTo(e._value));throw new Error("Cannot merge AddUnique Op with the previous Op")}toJSON(){return{__op:"AddUnique",objects:encode(this._value,!1,!0)}}}class RemoveOp extends Op{constructor(e){super(),this._value=unique(Array.isArray(e)?e:[e])}applyTo(e){if(null==e)return[];if(Array.isArray(e)){const t=CoreManager.getParseObject(),r=e.concat([]);for(let e=0;e<this._value.length;e++){let i=r.indexOf(this._value[e]);for(;i>-1;)r.splice(i,1),i=r.indexOf(this._value[e]);if(this._value[e]instanceof t&&this._value[e].id)for(let i=0;i<r.length;i++)r[i]instanceof t&&this._value[e].id===r[i].id&&(r.splice(i,1),i--)}return r}throw new Error("Cannot remove elements from a non-array value")}mergeWith(e){if(!e)return this;if(e instanceof SetOp)return new SetOp(this.applyTo(e._value));if(e instanceof UnsetOp)return new UnsetOp;if(e instanceof RemoveOp){const t=CoreManager.getParseObject(),r=e._value.concat([]);for(let e=0;e<this._value.length;e++)this._value[e]instanceof t?arrayContainsObject(r,this._value[e])||r.push(this._value[e]):r.indexOf(this._value[e])<0&&r.push(this._value[e]);return new RemoveOp(r)}throw new Error("Cannot merge Remove Op with the previous Op")}toJSON(){return{__op:"Remove",objects:encode(this._value,!1,!0)}}}class RelationOp extends Op{constructor(e,t){super(),this._targetClassName=null,Array.isArray(e)&&(this.relationsToAdd=unique(e.map(this._extractId,this))),Array.isArray(t)&&(this.relationsToRemove=unique(t.map(this._extractId,this)))}_extractId(e){if("string"==typeof e)return e;if(!e.id)throw new Error("You cannot add or remove an unsaved Parse Object from a relation");if(this._targetClassName||(this._targetClassName=e.className),this._targetClassName!==e.className)throw new Error("Tried to create a Relation with 2 different object types: "+this._targetClassName+" and "+e.className+".");return e.id}applyTo(e,t,r){if(!e){if(!t||!r)throw new Error("Cannot apply a RelationOp without either a previous value, or an object and a key");const e=new ParseRelation(t,r);return e.targetClassName=this._targetClassName,e}if(e instanceof ParseRelation){if(this._targetClassName)if(e.targetClassName){if(this._targetClassName!==e.targetClassName)throw new Error("Related object must be a "+e.targetClassName+", but a "+this._targetClassName+" was passed in.")}else e.targetClassName=this._targetClassName;return e}throw new Error("Relation cannot be applied to a non-relation field")}mergeWith(e){if(!e)return this;if(e instanceof UnsetOp)throw new Error("You cannot modify a relation after deleting it.");if(e instanceof SetOp&&e._value instanceof ParseRelation)return this;if(e instanceof RelationOp){if(e._targetClassName&&e._targetClassName!==this._targetClassName)throw new Error("Related object must be of class "+e._targetClassName+", but "+(this._targetClassName||"null")+" was passed in.");const t=e.relationsToAdd.concat([]);this.relationsToRemove.forEach((e=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)})),this.relationsToAdd.forEach((e=>{t.indexOf(e)<0&&t.push(e)}));const r=e.relationsToRemove.concat([]);this.relationsToAdd.forEach((e=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)})),this.relationsToRemove.forEach((e=>{r.indexOf(e)<0&&r.push(e)}));const i=new RelationOp(t,r);return i._targetClassName=this._targetClassName,i}throw new Error("Cannot merge Relation Op with the previous Op")}toJSON(){const e=e=>({__type:"Pointer",className:this._targetClassName,objectId:e});let t=null,r=null,i=null;return this.relationsToAdd.length>0&&(t=this.relationsToAdd.map(e),r={__op:"AddRelation",objects:t}),this.relationsToRemove.length>0&&(t=this.relationsToRemove.map(e),i={__op:"RemoveRelation",objects:t}),r&&i?{__op:"Batch",ops:[r,i]}:r||i||{}}}CoreManager.setParseOp({Op:Op,opFromJSON:opFromJSON,SetOp:SetOp,UnsetOp:UnsetOp,IncrementOp:IncrementOp,AddOp:AddOp,RelationOp:RelationOp,RemoveOp:RemoveOp,AddUniqueOp:AddUniqueOp});class TaskQueue{constructor(){this.queue=[]}enqueue(e){const t=resolvingPromise();return this.queue.push({task:e,_completion:t}),1===this.queue.length&&e().then((()=>{this._dequeue(),t.resolve()}),(e=>{this._dequeue(),t.reject(e)})),t}_dequeue(){if(this.queue.shift(),this.queue.length){const e=this.queue[0];e.task().then((()=>{this._dequeue(),e._completion.resolve()}),(t=>{this._dequeue(),e._completion.reject(t)}))}}}function defaultState(){return{serverData:Object.create(null),pendingOps:[Object.create(null)],objectCache:Object.create(null),tasks:new TaskQueue,existed:!1}}function setServerData$2(e,t){for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(isDangerousKey(r)||(void 0!==t[r]?e[r]=t[r]:delete e[r]))}function setPendingOp$2(e,t,r){if(isDangerousKey(t))return;const i=e.length-1;r?e[i][t]=r:delete e[i][t]}function pushPendingState$2(e){e.push(Object.create(null))}function popPendingState$2(e){const t=e.shift();return e.length||(e[0]=Object.create(null)),t}function mergeFirstPendingState$2(e){const t=popPendingState$2(e),r=e[0];for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&!isDangerousKey(e))if(r[e]&&t[e]){const i=r[e].mergeWith(t[e]);i&&(r[e]=i)}else r[e]=t[e]}function estimateAttribute$2(e,t,r,i){if(isDangerousKey(i))return;let n=e[i];for(let e=0;e<t.length;e++)t[e][i]&&(t[e][i]instanceof RelationOp?r.id&&(n=t[e][i].applyTo(n,r,i)):n=t[e][i].applyTo(n));return n}function estimateAttributes$2(e,t,r){const i=Object.create(null);let n;for(n in e)i[n]=e[n];for(let e=0;e<t.length;e++)for(n in t[e])if(Object.prototype.hasOwnProperty.call(t[e],n)&&!isDangerousKey(n))if(t[e][n]instanceof RelationOp)r.id&&(i[n]=t[e][n].applyTo(i[n],r,n));else if(n.includes(".")){const r=n.split("."),o=r[r.length-1];let s=i;for(let e=0;e<r.length-1;e++){const t=r[e];if(t in s)Array.isArray(s[t])?s[t]=[...s[t]]:s[t]={...s[t]};else{const i=r[e+1];isNaN(i)?s[t]=Object.create(null):s[t]=[]}s=s[t]}s[o]=t[e][n].applyTo(s[o])}else i[n]=t[e][n].applyTo(i[n]);return i}function nestedSet(e,t,r){const i=t.split(".");for(let t=0;t<i.length-1;t++){const r=i[t];if(!(r in e)){const n=i[t+1];isNaN(n)?e[r]=Object.create(null):e[r]=[]}e=e[r]}void 0===r?delete e[i[i.length-1]]:e[i[i.length-1]]=r}function commitServerChanges$2(e,t,r){const i=CoreManager.getParseObject();for(const n in r){if(!Object.prototype.hasOwnProperty.call(r,n))continue;if(isDangerousKey(n))continue;const o=r[n];if(nestedSet(e,n,o),o&&"object"==typeof o&&!(o instanceof i)&&!(o instanceof ParseFile)&&!(o instanceof ParseRelation)){const e=encode(o,!1,!0);t[n]=JSON.stringify(e)}}}let objectState$1=Object.create(null);function getState$1(e){const t=objectState$1[e.className];return t&&t[e.id]||null}function initializeState$1(e,t){let r=getState$1(e);return r||(objectState$1[e.className]||(objectState$1[e.className]=Object.create(null)),t||(t=defaultState()),r=objectState$1[e.className][e.id]=t,r)}function removeState$1(e){const t=getState$1(e);return null===t?null:(delete objectState$1[e.className][e.id],t)}function getServerData$1(e){const t=getState$1(e);return t?t.serverData:{}}function setServerData$1(e,t){setServerData$2(initializeState$1(e).serverData,t)}function getPendingOps$1(e){const t=getState$1(e);return t?t.pendingOps:[{}]}function setPendingOp$1(e,t,r){setPendingOp$2(initializeState$1(e).pendingOps,t,r)}function pushPendingState$1(e){pushPendingState$2(initializeState$1(e).pendingOps)}function popPendingState$1(e){return popPendingState$2(initializeState$1(e).pendingOps)}function mergeFirstPendingState$1(e){mergeFirstPendingState$2(getPendingOps$1(e))}function getObjectCache$1(e){const t=getState$1(e);return t?t.objectCache:{}}function estimateAttribute$1(e,t){return estimateAttribute$2(getServerData$1(e),getPendingOps$1(e),e,t)}function estimateAttributes$1(e){return estimateAttributes$2(getServerData$1(e),getPendingOps$1(e),e)}function commitServerChanges$1(e,t){const r=initializeState$1(e);commitServerChanges$2(r.serverData,r.objectCache,t)}function enqueueTask$1(e,t){return initializeState$1(e).tasks.enqueue(t)}function clearAllState$1(){objectState$1=Object.create(null)}function duplicateState$1(e,t){t.id=e.id}const SingleInstanceStateController=Object.freeze(Object.defineProperty({__proto__:null,clearAllState:clearAllState$1,commitServerChanges:commitServerChanges$1,duplicateState:duplicateState$1,enqueueTask:enqueueTask$1,estimateAttribute:estimateAttribute$1,estimateAttributes:estimateAttributes$1,getObjectCache:getObjectCache$1,getPendingOps:getPendingOps$1,getServerData:getServerData$1,getState:getState$1,initializeState:initializeState$1,mergeFirstPendingState:mergeFirstPendingState$1,popPendingState:popPendingState$1,pushPendingState:pushPendingState$1,removeState:removeState$1,setPendingOp:setPendingOp$1,setServerData:setServerData$1},Symbol.toStringTag,{value:"Module"}));let objectState=new WeakMap;function getState(e){return objectState.get(e)||null}function initializeState(e,t){let r=getState(e);return r||(t||(t={serverData:{},pendingOps:[{}],objectCache:{},tasks:new TaskQueue,existed:!1}),r=t,objectState.set(e,r),r)}function removeState(e){const t=getState(e);return null===t?null:(objectState.delete(e),t)}function getServerData(e){const t=getState(e);return t?t.serverData:{}}function setServerData(e,t){setServerData$2(initializeState(e).serverData,t)}function getPendingOps(e){const t=getState(e);return t?t.pendingOps:[{}]}function setPendingOp(e,t,r){setPendingOp$2(initializeState(e).pendingOps,t,r)}function pushPendingState(e){pushPendingState$2(initializeState(e).pendingOps)}function popPendingState(e){return popPendingState$2(initializeState(e).pendingOps)}function mergeFirstPendingState(e){mergeFirstPendingState$2(getPendingOps(e))}function getObjectCache(e){const t=getState(e);return t?t.objectCache:{}}function estimateAttribute(e,t){return estimateAttribute$2(getServerData(e),getPendingOps(e),e,t)}function estimateAttributes(e){return estimateAttributes$2(getServerData(e),getPendingOps(e),e)}function commitServerChanges(e,t){const r=initializeState(e);commitServerChanges$2(r.serverData,r.objectCache,t)}function enqueueTask(e,t){return initializeState(e).tasks.enqueue(t)}function duplicateState(e,t){const r=initializeState(e),i=initializeState(t);for(const e in r.serverData)i.serverData[e]=r.serverData[e];for(let e=0;e<r.pendingOps.length;e++)for(const t in r.pendingOps[e])i.pendingOps[e][t]=r.pendingOps[e][t];for(const e in r.objectCache)i.objectCache[e]=r.objectCache[e];i.existed=r.existed}function clearAllState(){objectState=new WeakMap}const UniqueInstanceStateController=Object.freeze(Object.defineProperty({__proto__:null,clearAllState:clearAllState,commitServerChanges:commitServerChanges,duplicateState:duplicateState,enqueueTask:enqueueTask,estimateAttribute:estimateAttribute,estimateAttributes:estimateAttributes,getObjectCache:getObjectCache,getPendingOps:getPendingOps,getServerData:getServerData,getState:getState,initializeState:initializeState,mergeFirstPendingState:mergeFirstPendingState,popPendingState:popPendingState,pushPendingState:pushPendingState,removeState:removeState,setPendingOp:setPendingOp,setServerData:setServerData},Symbol.toStringTag,{value:"Module"}));function unsavedChildren(e,t){const r={objects:{},files:[]},i=e.className+":"+e._getId();r.objects[i]=!e.dirty()||e;const n=e.attributes;for(const e in n)"object"==typeof n[e]&&traverse(n[e],r,!1,!!t);const o=[];for(const e in r.objects)e!==i&&!0!==r.objects[e]&&o.push(r.objects[e]);return o.concat(r.files)}function traverse(e,t,r,i){if(e instanceof CoreManager.getParseObject()){if(!e.id&&r)throw new Error("Cannot create a pointer to an unsaved Object.");const n=e.className+":"+e._getId();if(!t.objects[n]){t.objects[n]=!e.dirty()||e;const r=e.attributes;for(const e in r)"object"==typeof r[e]&&traverse(r[e],t,!i,i)}}else if(e instanceof ParseFile)!e.url()&&t.files.indexOf(e)<0&&t.files.push(e);else if(!(e instanceof ParseRelation)){Array.isArray(e)&&e.forEach((e=>{"object"==typeof e&&traverse(e,t,r,i)}));for(const n in e)"object"==typeof e[n]&&traverse(e[n],t,r,i)}}const classMap=Object.create(null);let objectCount=0,singleInstance=!CoreManager.get("IS_NODE");function getServerUrlPath(){let e=CoreManager.get("SERVER_URL");"/"!==e[e.length-1]&&(e+="/");const t=e.replace(/https?:\/\//,"");return t.substr(t.indexOf("/"))}singleInstance?CoreManager.setObjectStateController(SingleInstanceStateController):CoreManager.setObjectStateController(UniqueInstanceStateController);class ParseObject{constructor(e,t,r){"function"==typeof this.initialize&&this.initialize.apply(this,arguments);let i=null;if(this._objCount=objectCount++,"string"==typeof e)this.className=e,t&&"object"==typeof t&&(i=t);else if(e&&"object"==typeof e){this.className=e.className,i={};for(const t in e)"className"!==t&&(i[t]=e[t]);t&&"object"==typeof t&&(r=t)}if(i)try{this.set(i,r)}catch(e){throw new Error("Can't create an invalid Parse Object")}CoreManager.get("NODE_LOGGING")&&(this[Symbol.for("nodejs.util.inspect.custom")]=function(){return`ParseObject: className: ${this.className}, id: ${this.id}\nAttributes: ${JSON.stringify(this.attributes,null,2)}`})}get attributes(){const e=CoreManager.getObjectStateController();return Object.freeze(e.estimateAttributes(this._getStateIdentifier()))}get createdAt(){return this._getServerData().createdAt}get updatedAt(){return this._getServerData().updatedAt}_getId(){if("string"==typeof this.id)return this.id;if("string"==typeof this._localId)return this._localId;const e="local"+uuidv4();return this._localId=e,e}_getStateIdentifier(){if(singleInstance){let e=this.id;return e||(e=this._getId()),{id:e,className:this.className}}return this}_getServerData(){return CoreManager.getObjectStateController().getServerData(this._getStateIdentifier())}_clearServerData(){const e=this._getServerData(),t={};for(const r in e)t[r]=void 0;CoreManager.getObjectStateController().setServerData(this._getStateIdentifier(),t)}_getPendingOps(){return CoreManager.getObjectStateController().getPendingOps(this._getStateIdentifier())}_clearPendingOps(e){const t=this._getPendingOps(),r=t[t.length-1];(e||Object.keys(r)).forEach((e=>{delete r[e]}))}_getDirtyObjectAttributes(){const e=this.attributes,t=CoreManager.getObjectStateController().getObjectCache(this._getStateIdentifier()),r={};for(const i in e){const n=e[i];if(n&&"object"==typeof n&&!(n instanceof ParseObject)&&!(n instanceof ParseFile)&&!(n instanceof ParseRelation))try{const e=encode(n,!1,!0),o=JSON.stringify(e);t[i]!==o&&(r[i]=n)}catch(e){r[i]=n}}return r}_toFullJSON(e,t){const r=this.toJSON(e,t);return r.__type="Object",r.className=this.className,r}_getSaveJSON(){const e=this._getPendingOps(),t=this._getDirtyObjectAttributes(),r={};let i;for(i in t){let n=!1;for(let t=0;t<e.length;t+=1)for(const r in e[t])if(r.includes(".")){if(r.split(".")[0]===i){n=!0;break}}n||(r[i]=new SetOp(t[i]).toJSON())}for(i in e[0])r[i]=e[0][i].toJSON();return r}_getSaveParams(){let e=this.id?"PUT":"POST";const t=this._getSaveJSON();let r="classes/"+this.className;return CoreManager.get("ALLOW_CUSTOM_OBJECT_ID")?this.createdAt?(e="PUT",r+="/"+this.id):(e="POST",t.objectId=this.id):this.id?r+="/"+this.id:"_User"===this.className&&(r="users"),{method:e,body:t,path:r}}_finishFetch(e){!this.id&&e.objectId&&(this.id=e.objectId);const t=CoreManager.getObjectStateController();t.initializeState(this._getStateIdentifier());const r={};for(const t in e)"ACL"===t?r[t]=new ParseACL(e[t]):"objectId"!==t&&(r[t]=decode(e[t]),r[t]instanceof ParseRelation&&r[t]._ensureParentAndKey(this,t));r.createdAt&&"string"==typeof r.createdAt&&(r.createdAt=parseDate(r.createdAt)),r.updatedAt&&"string"==typeof r.updatedAt&&(r.updatedAt=parseDate(r.updatedAt)),!r.updatedAt&&r.createdAt&&(r.updatedAt=r.createdAt),t.commitServerChanges(this._getStateIdentifier(),r)}_setExisted(e){const t=CoreManager.getObjectStateController().getState(this._getStateIdentifier());t&&(t.existed=e)}_migrateId(e){if(this._localId&&e)if(singleInstance){const t=CoreManager.getObjectStateController(),r=t.removeState(this._getStateIdentifier());this.id=e,delete this._localId,r&&t.initializeState(this._getStateIdentifier(),r)}else this.id=e,delete this._localId}_handleSaveResponse(e,t){const r={};let i;const n=CoreManager.getObjectStateController(),o=n.popPendingState(this._getStateIdentifier());for(i in o)o[i]instanceof RelationOp?r[i]=o[i].applyTo(void 0,this,i):i in e||(r[i]=o[i].applyTo(void 0));for(i in e)if("createdAt"!==i&&"updatedAt"!==i||"string"!=typeof e[i]){if("ACL"===i)r[i]=new ParseACL(e[i]);else if("objectId"!==i){const t=decode(e[i]);t&&Object.getPrototypeOf(t)===Object.prototype?r[i]={...this.attributes[i],...t}:r[i]=t,r[i]instanceof UnsetOp&&(r[i]=void 0)}}else r[i]=parseDate(e[i]);r.createdAt&&!r.updatedAt&&(r.updatedAt=r.createdAt),this._migrateId(e.objectId),201!==t&&this._setExisted(!0),n.commitServerChanges(this._getStateIdentifier(),r)}_handleSaveError(){CoreManager.getObjectStateController().mergeFirstPendingState(this._getStateIdentifier())}static _getClassMap(){return classMap}static _getRequestOptions(e={}){const t={};if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("request options must be of type Object");const{hasOwn:r}=Object;return r(e,"useMasterKey")&&(t.useMasterKey=!!e.useMasterKey),r(e,"useMaintenanceKey")&&(t.useMaintenanceKey=!!e.useMaintenanceKey),r(e,"sessionToken")&&"string"==typeof e.sessionToken&&(t.sessionToken=e.sessionToken),r(e,"installationId")&&"string"==typeof e.installationId&&(t.installationId=e.installationId),r(e,"transaction")&&"boolean"==typeof e.transaction&&(t.transaction=e.transaction),r(e,"batchSize")&&"number"==typeof e.batchSize&&(t.batchSize=e.batchSize),r(e,"context")&&"object"==typeof e.context&&(t.context=e.context),r(e,"include")&&(t.include=ParseObject.handleIncludeOptions(e)),r(e,"usePost")&&(t.usePost=e.usePost),r(e,"json")&&(t.json=e.json),t}initialize(){}toJSON(e,t){const r=this.id?this.className+":"+this.id:this;e=e||[r];const i={},n=this.attributes;for(const r in n)"createdAt"!==r&&"updatedAt"!==r||!n[r].toJSON?i[r]=encode(n[r],!1,!1,e,t):i[r]=n[r].toJSON();const o=this._getPendingOps();for(const e in o[0])e.indexOf(".")<0&&(i[e]=o[0][e].toJSON(t));return this.id&&(i.objectId=this.id),i}equals(e){return this===e||e instanceof ParseObject&&this.className===e.className&&this.id===e.id&&void 0!==this.id}dirty(e){if(!this.id)return!0;const t=this._getPendingOps(),r=this._getDirtyObjectAttributes();if(e){if(Object.hasOwn(r,e))return!0;for(let r=0;r<t.length;r++)if(Object.hasOwn(t[r],e))return!0;return!1}return 0!==Object.keys(t[0]).length||0!==Object.keys(r).length}dirtyKeys(){const e=this._getPendingOps(),t={};for(let r=0;r<e.length;r++)for(const i in e[r])t[i]=!0;const r=this._getDirtyObjectAttributes();for(const e in r)t[e]=!0;return Object.keys(t)}isDataAvailable(){const e=this._getServerData();return!!Object.keys(e).length}toPointer(){if(!this.id)throw new Error("Cannot create a pointer to an unsaved ParseObject");return{__type:"Pointer",className:this.className,objectId:this.id}}toOfflinePointer(){if(!this._localId)throw new Error("Cannot create a offline pointer to a saved ParseObject");return{__type:"Object",className:this.className,_localId:this._localId}}get(e){return this.attributes[e]}relation(e){const t=this.get(e);if(t){if(!(t instanceof ParseRelation))throw new Error("Called relation() on non-relation field "+e);return t._ensureParentAndKey(this,e),t}return new ParseRelation(this,e)}escape(e){let t=this.attributes[e];if(null==t)return"";if("string"!=typeof t){if("function"!=typeof t.toString)return"";t=t.toString()}return escape$1(t)}has(e){const t=this.attributes;return!!Object.hasOwn(t,e)&&null!=t[e]}set(e,t,r){let i={};const n={};if(e&&"object"==typeof e)i=e,r=t;else{if("string"!=typeof e)return this;i[e]=t}r=r||{};let o=[];"function"==typeof this.constructor.readOnlyAttributes&&(o=o.concat(this.constructor.readOnlyAttributes()));for(const e in i)if("createdAt"!==e&&"updatedAt"!==e){if(o.indexOf(e)>-1)throw new Error("Cannot modify readonly attribute: "+e);if(r.unset)n[e]=new UnsetOp;else if(i[e]instanceof Op)n[e]=i[e];else if(i[e]&&"object"==typeof i[e]&&"string"==typeof i[e].__op)n[e]=opFromJSON(i[e]);else if("objectId"===e||"id"===e)"string"==typeof i[e]&&(this.id=i[e]);else if("ACL"!==e||"object"!=typeof i[e]||i[e]instanceof ParseACL)if(i[e]instanceof ParseRelation){const t=new ParseRelation(this,e);t.targetClassName=i[e].targetClassName,n[e]=new SetOp(t)}else n[e]=new SetOp(i[e]);else n[e]=new SetOp(new ParseACL(i[e]))}const s=this.attributes,a={};for(const e in n)n[e]instanceof RelationOp?a[e]=n[e].applyTo(s[e],this,e):n[e]instanceof UnsetOp||(a[e]=n[e].applyTo(s[e]));if(!r.ignoreValidation){const e=this.validate(a);if(e)throw e}const u=this._getPendingOps(),h=u.length-1,f=CoreManager.getObjectStateController();for(const e in n){const t=n[e].mergeWith(u[h][e]);f.setPendingOp(this._getStateIdentifier(),e,t)}return this}unset(e,t){return(t=t||{}).unset=!0,this.set(e,null,t)}increment(e,t){if(void 0===t&&(t=1),"number"!=typeof t)throw new Error("Cannot increment by a non-numeric amount.");return this.set(e,new IncrementOp(t))}decrement(e,t){if(void 0===t&&(t=1),"number"!=typeof t)throw new Error("Cannot decrement by a non-numeric amount.");return this.set(e,new IncrementOp(-1*t))}add(e,t){return this.set(e,new AddOp([t]))}addAll(e,t){return this.set(e,new AddOp(t))}addUnique(e,t){return this.set(e,new AddUniqueOp([t]))}addAllUnique(e,t){return this.set(e,new AddUniqueOp(t))}remove(e,t){return this.set(e,new RemoveOp([t]))}removeAll(e,t){return this.set(e,new RemoveOp(t))}op(e){const t=this._getPendingOps();for(let r=0;r<t.length;r+=1)if(t[r][e])return t[r][e]}clone(){const e=new this.constructor(this.className);let t=this.attributes;if("function"==typeof this.constructor.readOnlyAttributes){const e=this.constructor.readOnlyAttributes()||[],r={};for(const i in t)e.indexOf(i)<0&&(r[i]=t[i]);t=r}return e.set&&e.set(t),e}newInstance(){const e=new this.constructor(this.className);if(e.id=this.id,singleInstance)return e;const t=CoreManager.getObjectStateController();return t&&t.duplicateState(this._getStateIdentifier(),e._getStateIdentifier()),e}isNew(){return!this.id}existed(){if(!this.id)return!1;const e=CoreManager.getObjectStateController().getState(this._getStateIdentifier());return!!e&&e.existed}async exists(e){if(!this.id)return!1;try{const t=new(CoreManager.getParseQuery())(this.className);return await t.get(this.id,e),!0}catch(e){if(e.code===ParseError.OBJECT_NOT_FOUND)return!1;throw e}}isValid(){return!this.validate(this.attributes)}validate(e){if(Object.hasOwn(e,"ACL")&&!(e.ACL instanceof ParseACL))return new ParseError(ParseError.OTHER_CAUSE,"ACL must be a Parse ACL.");for(const t in e)if(!/^[A-Za-z_][0-9A-Za-z_.]*$/.test(t))return new ParseError(ParseError.INVALID_KEY_NAME,`Invalid key name: ${t}`);return!1}getACL(){const e=this.get("ACL");return e instanceof ParseACL?e:null}setACL(e,t){return this.set("ACL",e,t)}revert(...e){let t;if(e.length){t=[];for(const r of e){if("string"!=typeof r)throw new Error("Parse.Object#revert expects either no, or a list of string, arguments.");t.push(r)}}this._clearPendingOps(t)}clear(){const e=this.attributes,t={};let r=["createdAt","updatedAt"];"function"==typeof this.constructor.readOnlyAttributes&&(r=r.concat(this.constructor.readOnlyAttributes()));for(const i in e)r.indexOf(i)<0&&(t[i]=!0);return this.set(t,{unset:!0})}fetch(e){const t=ParseObject._getRequestOptions(e);return CoreManager.getObjectController().fetch(this,!0,t)}fetchWithInclude(e,t){return(t=t||{}).include=e,this.fetch(t)}async saveEventually(e){try{await this.save(null,e)}catch(t){t.code===ParseError.CONNECTION_FAILED&&(await CoreManager.getEventuallyQueue().save(this,e),CoreManager.getEventuallyQueue().poll())}return this}async save(e,t,r){let i,n;"object"==typeof e||void 0===e?(i=e,"object"==typeof t&&(n=t)):(i={},i[e]=t,n=r),n=n||{},i&&this.set(i,n);const o=ParseObject._getRequestOptions(n),s=CoreManager.getObjectController(),a=!1!==n.cascadeSave?unsavedChildren(this):null;if(a&&a.length&&!0===n.transaction&&a.some((e=>e instanceof ParseObject))){const e=[],t=[];a.forEach((r=>{r instanceof ParseFile?e.push(r):t.push(r)})),t.push(this);return(e.length?s.save(e,o):Promise.resolve()).then((()=>s.save(t,o))).then((e=>e.pop()))}return await s.save(a,o),s.save(this,o)}async destroyEventually(e){try{await this.destroy(e)}catch(t){t.code===ParseError.CONNECTION_FAILED&&(await CoreManager.getEventuallyQueue().destroy(this,e),CoreManager.getEventuallyQueue().poll())}return this}destroy(e){if(!this.id)return Promise.resolve(void 0);const t=ParseObject._getRequestOptions(e);return CoreManager.getObjectController().destroy(this,t)}pin(){return ParseObject.pinAllWithName(DEFAULT_PIN,[this])}unPin(){return ParseObject.unPinAllWithName(DEFAULT_PIN,[this])}async isPinned(){const e=CoreManager.getLocalDatastore();if(!e.isEnabled)return Promise.reject("Parse.enableLocalDatastore() must be called first");const t=e.getKeyForObject(this);return(await e.fromPinWithName(t)).length>0}pinWithName(e){return ParseObject.pinAllWithName(e,[this])}unPinWithName(e){return ParseObject.unPinAllWithName(e,[this])}async fetchFromLocalDatastore(){const e=CoreManager.getLocalDatastore();if(!e.isEnabled)throw new Error("Parse.enableLocalDatastore() must be called first");const t=e.getKeyForObject(this),r=await e._serializeObject(t);if(!r)throw new Error("Cannot fetch an unsaved ParseObject");const i=ParseObject.fromJSON(r);return this._finishFetch(i.toJSON()),this}static _clearAllState(){CoreManager.getObjectStateController().clearAllState()}static fetchAll(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getObjectController().fetch(e,!0,r)}static fetchAllWithInclude(e,t,r){return(r=r||{}).include=t,ParseObject.fetchAll(e,r)}static fetchAllIfNeededWithInclude(e,t,r){return(r=r||{}).include=t,ParseObject.fetchAllIfNeeded(e,r)}static fetchAllIfNeeded(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getObjectController().fetch(e,!1,r)}static handleIncludeOptions(e){let t=[];return Array.isArray(e.include)?e.include.forEach((e=>{Array.isArray(e)?t=t.concat(e):t.push(e)})):t.push(e.include),t}static destroyAll(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getObjectController().destroy(e,r)}static saveAll(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getObjectController().save(e,r)}static createWithoutData(e){const t=new this;return t.id=e,t}static fromJSON(e,t,r){if(!e.className)throw new Error("Cannot create an object without a className");const i=classMap[e.className],n=i?new i(e.className):new ParseObject(e.className),o={};for(const t in e)"className"!==t&&"__type"!==t&&(o[t]=e[t],r&&n.set(t,e[t]));if(t){o.objectId&&(n.id=o.objectId);let e=null;"function"==typeof n._preserveFieldsOnFetch&&(e=n._preserveFieldsOnFetch()),n._clearServerData(),e&&n._finishFetch(e)}return n._finishFetch(o),e.objectId&&n._setExisted(!0),n}static registerSubclass(e,t){if("string"!=typeof e)throw new TypeError("The first argument must be a valid class name.");if(void 0===t)throw new TypeError("You must supply a subclass constructor.");if("function"!=typeof t)throw new TypeError("You must register the subclass constructor. Did you attempt to register an instance of the subclass?");classMap[e]=t,t.className||(t.className=e)}static unregisterSubclass(e){if("string"!=typeof e)throw new TypeError("The first argument must be a valid class name.");delete classMap[e]}static extend(e,t,r){if("string"!=typeof e){if(e&&"string"==typeof e.className)return ParseObject.extend(e.className,e,t);throw new Error("Parse.Object.extend's first argument should be the className.")}let i=e;"User"===i&&CoreManager.get("PERFORM_USER_REWRITE")&&(i="_User");let n=ParseObject.prototype;Object.hasOwn(this,"__super__")&&this.__super__&&(n=this.prototype);let o=function(e,t){if(this.className=i,this._objCount=objectCount++,"function"==typeof this.initialize&&this.initialize.apply(this,arguments),this._initializers)for(const e of this._initializers)e.apply(this,arguments);if(e&&"object"==typeof e)try{this.set(e||{},t)}catch(e){throw new Error("Can't create an invalid Parse Object")}};if(classMap[i]?o=classMap[i]:(o.extend=function(e,t,r){return"string"==typeof e?ParseObject.extend.call(o,e,t,r):ParseObject.extend.call(o,i,e,t)},o.createWithoutData=ParseObject.createWithoutData,o.className=i,o.__super__=n,o.prototype=Object.create(n,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}})),t)for(const e in t)"initialize"!==e?"className"!==e&&Object.defineProperty(o.prototype,e,{value:t[e],enumerable:!1,writable:!0,configurable:!0}):Object.defineProperty(o.prototype,"_initializers",{value:[...o.prototype._initializers||[],t[e]],enumerable:!1,writable:!0,configurable:!0});if(r)for(const e in r)"className"!==e&&Object.defineProperty(o,e,{value:r[e],enumerable:!1,writable:!0,configurable:!0});return classMap[i]=o,o}static enableSingleInstance(){singleInstance=!0,CoreManager.setObjectStateController(SingleInstanceStateController)}static disableSingleInstance(){singleInstance=!1,CoreManager.setObjectStateController(UniqueInstanceStateController)}static pinAll(e){return CoreManager.getLocalDatastore().isEnabled?ParseObject.pinAllWithName(DEFAULT_PIN,e):Promise.reject("Parse.enableLocalDatastore() must be called first")}static pinAllWithName(e,t){const r=CoreManager.getLocalDatastore();return r.isEnabled?r._handlePinAllWithName(e,t):Promise.reject("Parse.enableLocalDatastore() must be called first")}static unPinAll(e){return CoreManager.getLocalDatastore().isEnabled?ParseObject.unPinAllWithName(DEFAULT_PIN,e):Promise.reject("Parse.enableLocalDatastore() must be called first")}static unPinAllWithName(e,t){const r=CoreManager.getLocalDatastore();return r.isEnabled?r._handleUnPinAllWithName(e,t):Promise.reject("Parse.enableLocalDatastore() must be called first")}static unPinAllObjects(){const e=CoreManager.getLocalDatastore();return e.isEnabled?e.unPinWithName(DEFAULT_PIN):Promise.reject("Parse.enableLocalDatastore() must be called first")}static unPinAllObjectsWithName(e){const t=CoreManager.getLocalDatastore();return t.isEnabled?t.unPinWithName(PIN_PREFIX+e):Promise.reject("Parse.enableLocalDatastore() must be called first")}}const DefaultController$9={fetch(e,t,r){const i=CoreManager.getLocalDatastore();if(Array.isArray(e)){if(e.length<1)return Promise.resolve([]);const n=[],o=[];let s=null;const a=[];let u=null;if(e.forEach((e=>{u||(s||(s=e.className),s!==e.className&&(u=new ParseError(ParseError.INVALID_CLASS_NAME,"All objects should be of the same class")),e.id||(u=new ParseError(ParseError.MISSING_OBJECT_ID,"All objects must have an ID")),!t&&e.isDataAvailable()||(o.push(e.id),n.push(e)),a.push(e))})),u)return Promise.reject(u);const h=new(CoreManager.getParseQuery())(s);return h.containedIn("objectId",o),r&&r.include&&h.include(r.include),h._limit=o.length,h.find(r).then((async e=>{const r={};e.forEach((e=>{r[e.id]=e}));for(let e=0;e<n.length;e++){const i=n[e];if((!i||!i.id||!r[i.id])&&t)return Promise.reject(new ParseError(ParseError.OBJECT_NOT_FOUND,"All objects must exist on the server."))}if(!singleInstance)for(let e=0;e<a.length;e++){const t=a[e];if(t&&t.id&&r[t.id]){const i=t.id;t._finishFetch(r[i].toJSON()),a[e]=r[i]}}for(const e of a)await i._updateObjectIfPinned(e);return Promise.resolve(a)}))}if(e instanceof ParseObject){if(!e.id)return Promise.reject(new ParseError(ParseError.MISSING_OBJECT_ID,"Object does not have an ID"));const t=CoreManager.getRESTController(),n={};return r&&r.include&&(n.include=r.include.join()),t.request("GET","classes/"+e.className+"/"+e._getId(),n,r).then((async t=>(e._clearPendingOps(),e._clearServerData(),e._finishFetch(t),await i._updateObjectIfPinned(e),e)))}return Promise.resolve(void 0)},async destroy(e,t){if(t&&t.batchSize&&t.transaction)throw new ParseError(ParseError.OTHER_CAUSE,"You cannot use both transaction and batchSize options simultaneously.");let r=t&&t.batchSize?t.batchSize:CoreManager.get("REQUEST_BATCH_SIZE");const i=CoreManager.getLocalDatastore(),n=CoreManager.getRESTController();if(Array.isArray(e)){if(t&&t.transaction&&e.length>1&&(r=e.length),e.length<1)return Promise.resolve([]);const o=[[]];e.forEach((e=>{e.id&&(o[o.length-1].push(e),o[o.length-1].length>=r&&o.push([]))})),0===o[o.length-1].length&&o.pop();let s=Promise.resolve();const a=[];return o.forEach((e=>{const r=e.map((e=>({method:"DELETE",path:getServerUrlPath()+"classes/"+e.className+"/"+e._getId(),body:{}}))),i=t&&t.transaction&&r.length>1?{requests:r,transaction:!0}:{requests:r};s=s.then((()=>n.request("POST","batch",i,t).then((t=>{for(let r=0;r<t.length;r++)if(t[r]&&Object.hasOwn(t[r],"error")){const i=new ParseError(t[r].error.code,t[r].error.error);i.object=e[r],a.push(i)}}))))})),s.then((async()=>{if(a.length){const e=new ParseError(ParseError.AGGREGATE_ERROR);return e.errors=a,Promise.reject(e)}for(const t of e)await i._destroyObjectIfPinned(t);return Promise.resolve(e)}))}return e instanceof ParseObject?n.request("DELETE","classes/"+e.className+"/"+e._getId(),{},t).then((async()=>(await i._destroyObjectIfPinned(e),Promise.resolve(e)))):Promise.resolve(e)},save(e,t){if(t&&t.batchSize&&t.transaction)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"You cannot use both transaction and batchSize options simultaneously."));let r=t&&t.batchSize?t.batchSize:CoreManager.get("REQUEST_BATCH_SIZE");const i=CoreManager.getLocalDatastore(),n={},o=CoreManager.getRESTController(),s=CoreManager.getObjectStateController(),a=CoreManager.get("ALLOW_CUSTOM_OBJECT_ID");if((t=t||{}).returnStatus=t.returnStatus||!0,Array.isArray(e)){if(e.length<1)return Promise.resolve([]);let u=e.concat();for(let t=0;t<e.length;t++){const r=e[t];r instanceof ParseObject&&(u=u.concat(unsavedChildren(r,!0)))}u=unique(u);const h=[];let f=[];if(u.forEach((e=>{e instanceof ParseFile?h.push(e.save(t)):e instanceof ParseObject&&f.push(e)})),t&&t.transaction&&f.length>1){if(f.some((e=>!canBeSerialized(e))))return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Tried to save a transactional batch containing an object with unserializable attributes."));r=f.length}return Promise.all(h).then((()=>{let u=null;return continueWhile((()=>f.length>0),(()=>{const e=[],i=[];if(f.forEach((t=>{if(a&&Object.hasOwn(t,"id")&&!t.id)throw new ParseError(ParseError.MISSING_OBJECT_ID,"objectId must not be empty or null");e.length<r&&canBeSerialized(t)?e.push(t):i.push(t)})),f=i,e.length<1)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Tried to save a batch with a cycle."));const h=resolvingPromise(),l=[],c=[];return e.forEach(((e,t)=>{const r=resolvingPromise();l.push(r);s.pushPendingState(e._getStateIdentifier()),c.push(s.enqueueTask(e._getStateIdentifier(),(function(){return r.resolve(),h.then((r=>{if(Object.hasOwn(r[t],"success")){const i=r[t].success.objectId,o=r[t]._status;delete r[t]._status,delete r[t]._headers,n[i]=e._localId,e._handleSaveResponse(r[t].success,o)}else{if(!u&&Object.hasOwn(r[t],"error")){const e=r[t].error;u=new ParseError(e.code,e.error),f=[]}e._handleSaveError()}}))})))})),when(l).then((()=>{const r=e.map((e=>{const t=e._getSaveParams();return t.path=getServerUrlPath()+t.path,t})),i=t&&t.transaction&&r.length>1?{requests:r,transaction:!0}:{requests:r};return o.request("POST","batch",i,t)})).then(h.resolve,(e=>{h.reject(new ParseError(ParseError.INCORRECT_TYPE,e.message))})),when(c)})).then((async()=>{if(u)return Promise.reject(u);for(const t of e)t instanceof ParseObject&&(await i._updateLocalIdForObject(n[t.id],t),await i._updateObjectIfPinned(t));return Promise.resolve(e)}))}))}if(e instanceof ParseObject){if(a&&Object.hasOwn(e,"id")&&!e.id)throw new ParseError(ParseError.MISSING_OBJECT_ID,"objectId must not be empty or null");e._getId();const r=e._localId,n=e,u=function(){const e=n._getSaveParams();return o.request(e.method,e.path,e.body,t).then((e=>{const t=e._status;delete e._status,delete e._headers,n._handleSaveResponse(e,t)}),(e=>(n._handleSaveError(),Promise.reject(e))))};return s.pushPendingState(e._getStateIdentifier()),s.enqueueTask(e._getStateIdentifier(),u).then((async()=>(await i._updateLocalIdForObject(r,e),await i._updateObjectIfPinned(e),e)),(e=>Promise.reject(e)))}return Promise.resolve(void 0)}};function equals(e,t){const r=Object.prototype.toString;if("[object Date]"===r.call(e)||"[object Date]"===r.call(t)){return+new Date(e)==+new Date(t)}if(typeof e!=typeof t)return!1;if(!e||"object"!=typeof e)return e===t;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(!equals(e[r],t[r]))return!1;return!0}const i=CoreManager.getParseObject();if(e instanceof ParseACL||e instanceof ParseFile||e instanceof ParseGeoPoint||e instanceof i)return e.equals(t);if(t instanceof i&&("Object"===e.__type||"Pointer"===e.__type))return e.objectId===t.id&&e.className===t.className;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(!equals(e[r],t[r]))return!1;return!0}function contains(e,t){if(t&&t.__type&&("Pointer"===t.__type||"Object"===t.__type)){for(const r in e){const i=e[r];if("string"==typeof i&&i===t.objectId)return!0;if(i.className===t.className&&i.objectId===t.objectId)return!0}return!1}if(Array.isArray(t))for(const r of t)if(contains(e,r))return!0;return e.indexOf(t)>-1}function transformObject(e){return e._toFullJSON?e._toFullJSON():e}function matchesQuery(e,t,r,i){if(t.className!==e)return!1;let n=t,o=i;t.toJSON&&(n=t.toJSON()),i.toJSON&&(o=i.toJSON().where),n.className=e;for(const t in o)if(!matchesKeyConstraints(e,n,r,t,o[t]))return!1;return!0}function equalObjectsGeneric(e,t,r){if(Array.isArray(e)){for(let i=0;i<e.length;i++)if(r(e[i],t))return!0;return!1}return r(e,t)}function relativeTimeToDate(e,t=new Date){let r=(e=e.toLowerCase()).split(" ");r=r.filter((e=>""!==e));const i="in"===r[0],n="ago"===r[r.length-1];if(!i&&!n&&"now"!==e)return{status:"error",info:"Time should either start with 'in' or end with 'ago'"};if(i&&n)return{status:"error",info:"Time cannot have both 'in' and 'ago'"};if(r=i?r.slice(1):r.slice(0,r.length-1),r.length%2!=0&&"now"!==e)return{status:"error",info:"Invalid time string. Dangling unit or number."};const o=[];for(;r.length;)o.push([r.shift(),r.shift()]);let s=0;for(const[e,t]of o){const r=Number(e);if(!Number.isInteger(r))return{status:"error",info:`'${e}' is not an integer.`};switch(t){case"yr":case"yrs":case"year":case"years":s+=31536e3*r;break;case"wk":case"wks":case"week":case"weeks":s+=604800*r;break;case"d":case"day":case"days":s+=86400*r;break;case"hr":case"hrs":case"hour":case"hours":s+=3600*r;break;case"min":case"mins":case"minute":case"minutes":s+=60*r;break;case"sec":case"secs":case"second":case"seconds":s+=r;break;default:return{status:"error",info:`Invalid interval: '${t}'`}}}const a=1e3*s;return i?{status:"success",info:"future",result:new Date(t.valueOf()+a)}:n?{status:"success",info:"past",result:new Date(t.valueOf()-a)}:{status:"success",info:"present",result:new Date(t.valueOf())}}function matchesKeyConstraints(e,t,r,i,n){if(null===n)return!1;if(i.indexOf(".")>=0){const o=i.split("."),s=o[0],a=o.slice(1).join(".");return matchesKeyConstraints(e,t[s]||{},r,a,n)}let o,s;if("$or"===i){for(o=0;o<n.length;o++)if(matchesQuery(e,t,r,n[o]))return!0;return!1}if("$and"===i){for(o=0;o<n.length;o++)if(!matchesQuery(e,t,r,n[o]))return!1;return!0}if("$nor"===i){for(o=0;o<n.length;o++)if(matchesQuery(e,t,r,n[o]))return!1;return!0}if("$relatedTo"===i)return!1;if(!/^[A-Za-z][0-9A-Za-z_]*$/.test(i))throw new ParseError(ParseError.INVALID_KEY_NAME,`Invalid Key: ${i}`);if("object"!=typeof n)return Array.isArray(t[i])?t[i].indexOf(n)>-1:t[i]===n;if(n.__type)return"Pointer"===n.__type?equalObjectsGeneric(t[i],n,(function(e,t){return void 0!==e&&t.className===e.className&&t.objectId===e.objectId})):equalObjectsGeneric(decode(t[i]),decode(n),equals);for(const e in n){if(s=n[e],s?.__type&&(s=decode(s)),s?.$relativeTime){const e=relativeTimeToDate(s.$relativeTime);if("success"!==e.status)throw new ParseError(ParseError.INVALID_JSON,`bad $relativeTime (${i}) value. ${e.info}`);s=e.result}switch(("[object Date]"===toString.call(s)||"string"==typeof s&&"Invalid Date"!==new Date(s).toString())&&(t[i]=new Date(t[i].iso?t[i].iso:t[i])),e){case"$lt":if(t[i]>=s)return!1;break;case"$lte":if(t[i]>s)return!1;break;case"$gt":if(t[i]<=s)return!1;break;case"$gte":if(t[i]<s)return!1;break;case"$ne":if(equals(t[i],s))return!1;break;case"$in":if(!contains(s,t[i]))return!1;break;case"$nin":if(contains(s,t[i]))return!1;break;case"$all":for(o=0;o<s.length;o++)if(t[i].indexOf(s[o])<0)return!1;break;case"$exists":{const e=void 0!==t[i],r=n.$exists;if("boolean"!=typeof n.$exists)break;if(!e&&r||e&&!r)return!1;break}case"$regex":{if("object"==typeof s)return s.test(t[i]);let e="",r=-2,o=s.indexOf("\\Q");for(;o>-1;)e+=s.substring(r+2,o),r=s.indexOf("\\E",o),r>-1&&(e+=s.substring(o+2,r).replace(/\\\\\\\\E/g,"\\E").replace(/\W/g,"\\$&")),o=s.indexOf("\\Q",r);e+=s.substring(Math.max(o,r+2));let a=n.$options||"";a=a.replace("x","").replace("s","");if(!new RegExp(e,a).test(t[i]))return!1;break}case"$nearSphere":if(!s||!t[i])return!1;return s.radiansTo(t[i])<=(n.$maxDistance||1/0);case"$within":{if(!s||!t[i])return!1;const e=s.$box[0],r=s.$box[1];return!(e.latitude>r.latitude||e.longitude>r.longitude)&&(t[i].latitude>e.latitude&&t[i].latitude<r.latitude&&t[i].longitude>e.longitude&&t[i].longitude<r.longitude)}case"$options":case"$maxDistance":break;case"$select":{const e=r.filter(((e,t,r)=>matchesQuery(s.query.className,e,r,s.query.where)));for(let r=0;r<e.length;r+=1){const n=transformObject(e[r]);return equals(t[i],n[s.key])}return!1}case"$dontSelect":{const e=r.filter(((e,t,r)=>matchesQuery(s.query.className,e,r,s.query.where)));for(let r=0;r<e.length;r+=1){const n=transformObject(e[r]);return!equals(t[i],n[s.key])}return!1}case"$inQuery":{const e=r.filter(((e,t,r)=>matchesQuery(s.className,e,r,s.where)));for(let r=0;r<e.length;r+=1){const n=transformObject(e[r]);if(t[i].className===n.className&&t[i].objectId===n.objectId)return!0}return!1}case"$notInQuery":{const e=r.filter(((e,t,r)=>matchesQuery(s.className,e,r,s.where)));for(let r=0;r<e.length;r+=1){const n=transformObject(e[r]);if(t[i].className===n.className&&t[i].objectId===n.objectId)return!1}return!0}case"$containedBy":for(const e of t[i])if(!contains(s,e))return!1;return!0;case"$geoWithin":if(s.$polygon){const e=s.$polygon.map((e=>[e.latitude,e.longitude]));return new ParsePolygon(e).containsPoint(t[i])}if(s.$centerSphere){const[e,r]=s.$centerSphere,n=new ParseGeoPoint({latitude:e[1],longitude:e[0]});return new ParseGeoPoint(t[i]).radiansTo(n)<=r}return!1;case"$geoIntersects":{const e=new ParsePolygon(t[i].coordinates),r=new ParseGeoPoint(s.$point);return e.containsPoint(r)}default:return!1}}return!0}function validateQuery(e){let t=e;e.toJSON&&(t=e.toJSON().where);const r=["$and","$or","$nor","_rperm","_wperm","_perishable_token","_email_verify_token","_email_verify_token_expires_at","_account_lockout_expires_at","_failed_login_count"];Object.keys(t).forEach((e=>{if(t&&t[e]&&t[e].$regex&&"string"==typeof t[e].$options&&!t[e].$options.match(/^[imxs]+$/))throw new ParseError(ParseError.INVALID_QUERY,`Bad $options value for query: ${t[e].$options}`);if(r.indexOf(e)<0&&!e.match(/^[a-zA-Z][a-zA-Z0-9_\.]*$/))throw new ParseError(ParseError.INVALID_KEY_NAME,`Invalid key name: ${e}`)}))}CoreManager.setParseObject(ParseObject),CoreManager.setObjectController(DefaultController$9);const OfflineQuery={matchesQuery:matchesQuery,validateQuery:validateQuery};function quote(e){return"\\Q"+e.replace("\\E","\\E\\\\E\\Q")+"\\E"}function _getClassNameFromQueries(e){let t=null;return e.forEach((e=>{if(t||(t=e.className),t!==e.className)throw new Error("All queries must be for the same class.")})),t}function handleSelectResult(e,t){const r={};if(t.forEach((t=>{const i=-1!==t.indexOf(".");if(i||Object.hasOwn(e,t)){if(i){const i=t.split(".");let n=e,o=r;i.forEach(((e,t,r)=>{n&&!Object.hasOwn(n,e)&&(n[e]=void 0),n&&"object"==typeof n&&(n=n[e]),t<r.length-1&&(o[e]||(o[e]={}),o=o[e])}))}}else e[t]=void 0})),Object.keys(r).length>0){copyMissingDataWithMask(CoreManager.getObjectStateController().getServerData({id:e.objectId,className:e.className}),e,r,!1)}}function copyMissingDataWithMask(e,t,r,i){if(i)for(const r in e)Object.hasOwn(e,r)&&!Object.hasOwn(t,r)&&(t[r]=e[r]);for(const i in r)void 0!==t[i]&&null!==t[i]&&null!=e&©MissingDataWithMask(e[i],t[i],r[i],!0)}function handleOfflineSort(e,t,r){let i=r[0];const n="-"===i.slice(0,1);if(n&&(i=i.substring(1)),"_created_at"===i&&(i="createdAt"),"_updated_at"===i&&(i="updatedAt"),!/^[A-Za-z][0-9A-Za-z_]*$/.test(i)||"password"===i)throw new ParseError(ParseError.INVALID_KEY_NAME,`Invalid Key: ${i}`);const o=e.get(i),s=t.get(i);if(o<s)return n?1:-1;if(o>s)return n?-1:1;if(r.length>1){return handleOfflineSort(e,t,r.slice(1))}return 0}class ParseQuery{constructor(e){if("string"==typeof e)"User"===e&&CoreManager.get("PERFORM_USER_REWRITE")?this.className="_User":this.className=e;else if(e instanceof ParseObject)this.className=e.className;else{if("function"!=typeof e)throw new TypeError("A ParseQuery must be constructed with a ParseObject or class name.");{const t=e;if("string"==typeof t.className)this.className=t.className;else{const e=new t;this.className=e.className}}}this._where={},this._watch=[],this._include=[],this._exclude=[],this._count=!1,this._limit=-1,this._skip=0,this._readPreference=null,this._includeReadPreference=null,this._subqueryReadPreference=null,this._queriesLocalDatastore=!1,this._localDatastorePinName=null,this._extraOptions={},this._xhrRequest={task:null,onchange:()=>{}},this._comment=null}_orQuery(e){const t=e.map((e=>e.toJSON().where));return this._where.$or=t,this}_andQuery(e){const t=e.map((e=>e.toJSON().where));return this._where.$and=t,this}_norQuery(e){const t=e.map((e=>e.toJSON().where));return this._where.$nor=t,this}_addCondition(e,t,r){return this._where[e]&&"string"!=typeof this._where[e]||(this._where[e]={}),this._where[e][t]=encode(r,!1,!0),this}_regexStartWith(e){return"^"+quote(e)}async _handleOfflineQuery(e){OfflineQuery.validateQuery(this);const t=CoreManager.getLocalDatastore();let r,i=(await t._serializeObjectsFromPinName(this._localDatastorePinName)).map(((e,t,r)=>{const i=ParseObject.fromJSON(e,!1);return e._localId&&!e.objectId&&(i._localId=e._localId),OfflineQuery.matchesQuery(this.className,i,r,this)?i:null})).filter((e=>null!==e));if(e.keys){let t=e.keys.split(",");const r=["className","objectId","createdAt","updatedAt","ACL"];t=t.concat(r),i=i.map((e=>{const r=e._toFullJSON();return Object.keys(r).forEach((e=>{t.includes(e)||delete r[e]})),ParseObject.fromJSON(r,!1)}))}if(e.order){const t=e.order.split(",");i.sort(((e,r)=>handleOfflineSort(e,r,t)))}e.count&&(r=i.length),e.skip&&(i=e.skip>=i.length?[]:i.splice(e.skip,i.length));let n=i.length;return 0!==e.limit&&e.limit<i.length&&(n=e.limit),i=i.splice(0,n),"number"==typeof r?{results:i,count:r}:i}toJSON(){const e={where:this._where};this._watch.length&&(e.watch=this._watch.join(",")),this._include.length&&(e.include=this._include.join(",")),this._exclude.length&&(e.excludeKeys=this._exclude.join(",")),this._select&&(e.keys=this._select.join(",")),this._count&&(e.count=1),this._limit>=0&&(e.limit=this._limit),this._skip>0&&(e.skip=this._skip),this._order&&(e.order=this._order.join(",")),this._readPreference&&(e.readPreference=this._readPreference),this._includeReadPreference&&(e.includeReadPreference=this._includeReadPreference),this._subqueryReadPreference&&(e.subqueryReadPreference=this._subqueryReadPreference),this._hint&&(e.hint=this._hint),this._explain&&(e.explain=!0),this._comment&&(e.comment=this._comment);for(const t in this._extraOptions)e[t]=this._extraOptions[t];return e}withJSON(e){e.where&&(this._where=e.where),e.watch&&(this._watch=e.watch.split(",")),e.include&&(this._include=e.include.split(",")),e.keys&&(this._select=e.keys.split(",")),e.excludeKeys&&(this._exclude=e.excludeKeys.split(",")),e.count&&(this._count=1===e.count),e.limit&&(this._limit=e.limit),e.skip&&(this._skip=e.skip),e.order&&(this._order=e.order.split(",")),e.readPreference&&(this._readPreference=e.readPreference),e.includeReadPreference&&(this._includeReadPreference=e.includeReadPreference),e.subqueryReadPreference&&(this._subqueryReadPreference=e.subqueryReadPreference),e.hint&&(this._hint=e.hint),e.explain&&(this._explain=!!e.explain),e.comment&&(this._comment=e.comment);for(const t in e)Object.hasOwn(e,t)&&-1===["where","include","keys","count","limit","skip","order","readPreference","includeReadPreference","subqueryReadPreference","hint","explain","comment"].indexOf(t)&&(this._extraOptions[t]=e[t]);return this}static fromJSON(e,t){return new ParseQuery(e).withJSON(t)}get(e,t){this.equalTo("objectId",e);const r=ParseObject._getRequestOptions(t);return this.first(r).then((e=>{if(e)return e;const t=new ParseError(ParseError.OBJECT_NOT_FOUND,"Object not found.");return Promise.reject(t)}))}find(e){const t=ParseObject._getRequestOptions(e);this._setRequestTask(t);const r=CoreManager.getQueryController(),i=this._select;return this._queriesLocalDatastore?this._handleOfflineQuery(this.toJSON()):r.find(this.className,this.toJSON(),t).then((e=>{if(this._explain)return e.results;const r=e.results?.map((r=>{const n=e.className||this.className;return r.className||(r.className=n),i&&handleSelectResult(r,i),t.json?r:ParseObject.fromJSON(r,!i)})),n=e.count;return"number"==typeof n?{results:r,count:n}:r}))}async findAll(e){let t=[];return await this.eachBatch((e=>{t=[...t,...e]}),e),t}count(e){e=e||{};const t=ParseObject._getRequestOptions(e);this._setRequestTask(t);const r=CoreManager.getQueryController(),i=this.toJSON();return i.limit=0,i.count=1,r.find(this.className,i,t).then((e=>e.count))}distinct(e){const t={useMasterKey:!0};this._setRequestTask(t);const r={distinct:e,where:this._where,hint:this._hint};return CoreManager.getQueryController().aggregate(this.className,r,t).then((e=>e.results))}aggregate(e){if(!Array.isArray(e)&&"object"!=typeof e)throw new Error("Invalid pipeline must be Array or Object");Object.keys(this._where||{}).length&&(Array.isArray(e)||(e=[e]),e.unshift({$match:this._where}));const t={pipeline:e,hint:this._hint,explain:this._explain,readPreference:this._readPreference},r={useMasterKey:!0};this._setRequestTask(r);return CoreManager.getQueryController().aggregate(this.className,t,r).then((e=>e.results))}first(e={}){const t=ParseObject._getRequestOptions(e);this._setRequestTask(t);const r=CoreManager.getQueryController(),i=this.toJSON();i.limit=1;const n=this._select;return this._queriesLocalDatastore?this._handleOfflineQuery(i).then((e=>{if(e[0])return e[0]})):r.find(this.className,i,t).then((e=>{const r=e.results;if(r[0])return r[0].className||(r[0].className=this.className),n&&handleSelectResult(r[0],n),t.json?r[0]:ParseObject.fromJSON(r[0],!n)}))}eachBatch(e,t){if(t=t||{},this._order||this._skip||this._limit>=0){const e="Cannot iterate on a query with sort, skip, or limit.";return Promise.reject(e)}const r=ParseQuery.fromJSON(this.className,this.toJSON());r.ascending("objectId"),r._limit=t.batchSize||100;const i=ParseObject._getRequestOptions(t);let n=!1,o=[];return continueWhile((()=>!n),(async()=>{const[t]=await Promise.all([r.find(i),Promise.resolve(o.length>0&&e(o))]);t.length>=r._limit?(i.json?r.greaterThan("objectId",t[t.length-1].objectId):r.greaterThan("objectId",t[t.length-1].id),o=t):t.length>0?(await Promise.resolve(e(t)),n=!0):n=!0}))}each(e,t){return this.eachBatch((t=>{let r=Promise.resolve();return t.forEach((t=>{r=r.then((()=>e(t)))})),r}),t)}hint(e){return void 0===e&&delete this._hint,this._hint=e,this}explain(e=!0){if("boolean"!=typeof e)throw new Error("You can only set explain to a boolean value");return this._explain=e,this}async map(e,t){const r=[];let i=0;return await this.each((t=>Promise.resolve(e(t,i,this)).then((e=>{r.push(e),i+=1}))),t),r}async reduce(e,t,r){let i=t,n=0;if(await this.each((r=>0===n&&void 0===t?(i=r,void(n+=1)):Promise.resolve(e(i,r,n)).then((e=>{i=e,n+=1}))),r),0===n&&void 0===t)throw new TypeError("Reducing empty query result set with no initial value");return i}async filter(e,t){const r=[];let i=0;return await this.each((t=>Promise.resolve(e(t,i,this)).then((e=>{e&&r.push(t),i+=1}))),t),r}equalTo(e,t){return e&&"object"==typeof e?(Object.entries(e).forEach((([e,t])=>this.equalTo(e,t))),this):void 0===t?this.doesNotExist(e):(this._where[e]=encode(t,!1,!0),this)}notEqualTo(e,t){return e&&"object"==typeof e?(Object.entries(e).forEach((([e,t])=>this.notEqualTo(e,t))),this):this._addCondition(e,"$ne",t)}lessThan(e,t){return this._addCondition(e,"$lt",t)}greaterThan(e,t){return this._addCondition(e,"$gt",t)}lessThanOrEqualTo(e,t){return this._addCondition(e,"$lte",t)}greaterThanOrEqualTo(e,t){return this._addCondition(e,"$gte",t)}containedIn(e,t){return this._addCondition(e,"$in",t)}notContainedIn(e,t){return this._addCondition(e,"$nin",t)}containedBy(e,t){return this._addCondition(e,"$containedBy",t)}containsAll(e,t){return this._addCondition(e,"$all",t)}containsAllStartingWith(e,t){Array.isArray(t)||(t=[t]);const r=t.map((e=>({$regex:this._regexStartWith(e)})));return this.containsAll(e,r)}exists(e){return this._addCondition(e,"$exists",!0)}doesNotExist(e){return this._addCondition(e,"$exists",!1)}matches(e,t,r){return this._addCondition(e,"$regex",t),r||(r=""),"string"!=typeof t&&(t.ignoreCase&&(r+="i"),t.multiline&&(r+="m")),r.length&&this._addCondition(e,"$options",r),this}matchesQuery(e,t){const r=t.toJSON();return r.className=t.className,this._addCondition(e,"$inQuery",r)}doesNotMatchQuery(e,t){const r=t.toJSON();return r.className=t.className,this._addCondition(e,"$notInQuery",r)}matchesKeyInQuery(e,t,r){const i=r.toJSON();return i.className=r.className,this._addCondition(e,"$select",{key:t,query:i})}doesNotMatchKeyInQuery(e,t,r){const i=r.toJSON();return i.className=r.className,this._addCondition(e,"$dontSelect",{key:t,query:i})}contains(e,t){if("string"!=typeof t)throw new Error("The value being searched for must be a string.");return this._addCondition(e,"$regex",quote(t))}fullText(e,t,r){if(r=r||{},!e)throw new Error("A key is required.");if(!t)throw new Error("A search term is required");if("string"!=typeof t)throw new Error("The value being searched for must be a string.");const i={};i.$term=t;for(const e in r)switch(e){case"language":i.$language=r[e];break;case"caseSensitive":i.$caseSensitive=r[e];break;case"diacriticSensitive":i.$diacriticSensitive=r[e];break;default:throw new Error(`Unknown option: ${e}`)}return this._addCondition(e,"$text",{$search:i})}sortByTextScore(){return this.ascending("$score"),this.select(["$score"]),this}startsWith(e,t,r){if("string"!=typeof t)throw new Error("The value being searched for must be a string.");return this.matches(e,this._regexStartWith(t),r)}endsWith(e,t,r){if("string"!=typeof t)throw new Error("The value being searched for must be a string.");return this.matches(e,quote(t)+"$",r)}near(e,t){return t instanceof ParseGeoPoint||(t=new ParseGeoPoint(t)),this._addCondition(e,"$nearSphere",t)}withinRadians(e,t,r,i){return i||void 0===i?(this.near(e,t),this._addCondition(e,"$maxDistance",r)):this._addCondition(e,"$geoWithin",{$centerSphere:[[t.longitude,t.latitude],r]})}withinMiles(e,t,r,i){return this.withinRadians(e,t,r/3958.8,i)}withinKilometers(e,t,r,i){return this.withinRadians(e,t,r/6371,i)}withinGeoBox(e,t,r){return t instanceof ParseGeoPoint||(t=new ParseGeoPoint(t)),r instanceof ParseGeoPoint||(r=new ParseGeoPoint(r)),this._addCondition(e,"$within",{$box:[t,r]}),this}withinPolygon(e,t){return this._addCondition(e,"$geoWithin",{$polygon:t})}polygonContains(e,t){return this._addCondition(e,"$geoIntersects",{$point:t})}ascending(...e){return this._order=[],this.addAscending.apply(this,e)}addAscending(...e){return this._order||(this._order=[]),e.forEach((e=>{Array.isArray(e)&&(e=e.join()),this._order=this._order.concat(e.replace(/\s/g,"").split(","))})),this}descending(...e){return this._order=[],this.addDescending.apply(this,e)}addDescending(...e){return this._order||(this._order=[]),e.forEach((e=>{Array.isArray(e)&&(e=e.join()),this._order=this._order.concat(e.replace(/\s/g,"").split(",").map((e=>"-"+e)))})),this}skip(e){if("number"!=typeof e||e<0)throw new Error("You can only skip by a positive number");return this._skip=e,this}limit(e){if("number"!=typeof e)throw new Error("You can only set the limit to a numeric value");return this._limit=e,this}withCount(e=!0){if("boolean"!=typeof e)throw new Error("You can only set withCount to a boolean value");return this._count=e,this}include(...e){return e.forEach((e=>{Array.isArray(e)?this._include=this._include.concat(e):this._include.push(e)})),this}includeAll(){return this.include("*")}select(...e){return this._select||(this._select=[]),e.forEach((e=>{Array.isArray(e)?this._select=this._select.concat(e):this._select.push(e)})),this}exclude(...e){return e.forEach((e=>{Array.isArray(e)?this._exclude=this._exclude.concat(e):this._exclude.push(e)})),this}watch(...e){return e.forEach((e=>{Array.isArray(e)?this._watch=this._watch.concat(e):this._watch.push(e)})),this}readPreference(e,t,r){return this._readPreference=e,this._includeReadPreference=t||null,this._subqueryReadPreference=r||null,this}async subscribe(e){const t=await CoreManager.getUserController().currentUserAsync();e||(e=t&&t.getSessionToken()||void 0);const r=await CoreManager.getLiveQueryController().getDefaultLiveQueryClient();r.shouldOpen()&&r.open();const i=r.subscribe(this,e);return i.subscribePromise.then((()=>i))}static or(...e){const t=_getClassNameFromQueries(e),r=new ParseQuery(t);return r._orQuery(e),r}static and(...e){const t=_getClassNameFromQueries(e),r=new ParseQuery(t);return r._andQuery(e),r}static nor(...e){const t=_getClassNameFromQueries(e),r=new ParseQuery(t);return r._norQuery(e),r}fromNetwork(){return this._queriesLocalDatastore=!1,this._localDatastorePinName=null,this}fromLocalDatastore(){return this.fromPinWithName(null)}fromPin(){return this.fromPinWithName(DEFAULT_PIN)}fromPinWithName(e){return CoreManager.getLocalDatastore().checkIfEnabled()&&(this._queriesLocalDatastore=!0,this._localDatastorePinName=e),this}cancel(){return this._xhrRequest.task&&"function"==typeof this._xhrRequest.task.abort?(this._xhrRequest.task._aborted=!0,this._xhrRequest.task.abort(),this._xhrRequest.task=null,this._xhrRequest.onchange=()=>{},this):(this._xhrRequest.onchange=()=>this.cancel(),this)}_setRequestTask(e){e.requestTask=e=>{this._xhrRequest.task=e,this._xhrRequest.onchange()}}comment(e){if(null==e)return delete this._comment,this;if("string"!=typeof e)throw new Error("The value of a comment to be sent with this query must be a string.");return this._comment=e,this}}const DefaultController$8={find:(e,t,r)=>CoreManager.getRESTController().request("GET","classes/"+e,t,r),aggregate:(e,t,r)=>CoreManager.getRESTController().request("GET","aggregate/"+e,t,r)};CoreManager.setParseQuery(ParseQuery),CoreManager.setQueryController(DefaultController$8);const Storage={async:()=>!!CoreManager.getStorageController().async,getItem(e){const t=CoreManager.getStorageController();if(1===t.async)throw new Error("Synchronous storage is not supported by the current storage controller");return t.getItem(e)},getItemAsync(e){const t=CoreManager.getStorageController();return 1===t.async?t.getItemAsync(e):Promise.resolve(t.getItem(e))},setItem(e,t){const r=CoreManager.getStorageController();if(1===r.async)throw new Error("Synchronous storage is not supported by the current storage controller");return r.setItem(e,t)},setItemAsync(e,t){const r=CoreManager.getStorageController();return 1===r.async?r.setItemAsync(e,t):Promise.resolve(r.setItem(e,t))},removeItem(e){const t=CoreManager.getStorageController();if(1===t.async)throw new Error("Synchronous storage is not supported by the current storage controller");return t.removeItem(e)},removeItemAsync(e){const t=CoreManager.getStorageController();return 1===t.async?t.removeItemAsync(e):Promise.resolve(t.removeItem(e))},getAllKeys(){const e=CoreManager.getStorageController();if(1===e.async)throw new Error("Synchronous storage is not supported by the current storage controller");return e.getAllKeys()},getAllKeysAsync(){const e=CoreManager.getStorageController();return 1===e.async?e.getAllKeysAsync():Promise.resolve(e.getAllKeys())},generatePath(e){if(!CoreManager.get("APPLICATION_ID"))throw new Error("You need to call Parse.initialize before using Parse.");if("string"!=typeof e)throw new Error("Tried to get a Storage path that was not a String.");return"/"===e[0]&&(e=e.substr(1)),"Parse/"+CoreManager.get("APPLICATION_ID")+"/"+e},_clear(){const e=CoreManager.getStorageController();Object.hasOwn(e,"clear")&&e.clear()}},QUEUE_KEY="Parse/Eventually/Queue";let queueCache=[],dirtyCache=!0,polling;const EventuallyQueue={save(e,t){return this.enqueue("save",e,t)},destroy(e,t){return this.enqueue("destroy",e,t)},generateQueueId(e,t){t._getId();const{className:r,id:i,_localId:n}=t;return[e,r,i,t.get("hash")||n].join("_")},async enqueue(e,t,r){const i=await this.getQueue(),n=this.generateQueueId(e,t);let o=this.queueItemExists(i,n);if(o>-1)for(const e in i[o].object)void 0===t.get(e)&&t.set(e,i[o].object[e]);else o=i.length;return i[o]={queueId:n,action:e,object:t.toJSON(),serverOptions:r||{},id:t.id,className:t.className,hash:t.get("hash"),createdAt:new Date},this.setQueue(i)},store:e=>Storage.setItemAsync(QUEUE_KEY,JSON.stringify(e)),load:()=>Storage.getItemAsync(QUEUE_KEY),async getQueue(){return dirtyCache&&(queueCache=JSON.parse(await this.load()||"[]"),dirtyCache=!1),queueCache},setQueue(e){return queueCache=e,this.store(queueCache)},async remove(e){const t=await this.getQueue(),r=this.queueItemExists(t,e);r>-1&&(t.splice(r,1),await this.setQueue(t))},clear(){return queueCache=[],this.store([])},queueItemExists:(e,t)=>e.findIndex((e=>e.queueId===t)),async length(){return(await this.getQueue()).length},async sendQueue(){const e=[...await this.getQueue()];if(0===e.length)return!1;for(let t=0;t<e.length;t+=1){const r=e[t],{id:i,hash:n,className:o}=r,s=ParseObject.extend(o);i?await this.process.byId(s,r):n?await this.process.byHash(s,r):await this.process.create(s,r)}return!0},async sendQueueCallback(e,t){if(!e)return this.remove(t.queueId);switch(t.action){case"save":if(void 0!==e.updatedAt&&e.updatedAt>new Date(t.object.createdAt))return this.remove(t.queueId);try{await e.save(t.object,t.serverOptions),await this.remove(t.queueId)}catch(e){e.code!==ParseError.CONNECTION_FAILED&&await this.remove(t.queueId)}break;case"destroy":try{await e.destroy(t.serverOptions),await this.remove(t.queueId)}catch(e){e.code!==ParseError.CONNECTION_FAILED&&await this.remove(t.queueId)}}},poll(e){polling||(polling=setInterval((()=>{CoreManager.getRESTController().request("GET","health").then((({status:e})=>{if("ok"===e)return this.stopPoll(),this.sendQueue()})).catch((e=>e))}),e||2e3))},stopPoll(){clearInterval(polling),polling=void 0},isPolling:()=>!!polling,_setPolling(e){polling=e},process:{create(e,t){const r=new e;return EventuallyQueue.sendQueueCallback(r,t)},async byId(e,t){const{sessionToken:r}=t.serverOptions,i=new ParseQuery(e);i.equalTo("objectId",t.id);const n=await i.find({sessionToken:r});return EventuallyQueue.sendQueueCallback(n[0],t)},async byHash(e,t){const{sessionToken:r}=t.serverOptions,i=new ParseQuery(e);i.equalTo("hash",t.hash);const n=await i.find({sessionToken:r});return n.length>0?EventuallyQueue.sendQueueCallback(n[0],t):EventuallyQueue.process.create(e,t)}}};function promisifyRequest(e){return new Promise(((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)}))}function createStore(e,t){let r;return(i,n)=>(()=>{if(r)return r;const i=indexedDB.open(e);return i.onupgradeneeded=()=>i.result.createObjectStore(t),r=promisifyRequest(i),r.then((e=>{e.onclose=()=>r=void 0}),(()=>{})),r})().then((e=>n(e.transaction(t,i).objectStore(t))))}let defaultGetStoreFunc,IndexedDBStorageController$1;function defaultGetStore(){return defaultGetStoreFunc||(defaultGetStoreFunc=createStore("keyval-store","keyval")),defaultGetStoreFunc}function get(e,t=defaultGetStore()){return t("readonly",(t=>promisifyRequest(t.get(e))))}function set(e,t,r=defaultGetStore()){return r("readwrite",(r=>(r.put(t,e),promisifyRequest(r.transaction))))}function del(e,t=defaultGetStore()){return t("readwrite",(t=>(t.delete(e),promisifyRequest(t.transaction))))}function clear(e=defaultGetStore()){return e("readwrite",(e=>(e.clear(),promisifyRequest(e.transaction))))}function eachCursor(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},promisifyRequest(e.transaction)}function keys(e=defaultGetStore()){return e("readonly",(e=>{if(e.getAllKeys)return promisifyRequest(e.getAllKeys());const t=[];return eachCursor(e,(e=>t.push(e.key))).then((()=>t))}))}if("undefined"!=typeof window&&window.indexedDB)try{const e=createStore("parseDB","parseStore");IndexedDBStorageController$1={async:1,getItemAsync:t=>get(t,e),setItemAsync:(t,r)=>set(t,r,e),removeItemAsync:t=>del(t,e),getAllKeysAsync:()=>keys(e),clear:()=>clear(e)}}catch(e){IndexedDBStorageController$1=void 0}else IndexedDBStorageController$1=void 0;const IndexedDBStorageController=IndexedDBStorageController$1,DEVICE_TYPES={IOS:"ios",MACOS:"macos",TVOS:"tvos",FCM:"fcm",ANDROID:"android",WEB:"web"};class ParseInstallation extends ParseObject{constructor(e){if(super("_Installation"),e&&"object"==typeof e)try{this.set(e||{})}catch(e){throw new Error("Can't create an invalid Installation")}}get appIdentifier(){return this.get("appIdentifier")}get appVersion(){return this.get("appVersion")}get appName(){return this.get("appName")}get badge(){return this.get("badge")}get channels(){return this.get("channels")}get deviceToken(){return this.get("deviceToken")}get deviceType(){return this.get("deviceType")}get GCMSenderId(){return this.get("GCMSenderId")}get installationId(){return this.get("installationId")}get localeIdentifier(){return this.get("localeIdentifier")}get parseVersion(){return this.get("parseVersion")}get pushType(){return this.get("pushType")}get timeZone(){return this.get("timeZone")}static get DEVICE_TYPES(){return DEVICE_TYPES}async fetch(...e){try{await super.fetch.apply(this,e)}catch(t){if(t.code!==ParseError.OBJECT_NOT_FOUND)throw t;delete this.id,this._getId(),this._markAllFieldsDirty(),await super.save.apply(this,e)}return await CoreManager.getInstallationController().updateInstallationOnDisk(this),this}async save(...e){try{await super.save.apply(this,e)}catch(t){if(t.code!==ParseError.OBJECT_NOT_FOUND)throw t;delete this.id,this._getId(),this._markAllFieldsDirty(),await super.save.apply(this,e)}return await CoreManager.getInstallationController().updateInstallationOnDisk(this),this}_markAllFieldsDirty(){for(const[e,t]of Object.entries(this.attributes))this.set(e,t)}static currentInstallation(){return CoreManager.getInstallationController().currentInstallation()}}ParseObject.registerSubclass("_Installation",ParseInstallation);const CURRENT_INSTALLATION_KEY="currentInstallation",CURRENT_INSTALLATION_ID_KEY="currentInstallationId";let iidCache=null,currentInstallationCache=null,currentInstallationCacheMatchesDisk=!1;const InstallationController={async updateInstallationOnDisk(e){const t=Storage.generatePath(CURRENT_INSTALLATION_KEY);await Storage.setItemAsync(t,JSON.stringify(e.toJSON())),this._setCurrentInstallationCache(e)},async currentInstallationId(){if("string"==typeof iidCache)return iidCache;const e=Storage.generatePath(CURRENT_INSTALLATION_ID_KEY);let t=await Storage.getItemAsync(e);return t?(iidCache=t,t):(t=uuidv4(),Storage.setItemAsync(e,t).then((()=>(iidCache=t,t))))},async currentInstallation(){if(currentInstallationCache)return currentInstallationCache;if(currentInstallationCacheMatchesDisk)return null;const e=Storage.generatePath(CURRENT_INSTALLATION_KEY);let t=await Storage.getItemAsync(e);if(currentInstallationCacheMatchesDisk=!0,t){t=JSON.parse(t),t.className="_Installation";const e=ParseInstallation.fromJSON(t);return currentInstallationCache=e,e}const r=await this.currentInstallationId(),i=new ParseInstallation;return i.set("deviceType",ParseInstallation.DEVICE_TYPES.WEB),i.set("installationId",r),i.set("parseVersion",CoreManager.get("VERSION")),currentInstallationCache=i,await Storage.setItemAsync(e,JSON.stringify(i.toJSON())),i},_clearCache(){iidCache=null,currentInstallationCache=null,currentInstallationCacheMatchesDisk=!1},_setInstallationIdCache(e){iidCache=e},_setCurrentInstallationCache(e,t=!0){currentInstallationCache=e,currentInstallationCacheMatchesDisk=t}};let useXDomainRequest=!1;function getPath(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),t.startsWith("/")||(t="/"+t),e+t}function ajaxIE9(e,t,r,i,n){return new Promise(((i,o)=>{const s=new XDomainRequest;s.onload=function(){let e;try{e=JSON.parse(s.responseText)}catch(e){o(e)}e&&i({response:e})},s.onerror=s.ontimeout=function(){const e={responseText:JSON.stringify({code:ParseError.X_DOMAIN_REQUEST,error:"IE's XDomainRequest does not supply error info."})};o(e)},s.onprogress=function(){n&&"function"==typeof n.progress&&n.progress(s.responseText)},s.open(e,t),s.send(r),n&&"function"==typeof n.requestTask&&n.requestTask(s)}))}"undefined"==typeof XDomainRequest||"withCredentials"in new XMLHttpRequest||(useXDomainRequest=!0);const RESTController={async ajax(e,t,r,i,n){if(useXDomainRequest)return ajaxIE9(e,t,r,i,n);if("function"!=typeof fetch)throw new Error("Cannot make a request: Fetch API not found.");const o=resolvingPromise(),s=CoreManager.get("IDEMPOTENCY")&&["POST","PUT"].includes(e),a=s?uuidv4():"";let u=0;const h=async function(){const f=new AbortController,{signal:l}=f;"string"!=typeof(i=i||{})["Content-Type"]&&(i["Content-Type"]="text/plain"),CoreManager.get("IS_NODE")&&(i["User-Agent"]="Parse/"+CoreManager.get("VERSION")+" (NodeJS "+process$1.versions.node+")"),s&&(i["X-Parse-Request-Id"]=a);const c=CoreManager.get("REQUEST_HEADERS");for(const e in c)i[e]=c[e];n&&"function"==typeof n.requestTask&&n.requestTask(f);try{const s={method:e,headers:i,signal:l,redirect:"manual"};r&&(s.body=r,"undefined"!=typeof ReadableStream&&r instanceof ReadableStream&&(s.duplex="half"));const a=await fetch(t,s),{status:f}=a;if(f>=200&&f<300){let e;const t={};if((a.headers.get("access-control-expose-headers")||"").split(", ").forEach((e=>{e&&a.headers.has(e)&&(t[e]=a.headers.get(e))})),n&&"function"==typeof n.progress&&a.body){const t=a.body.getReader(),r=+a.headers.get("Content-Length")||0;if(0===r)n.progress(null,null,null),e=await a.json();else{let i=0;const o=[];for(;;){const{done:e,value:s}=await t.read();if(e)break;o.push(s),i+=s?.length||0,n.progress(i/r,i,r)}const s=new Uint8Array(i);let a=0;for(const e of o)s.set(e,a),a+=e.length;const u=(new TextDecoder).decode(s);e=JSON.parse(u)}}else e=await a.json();o.resolve({status:f,response:e,headers:t})}else if(f>=400&&f<500){const e=await a.json();o.reject(e)}else if([301,302,303,307,308].includes(f)){const t=a.headers.get("location");o.resolve({status:f,location:t,method:303===f?"GET":e,dropBody:303===f})}else if(f>=500||0===f){if(!("undefined"!=typeof ReadableStream&&r instanceof ReadableStream)&&++u<CoreManager.get("REQUEST_ATTEMPT_LIMIT")){const e=Math.round(125*Math.random()*Math.pow(2,u));setTimeout(h,e)}else if(0===f)o.reject("Unable to connect to the Parse API");else{const e=await a.json();o.reject(e)}}else o.reject(a)}catch(e){"AbortError"===e.name?o.resolve({response:{results:[]},status:0}):"ECONNREFUSED"===e.cause?.code?o.reject("Unable to connect to the Parse API"):o.reject(e)}};return h(),o},request(e,t,r,i){i=i||{};const n=getPath(CoreManager.get("SERVER_URL"),t),o={};if(r&&"object"==typeof r)for(const e in r)o[e]=r[e];const s=i.context;void 0!==s&&(o._context=s),"POST"!==e&&(o._method=e,e="POST"),o._ApplicationId=CoreManager.get("APPLICATION_ID");const a=CoreManager.get("JAVASCRIPT_KEY");a&&(o._JavaScriptKey=a),o._ClientVersion=CoreManager.get("VERSION");let u=i.useMasterKey;if(void 0===u&&(u=CoreManager.get("USE_MASTER_KEY")),u){if(!CoreManager.get("MASTER_KEY"))throw new Error("Cannot use the Master Key, it has not been provided.");delete o._JavaScriptKey,o._MasterKey=CoreManager.get("MASTER_KEY")}i.useMaintenanceKey&&(o._MaintenanceKey=CoreManager.get("MAINTENANCE_KEY")),CoreManager.get("FORCE_REVOCABLE_SESSION")&&(o._RevocableSession="1");const h=i.installationId;let f;if(h&&"string"==typeof h)f=Promise.resolve(h);else{f=CoreManager.getInstallationController().currentInstallationId()}return f.then((e=>{o._InstallationId=e;const t=CoreManager.getUserController();return i&&"string"==typeof i.sessionToken?Promise.resolve(i.sessionToken):t?t.currentUserAsync().then((e=>e?Promise.resolve(e.getSessionToken()):Promise.resolve(null))):Promise.resolve(null)})).then((r=>{r&&(o._SessionToken=r);const s=JSON.stringify(o);return RESTController.ajax(e,n,s,{},i).then((async e=>{if(e.location){let r=getPath(e.location,t),n=e.method,o=e.dropBody?void 0:s;for(let a=0;a<5;a+=1){const a=await RESTController.ajax(n,r,o,{},i);if(!a.location){e=a;break}r=getPath(a.location,t),n=a.method,o=a.dropBody?void 0:s}}const{response:r,status:n,headers:o}=e;return i.returnStatus?{...r,_status:n,_headers:o}:r}))})).catch(RESTController.handleError)},handleError(e){let t;return t=e.code||e.error||e.message?new ParseError(e.code,e.error||e.message):new ParseError(ParseError.CONNECTION_FAILED,"XMLHttpRequest failed: "+JSON.stringify(e)),Promise.reject(t)}};function track(e,t){if(0===(e=(e=(e=e||"").replace(/^\s*/,"")).replace(/\s*$/,"")).length)throw new TypeError("A name for the custom event must be provided");for(const e in t)if("string"!=typeof e||"string"!=typeof t[e])throw new TypeError('track() dimensions expects keys and values of type "string".');return CoreManager.getAnalyticsController().track(e,t)}const DefaultController$7={track(e,t){const r="events/"+e;return CoreManager.getRESTController().request("POST",r,{dimensions:t})}};CoreManager.setAnalyticsController(DefaultController$7);const Analytics=Object.freeze(Object.defineProperty({__proto__:null,track:track},Symbol.toStringTag,{value:"Module"}));function isRevocableSession(e){return e.indexOf("r:")>-1}const CURRENT_USER_KEY="currentUser";let canUseCurrentUser=!CoreManager.get("IS_NODE"),currentUserCacheMatchesDisk=!1,currentUserCache=null;const authProviders={};class ParseUser extends ParseObject{constructor(e){if(super("_User"),e&&"object"==typeof e)try{this.set(e||{})}catch(e){throw new Error("Can't create an invalid Parse User")}}_upgradeToRevocableSession(e){const t=ParseObject._getRequestOptions(e);return CoreManager.getUserController().upgradeToRevocableSession(this,t)}linkWith(e,t,r={}){let i;if(r.sessionToken=r.sessionToken||this.getSessionToken()||"","string"==typeof e)if(i=e,authProviders[e])e=authProviders[e];else{const t={restoreAuthentication:()=>!0,getAuthType:()=>i};authProviders[t.getAuthType()]=t,e=t}else i=e.getAuthType();if(t&&Object.hasOwn(t,"authData")){const e=this.get("authData")||{};if("object"!=typeof e)throw new Error("Invalid type: authData field should be an object");e[i]=t.authData;const n=e.anonymous;this.stripAnonymity();return CoreManager.getUserController().linkWith(this,e,r).catch((t=>{throw delete e[i],this.restoreAnonimity(n),t}))}return new Promise(((t,i)=>{e.authenticate({success:(e,n)=>{const o={};o.authData=n,this.linkWith(e,o,r).then((()=>{t(this)}),(e=>{i(e)}))},error:(e,t)=>{i(t)}})}))}_linkWith(e,t,r={}){return this.linkWith(e,t,r)}_synchronizeAuthData(e){if(!this.isCurrent()||!e)return;let t;"string"==typeof e?(t=e,e=authProviders[t]):t=e.getAuthType();const r=this.get("authData");if(!e||!r||"object"!=typeof r)return;e.restoreAuthentication(r[t])||this._unlinkFrom(e)}_synchronizeAllAuthData(){const e=this.get("authData");if("object"==typeof e)for(const t in e)this._synchronizeAuthData(t)}_cleanupAuthData(){if(!this.isCurrent())return;const e=this.get("authData");if("object"==typeof e)for(const t in e)e[t]||delete e[t]}_unlinkFrom(e,t){return this.linkWith(e,{authData:null},t).then((()=>(this._synchronizeAuthData(e),Promise.resolve(this))))}_isLinked(e){let t;t="string"==typeof e?e:e.getAuthType();const r=this.get("authData")||{};return"object"==typeof r&&!!r[t]}_logOutWithAll(){const e=this.get("authData");if("object"==typeof e)for(const t in e)this._logOutWith(t)}_logOutWith(e){this.isCurrent()&&("string"==typeof e&&(e=authProviders[e]),e&&e.deauthenticate&&e.deauthenticate())}_preserveFieldsOnFetch(){return{sessionToken:this.get("sessionToken")}}isCurrent(){const e=ParseUser.current();return!!e&&e.id===this.id}async isCurrentAsync(){const e=await ParseUser.currentAsync();return!!e&&e.id===this.id}stripAnonymity(){const e=this.get("authData");e&&"object"==typeof e&&Object.hasOwn(e,"anonymous")&&(e.anonymous=null)}restoreAnonimity(e){if(e){this.get("authData").anonymous=e}}getUsername(){const e=this.get("username");return null==e||"string"==typeof e?e:""}setUsername(e){this.stripAnonymity(),this.set("username",e)}setPassword(e){this.set("password",e)}getEmail(){const e=this.get("email");return null==e||"string"==typeof e?e:""}setEmail(e){return this.set("email",e)}getSessionToken(){const e=this.get("sessionToken");return null==e||"string"==typeof e?e:""}authenticated(){const e=ParseUser.current();return!!this.get("sessionToken")&&!!e&&e.id===this.id}signUp(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getUserController().signUp(this,e,r)}logIn(e={}){const t=ParseObject._getRequestOptions(e);Object.hasOwn(t,"usePost")||(t.usePost=!0);return CoreManager.getUserController().logIn(this,t)}async save(...e){await super.save.apply(this,e);return await this.isCurrentAsync()?CoreManager.getUserController().updateUserOnDisk(this):this}async destroy(...e){await super.destroy.apply(this,e);return await this.isCurrentAsync()?CoreManager.getUserController().removeUserFromDisk():this}async fetch(...e){await super.fetch.apply(this,e);return await this.isCurrentAsync()?CoreManager.getUserController().updateUserOnDisk(this):this}async fetchWithInclude(...e){await super.fetchWithInclude.apply(this,e);return await this.isCurrentAsync()?CoreManager.getUserController().updateUserOnDisk(this):this}verifyPassword(e,t){const r=this.getUsername()||"";return ParseUser.verifyPassword(r,e,t)}static readOnlyAttributes(){return["sessionToken"]}static extend(e,t){if(e)for(const t in e)"className"!==t&&Object.defineProperty(ParseUser.prototype,t,{value:e[t],enumerable:!1,writable:!0,configurable:!0});if(t)for(const e in t)"className"!==e&&Object.defineProperty(ParseUser,e,{value:t[e],enumerable:!1,writable:!0,configurable:!0});return ParseUser}static current(){if(!canUseCurrentUser)return null;return CoreManager.getUserController().currentUser()}static currentAsync(){if(!canUseCurrentUser)return Promise.resolve(null);return CoreManager.getUserController().currentUserAsync()}static signUp(e,t,r,i){(r=r||{}).username=e,r.password=t;return new this(r).signUp({},i)}static logIn(e,t,r){if("string"!=typeof e)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Username must be a string."));if("string"!=typeof t)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Password must be a string."));const i=new this;return i._finishFetch({username:e,password:t}),i.logIn(r)}static logInWithAdditionalAuth(e,t,r,i){if("string"!=typeof e)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Username must be a string."));if("string"!=typeof t)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Password must be a string."));if("[object Object]"!==Object.prototype.toString.call(r))return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Auth must be an object."));const n=new this;return n._finishFetch({username:e,password:t,authData:r}),n.logIn(i)}static loginAs(e){if(!e)throw new ParseError(ParseError.USERNAME_MISSING,"Cannot log in as user with an empty user id");const t=CoreManager.getUserController(),r=new this;return t.loginAs(r,e)}static become(e,t){if(!canUseCurrentUser)throw new Error("It is not memory-safe to become a user in a server environment");const r=ParseObject._getRequestOptions(t);r.sessionToken=e;const i=CoreManager.getUserController(),n=new this;return i.become(n,r)}static me(e,t){const r=CoreManager.getUserController(),i=ParseObject._getRequestOptions(t);i.sessionToken=e;const n=new this;return r.me(n,i)}static hydrate(e){const t=CoreManager.getUserController(),r=new this;return t.hydrate(r,e)}static logInWith(e,t,r){return(new this).linkWith(e,t,r)}static logOut(e){return CoreManager.getUserController().logOut(e)}static requestPasswordReset(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getUserController().requestPasswordReset(e,r)}static requestEmailVerification(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getUserController().requestEmailVerification(e,r)}static verifyPassword(e,t,r){if("string"!=typeof e)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Username must be a string."));if("string"!=typeof t)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Password must be a string."));return CoreManager.getUserController().verifyPassword(e,t,r||{})}static allowCustomUserClass(e){CoreManager.set("PERFORM_USER_REWRITE",!e)}static enableRevocableSession(e){if(e=e||{},CoreManager.set("FORCE_REVOCABLE_SESSION",!0),canUseCurrentUser){const t=ParseUser.current();if(t)return t._upgradeToRevocableSession(e)}return Promise.resolve()}static enableUnsafeCurrentUser(){canUseCurrentUser=!0}static disableUnsafeCurrentUser(){canUseCurrentUser=!1}static _registerAuthenticationProvider(e){authProviders[e.getAuthType()]=e,ParseUser.currentAsync().then((t=>{t&&t._synchronizeAuthData(e.getAuthType())}))}static _logInWith(e,t,r){return(new this).linkWith(e,t,r)}static _clearCache(){currentUserCache=null,currentUserCacheMatchesDisk=!1}static _setCurrentUserCache(e){currentUserCache=e}}ParseObject.registerSubclass("_User",ParseUser);const DefaultController$6={updateUserOnDisk(e){const t=Storage.generatePath(CURRENT_USER_KEY),r=e.toJSON();delete r.password,r.className="_User";let i=JSON.stringify(r);if(CoreManager.get("ENCRYPTED_USER")){i=CoreManager.getCryptoController().encrypt(r,CoreManager.get("ENCRYPTED_KEY"))}return Storage.setItemAsync(t,i).then((()=>e))},removeUserFromDisk(){const e=Storage.generatePath(CURRENT_USER_KEY);return currentUserCacheMatchesDisk=!0,currentUserCache=null,Storage.removeItemAsync(e)},setCurrentUser:e=>(currentUserCache=e,e._cleanupAuthData(),e._synchronizeAllAuthData(),DefaultController$6.updateUserOnDisk(e)),currentUser(){if(currentUserCache)return currentUserCache;if(currentUserCacheMatchesDisk)return null;if(Storage.async())throw new Error("Cannot call currentUser() when using a platform with an async storage system. Call currentUserAsync() instead.");const e=Storage.generatePath(CURRENT_USER_KEY);let t=Storage.getItem(e);if(currentUserCacheMatchesDisk=!0,!t)return currentUserCache=null,null;if(CoreManager.get("ENCRYPTED_USER")){t=CoreManager.getCryptoController().decrypt(t,CoreManager.get("ENCRYPTED_KEY"))}t=JSON.parse(t),t.className||(t.className="_User"),t._id&&(t.objectId!==t._id&&(t.objectId=t._id),delete t._id),t._sessionToken&&(t.sessionToken=t._sessionToken,delete t._sessionToken);const r=ParseObject.fromJSON(t);return currentUserCache=r,r._synchronizeAllAuthData(),r},currentUserAsync(){if(currentUserCache)return Promise.resolve(currentUserCache);if(currentUserCacheMatchesDisk)return Promise.resolve(null);const e=Storage.generatePath(CURRENT_USER_KEY);return Storage.getItemAsync(e).then((e=>{if(currentUserCacheMatchesDisk=!0,!e)return currentUserCache=null,Promise.resolve(null);if(CoreManager.get("ENCRYPTED_USER")){e=CoreManager.getCryptoController().decrypt(e.toString(),CoreManager.get("ENCRYPTED_KEY"))}(e=JSON.parse(e)).className||(e.className="_User"),e._id&&(e.objectId!==e._id&&(e.objectId=e._id),delete e._id),e._sessionToken&&(e.sessionToken=e._sessionToken,delete e._sessionToken);const t=ParseObject.fromJSON(e);return currentUserCache=t,t._synchronizeAllAuthData(),Promise.resolve(t)}))},signUp(e,t,r){const i=t&&t.username||e.get("username"),n=t&&t.password||e.get("password");return i&&i.length?n&&n.length?e.save(t,r).then((()=>(e._finishFetch({password:void 0}),canUseCurrentUser?DefaultController$6.setCurrentUser(e):e))):Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Cannot sign up user with an empty password.")):Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Cannot sign up user with an empty username."))},logIn(e,t){const r=CoreManager.getRESTController(),i=CoreManager.getObjectStateController(),n={username:e.get("username"),password:e.get("password"),authData:e.get("authData")};return r.request(t.usePost?"POST":"GET","login",n,t).then((t=>(e._migrateId(t.objectId),e._setExisted(!0),i.setPendingOp(e._getStateIdentifier(),"username",void 0),i.setPendingOp(e._getStateIdentifier(),"password",void 0),t.password=void 0,e._finishFetch(t),canUseCurrentUser?DefaultController$6.setCurrentUser(e):Promise.resolve(e))))},loginAs:(e,t)=>CoreManager.getRESTController().request("POST","loginAs",{userId:t},{useMasterKey:!0}).then((t=>(e._finishFetch(t),e._setExisted(!0),canUseCurrentUser?DefaultController$6.setCurrentUser(e):Promise.resolve(e)))),become:(e,t)=>CoreManager.getRESTController().request("GET","users/me",{},t).then((t=>(e._finishFetch(t),e._setExisted(!0),DefaultController$6.setCurrentUser(e)))),hydrate:(e,t)=>(e._finishFetch(t),e._setExisted(!0),t.sessionToken&&canUseCurrentUser?DefaultController$6.setCurrentUser(e):Promise.resolve(e)),me:(e,t)=>CoreManager.getRESTController().request("GET","users/me",{},t).then((t=>(e._finishFetch(t),e._setExisted(!0),e))),logOut(e){const t=CoreManager.getRESTController();return e?.sessionToken?t.request("POST","logout",{},e):DefaultController$6.currentUserAsync().then((e=>{const r=Storage.generatePath(CURRENT_USER_KEY);let i=Storage.removeItemAsync(r);if(null!==e){const r=e.getSessionToken();r&&isRevocableSession(r)&&(i=i.then((()=>t.request("POST","logout",{},{sessionToken:r})))),e._logOutWithAll(),e._finishFetch({sessionToken:void 0})}return currentUserCacheMatchesDisk=!0,currentUserCache=null,i}))},requestPasswordReset:(e,t)=>CoreManager.getRESTController().request("POST","requestPasswordReset",{email:e},t),async upgradeToRevocableSession(e,t){const r=e.getSessionToken();if(!r)return Promise.reject(new ParseError(ParseError.SESSION_MISSING,"Cannot upgrade a user with no session token"));t.sessionToken=r;const i=CoreManager.getRESTController(),n=await i.request("POST","upgradeToRevocableSession",{},t);e._finishFetch({sessionToken:n?.sessionToken||""});return await e.isCurrentAsync()?DefaultController$6.setCurrentUser(e):Promise.resolve(e)},linkWith:(e,t,r)=>e.save({authData:t},r).then((()=>canUseCurrentUser?DefaultController$6.setCurrentUser(e):e)),verifyPassword(e,t,r){const i=CoreManager.getRESTController(),n={username:e,password:t,...void 0!==r.ignoreEmailVerification&&{ignoreEmailVerification:r.ignoreEmailVerification}};return i.request("GET","verifyPassword",n,r)},requestEmailVerification:(e,t)=>CoreManager.getRESTController().request("POST","verificationEmailRequest",{email:e},t)};CoreManager.setParseUser(ParseUser),CoreManager.setUserController(DefaultController$6);let registered=!1;const AnonymousUtils={isLinked(e){const t=this._getAuthProvider();return e._isLinked(t.getAuthType())},logIn(e){const t=this._getAuthProvider();return ParseUser.logInWith(t.getAuthType(),t.getAuthData(),e)},link(e,t){const r=this._getAuthProvider();return e.linkWith(r.getAuthType(),r.getAuthData(),t)},isRegistered:()=>registered,_getAuthProvider(){const e={restoreAuthentication:()=>!0,getAuthType:()=>"anonymous",getAuthData:()=>({authData:{id:uuidv4()}})};return registered||(ParseUser._registerAuthenticationProvider(e),registered=!0),e}};function run(e,t,r){if("string"!=typeof e||0===e.length)throw new TypeError("Cloud function name must be a string.");const i=ParseObject._getRequestOptions(r);return CoreManager.getCloudController().run(e,t,i)}function getJobsData(){return CoreManager.getCloudController().getJobsData({useMasterKey:!0})}function startJob(e,t){if("string"!=typeof e||0===e.length)throw new TypeError("Cloud job name must be a string.");return CoreManager.getCloudController().startJob(e,t,{useMasterKey:!0})}function getJobStatus(e){return new ParseQuery("_JobStatus").get(e,{useMasterKey:!0})}const DefaultController$5={run(e,t,r){const i=CoreManager.getRESTController(),n=encode(t,!0);return i.request("POST","functions/"+e,n,r).then((e=>{if("object"==typeof e&&Object.keys(e).length>0&&!Object.hasOwn(e,"result"))throw new ParseError(ParseError.INVALID_JSON,"The server returned an invalid response.");const t=decode(e);return t&&Object.hasOwn(t,"result")?Promise.resolve(t.result):Promise.resolve(void 0)}))},getJobsData:e=>CoreManager.getRESTController().request("GET","cloud_code/jobs/data",null,e),async startJob(e,t,r){const i=CoreManager.getRESTController(),n=encode(t,!0);r.returnStatus=!0;const o=await i.request("POST","jobs/"+e,n,r);return o._headers?.["X-Parse-Job-Status-Id"]}};CoreManager.setCloudController(DefaultController$5);const Cloud=Object.freeze(Object.defineProperty({__proto__:null,getJobStatus:getJobStatus,getJobsData:getJobsData,run:run,startJob:startJob},Symbol.toStringTag,{value:"Module"}));class ParseRole extends ParseObject{constructor(e,t){super("_Role"),"string"==typeof e&&t instanceof ParseACL&&(this.setName(e),this.setACL(t))}getName(){const e=this.get("name");return null==e||"string"==typeof e?e:""}setName(e,t){return this._validateName(e),this.set("name",e,t)}getUsers(){return this.relation("users")}getRoles(){return this.relation("roles")}_validateName(e){if("string"!=typeof e)throw new ParseError(ParseError.OTHER_CAUSE,"A role's name must be a String.");if(!/^[0-9a-zA-Z\-_ ]+$/.test(e))throw new ParseError(ParseError.OTHER_CAUSE,"A role's name can be only contain alphanumeric characters, _, -, and spaces.")}validate(e,t){const r=super.validate(e,t);if(r)return r;if("name"in e&&e.name!==this.getName()){const t=e.name;if(this.id&&this.id!==e.objectId)return new ParseError(ParseError.OTHER_CAUSE,"A role's name can only be set before it has been saved.");try{this._validateName(t)}catch(e){return e}}return!1}}CoreManager.setParseRole(ParseRole),ParseObject.registerSubclass("_Role",ParseRole);const PUBLIC_KEY="*",VALID_PERMISSIONS=new Map;VALID_PERMISSIONS.set("get",{}),VALID_PERMISSIONS.set("find",{}),VALID_PERMISSIONS.set("count",{}),VALID_PERMISSIONS.set("create",{}),VALID_PERMISSIONS.set("update",{}),VALID_PERMISSIONS.set("delete",{}),VALID_PERMISSIONS.set("addField",{});const VALID_PERMISSIONS_EXTENDED=new Map;VALID_PERMISSIONS_EXTENDED.set("protectedFields",{});class ParseCLP{constructor(e){this.permissionsMap={};for(const[e,t]of VALID_PERMISSIONS.entries()){this.permissionsMap[e]=Object.assign({},t);const r=e.charAt(0).toUpperCase()+e.slice(1);this[`get${r}RequiresAuthentication`]=function(){return this._getAccess(e,"requiresAuthentication")},this[`set${r}RequiresAuthentication`]=function(t){this._setAccess(e,"requiresAuthentication",t)},this[`get${r}PointerFields`]=function(){return this._getAccess(e,"pointerFields",!1)},this[`set${r}PointerFields`]=function(t){this._setArrayAccess(e,"pointerFields",t)},this[`get${r}Access`]=function(t){return this._getAccess(e,t)},this[`set${r}Access`]=function(t,r){this._setAccess(e,t,r)},this[`getPublic${r}Access`]=function(){return this[`get${r}Access`](PUBLIC_KEY)},this[`setPublic${r}Access`]=function(e){this[`set${r}Access`](PUBLIC_KEY,e)},this[`getRole${r}Access`]=function(e){return this[`get${r}Access`](this._getRoleName(e))},this[`setRole${r}Access`]=function(e,t){this[`set${r}Access`](this._getRoleName(e),t)}}for(const[e,t]of VALID_PERMISSIONS_EXTENDED.entries())this.permissionsMap[e]=Object.assign({},t);if(e&&"object"==typeof e)if(e instanceof ParseUser)this.setReadAccess(e,!0),this.setWriteAccess(e,!0);else if(e instanceof ParseRole)this.setRoleReadAccess(e,!0),this.setRoleWriteAccess(e,!0);else for(const t in e){const r=e[t],i=!!VALID_PERMISSIONS.get(t),n=!!VALID_PERMISSIONS_EXTENDED.get(t),o=["readUserFields","writeUserFields"].includes(t);if("string"!=typeof t||!(i||n||o))throw new TypeError("Tried to create an CLP with an invalid permission type.");if(o){if(r.every((e=>"string"==typeof e))){this.permissionsMap[t]=r;continue}throw new TypeError("Tried to create an CLP with an invalid permission value.")}for(const e in r){const i=r[e];if("boolean"!=typeof i&&!n&&"pointerFields"!==e)throw new TypeError("Tried to create an CLP with an invalid permission value.");this.permissionsMap[t][e]=i}}else if("function"==typeof e)throw new TypeError("ParseCLP constructed with a function. Did you forget ()?")}toJSON(){return{...this.permissionsMap}}equals(e){if(!(e instanceof ParseCLP))return!1;const t=Object.keys(this.permissionsMap),r=Object.keys(e.permissionsMap);if(t.length!==r.length)return!1;for(const t in this.permissionsMap){if(!e.permissionsMap[t])return!1;const r=Object.keys(this.permissionsMap[t]),i=Object.keys(e.permissionsMap[t]);if(r.length!==i.length)return!1;for(const r in this.permissionsMap[t]){if(!e.permissionsMap[t][r])return!1;if(this.permissionsMap[t][r]!==e.permissionsMap[t][r])return!1}}return!0}_getRoleName(e){let t=e;if(e instanceof ParseRole&&(t=e.getName()),"string"!=typeof t)throw new TypeError("role must be a Parse.Role or a String");return`role:${t}`}_parseEntity(e){let t=e;if(t instanceof ParseUser){if(t=t.id,!t)throw new Error("Cannot get access for a Parse.User without an id.")}else t instanceof ParseRole&&(t=this._getRoleName(t));if("string"!=typeof t)throw new TypeError("userId must be a string.");return t}_setAccess(e,t,r){if(t=this._parseEntity(t),"boolean"!=typeof r)throw new TypeError("allowed must be either true or false.");if(!this.permissionsMap[e][t]){if(!r)return;this.permissionsMap[e][t]={}}r?this.permissionsMap[e][t]=!0:delete this.permissionsMap[e][t]}_getAccess(e,t,r=!0){t=this._parseEntity(t);const i=this.permissionsMap[e][t];return r?!!i&&!!this.permissionsMap[e][t]:i}_setArrayAccess(e,t,r){t=this._parseEntity(t);if(this.permissionsMap[e][t]||(this.permissionsMap[e][t]=[]),!r||Array.isArray(r)&&0===r.length)delete this.permissionsMap[e][t];else{if(!Array.isArray(r)||!r.every((e=>"string"==typeof e)))throw new TypeError("fields must be an array of strings or undefined.");this.permissionsMap[e][t]=r}}_setGroupPointerPermission(e,t){if(this.permissionsMap[e]||(this.permissionsMap[e]=[]),!t||Array.isArray(t)&&0===t.length)delete this.permissionsMap[e];else{if(!Array.isArray(t)||!t.every((e=>"string"==typeof e)))throw new TypeError(`${e}.pointerFields must be an array of strings or undefined.`);this.permissionsMap[e]=t}}_getGroupPointerPermissions(e){return this.permissionsMap[e]||[]}setReadUserFields(e){this._setGroupPointerPermission("readUserFields",e)}getReadUserFields(){return this._getGroupPointerPermissions("readUserFields")||[]}setWriteUserFields(e){this._setGroupPointerPermission("writeUserFields",e)}getWriteUserFields(){return this._getGroupPointerPermissions("writeUserFields")||[]}setProtectedFields(e,t){this._setArrayAccess("protectedFields",e,t)}getProtectedFields(e){return this._getAccess("protectedFields",e,!1)}setReadAccess(e,t){this._setAccess("find",e,t),this._setAccess("get",e,t),this._setAccess("count",e,t)}getReadAccess(e){return this._getAccess("find",e)&&this._getAccess("get",e)&&this._getAccess("count",e)}setWriteAccess(e,t){this._setAccess("create",e,t),this._setAccess("update",e,t),this._setAccess("delete",e,t),this._setAccess("addField",e,t)}getWriteAccess(e){return this._getAccess("create",e)&&this._getAccess("update",e)&&this._getAccess("delete",e)&&this._getAccess("addField",e)}setPublicReadAccess(e){this.setReadAccess(PUBLIC_KEY,e)}getPublicReadAccess(){return this.getReadAccess(PUBLIC_KEY)}setPublicWriteAccess(e){this.setWriteAccess(PUBLIC_KEY,e)}getPublicWriteAccess(){return this.getWriteAccess(PUBLIC_KEY)}setPublicProtectedFields(e){this.setProtectedFields(PUBLIC_KEY,e)}getPublicProtectedFields(){return this.getProtectedFields(PUBLIC_KEY)}getRoleReadAccess(e){return this.getReadAccess(this._getRoleName(e))}getRoleWriteAccess(e){return this.getWriteAccess(this._getRoleName(e))}setRoleReadAccess(e,t){this.setReadAccess(this._getRoleName(e),t)}setRoleWriteAccess(e,t){this.setWriteAccess(this._getRoleName(e),t)}getRoleProtectedFields(e){return this.getProtectedFields(this._getRoleName(e))}setRoleProtectedFields(e,t){this.setProtectedFields(this._getRoleName(e),t)}}var eventsExports=requireEvents();const events=getDefaultExportFromCjs(eventsExports),__CJS__import__1__$1=_mergeNamespaces({__proto__:null,default:events},[eventsExports]);let EventEmitter$1;try{EventEmitter$1=(events||__CJS__import__1__$1).EventEmitter}catch(e){}const EventEmitter=EventEmitter$1;class ParseConfig{constructor(){this.attributes={},this._escapedAttributes={}}get(e){return this.attributes[e]}escape(e){const t=this._escapedAttributes[e];if(t)return t;const r=this.attributes[e];let i="";return null!=r&&(i=escape$1(r.toString())),this._escapedAttributes[e]=i,i}static current(){return CoreManager.getConfigController().current()}static get(e){return CoreManager.getConfigController().get(e)}static save(e,t){const r=CoreManager.getConfigController();return r.save(e,t).then((()=>r.get({useMasterKey:!0})),(e=>Promise.reject(e)))}static _clearCache(){currentConfig=null}}let currentConfig=null;const CURRENT_CONFIG_KEY="currentConfig";function decodePayload(e){try{const t=JSON.parse(e);if(t&&"object"==typeof t)return decode(t)}catch(e){return null}}const DefaultController$4={current(){if(currentConfig)return currentConfig;const e=new ParseConfig,t=Storage.generatePath(CURRENT_CONFIG_KEY);if(!Storage.async()){const r=Storage.getItem(t);if(r){const t=decodePayload(r);t&&(e.attributes=t,currentConfig=e)}return e}return Storage.getItemAsync(t).then((t=>{if(t){const r=decodePayload(t);r&&(e.attributes=r,currentConfig=e)}return e}))},get:e=>CoreManager.getRESTController().request("GET","config",{},e).then((e=>{if(!e||!e.params){const e=new ParseError(ParseError.INVALID_JSON,"Config JSON response invalid.");return Promise.reject(e)}const t=new ParseConfig;t.attributes={};for(const r in e.params)t.attributes[r]=decode(e.params[r]);return currentConfig=t,Storage.setItemAsync(Storage.generatePath(CURRENT_CONFIG_KEY),JSON.stringify(e.params)).then((()=>t))})),save(e,t){const r=CoreManager.getRESTController(),i={};for(const t in e)i[t]=encode(e[t]);return r.request("PUT","config",{params:i,masterKeyOnly:t},{useMasterKey:!0}).then((e=>{if(e&&e.result)return Promise.resolve();{const e=new ParseError(ParseError.INTERNAL_SERVER_ERROR,"Error occured updating Config.");return Promise.reject(e)}}))}};CoreManager.setConfigController(DefaultController$4);let initialized=!1,requestedPermissions,initOptions;const provider={authenticate(e){"undefined"==typeof FB&&e.error(this,"Facebook SDK not found."),FB.login((t=>{t.authResponse?e.success&&e.success(this,{id:t.authResponse.userID,access_token:t.authResponse.accessToken,expiration_date:new Date(1e3*t.authResponse.expiresIn+(new Date).getTime()).toJSON()}):e.error&&e.error(this,t)}),{scope:requestedPermissions})},restoreAuthentication(e){if(e){const t={};if(initOptions)for(const e in initOptions)t[e]=initOptions[e];t.status=!1;const r=FB.getAuthResponse();r&&r.userID!==e.id&&FB.logout(),FB.init(t)}return!0},getAuthType:()=>"facebook",deauthenticate(){this.restoreAuthentication(null)}},FacebookUtils={init(e){if("undefined"==typeof FB)throw new Error("The Facebook JavaScript SDK must be loaded before calling init.");if(initOptions={},e)for(const t in e)initOptions[t]=e[t];if(initOptions.status&&"undefined"!=typeof console){(console.warn||console.log||function(){}).call(console,'The "status" flag passed into FB.init, when set to true, can interfere with Parse Facebook integration, so it has been suppressed. Please call FB.getLoginStatus() explicitly if you require this behavior.')}initOptions.status=!1,FB.init(initOptions),ParseUser._registerAuthenticationProvider(provider),initialized=!0},isLinked:e=>e._isLinked("facebook"),logIn(e,t){if(!e||"string"==typeof e){if(!initialized)throw new Error("You must initialize FacebookUtils before calling logIn.");return requestedPermissions=e,ParseUser.logInWith("facebook",t)}const r={authData:e};return ParseUser.logInWith("facebook",r,t)},link(e,t,r){if(!t||"string"==typeof t){if(!initialized)throw new Error("You must initialize FacebookUtils before calling link.");return requestedPermissions=t,e.linkWith("facebook",r)}const i={authData:t};return e.linkWith("facebook",i,r)},unlink:function(e,t){if(!initialized)throw new Error("You must initialize FacebookUtils before calling unlink.");return e._unlinkFrom("facebook",t)},_getAuthProvider:()=>provider},DefaultController$3={get(e,t,r){let i="hooks/"+e;return t&&(i+="/"+t,r&&(i+="/"+r)),this.sendRequest("GET",i)},create(e){let t;if(e.functionName&&e.url)t="hooks/functions";else{if(!(e.className&&e.triggerName&&e.url))return Promise.reject({error:"invalid hook declaration",code:143});t="hooks/triggers"}return this.sendRequest("POST",t,e)},remove(e){let t;if(e.functionName)t="hooks/functions/"+e.functionName,delete e.functionName;else{if(!e.className||!e.triggerName)return Promise.reject({error:"invalid hook declaration",code:143});t="hooks/triggers/"+e.className+"/"+e.triggerName,delete e.className,delete e.triggerName}return this.sendRequest("PUT",t,{__op:"Delete"})},update(e){let t;if(e.functionName&&e.url)t="hooks/functions/"+e.functionName,delete e.functionName;else{if(!(e.className&&e.triggerName&&e.url))return Promise.reject({error:"invalid hook declaration",code:143});t="hooks/triggers/"+e.className+"/"+e.triggerName,delete e.className,delete e.triggerName}return this.sendRequest("PUT",t,e)},sendRequest:(e,t,r)=>CoreManager.getRESTController().request(e,t,r,{useMasterKey:!0}).then((e=>{const t=decode(e);return t?Promise.resolve(t):Promise.reject(new ParseError(ParseError.INVALID_JSON,"The server returned an invalid response."))}))};CoreManager.setHooksController(DefaultController$3);const LocalDatastoreController$1={async fromPinWithName(e){const t=await Storage.getItemAsync(e);if(!t)return[];return JSON.parse(t)},pinWithName(e,t){const r=JSON.stringify(t);return Storage.setItemAsync(e,r)},unPinWithName:e=>Storage.removeItemAsync(e),getAllContents:async()=>(await Storage.getAllKeysAsync()).reduce((async(e,t)=>{const r=await e;if(isLocalDatastoreKey(t)){const e=await Storage.getItemAsync(t);try{r[t]=JSON.parse(e)}catch(e){console.error("Error getAllContents: ",e)}}return r}),Promise.resolve({})),getRawStorage:async()=>(await Storage.getAllKeysAsync()).reduce((async(e,t)=>{const r=await e,i=await Storage.getItemAsync(t);return r[t]=i,r}),Promise.resolve({})),async clear(){const e=await Storage.getAllKeysAsync(),t=[];for(const r of e)isLocalDatastoreKey(r)&&t.push(r);const r=t.map(this.unPinWithName);return Promise.all(r)}};let LocalDatastoreController=LocalDatastoreController$1;const LocalDatastore={isEnabled:!1,isSyncing:!1,fromPinWithName:e=>CoreManager.getLocalDatastoreController().fromPinWithName(e),pinWithName:async(e,t)=>CoreManager.getLocalDatastoreController().pinWithName(e,t),unPinWithName:async e=>CoreManager.getLocalDatastoreController().unPinWithName(e),_getAllContents:()=>CoreManager.getLocalDatastoreController().getAllContents(),_getRawStorage:async()=>CoreManager.getLocalDatastoreController().getRawStorage(),_clear:async()=>CoreManager.getLocalDatastoreController().clear(),async _handlePinAllWithName(e,t){const r=this.getPinName(e),i=[],n=[];for(const e of t){const t=this._getChildren(e),r=this.getKeyForObject(e),o=e._toFullJSON(void 0,!0);e._localId&&(o._localId=e._localId),t[r]=o;for(const e in t)n.push(e),i.push(this.pinWithName(e,[t[e]]))}const o=this.fromPinWithName(r),[s]=await Promise.all([o,i]),a=[...new Set([...s||[],...n])];return this.pinWithName(r,a)},async _handleUnPinAllWithName(e,t){const r=await this._getAllContents(),i=this.getPinName(e),n=[];let o=[];for(const e of t){const t=this._getChildren(e),r=this.getKeyForObject(e);o.push(r,...Object.keys(t))}o=[...new Set(o)];let s=r[i]||[];s=s.filter((e=>!o.includes(e))),0==s.length?(n.push(this.unPinWithName(i)),delete r[i]):(n.push(this.pinWithName(i,s)),r[i]=s);for(const e of o){let t=!1;for(const i in r)if(i===DEFAULT_PIN||i.startsWith(PIN_PREFIX)){if((r[i]||[]).includes(e)){t=!0;break}}t||n.push(this.unPinWithName(e))}return Promise.all(n)},_getChildren(e){const t={},r=e._toFullJSON(void 0,!0);for(const e in r)r[e]&&r[e].__type&&"Object"===r[e].__type&&this._traverse(r[e],t);return t},_traverse(e,t){if(e.objectId){{const r=this.getKeyForObject(e);if(t[r])return;t[r]=e}for(const r in e){let i=e[r];e[r]||(i=e),i.__type&&"Object"===i.__type&&this._traverse(i,t)}}},async _serializeObjectsFromPinName(e){const t=await this._getAllContents(),r=[];for(const e in t)e.startsWith(OBJECT_PREFIX)&&r.push(t[e][0]);if(!e)return r;const i=t[this.getPinName(e)];if(!Array.isArray(i))return[];const n=i.map((e=>this.fromPinWithName(e)));let o=await Promise.all(n);return o=[].concat(...o),o.filter((e=>null!=e))},async _serializeObject(e,t){let r=t;if(r||(r=await this._getAllContents()),!r[e]||0===r[e].length)return null;const i=r[e][0],n=[],o={};let s=0;for(o[s]=i,n.push(s);0!==n.length;){const e=o[n.shift()];for(const t in e){const i=e[t];if(i.__type&&"Object"===i.__type){const a=this.getKeyForObject(i);if(r[a]&&r[a].length>0){const i=r[a][0];s++,o[s]=i,e[t]=i,n.push(s)}}}}return i},async _updateObjectIfPinned(e){if(!this.isEnabled)return;const t=this.getKeyForObject(e),r=await this.fromPinWithName(t);return r&&0!==r.length?this.pinWithName(t,[e._toFullJSON()]):void 0},async _destroyObjectIfPinned(e){if(!this.isEnabled)return;const t=await this._getAllContents(),r=this.getKeyForObject(e);if(!t[r])return;const i=[this.unPinWithName(r)];delete t[r];for(const e in t)if(e===DEFAULT_PIN||e.startsWith(PIN_PREFIX)){let n=t[e]||[];n.includes(r)&&(n=n.filter((e=>e!==r)),0==n.length?(i.push(this.unPinWithName(e)),delete t[e]):(i.push(this.pinWithName(e,n)),t[e]=n))}return Promise.all(i)},async _updateLocalIdForObject(e,t){if(!this.isEnabled)return;const r=`${OBJECT_PREFIX}${t.className}_${e}`,i=this.getKeyForObject(t),n=await this.fromPinWithName(r);if(!n||0===n.length)return;const o=[this.unPinWithName(r),this.pinWithName(i,n)],s=await this._getAllContents();for(const e in s)if(e===DEFAULT_PIN||e.startsWith(PIN_PREFIX)){let t=s[e]||[];t.includes(r)&&(t=t.filter((e=>e!==r)),t.push(i),o.push(this.pinWithName(e,t)),s[e]=t)}return Promise.all(o)},async updateFromServer(){if(!this.checkIfEnabled()||this.isSyncing)return;const e=await this._getAllContents(),t=[];for(const r in e)r.startsWith(OBJECT_PREFIX)&&t.push(r);if(0===t.length)return;this.isSyncing=!0;const r={};for(const e of t){let[,,t,i]=e.split("_");5===e.split("_").length&&"User"===e.split("_")[3]&&(t="_User",i=e.split("_")[4]),i.startsWith("local")||(t in r||(r[t]=new Set),r[t].add(i))}const i=Object.keys(r).map((e=>{const t=Array.from(r[e]),i=new ParseQuery(e);return i.limit(t.length),1===t.length?i.equalTo("objectId",t[0]):i.containedIn("objectId",t),i.find()}));try{const e=await Promise.all(i),t=[].concat.apply([],e).map((e=>{const t=this.getKeyForObject(e);return this.pinWithName(t,e._toFullJSON())}));await Promise.all(t),this.isSyncing=!1}catch(e){console.error("Error syncing LocalDatastore: ",e),this.isSyncing=!1}},getKeyForObject(e){const t=e.objectId||e._getId();return`${OBJECT_PREFIX}${e.className}_${t}`},getPinName:e=>e&&e!==DEFAULT_PIN?PIN_PREFIX+e:DEFAULT_PIN,checkIfEnabled(){return this.isEnabled||console.error("Parse.enableLocalDatastore() must be called first"),this.isEnabled}};function send(e,t={}){if(e.where&&e.where instanceof ParseQuery&&(e.where=e.where.toJSON().where),e.push_time&&"object"==typeof e.push_time&&(e.push_time=e.push_time.toJSON()),e.expiration_time&&"object"==typeof e.expiration_time&&(e.expiration_time=e.expiration_time.toJSON()),e.expiration_time&&e.expiration_interval)throw new Error("expiration_time and expiration_interval cannot both be set.");const r={useMasterKey:!0};return Object.hasOwn(t,"useMasterKey")&&(r.useMasterKey=t.useMasterKey),CoreManager.getPushController().send(e,r)}function getPushStatus(e,t={}){const r={useMasterKey:!0};Object.hasOwn(t,"useMasterKey")&&(r.useMasterKey=t.useMasterKey);return new ParseQuery("_PushStatus").get(e,r)}CoreManager.setLocalDatastoreController(LocalDatastoreController),CoreManager.setLocalDatastore(LocalDatastore);const DefaultController$2={async send(e,t){t.returnStatus=!0;const r=await CoreManager.getRESTController().request("POST","push",e,t);return r._headers?.["X-Parse-Push-Status-Id"]}};CoreManager.setPushController(DefaultController$2);const Push=Object.freeze(Object.defineProperty({__proto__:null,getPushStatus:getPushStatus,send:send},Symbol.toStringTag,{value:"Module"})),FIELD_TYPES=["String","Number","Boolean","Bytes","Date","File","GeoPoint","Polygon","Array","Object","Pointer","Relation"];class ParseSchema{constructor(e){"string"==typeof e&&("User"===e&&CoreManager.get("PERFORM_USER_REWRITE")?this.className="_User":this.className=e),this._fields={},this._indexes={}}static all(){return CoreManager.getSchemaController().get("").then((e=>{if(0===e.results.length)throw new Error("Schema not found.");return e.results}))}get(){this.assertClassName();return CoreManager.getSchemaController().get(this.className).then((e=>{if(!e)throw new Error("Schema not found.");return e}))}save(){this.assertClassName();const e=CoreManager.getSchemaController(),t={className:this.className,fields:this._fields,indexes:this._indexes,classLevelPermissions:this._clp};return e.create(this.className,t)}update(){this.assertClassName();const e=CoreManager.getSchemaController(),t={className:this.className,fields:this._fields,indexes:this._indexes,classLevelPermissions:this._clp};return this._fields={},this._indexes={},e.update(this.className,t)}delete(){this.assertClassName();return CoreManager.getSchemaController().delete(this.className)}purge(){this.assertClassName();return CoreManager.getSchemaController().purge(this.className)}assertClassName(){if(!this.className)throw new Error("You must set a Class Name before making any request.")}setCLP(e){return this._clp=e instanceof ParseCLP?e.toJSON():e,this}addField(e,t,r){if(t=t||"String",r=r||{},!e)throw new Error("field name may not be null.");if(-1===FIELD_TYPES.indexOf(t))throw new Error(`${t} is not a valid type.`);if("Pointer"===t)return this.addPointer(e,r.targetClass,r);if("Relation"===t)return this.addRelation(e,r.targetClass);const i={type:t};return"boolean"==typeof r.required&&(i.required=r.required),void 0!==r.defaultValue&&(i.defaultValue=r.defaultValue),"Date"===t&&r&&r.defaultValue&&(i.defaultValue={__type:"Date",iso:new Date(r.defaultValue)}),"Bytes"===t&&r&&r.defaultValue&&(i.defaultValue={__type:"Bytes",base64:r.defaultValue}),this._fields[e]=i,this}addIndex(e,t){if(!e)throw new Error("index name may not be null.");if(!t)throw new Error("index may not be null.");return this._indexes[e]=t,this}addString(e,t){return this.addField(e,"String",t)}addNumber(e,t){return this.addField(e,"Number",t)}addBoolean(e,t){return this.addField(e,"Boolean",t)}addBytes(e,t){return this.addField(e,"Bytes",t)}addDate(e,t){return this.addField(e,"Date",t)}addFile(e,t){return this.addField(e,"File",t)}addGeoPoint(e,t){return this.addField(e,"GeoPoint",t)}addPolygon(e,t){return this.addField(e,"Polygon",t)}addArray(e,t){return this.addField(e,"Array",t)}addObject(e,t){return this.addField(e,"Object",t)}addPointer(e,t,r){if(!e)throw new Error("field name may not be null.");if(!t)throw new Error("You need to set the targetClass of the Pointer.");const i={type:"Pointer",targetClass:t};return"boolean"==typeof r?.required&&(i.required=r.required),void 0!==r?.defaultValue&&(i.defaultValue=r.defaultValue,r.defaultValue instanceof ParseObject&&(i.defaultValue=r.defaultValue.toPointer())),this._fields[e]=i,this}addRelation(e,t){if(!e)throw new Error("field name may not be null.");if(!t)throw new Error("You need to set the targetClass of the Relation.");return this._fields[e]={type:"Relation",targetClass:t},this}deleteField(e){return this._fields[e]={__op:"Delete"},this}deleteIndex(e){return this._indexes[e]={__op:"Delete"},this}}const DefaultController$1={send:(e,t,r={})=>CoreManager.getRESTController().request(t,`schemas/${e}`,r,{useMasterKey:!0}),get(e){return this.send(e,"GET")},create(e,t){return this.send(e,"POST",t)},update(e,t){return this.send(e,"PUT",t)},delete(e){return this.send(e,"DELETE")},purge:e=>CoreManager.getRESTController().request("DELETE",`purge/${e}`,{},{useMasterKey:!0})};CoreManager.setSchemaController(DefaultController$1);class ParseSession extends ParseObject{constructor(e){if(super("_Session"),e&&"object"==typeof e)try{this.set(e||{})}catch(e){throw new Error("Can't create an invalid Session")}}getSessionToken(){const e=this.get("sessionToken");return"string"==typeof e?e:""}static readOnlyAttributes(){return["createdWith","expiresAt","installationId","restricted","sessionToken","user"]}static current(e){const t=CoreManager.getSessionController(),r=ParseObject._getRequestOptions(e);return ParseUser.currentAsync().then((e=>e?(r.sessionToken=e.getSessionToken(),t.getSession(r)):Promise.reject("There is no current user.")))}static isCurrentSessionRevocable(){const e=ParseUser.current();return!!e&&isRevocableSession(e.getSessionToken()||"")}}ParseObject.registerSubclass("_Session",ParseSession);const DefaultController={getSession(e){const t=CoreManager.getRESTController(),r=new ParseSession;return t.request("GET","sessions/me",{},e).then((e=>(r._finishFetch(e),r._setExisted(!0),r)))}};CoreManager.setSessionController(DefaultController);class LiveQuerySubscription{constructor(e,t,r,i){this.id=e,this.query=t,this.sessionToken=r,this.client=i,this.subscribePromise=resolvingPromise(),this.unsubscribePromise=resolvingPromise(),this.subscribed=!1;const n=CoreManager.getEventEmitter();this.emitter=new n,this.on=(e,t)=>this.emitter.on(e,t),this.emit=(e,...t)=>this.emitter.emit(e,...t),this.on("error",(()=>{}))}unsubscribe(){return CoreManager.getLiveQueryController().getDefaultLiveQueryClient().then((e=>(this.emit("close"),e.unsubscribe(this))))}find(){this.client&&this.client.connectPromise.then((()=>{this.client.socket.send(JSON.stringify({op:"query",requestId:this.id}))}))}}const CLIENT_STATE={INITIALIZED:"initialized",CONNECTING:"connecting",CONNECTED:"connected",CLOSED:"closed",RECONNECTING:"reconnecting",DISCONNECTED:"disconnected"},OP_TYPES={CONNECT:"connect",SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"},OP_EVENTS={CONNECTED:"connected",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed",ERROR:"error",RESULT:"result"},CLIENT_EMMITER_TYPES={CLOSE:"close",ERROR:"error",OPEN:"open"},SUBSCRIPTION_EMMITER_TYPES={OPEN:"open",CLOSE:"close",ERROR:"error",RESULT:"result"},generateInterval=e=>Math.random()*Math.min(30,Math.pow(2,e)-1)*1e3;class LiveQueryClient{constructor({applicationId:e,serverURL:t,javascriptKey:r,masterKey:i,sessionToken:n,installationId:o}){if(!t||0!==t.indexOf("ws"))throw new Error("You need to set a proper Parse LiveQuery server url before using LiveQueryClient");this.reconnectHandle=null,this.attempts=1,this.id=0,this.requestId=1,this.serverURL=t,this.applicationId=e,this.javascriptKey=r||void 0,this.masterKey=i||void 0,this.sessionToken=n||void 0,this.installationId=o||void 0,this.additionalProperties=!0,this.connectPromise=resolvingPromise(),this.subscriptions=new Map,this.state=CLIENT_STATE.INITIALIZED;const s=CoreManager.getEventEmitter();this.emitter=new s,this.on=(e,t)=>this.emitter.on(e,t),this.emit=(e,...t)=>this.emitter.emit(e,...t),this.on("error",(()=>{}))}shouldOpen(){return this.state===CLIENT_STATE.INITIALIZED||this.state===CLIENT_STATE.DISCONNECTED}subscribe(e,t){if(!e)return;const r=e.className,i=e.toJSON(),n=i.where,o=i.keys?.split(","),s=i.watch?.split(","),a={op:OP_TYPES.SUBSCRIBE,requestId:this.requestId,query:{className:r,where:n,keys:o,watch:s},sessionToken:void 0};t&&(a.sessionToken=t);const u=new LiveQuerySubscription(this.requestId,e,t,this);return this.subscriptions.set(this.requestId,u),this.requestId+=1,this.connectPromise.then((()=>{this.socket.send(JSON.stringify(a))})).catch((e=>{u.subscribePromise.reject(e)})),u}async unsubscribe(e){if(!e)return;const t={op:OP_TYPES.UNSUBSCRIBE,requestId:e.id};return this.connectPromise.then((()=>this.socket.send(JSON.stringify(t)))).then((()=>e.unsubscribePromise))}open(){const e=CoreManager.getWebSocketController();e?(this.state!==CLIENT_STATE.RECONNECTING&&(this.state=CLIENT_STATE.CONNECTING),this.socket=new e(this.serverURL),this.socket.closingPromise=resolvingPromise(),this.socket.onopen=()=>{this._handleWebSocketOpen()},this.socket.onmessage=e=>{this._handleWebSocketMessage(e)},this.socket.onclose=e=>{this.socket.closingPromise?.resolve(e),this._handleWebSocketClose()},this.socket.onerror=e=>{this._handleWebSocketError(e)}):this.emit(CLIENT_EMMITER_TYPES.ERROR,"Can not find WebSocket implementation")}resubscribe(){this.subscriptions.forEach(((e,t)=>{const r=e.query,i=r.toJSON(),n=i.where,o=i.keys?.split(","),s=i.watch?.split(","),a=r.className,u=e.sessionToken,h={op:OP_TYPES.SUBSCRIBE,requestId:t,query:{className:a,where:n,keys:o,watch:s},sessionToken:void 0};u&&(h.sessionToken=u),this.connectPromise.then((()=>{this.socket.send(JSON.stringify(h))}))}))}async close(){if(this.state!==CLIENT_STATE.INITIALIZED&&this.state!==CLIENT_STATE.DISCONNECTED){this.state=CLIENT_STATE.DISCONNECTED,this.socket?.close();for(const e of this.subscriptions.values())e.subscribed=!1,e.emit(SUBSCRIPTION_EMMITER_TYPES.CLOSE);return this._handleReset(),this.emit(CLIENT_EMMITER_TYPES.CLOSE),this.socket?.closingPromise}}_handleReset(){this.attempts=1,this.id=0,this.requestId=1,this.connectPromise=resolvingPromise(),this.subscriptions=new Map}_handleWebSocketOpen(){const e={op:OP_TYPES.CONNECT,applicationId:this.applicationId,javascriptKey:this.javascriptKey,masterKey:this.masterKey,sessionToken:this.sessionToken,installationId:void 0};this.additionalProperties&&(e.installationId=this.installationId),this.socket.send(JSON.stringify(e))}_handleWebSocketMessage(e){let t=e.data;"string"==typeof t&&(t=JSON.parse(t));let r=null;t.requestId&&(r=this.subscriptions.get(t.requestId)||null);const i={clientId:t.clientId,installationId:t.installationId};switch(t.op){case OP_EVENTS.CONNECTED:this.state===CLIENT_STATE.RECONNECTING&&this.resubscribe(),this.emit(CLIENT_EMMITER_TYPES.OPEN),this.id=t.clientId,this.connectPromise.resolve(),this.state=CLIENT_STATE.CONNECTED;break;case OP_EVENTS.SUBSCRIBED:r&&(this.attempts=1,r.subscribed=!0,r.subscribePromise.resolve(),setTimeout((()=>r.emit(SUBSCRIPTION_EMMITER_TYPES.OPEN,i)),200));break;case OP_EVENTS.ERROR:{const e=new ParseError(t.code,t.error);this.id||(this.connectPromise.reject(e),this.state=CLIENT_STATE.DISCONNECTED),t.requestId?r&&(r.subscribePromise.reject(e),setTimeout((()=>r.emit(SUBSCRIPTION_EMMITER_TYPES.ERROR,t.error)),200)):this.emit(CLIENT_EMMITER_TYPES.ERROR,t.error),"Additional properties not allowed"===t.error&&(this.additionalProperties=!1),t.reconnect&&this._handleReconnect();break}case OP_EVENTS.UNSUBSCRIBED:r&&(this.subscriptions.delete(t.requestId),r.subscribed=!1,r.unsubscribePromise.resolve());break;case OP_EVENTS.RESULT:if(r){const e=t.results.map((e=>(!e.className&&r.query&&(e.className=r.query.className),ParseObject.fromJSON(e,!1))));r.emit(SUBSCRIPTION_EMMITER_TYPES.RESULT,e)}break;default:{if(!r)break;let e=!1;if(t.original){e=!0,delete t.original.__type;for(const e in t.original)e in t.object||(t.object[e]=void 0);t.original=ParseObject.fromJSON(t.original,!1)}delete t.object.__type;const n=ParseObject.fromJSON(t.object,(!r.query||!r.query._select)&&e);t.original?r.emit(t.op,n,t.original,i):r.emit(t.op,n,i);const o=CoreManager.getLocalDatastore();e&&o.isEnabled&&o._updateObjectIfPinned(n).then((()=>{}))}}}_handleWebSocketClose(){if(this.state!==CLIENT_STATE.DISCONNECTED){this.state=CLIENT_STATE.CLOSED,this.emit(CLIENT_EMMITER_TYPES.CLOSE);for(const e of this.subscriptions.values())e.emit(SUBSCRIPTION_EMMITER_TYPES.CLOSE);this._handleReconnect()}}_handleWebSocketError(e){this.emit(CLIENT_EMMITER_TYPES.ERROR,e);for(const t of this.subscriptions.values())t.emit(SUBSCRIPTION_EMMITER_TYPES.ERROR,e);this._handleReconnect()}_handleReconnect(){if(this.state===CLIENT_STATE.DISCONNECTED)return;this.state=CLIENT_STATE.RECONNECTING;const e=generateInterval(this.attempts);this.reconnectHandle&&clearTimeout(this.reconnectHandle),this.reconnectHandle=setTimeout((()=>{this.attempts++,this.connectPromise=resolvingPromise(),this.open()}).bind(this),e)}}function getLiveQueryClient(){return CoreManager.getLiveQueryController().getDefaultLiveQueryClient()}class LiveQuery{constructor(){const e=CoreManager.getEventEmitter();this.emitter=new e,this.on=(e,t)=>this.emitter.on(e,t),this.emit=(e,...t)=>this.emitter.emit(e,...t),this.on("error",(()=>{}))}async open(){(await getLiveQueryClient()).open()}async close(){(await getLiveQueryClient()).close()}}let defaultLiveQueryClient;const DefaultLiveQueryController={setDefaultLiveQueryClient(e){defaultLiveQueryClient=e},async getDefaultLiveQueryClient(){if(defaultLiveQueryClient)return defaultLiveQueryClient;const[e,t]=await Promise.all([CoreManager.getUserController().currentUserAsync(),CoreManager.getInstallationController().currentInstallationId()]),r=e?e.getSessionToken():void 0;let i=CoreManager.get("LIVEQUERY_SERVER_URL");if(i&&0!==i.indexOf("ws"))throw new Error("You need to set a proper Parse LiveQuery server url before using LiveQueryClient");if(!i){const e=CoreManager.get("SERVER_URL");i=(0===e.indexOf("https")?"wss://":"ws://")+e.replace(/^https?:\/\//,""),CoreManager.set("LIVEQUERY_SERVER_URL",i)}const n=CoreManager.get("APPLICATION_ID"),o=CoreManager.get("JAVASCRIPT_KEY"),s=CoreManager.get("MASTER_KEY");defaultLiveQueryClient=new LiveQueryClient({applicationId:n,serverURL:i,javascriptKey:o,masterKey:s,sessionToken:r,installationId:t});const a=CoreManager.getLiveQuery();return defaultLiveQueryClient.on("error",(e=>{a.emit("error",e)})),defaultLiveQueryClient.on("open",(()=>{a.emit("open")})),defaultLiveQueryClient.on("close",(()=>{a.emit("close")})),defaultLiveQueryClient},_clearCachedDefaultClient(){defaultLiveQueryClient=null}};CoreManager.setLiveQueryController(DefaultLiveQueryController);const StorageController$3={async:0,getItem:e=>localStorage.getItem(e),setItem(e,t){try{localStorage.setItem(e,t)}catch(e){console.log(e.message)}},removeItem(e){localStorage.removeItem(e)},getAllKeys(){const e=[];for(let t=0;t<localStorage.length;t+=1)e.push(localStorage.key(t));return e},clear(){localStorage.clear()}},memMap={},StorageController$2={async:0,getItem:e=>Object.hasOwn(memMap,e)?memMap[e]:null,setItem(e,t){memMap[e]=String(t)},removeItem(e){delete memMap[e]},getAllKeys:()=>Object.keys(memMap),clear(){for(const e in memMap)Object.hasOwn(memMap,e)&&delete memMap[e]}};let StorageController$1=StorageController$2;StorageController$1=StorageController$3;const StorageController=StorageController$1;var browser$1,hasRequiredBrowser;function requireBrowser(){return hasRequiredBrowser?browser$1:(hasRequiredBrowser=1,browser$1=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")})}var browserExports=requireBrowser();const browser=getDefaultExportFromCjs(browserExports),__CJS__import__0__=_mergeNamespaces({__proto__:null,default:browser},[browserExports]);class SocketWeapp{constructor(e){this.onopen=()=>{},this.onmessage=()=>{},this.onclose=()=>{},this.onerror=()=>{},wx.onSocketOpen((()=>{this.onopen()})),wx.onSocketMessage((e=>{this.onmessage(e)})),wx.onSocketClose((e=>{this.onclose(e)})),wx.onSocketError((e=>{this.onerror(e)})),wx.connectSocket({url:e})}send(e){wx.sendSocketMessage({data:e})}close(){wx.closeSocket()}}const __CJS__import__1__=Object.freeze(Object.defineProperty({__proto__:null,default:SocketWeapp},Symbol.toStringTag,{value:"Module"}));let WebSocketController$1;try{WebSocketController$1="function"==typeof WebSocket||"object"==typeof WebSocket?WebSocket:null}catch(e){}const WebSocketController=WebSocketController$1;var define_process_env_default={};const Parse={ACL:ParseACL,Analytics:Analytics,AnonymousUtils:AnonymousUtils,Cloud:Cloud,CLP:ParseCLP,CoreManager:CoreManager,Config:ParseConfig,Error:ParseError,FacebookUtils:FacebookUtils,File:ParseFile,GeoPoint:ParseGeoPoint,Polygon:ParsePolygon,Installation:ParseInstallation,LocalDatastore:LocalDatastore,Object:ParseObject,Op:{Set:SetOp,Unset:UnsetOp,Increment:IncrementOp,Add:AddOp,Remove:RemoveOp,AddUnique:AddUniqueOp,Relation:RelationOp},Push:Push,Query:ParseQuery,Relation:ParseRelation,Role:ParseRole,Schema:ParseSchema,Session:ParseSession,Storage:Storage,User:ParseUser,LiveQueryClient:LiveQueryClient,IndexedDB:void 0,Hooks:void 0,Parse:void 0,set EventuallyQueue(e){CoreManager.setEventuallyQueue(e)},get EventuallyQueue(){return CoreManager.getEventuallyQueue()},initialize(e,t){CoreManager.get("IS_NODE")&&!define_process_env_default.SERVER_RENDERING&&console.log("It looks like you're using the browser version of the SDK in a node.js environment. You should require('parse/node') instead."),Parse._initialize(e,t)},_initialize(e,t,r,i){CoreManager.set("APPLICATION_ID",e),CoreManager.set("JAVASCRIPT_KEY",t),CoreManager.set("MAINTENANCE_KEY",i),CoreManager.set("MASTER_KEY",r),CoreManager.set("USE_MASTER_KEY",!1),CoreManager.setIfNeeded("EventEmitter",EventEmitter),CoreManager.setIfNeeded("LiveQuery",new LiveQuery),CoreManager.setIfNeeded("CryptoController",CryptoController),CoreManager.setIfNeeded("EventuallyQueue",EventuallyQueue),CoreManager.setIfNeeded("InstallationController",InstallationController),CoreManager.setIfNeeded("LocalDatastoreController",LocalDatastoreController),CoreManager.setIfNeeded("StorageController",StorageController),CoreManager.setIfNeeded("WebSocketController",WebSocketController),Parse.IndexedDB=CoreManager.setIfNeeded("IndexedDBStorageController",IndexedDBStorageController)},setAsyncStorage(e){CoreManager.setAsyncStorage(e)},setLocalDatastoreController(e){CoreManager.setLocalDatastoreController(e)},getServerHealth:()=>CoreManager.getRESTController().request("GET","health"),set applicationId(e){CoreManager.set("APPLICATION_ID",e)},get applicationId(){return CoreManager.get("APPLICATION_ID")},set javaScriptKey(e){CoreManager.set("JAVASCRIPT_KEY",e)},get javaScriptKey(){return CoreManager.get("JAVASCRIPT_KEY")},set masterKey(e){CoreManager.set("MASTER_KEY",e)},get masterKey(){return CoreManager.get("MASTER_KEY")},set maintenanceKey(e){CoreManager.set("MAINTENANCE_KEY",e)},get maintenanceKey(){return CoreManager.get("MAINTENANCE_KEY")},set serverURL(e){CoreManager.set("SERVER_URL",e)},get serverURL(){return CoreManager.get("SERVER_URL")},set LiveQuery(e){CoreManager.setLiveQuery(e)},get LiveQuery(){return CoreManager.getLiveQuery()},set liveQueryServerURL(e){CoreManager.set("LIVEQUERY_SERVER_URL",e)},get liveQueryServerURL(){return CoreManager.get("LIVEQUERY_SERVER_URL")},set encryptedUser(e){CoreManager.set("ENCRYPTED_USER",e)},get encryptedUser(){return CoreManager.get("ENCRYPTED_USER")},set secret(e){CoreManager.set("ENCRYPTED_KEY",e)},get secret(){return CoreManager.get("ENCRYPTED_KEY")},set idempotency(e){CoreManager.set("IDEMPOTENCY",e)},get idempotency(){return CoreManager.get("IDEMPOTENCY")},set allowCustomObjectId(e){CoreManager.set("ALLOW_CUSTOM_OBJECT_ID",e)},get allowCustomObjectId(){return CoreManager.get("ALLOW_CUSTOM_OBJECT_ID")},set nodeLogging(e){CoreManager.set("NODE_LOGGING",e)},get nodeLogging(){return CoreManager.get("NODE_LOGGING")},_request:(...e)=>CoreManager.getRESTController().request.apply(null,e),_ajax:(...e)=>CoreManager.getRESTController().ajax.apply(null,e),_decode:(e,t)=>decode(t),_encode:(e,t,r)=>encode(e,r),_getInstallationId:()=>CoreManager.getInstallationController().currentInstallationId(),enableLocalDatastore(e,t){this.applicationId?this.LocalDatastore.isEnabled||(this.LocalDatastore.isEnabled=!0,(e||void 0===e)&&CoreManager.getEventuallyQueue().poll(t||2e3)):console.log("'enableLocalDatastore' must be called after 'initialize'")},isLocalDatastoreEnabled(){return this.LocalDatastore.isEnabled},dumpLocalDatastore(){return this.LocalDatastore.isEnabled?Parse.LocalDatastore._getAllContents():(console.log("Parse.enableLocalDatastore() must be called first"),Promise.resolve({}))},enableEncryptedUser(){this.encryptedUser=!0},isEncryptedUserEnabled(){return this.encryptedUser}};CoreManager.setRESTController(RESTController),globalThis.Parse=Parse,Parse.Parse=Parse}));
|
|
1
|
+
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function _mergeNamespaces(e,t){for(var r=0;r<t.length;r++){const i=t[r];if("string"!=typeof i&&!Array.isArray(i))for(const t in i)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(i,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>i[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function getDefaultExportFromCjs$1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var browser$e={exports:{}},process=browser$e.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports$1=browser$e.exports;const process$1=getDefaultExportFromCjs$1(browserExports$1),config={IS_NODE:void 0!==process$1&&!!process$1.versions&&!!process$1.versions.node&&!process$1.versions.electron,REQUEST_ATTEMPT_LIMIT:5,REQUEST_BATCH_SIZE:20,REQUEST_HEADERS:{},SERVER_URL:"https://api.parse.com/1",LIVEQUERY_SERVER_URL:null,ENCRYPTED_KEY:null,VERSION:"js8.5.0-alpha.1",APPLICATION_ID:null,JAVASCRIPT_KEY:null,MAINTENANCE_KEY:null,MASTER_KEY:null,USE_MASTER_KEY:!1,PERFORM_USER_REWRITE:!0,FORCE_REVOCABLE_SESSION:!1,ENCRYPTED_USER:!1,IDEMPOTENCY:!1,ALLOW_CUSTOM_OBJECT_ID:!1,PARSE_ERRORS:[],NODE_LOGGING:!1};function requireMethods(e,t,r){t.forEach((t=>{if("function"!=typeof r[t])throw new Error(`${e} must implement ${t}()`)}))}const CoreManager={get:function(e){if(Object.hasOwn(config,e))return config[e];throw new Error("Configuration key not found: "+e)},set:function(e,t){config[e]=t},setIfNeeded:function(e,t){return Object.hasOwn(config,e)||(config[e]=t),config[e]},setAnalyticsController(e){requireMethods("AnalyticsController",["track"],e),config.AnalyticsController=e},getAnalyticsController:()=>config.AnalyticsController,setCloudController(e){requireMethods("CloudController",["run","getJobsData","startJob"],e),config.CloudController=e},getCloudController:()=>config.CloudController,setConfigController(e){requireMethods("ConfigController",["current","get","save"],e),config.ConfigController=e},getConfigController:()=>config.ConfigController,setCryptoController(e){requireMethods("CryptoController",["encrypt","decrypt"],e),config.CryptoController=e},getCryptoController:()=>config.CryptoController,setEventEmitter(e){config.EventEmitter=e},getEventEmitter:()=>config.EventEmitter,setFileController(e){requireMethods("FileController",["saveFile","saveBase64"],e),config.FileController=e},setEventuallyQueue(e){requireMethods("EventuallyQueue",["poll","save","destroy"],e),config.EventuallyQueue=e},getEventuallyQueue:()=>config.EventuallyQueue,getFileController:()=>config.FileController,setInstallationController(e){requireMethods("InstallationController",["currentInstallationId","currentInstallation","updateInstallationOnDisk"],e),config.InstallationController=e},getInstallationController:()=>config.InstallationController,setLiveQuery(e){config.LiveQuery=e},getLiveQuery:()=>config.LiveQuery,setObjectController(e){requireMethods("ObjectController",["save","fetch","destroy"],e),config.ObjectController=e},getObjectController:()=>config.ObjectController,setObjectStateController(e){requireMethods("ObjectStateController",["getState","initializeState","removeState","getServerData","setServerData","getPendingOps","setPendingOp","pushPendingState","popPendingState","mergeFirstPendingState","getObjectCache","estimateAttribute","estimateAttributes","commitServerChanges","enqueueTask","clearAllState"],e),config.ObjectStateController=e},getObjectStateController:()=>config.ObjectStateController,setPushController(e){requireMethods("PushController",["send"],e),config.PushController=e},getPushController:()=>config.PushController,setQueryController(e){requireMethods("QueryController",["find","aggregate"],e),config.QueryController=e},getQueryController:()=>config.QueryController,setRESTController(e){requireMethods("RESTController",["request","ajax"],e),config.RESTController=e},getRESTController:()=>config.RESTController,setSchemaController(e){requireMethods("SchemaController",["get","create","update","delete","send","purge"],e),config.SchemaController=e},getSchemaController:()=>config.SchemaController,setSessionController(e){requireMethods("SessionController",["getSession"],e),config.SessionController=e},getSessionController:()=>config.SessionController,setStorageController(e){e.async?requireMethods("An async StorageController",["getItemAsync","setItemAsync","removeItemAsync","getAllKeysAsync"],e):requireMethods("A synchronous StorageController",["getItem","setItem","removeItem","getAllKeys"],e),config.StorageController=e},setLocalDatastoreController(e){requireMethods("LocalDatastoreController",["pinWithName","fromPinWithName","unPinWithName","getAllContents","clear"],e),config.LocalDatastoreController=e},getLocalDatastoreController:()=>config.LocalDatastoreController,setLocalDatastore(e){config.LocalDatastore=e},getLocalDatastore:()=>config.LocalDatastore,getStorageController:()=>config.StorageController,setAsyncStorage(e){config.AsyncStorage=e},getAsyncStorage:()=>config.AsyncStorage,setWebSocketController(e){config.WebSocketController=e},getWebSocketController:()=>config.WebSocketController,setUserController(e){requireMethods("UserController",["setCurrentUser","currentUser","currentUserAsync","signUp","logIn","become","logOut","me","requestPasswordReset","upgradeToRevocableSession","requestEmailVerification","verifyPassword","linkWith"],e),config.UserController=e},getUserController:()=>config.UserController,setLiveQueryController(e){requireMethods("LiveQueryController",["setDefaultLiveQueryClient","getDefaultLiveQueryClient","_clearCachedDefaultClient"],e),config.LiveQueryController=e},getLiveQueryController:()=>config.LiveQueryController,setHooksController(e){requireMethods("HooksController",["create","get","update","remove"],e),config.HooksController=e},getHooksController:()=>config.HooksController,setParseOp(e){config.ParseOp=e},getParseOp:()=>config.ParseOp,setParseObject(e){config.ParseObject=e},getParseObject:()=>config.ParseObject,setParseQuery(e){config.ParseQuery=e},getParseQuery:()=>config.ParseQuery,setParseRole(e){config.ParseRole=e},getParseRole:()=>config.ParseRole,setParseUser(e){config.ParseUser=e},getParseUser:()=>config.ParseUser};var buffer$1={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function byteLength(e){var t=getLens(e),r=t[0],i=t[1];return 3*(r+i)/4-i}function _byteLength(e,t,r){return 3*(t+r)/4-r}function toByteArray(e){var t,r,i=getLens(e),n=i[0],o=i[1],s=new Arr(_byteLength(e,n,o)),a=0,u=o>0?n-4:n;for(r=0;r<u;r+=4)t=revLookup[e.charCodeAt(r)]<<18|revLookup[e.charCodeAt(r+1)]<<12|revLookup[e.charCodeAt(r+2)]<<6|revLookup[e.charCodeAt(r+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===o&&(t=revLookup[e.charCodeAt(r)]<<2|revLookup[e.charCodeAt(r+1)]>>4,s[a++]=255&t),1===o&&(t=revLookup[e.charCodeAt(r)]<<10|revLookup[e.charCodeAt(r+1)]<<4|revLookup[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[63&e]}function encodeChunk(e,t,r){for(var i,n=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),n.push(tripletToBase64(i));return n.join("")}function fromByteArray(e){for(var t,r=e.length,i=r%3,n=[],o=16383,s=0,a=r-i;s<a;s+=o)n.push(encodeChunk(e,s,s+o>a?a:s+o));return 1===i?(t=e[r-1],n.push(lookup[t>>2]+lookup[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],n.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),n.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var ieee754={read:function(e,t,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,h=u>>1,f=-7,l=r?n-1:0,c=r?-1:1,d=e[t+l];for(l+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+e[t+l],l+=c,f-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=h}return(d?-1:1)*s*Math.pow(2,o-i)},write:function(e,t,r,i,n,o){var s,a,u,h=8*o-n-1,f=(1<<h)-1,l=f>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?c/u:c*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,n),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;e[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;e[r+d]=255&s,d+=p,s/=256,h-=8);e[r+d-p]|=128*m}};!function(e){const t=base64Js,r=ieee754,i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=h,e.SlowBuffer=function(e){+e!=e&&(e=0);return h.alloc(+e)},e.INSPECT_MAX_BYTES=50;const n=2147483647;e.kMaxLength=n;const{Uint8Array:o,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;function u(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new o(e);return Object.setPrototypeOf(t,h.prototype),t}function h(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return f(e,t,r)}function f(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!h.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let i=u(r);const n=i.write(e,t);n!==r&&(i=i.slice(0,n));return i}(e,t);if(s.isView(e))return function(e){if(Q(e,o)){const t=new o(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,s)||e&&Q(e.buffer,s))return p(e,t,r);if(void 0!==a&&(Q(e,a)||e&&Q(e.buffer,a)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return h.from(i,t,r);const n=function(e){if(h.isBuffer(e)){const t=0|m(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Z(e.length)?u(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return h.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),u(e<0?0:0|m(e))}function d(e){const t=e.length<0?0:0|m(e.length),r=u(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===r?new o(e):void 0===r?new o(e,t):new o(e,t,r),Object.setPrototypeOf(i,h.prototype),i}function m(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function g(e,t){if(h.isBuffer(e))return e.length;if(s.isView(e)||Q(e,s))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(n)return i?-1:G(e).length;t=(""+t).toLowerCase(),n=!0}}function y(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return q(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function b(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=h.from(t,i)),h.isBuffer(t))return 0===t.length?-1:w(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof o.prototype.indexOf?n?o.prototype.indexOf.call(e,t,r):o.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,i,n){let o,s=1,a=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){let i=-1;for(o=r;o<a;o++)if(h(e,o)===h(t,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===u)return i*s}else-1!==i&&(o-=o-i),i=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let i=0;i<u;i++)if(h(e,o+i)!==h(t,i)){r=!1;break}if(r)return o}return-1}function _(e,t,r,i){r=Number(r)||0;const n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;const o=t.length;let s;for(i>o/2&&(i=o/2),s=0;s<i;++s){const i=parseInt(t.substr(2*s,2),16);if(Z(i))return s;e[r+s]=i}return s}function M(e,t,r,i){return V(G(t,e.length-r),e,r,i)}function S(e,t,r,i){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function E(e,t,r,i){return V(J(t),e,r,i)}function R(e,t,r,i){return V(function(e,t){let r,i,n;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function A(e,r,i){return 0===r&&i===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,i))}function q(e,t,r){r=Math.min(e.length,r);const i=[];let n=t;for(;n<r;){const t=e[n];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(n+s<=r){let r,i,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[n+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[n+1],i=e[n+2],128==(192&r)&&128==(192&i)&&(u=(15&t)<<12|(63&r)<<6|63&i,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[n+1],i=e[n+2],a=e[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}return function(e){const t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);let r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=C));return r}(i)}h.TYPED_ARRAY_SUPPORT=function(){try{const e=new o(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,o.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),h.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),h.poolSize=8192,h.from=function(e,t,r){return f(e,t,r)},Object.setPrototypeOf(h.prototype,o.prototype),Object.setPrototypeOf(h,o),h.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?u(e):void 0!==t?"string"==typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}(e,t,r)},h.allocUnsafe=function(e){return c(e)},h.allocUnsafeSlow=function(e){return c(e)},h.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==h.prototype},h.compare=function(e,t){if(Q(e,o)&&(e=h.from(e,e.offset,e.byteLength)),Q(t,o)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(e)||!h.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},h.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return h.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const i=h.allocUnsafe(t);let n=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,o))n+t.length>i.length?(h.isBuffer(t)||(t=h.from(t)),t.copy(i,n)):o.prototype.set.call(i,t,n);else{if(!h.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,n)}n+=t.length}return i},h.byteLength=g,h.prototype._isBuffer=!0,h.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},h.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},h.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},h.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?q(this,0,e):y.apply(this,arguments)},h.prototype.toLocaleString=h.prototype.toString,h.prototype.equals=function(e){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===h.compare(this,e)},h.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},i&&(h.prototype[i]=h.prototype.inspect),h.prototype.compare=function(e,t,r,i,n){if(Q(e,o)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0);const u=Math.min(s,a),f=this.slice(i,n),l=e.slice(t,r);for(let e=0;e<u;++e)if(f[e]!==l[e]){s=f[e],a=l[e];break}return s<a?-1:a<s?1:0},h.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},h.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},h.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},h.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return M(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function P(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function B(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function I(e,t,r){const i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i<r;++i)n+=Y[e[i]];return n}function O(e,t,r){const i=e.slice(t,r);let n="";for(let e=0;e<i.length-1;e+=2)n+=String.fromCharCode(i[e]+256*i[e+1]);return n}function k(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,i,n,o){if(!h.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function N(e,t,r,i,n){z(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function x(e,t,r,i,n){z(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function j(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function $(e,t,i,n,o){return t=+t,i>>>=0,o||j(e,0,i,4),r.write(e,t,i,n,23,4),i+4}function D(e,t,i,n,o){return t=+t,i>>>=0,o||j(e,0,i,8),r.write(e,t,i,n,52,8),i+8}h.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,h.prototype),i},h.prototype.readUintLE=h.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let i=this[e],n=1,o=0;for(;++o<t&&(n*=256);)i+=this[e+o]*n;return i},h.prototype.readUintBE=h.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},h.prototype.readUint8=h.prototype.readUInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),this[e]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(e,t){return e>>>=0,t||k(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readBigUInt64LE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),h.prototype.readBigUInt64BE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),h.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let i=this[e],n=1,o=0;for(;++o<t&&(n*=256);)i+=this[e+o]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},h.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||k(e,t,this.length);let i=t,n=1,o=this[e+--i];for(;i>0&&(n*=256);)o+=this[e+--i]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*t)),o},h.prototype.readInt8=function(e,t){return e>>>=0,t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(e,t){e>>>=0,t||k(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return e>>>=0,t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readBigInt64LE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),h.prototype.readBigInt64BE=X((function(e){K(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||W(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),h.prototype.readFloatLE=function(e,t){return e>>>=0,t||k(e,4,this.length),r.read(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return e>>>=0,t||k(e,4,this.length),r.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return e>>>=0,t||k(e,8,this.length),r.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return e>>>=0,t||k(e,8,this.length),r.read(this,e,!1,52,8)},h.prototype.writeUintLE=h.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=1,o=0;for(this[t]=255&e;++o<r&&(n*=256);)this[t+o]=e/n&255;return t+r},h.prototype.writeUintBE=h.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=r-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+r},h.prototype.writeUint8=h.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeBigUInt64LE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeBigUInt64BE=X((function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),h.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}let n=0,o=1,s=0;for(this[t]=255&e;++n<r&&(o*=256);)e<0&&0===s&&0!==this[t+n-1]&&(s=1),this[t+n]=(e/o|0)-s&255;return t+r},h.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}let n=r-1,o=1,s=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/o|0)-s&255;return t+r},h.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},h.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},h.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},h.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},h.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},h.prototype.writeBigInt64LE=X((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeBigInt64BE=X((function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),h.prototype.writeFloatLE=function(e,t,r){return $(this,e,t,!0,r)},h.prototype.writeFloatBE=function(e,t,r){return $(this,e,t,!1,r)},h.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},h.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},h.prototype.copy=function(e,t,r,i){if(!h.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);const n=i-r;return this===e&&"function"==typeof o.prototype.copyWithin?this.copyWithin(t,r,i):o.prototype.set.call(e,this.subarray(r,i),t),n},h.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!h.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{const o=h.isBuffer(e)?e:h.from(e,i),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=o[n%s]}return this};const U={};function L(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function F(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function z(e,t,r,i,n,o){if(e>r||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||W(t,e.length-(r+1))}(i,n,o)}function K(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){if(Math.floor(e)!==e)throw K(e,r),new U.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}L("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),L("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),L("ERR_OUT_OF_RANGE",(function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=F(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=F(n)),n+="n"),i+=` It must be ${t}. Received ${n}`,i}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const i=e.length;let n=null;const o=[];for(let s=0;s<i;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,i){let n;for(n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function X(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}}(buffer$1);const Buffer=buffer$1.Buffer;var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var events$1={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events$1.exports;hasRequiredEvents=1;var e,t="object"==typeof Reflect?Reflect:null,r=t&&"function"==typeof t.apply?t.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function n(){n.init.call(this)}events$1.exports=n,events$1.exports.once=function(e,t){return new Promise((function(r,i){function n(r){e.removeListener(t,o),i(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}p(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&p(e,"error",t,r)}(e,n,{once:!0})}))},n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?n.defaultMaxListeners:e._maxListeners}function u(e,t,r,i){var n,o,u,h;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),u=o[t]),void 0===u)u=o[t]=r,++e._eventsCount;else if("function"==typeof u?u=o[t]=i?[r,u]:[u,r]:i?u.unshift(r):u.push(r),(n=a(e))>0&&u.length>n&&!u.warned){u.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=u.length,h=f,console&&console.warn&&console.warn(h)}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 f(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=h.bind(i);return n.listener=r,i.wrapFn=n,n}function l(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):d(n,n.length)}function c(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function p(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(o){i.once&&e.removeEventListener(t,n),r(o)}))}}return Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),n.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},n.prototype.getMaxListeners=function(){return a(this)},n.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var h=u.length,f=d(u,h);for(i=0;i<h;++i)r(f[i],this,t)}return!0},n.prototype.addListener=function(e,t){return u(this,e,t,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(e,t){return u(this,e,t,!0)},n.prototype.once=function(e,t){return s(t),this.on(e,f(this,e,t)),this},n.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,f(this,e,t)),this},n.prototype.removeListener=function(e,t){var r,i,n,o,a;if(s(t),void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,a||t)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,o=Object.keys(r);for(i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},n.prototype.listeners=function(e){return l(this,e,!0)},n.prototype.rawListeners=function(e){return l(this,e,!1)},n.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},n.prototype.listenerCount=c,n.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},events$1.exports}var inherits_browser={exports:{}},hasRequiredInherits_browser,streamBrowser$1,hasRequiredStreamBrowser$1;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,"function"==typeof Object.create?inherits_browser.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),inherits_browser.exports}function requireStreamBrowser$1(){return hasRequiredStreamBrowser$1?streamBrowser$1:(hasRequiredStreamBrowser$1=1,streamBrowser$1=requireEvents().EventEmitter)}var dist={},hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});for(var t={},r={byteLength:function(e){var t=u(e),r=t[0],i=t[1];return 3*(r+i)/4-i},toByteArray:function(e){var t,r,i=u(e),s=i[0],a=i[1],h=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],h[f++]=t>>16&255,h[f++]=t>>8&255,h[f++]=255&t;2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,h[f++]=255&t);1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,h[f++]=t>>8&255,h[f++]=255&t);return h},fromByteArray:function(e){for(var t,r=e.length,n=r%3,o=[],s=16383,a=0,u=r-n;a<u;a+=s)o.push(h(e,a,a+s>u?u:a+s));1===n?(t=e[r-1],o.push(i[t>>2]+i[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],o.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return o.join("")}},i=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)i[a]=s[a],n[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function h(e,t,r){for(var n,o,s=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(i[(o=n)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63;var f={read:function(e,t,r,i,n){var o,s,a=8*n-i-1,u=(1<<a)-1,h=u>>1,f=-7,l=r?n-1:0,c=r?-1:1,d=e[t+l];for(l+=c,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=i;f>0;s=256*s+e[t+l],l+=c,f-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),o-=h}return(d?-1:1)*s*Math.pow(2,o-i)},write:function(e,t,r,i,n,o){var s,a,u,h=8*o-n-1,f=(1<<h)-1,l=f>>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?c/u:c*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,n),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,n),s=0));n>=8;e[r+d]=255&a,d+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;e[r+d]=255&s,d+=p,s/=256,h-=8);e[r+d-p]|=128*m}};!function(e){const t=r,i=f,n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=l,e.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:s,ArrayBuffer:a,SharedArrayBuffer:u}=globalThis;function h(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new s(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return p(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|b(e,t);let i=h(r);const n=i.write(e,t);n!==r&&(i=i.slice(0,n));return i}(e,t);if(a.isView(e))return function(e){if(Y(e,s)){const t=new s(e);return g(t.buffer,t.byteOffset,t.byteLength)}return m(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,a)||e&&Y(e.buffer,a))return g(e,t,r);if(void 0!==u&&(Y(e,u)||e&&Y(e.buffer,u)))return g(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return l.from(i,t,r);const n=function(e){if(l.isBuffer(e)){const t=0|y(e.length),r=h(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||X(e.length)?h(0):m(e);if("Buffer"===e.type&&Array.isArray(e.data))return m(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function p(e){return d(e),h(e<0?0:0|y(e))}function m(e){const t=e.length<0?0:0|y(e.length),r=h(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function g(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===r?new s(e):void 0===r?new s(e,t):new s(e,t,r),Object.setPrototypeOf(i,l.prototype),i}function y(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function b(e,t){if(l.isBuffer(e))return e.length;if(a.isView(e)||Y(e,a))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(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(n)return i?-1:V(e).length;t=(""+t).toLowerCase(),n=!0}}function v(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function w(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function _(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:M(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof s.prototype.indexOf?n?s.prototype.indexOf.call(e,t,r):s.prototype.lastIndexOf.call(e,t,r):M(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function M(e,t,r,i,n){let o,s=1,a=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){let i=-1;for(o=r;o<a;o++)if(h(e,o)===h(t,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===u)return i*s}else-1!==i&&(o-=o-i),i=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let i=0;i<u;i++)if(h(e,o+i)!==h(t,i)){r=!1;break}if(r)return o}return-1}function S(e,t,r,i){r=Number(r)||0;const n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;const o=t.length;let s;for(i>o/2&&(i=o/2),s=0;s<i;++s){const i=parseInt(t.substr(2*s,2),16);if(X(i))return s;e[r+s]=i}return s}function E(e,t,r,i){return Z(V(t,e.length-r),e,r,i)}function R(e,t,r,i){return Z(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function A(e,t,r,i){return Z(Q(t),e,r,i)}function q(e,t,r,i){return Z(function(e,t){let r,i,n;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function C(e,r,i){return 0===r&&i===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,i))}function P(e,t,r){r=Math.min(e.length,r);const i=[];let n=t;for(;n<r;){const t=e[n];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(n+s<=r){let r,i,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[n+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[n+1],i=e[n+2],128==(192&r)&&128==(192&i)&&(u=(15&t)<<12|(63&r)<<6|63&i,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[n+1],i=e[n+2],a=e[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=s}return function(e){const t=e.length;if(t<=B)return String.fromCharCode.apply(String,e);let r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=B));return r}(i)}l.TYPED_ARRAY_SUPPORT=function(){try{const e=new s(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,s.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,s.prototype),Object.setPrototypeOf(l,s),l.alloc=function(e,t,r){return function(e,t,r){return d(e),e<=0?h(e):void 0!==t?"string"==typeof r?h(e).fill(t,r):h(e).fill(t):h(e)}(e,t,r)},l.allocUnsafe=function(e){return p(e)},l.allocUnsafeSlow=function(e){return p(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Y(e,s)&&(e=l.from(e,e.offset,e.byteLength)),Y(t,s)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const i=l.allocUnsafe(t);let n=0;for(r=0;r<e.length;++r){let t=e[r];if(Y(t,s))n+t.length>i.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(i,n)):s.prototype.set.call(i,t,n);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,n)}n+=t.length}return i},l.byteLength=b,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)w(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?P(this,0,e):v.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(l.prototype[n]=l.prototype.inspect),l.prototype.compare=function(e,t,r,i,n){if(Y(e,s)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0);const u=Math.min(o,a),h=this.slice(i,n),f=e.slice(t,r);for(let e=0;e<u;++e)if(h[e]!==f[e]){o=h[e],a=f[e];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return _(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return _(this,e,t,r,!1)},l.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return R(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const B=4096;function I(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function O(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function k(e,t,r){const i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i<r;++i)n+=ee[e[i]];return n}function T(e,t,r){const i=e.slice(t,r);let n="";for(let e=0;e<i.length-1;e+=2)n+=String.fromCharCode(i[e]+256*i[e+1]);return n}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,i,n,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function j(e,t,r,i,n){W(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function $(e,t,r,i,n){W(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function D(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,o){return t=+t,r>>>=0,o||D(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,o){return t=+t,r>>>=0,o||D(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,l.prototype),i},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e],n=1,o=0;for(;++o<t&&(n*=256);)i+=this[e+o]*n;return i},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=te((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),l.prototype.readBigUInt64BE=te((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=this[e],n=1,o=0;for(;++o<t&&(n*=256);)i+=this[e+o]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let i=t,n=1,o=this[e+--i];for(;i>0&&(n*=256);)o+=this[e+--i]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=te((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=te((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=1,o=0;for(this[t]=255&e;++o<r&&(n*=256);)this[t+o]=e/n&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){x(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=r-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=te((function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=te((function(e,t=0){return $(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}let n=0,o=1,s=0;for(this[t]=255&e;++n<r&&(o*=256);)e<0&&0===s&&0!==this[t+n-1]&&(s=1),this[t+n]=(e/o|0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}let n=r-1,o=1,s=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/o|0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=te((function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=te((function(e,t=0){return $(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,i){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);const n=i-r;return this===e&&"function"==typeof s.prototype.copyWithin?this.copyWithin(t,r,i):s.prototype.set.call(e,this.subarray(r,i),t),n},l.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{const o=l.isBuffer(e)?e:l.from(e,i),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=o[n%s]}return this};const F={};function z(e,t,r){F[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function K(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function W(e,t,r,i,n,o){if(e>r||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`,new F.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(i,n,o)}function H(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new F.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),z("ERR_OUT_OF_RANGE",(function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=K(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=K(n)),n+="n"),i+=` It must be ${t}. Received ${n}`,i}),RangeError);const J=/[^+/0-9A-Za-z-_]/g;function V(e,t){let r;t=t||1/0;const i=e.length;let n=null;const o=[];for(let s=0;s<i;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Q(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Z(e,t,r,i){let n;for(n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const ee=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function te(e){return"undefined"==typeof BigInt?re:e}function re(){throw new Error("BigInt not supported")}}(t);const l=t.Buffer;e.Blob=t.Blob,e.BlobOptions=t.BlobOptions,e.Buffer=t.Buffer,e.File=t.File,e.FileOptions=t.FileOptions,e.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,e.SlowBuffer=t.SlowBuffer,e.TranscodeEncoding=t.TranscodeEncoding,e.atob=t.atob,e.btoa=t.btoa,e.constants=t.constants,e.default=l,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode}(dist)),dist}var util$1={},types={},shams$1,hasRequiredShams$1,shams,hasRequiredShams,esObjectAtoms,hasRequiredEsObjectAtoms,esErrors,hasRequiredEsErrors,_eval,hasRequired_eval,range,hasRequiredRange,ref,hasRequiredRef,syntax,hasRequiredSyntax,type,hasRequiredType,uri,hasRequiredUri,abs,hasRequiredAbs,floor,hasRequiredFloor,max,hasRequiredMax,min,hasRequiredMin,pow,hasRequiredPow,round,hasRequiredRound,_isNaN,hasRequired_isNaN,sign$1,hasRequiredSign$1,gOPD,hasRequiredGOPD,gopd,hasRequiredGopd,esDefineProperty,hasRequiredEsDefineProperty,hasSymbols,hasRequiredHasSymbols,Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf,Object_getPrototypeOf,hasRequiredObject_getPrototypeOf,implementation,hasRequiredImplementation,functionBind,hasRequiredFunctionBind,functionCall,hasRequiredFunctionCall,functionApply,hasRequiredFunctionApply,reflectApply,hasRequiredReflectApply,actualApply,hasRequiredActualApply,callBindApplyHelpers,hasRequiredCallBindApplyHelpers,get$1,hasRequiredGet,getProto,hasRequiredGetProto,hasown,hasRequiredHasown,getIntrinsic,hasRequiredGetIntrinsic,callBound,hasRequiredCallBound,isArguments,hasRequiredIsArguments,isRegex,hasRequiredIsRegex,safeRegexTest,hasRequiredSafeRegexTest,isGeneratorFunction,hasRequiredIsGeneratorFunction,isCallable,hasRequiredIsCallable,forEach,hasRequiredForEach,possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames,availableTypedArrays,hasRequiredAvailableTypedArrays;function requireShams$1(){return hasRequiredShams$1?shams$1:(hasRequiredShams$1=1,shams$1=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0})}function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var e=requireShams$1();return shams=function(){return e()&&!!Symbol.toStringTag}}function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms?esObjectAtoms:(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object)}function requireEsErrors(){return hasRequiredEsErrors?esErrors:(hasRequiredEsErrors=1,esErrors=Error)}function require_eval(){return hasRequired_eval?_eval:(hasRequired_eval=1,_eval=EvalError)}function requireRange(){return hasRequiredRange?range:(hasRequiredRange=1,range=RangeError)}function requireRef(){return hasRequiredRef?ref:(hasRequiredRef=1,ref=ReferenceError)}function requireSyntax(){return hasRequiredSyntax?syntax:(hasRequiredSyntax=1,syntax=SyntaxError)}function requireType(){return hasRequiredType?type:(hasRequiredType=1,type=TypeError)}function requireUri(){return hasRequiredUri?uri:(hasRequiredUri=1,uri=URIError)}function requireAbs(){return hasRequiredAbs?abs:(hasRequiredAbs=1,abs=Math.abs)}function requireFloor(){return hasRequiredFloor?floor:(hasRequiredFloor=1,floor=Math.floor)}function requireMax(){return hasRequiredMax?max:(hasRequiredMax=1,max=Math.max)}function requireMin(){return hasRequiredMin?min:(hasRequiredMin=1,min=Math.min)}function requirePow(){return hasRequiredPow?pow:(hasRequiredPow=1,pow=Math.pow)}function requireRound(){return hasRequiredRound?round:(hasRequiredRound=1,round=Math.round)}function require_isNaN(){return hasRequired_isNaN?_isNaN:(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(e){return e!=e})}function requireSign$1(){if(hasRequiredSign$1)return sign$1;hasRequiredSign$1=1;var e=require_isNaN();return sign$1=function(t){return e(t)||0===t?t:t<0?-1:1}}function requireGOPD(){return hasRequiredGOPD?gOPD:(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor)}function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var e=requireGOPD();if(e)try{e([],"length")}catch(t){e=null}return gopd=e}function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}return esDefineProperty=e}function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var e="undefined"!=typeof Symbol&&Symbol,t=requireShams$1();return hasSymbols=function(){return"function"==typeof e&&("function"==typeof Symbol&&("symbol"==typeof e("foo")&&("symbol"==typeof Symbol("bar")&&t())))}}function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf?Reflect_getPrototypeOf:(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null)}function requireObject_getPrototypeOf(){return hasRequiredObject_getPrototypeOf?Object_getPrototypeOf:(hasRequiredObject_getPrototypeOf=1,Object_getPrototypeOf=requireEsObjectAtoms().getPrototypeOf||null)}function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var e=Object.prototype.toString,t=Math.max,r=function(e,t){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var n=0;n<t.length;n+=1)r[n+e.length]=t[n];return r};return implementation=function(i){var n=this;if("function"!=typeof n||"[object Function]"!==e.apply(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var o,s=function(e,t){for(var r=[],i=t,n=0;i<e.length;i+=1,n+=1)r[n]=e[i];return r}(arguments,1),a=t(0,n.length-s.length),u=[],h=0;h<a;h++)u[h]="$"+h;if(o=Function("binder","return function ("+function(e,t){for(var r="",i=0;i<e.length;i+=1)r+=e[i],i+1<e.length&&(r+=t);return r}(u,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof o){var e=n.apply(this,r(s,arguments));return Object(e)===e?e:this}return n.apply(i,r(s,arguments))})),n.prototype){var f=function(){};f.prototype=n.prototype,o.prototype=new f,f.prototype=null}return o},implementation}function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var e=requireImplementation();return functionBind=Function.prototype.bind||e}function requireFunctionCall(){return hasRequiredFunctionCall?functionCall:(hasRequiredFunctionCall=1,functionCall=Function.prototype.call)}function requireFunctionApply(){return hasRequiredFunctionApply?functionApply:(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply)}function requireReflectApply(){return hasRequiredReflectApply?reflectApply:(hasRequiredReflectApply=1,reflectApply="undefined"!=typeof Reflect&&Reflect&&Reflect.apply)}function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireFunctionCall(),i=requireReflectApply();return actualApply=i||e.call(r,t)}function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var e=requireFunctionBind(),t=requireType(),r=requireFunctionCall(),i=requireActualApply();return callBindApplyHelpers=function(n){if(n.length<1||"function"!=typeof n[0])throw new t("a function is required");return i(e,r,n)}}function requireGet(){if(hasRequiredGet)return get$1;hasRequiredGet=1;var e,t=requireCallBindApplyHelpers(),r=requireGopd();try{e=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var i=!!e&&r&&r(Object.prototype,"__proto__"),n=Object,o=n.getPrototypeOf;return get$1=i&&"function"==typeof i.get?t([i.get]):"function"==typeof o&&function(e){return o(null==e?e:n(e))}}function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var e=requireReflect_getPrototypeOf(),t=requireObject_getPrototypeOf(),r=requireGet();return getProto=e?function(t){return e(t)}:t?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return t(e)}:r?function(e){return r(e)}:null}function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=requireFunctionBind();return hasown=r.call(e,t)}function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;var e;hasRequiredGetIntrinsic=1;var t=requireEsObjectAtoms(),r=requireEsErrors(),i=require_eval(),n=requireRange(),o=requireRef(),s=requireSyntax(),a=requireType(),u=requireUri(),h=requireAbs(),f=requireFloor(),l=requireMax(),c=requireMin(),d=requirePow(),p=requireRound(),m=requireSign$1(),g=Function,y=function(e){try{return g('"use strict"; return ('+e+").constructor;")()}catch(e){}},b=requireGopd(),v=requireEsDefineProperty(),w=function(){throw new a},_=b?function(){try{return w}catch(e){try{return b(arguments,"callee").get}catch(e){return w}}}():w,M=requireHasSymbols()(),S=requireGetProto(),E=requireObject_getPrototypeOf(),R=requireReflect_getPrototypeOf(),A=requireFunctionApply(),q=requireFunctionCall(),C={},P="undefined"!=typeof Uint8Array&&S?S(Uint8Array):e,B={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&S?S([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":"undefined"==typeof Atomics?e:Atomics,"%BigInt%":"undefined"==typeof BigInt?e:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?e:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":i,"%Float16Array%":"undefined"==typeof Float16Array?e:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?e:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?e:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?e:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":C,"%Int8Array%":"undefined"==typeof Int8Array?e:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?e:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&S?S(S([][Symbol.iterator]())):e,"%JSON%":"object"==typeof JSON?JSON:e,"%Map%":"undefined"==typeof Map?e:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&M&&S?S((new Map)[Symbol.iterator]()):e,"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?e:Promise,"%Proxy%":"undefined"==typeof Proxy?e:Proxy,"%RangeError%":n,"%ReferenceError%":o,"%Reflect%":"undefined"==typeof Reflect?e:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?e:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&M&&S?S((new Set)[Symbol.iterator]()):e,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&S?S(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":s,"%ThrowTypeError%":_,"%TypedArray%":P,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?e:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?e:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?e:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?e:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?e:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?e:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?e:WeakSet,"%Function.prototype.call%":q,"%Function.prototype.apply%":A,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":E,"%Math.abs%":h,"%Math.floor%":f,"%Math.max%":l,"%Math.min%":c,"%Math.pow%":d,"%Math.round%":p,"%Math.sign%":m,"%Reflect.getPrototypeOf%":R};if(S)try{null.error}catch(e){var I=S(S(e));B["%Error.prototype%"]=I}var O=function e(t){var r;if("%AsyncFunction%"===t)r=y("async function () {}");else if("%GeneratorFunction%"===t)r=y("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=y("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&S&&(r=S(n.prototype))}return B[t]=r,r},k={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},T=requireFunctionBind(),N=requireHasown(),x=T.call(q,Array.prototype.concat),j=T.call(A,Array.prototype.splice),$=T.call(q,String.prototype.replace),D=T.call(q,String.prototype.slice),U=T.call(q,RegExp.prototype.exec),L=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F=/\\(\\)?/g,z=function(e,t){var r,i=e;if(N(k,i)&&(i="%"+(r=k[i])[0]+"%"),N(B,i)){var n=B[i];if(n===C&&(n=O(i)),void 0===n&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new s("intrinsic "+e+" does not exist!")};return getIntrinsic=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,e))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=D(e,0,1),r=D(e,-1);if("%"===t&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new s("invalid intrinsic syntax, expected opening `%`");var i=[];return $(e,L,(function(e,t,r,n){i[i.length]=r?$(n,F,"$1"):t||e})),i}(e),i=r.length>0?r[0]:"",n=z("%"+i+"%",t),o=n.name,u=n.value,h=!1,f=n.alias;f&&(i=f[0],j(r,x([0,1],f)));for(var l=1,c=!0;l<r.length;l+=1){var d=r[l],p=D(d,0,1),m=D(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===m||"'"===m||"`"===m)&&p!==m)throw new s("property names with quotes must have matching quotes");if("constructor"!==d&&c||(h=!0),N(B,o="%"+(i+="."+d)+"%"))u=B[o];else if(null!=u){if(!(d in u)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(b&&l+1>=r.length){var g=b(u,d);u=(c=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:u[d]}else c=N(u,d),u=u[d];c&&!h&&(B[o]=u)}}return u},getIntrinsic}function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var e=requireGetIntrinsic(),t=requireCallBindApplyHelpers(),r=t([e("%String.prototype.indexOf%")]);return callBound=function(i,n){var o=e(i,!!n);return"function"==typeof o&&r(i,".prototype.")>-1?t([o]):o}}function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var e=requireShams()(),t=requireCallBound()("Object.prototype.toString"),r=function(r){return!(e&&r&&"object"==typeof r&&Symbol.toStringTag in r)&&"[object Arguments]"===t(r)},i=function(e){return!!r(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==t(e)&&"callee"in e&&"[object Function]"===t(e.callee)},n=function(){return r(arguments)}();return r.isLegacyArguments=i,isArguments=n?r:i}function requireIsRegex(){if(hasRequiredIsRegex)return isRegex;hasRequiredIsRegex=1;var e,t=requireCallBound(),r=requireShams()(),i=requireHasown(),n=requireGopd();if(r){var o=t("RegExp.prototype.exec"),s={},a=function(){throw s},u={toString:a,valueOf:a};"symbol"==typeof Symbol.toPrimitive&&(u[Symbol.toPrimitive]=a),e=function(e){if(!e||"object"!=typeof e)return!1;var t=n(e,"lastIndex");if(!(t&&i(t,"value")))return!1;try{o(e,u)}catch(e){return e===s}}}else{var h=t("Object.prototype.toString");e=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===h(e)}}return isRegex=e}function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var e=requireCallBound(),t=requireIsRegex(),r=e("RegExp.prototype.exec"),i=requireType();return safeRegexTest=function(e){if(!t(e))throw new i("`regex` must be a RegExp");return function(t){return null!==r(e,t)}}}function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var e,t=requireCallBound(),r=requireSafeRegexTest()(/^\s*(?:function)?\*/),i=requireShams()(),n=requireGetProto(),o=t("Object.prototype.toString"),s=t("Function.prototype.toString");return isGeneratorFunction=function(t){if("function"!=typeof t)return!1;if(r(s(t)))return!0;if(!i)return"[object GeneratorFunction]"===o(t);if(!n)return!1;if(void 0===e){var a=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(e){}}();e=!!a&&n(a)}return n(t)===e}}function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var e,t,r=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw t}}),t={},i((function(){throw 42}),null,e)}catch(e){e!==t&&(i=null)}else i=null;var n=/^\s*class\b/,o=function(e){try{var t=r.call(e);return n.test(t)}catch(e){return!1}},s=function(e){try{return!o(e)&&(r.call(e),!0)}catch(e){return!1}},a=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,h=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var l=document.all;a.call(l)===a.call(document.all)&&(f=function(e){if((h||!e)&&(void 0===e||"object"==typeof e))try{var t=a.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}return isCallable=i?function(r){if(f(r))return!0;if(!r)return!1;if("function"!=typeof r&&"object"!=typeof r)return!1;try{i(r,null,e)}catch(e){if(e!==t)return!1}return!o(r)&&s(r)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(u)return s(e);if(o(e))return!1;var t=a.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}}function requireForEach(){if(hasRequiredForEach)return forEach;hasRequiredForEach=1;var e=requireIsCallable(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty;return forEach=function(i,n,o){if(!e(n))throw new TypeError("iterator must be a function");var s,a;arguments.length>=3&&(s=o),a=i,"[object Array]"===t.call(a)?function(e,t,i){for(var n=0,o=e.length;n<o;n++)r.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))}(i,n,s):"string"==typeof i?function(e,t,r){for(var i=0,n=e.length;i<n;i++)null==r?t(e.charAt(i),i,e):t.call(r,e.charAt(i),i,e)}(i,n,s):function(e,t,i){for(var n in e)r.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))}(i,n,s)},forEach}function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames?possibleTypedArrayNames:(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"])}function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var e=requirePossibleTypedArrayNames(),t="undefined"==typeof globalThis?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var r=[],i=0;i<e.length;i++)"function"==typeof t[e[i]]&&(r[r.length]=e[i]);return r}}var callBind={exports:{}},defineDataProperty,hasRequiredDefineDataProperty,hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors,setFunctionLength,hasRequiredSetFunctionLength,applyBind,hasRequiredApplyBind,hasRequiredCallBind,whichTypedArray,hasRequiredWhichTypedArray,isTypedArray,hasRequiredIsTypedArray,hasRequiredTypes,isBufferBrowser,hasRequiredIsBufferBrowser,hasRequiredUtil$1,buffer_list,hasRequiredBuffer_list,destroy_1$1,hasRequiredDestroy$1;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var e=requireEsDefineProperty(),t=requireSyntax(),r=requireType(),i=requireGopd();return defineDataProperty=function(n,o,s){if(!n||"object"!=typeof n&&"function"!=typeof n)throw new r("`obj` must be an object or a function`");if("string"!=typeof o&&"symbol"!=typeof o)throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new r("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,f=arguments.length>6&&arguments[6],l=!!i&&i(n,o);if(e)e(n,o,{configurable:null===h&&l?l.configurable:!h,enumerable:null===a&&l?l.enumerable:!a,value:s,writable:null===u&&l?l.writable:!u});else{if(!f&&(a||u||h))throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");n[o]=s}},defineDataProperty}function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var e=requireEsDefineProperty(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return 1!==e([],"length",{value:1}).length}catch(e){return!0}},hasPropertyDescriptors_1=t}function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var e=requireGetIntrinsic(),t=requireDefineDataProperty(),r=requireHasPropertyDescriptors()(),i=requireGopd(),n=requireType(),o=e("%Math.floor%");return setFunctionLength=function(e,s){if("function"!=typeof e)throw new n("`fn` is not a function");if("number"!=typeof s||s<0||s>4294967295||o(s)!==s)throw new n("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],u=!0,h=!0;if("length"in e&&i){var f=i(e,"length");f&&!f.configurable&&(u=!1),f&&!f.writable&&(h=!1)}return(u||h||!a)&&(r?t(e,"length",s,!0,!0):t(e,"length",s)),e},setFunctionLength}function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var e=requireFunctionBind(),t=requireFunctionApply(),r=requireActualApply();return applyBind=function(){return r(e,t,arguments)},applyBind}function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,e=callBind,t=requireSetFunctionLength(),r=requireEsDefineProperty(),i=requireCallBindApplyHelpers(),n=requireApplyBind(),e.exports=function(e){var r=i(arguments),n=e.length-(arguments.length-1);return t(r,1+(n>0?n:0),!0)},r?r(e.exports,"apply",{value:n}):e.exports.apply=n),callBind.exports;var e,t,r,i,n}function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var e=requireForEach(),t=requireAvailableTypedArrays(),r=requireCallBind(),i=requireCallBound(),n=requireGopd(),o=requireGetProto(),s=i("Object.prototype.toString"),a=requireShams()(),u="undefined"==typeof globalThis?commonjsGlobal:globalThis,h=t(),f=i("String.prototype.slice"),l=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},c={__proto__:null};e(h,a&&n&&o?function(e){var t=new u[e];if(Symbol.toStringTag in t&&o){var i=o(t),s=n(i,Symbol.toStringTag);if(!s&&i){var a=o(i);s=n(a,Symbol.toStringTag)}c["$"+e]=r(s.get)}}:function(e){var t=new u[e],i=t.slice||t.set;i&&(c["$"+e]=r(i))});return whichTypedArray=function(t){if(!t||"object"!=typeof t)return!1;if(!a){var r=f(s(t),8,-1);return l(h,r)>-1?r:"Object"===r&&function(t){var r=!1;return e(c,(function(e,i){if(!r)try{e(t),r=f(i,1)}catch(e){}})),r}(t)}return n?function(t){var r=!1;return e(c,(function(e,i){if(!r)try{"$"+e(t)===i&&(r=f(i,1))}catch(e){}})),r}(t):null}}function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray;hasRequiredIsTypedArray=1;var e=requireWhichTypedArray();return isTypedArray=function(t){return!!e(t)}}function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(e){var t=requireIsArguments(),r=requireIsGeneratorFunction(),i=requireWhichTypedArray(),n=requireIsTypedArray();function o(e){return e.call.bind(e)}var s="undefined"!=typeof BigInt,a="undefined"!=typeof Symbol,u=o(Object.prototype.toString),h=o(Number.prototype.valueOf),f=o(String.prototype.valueOf),l=o(Boolean.prototype.valueOf);if(s)var c=o(BigInt.prototype.valueOf);if(a)var d=o(Symbol.prototype.valueOf);function p(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===u(e)}function g(e){return"[object Set]"===u(e)}function y(e){return"[object WeakMap]"===u(e)}function b(e){return"[object WeakSet]"===u(e)}function v(e){return"[object ArrayBuffer]"===u(e)}function w(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===u(e)}function M(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=n,e.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},e.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):n(e)||M(e)},e.isUint8Array=function(e){return"Uint8Array"===i(e)},e.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},e.isUint16Array=function(e){return"Uint16Array"===i(e)},e.isUint32Array=function(e){return"Uint32Array"===i(e)},e.isInt8Array=function(e){return"Int8Array"===i(e)},e.isInt16Array=function(e){return"Int16Array"===i(e)},e.isInt32Array=function(e){return"Int32Array"===i(e)},e.isFloat32Array=function(e){return"Float32Array"===i(e)},e.isFloat64Array=function(e){return"Float64Array"===i(e)},e.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},e.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),e.isSet=function(e){return"undefined"!=typeof Set&&(g.working?g(e):e instanceof Set)},y.working="undefined"!=typeof WeakMap&&y(new WeakMap),e.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},b.working="undefined"!=typeof WeakSet&&b(new WeakSet),e.isWeakSet=function(e){return b(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),e.isArrayBuffer=w,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=M;var S="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function E(e){return"[object SharedArrayBuffer]"===u(e)}function R(e){return void 0!==S&&(void 0===E.working&&(E.working=E(new S)),E.working?E(e):e instanceof S)}function A(e){return p(e,h)}function q(e){return p(e,f)}function C(e){return p(e,l)}function P(e){return s&&p(e,c)}function B(e){return a&&p(e,d)}e.isSharedArrayBuffer=R,e.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},e.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},e.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},e.isGeneratorObject=function(e){return"[object Generator]"===u(e)},e.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},e.isNumberObject=A,e.isStringObject=q,e.isBooleanObject=C,e.isBigIntObject=P,e.isSymbolObject=B,e.isBoxedPrimitive=function(e){return A(e)||q(e)||C(e)||P(e)||B(e)},e.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(w(e)||R(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))}(types)),types}function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser?isBufferBrowser:(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8})}function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,function(e){var t={},r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},i=0;i<t.length;i++)r[t[i]]=Object.getOwnPropertyDescriptor(e,t[i]);return r},i=/%[sdj%]/g;e.format=function(e){if(!y(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(a(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),u=n[r];r<o;u=n[++r])m(u)||!w(u)?s+=" "+u:s+=" "+a(u);return s},e.deprecate=function(t,r){if(void 0!==process$1&&!0===process$1.noDeprecation)return t;if(void 0===process$1)return function(){return e.deprecate(t,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(process$1.throwDeprecation)throw new Error(r);process$1.traceDeprecation?console.trace(r):console.error(r),i=!0}return t.apply(this,arguments)}};var n={},o=/^$/;if(t.NODE_DEBUG){var s=t.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+s+"$","i")}function a(t,r){var i={seen:[],stylize:h};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),p(r)?i.showHidden=r:r&&e._extend(i,r),b(i.showHidden)&&(i.showHidden=!1),b(i.depth)&&(i.depth=2),b(i.colors)&&(i.colors=!1),b(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=u),f(i,t,i.depth)}function u(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function h(e,t){return e}function f(t,r,i){if(t.customInspect&&r&&S(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(i,t);return y(n)||(n=f(t,n,i)),n}var o=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"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")}(t,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),M(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(S(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(v(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return t.stylize(Date.prototype.toString.call(r),"date");if(M(r))return l(r)}var h,w="",E=!1,R=["{","}"];(d(r)&&(E=!0,R=["[","]"]),S(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return v(r)&&(w=" "+RegExp.prototype.toString.call(r)),_(r)&&(w=" "+Date.prototype.toUTCString.call(r)),M(r)&&(w=" "+l(r)),0!==s.length||E&&0!=r.length?i<0?v(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),h=E?function(e,t,r,i,n){for(var o=[],s=0,a=t.length;s<a;++s)q(t,String(s))?o.push(c(e,t,r,i,String(s),!0)):o.push("");return n.forEach((function(n){n.match(/^\d+$/)||o.push(c(e,t,r,i,n,!0))})),o}(t,r,i,a,s):s.map((function(e){return c(t,r,i,a,e,E)})),t.seen.pop(),function(e,t,r){var i=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(i>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(h,w,R)):R[0]+w+R[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,r,i,n,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),q(i,n)||(s="["+n+"]"),a||(e.seen.indexOf(u.value)<0?(a=m(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),b(s)){if(o&&n.match(/^\d+$/))return a;(s=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}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 y(e){return"string"==typeof e}function b(e){return void 0===e}function v(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function _(e){return w(e)&&"[object Date]"===E(e)}function M(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function R(e){return e<10?"0"+e.toString(10):e.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!n[t])if(o.test(t)){var r=process$1.pid;n[t]=function(){var i=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,i)}}else n[t]=function(){};return n[t]},e.inspect=a,a.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]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=requireTypes(),e.isArray=d,e.isBoolean=p,e.isNull=m,e.isNullOrUndefined=function(e){return null==e},e.isNumber=g,e.isString=y,e.isSymbol=function(e){return"symbol"==typeof e},e.isUndefined=b,e.isRegExp=v,e.types.isRegExp=v,e.isObject=w,e.isDate=_,e.types.isDate=_,e.isError=M,e.types.isNativeError=M,e.isFunction=S,e.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},e.isBuffer=requireIsBufferBrowser();var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){var t,r;console.log("%s - %s",(r=[R((t=new Date).getHours()),R(t.getMinutes()),R(t.getSeconds())].join(":"),[t.getDate(),A[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=requireInherits_browser(),e._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e};var C="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}e.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(C&&e[C]){var t;if("function"!=typeof(t=e[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,i=new Promise((function(e,i){t=e,r=i})),n=[],o=0;o<arguments.length;o++)n.push(arguments[o]);n.push((function(e,i){e?r(e):t(i)}));try{e.apply(this,n)}catch(e){r(e)}return i}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),C&&Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,r(e))},e.promisify.custom=C,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var n=this,o=function(){return i.apply(n,arguments)};e.apply(this,t).then((function(e){process$1.nextTick(o.bind(null,null,e))}),(function(e){process$1.nextTick(P.bind(null,e,o))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,r(e)),t}}(util$1)),util$1}function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function t(t){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?e(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function n(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}hasRequiredBuffer_list=1;var o=requireDist().Buffer,s=requireUtil$1().inspect,a=s&&s.custom||"inspect";return buffer_list=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return i(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,i,n=o.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,r=n,i=a,o.prototype.copy.call(t,r,i),a+=s.data.length,s=s.next;return n}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,i=t.data;for(e-=i.length;t=t.next;){var n=t.data,o=e>n.length?n.length:e;if(o===n.length?i+=n:i+=n.slice(0,e),0===(e-=o)){o===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(o));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,s=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,s),0===(e-=s)){s===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(s));break}++i}return this.length-=i,t}},{key:a,value:function(e,r){return s(this,t(t({},r),{},{depth:0,customInspect:!1}))}}]),e}()}function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$1;function e(e,i){r(e,i),t(e)}function t(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}return hasRequiredDestroy$1=1,destroy_1$1={destroy:function(i,n){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(n?n(i):i&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1.nextTick(r,this,i)):process$1.nextTick(r,this,i)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(i||null,(function(r){!n&&r?o._writableState?o._writableState.errorEmitted?process$1.nextTick(t,o):(o._writableState.errorEmitted=!0,process$1.nextTick(e,o,r)):process$1.nextTick(e,o,r):n?(process$1.nextTick(t,o),n(r)):process$1.nextTick(t,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}}}var errorsBrowser={},hasRequiredErrorsBrowser,state,hasRequiredState,browser$d,hasRequiredBrowser$c,_stream_writable$1,hasRequired_stream_writable$1,_stream_duplex$1,hasRequired_stream_duplex$1;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;var e={};function t(t,r,i){i||(i=Error);var n=function(e){var t,i;function n(t,i,n){return e.call(this,function(e,t,i){return"string"==typeof r?r:r(e,t,i)}(t,i,n))||this}return i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i,n}(i);n.prototype.name=i.name,n.prototype.code=t,e[t]=n}function r(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}return t("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),t("ERR_INVALID_ARG_TYPE",(function(e,t,i){var n,o,s;if("string"==typeof t&&(o="not ",t.substr(0,o.length)===o)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(r(t,"type"));else{var a=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(a," ").concat(n," ").concat(r(t,"type"))}return s+=". Received type ".concat(typeof i)}),TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=e,errorsBrowser}function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var e=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;return state={getHighWaterMark:function(t,r,i,n){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(r,n,i);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new e(n?i:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}}function requireBrowser$c(){if(hasRequiredBrowser$c)return browser$d;function e(e){try{if(!commonjsGlobal.localStorage)return!1}catch(e){return!1}var t=commonjsGlobal.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}return hasRequiredBrowser$c=1,browser$d=function(t,r){if(e("noDeprecation"))return t;var i=!1;return function(){if(!i){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return t.apply(this,arguments)}},browser$d}function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;function e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var i=e.entry;e.entry=null;for(;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}(t,e)}}var t;hasRequired_stream_writable$1=1,_stream_writable$1=_,_.WritableState=w;var r={deprecate:requireBrowser$c()},i=requireStreamBrowser$1(),n=requireDist().Buffer,o=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var s,a=requireDestroy$1(),u=requireState().getHighWaterMark,h=requireErrorsBrowser().codes,f=h.ERR_INVALID_ARG_TYPE,l=h.ERR_METHOD_NOT_IMPLEMENTED,c=h.ERR_MULTIPLE_CALLBACK,d=h.ERR_STREAM_CANNOT_PIPE,p=h.ERR_STREAM_DESTROYED,m=h.ERR_STREAM_NULL_VALUES,g=h.ERR_STREAM_WRITE_AFTER_END,y=h.ERR_UNKNOWN_ENCODING,b=a.errorOrDestroy;function v(){}function w(r,i,n){t=t||require_stream_duplex$1(),r=r||{},"boolean"!=typeof n&&(n=i instanceof t),this.objectMode=!!r.objectMode,n&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=u(this,r,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===r.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=r.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 r=e._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new c;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,n){--t.pendingcb,r?(process$1.nextTick(n,i),process$1.nextTick(q,e,t),e._writableState.errorEmitted=!0,b(e,i)):(n(i),e._writableState.errorEmitted=!0,b(e,i),q(e,t))}(e,r,i,t,n);else{var o=R(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||E(e,r),i?process$1.nextTick(S,e,r,o,n):S(e,r,o,n)}}(i,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==r.emitClose,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function _(e){var r=this instanceof(t=t||require_stream_duplex$1());if(!r&&!s.call(_,this))return new _(e);this._writableState=new w(e,this,r),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)),i.call(this)}function M(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new p("write")):r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function S(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),q(e,t)}function E(t,r){r.bufferProcessing=!0;var i=r.bufferedRequest;if(t._writev&&i&&i.next){var n=r.bufferedRequestCount,o=new Array(n),s=r.corkedRequestsFree;s.entry=i;for(var a=0,u=!0;i;)o[a]=i,i.isBuf||(u=!1),i=i.next,a+=1;o.allBuffers=u,M(t,r,!0,r.length,o,"",s.finish),r.pendingcb++,r.lastBufferedRequest=null,s.next?(r.corkedRequestsFree=s.next,s.next=null):r.corkedRequestsFree=new e(r),r.bufferedRequestCount=0}else{for(;i;){var h=i.chunk,f=i.encoding,l=i.callback;if(M(t,r,!1,r.objectMode?1:h.length,h,f,l),i=i.next,r.bufferedRequestCount--,r.writing)break}null===i&&(r.lastBufferedRequest=null)}r.bufferedRequest=i,r.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(r){t.pendingcb--,r&&b(e,r),t.prefinished=!0,e.emit("prefinish"),q(e,t)}))}function q(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process$1.nextTick(A,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}return requireInherits_browser()(_,i),w.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(w.prototype,"buffer",{get:r.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]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===_&&(e&&e._writableState instanceof w)}})):s=function(e){return e instanceof this},_.prototype.pipe=function(){b(this,new d)},_.prototype.write=function(e,t,r){var i,s=this._writableState,a=!1,u=!s.objectMode&&(i=e,n.isBuffer(i)||i instanceof o);return u&&!n.isBuffer(e)&&(e=function(e){return n.from(e)}(e)),"function"==typeof t&&(r=t,t=null),u?t="buffer":t||(t=s.defaultEncoding),"function"!=typeof r&&(r=v),s.ending?function(e,t){var r=new g;b(e,r),process$1.nextTick(t,r)}(this,r):(u||function(e,t,r,i){var n;return null===r?n=new m:"string"==typeof r||t.objectMode||(n=new f("chunk",["string","Buffer"],r)),!n||(b(e,n),process$1.nextTick(i,n),!1)}(this,s,e,r))&&(s.pendingcb++,a=function(e,t,r,i,o,s){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=n.from(t,r));return t}(t,i,o);i!==a&&(r=!0,o="buffer",i=a)}var u=t.objectMode?1:i.length;t.length+=u;var h=t.length<t.highWaterMark;h||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:o,isBuf:r,callback:s,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else M(e,t,!1,u,i,o,s);return h}(this,s,u,e,t,r)),a},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||E(this,e))},_.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new y(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(e,t,r){r(new l("_write()"))},_.prototype._writev=null,_.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,q(e,t),r&&(t.finished?process$1.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),_.prototype.destroy=a.destroy,_.prototype._undestroy=a.undestroy,_.prototype._destroy=function(e,t){t(e)},_stream_writable$1}function require_stream_duplex$1(){if(hasRequired_stream_duplex$1)return _stream_duplex$1;hasRequired_stream_duplex$1=1;var e=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};_stream_duplex$1=s;var t=require_stream_readable$1(),r=require_stream_writable$1();requireInherits_browser()(s,t);for(var i=e(r.prototype),n=0;n<i.length;n++){var o=i[n];s.prototype[o]||(s.prototype[o]=r.prototype[o])}function s(e){if(!(this instanceof s))return new s(e);t.call(this,e),r.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||process$1.nextTick(u,this)}function u(e){e.end()}return Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),_stream_duplex$1}var string_decoder={},safeBuffer$a={exports:{}},hasRequiredSafeBuffer$a,hasRequiredString_decoder,endOfStream,hasRequiredEndOfStream,async_iterator,hasRequiredAsync_iterator,fromBrowser,hasRequiredFromBrowser,_stream_readable$1,hasRequired_stream_readable$1,_stream_transform$1,hasRequired_stream_transform$1,_stream_passthrough$1,hasRequired_stream_passthrough$1,pipeline_1,hasRequiredPipeline,streamBrowserify,hasRequiredStreamBrowserify;function requireSafeBuffer$a(){return hasRequiredSafeBuffer$a||(hasRequiredSafeBuffer$a=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$a,safeBuffer$a.exports)),safeBuffer$a.exports}function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var e=requireSafeBuffer$a().Buffer,t=e.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var i;switch(this.encoding=function(r){var i=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(r);if("string"!=typeof i&&(e.isEncoding===t||!t(r)))throw new Error("Unknown encoding: "+r);return i||r}(r),this.encoding){case"utf16le":this.text=o,this.end=s,i=4;break;case"utf8":this.fillLast=n,i=4;break;case"base64":this.text=a,this.end=u,i=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(i)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function n(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r: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 o(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function a(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function u(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 f(e){return e&&e.length?this.write(e):""}return string_decoder.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=i(t[n]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if(o=i(t[n]),o>=0)return o>0&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if(o=i(t[n]),o>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},r.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},string_decoder}function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var e=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function t(){}return endOfStream=function r(i,n,o){if("function"==typeof n)return r(i,null,n);n||(n={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}(o||t);var s=n.readable||!1!==n.readable&&i.readable,a=n.writable||!1!==n.writable&&i.writable,u=function(){i.writable||f()},h=i._writableState&&i._writableState.finished,f=function(){a=!1,h=!0,s||o.call(i)},l=i._readableState&&i._readableState.endEmitted,c=function(){s=!1,l=!0,a||o.call(i)},d=function(e){o.call(i,e)},p=function(){var t;return s&&!l?(i._readableState&&i._readableState.ended||(t=new e),o.call(i,t)):a&&!h?(i._writableState&&i._writableState.ended||(t=new e),o.call(i,t)):void 0},m=function(){i.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(i)?a&&!i._writableState&&(i.on("end",u),i.on("close",u)):(i.on("complete",f),i.on("abort",p),i.req?m():i.on("request",m)),i.on("end",c),i.on("finish",f),!1!==n.error&&i.on("error",d),i.on("close",p),function(){i.removeListener("complete",f),i.removeListener("abort",p),i.removeListener("request",m),i.req&&i.req.removeListener("finish",f),i.removeListener("end",u),i.removeListener("close",u),i.removeListener("finish",f),i.removeListener("end",c),i.removeListener("error",d),i.removeListener("close",p)}},endOfStream}function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;var e;function t(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hasRequiredAsync_iterator=1;var r=requireEndOfStream(),i=Symbol("lastResolve"),n=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),a=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function f(e,t){return{value:e,done:t}}function l(e){var t=e[i];if(null!==t){var r=e[h].read();null!==r&&(e[a]=null,e[i]=null,e[n]=null,t(f(r,!1)))}}function c(e){process$1.nextTick(l,e)}var d=Object.getPrototypeOf((function(){})),p=Object.setPrototypeOf((t(e={get stream(){return this[h]},next:function(){var e=this,t=this[o];if(null!==t)return Promise.reject(t);if(this[s])return Promise.resolve(f(void 0,!0));if(this[h].destroyed)return new Promise((function(t,r){process$1.nextTick((function(){e[o]?r(e[o]):t(f(void 0,!0))}))}));var r,i=this[a];if(i)r=new Promise(function(e,t){return function(r,i){e.then((function(){t[s]?r(f(void 0,!0)):t[u](r,i)}),i)}}(i,this));else{var n=this[h].read();if(null!==n)return Promise.resolve(f(n,!1));r=new Promise(this[u])}return this[a]=r,r}},Symbol.asyncIterator,(function(){return this})),t(e,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(f(void 0,!0))}))}))})),e),d);return async_iterator=function(e){var l,d=Object.create(p,(t(l={},h,{value:e,writable:!0}),t(l,i,{value:null,writable:!0}),t(l,n,{value:null,writable:!0}),t(l,o,{value:null,writable:!0}),t(l,s,{value:e._readableState.endEmitted,writable:!0}),t(l,u,{value:function(e,t){var r=d[h].read();r?(d[a]=null,d[i]=null,d[n]=null,e(f(r,!1))):(d[i]=e,d[n]=t)},writable:!0}),l));return d[a]=null,r(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=d[n];return null!==t&&(d[a]=null,d[i]=null,d[n]=null,t(e)),void(d[o]=e)}var r=d[i];null!==r&&(d[a]=null,d[i]=null,d[n]=null,r(f(void 0,!0))),d[s]=!0})),e.on("readable",c.bind(null,d)),d}}function requireFromBrowser(){return hasRequiredFromBrowser?fromBrowser:(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")})}function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;var e;hasRequired_stream_readable$1=1,_stream_readable$1=_,_.ReadableState=w,requireEvents().EventEmitter;var t=function(e,t){return e.listeners(t).length},r=requireStreamBrowser$1(),i=requireDist().Buffer,n=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var o,s=requireUtil$1();o=s&&s.debuglog?s.debuglog("stream"):function(){};var a,u,h,f=requireBuffer_list(),l=requireDestroy$1(),c=requireState().getHighWaterMark,d=requireErrorsBrowser().codes,p=d.ERR_INVALID_ARG_TYPE,m=d.ERR_STREAM_PUSH_AFTER_EOF,g=d.ERR_METHOD_NOT_IMPLEMENTED,y=d.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;requireInherits_browser()(_,r);var b=l.errorOrDestroy,v=["error","close","destroy","pause","resume"];function w(t,r,i){e=e||require_stream_duplex$1(),t=t||{},"boolean"!=typeof i&&(i=r instanceof e),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=c(this,t,"readableHighWaterMark",i),this.buffer=new f,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!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(a||(a=requireString_decoder().StringDecoder),this.decoder=new a(t.encoding),this.encoding=t.encoding)}function _(t){if(e=e||require_stream_duplex$1(),!(this instanceof _))return new _(t);var i=this instanceof e;this._readableState=new w(t,this,i),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),r.call(this)}function M(e,t,r,s,a){o("readableAddChunk",t);var u,h=e._readableState;if(null===t)h.reading=!1,function(e,t){if(o("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,q(e)))}(e,h);else if(a||(u=function(e,t){var r;o=t,i.isBuffer(o)||o instanceof n||"string"==typeof t||void 0===t||e.objectMode||(r=new p("chunk",["string","Buffer","Uint8Array"],t));var o;return r}(h,t)),u)b(e,u);else if(h.objectMode||t&&t.length>0)if("string"==typeof t||h.objectMode||Object.getPrototypeOf(t)===i.prototype||(t=function(e){return i.from(e)}(t)),s)h.endEmitted?b(e,new y):S(e,h,t,!0);else if(h.ended)b(e,new m);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(t=h.decoder.write(t),h.objectMode||0!==t.length?S(e,h,t,!1):C(e,h)):S(e,h,t,!1)}else s||(h.reading=!1,C(e,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function S(e,t,r,i){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&A(e)),C(e,t)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=l.destroy,_.prototype._undestroy=l.undestroy,_.prototype._destroy=function(e,t){t(e)},_.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=i.from(e,t),t=""),r=!0),M(this,e,t,!1,r)},_.prototype.unshift=function(e){return M(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){a||(a=requireString_decoder().StringDecoder);var t=new a(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var E=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=E?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 A(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,process$1.nextTick(q,e))}function q(e){var t=e._readableState;o("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,k(e)}function C(e,t){t.readingMore||(t.readingMore=!0,process$1.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function B(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){o("readable nexttick read 0"),e.read(0)}function O(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),k(e),t.flowing&&!t.reading&&e.read(0)}function k(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function N(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process$1.nextTick(x,t,e))}function x(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function j(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}return _.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):A(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&N(this),null;var i,n=t.needReadable;return o("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",n=!0),t.ended||t.reading?o("reading or ended",n=!1):n&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(i=e>0?T(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),r!==e&&t.ended&&N(this)),null!==i&&this.emit("data",i),i},_.prototype._read=function(e){b(this,new g("_read()"))},_.prototype.pipe=function(e,r){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,r);var s=(!r||!1!==r.end)&&e!==process$1.stdout&&e!==process$1.stderr?u:m;function a(t,r){o("onunpipe"),t===i&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",h),e.removeListener("error",c),e.removeListener("unpipe",a),i.removeListener("end",u),i.removeListener("end",m),i.removeListener("data",l),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function u(){o("onend"),e.end()}n.endEmitted?process$1.nextTick(s):i.once("end",s),e.on("unpipe",a);var h=function(e){return function(){var r=e._readableState;o("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&t(e,"data")&&(r.flowing=!0,k(e))}}(i);e.on("drain",h);var f=!1;function l(t){o("ondata");var r=e.write(t);o("dest.write",r),!1===r&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==j(n.pipes,e))&&!f&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),i.pause())}function c(r){o("onerror",r),m(),e.removeListener("error",c),0===t(e,"error")&&b(e,r)}function d(){e.removeListener("finish",p),m()}function p(){o("onfinish"),e.removeListener("close",d),m()}function m(){o("unpipe"),i.unpipe(e)}return i.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",d),e.once("finish",p),e.emit("pipe",i),n.flowing||(o("pipe resume"),i.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=j(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},_.prototype.on=function(e,t){var i=r.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?A(this):n.reading||process$1.nextTick(I,this))),i},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(e,t){var i=r.prototype.removeListener.call(this,e,t);return"readable"===e&&process$1.nextTick(B,this),i},_.prototype.removeAllListeners=function(e){var t=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process$1.nextTick(B,this),t},_.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process$1.nextTick(O,e,t))}(this,e)),e.paused=!1,this},_.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var n in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(o("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(i=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var s=0;s<v.length;s++)e.on(v[s],this.emit.bind(this,v[s]));return this._read=function(t){o("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"==typeof Symbol&&(_.prototype[Symbol.asyncIterator]=function(){return void 0===u&&(u=requireAsync_iterator()),u(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),_._fromList=T,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(_.from=function(e,t){return void 0===h&&(h=requireFromBrowser()),h(_,e,t)}),_stream_readable$1}function require_stream_transform$1(){if(hasRequired_stream_transform$1)return _stream_transform$1;hasRequired_stream_transform$1=1,_stream_transform$1=a;var e=requireErrorsBrowser().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,r=e.ERR_MULTIPLE_CALLBACK,i=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,n=e.ERR_TRANSFORM_WITH_LENGTH_0,o=require_stream_duplex$1();function s(e,t){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(null===n)return this.emit("error",new r);i.writechunk=null,i.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);o.call(this,e),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function u(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new n;if(e._transformState.transforming)throw new i;return e.push(null)}return requireInherits_browser()(a,o),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,o.prototype.push.call(this,e,t)},a.prototype._transform=function(e,r,i){i(new t("_transform()"))},a.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},a.prototype._destroy=function(e,t){o.prototype._destroy.call(this,e,(function(e){t(e)}))},_stream_transform$1}function require_stream_passthrough$1(){if(hasRequired_stream_passthrough$1)return _stream_passthrough$1;hasRequired_stream_passthrough$1=1,_stream_passthrough$1=t;var e=require_stream_transform$1();function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return requireInherits_browser()(t,e),t.prototype._transform=function(e,t,r){r(null,e)},_stream_passthrough$1}function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;var e;hasRequiredPipeline=1;var t=requireErrorsBrowser().codes,r=t.ERR_MISSING_ARGS,i=t.ERR_STREAM_DESTROYED;function n(e){if(e)throw e}function o(e){e()}function s(e,t){return e.pipe(t)}return pipeline_1=function(){for(var t=arguments.length,a=new Array(t),u=0;u<t;u++)a[u]=arguments[u];var h,f=function(e){return e.length?"function"!=typeof e[e.length-1]?n:e.pop():n}(a);if(Array.isArray(a[0])&&(a=a[0]),a.length<2)throw new r("streams");var l=a.map((function(t,r){var n=r<a.length-1;return function(t,r,n,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;t.on("close",(function(){s=!0})),void 0===e&&(e=requireEndOfStream()),e(t,{readable:r,writable:n},(function(e){if(e)return o(e);s=!0,o()}));var a=!1;return function(e){if(!s&&!a)return a=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new i("pipe"))}}(t,n,r>0,(function(e){h||(h=e),e&&l.forEach(o),n||(l.forEach(o),f(h))}))}));return a.reduce(s)},pipeline_1}function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=t;var e=requireEvents().EventEmitter;function t(){e.call(this)}return requireInherits_browser()(t,e),t.Readable=require_stream_readable$1(),t.Writable=require_stream_writable$1(),t.Duplex=require_stream_duplex$1(),t.Transform=require_stream_transform$1(),t.PassThrough=require_stream_passthrough$1(),t.finished=requireEndOfStream(),t.pipeline=requirePipeline(),t.Stream=t,t.prototype.pipe=function(t,r){var i=this;function n(e){t.writable&&!1===t.write(e)&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}i.on("data",n),t.on("drain",o),t._isStdio||r&&!1===r.end||(i.on("end",a),i.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function h(t){if(f(),0===e.listenerCount(this,"error"))throw t}function f(){i.removeListener("data",n),t.removeListener("drain",o),i.removeListener("end",a),i.removeListener("close",u),i.removeListener("error",h),t.removeListener("error",h),i.removeListener("end",f),i.removeListener("close",f),t.removeListener("close",f)}return i.on("error",h),t.on("error",h),i.on("end",f),i.on("close",f),t.on("close",f),t.emit("pipe",i),t},streamBrowserify}requireStreamBrowserify();const _ParseError=class extends Error{constructor(e,t){super(t),this.code=e;let r=t;CoreManager.get("PARSE_ERRORS").forEach((t=>{t.code===e&&t.code&&(r=t.message)})),Object.defineProperty(this,"message",{enumerable:!0,value:r})}toString(){return"ParseError: "+this.code+" "+this.message}};_ParseError.OTHER_CAUSE=-1,_ParseError.INTERNAL_SERVER_ERROR=1,_ParseError.CONNECTION_FAILED=100,_ParseError.OBJECT_NOT_FOUND=101,_ParseError.INVALID_QUERY=102,_ParseError.INVALID_CLASS_NAME=103,_ParseError.MISSING_OBJECT_ID=104,_ParseError.INVALID_KEY_NAME=105,_ParseError.INVALID_POINTER=106,_ParseError.INVALID_JSON=107,_ParseError.COMMAND_UNAVAILABLE=108,_ParseError.NOT_INITIALIZED=109,_ParseError.INCORRECT_TYPE=111,_ParseError.INVALID_CHANNEL_NAME=112,_ParseError.PUSH_MISCONFIGURED=115,_ParseError.OBJECT_TOO_LARGE=116,_ParseError.OPERATION_FORBIDDEN=119,_ParseError.CACHE_MISS=120,_ParseError.INVALID_NESTED_KEY=121,_ParseError.INVALID_FILE_NAME=122,_ParseError.INVALID_ACL=123,_ParseError.TIMEOUT=124,_ParseError.INVALID_EMAIL_ADDRESS=125,_ParseError.MISSING_CONTENT_TYPE=126,_ParseError.MISSING_CONTENT_LENGTH=127,_ParseError.INVALID_CONTENT_LENGTH=128,_ParseError.FILE_TOO_LARGE=129,_ParseError.FILE_SAVE_ERROR=130,_ParseError.DUPLICATE_VALUE=137,_ParseError.INVALID_ROLE_NAME=139,_ParseError.EXCEEDED_QUOTA=140,_ParseError.SCRIPT_FAILED=141,_ParseError.VALIDATION_ERROR=142,_ParseError.INVALID_IMAGE_DATA=143,_ParseError.UNSAVED_FILE_ERROR=151,_ParseError.INVALID_PUSH_TIME_ERROR=152,_ParseError.FILE_DELETE_ERROR=153,_ParseError.FILE_DELETE_UNNAMED_ERROR=161,_ParseError.REQUEST_LIMIT_EXCEEDED=155,_ParseError.DUPLICATE_REQUEST=159,_ParseError.INVALID_EVENT_NAME=160,_ParseError.INVALID_VALUE=162,_ParseError.USERNAME_MISSING=200,_ParseError.PASSWORD_MISSING=201,_ParseError.USERNAME_TAKEN=202,_ParseError.EMAIL_TAKEN=203,_ParseError.EMAIL_MISSING=204,_ParseError.EMAIL_NOT_FOUND=205,_ParseError.SESSION_MISSING=206,_ParseError.MUST_CREATE_USER_THROUGH_SIGNUP=207,_ParseError.ACCOUNT_ALREADY_LINKED=208,_ParseError.INVALID_SESSION_TOKEN=209,_ParseError.MFA_ERROR=210,_ParseError.MFA_TOKEN_REQUIRED=211,_ParseError.LINKED_ID_MISSING=250,_ParseError.INVALID_LINKED_SESSION=251,_ParseError.UNSUPPORTED_SERVICE=252,_ParseError.INVALID_SCHEMA_OPERATION=255,_ParseError.AGGREGATE_ERROR=600,_ParseError.FILE_READ_ERROR=601,_ParseError.X_DOMAIN_REQUEST=602;let ParseError=_ParseError,NodeReadable;function b64Digit(e){if(e<26)return String.fromCharCode(65+e);if(e<52)return String.fromCharCode(e-26+97);if(e<62)return String.fromCharCode(e-52+48);if(62===e)return"+";if(63===e)return"/";throw new TypeError("Tried to encode large digit "+e+" in base64.")}class ParseFile{constructor(e,t,r,i,n){const o=r||"";if(this._name=e,this._metadata=i||{},this._tags=n||{},void 0!==t)if(void 0!==Buffer&&Buffer.isBuffer(t))this._source={format:"buffer",buffer:t,type:o};else if(null!==t&&"object"==typeof t&&"function"==typeof t.pipe&&"function"==typeof t.read)this._source={format:"stream",stream:t,type:o};else if("undefined"!=typeof ReadableStream&&t instanceof ReadableStream)this._source={format:"stream",stream:t,type:o};else if(Array.isArray(t)||t instanceof Uint8Array)this._data=ParseFile.encodeBase64(t),this._source={format:"base64",base64:this._data,type:o};else if("undefined"!=typeof Blob&&t instanceof Blob)this._source={format:"file",file:t,type:o};else if(t&&"string"==typeof t.uri&&void 0!==t.uri)this._source={format:"uri",uri:t.uri,type:o};else{if(!t||"string"!=typeof t.base64)throw new TypeError("Cannot create a Parse.File with that data.");{const e=t.base64.split(",").slice(-1)[0],r=o||t.base64.split(";").slice(0,1)[0].split(":").slice(1,2)[0]||"text/plain";this._data=e,this._source={format:"base64",base64:e,type:r}}}}async getData(e){if(e=e||{},this._data)return this._data;if("buffer"===this._source?.format)return this._data=this._source.buffer.toString("base64"),this._data;if(!this._url)throw new Error("Cannot retrieve data for unsaved ParseFile.");e.requestTask=e=>this._requestTask=e;const t=CoreManager.getFileController(),r=await t.download(this._url,e);return this._data=r.base64,this._data}name(){return this._name}url(e){if(e=e||{},this._url)return e.forceSecure?this._url.replace(/^http:\/\//i,"https://"):this._url}metadata(){return this._metadata}tags(){return this._tags}directory(){return this._directory}save(e){(e=e||{}).requestTask=e=>this._requestTask=e,e.metadata=this._metadata,e.tags=this._tags,e.directory=this._directory;const t=CoreManager.getFileController();if(!this._previousSave)if("buffer"===this._source.format||"stream"===this._source.format){if("stream"===this._source.format&&!t.saveBinary)throw new Error("Cannot save a stream-based file without saveBinary support on the FileController.");const r=this._metadata&&Object.keys(this._metadata).length>0||this._tags&&Object.keys(this._tags).length>0||!!this._directory;if(!t.saveBinary||"stream"!==this._source.format&&r&&!e.maxUploadSize){if("buffer"===this._source.format){const r={format:"base64",base64:this._source.buffer.toString("base64"),type:this._source.type};this._previousSave=t.saveBase64(this._name,r,e).then((e=>(this._name=e.name,this._url=e.url,this._requestTask=null,this)))}}else this._previousSave=t.saveBinary(this._name,this._source,e).then((e=>(this._name=e.name,this._url=e.url,this._data=null,this._requestTask=null,this)))}else"file"===this._source.format?this._previousSave=t.saveFile(this._name,this._source,e).then((e=>(this._name=e.name,this._url=e.url,this._data=null,this._requestTask=null,this))):"uri"===this._source.format?this._previousSave=t.download(this._source.uri,e).then((r=>{if(!r||!r.base64)return{};const i={format:"base64",base64:r.base64,type:r.contentType};return this._data=r.base64,this._requestTask=null,t.saveBase64(this._name,i,e)})).then((e=>(this._name=e.name,this._url=e.url,this._requestTask=null,this))):this._previousSave=t.saveBase64(this._name,this._source,e).then((e=>(this._name=e.name,this._url=e.url,this._requestTask=null,this)));if(this._previousSave)return this._previousSave}cancel(){this._requestTask&&"function"==typeof this._requestTask.abort&&(this._requestTask._aborted=!0,this._requestTask.abort()),this._requestTask=null}destroy(e={}){if(!this._name)throw new ParseError(ParseError.FILE_DELETE_UNNAMED_ERROR,"Cannot delete an unnamed file.");const t={useMasterKey:!0};Object.hasOwn(e,"useMasterKey")&&(t.useMasterKey=!!e.useMasterKey);return CoreManager.getFileController().deleteFile(this._name,t).then((()=>(this._data=void 0,this._requestTask=null,this)))}toJSON(){return{__type:"File",name:this._name,url:this._url}}equals(e){return this===e||e instanceof ParseFile&&this.name()===e.name()&&this.url()===e.url()&&void 0!==this.url()}setMetadata(e){e&&"object"==typeof e&&Object.keys(e).forEach((t=>{this.addMetadata(t,e[t])}))}addMetadata(e,t){"string"==typeof e&&(this._metadata[e]=t)}setTags(e){e&&"object"==typeof e&&Object.keys(e).forEach((t=>{this.addTag(t,e[t])}))}addTag(e,t){"string"==typeof e&&(this._tags[e]=t)}setDirectory(e){"string"==typeof e&&e.length>0&&(this._directory=e)}static fromJSON(e){if("File"!==e.__type)throw new TypeError("JSON object does not represent a ParseFile");const t=new ParseFile(e.name);return t._url=e.url,t}static encodeBase64(e){const t=[];t.length=Math.ceil(e.length/3);for(let r=0;r<t.length;r++){const i=e[3*r],n=e[3*r+1]||0,o=e[3*r+2]||0,s=3*r+1<e.length,a=3*r+2<e.length;t[r]=[b64Digit(i>>2&63),b64Digit(i<<4&48|n>>4&15),s?b64Digit(n<<2&60|o>>6&3):"=",a?b64Digit(63&o):"="].join("")}return t.join("")}}const DefaultController$a={saveFile:async function(e,t,r){if("file"!==t.format)throw new Error("saveFile can only be used with File-type sources.");const i=await new Promise(((e,r)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=e=>r(e),i.readAsDataURL(t.file)})),[n,o]=i.split(","),s={format:"base64",base64:o||n,type:t.type||(t.file?t.file.type:void 0)};return await DefaultController$a.saveBase64(e,s,r)},saveBase64:function(e,t,r={}){if("base64"!==t.format)throw new Error("saveBase64 can only be used with Base64-type sources.");const i={base64:t.base64,fileData:{metadata:{...r.metadata},tags:{...r.tags},...r.directory?{directory:r.directory}:{}}};delete r.metadata,delete r.tags,delete r.directory,t.type&&(i._ContentType=t.type);const n="files/"+e;return CoreManager.getRESTController().request("POST",n,i,r)},saveBinary:async function(e,t,r={}){if("buffer"!==t.format&&"stream"!==t.format)throw new Error("saveBinary can only be used with Buffer or Stream sources.");const i={"X-Parse-Application-ID":CoreManager.get("APPLICATION_ID"),"X-Parse-Upload-Mode":"stream"};i["Content-Type"]=(t.type||"application/octet-stream").replace(/[\r\n]/g,""),r.directory&&(i["X-Parse-File-Directory"]=r.directory.replace(/[\r\n]/g,"")),r.metadata&&Object.keys(r.metadata).length>0&&(i["X-Parse-File-Metadata"]=JSON.stringify(r.metadata)),r.tags&&Object.keys(r.tags).length>0&&(i["X-Parse-File-Tags"]=JSON.stringify(r.tags)),r.maxUploadSize&&(i["X-Parse-File-Max-Upload-Size"]=r.maxUploadSize.replace(/[\r\n]/g,""));const n=CoreManager.get("JAVASCRIPT_KEY");n&&(i["X-Parse-JavaScript-Key"]=n);let o,s=r.useMasterKey;if(void 0===s&&(s=CoreManager.get("USE_MASTER_KEY")),s){if(!CoreManager.get("MASTER_KEY"))throw new Error("Cannot use the Master Key, it has not been provided.");delete i["X-Parse-JavaScript-Key"],i["X-Parse-Master-Key"]=CoreManager.get("MASTER_KEY")}if(r.sessionToken)i["X-Parse-Session-Token"]=r.sessionToken;else{const e=CoreManager.getUserController();if(e){const t=await e.currentUserAsync();if(t){const e=t.getSessionToken();e&&(i["X-Parse-Session-Token"]=e)}}}if("buffer"===t.format)o=t.buffer;else if("stream"===t.format){const e=t.stream;o="function"==typeof e.pipe&&"function"==typeof e.read?NodeReadable.toWeb(e):e}let a=CoreManager.get("SERVER_URL");return"/"!==a[a.length-1]&&(a+="/"),a+="files/"+encodeURIComponent(e),CoreManager.getRESTController().ajax("POST",a,o,i,r).then((({response:e})=>e))},download:async function(e,t){const r=new AbortController;t.requestTask(r);const{signal:i}=r;try{const r=await fetch(e,{signal:i}),n=r.body.getReader(),o=+r.headers.get("Content-Length")||0,s=r.headers.get("Content-Type");if(0===o)return t.progress?.(null,null,null),{base64:"",contentType:s};let a=0;const u=[];for(;;){const{done:e,value:r}=await n.read();if(e)break;u.push(r),a+=r?.length||0,t.progress?.(a/o,a,o)}const h=new Uint8Array(a);let f=0;for(const e of u)h.set(e,f),f+=e.length;return{base64:ParseFile.encodeBase64(h),contentType:s}}catch(e){if("AbortError"===e.name)return{};throw e}},deleteFile:function(e,t){const r={"X-Parse-Application-ID":CoreManager.get("APPLICATION_ID")};t.useMasterKey&&(r["X-Parse-Master-Key"]=CoreManager.get("MASTER_KEY"));let i=CoreManager.get("SERVER_URL");return"/"!==i[i.length-1]&&(i+="/"),i+="files/"+e,CoreManager.getRESTController().ajax("DELETE",i,"",r).catch((e=>e&&"SyntaxError: Unexpected end of JSON input"!==e.toString()?CoreManager.getRESTController().handleError(e):Promise.resolve()))}};CoreManager.setFileController(DefaultController$a);class ParseGeoPoint{constructor(e,t){Array.isArray(e)?(ParseGeoPoint._validate(e[0],e[1]),this._latitude=e[0],this._longitude=e[1]):"object"==typeof e?(ParseGeoPoint._validate(e.latitude,e.longitude),this._latitude=e.latitude,this._longitude=e.longitude):void 0!==e&&void 0!==t?(ParseGeoPoint._validate(e,t),this._latitude=e,this._longitude=t):(this._latitude=0,this._longitude=0)}get latitude(){return this._latitude}set latitude(e){ParseGeoPoint._validate(e,this.longitude),this._latitude=e}get longitude(){return this._longitude}set longitude(e){ParseGeoPoint._validate(this.latitude,e),this._longitude=e}toJSON(){return ParseGeoPoint._validate(this._latitude,this._longitude),{__type:"GeoPoint",latitude:this._latitude,longitude:this._longitude}}equals(e){return e instanceof ParseGeoPoint&&this.latitude===e.latitude&&this.longitude===e.longitude}radiansTo(e){const t=Math.PI/180,r=this.latitude*t,i=this.longitude*t,n=e.latitude*t,o=r-n,s=i-e.longitude*t,a=Math.sin(o/2),u=Math.sin(s/2);let h=a*a+Math.cos(r)*Math.cos(n)*u*u;return h=Math.min(1,h),2*Math.asin(Math.sqrt(h))}kilometersTo(e){return 6371*this.radiansTo(e)}milesTo(e){return 3958.8*this.radiansTo(e)}static _validate(e,t){if(isNaN(e)||isNaN(t)||"number"!=typeof e||"number"!=typeof t)throw new TypeError("GeoPoint latitude and longitude must be valid numbers");if(e<-90)throw new TypeError("GeoPoint latitude out of bounds: "+e+" < -90.0.");if(e>90)throw new TypeError("GeoPoint latitude out of bounds: "+e+" > 90.0.");if(t<-180)throw new TypeError("GeoPoint longitude out of bounds: "+t+" < -180.0.");if(t>180)throw new TypeError("GeoPoint longitude out of bounds: "+t+" > 180.0.")}static current(e){return new Promise(((t,r)=>{navigator.geolocation.getCurrentPosition((e=>{t(new ParseGeoPoint(e.coords.latitude,e.coords.longitude))}),r,e)}))}}class ParsePolygon{constructor(e){this._coordinates=ParsePolygon._validate(e)}get coordinates(){return this._coordinates}set coordinates(e){this._coordinates=ParsePolygon._validate(e)}toJSON(){return ParsePolygon._validate(this._coordinates),{__type:"Polygon",coordinates:this._coordinates}}equals(e){if(!(e instanceof ParsePolygon)||this.coordinates.length!==e.coordinates.length)return!1;let t=!0;for(let r=1;r<this._coordinates.length;r+=1)if(this._coordinates[r][0]!=e.coordinates[r][0]||this._coordinates[r][1]!=e.coordinates[r][1]){t=!1;break}return t}containsPoint(e){let t=this._coordinates[0][0],r=this._coordinates[0][0],i=this._coordinates[0][1],n=this._coordinates[0][1];for(let e=1;e<this._coordinates.length;e+=1){const o=this._coordinates[e];t=Math.min(o[0],t),r=Math.max(o[0],r),i=Math.min(o[1],i),n=Math.max(o[1],n)}if(e.latitude<t||e.latitude>r||e.longitude<i||e.longitude>n)return!1;let o=!1;for(let t=0,r=this._coordinates.length-1;t<this._coordinates.length;r=t++){const i=this._coordinates[t][0],n=this._coordinates[t][1],s=this._coordinates[r][0],a=this._coordinates[r][1];n>e.longitude!=a>e.longitude&&e.latitude<(s-i)*(e.longitude-n)/(a-n)+i&&(o=!o)}return o}static _validate(e){if(!Array.isArray(e))throw new TypeError("Coordinates must be an Array");if(e.length<3)throw new TypeError("Polygon must have at least 3 GeoPoints or Points");const t=[];for(let r=0;r<e.length;r+=1){const i=e[r];let n;if(i instanceof ParseGeoPoint)n=i;else{if(!Array.isArray(i)||2!==i.length)throw new TypeError("Coordinates must be an Array of GeoPoints or Points");n=new ParseGeoPoint(i[0],i[1])}t.push([n.latitude,n.longitude])}return t}}class ParseRelation{constructor(e,t){this.parent=e,this.key=t,this.targetClassName=null}_ensureParentAndKey(e,t){if(this.key=this.key||t,this.key!==t)throw new Error("Internal Error. Relation retrieved from two different keys.");if(this.parent){if(this.parent.className!==e.className)throw new Error("Internal Error. Relation retrieved from two different Objects.");if(this.parent.id){if(this.parent.id!==e.id)throw new Error("Internal Error. Relation retrieved from two different Objects.")}else e.id&&(this.parent=e)}else this.parent=e}add(e){Array.isArray(e)||(e=[e]);const{RelationOp:t}=CoreManager.getParseOp(),r=new t(e,[]),i=this.parent;if(!i)throw new Error("Cannot add to a Relation without a parent");return 0===e.length||(i.set(this.key,r),this.targetClassName=r._targetClassName),i}remove(e){Array.isArray(e)||(e=[e]);const{RelationOp:t}=CoreManager.getParseOp(),r=new t([],e);if(!this.parent)throw new Error("Cannot remove from a Relation without a parent");0!==e.length&&(this.parent.set(this.key,r),this.targetClassName=r._targetClassName)}toJSON(){return{__type:"Relation",className:this.targetClassName}}query(){let e;const t=this.parent;if(!t)throw new Error("Cannot construct a query for a Relation without a parent");const r=CoreManager.getParseQuery();return this.targetClassName?e=new r(this.targetClassName):(e=new r(t.className),e._extraOptions.redirectClassNameForKey=this.key),e._addCondition("$relatedTo","object",{__type:"Pointer",className:t.className,objectId:t.id}),e._addCondition("$relatedTo","key",this.key),e}}function isDangerousKey(e){const t=["__proto__","constructor","prototype"];if(t.includes(e))return!0;if(e.includes(".")){return e.split(".").some((e=>t.includes(e)))}return!1}function decode(e){if(null===e||"object"!=typeof e||e instanceof Date)return e;if(Array.isArray(e)){const t=[];return e.forEach(((e,r)=>{t[r]=decode(e)})),t}if("string"==typeof e.__op){const{opFromJSON:t}=CoreManager.getParseOp();return t(e)}const t=CoreManager.getParseObject();if("Pointer"===e.__type&&e.className)return t.fromJSON(e);if("Object"===e.__type&&e.className)return t.fromJSON(e);if("Relation"===e.__type){const t=new ParseRelation(null,null);return t.targetClassName=e.className,t}if("Date"===e.__type)return new Date(e.iso);if("File"===e.__type)return ParseFile.fromJSON(e);if("GeoPoint"===e.__type)return new ParseGeoPoint({latitude:e.latitude,longitude:e.longitude});if("Polygon"===e.__type)return new ParsePolygon(e.coordinates);const r={};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){if(isDangerousKey(t))continue;r[t]=decode(e[t])}return r}const PUBLIC_KEY$1="*";class ParseACL{constructor(e){if(this.permissionsById={},e&&"object"==typeof e){if(e instanceof CoreManager.getParseUser())this.setReadAccess(e,!0),this.setWriteAccess(e,!0);else for(const t in e){const r=e[t];this.permissionsById[t]={};for(const e in r){const i=r[e];if("read"!==e&&"write"!==e)throw new TypeError("Tried to create an ACL with an invalid permission type.");if("boolean"!=typeof i)throw new TypeError("Tried to create an ACL with an invalid permission value.");this.permissionsById[t][e]=i}}}else if("function"==typeof e)throw new TypeError("ParseACL constructed with a function. Did you forget ()?")}toJSON(){const e={};for(const t in this.permissionsById)e[t]=this.permissionsById[t];return e}equals(e){if(!(e instanceof ParseACL))return!1;const t=Object.keys(this.permissionsById),r=Object.keys(e.permissionsById);if(t.length!==r.length)return!1;for(const t in this.permissionsById){if(!e.permissionsById[t])return!1;if(this.permissionsById[t].read!==e.permissionsById[t].read)return!1;if(this.permissionsById[t].write!==e.permissionsById[t].write)return!1}return!0}_setAccess(e,t,r){const i=CoreManager.getParseRole();if(t instanceof CoreManager.getParseUser())t=t.id;else if(t instanceof i){const e=t.getName();if(!e)throw new TypeError("Role must have a name");t="role:"+e}if("string"!=typeof t)throw new TypeError("userId must be a string.");if("boolean"!=typeof r)throw new TypeError("allowed must be either true or false.");let n=this.permissionsById[t];if(!n){if(!r)return;n={},this.permissionsById[t]=n}r?this.permissionsById[t][e]=!0:(delete n[e],0===Object.keys(n).length&&delete this.permissionsById[t])}_getAccess(e,t){const r=CoreManager.getParseRole();if(t instanceof CoreManager.getParseUser()){if(!(t=t.id))throw new Error("Cannot get access for a ParseUser without an ID")}else if(t instanceof r){const e=t.getName();if(!e)throw new TypeError("Role must have a name");t="role:"+e}const i=this.permissionsById[t];return!!i&&!!i[e]}setReadAccess(e,t){this._setAccess("read",e,t)}getReadAccess(e){return this._getAccess("read",e)}setWriteAccess(e,t){this._setAccess("write",e,t)}getWriteAccess(e){return this._getAccess("write",e)}setPublicReadAccess(e){this.setReadAccess(PUBLIC_KEY$1,e)}getPublicReadAccess(){return this.getReadAccess(PUBLIC_KEY$1)}setPublicWriteAccess(e){this.setWriteAccess(PUBLIC_KEY$1,e)}getPublicWriteAccess(){return this.getWriteAccess(PUBLIC_KEY$1)}getRoleReadAccess(e){if(e instanceof CoreManager.getParseRole()&&(e=e.getName()),"string"!=typeof e)throw new TypeError("role must be a ParseRole or a String");return this.getReadAccess("role:"+e)}getRoleWriteAccess(e){if(e instanceof CoreManager.getParseRole()&&(e=e.getName()),"string"!=typeof e)throw new TypeError("role must be a ParseRole or a String");return this.getWriteAccess("role:"+e)}setRoleReadAccess(e,t){if(e instanceof CoreManager.getParseRole()&&(e=e.getName()),"string"!=typeof e)throw new TypeError("role must be a ParseRole or a String");this.setReadAccess("role:"+e,t)}setRoleWriteAccess(e,t){if(e instanceof CoreManager.getParseRole()&&(e=e.getName()),"string"!=typeof e)throw new TypeError("role must be a ParseRole or a String");this.setWriteAccess("role:"+e,t)}}function encode$1(e,t,r,i,n){if(e instanceof CoreManager.getParseObject()){if(t)throw new Error("Parse Objects not allowed here");const o=e.id?e.className+":"+e.id:e;return r||!i||i.indexOf(o)>-1||e.dirty()||Object.keys(e._getServerData()).length<1?n&&e._getId().startsWith("local")?e.toOfflinePointer():e.toPointer():(i=i.concat(o),e._toFullJSON(i,n))}const{Op:o}=CoreManager.getParseOp();if(e instanceof o||e instanceof ParseACL||e instanceof ParseGeoPoint||e instanceof ParsePolygon||e instanceof ParseRelation)return e.toJSON();if(e instanceof ParseFile){if(!e.url())throw new Error("Tried to encode an unsaved file.");return e.toJSON()}if("[object Date]"===Object.prototype.toString.call(e)){if(isNaN(e))throw new Error("Tried to encode an invalid date.");return{__type:"Date",iso:e.toJSON()}}if("[object RegExp]"===Object.prototype.toString.call(e)&&"string"==typeof e.source)return e.source;if(Array.isArray(e))return e.map((e=>encode$1(e,t,r,i,n)));if(e&&"object"==typeof e){const o={};for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(isDangerousKey(s))continue;o[s]=encode$1(e[s],t,r,i,n)}return o}return e}function encode(e,t,r,i,n){return encode$1(e,!!t,!!r,i||[],n)}var CryptoJS_1,hasRequiredCryptoJS;function requireCryptoJS(){if(hasRequiredCryptoJS)return CryptoJS_1;hasRequiredCryptoJS=1;let e=function(e){var t={},r=t.lib={},i=function(){},n=r.Base={extend:function(e){i.prototype=this;var t=new i;return e&&t.mixIn(e),t.hasOwnProperty("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)}},o=r.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,r=e.words,i=this.sigBytes;if(e=e.sigBytes,this.clamp(),i%4)for(var n=0;n<e;n++)t[i+n>>>2]|=(r[n>>>2]>>>24-n%4*8&255)<<24-(i+n)%4*8;else if(65535<r.length)for(n=0;n<e;n+=4)t[i+n>>>2]=r[n>>>2];else t.push.apply(t,r);return this.sigBytes+=e,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=n.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r=[],i=0;i<t;i+=4)r.push(4294967296*e.random()|0);return new o.init(r,t)}}),s=t.enc={},a=s.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var r=[],i=0;i<e;i++){var n=t[i>>>2]>>>24-i%4*8&255;r.push((n>>>4).toString(16)),r.push((15&n).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i+=2)r[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new o.init(r,t/2)}},u=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var r=[],i=0;i<e;i++)r.push(String.fromCharCode(t[i>>>2]>>>24-i%4*8&255));return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new o.init(r,t)}},h=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},f=r.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,i=r.words,n=r.sigBytes,s=this.blockSize,a=n/(4*s);if(t=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,n=e.min(4*t,n),t){for(var u=0;u<t;u+=s)this._doProcessBlock(i,u);u=i.splice(0,t),r.sigBytes-=n}return new o.init(u,n)},clone:function(){var e=n.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=f.extend({cfg:n.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new l.HMAC.init(e,r).finalize(t)}}});var l=t.algo={};return t}(Math);var t,r;return r=(t=e).lib.WordArray,t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,i=this._map;e.clamp(),e=[];for(var n=0;n<r;n+=3)for(var o=(t[n>>>2]>>>24-n%4*8&255)<<16|(t[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|t[n+2>>>2]>>>24-(n+2)%4*8&255,s=0;4>s&&n+.75*s<r;s++)e.push(i.charAt(o>>>6*(3-s)&63));if(t=i.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var t=e.length,i=this._map;(n=i.charAt(64))&&-1!=(n=e.indexOf(n))&&(t=n);for(var n=[],o=0,s=0;s<t;s++)if(s%4){var a=i.indexOf(e.charAt(s-1))<<s%4*2,u=i.indexOf(e.charAt(s))>>>6-s%4*2;n[o>>>2]|=(a|u)<<24-o%4*8,o++}return r.create(n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(t){function r(e,t,r,i,n,o,s){return((e=e+(t&r|~t&i)+n+s)<<o|e>>>32-o)+t}function i(e,t,r,i,n,o,s){return((e=e+(t&i|r&~i)+n+s)<<o|e>>>32-o)+t}function n(e,t,r,i,n,o,s){return((e=e+(t^r^i)+n+s)<<o|e>>>32-o)+t}function o(e,t,r,i,n,o,s){return((e=e+(r^(t|~i))+n+s)<<o|e>>>32-o)+t}for(var s=e,a=(h=s.lib).WordArray,u=h.Hasher,h=s.algo,f=[],l=0;64>l;l++)f[l]=4294967296*t.abs(t.sin(l+1))|0;h=h.MD5=u.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var s=0;16>s;s++){var a=e[u=t+s];e[u]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}s=this._hash.words;var u=e[t+0],h=(a=e[t+1],e[t+2]),l=e[t+3],c=e[t+4],d=e[t+5],p=e[t+6],m=e[t+7],g=e[t+8],y=e[t+9],b=e[t+10],v=e[t+11],w=e[t+12],_=e[t+13],M=e[t+14],S=e[t+15],E=r(E=s[0],q=s[1],A=s[2],R=s[3],u,7,f[0]),R=r(R,E,q,A,a,12,f[1]),A=r(A,R,E,q,h,17,f[2]),q=r(q,A,R,E,l,22,f[3]);E=r(E,q,A,R,c,7,f[4]),R=r(R,E,q,A,d,12,f[5]),A=r(A,R,E,q,p,17,f[6]),q=r(q,A,R,E,m,22,f[7]),E=r(E,q,A,R,g,7,f[8]),R=r(R,E,q,A,y,12,f[9]),A=r(A,R,E,q,b,17,f[10]),q=r(q,A,R,E,v,22,f[11]),E=r(E,q,A,R,w,7,f[12]),R=r(R,E,q,A,_,12,f[13]),A=r(A,R,E,q,M,17,f[14]),E=i(E,q=r(q,A,R,E,S,22,f[15]),A,R,a,5,f[16]),R=i(R,E,q,A,p,9,f[17]),A=i(A,R,E,q,v,14,f[18]),q=i(q,A,R,E,u,20,f[19]),E=i(E,q,A,R,d,5,f[20]),R=i(R,E,q,A,b,9,f[21]),A=i(A,R,E,q,S,14,f[22]),q=i(q,A,R,E,c,20,f[23]),E=i(E,q,A,R,y,5,f[24]),R=i(R,E,q,A,M,9,f[25]),A=i(A,R,E,q,l,14,f[26]),q=i(q,A,R,E,g,20,f[27]),E=i(E,q,A,R,_,5,f[28]),R=i(R,E,q,A,h,9,f[29]),A=i(A,R,E,q,m,14,f[30]),E=n(E,q=i(q,A,R,E,w,20,f[31]),A,R,d,4,f[32]),R=n(R,E,q,A,g,11,f[33]),A=n(A,R,E,q,v,16,f[34]),q=n(q,A,R,E,M,23,f[35]),E=n(E,q,A,R,a,4,f[36]),R=n(R,E,q,A,c,11,f[37]),A=n(A,R,E,q,m,16,f[38]),q=n(q,A,R,E,b,23,f[39]),E=n(E,q,A,R,_,4,f[40]),R=n(R,E,q,A,u,11,f[41]),A=n(A,R,E,q,l,16,f[42]),q=n(q,A,R,E,p,23,f[43]),E=n(E,q,A,R,y,4,f[44]),R=n(R,E,q,A,w,11,f[45]),A=n(A,R,E,q,S,16,f[46]),E=o(E,q=n(q,A,R,E,h,23,f[47]),A,R,u,6,f[48]),R=o(R,E,q,A,m,10,f[49]),A=o(A,R,E,q,M,15,f[50]),q=o(q,A,R,E,d,21,f[51]),E=o(E,q,A,R,w,6,f[52]),R=o(R,E,q,A,l,10,f[53]),A=o(A,R,E,q,b,15,f[54]),q=o(q,A,R,E,a,21,f[55]),E=o(E,q,A,R,g,6,f[56]),R=o(R,E,q,A,S,10,f[57]),A=o(A,R,E,q,p,15,f[58]),q=o(q,A,R,E,_,21,f[59]),E=o(E,q,A,R,c,6,f[60]),R=o(R,E,q,A,v,10,f[61]),A=o(A,R,E,q,h,15,f[62]),q=o(q,A,R,E,y,21,f[63]);s[0]=s[0]+E|0,s[1]=s[1]+q|0,s[2]=s[2]+A|0,s[3]=s[3]+R|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296);for(r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e.sigBytes=4*(r.length+1),this._process(),r=(e=this._hash).words,i=0;4>i;i++)n=r[i],r[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8);return e},clone:function(){var e=u.clone.call(this);return e._hash=this._hash.clone(),e}}),s.MD5=u._createHelper(h),s.HmacMD5=u._createHmacHelper(h)}(Math),function(){var t,r=e,i=(t=r.lib).Base,n=t.WordArray,o=(t=r.algo).EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=(a=this.cfg).hasher.create(),i=n.create(),o=i.words,s=a.keySize,a=a.iterations;o.length<s;){u&&r.update(u);var u=r.update(e).finalize(t);r.reset();for(var h=1;h<a;h++)u=r.finalize(u),r.reset();i.concat(u)}return i.sigBytes=4*s,i}});r.EvpKDF=function(e,t,r){return o.create(r).compute(e,t)}}(),e.lib.Cipher||function(){var t=(d=e).lib,r=t.Base,i=t.WordArray,n=t.BufferedBlockAlgorithm,o=d.enc.Base64,s=d.algo.EvpKDF,a=t.Cipher=n.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){n.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,r,i){return("string"==typeof r?p:c).encrypt(e,t,r,i)},decrypt:function(t,r,i){return("string"==typeof r?p:c).decrypt(e,t,r,i)}}}});t.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=d.mode={},h=function(e,t,r){var i=this._iv;i?this._iv=undefined:i=this._prevBlock;for(var n=0;n<r;n++)e[t+n]^=i[n]},f=(t.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();f.Encryptor=f.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;h.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),f.Decryptor=f.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,n=e.slice(t,t+i);r.decryptBlock(e,t),h.call(this,e,t,i),this._prevBlock=n}}),u=u.CBC=f,f=(d.pad={}).Pkcs7={pad:function(e,t){for(var r,n=(r=(r=4*t)-e.sigBytes%r)<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(n);r=i.create(o,r),e.concat(r)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=a.extend({cfg:a.cfg.extend({mode:u,padding:f}),reset:function(){a.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=t.createEncryptor;else r=t.createDecryptor,this._minBufferSize=1;this._mode=r.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var l=t.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),c=(u=(d.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?i.create([1398893684,1701076831]).concat(e).concat(t):t).toString(o)},parse:function(e){var t=(e=o.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var r=i.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return l.create({ciphertext:e,salt:r})}},t.SerializableCipher=r.extend({cfg:r.extend({format:u}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i);return t=n.finalize(t),n=n.cfg,l.create({ciphertext:t,key:r,iv:n.iv,algorithm:e,mode:n.mode,padding:n.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(r,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),d=(d.kdf={}).OpenSSL={execute:function(e,t,r,n){return n||(n=i.random(8)),e=s.create({keySize:t+r}).compute(e,n),r=i.create(e.words.slice(t),4*r),e.sigBytes=4*t,l.create({key:e,iv:r,salt:n})}},p=t.PasswordBasedCipher=c.extend({cfg:c.cfg.extend({kdf:d}),encrypt:function(e,t,r,i){return r=(i=this.cfg.extend(i)).kdf.execute(r,e.keySize,e.ivSize),i.iv=r.iv,(e=c.encrypt.call(this,e,t,r.key,i)).mixIn(r),e},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),r=i.kdf.execute(r,e.keySize,e.ivSize,t.salt),i.iv=r.iv,c.decrypt.call(this,e,t,r.key,i)}})}(),function(){for(var t=e,r=t.lib.BlockCipher,i=t.algo,n=[],o=[],s=[],a=[],u=[],h=[],f=[],l=[],c=[],d=[],p=[],m=0;256>m;m++)p[m]=128>m?m<<1:m<<1^283;var g=0,y=0;for(m=0;256>m;m++){var b=(b=y^y<<1^y<<2^y<<3^y<<4)>>>8^255&b^99;n[g]=b,o[b]=g;var v=p[g],w=p[v],_=p[w],M=257*p[b]^16843008*b;s[g]=M<<24|M>>>8,a[g]=M<<16|M>>>16,u[g]=M<<8|M>>>24,h[g]=M,M=16843009*_^65537*w^257*v^16843008*g,f[b]=M<<24|M>>>8,l[b]=M<<16|M>>>16,c[b]=M<<8|M>>>24,d[b]=M,g?(g=v^p[p[p[_^v]]],y^=p[p[y]]):g=y=1}var S=[0,1,2,4,8,16,32,64,128,27,54];i=i.AES=r.extend({_doReset:function(){for(var e=(r=this._key).words,t=r.sigBytes/4,r=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],o=0;o<r;o++)if(o<t)i[o]=e[o];else{var s=i[o-1];o%t?6<t&&4==o%t&&(s=n[s>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s]):(s=n[(s=s<<8|s>>>24)>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s],s^=S[o/t|0]<<24),i[o]=i[o-t]^s}for(e=this._invKeySchedule=[],t=0;t<r;t++)o=r-t,s=t%4?i[o]:i[o-4],e[t]=4>t||4>=o?s:f[n[s>>>24]]^l[n[s>>>16&255]]^c[n[s>>>8&255]]^d[n[255&s]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,u,h,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,l,c,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,o,s,a){for(var u=this._nRounds,h=e[t]^r[0],f=e[t+1]^r[1],l=e[t+2]^r[2],c=e[t+3]^r[3],d=4,p=1;p<u;p++){var m=i[h>>>24]^n[f>>>16&255]^o[l>>>8&255]^s[255&c]^r[d++],g=i[f>>>24]^n[l>>>16&255]^o[c>>>8&255]^s[255&h]^r[d++],y=i[l>>>24]^n[c>>>16&255]^o[h>>>8&255]^s[255&f]^r[d++];c=i[c>>>24]^n[h>>>16&255]^o[f>>>8&255]^s[255&l]^r[d++],h=m,f=g,l=y}m=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[l>>>8&255]<<8|a[255&c])^r[d++],g=(a[f>>>24]<<24|a[l>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^r[d++],y=(a[l>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[d++],c=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&l])^r[d++],e[t]=m,e[t+1]=g,e[t+2]=y,e[t+3]=c},keySize:8});t.AES=r._createHelper(i)}(),CryptoJS_1=e}requireCryptoJS();var aes$3={exports:{}};function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var core$1={exports:{}},cryptoBrowserify={},browser$c={exports:{}},safeBuffer$9={exports:{}},hasRequiredSafeBuffer$9,hasRequiredBrowser$b;function requireSafeBuffer$9(){return hasRequiredSafeBuffer$9||(hasRequiredSafeBuffer$9=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$9,safeBuffer$9.exports)),safeBuffer$9.exports}function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$c.exports;hasRequiredBrowser$b=1;var e=65536,t=4294967295;var r=requireSafeBuffer$9().Buffer,i=commonjsGlobal.crypto||commonjsGlobal.msCrypto;return i&&i.getRandomValues?browser$c.exports=function(n,o){if(n>t)throw new RangeError("requested too many random bytes");var s=r.allocUnsafe(n);if(n>0)if(n>e)for(var a=0;a<n;a+=e)i.getRandomValues(s.slice(a,a+e));else i.getRandomValues(s);if("function"==typeof o)return process$1.nextTick((function(){o(null,s)}));return s}:browser$c.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")},browser$c.exports}var safeBuffer$8={exports:{}},hasRequiredSafeBuffer$8,hashBase$1,hasRequiredHashBase$1,md5_js,hasRequiredMd5_js,ripemd160$1,hasRequiredRipemd160$1;function requireSafeBuffer$8(){return hasRequiredSafeBuffer$8||(hasRequiredSafeBuffer$8=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$8,safeBuffer$8.exports)),safeBuffer$8.exports}function requireHashBase$1(){if(hasRequiredHashBase$1)return hashBase$1;hasRequiredHashBase$1=1;var e=requireSafeBuffer$8().Buffer,t=requireStreamBrowserify().Transform;function r(r){t.call(this),this._block=e.allocUnsafe(r),this._blockSize=r,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}requireInherits_browser()(r,t),r.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},r.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)};var i="undefined"!=typeof Uint8Array,n="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&ArrayBuffer.isView&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return r.prototype.update=function(t,r){if(this._finalized)throw new Error("Digest already called");t=function(t,r){if(t instanceof e)return t;if("string"==typeof t)return e.from(t,r);if(n&&ArrayBuffer.isView(t)){if(0===t.byteLength)return e.alloc(0);var o=e.from(t.buffer,t.byteOffset,t.byteLength);if(o.byteLength===t.byteLength)return o}if(i&&t instanceof Uint8Array)return e.from(t);if(e.isBuffer(t)&&t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))return e.from(t);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}(t,r);for(var o=this._block,s=0;this._blockOffset+t.length-s>=this._blockSize;){for(var a=this._blockOffset;a<this._blockSize;)o[a++]=t[s++];this._update(),this._blockOffset=0}for(;s<t.length;)o[this._blockOffset++]=t[s++];for(var u=0,h=8*t.length;h>0;++u)this._length[u]+=h,(h=this._length[u]/4294967296|0)>0&&(this._length[u]-=4294967296*h);return this},r.prototype._update=function(){throw new Error("_update is not implemented")},r.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 r=0;r<4;++r)this._length[r]=0;return t},r.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$1=r}function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var e=requireInherits_browser(),t=requireHashBase$1(),r=requireSafeBuffer$9().Buffer,i=new Array(16);function n(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function o(e,t){return e<<t|e>>>32-t}function s(e,t,r,i,n,s,a){return o(e+(t&r|~t&i)+n+s|0,a)+t|0}function a(e,t,r,i,n,s,a){return o(e+(t&i|r&~i)+n+s|0,a)+t|0}function u(e,t,r,i,n,s,a){return o(e+(t^r^i)+n+s|0,a)+t|0}function h(e,t,r,i,n,s,a){return o(e+(r^(t|~i))+n+s|0,a)+t|0}return e(n,t),n.prototype._update=function(){for(var e=i,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,o=this._c,f=this._d;r=s(r,n,o,f,e[0],3614090360,7),f=s(f,r,n,o,e[1],3905402710,12),o=s(o,f,r,n,e[2],606105819,17),n=s(n,o,f,r,e[3],3250441966,22),r=s(r,n,o,f,e[4],4118548399,7),f=s(f,r,n,o,e[5],1200080426,12),o=s(o,f,r,n,e[6],2821735955,17),n=s(n,o,f,r,e[7],4249261313,22),r=s(r,n,o,f,e[8],1770035416,7),f=s(f,r,n,o,e[9],2336552879,12),o=s(o,f,r,n,e[10],4294925233,17),n=s(n,o,f,r,e[11],2304563134,22),r=s(r,n,o,f,e[12],1804603682,7),f=s(f,r,n,o,e[13],4254626195,12),o=s(o,f,r,n,e[14],2792965006,17),r=a(r,n=s(n,o,f,r,e[15],1236535329,22),o,f,e[1],4129170786,5),f=a(f,r,n,o,e[6],3225465664,9),o=a(o,f,r,n,e[11],643717713,14),n=a(n,o,f,r,e[0],3921069994,20),r=a(r,n,o,f,e[5],3593408605,5),f=a(f,r,n,o,e[10],38016083,9),o=a(o,f,r,n,e[15],3634488961,14),n=a(n,o,f,r,e[4],3889429448,20),r=a(r,n,o,f,e[9],568446438,5),f=a(f,r,n,o,e[14],3275163606,9),o=a(o,f,r,n,e[3],4107603335,14),n=a(n,o,f,r,e[8],1163531501,20),r=a(r,n,o,f,e[13],2850285829,5),f=a(f,r,n,o,e[2],4243563512,9),o=a(o,f,r,n,e[7],1735328473,14),r=u(r,n=a(n,o,f,r,e[12],2368359562,20),o,f,e[5],4294588738,4),f=u(f,r,n,o,e[8],2272392833,11),o=u(o,f,r,n,e[11],1839030562,16),n=u(n,o,f,r,e[14],4259657740,23),r=u(r,n,o,f,e[1],2763975236,4),f=u(f,r,n,o,e[4],1272893353,11),o=u(o,f,r,n,e[7],4139469664,16),n=u(n,o,f,r,e[10],3200236656,23),r=u(r,n,o,f,e[13],681279174,4),f=u(f,r,n,o,e[0],3936430074,11),o=u(o,f,r,n,e[3],3572445317,16),n=u(n,o,f,r,e[6],76029189,23),r=u(r,n,o,f,e[9],3654602809,4),f=u(f,r,n,o,e[12],3873151461,11),o=u(o,f,r,n,e[15],530742520,16),r=h(r,n=u(n,o,f,r,e[2],3299628645,23),o,f,e[0],4096336452,6),f=h(f,r,n,o,e[7],1126891415,10),o=h(o,f,r,n,e[14],2878612391,15),n=h(n,o,f,r,e[5],4237533241,21),r=h(r,n,o,f,e[12],1700485571,6),f=h(f,r,n,o,e[3],2399980690,10),o=h(o,f,r,n,e[10],4293915773,15),n=h(n,o,f,r,e[1],2240044497,21),r=h(r,n,o,f,e[8],1873313359,6),f=h(f,r,n,o,e[15],4264355552,10),o=h(o,f,r,n,e[6],2734768916,15),n=h(n,o,f,r,e[13],1309151649,21),r=h(r,n,o,f,e[4],4149444226,6),f=h(f,r,n,o,e[11],3174756917,10),o=h(o,f,r,n,e[2],718787259,15),n=h(n,o,f,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+o|0,this._d=this._d+f|0},n.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.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},md5_js=n}function requireRipemd160$1(){if(hasRequiredRipemd160$1)return ripemd160$1;hasRequiredRipemd160$1=1;var e=requireDist().Buffer,t=requireInherits_browser(),r=requireHashBase$1(),i=new Array(16),n=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],o=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],s=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],a=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],u=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function f(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function l(e,t){return e<<t|e>>>32-t}function c(e,t,r,i,n,o,s,a){return l(e+(t^r^i)+o+s|0,a)+n|0}function d(e,t,r,i,n,o,s,a){return l(e+(t&r|~t&i)+o+s|0,a)+n|0}function p(e,t,r,i,n,o,s,a){return l(e+((t|~r)^i)+o+s|0,a)+n|0}function m(e,t,r,i,n,o,s,a){return l(e+(t&i|r&~i)+o+s|0,a)+n|0}function g(e,t,r,i,n,o,s,a){return l(e+(t^(r|~i))+o+s|0,a)+n|0}return t(f,r),f.prototype._update=function(){for(var e=i,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,f=0|this._b,y=0|this._c,b=0|this._d,v=0|this._e,w=0|this._a,_=0|this._b,M=0|this._c,S=0|this._d,E=0|this._e,R=0;R<80;R+=1){var A,q;R<16?(A=c(r,f,y,b,v,e[n[R]],u[0],s[R]),q=g(w,_,M,S,E,e[o[R]],h[0],a[R])):R<32?(A=d(r,f,y,b,v,e[n[R]],u[1],s[R]),q=m(w,_,M,S,E,e[o[R]],h[1],a[R])):R<48?(A=p(r,f,y,b,v,e[n[R]],u[2],s[R]),q=p(w,_,M,S,E,e[o[R]],h[2],a[R])):R<64?(A=m(r,f,y,b,v,e[n[R]],u[3],s[R]),q=d(w,_,M,S,E,e[o[R]],h[3],a[R])):(A=g(r,f,y,b,v,e[n[R]],u[4],s[R]),q=c(w,_,M,S,E,e[o[R]],h[4],a[R])),r=v,v=b,b=l(y,10),y=f,f=A,w=E,E=S,S=l(M,10),M=_,_=q}var C=this._b+y+S|0;this._b=this._c+b+E|0,this._c=this._d+v+w|0,this._d=this._e+r+_|0,this._e=this._a+f+M|0,this._a=C},f.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 t=e.alloc?e.alloc(20):new e(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},ripemd160$1=f}var sha_js={exports:{}},safeBuffer$7={exports:{}},hasRequiredSafeBuffer$7;function requireSafeBuffer$7(){return hasRequiredSafeBuffer$7||(hasRequiredSafeBuffer$7=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$7,safeBuffer$7.exports)),safeBuffer$7.exports}var safeBuffer$6={exports:{}},hasRequiredSafeBuffer$6,isarray$1,hasRequiredIsarray$1,typedArrayBuffer,hasRequiredTypedArrayBuffer,toBuffer,hasRequiredToBuffer$1,hash$1,hasRequiredHash$1,sha$1,hasRequiredSha$1,sha1$2,hasRequiredSha1$1,sha256$1,hasRequiredSha256,sha224$1,hasRequiredSha224,sha512$1,hasRequiredSha512,sha384$1,hasRequiredSha384,hasRequiredSha_js;function requireSafeBuffer$6(){return hasRequiredSafeBuffer$6||(hasRequiredSafeBuffer$6=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$6,safeBuffer$6.exports)),safeBuffer$6.exports}function requireIsarray$1(){if(hasRequiredIsarray$1)return isarray$1;hasRequiredIsarray$1=1;var e={}.toString;return isarray$1=Array.isArray||function(t){return"[object Array]"==e.call(t)}}function requireTypedArrayBuffer(){if(hasRequiredTypedArrayBuffer)return typedArrayBuffer;hasRequiredTypedArrayBuffer=1;var e=requireType(),t=requireCallBound()("TypedArray.prototype.buffer",!0),r=requireIsTypedArray();return typedArrayBuffer=t||function(t){if(!r(t))throw new e("Not a Typed Array");return t.buffer}}function requireToBuffer$1(){if(hasRequiredToBuffer$1)return toBuffer;hasRequiredToBuffer$1=1;var e=requireSafeBuffer$6().Buffer,t=requireIsarray$1(),r=requireTypedArrayBuffer(),i=ArrayBuffer.isView||function(e){try{return r(e),!0}catch(e){return!1}},n="undefined"!=typeof Uint8Array,o="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,s=o&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return toBuffer=function(r,a){if(r instanceof e)return r;if("string"==typeof r)return e.from(r,a);if(o&&i(r)){if(0===r.byteLength)return e.alloc(0);if(s){var u=e.from(r.buffer,r.byteOffset,r.byteLength);if(u.byteLength===r.byteLength)return u}var h=r instanceof Uint8Array?r:new Uint8Array(r.buffer,r.byteOffset,r.byteLength),f=e.from(h);if(f.length===r.byteLength)return f}if(n&&r instanceof Uint8Array)return e.from(r);var l=t(r);if(l)for(var c=0;c<r.length;c+=1){var d=r[c];if("number"!=typeof d||d<0||d>255||~~d!==d)throw new RangeError("Array items must be numbers in the range 0-255.")}if(l||e.isBuffer(r)&&r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r))return e.from(r);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}function requireHash$1(){if(hasRequiredHash$1)return hash$1;hasRequiredHash$1=1;var e=requireSafeBuffer$7().Buffer,t=requireToBuffer$1();function r(t,r){this._block=e.alloc(t),this._finalSize=r,this._blockSize=t,this._len=0}return r.prototype.update=function(e,r){e=t(e,r||"utf8");for(var i=this._block,n=this._blockSize,o=e.length,s=this._len,a=0;a<o;){for(var u=s%n,h=Math.min(o-a,n-u),f=0;f<h;f++)i[u+f]=e[a+f];a+=h,(s+=h)%n==0&&this._update(i)}return this._len+=o,this},r.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$1=r}function requireSha$1(){if(hasRequiredSha$1)return sha$1;hasRequiredSha$1=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$7().Buffer,i=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function o(){this.init(),this._w=n,t.call(this,64,56)}function s(e){return e<<30|e>>>2}function a(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}return e(o,t),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,u=0|this._c,h=0|this._d,f=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var c=0;c<80;++c){var d=~~(c/20),p=0|((t=n)<<5|t>>>27)+a(d,o,u,h)+f+r[c]+i[d];f=h,h=u,u=s(o),o=n,n=p}this._a=n+this._a|0,this._b=o+this._b|0,this._c=u+this._c|0,this._d=h+this._d|0,this._e=f+this._e|0},o.prototype._hash=function(){var e=r.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},sha$1=o}function requireSha1$1(){if(hasRequiredSha1$1)return sha1$2;hasRequiredSha1$1=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$7().Buffer,i=[1518500249,1859775393,-1894007588,-899497514],n=new Array(80);function o(){this.init(),this._w=n,t.call(this,64,56)}function s(e){return e<<5|e>>>27}function a(e){return e<<30|e>>>2}function u(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}return e(o,t),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,h=0|this._c,f=0|this._d,l=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=(t=r[c-3]^r[c-8]^r[c-14]^r[c-16])<<1|t>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=s(n)+u(p,o,h,f)+l+r[d]+i[p]|0;l=f,f=h,h=a(o),o=n,n=m}this._a=n+this._a|0,this._b=o+this._b|0,this._c=h+this._c|0,this._d=f+this._d|0,this._e=l+this._e|0},o.prototype._hash=function(){var e=r.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},sha1$2=o}function requireSha256(){if(hasRequiredSha256)return sha256$1;hasRequiredSha256=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$7().Buffer,i=[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],n=new Array(64);function o(){this.init(),this._w=n,t.call(this,64,56)}function s(e,t,r){return r^e&(t^r)}function a(e,t,r){return e&t|r&(e|t)}function u(e){return(e>>>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 f(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}return e(o,t),o.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},o.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,o=0|this._b,l=0|this._c,c=0|this._d,d=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,y=0;y<16;++y)r[y]=e.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((t=r[y-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[y-7]+f(r[y-15])+r[y-16];for(var b=0;b<64;++b){var v=g+h(d)+s(d,p,m)+i[b]+r[b]|0,w=u(n)+a(n,o,l)|0;g=m,m=p,p=d,d=c+v|0,c=l,l=o,o=n,n=v+w|0}this._a=n+this._a|0,this._b=o+this._b|0,this._c=l+this._c|0,this._d=c+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},o.prototype._hash=function(){var e=r.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},sha256$1=o}function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var e=requireInherits_browser(),t=requireSha256(),r=requireHash$1(),i=requireSafeBuffer$7().Buffer,n=new Array(64);function o(){this.init(),this._w=n,r.call(this,64,56)}return e(o,t),o.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},o.prototype._hash=function(){var e=i.allocUnsafe(28);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},sha224$1=o}function requireSha512(){if(hasRequiredSha512)return sha512$1;hasRequiredSha512=1;var e=requireInherits_browser(),t=requireHash$1(),r=requireSafeBuffer$7().Buffer,i=[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],n=new Array(160);function o(){this.init(),this._w=n,t.call(this,128,112)}function s(e,t,r){return r^e&(t^r)}function a(e,t,r){return e&t|r&(e|t)}function u(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 f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function c(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function d(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function p(e,t){return e>>>0<t>>>0?1:0}return e(o,t),o.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},o.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,o=0|this._ch,m=0|this._dh,g=0|this._eh,y=0|this._fh,b=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,M=0|this._cl,S=0|this._dl,E=0|this._el,R=0|this._fl,A=0|this._gl,q=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 P=t[C-30],B=t[C-30+1],I=f(P,B),O=l(B,P),k=c(P=t[C-4],B=t[C-4+1]),T=d(B,P),N=t[C-14],x=t[C-14+1],j=t[C-32],$=t[C-32+1],D=O+x|0,U=I+N+p(D,O)|0;U=(U=U+k+p(D=D+T|0,T)|0)+j+p(D=D+$|0,$)|0,t[C]=U,t[C+1]=D}for(var L=0;L<160;L+=2){U=t[L],D=t[L+1];var F=a(r,n,o),z=a(w,_,M),K=u(r,w),W=u(w,r),H=h(g,E),G=h(E,g),J=i[L],V=i[L+1],Q=s(g,y,b),Z=s(E,R,A),Y=q+G|0,X=v+H+p(Y,q)|0;X=(X=(X=X+Q+p(Y=Y+Z|0,Z)|0)+J+p(Y=Y+V|0,V)|0)+U+p(Y=Y+D|0,D)|0;var ee=W+z|0,te=K+F+p(ee,W)|0;v=b,q=A,b=y,A=R,y=g,R=E,g=m+X+p(E=S+Y|0,S)|0,m=o,S=M,o=n,M=_,n=r,_=w,r=X+te+p(w=Y+ee|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+M|0,this._dl=this._dl+S|0,this._el=this._el+E|0,this._fl=this._fl+R|0,this._gl=this._gl+A|0,this._hl=this._hl+q|0,this._ah=this._ah+r+p(this._al,w)|0,this._bh=this._bh+n+p(this._bl,_)|0,this._ch=this._ch+o+p(this._cl,M)|0,this._dh=this._dh+m+p(this._dl,S)|0,this._eh=this._eh+g+p(this._el,E)|0,this._fh=this._fh+y+p(this._fl,R)|0,this._gh=this._gh+b+p(this._gl,A)|0,this._hh=this._hh+v+p(this._hl,q)|0},o.prototype._hash=function(){var e=r.allocUnsafe(64);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+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},sha512$1=o}function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var e=requireInherits_browser(),t=requireSha512(),r=requireHash$1(),i=requireSafeBuffer$7().Buffer,n=new Array(160);function o(){this.init(),this._w=n,r.call(this,128,112)}return e(o,t),o.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},o.prototype._hash=function(){var e=i.allocUnsafe(48);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+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),e},sha384$1=o}function requireSha_js(){return hasRequiredSha_js||(hasRequiredSha_js=1,(e=sha_js).exports=function(t){var r=t.toLowerCase(),i=e.exports[r];if(!i)throw new Error(r+" is not supported (we accept pull requests)");return new i},e.exports.sha=requireSha$1(),e.exports.sha1=requireSha1$1(),e.exports.sha224=requireSha224(),e.exports.sha256=requireSha256(),e.exports.sha384=requireSha384(),e.exports.sha512=requireSha512()),sha_js.exports;var e}var safeBuffer$5={exports:{}},hasRequiredSafeBuffer$5,cipherBase,hasRequiredCipherBase,browser$b,hasRequiredBrowser$a,legacy,hasRequiredLegacy,md5$3,hasRequiredMd5$2,browser$a,hasRequiredBrowser$9;function requireSafeBuffer$5(){return hasRequiredSafeBuffer$5||(hasRequiredSafeBuffer$5=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$5,safeBuffer$5.exports)),safeBuffer$5.exports}function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var e=requireSafeBuffer$5().Buffer,t=requireStreamBrowserify().Transform,r=requireString_decoder().StringDecoder;function i(e){t.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}requireInherits_browser()(i,t);var n="undefined"!=typeof Uint8Array,o="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&ArrayBuffer.isView&&(e.prototype instanceof Uint8Array||e.TYPED_ARRAY_SUPPORT);return i.prototype.update=function(t,r,i){var s=function(t,r){if(t instanceof e)return t;if("string"==typeof t)return e.from(t,r);if(o&&ArrayBuffer.isView(t)){if(0===t.byteLength)return e.alloc(0);var i=e.from(t.buffer,t.byteOffset,t.byteLength);if(i.byteLength===t.byteLength)return i}if(n&&t instanceof Uint8Array)return e.from(t);if(e.isBuffer(t)&&t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t))return e.from(t);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}(t,r),a=this._update(s);return this.hashMode?this:(i&&(a=this._toString(a,i)),a)},i.prototype.setAutoPadding=function(){},i.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},i.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},i.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},i.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},i.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},i.prototype._finalOrDigest=function(t){var r=this.__final()||e.alloc(0);return t&&(r=this._toString(r,t,!0)),r},i.prototype._toString=function(e,t,i){if(this._decoder||(this._decoder=new r(t),this._encoding=t),this._encoding!==t)throw new Error("can’t switch encodings");var n=this._decoder.write(e);return i&&(n+=this._decoder.end()),n},cipherBase=i}function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$b;hasRequiredBrowser$a=1;var e=requireInherits_browser(),t=requireMd5_js(),r=requireRipemd160$1(),i=requireSha_js(),n=requireCipherBase();function o(e){n.call(this,"digest"),this._hash=e}return e(o,n),o.prototype._update=function(e){this._hash.update(e)},o.prototype._final=function(){return this._hash.digest()},browser$b=function(e){return"md5"===(e=e.toLowerCase())?new t:"rmd160"===e||"ripemd160"===e?new r:new o(i(e))}}function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var e=requireInherits_browser(),t=requireSafeBuffer$9().Buffer,r=requireCipherBase(),i=t.alloc(128),n=64;function o(e,o){r.call(this,"digest"),"string"==typeof o&&(o=t.from(o)),this._alg=e,this._key=o,o.length>n?o=e(o):o.length<n&&(o=t.concat([o,i],n));for(var s=this._ipad=t.allocUnsafe(n),a=this._opad=t.allocUnsafe(n),u=0;u<n;u++)s[u]=54^o[u],a[u]=92^o[u];this._hash=[s]}return e(o,r),o.prototype._update=function(e){this._hash.push(e)},o.prototype._final=function(){var e=this._alg(t.concat(this._hash));return this._alg(t.concat([this._opad,e]))},legacy=o}function requireMd5$2(){if(hasRequiredMd5$2)return md5$3;hasRequiredMd5$2=1;var e=requireMd5_js();return md5$3=function(t){return(new e).update(t).digest()}}function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$a;hasRequiredBrowser$9=1;var e=requireInherits_browser(),t=requireLegacy(),r=requireCipherBase(),i=requireSafeBuffer$9().Buffer,n=requireMd5$2(),o=requireRipemd160$1(),s=requireSha_js(),a=i.alloc(128);function u(e,t){r.call(this,"digest"),"string"==typeof t&&(t=i.from(t));var n="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>n)?t=("rmd160"===e?new o:s(e)).update(t).digest():t.length<n&&(t=i.concat([t,a],n));for(var u=this._ipad=i.allocUnsafe(n),h=this._opad=i.allocUnsafe(n),f=0;f<n;f++)u[f]=54^t[f],h[f]=92^t[f];this._hash="rmd160"===e?new o:s(e),this._hash.update(u)}return e(u,r),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new o:s(this._alg)).update(this._opad).update(e).digest()},browser$a=function(e,r){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new u("rmd160",r):"md5"===e?new t(n,r):new u(e,r)}}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},sha256={sign:"ecdsa",hash:"sha256",id:""},sha224={sign:"ecdsa",hash:"sha224",id:""},sha384={sign:"ecdsa",hash:"sha384",id:""},sha512={sign:"ecdsa",hash:"sha512",id:""},DSA={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption:sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:sha512WithRSAEncryption,"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:sha256,sha224:sha224,sha384:sha384,sha512:sha512,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:DSA,"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:ripemd160WithRSA,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos?algos:(hasRequiredAlgos=1,algos=require$$6)}var browser$9={},safeBuffer$4={exports:{}},hasRequiredSafeBuffer$4,precondition,hasRequiredPrecondition,defaultEncoding_1,hasRequiredDefaultEncoding,makeHash,hasRequiredMakeHash,md5$2,hasRequiredMd5$1,hashBase,hasRequiredHashBase,ripemd160,hasRequiredRipemd160,toBuffer_1,hasRequiredToBuffer,syncBrowser,hasRequiredSyncBrowser,async,hasRequiredAsync,hasRequiredBrowser$8;function requireSafeBuffer$4(){return hasRequiredSafeBuffer$4||(hasRequiredSafeBuffer$4=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$4,safeBuffer$4.exports)),safeBuffer$4.exports}function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var e=Math.pow(2,30)-1;return precondition=function(t,r){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>e||r!=r)throw new TypeError("Bad key length")}}function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;var e;if(hasRequiredDefaultEncoding=1,commonjsGlobal.process&&commonjsGlobal.process.browser)e="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){e=parseInt(process$1.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else e="utf-8";return defaultEncoding_1=e}function requireMakeHash(){if(hasRequiredMakeHash)return makeHash;hasRequiredMakeHash=1;var e=new Buffer(4);e.fill(0);return makeHash=function(t,r){var i=r(function(t){if(t.length%4!=0){var r=t.length+(4-t.length%4);t=Buffer.concat([t,e],r)}for(var i=new Array(t.length>>>2),n=0,o=0;n<t.length;n+=4,o++)i[o]=t.readInt32LE(n);return i}(t),8*t.length);t=new Buffer(16);for(var n=0;n<i.length;n++)t.writeInt32LE(i[n],n<<2,!0);return t}}function requireMd5$1(){if(hasRequiredMd5$1)return md5$2;hasRequiredMd5$1=1;var e=requireMakeHash();function t(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var r=1732584193,u=-271733879,h=-1732584194,f=271733878,l=0;l<e.length;l+=16){var c=r,d=u,p=h,m=f;r=i(r,u,h,f,e[l+0],7,-680876936),f=i(f,r,u,h,e[l+1],12,-389564586),h=i(h,f,r,u,e[l+2],17,606105819),u=i(u,h,f,r,e[l+3],22,-1044525330),r=i(r,u,h,f,e[l+4],7,-176418897),f=i(f,r,u,h,e[l+5],12,1200080426),h=i(h,f,r,u,e[l+6],17,-1473231341),u=i(u,h,f,r,e[l+7],22,-45705983),r=i(r,u,h,f,e[l+8],7,1770035416),f=i(f,r,u,h,e[l+9],12,-1958414417),h=i(h,f,r,u,e[l+10],17,-42063),u=i(u,h,f,r,e[l+11],22,-1990404162),r=i(r,u,h,f,e[l+12],7,1804603682),f=i(f,r,u,h,e[l+13],12,-40341101),h=i(h,f,r,u,e[l+14],17,-1502002290),r=n(r,u=i(u,h,f,r,e[l+15],22,1236535329),h,f,e[l+1],5,-165796510),f=n(f,r,u,h,e[l+6],9,-1069501632),h=n(h,f,r,u,e[l+11],14,643717713),u=n(u,h,f,r,e[l+0],20,-373897302),r=n(r,u,h,f,e[l+5],5,-701558691),f=n(f,r,u,h,e[l+10],9,38016083),h=n(h,f,r,u,e[l+15],14,-660478335),u=n(u,h,f,r,e[l+4],20,-405537848),r=n(r,u,h,f,e[l+9],5,568446438),f=n(f,r,u,h,e[l+14],9,-1019803690),h=n(h,f,r,u,e[l+3],14,-187363961),u=n(u,h,f,r,e[l+8],20,1163531501),r=n(r,u,h,f,e[l+13],5,-1444681467),f=n(f,r,u,h,e[l+2],9,-51403784),h=n(h,f,r,u,e[l+7],14,1735328473),r=o(r,u=n(u,h,f,r,e[l+12],20,-1926607734),h,f,e[l+5],4,-378558),f=o(f,r,u,h,e[l+8],11,-2022574463),h=o(h,f,r,u,e[l+11],16,1839030562),u=o(u,h,f,r,e[l+14],23,-35309556),r=o(r,u,h,f,e[l+1],4,-1530992060),f=o(f,r,u,h,e[l+4],11,1272893353),h=o(h,f,r,u,e[l+7],16,-155497632),u=o(u,h,f,r,e[l+10],23,-1094730640),r=o(r,u,h,f,e[l+13],4,681279174),f=o(f,r,u,h,e[l+0],11,-358537222),h=o(h,f,r,u,e[l+3],16,-722521979),u=o(u,h,f,r,e[l+6],23,76029189),r=o(r,u,h,f,e[l+9],4,-640364487),f=o(f,r,u,h,e[l+12],11,-421815835),h=o(h,f,r,u,e[l+15],16,530742520),r=s(r,u=o(u,h,f,r,e[l+2],23,-995338651),h,f,e[l+0],6,-198630844),f=s(f,r,u,h,e[l+7],10,1126891415),h=s(h,f,r,u,e[l+14],15,-1416354905),u=s(u,h,f,r,e[l+5],21,-57434055),r=s(r,u,h,f,e[l+12],6,1700485571),f=s(f,r,u,h,e[l+3],10,-1894986606),h=s(h,f,r,u,e[l+10],15,-1051523),u=s(u,h,f,r,e[l+1],21,-2054922799),r=s(r,u,h,f,e[l+8],6,1873313359),f=s(f,r,u,h,e[l+15],10,-30611744),h=s(h,f,r,u,e[l+6],15,-1560198380),u=s(u,h,f,r,e[l+13],21,1309151649),r=s(r,u,h,f,e[l+4],6,-145523070),f=s(f,r,u,h,e[l+11],10,-1120210379),h=s(h,f,r,u,e[l+2],15,718787259),u=s(u,h,f,r,e[l+9],21,-343485551),r=a(r,c),u=a(u,d),h=a(h,p),f=a(f,m)}return[r,u,h,f]}function r(e,t,r,i,n,o){return a((s=a(a(t,e),a(i,o)))<<(u=n)|s>>>32-u,r);var s,u}function i(e,t,i,n,o,s,a){return r(t&i|~t&n,e,t,o,s,a)}function n(e,t,i,n,o,s,a){return r(t&n|i&~n,e,t,o,s,a)}function o(e,t,i,n,o,s,a){return r(t^i^n,e,t,o,s,a)}function s(e,t,i,n,o,s,a){return r(i^(t|~n),e,t,o,s,a)}function a(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}return md5$2=function(r){return e(r,t)}}function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var e=requireStreamBrowserify().Transform;function t(t){e.call(this),this._block=new Buffer(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return requireInherits_browser()(t,e),t.prototype._transform=function(e,t,r){var i=null;try{"buffer"!==t&&(e=new Buffer(e,t)),this.update(e)}catch(e){i=e}r(i)},t.prototype._flush=function(e){var t=null;try{this.push(this._digest())}catch(e){t=e}e(t)},t.prototype.update=function(e,t){if(!Buffer.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");Buffer.isBuffer(e)||(e=new Buffer(e,t||"binary"));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)r[n++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var o=0,s=8*e.length;s>0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},t.prototype._update=function(e){throw new Error("_update is not implemented")},t.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();return void 0!==e&&(t=t.toString(e)),t},t.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=t}function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var e=requireInherits_browser(),t=requireHashBase();function r(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function i(e,t){return e<<t|e>>>32-t}function n(e,t,r,n,o,s,a,u){return i(e+(t^r^n)+s+a|0,u)+o|0}function o(e,t,r,n,o,s,a,u){return i(e+(t&r|~t&n)+s+a|0,u)+o|0}function s(e,t,r,n,o,s,a,u){return i(e+((t|~r)^n)+s+a|0,u)+o|0}function a(e,t,r,n,o,s,a,u){return i(e+(t&n|r&~n)+s+a|0,u)+o|0}function u(e,t,r,n,o,s,a,u){return i(e+(t^(r|~n))+s+a|0,u)+o|0}return e(r,t),r.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,h=this._b,f=this._c,l=this._d,c=this._e;r=n(r,h,f,l,c,e[0],0,11),c=n(c,r,h,f=i(f,10),l,e[1],0,14),l=n(l,c,r,h=i(h,10),f,e[2],0,15),f=n(f,l,c,r=i(r,10),h,e[3],0,12),h=n(h,f,l,c=i(c,10),r,e[4],0,5),r=n(r,h,f,l=i(l,10),c,e[5],0,8),c=n(c,r,h,f=i(f,10),l,e[6],0,7),l=n(l,c,r,h=i(h,10),f,e[7],0,9),f=n(f,l,c,r=i(r,10),h,e[8],0,11),h=n(h,f,l,c=i(c,10),r,e[9],0,13),r=n(r,h,f,l=i(l,10),c,e[10],0,14),c=n(c,r,h,f=i(f,10),l,e[11],0,15),l=n(l,c,r,h=i(h,10),f,e[12],0,6),f=n(f,l,c,r=i(r,10),h,e[13],0,7),h=n(h,f,l,c=i(c,10),r,e[14],0,9),c=o(c,r=n(r,h,f,l=i(l,10),c,e[15],0,8),h,f=i(f,10),l,e[7],1518500249,7),l=o(l,c,r,h=i(h,10),f,e[4],1518500249,6),f=o(f,l,c,r=i(r,10),h,e[13],1518500249,8),h=o(h,f,l,c=i(c,10),r,e[1],1518500249,13),r=o(r,h,f,l=i(l,10),c,e[10],1518500249,11),c=o(c,r,h,f=i(f,10),l,e[6],1518500249,9),l=o(l,c,r,h=i(h,10),f,e[15],1518500249,7),f=o(f,l,c,r=i(r,10),h,e[3],1518500249,15),h=o(h,f,l,c=i(c,10),r,e[12],1518500249,7),r=o(r,h,f,l=i(l,10),c,e[0],1518500249,12),c=o(c,r,h,f=i(f,10),l,e[9],1518500249,15),l=o(l,c,r,h=i(h,10),f,e[5],1518500249,9),f=o(f,l,c,r=i(r,10),h,e[2],1518500249,11),h=o(h,f,l,c=i(c,10),r,e[14],1518500249,7),r=o(r,h,f,l=i(l,10),c,e[11],1518500249,13),l=s(l,c=o(c,r,h,f=i(f,10),l,e[8],1518500249,12),r,h=i(h,10),f,e[3],1859775393,11),f=s(f,l,c,r=i(r,10),h,e[10],1859775393,13),h=s(h,f,l,c=i(c,10),r,e[14],1859775393,6),r=s(r,h,f,l=i(l,10),c,e[4],1859775393,7),c=s(c,r,h,f=i(f,10),l,e[9],1859775393,14),l=s(l,c,r,h=i(h,10),f,e[15],1859775393,9),f=s(f,l,c,r=i(r,10),h,e[8],1859775393,13),h=s(h,f,l,c=i(c,10),r,e[1],1859775393,15),r=s(r,h,f,l=i(l,10),c,e[2],1859775393,14),c=s(c,r,h,f=i(f,10),l,e[7],1859775393,8),l=s(l,c,r,h=i(h,10),f,e[0],1859775393,13),f=s(f,l,c,r=i(r,10),h,e[6],1859775393,6),h=s(h,f,l,c=i(c,10),r,e[13],1859775393,5),r=s(r,h,f,l=i(l,10),c,e[11],1859775393,12),c=s(c,r,h,f=i(f,10),l,e[5],1859775393,7),f=a(f,l=s(l,c,r,h=i(h,10),f,e[12],1859775393,5),c,r=i(r,10),h,e[1],2400959708,11),h=a(h,f,l,c=i(c,10),r,e[9],2400959708,12),r=a(r,h,f,l=i(l,10),c,e[11],2400959708,14),c=a(c,r,h,f=i(f,10),l,e[10],2400959708,15),l=a(l,c,r,h=i(h,10),f,e[0],2400959708,14),f=a(f,l,c,r=i(r,10),h,e[8],2400959708,15),h=a(h,f,l,c=i(c,10),r,e[12],2400959708,9),r=a(r,h,f,l=i(l,10),c,e[4],2400959708,8),c=a(c,r,h,f=i(f,10),l,e[13],2400959708,9),l=a(l,c,r,h=i(h,10),f,e[3],2400959708,14),f=a(f,l,c,r=i(r,10),h,e[7],2400959708,5),h=a(h,f,l,c=i(c,10),r,e[15],2400959708,6),r=a(r,h,f,l=i(l,10),c,e[14],2400959708,8),c=a(c,r,h,f=i(f,10),l,e[5],2400959708,6),l=a(l,c,r,h=i(h,10),f,e[6],2400959708,5),h=u(h,f=a(f,l,c,r=i(r,10),h,e[2],2400959708,12),l,c=i(c,10),r,e[4],2840853838,9),r=u(r,h,f,l=i(l,10),c,e[0],2840853838,15),c=u(c,r,h,f=i(f,10),l,e[5],2840853838,5),l=u(l,c,r,h=i(h,10),f,e[9],2840853838,11),f=u(f,l,c,r=i(r,10),h,e[7],2840853838,6),h=u(h,f,l,c=i(c,10),r,e[12],2840853838,8),r=u(r,h,f,l=i(l,10),c,e[2],2840853838,13),c=u(c,r,h,f=i(f,10),l,e[10],2840853838,12),l=u(l,c,r,h=i(h,10),f,e[14],2840853838,5),f=u(f,l,c,r=i(r,10),h,e[1],2840853838,12),h=u(h,f,l,c=i(c,10),r,e[3],2840853838,13),r=u(r,h,f,l=i(l,10),c,e[8],2840853838,14),c=u(c,r,h,f=i(f,10),l,e[11],2840853838,11),l=u(l,c,r,h=i(h,10),f,e[6],2840853838,8),f=u(f,l,c,r=i(r,10),h,e[15],2840853838,5),h=u(h,f,l,c=i(c,10),r,e[13],2840853838,6),l=i(l,10);var d=this._a,p=this._b,m=this._c,g=this._d,y=this._e;d=u(d,p,m,g,y,e[5],1352829926,8),y=u(y,d,p,m=i(m,10),g,e[14],1352829926,9),g=u(g,y,d,p=i(p,10),m,e[7],1352829926,9),m=u(m,g,y,d=i(d,10),p,e[0],1352829926,11),p=u(p,m,g,y=i(y,10),d,e[9],1352829926,13),d=u(d,p,m,g=i(g,10),y,e[2],1352829926,15),y=u(y,d,p,m=i(m,10),g,e[11],1352829926,15),g=u(g,y,d,p=i(p,10),m,e[4],1352829926,5),m=u(m,g,y,d=i(d,10),p,e[13],1352829926,7),p=u(p,m,g,y=i(y,10),d,e[6],1352829926,7),d=u(d,p,m,g=i(g,10),y,e[15],1352829926,8),y=u(y,d,p,m=i(m,10),g,e[8],1352829926,11),g=u(g,y,d,p=i(p,10),m,e[1],1352829926,14),m=u(m,g,y,d=i(d,10),p,e[10],1352829926,14),p=u(p,m,g,y=i(y,10),d,e[3],1352829926,12),y=a(y,d=u(d,p,m,g=i(g,10),y,e[12],1352829926,6),p,m=i(m,10),g,e[6],1548603684,9),g=a(g,y,d,p=i(p,10),m,e[11],1548603684,13),m=a(m,g,y,d=i(d,10),p,e[3],1548603684,15),p=a(p,m,g,y=i(y,10),d,e[7],1548603684,7),d=a(d,p,m,g=i(g,10),y,e[0],1548603684,12),y=a(y,d,p,m=i(m,10),g,e[13],1548603684,8),g=a(g,y,d,p=i(p,10),m,e[5],1548603684,9),m=a(m,g,y,d=i(d,10),p,e[10],1548603684,11),p=a(p,m,g,y=i(y,10),d,e[14],1548603684,7),d=a(d,p,m,g=i(g,10),y,e[15],1548603684,7),y=a(y,d,p,m=i(m,10),g,e[8],1548603684,12),g=a(g,y,d,p=i(p,10),m,e[12],1548603684,7),m=a(m,g,y,d=i(d,10),p,e[4],1548603684,6),p=a(p,m,g,y=i(y,10),d,e[9],1548603684,15),d=a(d,p,m,g=i(g,10),y,e[1],1548603684,13),g=s(g,y=a(y,d,p,m=i(m,10),g,e[2],1548603684,11),d,p=i(p,10),m,e[15],1836072691,9),m=s(m,g,y,d=i(d,10),p,e[5],1836072691,7),p=s(p,m,g,y=i(y,10),d,e[1],1836072691,15),d=s(d,p,m,g=i(g,10),y,e[3],1836072691,11),y=s(y,d,p,m=i(m,10),g,e[7],1836072691,8),g=s(g,y,d,p=i(p,10),m,e[14],1836072691,6),m=s(m,g,y,d=i(d,10),p,e[6],1836072691,6),p=s(p,m,g,y=i(y,10),d,e[9],1836072691,14),d=s(d,p,m,g=i(g,10),y,e[11],1836072691,12),y=s(y,d,p,m=i(m,10),g,e[8],1836072691,13),g=s(g,y,d,p=i(p,10),m,e[12],1836072691,5),m=s(m,g,y,d=i(d,10),p,e[2],1836072691,14),p=s(p,m,g,y=i(y,10),d,e[10],1836072691,13),d=s(d,p,m,g=i(g,10),y,e[0],1836072691,13),y=s(y,d,p,m=i(m,10),g,e[4],1836072691,7),m=o(m,g=s(g,y,d,p=i(p,10),m,e[13],1836072691,5),y,d=i(d,10),p,e[8],2053994217,15),p=o(p,m,g,y=i(y,10),d,e[6],2053994217,5),d=o(d,p,m,g=i(g,10),y,e[4],2053994217,8),y=o(y,d,p,m=i(m,10),g,e[1],2053994217,11),g=o(g,y,d,p=i(p,10),m,e[3],2053994217,14),m=o(m,g,y,d=i(d,10),p,e[11],2053994217,14),p=o(p,m,g,y=i(y,10),d,e[15],2053994217,6),d=o(d,p,m,g=i(g,10),y,e[0],2053994217,14),y=o(y,d,p,m=i(m,10),g,e[5],2053994217,6),g=o(g,y,d,p=i(p,10),m,e[12],2053994217,9),m=o(m,g,y,d=i(d,10),p,e[2],2053994217,12),p=o(p,m,g,y=i(y,10),d,e[13],2053994217,9),d=o(d,p,m,g=i(g,10),y,e[9],2053994217,12),y=o(y,d,p,m=i(m,10),g,e[7],2053994217,5),g=o(g,y,d,p=i(p,10),m,e[10],2053994217,15),p=n(p,m=o(m,g,y,d=i(d,10),p,e[14],2053994217,8),g,y=i(y,10),d,e[12],0,8),d=n(d,p,m,g=i(g,10),y,e[15],0,5),y=n(y,d,p,m=i(m,10),g,e[10],0,12),g=n(g,y,d,p=i(p,10),m,e[4],0,9),m=n(m,g,y,d=i(d,10),p,e[1],0,12),p=n(p,m,g,y=i(y,10),d,e[5],0,5),d=n(d,p,m,g=i(g,10),y,e[8],0,14),y=n(y,d,p,m=i(m,10),g,e[7],0,6),g=n(g,y,d,p=i(p,10),m,e[6],0,8),m=n(m,g,y,d=i(d,10),p,e[2],0,13),p=n(p,m,g,y=i(y,10),d,e[13],0,6),d=n(d,p,m,g=i(g,10),y,e[14],0,5),y=n(y,d,p,m=i(m,10),g,e[0],0,15),g=n(g,y,d,p=i(p,10),m,e[3],0,13),m=n(m,g,y,d=i(d,10),p,e[9],0,11),p=n(p,m,g,y=i(y,10),d,e[11],0,11),g=i(g,10);var b=this._b+f+g|0;this._b=this._c+l+y|0,this._c=this._d+c+d|0,this._d=this._e+r+p|0,this._e=this._a+h+m|0,this._a=b},r.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=new Buffer(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},ripemd160=r}function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer_1;hasRequiredToBuffer=1;var e=requireSafeBuffer$4().Buffer,t=requireToBuffer$1(),r="undefined"!=typeof Uint8Array,i=r&&"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView;return toBuffer_1=function(n,o,s){if("string"==typeof n||e.isBuffer(n)||r&&n instanceof Uint8Array||i&&i(n))return t(n,o);throw new TypeError(s+" must be a string, a Buffer, a Uint8Array, or a DataView")}}function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var e=requireMd5$1(),t=requireRipemd160(),r=requireSha_js(),i=requireSafeBuffer$4().Buffer,n=requirePrecondition(),o=requireDefaultEncoding(),s=requireToBuffer(),a=i.alloc(128),u={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},h={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function f(e){return(new t).update(e).digest()}function l(t,n,o){var s=function(t){return"rmd160"===t||"ripemd160"===t?f:"md5"===t?e:function(e){return r(t).update(e).digest()}}(t),h="sha512"===t||"sha384"===t?128:64;n.length>h?n=s(n):n.length<h&&(n=i.concat([n,a],h));for(var l=i.allocUnsafe(h+u[t]),c=i.allocUnsafe(h+u[t]),d=0;d<h;d++)l[d]=54^n[d],c[d]=92^n[d];var p=i.allocUnsafe(h+o+4);l.copy(p,0,0,h),this.ipad1=p,this.ipad2=l,this.opad=c,this.alg=t,this.blocksize=h,this.hash=s,this.size=u[t]}return l.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},syncBrowser=function(e,t,r,a,f){n(r,a),e=s(e,o,"Password"),t=s(t,o,"Salt");var c=(f||"sha1").toLowerCase(),d=h[c]||c,p=u[d];if("number"!=typeof p||!p)throw new TypeError("Digest algorithm not supported: "+f);var m=new l(d,e,t.length),g=i.allocUnsafe(a),y=i.allocUnsafe(t.length+4);t.copy(y,0,0,t.length);for(var b=0,v=p,w=Math.ceil(a/v),_=1;_<=w;_++){y.writeUInt32BE(_,t.length);for(var M=m.run(y,m.ipad1),S=M,E=1;E<r;E++){S=m.run(S,m.ipad2);for(var R=0;R<v;R++)M[R]^=S[R]}M.copy(g,b),b+=v}return g}}function requireAsync(){if(hasRequiredAsync)return async;hasRequiredAsync=1;var e,t,r=requireSafeBuffer$4().Buffer,i=requirePrecondition(),n=requireDefaultEncoding(),o=requireSyncBrowser(),s=requireToBuffer(),a=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,u={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function f(){return t||(t=commonjsGlobal.process&&commonjsGlobal.process.nextTick?commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?commonjsGlobal.setImmediate:commonjsGlobal.setTimeout)}function l(e,t,i,n,o){return a.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return a.deriveBits({name:"PBKDF2",salt:t,iterations:i,hash:{name:o}},e,n<<3)})).then((function(e){return r.from(e)}))}return async=function(t,c,d,p,m,g){"function"==typeof m&&(g=m,m=void 0);var y=u[(m=m||"sha1").toLowerCase()];if(y&&"function"==typeof commonjsGlobal.Promise){if(i(d,p),t=s(t,n,"Password"),c=s(c,n,"Salt"),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){f()((function(){t(null,e)}))}),(function(e){f()((function(){t(e)}))}))}(function(t){if(commonjsGlobal.process&&!commonjsGlobal.process.browser)return Promise.resolve(!1);if(!a||!a.importKey||!a.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var i=l(e=e||r.alloc(8),e,10,128,t).then((function(){return!0}),(function(){return!1}));return h[t]=i,i}(y).then((function(e){return e?l(t,c,d,p,y):o(t,c,d,p,m)})),g)}else f()((function(){var e;try{e=o(t,c,d,p,m)}catch(e){return void g(e)}g(null,e)}))}}function requireBrowser$8(){return hasRequiredBrowser$8||(hasRequiredBrowser$8=1,browser$9.pbkdf2=requireAsync(),browser$9.pbkdf2Sync=requireSyncBrowser()),browser$9}var browser$8={},des$1={},utils$3={},hasRequiredUtils$3,minimalisticAssert,hasRequiredMinimalisticAssert,cipher,hasRequiredCipher,des,hasRequiredDes$1;function requireUtils$3(){if(hasRequiredUtils$3)return utils$3;hasRequiredUtils$3=1,utils$3.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},utils$3.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},utils$3.ip=function(e,t,r,i){for(var n=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)n<<=1,n|=t>>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=e>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1}r[i+0]=n>>>0,r[i+1]=o>>>0},utils$3.rip=function(e,t,r,i){for(var n=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)n<<=1,n|=t>>>a+s&1,n<<=1,n|=e>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=t>>>a+s&1,o<<=1,o|=e>>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},utils$3.pc1=function(e,t,r,i){for(var n=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)n<<=1,n|=t>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=e>>a+s&1}for(a=0;a<=24;a+=8)n<<=1,n|=t>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;r[i+0]=n>>>0,r[i+1]=o>>>0},utils$3.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var e=[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];utils$3.pc2=function(t,r,i,n){for(var o=0,s=0,a=e.length>>>1,u=0;u<a;u++)o<<=1,o|=t>>>e[u]&1;for(u=a;u<e.length;u++)s<<=1,s|=r>>>e[u]&1;i[n+0]=o>>>0,i[n+1]=s>>>0},utils$3.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)i<<=6,i|=e>>>o&63;for(o=11;o>=3;o-=4)n|=e>>>o&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var t=[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];utils$3.substitute=function(e,r){for(var i=0,n=0;n<4;n++){i<<=4,i|=t[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){i<<=4,i|=t[256+64*n+(r>>>18-6*n&63)]}return i>>>0};var r=[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];return utils$3.permute=function(e){for(var t=0,i=0;i<r.length;i++)t<<=1,t|=e>>>r[i]&1;return t>>>0},utils$3.padSplit=function(e,t,r){for(var i=e.toString(2);i.length<t;)i="0"+i;for(var n=[],o=0;o<t;o+=r)n.push(i.slice(o,o+r));return n.join(" ")},utils$3}function requireMinimalisticAssert(){if(hasRequiredMinimalisticAssert)return minimalisticAssert;function e(e,t){if(!e)throw new Error(t||"Assertion failed")}return hasRequiredMinimalisticAssert=1,minimalisticAssert=e,e.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)},minimalisticAssert}function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var e=requireMinimalisticAssert();function t(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}return cipher=t,t.prototype._init=function(){},t.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},t.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),i=0;i<r;i++)this.buffer[this.bufferOff+i]=e[t+i];return this.bufferOff+=r,r},t.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},t.prototype._updateEncrypt=function(e){var t=0,r=0,i=(this.bufferOff+e.length)/this.blockSize|0,n=new Array(i*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(n,r)));for(var o=e.length-(e.length-t)%this.blockSize;t<o;t+=this.blockSize)this._update(e,t,n,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return n},t.prototype._updateDecrypt=function(e){for(var t=0,r=0,i=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,n=new Array(i*this.blockSize);i>0;i--)t+=this._buffer(e,t),r+=this._flushBuffer(n,r);return t+=this._buffer(e,t),n},t.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},t.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},t.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},t.prototype._unpad=function(e){return e},t.prototype._finalDecrypt=function(){e.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)},cipher}function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var e=requireMinimalisticAssert(),t=requireInherits_browser(),r=requireUtils$3(),i=requireCipher();function n(){this.tmp=new Array(2),this.keys=null}function o(e){i.call(this,e);var t=new n;this._desState=t,this.deriveKeys(t,e.key)}t(o,i),des=o,o.create=function(e){return new o(e)};var s=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return o.prototype.deriveKeys=function(t,i){t.keys=new Array(32),e.equal(i.length,this.blockSize,"Invalid key length");var n=r.readUInt32BE(i,0),o=r.readUInt32BE(i,4);r.pc1(n,o,t.tmp,0),n=t.tmp[0],o=t.tmp[1];for(var a=0;a<t.keys.length;a+=2){var u=s[a>>>1];n=r.r28shl(n,u),o=r.r28shl(o,u),r.pc2(n,o,t.keys,a)}},o.prototype._update=function(e,t,i,n){var o=this._desState,s=r.readUInt32BE(e,t),a=r.readUInt32BE(e,t+4);r.ip(s,a,o.tmp,0),s=o.tmp[0],a=o.tmp[1],"encrypt"===this.type?this._encrypt(o,s,a,o.tmp,0):this._decrypt(o,s,a,o.tmp,0),s=o.tmp[0],a=o.tmp[1],r.writeUInt32BE(i,s,n),r.writeUInt32BE(i,a,n+4)},o.prototype._pad=function(e,t){if(!1===this.padding)return!1;for(var r=e.length-t,i=t;i<e.length;i++)e[i]=r;return!0},o.prototype._unpad=function(t){if(!1===this.padding)return t;for(var r=t[t.length-1],i=t.length-r;i<t.length;i++)e.equal(t[i],r);return t.slice(0,t.length-r)},o.prototype._encrypt=function(e,t,i,n,o){for(var s=t,a=i,u=0;u<e.keys.length;u+=2){var h=e.keys[u],f=e.keys[u+1];r.expand(a,e.tmp,0),h^=e.tmp[0],f^=e.tmp[1];var l=r.substitute(h,f),c=a;a=(s^r.permute(l))>>>0,s=c}r.rip(a,s,n,o)},o.prototype._decrypt=function(e,t,i,n,o){for(var s=i,a=t,u=e.keys.length-2;u>=0;u-=2){var h=e.keys[u],f=e.keys[u+1];r.expand(s,e.tmp,0),h^=e.tmp[0],f^=e.tmp[1];var l=r.substitute(h,f),c=s;s=(a^r.permute(l))>>>0,a=c}r.rip(s,a,n,o)},des}var cbc$1={},hasRequiredCbc$1,ede,hasRequiredEde,hasRequiredDes,browserifyDes,hasRequiredBrowserifyDes;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var e=requireMinimalisticAssert(),t=requireInherits_browser(),r={};function i(t){e.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var r=0;r<this.iv.length;r++)this.iv[r]=t[r]}return cbc$1.instantiate=function(e){function i(t){e.call(this,t),this._cbcInit()}t(i,e);for(var n=Object.keys(r),o=0;o<n.length;o++){var s=n[o];i.prototype[s]=r[s]}return i.create=function(e){return new i(e)},i},r._cbcInit=function(){var e=new i(this.options.iv);this._cbcState=e},r._update=function(e,t,r,i){var n=this._cbcState,o=this.constructor.super_.prototype,s=n.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=e[t+a];o._update.call(this,s,0,r,i);for(a=0;a<this.blockSize;a++)s[a]=r[i+a]}else{o._update.call(this,e,t,r,i);for(a=0;a<this.blockSize;a++)r[i+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=e[t+a]}},cbc$1}function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var e=requireMinimalisticAssert(),t=requireInherits_browser(),r=requireCipher(),i=requireDes$1();function n(t,r){e.equal(r.length,24,"Invalid key length");var n=r.slice(0,8),o=r.slice(8,16),s=r.slice(16,24);this.ciphers="encrypt"===t?[i.create({type:"encrypt",key:n}),i.create({type:"decrypt",key:o}),i.create({type:"encrypt",key:s})]:[i.create({type:"decrypt",key:s}),i.create({type:"encrypt",key:o}),i.create({type:"decrypt",key:n})]}function o(e){r.call(this,e);var t=new n(this.type,this.options.key);this._edeState=t}return t(o,r),ede=o,o.create=function(e){return new o(e)},o.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},o.prototype._pad=i.prototype._pad,o.prototype._unpad=i.prototype._unpad,ede}function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils$3(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var e=requireCipherBase(),t=requireDes(),r=requireInherits_browser(),i=requireSafeBuffer$9().Buffer,n={"des-ede3-cbc":t.CBC.instantiate(t.EDE),"des-ede3":t.EDE,"des-ede-cbc":t.CBC.instantiate(t.EDE),"des-ede":t.EDE,"des-cbc":t.CBC.instantiate(t.DES),"des-ecb":t.DES};function o(t){e.call(this);var r,o=t.mode.toLowerCase(),s=n[o];r=t.decrypt?"decrypt":"encrypt";var a=t.key;i.isBuffer(a)||(a=i.from(a)),"des-ede"!==o&&"des-ede-cbc"!==o||(a=i.concat([a,a.slice(0,8)]));var u=t.iv;i.isBuffer(u)||(u=i.from(u)),this._des=s.create({key:a,iv:u,type:r})}return n.des=n["des-cbc"],n.des3=n["des-ede3-cbc"],browserifyDes=o,r(o,e),o.prototype._update=function(e){return i.from(this._des.update(e))},o.prototype._final=function(){return i.from(this._des.final())},browserifyDes}var browser$7={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(e,t){return e._cipher.encryptBlock(t)},ecb.decrypt=function(e,t){return e._cipher.decryptBlock(t)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor,hasRequiredCbc;function requireBufferXor(){return hasRequiredBufferXor?bufferXor:(hasRequiredBufferXor=1,bufferXor=function(e,t){for(var r=Math.min(e.length,t.length),i=new Buffer(r),n=0;n<r;++n)i[n]=e[n]^t[n];return i})}function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var e=requireBufferXor();return cbc.encrypt=function(t,r){var i=e(r,t._prev);return t._prev=t._cipher.encryptBlock(i),t._prev},cbc.decrypt=function(t,r){var i=t._prev;t._prev=r;var n=t._cipher.decryptBlock(r);return e(n,i)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var e=requireSafeBuffer$9().Buffer,t=requireBufferXor();function r(r,i,n){var o=i.length,s=t(i,r._cache);return r._cache=r._cache.slice(o),r._prev=e.concat([r._prev,n?i:s]),s}return cfb.encrypt=function(t,i,n){for(var o,s=e.allocUnsafe(0);i.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=e.allocUnsafe(0)),!(t._cache.length<=i.length)){s=e.concat([s,r(t,i,n)]);break}o=t._cache.length,s=e.concat([s,r(t,i.slice(0,o),n)]),i=i.slice(o)}return s},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var e=requireSafeBuffer$9().Buffer;function t(t,r,i){var n=t._cipher.encryptBlock(t._prev)[0]^r;return t._prev=e.concat([t._prev.slice(1),e.from([i?r:n])]),n}return cfb8.encrypt=function(r,i,n){for(var o=i.length,s=e.allocUnsafe(o),a=-1;++a<o;)s[a]=t(r,i[a],n);return s},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var e=requireSafeBuffer$9().Buffer;function t(e,t,i){for(var n,o,s=-1,a=0;++s<8;)n=t&1<<7-s?128:0,a+=(128&(o=e._cipher.encryptBlock(e._prev)[0]^n))>>s%8,e._prev=r(e._prev,i?n:o);return a}function r(t,r){var i=t.length,n=-1,o=e.allocUnsafe(t.length);for(t=e.concat([t,e.from([r])]);++n<i;)o[n]=t[n]<<1|t[n+1]>>7;return o}return cfb1.encrypt=function(r,i,n){for(var o=i.length,s=e.allocUnsafe(o),a=-1;++a<o;)s[a]=t(r,i[a],n);return s},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var e=requireBufferXor();function t(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}return ofb.encrypt=function(r,i){for(;r._cache.length<i.length;)r._cache=Buffer.concat([r._cache,t(r)]);var n=r._cache.slice(0,i.length);return r._cache=r._cache.slice(i.length),e(i,n)},ofb}var ctr={},incr32_1,hasRequiredIncr32,hasRequiredCtr;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;return hasRequiredIncr32=1,incr32_1=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}}function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var e=requireBufferXor(),t=requireSafeBuffer$9().Buffer,r=requireIncr32();function i(e){var t=e._cipher.encryptBlockRaw(e._prev);return r(e._prev),t}return ctr.encrypt=function(r,n){var o=Math.ceil(n.length/16),s=r._cache.length;r._cache=t.concat([r._cache,t.allocUnsafe(16*o)]);for(var a=0;a<o;a++){var u=i(r),h=s+16*a;r._cache.writeUInt32BE(u[0],h+0),r._cache.writeUInt32BE(u[1],h+4),r._cache.writeUInt32BE(u[2],h+8),r._cache.writeUInt32BE(u[3],h+12)}var f=r._cache.slice(0,n.length);return r._cache=r._cache.slice(n.length),e(n,f)},ctr}const aes128={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},require$$2={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:aes128,aes192:aes192,aes256:aes256,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var e={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},t=require$$2;for(var r in t)t[r].module=e[t[r].mode];return modes_1=t}var aes$2={},hasRequiredAes$1,ghash,hasRequiredGhash,authCipher,hasRequiredAuthCipher,streamCipher,hasRequiredStreamCipher,evp_bytestokey,hasRequiredEvp_bytestokey,hasRequiredEncrypter;function requireAes$1(){if(hasRequiredAes$1)return aes$2;hasRequiredAes$1=1;var e=requireSafeBuffer$9().Buffer;function t(t){e.isBuffer(t)||(t=e.from(t));for(var r=t.length/4|0,i=new Array(r),n=0;n<r;n++)i[n]=t.readUInt32BE(4*n);return i}function r(e){for(;0<e.length;e++)e[0]=0}function i(e,t,r,i,n){for(var o,s,a,u,h=r[0],f=r[1],l=r[2],c=r[3],d=e[0]^t[0],p=e[1]^t[1],m=e[2]^t[2],g=e[3]^t[3],y=4,b=1;b<n;b++)o=h[d>>>24]^f[p>>>16&255]^l[m>>>8&255]^c[255&g]^t[y++],s=h[p>>>24]^f[m>>>16&255]^l[g>>>8&255]^c[255&d]^t[y++],a=h[m>>>24]^f[g>>>16&255]^l[d>>>8&255]^c[255&p]^t[y++],u=h[g>>>24]^f[d>>>16&255]^l[p>>>8&255]^c[255&m]^t[y++],d=o,p=s,m=a,g=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^t[y++],s=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&d])^t[y++],a=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^t[y++],u=(i[g>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^t[y++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var n=[0,1,2,4,8,16,32,64,128,27,54],o=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var h=a^a<<1^a<<2^a<<3^a<<4;h=h>>>8^255&h^99,r[s]=h,i[h]=s;var f=e[s],l=e[f],c=e[l],d=257*e[h]^16843008*h;n[0][s]=d<<24|d>>>8,n[1][s]=d<<16|d>>>16,n[2][s]=d<<8|d>>>24,n[3][s]=d,d=16843009*c^65537*l^257*f^16843008*s,o[0][h]=d<<24|d>>>8,o[1][h]=d<<16|d>>>16,o[2][h]=d<<8|d>>>24,o[3][h]=d,0===s?s=a=1:(s=f^e[e[e[c^f]]],a^=e[e[a]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function s(e){this._key=t(e),this._reset()}return s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),s=[],a=0;a<t;a++)s[a]=e[a];for(a=t;a<i;a++){var u=s[a-1];a%t==0?(u=u<<8|u>>>24,u=o.SBOX[u>>>24]<<24|o.SBOX[u>>>16&255]<<16|o.SBOX[u>>>8&255]<<8|o.SBOX[255&u],u^=n[a/t|0]<<24):t>6&&a%t==4&&(u=o.SBOX[u>>>24]<<24|o.SBOX[u>>>16&255]<<16|o.SBOX[u>>>8&255]<<8|o.SBOX[255&u]),s[a]=s[a-t]^u}for(var h=[],f=0;f<i;f++){var l=i-f,c=s[l-(f%4?0:4)];h[f]=f<4||l<=4?c:o.INV_SUB_MIX[0][o.SBOX[c>>>24]]^o.INV_SUB_MIX[1][o.SBOX[c>>>16&255]]^o.INV_SUB_MIX[2][o.SBOX[c>>>8&255]]^o.INV_SUB_MIX[3][o.SBOX[255&c]]}this._nRounds=r,this._keySchedule=s,this._invKeySchedule=h},s.prototype.encryptBlockRaw=function(e){return i(e=t(e),this._keySchedule,o.SUB_MIX,o.SBOX,this._nRounds)},s.prototype.encryptBlock=function(t){var r=this.encryptBlockRaw(t),i=e.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[1],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[3],12),i},s.prototype.decryptBlock=function(r){var n=(r=t(r))[1];r[1]=r[3],r[3]=n;var s=i(r,this._invKeySchedule,o.INV_SUB_MIX,o.INV_SBOX,this._nRounds),a=e.allocUnsafe(16);return a.writeUInt32BE(s[0],0),a.writeUInt32BE(s[3],4),a.writeUInt32BE(s[2],8),a.writeUInt32BE(s[1],12),a},s.prototype.scrub=function(){r(this._keySchedule),r(this._invKeySchedule),r(this._key)},aes$2.AES=s,aes$2}function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var e=requireSafeBuffer$9().Buffer,t=e.alloc(16,0);function r(t){var r=e.allocUnsafe(16);return r.writeUInt32BE(t[0]>>>0,0),r.writeUInt32BE(t[1]>>>0,4),r.writeUInt32BE(t[2]>>>0,8),r.writeUInt32BE(t[3]>>>0,12),r}function i(t){this.h=t,this.state=e.alloc(16,0),this.cache=e.allocUnsafe(0)}return i.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},i.prototype._multiply=function(){for(var e,t,i,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],o=[0,0,0,0],s=-1;++s<128;){for(!!(this.state[~~(s/8)]&1<<7-s%8)&&(o[0]^=n[0],o[1]^=n[1],o[2]^=n[2],o[3]^=n[3]),i=!!(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,i&&(n[0]=n[0]^225<<24)}this.state=r(o)},i.prototype.update=function(t){var r;for(this.cache=e.concat([this.cache,t]);this.cache.length>=16;)r=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(r)},i.prototype.final=function(i,n){return this.cache.length&&this.ghash(e.concat([this.cache,t],16)),this.ghash(r([0,i,0,n])),this.state},ghash=i}function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var e=requireAes$1(),t=requireSafeBuffer$9().Buffer,r=requireCipherBase(),i=requireInherits_browser(),n=requireGhash(),o=requireBufferXor(),s=requireIncr32();function a(i,o,a,u){r.call(this);var h=t.alloc(4,0);this._cipher=new e.AES(o);var f=this._cipher.encryptBlock(h);this._ghash=new n(f),a=function(e,r,i){if(12===r.length)return e._finID=t.concat([r,t.from([0,0,0,1])]),t.concat([r,t.from([0,0,0,2])]);var o=new n(i),a=r.length,u=a%16;o.update(r),u&&(u=16-u,o.update(t.alloc(u,0))),o.update(t.alloc(8,0));var h=8*a,f=t.alloc(8);f.writeUIntBE(h,0,8),o.update(f),e._finID=o.state;var l=t.from(e._finID);return s(l),l}(this,a,f),this._prev=t.from(a),this._cache=t.allocUnsafe(0),this._secCache=t.allocUnsafe(0),this._decrypt=u,this._alen=0,this._len=0,this._mode=i,this._authTag=null,this._called=!1}return i(a,r),a.prototype._update=function(e){if(!this._called&&this._alen){var r=16-this._alen%16;r<16&&(r=t.alloc(r,0),this._ghash.update(r))}this._called=!0;var i=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(i),this._len+=e.length,i},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=o(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n<i;++n)r+=e[n]^t[n];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},a.prototype.getAuthTag=function(){if(this._decrypt||!t.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},a.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},a.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},authCipher=a}function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var e=requireAes$1(),t=requireSafeBuffer$9().Buffer,r=requireCipherBase();function i(i,n,o,s){r.call(this),this._cipher=new e.AES(n),this._prev=t.from(o),this._cache=t.allocUnsafe(0),this._secCache=t.allocUnsafe(0),this._decrypt=s,this._mode=i}return requireInherits_browser()(i,r),i.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},i.prototype._final=function(){this._cipher.scrub()},streamCipher=i}function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var e=requireSafeBuffer$9().Buffer,t=requireMd5_js();return evp_bytestokey=function(r,i,n,o){if(e.isBuffer(r)||(r=e.from(r,"binary")),i&&(e.isBuffer(i)||(i=e.from(i,"binary")),8!==i.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=n/8,a=e.alloc(s),u=e.alloc(o||0),h=e.alloc(0);s>0||o>0;){var f=new t;f.update(h),f.update(r),i&&f.update(i),h=f.digest();var l=0;if(s>0){var c=a.length-s;l=Math.min(s,h.length),h.copy(a,c,0,l),s-=l}if(l<h.length&&o>0){var d=u.length-o,p=Math.min(o,h.length-l);h.copy(u,d,l,l+p),o-=p}}return h.fill(0),{key:a,iv:u}}}function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var e=requireModes$1(),t=requireAuthCipher(),r=requireSafeBuffer$9().Buffer,i=requireStreamCipher(),n=requireCipherBase(),o=requireAes$1(),s=requireEvp_bytestokey();function a(e,t,i){n.call(this),this._cache=new h,this._cipher=new o.AES(t),this._prev=r.from(i),this._mode=e,this._autopadding=!0}requireInherits_browser()(a,n),a.prototype._update=function(e){var t,i;this._cache.add(e);for(var n=[];t=this._cache.get();)i=this._mode.encrypt(this,t),n.push(i);return r.concat(n)};var u=r.alloc(16,16);function h(){this.cache=r.allocUnsafe(0)}function f(n,o,s){var u=e[n.toLowerCase()];if(!u)throw new TypeError("invalid suite type");if("string"==typeof o&&(o=r.from(o)),o.length!==u.key/8)throw new TypeError("invalid key length "+o.length);if("string"==typeof s&&(s=r.from(s)),"GCM"!==u.mode&&s.length!==u.iv)throw new TypeError("invalid iv length "+s.length);return"stream"===u.type?new i(u.module,o,s):"auth"===u.type?new t(u.module,o,s):new a(u.module,o,s)}return a.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(u))throw this._cipher.scrub(),new Error("data not multiple of block length")},a.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=r.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=r.allocUnsafe(e),i=-1;++i<e;)t.writeUInt8(e,i);return r.concat([this.cache,t])},encrypter.createCipheriv=f,encrypter.createCipher=function(t,r){var i=e[t.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var n=s(r,!1,i.key,i.iv);return f(t,n.key,n.iv)},encrypter}var decrypter={},hasRequiredDecrypter,hasRequiredBrowser$7;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var e=requireAuthCipher(),t=requireSafeBuffer$9().Buffer,r=requireModes$1(),i=requireStreamCipher(),n=requireCipherBase(),o=requireAes$1(),s=requireEvp_bytestokey();function a(e,r,i){n.call(this),this._cache=new u,this._last=void 0,this._cipher=new o.AES(r),this._prev=t.from(i),this._mode=e,this._autopadding=!0}function u(){this.cache=t.allocUnsafe(0)}function h(n,o,s){var u=r[n.toLowerCase()];if(!u)throw new TypeError("invalid suite type");if("string"==typeof s&&(s=t.from(s)),"GCM"!==u.mode&&s.length!==u.iv)throw new TypeError("invalid iv length "+s.length);if("string"==typeof o&&(o=t.from(o)),o.length!==u.key/8)throw new TypeError("invalid key length "+o.length);return"stream"===u.type?new i(u.module,o,s,!0):"auth"===u.type?new e(u.module,o,s,!0):new a(u.module,o,s)}return requireInherits_browser()(a,n),a.prototype._update=function(e){var r,i;this._cache.add(e);for(var n=[];r=this._cache.get(this._autopadding);)i=this._mode.decrypt(this,r),n.push(i);return t.concat(n)},a.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},a.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},u.prototype.add=function(e){this.cache=t.concat([this.cache,e])},u.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},u.prototype.flush=function(){if(this.cache.length)return this.cache},decrypter.createDecipher=function(e,t){var i=r[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var n=s(t,!1,i.key,i.iv);return h(e,n.key,n.iv)},decrypter.createDecipheriv=h,decrypter}function requireBrowser$7(){if(hasRequiredBrowser$7)return browser$7;hasRequiredBrowser$7=1;var e=requireEncrypter(),t=requireDecrypter(),r=require$$2;return browser$7.createCipher=browser$7.Cipher=e.createCipher,browser$7.createCipheriv=browser$7.Cipheriv=e.createCipheriv,browser$7.createDecipher=browser$7.Decipher=t.createDecipher,browser$7.createDecipheriv=browser$7.Decipheriv=t.createDecipheriv,browser$7.listCiphers=browser$7.getCiphers=function(){return Object.keys(r)},browser$7}var modes={},hasRequiredModes,hasRequiredBrowser$6;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,(e=modes)["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}),modes;var e}function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$8;hasRequiredBrowser$6=1;var e=requireBrowserifyDes(),t=requireBrowser$7(),r=requireModes$1(),i=requireModes(),n=requireEvp_bytestokey();function o(n,o,s){if(n=n.toLowerCase(),r[n])return t.createCipheriv(n,o,s);if(i[n])return new e({key:o,iv:s,mode:n});throw new TypeError("invalid suite type")}function s(n,o,s){if(n=n.toLowerCase(),r[n])return t.createDecipheriv(n,o,s);if(i[n])return new e({key:o,iv:s,mode:n,decrypt:!0});throw new TypeError("invalid suite type")}return browser$8.createCipher=browser$8.Cipher=function(e,t){var s,a;if(e=e.toLowerCase(),r[e])s=r[e].key,a=r[e].iv;else{if(!i[e])throw new TypeError("invalid suite type");s=8*i[e].key,a=i[e].iv}var u=n(t,!1,s,a);return o(e,u.key,u.iv)},browser$8.createCipheriv=browser$8.Cipheriv=o,browser$8.createDecipher=browser$8.Decipher=function(e,t){var o,a;if(e=e.toLowerCase(),r[e])o=r[e].key,a=r[e].iv;else{if(!i[e])throw new TypeError("invalid suite type");o=8*i[e].key,a=i[e].iv}var u=n(t,!1,o,a);return s(e,u.key,u.iv)},browser$8.createDecipheriv=browser$8.Decipheriv=s,browser$8.listCiphers=browser$8.getCiphers=function(){return Object.keys(i).concat(t.getCiphers())},browser$8}var browser$6={},bn$d={exports:{}},bn$c=bn$d.exports,hasRequiredBn$6;function requireBn$6(){return hasRequiredBn$6||(hasRequiredBn$6=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$d,bn$c)),bn$d.exports}var bn$b={exports:{}},bn$a=bn$b.exports,hasRequiredBn$5;function requireBn$5(){return hasRequiredBn$5||(hasRequiredBn$5=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$b,bn$a)),bn$b.exports}var brorand={exports:{}},hasRequiredBrorand,mr,hasRequiredMr,generatePrime,hasRequiredGeneratePrime;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;var e;function t(e){this.rand=e}if(hasRequiredBrorand=1,brorand.exports=function(r){return e||(e=new t(null)),e.generate(r)},brorand.exports.Rand=t,t.prototype.generate=function(e){return this._rand(e)},t.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var r=requireCryptoBrowserify();if("function"!=typeof r.randomBytes)throw new Error("Not supported");t.prototype._rand=function(e){return r.randomBytes(e)}}catch(e){}return brorand.exports}function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var e=requireBn$5(),t=requireBrorand();function r(e){this.rand=e||new t.Rand}return mr=r,r.create=function(e){return new r(e)},r.prototype._randbelow=function(t){var r=t.bitLength(),i=Math.ceil(r/8);do{var n=new e(this.rand.generate(i))}while(n.cmp(t)>=0);return n},r.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},r.prototype.test=function(t,r,i){var n=t.bitLength(),o=e.mont(t),s=new e(1).toRed(o);r||(r=Math.max(1,n/48|0));for(var a=t.subn(1),u=0;!a.testn(u);u++);for(var h=t.shrn(u),f=a.toRed(o);r>0;r--){var l=this._randrange(new e(2),a);i&&i(l);var c=l.toRed(o).redPow(h);if(0!==c.cmp(s)&&0!==c.cmp(f)){for(var d=1;d<u;d++){if(0===(c=c.redSqr()).cmp(s))return!1;if(0===c.cmp(f))break}if(d===u)return!1}}return!0},r.prototype.getDivisor=function(t,r){var i=t.bitLength(),n=e.mont(t),o=new e(1).toRed(n);r||(r=Math.max(1,i/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var u=t.shrn(a),h=s.toRed(n);r>0;r--){var f=this._randrange(new e(2),s),l=t.gcd(f);if(0!==l.cmpn(1))return l;var c=f.toRed(n).redPow(u);if(0!==c.cmp(o)&&0!==c.cmp(h)){for(var d=1;d<a;d++){if(0===(c=c.redSqr()).cmp(o))return c.fromRed().subn(1).gcd(t);if(0===c.cmp(h))break}if(d===a)return(c=c.redSqr()).fromRed().subn(1).gcd(t)}}return!1},mr}function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var e=requireBrowser$b();generatePrime=p,p.simpleSieve=c,p.fermatTest=d;var t=requireBn$6(),r=new t(24),i=new(requireMr()),n=new t(1),o=new t(2),s=new t(5);new t(16),new t(8);var a=new t(10),u=new t(3);new t(7);var h=new t(11),f=new t(4);new t(12);var l=null;function c(e){for(var t=function(){if(null!==l)return l;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var i=Math.ceil(Math.sqrt(r)),n=0;n<t&&e[n]<=i&&r%e[n]!=0;n++);t!==n&&e[n]<=i||(e[t++]=r)}return l=e,e}(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function d(e){var r=t.mont(e);return 0===o.toRed(r).redPow(e.subn(1)).fromRed().cmpn(1)}function p(l,p){if(l<16)return new t(2===p||5===p?[140,123]:[140,39]);var m,g;for(p=new t(p);;){for(m=new t(e(Math.ceil(l/8)));m.bitLength()>l;)m.ishrn(1);if(m.isEven()&&m.iadd(n),m.testn(1)||m.iadd(o),p.cmp(o)){if(!p.cmp(s))for(;m.mod(a).cmp(u);)m.iadd(f)}else for(;m.mod(r).cmp(h);)m.iadd(f);if(c(g=m.shrn(1))&&c(m)&&d(g)&&d(m)&&i.test(g)&&i.test(m))return m}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1:modp1,modp2:modp2,modp5:modp5,modp14:modp14,modp15:modp15,modp16:modp16,modp17:modp17,modp18:modp18};var dh,hasRequiredDh,hasRequiredBrowser$5;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var e=requireBn$6(),t=new(requireMr()),r=new e(24),i=new e(11),n=new e(10),o=new e(3),s=new e(7),a=requireGeneratePrime(),u=requireBrowser$b();function h(t,r){return r=r||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,r)),this._pub=new e(t),this}function f(t,r){return r=r||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,r)),this._priv=new e(t),this}dh=c;var l={};function c(t,r,i){this.setGenerator(r),this.__prime=new e(t),this._prime=e.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,i?(this.setPublicKey=h,this.setPrivateKey=f):this._primeCode=8}function d(e,t){var r=new Buffer(e.toArray());return t?r.toString(t):r}return Object.defineProperty(c.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,u){var h=u.toString("hex"),f=[h,e.toString(16)].join("_");if(f in l)return l[f];var c,d=0;if(e.isEven()||!a.simpleSieve||!a.fermatTest(e)||!t.test(e))return d+=1,d+="02"===h||"05"===h?8:4,l[f]=d,d;switch(t.test(e.shrn(1))||(d+=2),h){case"02":e.mod(r).cmp(i)&&(d+=8);break;case"05":(c=e.mod(n)).cmp(o)&&c.cmp(s)&&(d+=8);break;default:d+=4}return l[f]=d,d}(this.__prime,this.__gen)),this._primeCode}}),c.prototype.generateKeys=function(){return this._priv||(this._priv=new e(u(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},c.prototype.computeSecret=function(t){var r=(t=(t=new e(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new Buffer(r.toArray()),n=this.getPrime();if(i.length<n.length){var o=new Buffer(n.length-i.length);o.fill(0),i=Buffer.concat([o,i])}return i},c.prototype.getPublicKey=function(e){return d(this._pub,e)},c.prototype.getPrivateKey=function(e){return d(this._priv,e)},c.prototype.getPrime=function(e){return d(this.__prime,e)},c.prototype.getGenerator=function(e){return d(this._gen,e)},c.prototype.setGenerator=function(t,r){return r=r||"utf8",Buffer.isBuffer(t)||(t=new Buffer(t,r)),this.__gen=t,this._gen=new e(t),this},dh}function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$6;hasRequiredBrowser$5=1;var e=requireGeneratePrime(),t=require$$1$1,r=requireDh();var i={binary:!0,hex:!0,base64:!0};return browser$6.DiffieHellmanGroup=browser$6.createDiffieHellmanGroup=browser$6.getDiffieHellman=function(e){var i=new Buffer(t[e].prime,"hex"),n=new Buffer(t[e].gen,"hex");return new r(i,n)},browser$6.createDiffieHellman=browser$6.DiffieHellman=function t(n,o,s,a){return Buffer.isBuffer(o)||void 0===i[o]?t(n,"binary",o,s):(o=o||"binary",a=a||"binary",s=s||new Buffer([2]),Buffer.isBuffer(s)||(s=new Buffer(s,a)),"number"==typeof n?new r(e(n,s),s,!0):(Buffer.isBuffer(n)||(n=new Buffer(n,o)),new r(n,s,!0)))},browser$6}var safeBuffer$3={exports:{}},hasRequiredSafeBuffer$3;function requireSafeBuffer$3(){return hasRequiredSafeBuffer$3||(hasRequiredSafeBuffer$3=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$3,safeBuffer$3.exports)),safeBuffer$3.exports}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs,isarray,hasRequiredIsarray,streamBrowser,hasRequiredStreamBrowser;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;return hasRequiredProcessNextickArgs=1,void 0===process$1||!process$1.version||0===process$1.version.indexOf("v0.")||0===process$1.version.indexOf("v1.")&&0!==process$1.version.indexOf("v1.8.")?processNextickArgs.exports={nextTick:function(e,t,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var n,o,s=arguments.length;switch(s){case 0:case 1:return process$1.nextTick(e);case 2:return process$1.nextTick((function(){e.call(null,t)}));case 3:return process$1.nextTick((function(){e.call(null,t,r)}));case 4:return process$1.nextTick((function(){e.call(null,t,r,i)}));default:for(n=new Array(s-1),o=0;o<n.length;)n[o++]=arguments[o];return process$1.nextTick((function(){e.apply(null,n)}))}}}:processNextickArgs.exports=process$1,processNextickArgs.exports}function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var e={}.toString;return isarray=Array.isArray||function(t){return"[object Array]"==e.call(t)}}function requireStreamBrowser(){return hasRequiredStreamBrowser?streamBrowser:(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter)}var safeBuffer$2={exports:{}},hasRequiredSafeBuffer$2;function requireSafeBuffer$2(){return hasRequiredSafeBuffer$2||(hasRequiredSafeBuffer$2=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$2,safeBuffer$2.exports)),safeBuffer$2.exports}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;function e(e){return Object.prototype.toString.call(e)}return hasRequiredUtil=1,util.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},util.isBoolean=function(e){return"boolean"==typeof e},util.isNull=function(e){return null===e},util.isNullOrUndefined=function(e){return null==e},util.isNumber=function(e){return"number"==typeof e},util.isString=function(e){return"string"==typeof e},util.isSymbol=function(e){return"symbol"==typeof e},util.isUndefined=function(e){return void 0===e},util.isRegExp=function(t){return"[object RegExp]"===e(t)},util.isObject=function(e){return"object"==typeof e&&null!==e},util.isDate=function(t){return"[object Date]"===e(t)},util.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},util.isFunction=function(e){return"function"==typeof e},util.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},util.isBuffer=requireDist().Buffer.isBuffer,util}var BufferList={exports:{}},hasRequiredBufferList,destroy_1,hasRequiredDestroy,_stream_writable,hasRequired_stream_writable,_stream_duplex,hasRequired_stream_duplex,_stream_readable,hasRequired_stream_readable,_stream_transform,hasRequired_stream_transform,_stream_passthrough,hasRequired_stream_passthrough,hasRequiredReadableBrowser;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,e=BufferList,t=requireSafeBuffer$2().Buffer,r=requireUtil$1(),e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return t.alloc(0);for(var r,i,n,o=t.allocUnsafe(e>>>0),s=this.head,a=0;s;)r=s.data,i=o,n=a,r.copy(i,n),a+=s.data.length,s=s.next;return o},e}(),r&&r.inspect&&r.inspect.custom&&(e.exports.prototype[r.inspect.custom]=function(){var e=r.inspect({length:this.length});return this.constructor.name+" "+e})),BufferList.exports;var e,t,r}function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var e=requireProcessNextickArgs();function t(e,t){e.emit("error",t)}return destroy_1={destroy:function(r,i){var n=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(i?i(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(t,this,r)):e.nextTick(t,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,(function(r){!i&&r?n._writableState?n._writableState.errorEmitted||(n._writableState.errorEmitted=!0,e.nextTick(t,n,r)):e.nextTick(t,n,r):i&&i(r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}}function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var e=requireProcessNextickArgs();function t(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var i=e.entry;e.entry=null;for(;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}(t,e)}}_stream_writable=d;var r,i=!process$1.browser&&["v0.10","v0.9."].indexOf(process$1.version.slice(0,5))>-1?setImmediate:e.nextTick;d.WritableState=c;var n=Object.create(requireUtil());n.inherits=requireInherits_browser();var o={deprecate:requireBrowser$c()},s=requireStreamBrowser(),a=requireSafeBuffer$2().Buffer,u=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var h,f=requireDestroy();function l(){}function c(n,o){r=r||require_stream_duplex(),n=n||{};var s=o instanceof r;this.objectMode=!!n.objectMode,s&&(this.objectMode=this.objectMode||!!n.writableObjectMode);var a=n.highWaterMark,u=n.writableHighWaterMark,h=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:s&&(u||0===u)?u:h,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===n.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,r){var n=t._writableState,o=n.sync,s=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),r)!function(t,r,i,n,o){--r.pendingcb,i?(e.nextTick(o,n),e.nextTick(v,t,r),t._writableState.errorEmitted=!0,t.emit("error",n)):(o(n),t._writableState.errorEmitted=!0,t.emit("error",n),v(t,r))}(t,n,o,r,s);else{var a=y(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||g(t,n),o?i(m,t,n,a,s):m(t,n,a,s)}}(o,t)},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 t(this)}function d(e){if(r=r||require_stream_duplex(),!(h.call(d,this)||this instanceof r))return new d(e);this._writableState=new c(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)),s.call(this)}function p(e,t,r,i,n,o,s){t.writelen=i,t.writecb=s,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function m(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),v(e,t)}function g(e,r){r.bufferProcessing=!0;var i=r.bufferedRequest;if(e._writev&&i&&i.next){var n=r.bufferedRequestCount,o=new Array(n),s=r.corkedRequestsFree;s.entry=i;for(var a=0,u=!0;i;)o[a]=i,i.isBuf||(u=!1),i=i.next,a+=1;o.allBuffers=u,p(e,r,!0,r.length,o,"",s.finish),r.pendingcb++,r.lastBufferedRequest=null,s.next?(r.corkedRequestsFree=s.next,s.next=null):r.corkedRequestsFree=new t(r),r.bufferedRequestCount=0}else{for(;i;){var h=i.chunk,f=i.encoding,l=i.callback;if(p(e,r,!1,r.objectMode?1:h.length,h,f,l),i=i.next,r.bufferedRequestCount--,r.writing)break}null===i&&(r.lastBufferedRequest=null)}r.bufferedRequest=i,r.bufferProcessing=!1}function y(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function b(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),v(e,t)}))}function v(t,r){var i=y(r);return i&&(!function(t,r){r.prefinished||r.finalCalled||("function"==typeof t._final?(r.pendingcb++,r.finalCalled=!0,e.nextTick(b,t,r)):(r.prefinished=!0,t.emit("prefinish")))}(t,r),0===r.pendingcb&&(r.finished=!0,t.emit("finish"))),i}return n.inherits(d,s),c.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(c.prototype,"buffer",{get:o.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]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(d,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===d&&(e&&e._writableState instanceof c)}})):h=function(e){return e instanceof this},d.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},d.prototype.write=function(t,r,i){var n,o=this._writableState,s=!1,h=!o.objectMode&&(n=t,a.isBuffer(n)||n instanceof u);return h&&!a.isBuffer(t)&&(t=function(e){return a.from(e)}(t)),"function"==typeof r&&(i=r,r=null),h?r="buffer":r||(r=o.defaultEncoding),"function"!=typeof i&&(i=l),o.ended?function(t,r){var i=new Error("write after end");t.emit("error",i),e.nextTick(r,i)}(this,i):(h||function(t,r,i,n){var o=!0,s=!1;return null===i?s=new TypeError("May not write null values to stream"):"string"==typeof i||void 0===i||r.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),e.nextTick(n,s),o=!1),o}(this,o,t,i))&&(o.pendingcb++,s=function(e,t,r,i,n,o){if(!r){var s=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=a.from(t,r));return t}(t,i,n);i!==s&&(r=!0,n="buffer",i=s)}var u=t.objectMode?1:i.length;t.length+=u;var h=t.length<t.highWaterMark;h||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else p(e,t,!1,u,i,n,o);return h}(this,o,h,t,r,i)),s},d.prototype.cork=function(){this._writableState.corked++},d.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||g(this,e))},d.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),d.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},d.prototype._writev=null,d.prototype.end=function(t,r,i){var n=this._writableState;"function"==typeof t?(i=t,t=null,r=null):"function"==typeof r&&(i=r,r=null),null!=t&&this.write(t,r),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,r,i){r.ending=!0,v(t,r),i&&(r.finished?e.nextTick(i):t.once("finish",i));r.ended=!0,t.writable=!1}(this,n,i)},Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),d.prototype.destroy=f.destroy,d.prototype._undestroy=f.undestroy,d.prototype._destroy=function(e,t){this.end(),t(e)},_stream_writable}function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var e=requireProcessNextickArgs(),t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};_stream_duplex=u;var r=Object.create(requireUtil());r.inherits=requireInherits_browser();var i=require_stream_readable(),n=require_stream_writable();r.inherits(u,i);for(var o=t(n.prototype),s=0;s<o.length;s++){var a=o[s];u.prototype[a]||(u.prototype[a]=n.prototype[a])}function u(e){if(!(this instanceof u))return new u(e);i.call(this,e),n.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||e.nextTick(f,this)}function f(e){e.end()}return Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),u.prototype._destroy=function(t,r){this.push(null),this.end(),e.nextTick(r,t)},_stream_duplex}function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var e=requireProcessNextickArgs();_stream_readable=m;var t,r=requireIsarray();m.ReadableState=p,requireEvents().EventEmitter;var i=function(e,t){return e.listeners(t).length},n=requireStreamBrowser(),o=requireSafeBuffer$2().Buffer,s=(void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a=Object.create(requireUtil());a.inherits=requireInherits_browser();var u=requireUtil$1(),h=void 0;h=u&&u.debuglog?u.debuglog("stream"):function(){};var f,l=requireBufferList(),c=requireDestroy();a.inherits(m,n);var d=["error","close","destroy","pause","resume"];function p(e,r){e=e||{};var i=r instanceof(t=t||require_stream_duplex());this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new l,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&&(f||(f=requireString_decoder().StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function m(e){if(t=t||require_stream_duplex(),!(this instanceof m))return new m(e);this._readableState=new p(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),n.call(this)}function g(e,t,r,i,n){var a,u=e._readableState;null===t?(u.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,w(e)}(e,u)):(n||(a=function(e,t){var r;i=t,o.isBuffer(i)||i instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var i;return r}(u,t)),a?e.emit("error",a):u.objectMode||t&&t.length>0?("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),i?u.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):y(e,u,t,!0):u.ended?e.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?y(e,u,t,!1):M(e,u)):y(e,u,t,!1))):i||(u.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(u)}function y(e,t,r,i){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&w(e)),M(e,t)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),m.prototype.destroy=c.destroy,m.prototype._undestroy=c.undestroy,m.prototype._destroy=function(e,t){this.push(null),t(e)},m.prototype.push=function(e,t){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=o.from(e,t),t=""),r=!0),g(this,e,t,!1,r)},m.prototype.unshift=function(e){return g(this,e,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(e){return f||(f=requireString_decoder().StringDecoder),this._readableState.decoder=new f(e),this._readableState.encoding=e,this};var b=8388608;function v(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=b?e=b:(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 w(t){var r=t._readableState;r.needReadable=!1,r.emittedReadable||(h("emitReadable",r.flowing),r.emittedReadable=!0,r.sync?e.nextTick(_,t):_(t))}function _(e){h("emit readable"),e.emit("readable"),A(e)}function M(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(S,t,r))}function S(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function E(e){h("readable nexttick read 0"),e.read(0)}function R(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function q(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var i;e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):i=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,i=1,n=r.data;e-=n.length;for(;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(s===o.length?n+=o:n+=o.slice(0,e),0===(e-=s)){s===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++i}return t.length-=i,n}(e,t):function(e,t){var r=o.allocUnsafe(e),i=t.head,n=1;i.data.copy(r),e-=i.data.length;for(;i=i.next;){var s=i.data,a=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,a),0===(e-=a)){a===s.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=s.slice(a));break}++n}return t.length-=n,r}(e,t);return i}(e,t.buffer,t.decoder),r);var r}function C(t){var r=t._readableState;if(r.length>0)throw new Error('"endReadable()" called on non-empty stream');r.endEmitted||(r.ended=!0,e.nextTick(P,r,t))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function B(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}return m.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):w(this),null;if(0===(e=v(e,t))&&t.ended)return 0===t.length&&C(this),null;var i,n=t.needReadable;return h("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",n=!0),t.ended||t.reading?h("reading or ended",n=!1):n&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=v(r,t))),null===(i=e>0?q(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==i&&this.emit("data",i),i},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(t,n){var o=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,h("pipe count=%d opts=%j",s.pipesCount,n);var a=(!n||!1!==n.end)&&t!==process$1.stdout&&t!==process$1.stderr?f:b;function u(e,r){h("onunpipe"),e===o&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),t.removeListener("close",g),t.removeListener("finish",y),t.removeListener("drain",l),t.removeListener("error",m),t.removeListener("unpipe",u),o.removeListener("end",f),o.removeListener("end",b),o.removeListener("data",p),c=!0,!s.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function f(){h("onend"),t.end()}s.endEmitted?e.nextTick(a):o.once("end",a),t.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,A(e))}}(o);t.on("drain",l);var c=!1;var d=!1;function p(e){h("ondata"),d=!1,!1!==t.write(e)||d||((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==B(s.pipes,t))&&!c&&(h("false write response, pause",s.awaitDrain),s.awaitDrain++,d=!0),o.pause())}function m(e){h("onerror",e),b(),t.removeListener("error",m),0===i(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",y),b()}function y(){h("onfinish"),t.removeListener("close",g),b()}function b(){h("unpipe"),o.unpipe(t)}return o.on("data",p),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(t,"error",m),t.once("close",g),t.once("finish",y),t.emit("pipe",o),s.flowing||(h("pipe resume"),o.resume()),t},m.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=B(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},m.prototype.on=function(t,r){var i=n.prototype.on.call(this,t,r);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var o=this._readableState;o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.emittedReadable=!1,o.reading?o.length&&w(this):e.nextTick(E,this))}return i},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!0,function(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(R,t,r))}(this,t)),this},m.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var n in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(h("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(i=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var o=0;o<d.length;o++)e.on(d[o],this.emit.bind(this,d[o]));return this._read=function(t){h("wrapped _read",t),i&&(i=!1,e.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=q,_stream_readable}function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=i;var e=require_stream_duplex(),t=Object.create(requireUtil());function r(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function i(t){if(!(this instanceof i))return new i(t);e.call(this,t),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",n)}function n(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){o(e,t,r)})):o(this,null,null)}function o(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}return t.inherits=requireInherits_browser(),t.inherits(i,e),i.prototype.push=function(t,r){return this._transformState.needTransform=!1,e.prototype.push.call(this,t,r)},i.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},i.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},i.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},i.prototype._destroy=function(t,r){var i=this;e.prototype._destroy.call(this,t,(function(e){r(e),i.emit("close")}))},_stream_transform}function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=r;var e=require_stream_transform(),t=Object.create(requireUtil());function r(t){if(!(this instanceof r))return new r(t);e.call(this,t)}return t.inherits=requireInherits_browser(),t.inherits(r,e),r.prototype._transform=function(e,t,r){r(null,e)},_stream_passthrough}function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,e=readableBrowser,t=readableBrowser.exports,(t=e.exports=require_stream_readable()).Stream=t,t.Readable=t,t.Writable=require_stream_writable(),t.Duplex=require_stream_duplex(),t.Transform=require_stream_transform(),t.PassThrough=require_stream_passthrough()),readableBrowser.exports;var e,t}var sign={exports:{}},bn$9={exports:{}},bn$8=bn$9.exports,hasRequiredBn$4;function requireBn$4(){return hasRequiredBn$4||(hasRequiredBn$4=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+e)}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,i,n){for(var o=0,s=0,a=Math.min(e.length,i),u=t;u<a;u++){var h=e.charCodeAt(u)-48;o*=n,s=h>=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&s<n,"Invalid character"),o+=s}return o}function h(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this._strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this._strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype._move=function(e){h(e,this)},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){n.prototype.inspect=f}else n.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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"],c=[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],d=[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 p(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r._strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?l[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var h=c[e],f=d[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(e);i=(p=p.idivn(f)).isZero()?m+i:l[h-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16,2)},o&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){this._strip();var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},n.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|i;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this._strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}Math.imul||(m=p),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?g(this,e,t):y(this,e,t)},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),y(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var i=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,s=(67108863&o)+(67108863&i);i>>=26,i+=o/67108864|0,i+=s>>>26,this.words[n]=67108863&s}return 0!==i&&(this.words[n]=i,this.length++),t?this.ineg():this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=e.words[i]>>>n&1}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this._strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var i=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(i*n+(0|this.words[o]))%e;return t?-n:n},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*i;this.words[n]=o/e|0,i=o%e}return this._strip(),t?this.ineg():this},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new E(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=n._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 R(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}v.prototype._tmp=function(){var e=new n(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(w,v),w.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(_,v),i(M,v),i(S,v),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new _;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return b[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(!(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):(h(e,e.umod(this.m)._forceRed(this)),e)},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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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 i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},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},n.mont=function(e){return new R(e)},i(R,E),R.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},R.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},R.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},R.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},R.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$9,bn$8)),bn$9.exports}var safeBuffer$1={exports:{}},hasRequiredSafeBuffer$1,browserifyRsa,hasRequiredBrowserifyRsa;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var e=requireBn$4(),t=requireBrowser$b(),r=requireSafeBuffer$1().Buffer;function i(r){var i,n=r.modulus.byteLength();do{i=new e(t(n))}while(i.cmp(r.modulus)>=0||!i.umod(r.prime1)||!i.umod(r.prime2));return i}function n(t,n){var o=function(t){var r=i(t);return{blinder:r.toRed(e.mont(t.modulus)).redPow(new e(t.publicExponent)).fromRed(),unblinder:r.invm(t.modulus)}}(n),s=n.modulus.byteLength(),a=new e(t).mul(o.blinder).umod(n.modulus),u=a.toRed(e.mont(n.prime1)),h=a.toRed(e.mont(n.prime2)),f=n.coefficient,l=n.prime1,c=n.prime2,d=u.redPow(n.exponent1).fromRed(),p=h.redPow(n.exponent2).fromRed(),m=d.isub(p).imul(f).umod(l).imul(c);return p.iadd(m).imul(o.unblinder).umod(n.modulus).toArrayLike(r,"be",s)}return n.getr=i,browserifyRsa=n}var elliptic={};const version="6.6.1",require$$0={version:version};var utils$2={},bn$7={exports:{}},bn$6=bn$7.exports,hasRequiredBn$3;function requireBn$3(){return hasRequiredBn$3||(hasRequiredBn$3=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$7,bn$6)),bn$7.exports}var utils$1={},hasRequiredUtils$2,hasRequiredUtils$1;function requireUtils$2(){return hasRequiredUtils$2||(hasRequiredUtils$2=1,function(e){var t=e;function r(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",i=0;i<e.length;i++)t+=r(e[i].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},t.zero2=r,t.toHex=i,t.encode=function(e,t){return"hex"===t?i(e):e}}(utils$1)),utils$1}function requireUtils$1(){return hasRequiredUtils$1||(hasRequiredUtils$1=1,e=utils$2,t=requireBn$3(),r=requireMinimalisticAssert(),i=requireUtils$2(),e.assert=r,e.toArray=i.toArray,e.zero2=i.zero2,e.toHex=i.toHex,e.encode=i.encode,e.getNAF=function(e,t,r){var i,n=new Array(Math.max(e.bitLength(),r)+1);for(i=0;i<n.length;i+=1)n[i]=0;var o=1<<t+1,s=e.clone();for(i=0;i<n.length;i++){var a,u=s.andln(o-1);s.isOdd()?(a=u>(o>>1)-1?(o>>1)-u:u,s.isubn(a)):a=0,n[i]=a,s.iushrn(1)}return n},e.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,o=0;e.cmpn(-n)>0||t.cmpn(-o)>0;){var s,a,u=e.andln(3)+n&3,h=t.andln(3)+o&3;3===u&&(u=-1),3===h&&(h=-1),s=1&u?3!=(i=e.andln(7)+n&7)&&5!==i||2!==h?u:-u:0,r[0].push(s),a=1&h?3!=(i=t.andln(7)+o&7)&&5!==i||2!==u?h:-h:0,r[1].push(a),2*n===s+1&&(n=1-n),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},e.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(e){return new t(e,"hex","le")}),utils$2;var e,t,r,i}var curve={},base$1,hasRequiredBase$1,short,hasRequiredShort,mont,hasRequiredMont,edwards,hasRequiredEdwards,hasRequiredCurve;function requireBase$1(){if(hasRequiredBase$1)return base$1;hasRequiredBase$1=1;var e=requireBn$3(),t=requireUtils$1(),r=t.getNAF,i=t.getJSF,n=t.assert;function o(t,r){this.type=t,this.p=new e(r.p,16),this.red=r.prime?e.red(r.prime):e.mont(this.p),this.zero=new e(0).toRed(this.red),this.one=new e(1).toRed(this.red),this.two=new e(2).toRed(this.red),this.n=r.n&&new e(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.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 i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function s(e,t){this.curve=e,this.type=t,this.precomputed=null}return base$1=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){n(e.precomputed);var i=e._getDoubles(),o=r(t,1,this._bitLength),s=(1<<i.step+1)-(i.step%2==0?2:1);s/=3;var a,u,h=[];for(a=0;a<o.length;a+=i.step){u=0;for(var f=a+i.step-1;f>=a;f--)u=(u<<1)+o[f];h.push(u)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a<h.length;a++)(u=h[a])===d?c=c.mixedAdd(i.points[a]):u===-d&&(c=c.mixedAdd(i.points[a].neg()));l=l.add(c)}return l.toP()},o.prototype._wnafMul=function(e,t){var i=4,o=e._getNAFPoints(i);i=o.wnd;for(var s=o.points,a=r(t,i,this._bitLength),u=this.jpoint(null,null,null),h=a.length-1;h>=0;h--){for(var f=0;h>=0&&0===a[h];h--)f++;if(h>=0&&f++,u=u.dblp(f),h<0)break;var l=a[h];n(0!==l),u="affine"===e.type?l>0?u.mixedAdd(s[l-1>>1]):u.mixedAdd(s[-l-1>>1].neg()):l>0?u.add(s[l-1>>1]):u.add(s[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},o.prototype._wnafMulAdd=function(e,t,n,o,s){var a,u,h,f=this._wnafT1,l=this._wnafT2,c=this._wnafT3,d=0;for(a=0;a<o;a++){var p=(h=t[a])._getNAFPoints(e);f[a]=p.wnd,l[a]=p.points}for(a=o-1;a>=1;a-=2){var m=a-1,g=a;if(1===f[m]&&1===f[g]){var y=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(y[1]=t[m].add(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].add(t[g].neg())):(y[1]=t[m].toJ().mixedAdd(t[g]),y[2]=t[m].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=i(n[m],n[g]);for(d=Math.max(v[0].length,d),c[m]=new Array(d),c[g]=new Array(d),u=0;u<d;u++){var w=0|v[0][u],_=0|v[1][u];c[m][u]=b[3*(w+1)+(_+1)],c[g][u]=0,l[m]=y}}else c[m]=r(n[m],f[m],this._bitLength),c[g]=r(n[g],f[g],this._bitLength),d=Math.max(c[m].length,d),d=Math.max(c[g].length,d)}var M=this.jpoint(null,null,null),S=this._wnafT4;for(a=d;a>=0;a--){for(var E=0;a>=0;){var R=!0;for(u=0;u<o;u++)S[u]=0|c[u][a],0!==S[u]&&(R=!1);if(!R)break;E++,a--}if(a>=0&&E++,M=M.dblp(E),a<0)break;for(u=0;u<o;u++){var A=S[u];0!==A&&(A>0?h=l[u][A-1>>1]:A<0&&(h=l[u][-A-1>>1].neg()),M="affine"===h.type?M.mixedAdd(h):M.add(h))}}for(a=0;a<o;a++)l[a]=null;return s?M:M.toP()},o.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},o.prototype.decodePoint=function(e,r){e=t.toArray(e,r);var i=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*i)return 6===e[0]?n(e[e.length-1]%2==0):7===e[0]&&n(e[e.length-1]%2==1),this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));if((2===e[0]||3===e[0])&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),3===e[0]);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(e){return this.encode(e,!0)},s.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},s.prototype.encode=function(e,r){return t.encode(this._encode(r),e)},s.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},s.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},s.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var o=0;o<e;o++)i=i.dbl();r.push(i)}return{step:e,points:r}},s.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t},base$1}function requireShort(){if(hasRequiredShort)return short;hasRequiredShort=1;var e=requireUtils$1(),t=requireBn$3(),r=requireInherits_browser(),i=requireBase$1(),n=e.assert;function o(e){i.call(this,"short",e),this.a=new t(e.a,16).toRed(this.red),this.b=new t(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function s(e,r,n,o){i.BasePoint.call(this,e,"affine"),null===r&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(r,16),this.y=new t(n,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function a(e,r,n,o){i.BasePoint.call(this,e,"jacobian"),null===r&&null===n&&null===o?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(r,16),this.y=new t(n,16),this.z=new t(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return r(o,i),short=o,o.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,i;if(e.beta)r=new t(e.beta,16).toRed(this.red);else{var o=this._getEndoRoots(this.p);r=(r=o[0].cmp(o[1])<0?o[0]:o[1]).toRed(this.red)}if(e.lambda)i=new t(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))?i=s[0]:(i=s[1],n(0===this.g.mul(i).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:i,basis:e.basis?e.basis.map((function(e){return{a:new t(e.a,16),b:new t(e.b,16)}})):this._getEndoBasis(i)}}},o.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:t.mont(e),i=new t(2).toRed(r).redInvm(),n=i.redNeg(),o=new t(3).toRed(r).redNeg().redSqrt().redMul(i);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},o.prototype._getEndoBasis=function(e){for(var r,i,n,o,s,a,u,h,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=e,d=this.n.clone(),p=new t(1),m=new t(0),g=new t(0),y=new t(1),b=0;0!==c.cmpn(0);){var v=d.div(c);h=d.sub(v.mul(c)),f=g.sub(v.mul(p));var w=y.sub(v.mul(m));if(!n&&h.cmp(l)<0)r=u.neg(),i=p,n=h.neg(),o=f;else if(n&&2==++b)break;u=h,d=c,c=h,g=p,p=f,y=m,m=w}s=h.neg(),a=f;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=r,a=i),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),a=o.mul(i.a),u=n.mul(r.b),h=o.mul(i.b);return{k1:e.sub(s).sub(a),k2:u.add(h).neg()}},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(0!==n.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(r&&!o||!r&&o)&&(n=n.redNeg()),this.point(e,n)},o.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),i[2*o]=a,i[2*o+1]=u,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,i,n,2*o,r),f=0;f<2*o;f++)i[f]=null,n[f]=null;return h},r(s,i.BasePoint),o.prototype.point=function(e,t,r){return new s(this,e,t,r)},o.prototype.pointFromJSON=function(e,t){return s.fromJSON(this,e,t)},s.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},s.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},s.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var o=t[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(n))}},i},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return this.inf},s.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},s.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.prototype.mul=function(e){return e=new t(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},s.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},s.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},s.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},s.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},r(a,i.BasePoint),o.prototype.jpoint=function(e,t,r){return new a(this,e,t,r)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),f=h.redMul(a),l=i.redMul(h),c=u.redSqr().redIAdd(f).redISub(l).redISub(l),d=u.redMul(l.redISub(c)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(c,d,p)},a.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(i),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),f=r.redMul(u),l=a.redSqr().redIAdd(h).redISub(f).redISub(f),c=a.redMul(f.redISub(l)).redISub(n.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(l,c,d)},a.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),h=s.redAdd(s);for(t=0;t<e;t++){var f=o.redSqr(),l=h.redSqr(),c=l.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(i.redMul(u)),p=o.redMul(l),m=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=d.redMul(g);y=y.redIAdd(y).redISub(c);var b=h.redMul(a);t+1<e&&(u=u.redMul(c)),o=m,a=b,h=y}return this.curve.jpoint(o,h.redMul(n),a)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i),u=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=u,t=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),c=l.redSqr(),d=this.x.redAdd(l).redSqr().redISub(f).redISub(c);d=d.redIAdd(d);var p=f.redAdd(f).redIAdd(f),m=p.redSqr(),g=c.redIAdd(c);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},a.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);e=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),c=this.x.redMul(l),d=this.x.redSub(f).redMul(this.x.redAdd(f));d=d.redAdd(d).redIAdd(d);var p=c.redIAdd(c),m=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var g=l.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=d.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},a.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(n)),u=t.redAdd(t),h=(u=u.redIAdd(u)).redMul(s),f=a.redSqr().redISub(h.redAdd(h)),l=h.redISub(f),c=s.redSqr();c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=a.redMul(l).redISub(c),p=r.redAdd(r).redMul(i);return this.curve.jpoint(f,d,p)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),o=n.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(i),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=i.redIAdd(i);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),f=t.redMul(h);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(a).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var c=this.y.redMul(h.redMul(u.redISub(h)).redISub(s.redMul(a)));c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(l,c,d)},a.prototype.mul=function(e,r){return e=new t(e,r),this.curve._wnafMul(this,e)},a.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},a.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},a.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},a.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},short}function requireMont(){if(hasRequiredMont)return mont;hasRequiredMont=1;var e=requireBn$3(),t=requireInherits_browser(),r=requireBase$1(),i=requireUtils$1();function n(t){r.call(this,"mont",t),this.a=new e(t.a,16).toRed(this.red),this.b=new e(t.b,16).toRed(this.red),this.i4=new e(4).toRed(this.red).redInvm(),this.two=new e(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(t,i,n){r.BasePoint.call(this,t,"projective"),null===i&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new e(i,16),this.z=new e(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(n,r),mont=n,n.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},t(o,r.BasePoint),n.prototype.decodePoint=function(e,t){return this.point(i.toArray(e,t),1)},n.prototype.point=function(e,t){return new o(this,e,t)},n.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=n.redMul(i),a=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},o.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont}function requireEdwards(){if(hasRequiredEdwards)return edwards;hasRequiredEdwards=1;var e=requireUtils$1(),t=requireBn$3(),r=requireInherits_browser(),i=requireBase$1(),n=e.assert;function o(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,i.call(this,"edwards",e),this.a=new t(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),n(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function s(e,r,n,o,s){i.BasePoint.call(this,e,"projective"),null===r&&null===n&&null===o?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new t(r,16),this.y=new t(n,16),this.z=o?new t(o,16):this.curve.one,this.t=s&&new t(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return r(o,i),edwards=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},o.prototype.pointFromX=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),o=this.one.redSub(this.c2.redMul(this.d).redMul(i)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(r&&!u||!r&&u)&&(a=a.redNeg()),this.point(e,a)},o.prototype.pointFromY=function(e,r){(e=new t(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),o=i.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==r&&(a=a.redNeg()),this.point(a,e)},o.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},r(s,i.BasePoint),o.prototype.pointFromJSON=function(e){return s.fromJSON(this,e)},o.prototype.point=function(e,t,r,i){return new s(this,e,t,r,i)},s.fromJSON=function(e,t){return new s(e,t[0],t[1],t[2])},s.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},s.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},s.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),s=o.redSub(r),a=i.redSub(t),u=n.redMul(s),h=o.redMul(a),f=n.redMul(a),l=s.redMul(o);return this.curve.point(u,h,l,f)},s.prototype._projDbl=function(){var e,t,r,i,n,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var h=(i=this.curve._mulA(a)).redAdd(u);this.zOne?(e=s.redSub(a).redSub(u).redMul(h.redSub(this.curve.two)),t=h.redMul(i.redSub(u)),r=h.redSqr().redSub(h).redSub(h)):(n=this.z.redSqr(),o=h.redSub(n).redISub(n),e=s.redSub(a).redISub(u).redMul(o),t=h.redMul(i.redSub(u)),r=h.redMul(o))}else i=a.redAdd(u),n=this.curve._mulC(this.z).redSqr(),o=i.redSub(n).redSub(n),e=this.curve._mulC(s.redISub(i)).redMul(o),t=this.curve._mulC(i).redMul(a.redISub(u)),r=i.redMul(o);return this.curve.point(e,t,r)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=n.redSub(i),a=n.redAdd(i),u=r.redAdd(t),h=o.redMul(s),f=a.redMul(u),l=o.redMul(u),c=s.redMul(a);return this.curve.point(h,f,c,l)},s.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),u=n.redSub(a),h=n.redAdd(a),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),l=i.redMul(u).redMul(f);return this.curve.twisted?(t=i.redMul(h).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(h)):(t=i.redMul(h).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(h)),this.curve.point(l,t,r)},s.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},s.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},s.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},s.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},s.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},s.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add,edwards}function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,(e=curve).base=requireBase$1(),e.short=requireShort(),e.mont=requireMont(),e.edwards=requireEdwards()),curve;var e}var curves={},hash={},utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var e=requireMinimalisticAssert(),t=requireInherits_browser();function r(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function i(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function o(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}return utils.inherits=t,utils.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)i.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var s=e.charCodeAt(o);s<128?i[n++]=s:s<2048?(i[n++]=s>>6|192,i[n++]=63&s|128):r(e,o)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++o)),i[n++]=s>>18|240,i[n++]=s>>12&63|128,i[n++]=s>>6&63|128,i[n++]=63&s|128):(i[n++]=s>>12|224,i[n++]=s>>6&63|128,i[n++]=63&s|128)}else for(o=0;o<e.length;o++)i[o]=0|e[o];return i},utils.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t},utils.htonl=i,utils.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];"little"===t&&(s=i(s)),r+=o(s.toString(16))}return r},utils.zero2=n,utils.zero8=o,utils.join32=function(t,r,i,n){var o=i-r;e(o%4==0);for(var s=new Array(o/4),a=0,u=r;a<s.length;a++,u+=4){var h;h="big"===n?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=h>>>0}return s},utils.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];"big"===t?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},utils.rotr32=function(e,t){return e>>>t|e<<32-t},utils.rotl32=function(e,t){return e<<t|e>>>32-t},utils.sum32=function(e,t){return e+t>>>0},utils.sum32_3=function(e,t,r){return e+t+r>>>0},utils.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},utils.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},utils.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,s=(o<i?1:0)+r+n;e[t]=s>>>0,e[t+1]=o},utils.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},utils.sum64_lo=function(e,t,r,i){return t+i>>>0},utils.sum64_4_hi=function(e,t,r,i,n,o,s,a){var u=0,h=t;return u+=(h=h+i>>>0)<t?1:0,u+=(h=h+o>>>0)<o?1:0,e+r+n+s+(u+=(h=h+a>>>0)<a?1:0)>>>0},utils.sum64_4_lo=function(e,t,r,i,n,o,s,a){return t+i+o+a>>>0},utils.sum64_5_hi=function(e,t,r,i,n,o,s,a,u,h){var f=0,l=t;return f+=(l=l+i>>>0)<t?1:0,f+=(l=l+o>>>0)<o?1:0,f+=(l=l+a>>>0)<a?1:0,e+r+n+s+u+(f+=(l=l+h>>>0)<h?1:0)>>>0},utils.sum64_5_lo=function(e,t,r,i,n,o,s,a,u,h){return t+i+o+a+h>>>0},utils.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},utils.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},utils.shr64_hi=function(e,t,r){return e>>>r},utils.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},utils}var common$1={},hasRequiredCommon$1;function requireCommon$1(){if(hasRequiredCommon$1)return common$1;hasRequiredCommon$1=1;var e=requireUtils(),t=requireMinimalisticAssert();function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return common$1.BlockHash=r,r.prototype.update=function(t,r){if(t=e.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var i=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-i,t.length),0===this.pending.length&&(this.pending=null),t=e.join32(t,0,t.length-i,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},r.prototype.digest=function(e){return this.update(this._pad()),t(null===this.pending),this._digest(e)},r.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i},common$1}var sha={},common={},hasRequiredCommon,_1,hasRequired_1,_256,hasRequired_256,_224,hasRequired_224,_512,hasRequired_512,_384,hasRequired_384,hasRequiredSha;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;var e=requireUtils().rotr32;function t(e,t,r){return e&t^~e&r}function r(e,t,r){return e&t^e&r^t&r}function i(e,t,r){return e^t^r}return common.ft_1=function(e,n,o,s){return 0===e?t(n,o,s):1===e||3===e?i(n,o,s):2===e?r(n,o,s):void 0},common.ch32=t,common.maj32=r,common.p32=i,common.s0_256=function(t){return e(t,2)^e(t,13)^e(t,22)},common.s1_256=function(t){return e(t,6)^e(t,11)^e(t,25)},common.g0_256=function(t){return e(t,7)^e(t,18)^t>>>3},common.g1_256=function(t){return e(t,17)^e(t,19)^t>>>10},common}function require_1(){if(hasRequired_1)return _1;hasRequired_1=1;var e=requireUtils(),t=requireCommon$1(),r=requireCommon(),i=e.rotl32,n=e.sum32,o=e.sum32_5,s=r.ft_1,a=t.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return e.inherits(h,a),_1=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,a=0;a<16;a++)r[a]=e[t+a];for(;a<r.length;a++)r[a]=i(r[a-3]^r[a-8]^r[a-14]^r[a-16],1);var h=this.h[0],f=this.h[1],l=this.h[2],c=this.h[3],d=this.h[4];for(a=0;a<r.length;a++){var p=~~(a/20),m=o(i(h,5),s(p,f,l,c),d,r[a],u[p]);d=c,c=l,l=i(f,30),f=h,h=m}this.h[0]=n(this.h[0],h),this.h[1]=n(this.h[1],f),this.h[2]=n(this.h[2],l),this.h[3]=n(this.h[3],c),this.h[4]=n(this.h[4],d)},h.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},_1}function require_256(){if(hasRequired_256)return _256;hasRequired_256=1;var e=requireUtils(),t=requireCommon$1(),r=requireCommon(),i=requireMinimalisticAssert(),n=e.sum32,o=e.sum32_4,s=e.sum32_5,a=r.ch32,u=r.maj32,h=r.s0_256,f=r.s1_256,l=r.g0_256,c=r.g1_256,d=t.BlockHash,p=[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 m(){if(!(this instanceof m))return new m;d.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return e.inherits(m,d),_256=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(e,t){for(var r=this.W,d=0;d<16;d++)r[d]=e[t+d];for(;d<r.length;d++)r[d]=o(c(r[d-2]),r[d-7],l(r[d-15]),r[d-16]);var p=this.h[0],m=this.h[1],g=this.h[2],y=this.h[3],b=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(i(this.k.length===r.length),d=0;d<r.length;d++){var M=s(_,f(b),a(b,v,w),this.k[d],r[d]),S=n(h(p),u(p,m,g));_=w,w=v,v=b,b=n(y,M),y=g,g=m,m=p,p=n(M,S)}this.h[0]=n(this.h[0],p),this.h[1]=n(this.h[1],m),this.h[2]=n(this.h[2],g),this.h[3]=n(this.h[3],y),this.h[4]=n(this.h[4],b),this.h[5]=n(this.h[5],v),this.h[6]=n(this.h[6],w),this.h[7]=n(this.h[7],_)},m.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},_256}function require_224(){if(hasRequired_224)return _224;hasRequired_224=1;var e=requireUtils(),t=require_256();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return e.inherits(r,t),_224=r,r.blockSize=512,r.outSize=224,r.hmacStrength=192,r.padLength=64,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,7),"big"):e.split32(this.h.slice(0,7),"big")},_224}function require_512(){if(hasRequired_512)return _512;hasRequired_512=1;var e=requireUtils(),t=requireCommon$1(),r=requireMinimalisticAssert(),i=e.rotr64_hi,n=e.rotr64_lo,o=e.shr64_hi,s=e.shr64_lo,a=e.sum64,u=e.sum64_hi,h=e.sum64_lo,f=e.sum64_4_hi,l=e.sum64_4_lo,c=e.sum64_5_hi,d=e.sum64_5_lo,p=t.BlockHash,m=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function g(){if(!(this instanceof g))return new g;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function y(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function b(e,t,r,i,n,o){var s=t&i^~t&o;return s<0&&(s+=4294967296),s}function v(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function w(e,t,r,i,n,o){var s=t&i^t&o^i&o;return s<0&&(s+=4294967296),s}function _(e,t){var r=i(e,t,28)^i(t,e,2)^i(t,e,7);return r<0&&(r+=4294967296),r}function M(e,t){var r=n(e,t,28)^n(t,e,2)^n(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=i(e,t,14)^i(e,t,18)^i(t,e,9);return r<0&&(r+=4294967296),r}function E(e,t){var r=n(e,t,14)^n(e,t,18)^n(t,e,9);return r<0&&(r+=4294967296),r}function R(e,t){var r=i(e,t,1)^i(e,t,8)^o(e,t,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=n(e,t,1)^n(e,t,8)^s(e,t,7);return r<0&&(r+=4294967296),r}function q(e,t){var r=i(e,t,19)^i(t,e,29)^o(e,t,6);return r<0&&(r+=4294967296),r}function C(e,t){var r=n(e,t,19)^n(t,e,29)^s(e,t,6);return r<0&&(r+=4294967296),r}return e.inherits(g,p),_512=g,g.blockSize=1024,g.outSize=512,g.hmacStrength=192,g.padLength=128,g.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=q(r[i-4],r[i-3]),o=C(r[i-4],r[i-3]),s=r[i-14],a=r[i-13],u=R(r[i-30],r[i-29]),h=A(r[i-30],r[i-29]),c=r[i-32],d=r[i-31];r[i]=f(n,o,s,a,u,h,c,d),r[i+1]=l(n,o,s,a,u,h,c,d)}},g.prototype._update=function(e,t){this._prepareBlock(e,t);var i=this.W,n=this.h[0],o=this.h[1],s=this.h[2],f=this.h[3],l=this.h[4],p=this.h[5],m=this.h[6],g=this.h[7],R=this.h[8],A=this.h[9],q=this.h[10],C=this.h[11],P=this.h[12],B=this.h[13],I=this.h[14],O=this.h[15];r(this.k.length===i.length);for(var k=0;k<i.length;k+=2){var T=I,N=O,x=S(R,A),j=E(R,A),$=y(R,A,q,C,P),D=b(R,A,q,C,P,B),U=this.k[k],L=this.k[k+1],F=i[k],z=i[k+1],K=c(T,N,x,j,$,D,U,L,F,z),W=d(T,N,x,j,$,D,U,L,F,z);T=_(n,o),N=M(n,o),x=v(n,o,s,f,l),j=w(n,o,s,f,l,p);var H=u(T,N,x,j),G=h(T,N,x,j);I=P,O=B,P=q,B=C,q=R,C=A,R=u(m,g,K,W),A=h(g,g,K,W),m=l,g=p,l=s,p=f,s=n,f=o,n=u(K,W,H,G),o=h(K,W,H,G)}a(this.h,0,n,o),a(this.h,2,s,f),a(this.h,4,l,p),a(this.h,6,m,g),a(this.h,8,R,A),a(this.h,10,q,C),a(this.h,12,P,B),a(this.h,14,I,O)},g.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"big"):e.split32(this.h,"big")},_512}function require_384(){if(hasRequired_384)return _384;hasRequired_384=1;var e=requireUtils(),t=require_512();function r(){if(!(this instanceof r))return new r;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return e.inherits(r,t),_384=r,r.blockSize=1024,r.outSize=384,r.hmacStrength=192,r.padLength=128,r.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h.slice(0,12),"big"):e.split32(this.h.slice(0,12),"big")},_384}function requireSha(){return hasRequiredSha||(hasRequiredSha=1,sha.sha1=require_1(),sha.sha224=require_224(),sha.sha256=require_256(),sha.sha384=require_384(),sha.sha512=require_512()),sha}var ripemd={},hasRequiredRipemd,hmac$2,hasRequiredHmac$1,hasRequiredHash,secp256k1,hasRequiredSecp256k1,hasRequiredCurves,hmacDrbg,hasRequiredHmacDrbg,key$1,hasRequiredKey$1,signature$1,hasRequiredSignature$1,ec,hasRequiredEc,key,hasRequiredKey,signature,hasRequiredSignature,eddsa,hasRequiredEddsa,hasRequiredElliptic;function requireRipemd(){if(hasRequiredRipemd)return ripemd;hasRequiredRipemd=1;var e=requireUtils(),t=requireCommon$1(),r=e.rotl32,i=e.sum32,n=e.sum32_3,o=e.sum32_4,s=t.BlockHash;function a(){if(!(this instanceof a))return new a;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function f(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}e.inherits(a,s),ripemd.ripemd160=a,a.blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(e,t){for(var s=this.h[0],a=this.h[1],m=this.h[2],g=this.h[3],y=this.h[4],b=s,v=a,w=m,_=g,M=y,S=0;S<80;S++){var E=i(r(o(s,u(S,a,m,g),e[l[S]+t],h(S)),d[S]),y);s=y,y=g,g=r(m,10),m=a,a=E,E=i(r(o(b,u(79-S,v,w,_),e[c[S]+t],f(S)),p[S]),M),b=M,M=_,_=r(w,10),w=v,v=E}E=n(this.h[1],m,_),this.h[1]=n(this.h[2],g,M),this.h[2]=n(this.h[3],y,b),this.h[3]=n(this.h[4],s,v),this.h[4]=n(this.h[0],a,w),this.h[0]=E},a.prototype._digest=function(t){return"hex"===t?e.toHex32(this.h,"little"):e.split32(this.h,"little")};var l=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],d=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return ripemd}function requireHmac$1(){if(hasRequiredHmac$1)return hmac$2;hasRequiredHmac$1=1;var e=requireUtils(),t=requireMinimalisticAssert();function r(t,i,n){if(!(this instanceof r))return new r(t,i,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(e.toArray(i,n))}return hmac$2=r,r.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),t(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=(new this.Hash).update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=(new this.Hash).update(e)},r.prototype.update=function(e,t){return this.inner.update(e,t),this},r.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},hmac$2}function requireHash(){return hasRequiredHash||(hasRequiredHash=1,(e=hash).utils=requireUtils(),e.common=requireCommon$1(),e.sha=requireSha(),e.ripemd=requireRipemd(),e.hmac=requireHmac$1(),e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160),hash;var e}function requireSecp256k1(){return hasRequiredSecp256k1?secp256k1:(hasRequiredSecp256k1=1,secp256k1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}})}function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,function(e){var t,r=e,i=requireHash(),n=requireCurve(),o=requireUtils$1().assert;function s(e){"short"===e.type?this.curve=new n.short(e):"edwards"===e.type?this.curve=new n.edwards(e):this.curve=new n.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var i=new s(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=s,a("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:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:i.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"]}),a("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:i.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),a("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:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=requireSecp256k1()}catch(e){t=void 0}a("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:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}(curves)),curves}function requireHmacDrbg(){if(hasRequiredHmacDrbg)return hmacDrbg;hasRequiredHmacDrbg=1;var e=requireHash(),t=requireUtils$2(),r=requireMinimalisticAssert();function i(e){if(!(this instanceof i))return new i(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=t.toArray(e.entropy,e.entropyEnc||"hex"),o=t.toArray(e.nonce,e.nonceEnc||"hex"),s=t.toArray(e.pers,e.persEnc||"hex");r(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,o,s)}return hmacDrbg=i,i.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new e.hmac(this.hash,this.K)},i.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(e,i,n,o){"string"!=typeof i&&(o=n,n=i,i=null),e=t.toArray(e,i),n=t.toArray(n,o),r(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},i.prototype.generate=function(e,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(n=i,i=r,r=null),i&&(i=t.toArray(i,n||"hex"),this._update(i));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(i),this._reseed++,t.encode(s,r)},hmacDrbg}function requireKey$1(){if(hasRequiredKey$1)return key$1;hasRequiredKey$1=1;var e=requireBn$3(),t=requireUtils$1().assert;function r(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}return key$1=r,r.fromPublic=function(e,t,i){return t instanceof r?t:new r(e,{pub:t,pubEnc:i})},r.fromPrivate=function(e,t,i){return t instanceof r?t:new r(e,{priv:t,privEnc:i})},r.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},r.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(t,r){this.priv=new e(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(e,r){if(e.x||e.y)return"mont"===this.ec.curve.type?t(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||t(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,r)},r.prototype.derive=function(e){return e.validate()||t(e.validate(),"public point not validated"),e.mul(this.priv).getX()},r.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},r.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},key$1}function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1;var e=requireBn$3(),t=requireUtils$1(),r=t.assert;function i(t,n){if(t instanceof i)return t;this._importDER(t,n)||(r(t.r&&t.s,"Signature without r or s"),this.r=new e(t.r,16),this.s=new e(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function n(){this.place=0}function o(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;if(0===e[t.place])return!1;for(var n=0,o=0,s=t.place;o<i;o++,s++)n<<=8,n|=e[s],n>>>=0;return!(n<=127)&&(t.place=s,n)}function s(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function a(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}return signature$1=i,i.prototype._importDER=function(r,i){r=t.toArray(r,i);var s=new n;if(48!==r[s.place++])return!1;var a=o(r,s);if(!1===a)return!1;if(a+s.place!==r.length)return!1;if(2!==r[s.place++])return!1;var u=o(r,s);if(!1===u)return!1;if(128&r[s.place])return!1;var h=r.slice(s.place,u+s.place);if(s.place+=u,2!==r[s.place++])return!1;var f=o(r,s);if(!1===f)return!1;if(r.length!==f+s.place)return!1;if(128&r[s.place])return!1;var l=r.slice(s.place,f+s.place);if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new e(h),this.s=new e(l),this.recoveryParam=null,!0},i.prototype.toDER=function(e){var r=this.r.toArray(),i=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&i[0]&&(i=[0].concat(i)),r=s(r),i=s(i);!(i[0]||128&i[1]);)i=i.slice(1);var n=[2];a(n,r.length),(n=n.concat(r)).push(2),a(n,i.length);var o=n.concat(i),u=[48];return a(u,o.length),u=u.concat(o),t.encode(u,e)},signature$1}function requireEc(){if(hasRequiredEc)return ec;hasRequiredEc=1;var e=requireBn$3(),t=requireHmacDrbg(),r=requireUtils$1(),i=requireCurves(),n=requireBrorand(),o=r.assert,s=requireKey$1(),a=requireSignature$1();function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(o(Object.prototype.hasOwnProperty.call(i,e),"Unknown curve "+e),e=i[e]),e instanceof i.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}return ec=u,u.prototype.keyPair=function(e){return new s(this,e)},u.prototype.keyFromPrivate=function(e,t){return s.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return s.fromPublic(this,e,t)},u.prototype.genKeyPair=function(r){r||(r={});for(var i=new t({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||n(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),o=this.n.byteLength(),s=this.n.sub(new e(2));;){var a=new e(i.generate(o));if(!(a.cmp(s)>0))return a.iaddn(1),this.keyFromPrivate(a)}},u.prototype._truncateToN=function(t,r,i){var n;if(e.isBN(t)||"number"==typeof t)n=(t=new e(t,16)).byteLength();else if("object"==typeof t)n=t.length,t=new e(t,16);else{var o=t.toString();n=o.length+1>>>1,t=new e(o,16)}"number"!=typeof i&&(i=8*n);var s=i-this.n.bitLength();return s>0&&(t=t.ushrn(s)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},u.prototype.sign=function(r,i,n,s){if("object"==typeof n&&(s=n,n=null),s||(s={}),"string"!=typeof r&&"number"!=typeof r&&!e.isBN(r)){o("object"==typeof r&&r&&"number"==typeof r.length,"Expected message to be an array-like, a hex string, or a BN instance"),o(r.length>>>0===r.length);for(var u=0;u<r.length;u++)o((255&r[u])===r[u])}i=this.keyFromPrivate(i,n),r=this._truncateToN(r,!1,s.msgBitLength),o(!r.isNeg(),"Can not sign a negative message");var h=this.n.byteLength(),f=i.getPrivate().toArray("be",h),l=r.toArray("be",h);o(new e(l).eq(r),"Can not sign message");for(var c=new t({hash:this.hash,entropy:f,nonce:l,pers:s.pers,persEnc:s.persEnc||"utf8"}),d=this.n.sub(new e(1)),p=0;;p++){var m=s.k?s.k(p):new e(c.generate(this.n.byteLength()));if(!((m=this._truncateToN(m,!0)).cmpn(1)<=0||m.cmp(d)>=0)){var g=this.g.mul(m);if(!g.isInfinity()){var y=g.getX(),b=y.umod(this.n);if(0!==b.cmpn(0)){var v=m.invm(this.n).mul(b.mul(i.getPrivate()).iadd(r));if(0!==(v=v.umod(this.n)).cmpn(0)){var w=(g.getY().isOdd()?1:0)|(0!==y.cmp(b)?2:0);return s.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),w^=1),new a({r:b,s:v,recoveryParam:w})}}}}}},u.prototype.verify=function(e,t,r,i,n){n||(n={}),e=this._truncateToN(e,!1,n.msgBitLength),r=this.keyFromPublic(r,i);var o=(t=new a(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var u,h=s.invm(this.n),f=h.mul(e).umod(this.n),l=h.mul(o).umod(this.n);return this.curve._maxwellTrick?!(u=this.g.jmulAdd(f,r.getPublic(),l)).isInfinity()&&u.eqXToP(o):!(u=this.g.mulAdd(f,r.getPublic(),l)).isInfinity()&&0===u.getX().umod(this.n).cmp(o)},u.prototype.recoverPubKey=function(t,r,i,n){o((3&i)===i,"The recovery param is more than two bits"),r=new a(r,n);var s=this.n,u=new e(t),h=r.r,f=r.s,l=1&i,c=i>>1;if(h.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");h=c?this.curve.pointFromX(h.add(this.curve.n),l):this.curve.pointFromX(h,l);var d=r.r.invm(s),p=s.sub(u).mul(d).umod(s),m=f.mul(d).umod(s);return this.g.mulAdd(p,h,m)},u.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new a(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")},ec}function requireKey(){if(hasRequiredKey)return key;hasRequiredKey=1;var e=requireUtils$1(),t=e.assert,r=e.parseBytes,i=e.cachedProperty;function n(e,t){this.eddsa=e,this._secret=r(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=r(t.pub)}return n.fromPublic=function(e,t){return t instanceof n?t:new n(e,{pub:t})},n.fromSecret=function(e,t){return t instanceof n?t:new n(e,{secret:t})},n.prototype.secret=function(){return this._secret},i(n,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),i(n,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),i(n,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),i(n,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),i(n,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),i(n,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),n.prototype.sign=function(e){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},n.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},n.prototype.getSecret=function(r){return t(this._secret,"KeyPair is public only"),e.encode(this.secret(),r)},n.prototype.getPublic=function(t){return e.encode(this.pubBytes(),t)},key=n}function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var e=requireBn$3(),t=requireUtils$1(),r=t.assert,i=t.cachedProperty,n=t.parseBytes;function o(t,i){this.eddsa=t,"object"!=typeof i&&(i=n(i)),Array.isArray(i)&&(r(i.length===2*t.encodingLength,"Signature has invalid size"),i={R:i.slice(0,t.encodingLength),S:i.slice(t.encodingLength)}),r(i.R&&i.S,"Signature without R or S"),t.isPoint(i.R)&&(this._R=i.R),i.S instanceof e&&(this._S=i.S),this._Rencoded=Array.isArray(i.R)?i.R:i.Rencoded,this._Sencoded=Array.isArray(i.S)?i.S:i.Sencoded}return i(o,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),i(o,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),i(o,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),i(o,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},signature=o}function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;var e=requireHash(),t=requireCurves(),r=requireUtils$1(),i=r.assert,n=r.parseBytes,o=requireKey(),s=requireSignature();function a(r){if(i("ed25519"===r,"only tested with ed25519 so far"),!(this instanceof a))return new a(r);r=t[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=e.sha512}return eddsa=a,a.prototype.sign=function(e,t){e=n(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),o=this.g.mul(i),s=this.encodePoint(o),a=this.hashInt(s,r.pubBytes(),e).mul(r.priv()),u=i.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:u,Rencoded:s})},a.prototype.verify=function(e,t,r){if(e=n(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var i=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),i.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(i.pub().mul(o)).eq(s)},a.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return r.intFromLE(e.digest()).umod(this.curve.n)},a.prototype.keyFromPublic=function(e){return o.fromPublic(this,e)},a.prototype.keyFromSecret=function(e){return o.fromSecret(this,e)},a.prototype.makeSignature=function(e){return e instanceof s?e:new s(this,e)},a.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},a.prototype.decodePoint=function(e){var t=(e=r.parseBytes(e)).length-1,i=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),o=r.intFromLE(i);return this.curve.pointFromY(o,n)},a.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},a.prototype.decodeInt=function(e){return r.intFromLE(e)},a.prototype.isPoint=function(e){return e instanceof this.pointClass},eddsa}function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,(e=elliptic).version=require$$0.version,e.utils=requireUtils$1(),e.rand=requireBrorand(),e.curve=requireCurve(),e.curves=requireCurves(),e.ec=requireEc(),e.eddsa=requireEddsa()),elliptic;var e}var asn1$1={},asn1={},bn$5={exports:{}},bn$4=bn$5.exports,hasRequiredBn$2;function requireBn$2(){return hasRequiredBn$2||(hasRequiredBn$2=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$5,bn$4)),bn$5.exports}var api={},vmBrowserify={},hasRequiredVmBrowserify,hasRequiredApi;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,function(exports$1){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(e){return function(e,t,r){e[t]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports$1.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,i=r.eval,n=r.execScript;!i&&n&&(n.call(r,"null"),i=r.eval),forEach(Object_keys(e),(function(t){r[t]=e[t]})),forEach(globals,(function(t){e[t]&&(r[t]=e[t])}));var o=Object_keys(r),s=i.call(r,this.code);return forEach(Object_keys(r),(function(t){(t in e||-1===indexOf(o,t))&&(e[t]=r[t])})),forEach(globals,(function(t){t in e||defineProp(e,t,r[t])})),document.body.removeChild(t),s},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return e&&forEach(Object_keys(t),(function(r){e[r]=t[r]})),r},forEach(Object_keys(Script.prototype),(function(e){exports$1[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}})),exports$1.isContext=function(e){return e instanceof Context},exports$1.createScript=function(e){return exports$1.Script(e)},exports$1.createContext=Script.createContext=function(e){var t=new Context;return"object"==typeof e&&forEach(Object_keys(e),(function(r){t[r]=e[r]})),t}}(vmBrowserify)),vmBrowserify}function requireApi(){return hasRequiredApi||(hasRequiredApi=1,function(e){var t=requireAsn1$1(),r=requireInherits_browser();function i(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}e.define=function(e,t){return new i(e,t)},i.prototype._createNamed=function(e){var t;try{t=requireVmBrowserify().runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return r(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},i.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(t.decoders[e])),this.decoders[e]},i.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},i.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(t.encoders[e])),this.encoders[e]},i.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}}(api)),api}var base={},reporter={},hasRequiredReporter;function requireReporter(){if(hasRequiredReporter)return reporter;hasRequiredReporter=1;var e=requireInherits_browser();function t(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function r(e,t){this.path=e,this.rethrow(t)}return reporter.Reporter=t,t.prototype.isError=function(e){return e instanceof r},t.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},t.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},t.prototype.enterKey=function(e){return this._reporterState.path.push(e)},t.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},t.prototype.leaveKey=function(e,t,r){var i=this._reporterState;this.exitKey(e),null!==i.obj&&(i.obj[t]=r)},t.prototype.path=function(){return this._reporterState.path.join("/")},t.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},t.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},t.prototype.error=function(e){var t,i=this._reporterState,n=e instanceof r;if(t=n?e:new r(i.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!i.options.partial)throw t;return n||i.errors.push(t),t},t.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},e(r,Error),r.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,r),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this},reporter}var buffer={},hasRequiredBuffer,node,hasRequiredNode,hasRequiredBase;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;var e=requireInherits_browser(),t=requireBase().Reporter,r=requireDist().Buffer;function i(e,i){t.call(this,i),r.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function n(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof n||(e=new n(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=r.byteLength(e);else{if(!r.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}return e(i,t),buffer.DecoderBuffer=i,i.prototype.save=function(){return{offset:this.offset,reporter:t.prototype.save.call(this)}},i.prototype.restore=function(e){var r=new i(this.base);return r.offset=e.offset,r.length=this.offset,this.offset=e.offset,t.prototype.restore.call(this,e.reporter),r},i.prototype.isEmpty=function(){return this.offset===this.length},i.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},i.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new i(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},i.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},buffer.EncoderBuffer=n,n.prototype.join=function(e,t){return e||(e=new r(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(e,t),t+=r.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):r.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e},buffer}function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var e=requireBase().Reporter,t=requireBase().EncoderBuffer,r=requireBase().DecoderBuffer,i=requireMinimalisticAssert(),n=["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"],o=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(n);function s(e,t){var r={};this._baseState=r,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())}node=s;var a=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return s.prototype.clone=function(){var e=this._baseState,t={};a.forEach((function(r){t[r]=e[r]}));var r=new this.constructor(t.parent);return r._baseState=t,r},s.prototype._wrap=function(){var e=this._baseState;o.forEach((function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}}),this)},s.prototype._init=function(e){var t=this._baseState;i(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),i.equal(t.children.length,1,"Root node can have only one child")},s.prototype._useArgs=function(e){var t=this._baseState,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(i(null===t.children),t.children=r,r.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(i(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(r){r==(0|r)&&(r|=0);var i=e[r];t[i]=r})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){s.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),n.forEach((function(e){s.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return i(null===t.tag),t.tag=e,this._useArgs(r),this}})),s.prototype.use=function(e){i(e);var t=this._baseState;return i(null===t.use),t.use=e,this},s.prototype.optional=function(){return this._baseState.optional=!0,this},s.prototype.def=function(e){var t=this._baseState;return i(null===t.default),t.default=e,t.optional=!0,this},s.prototype.explicit=function(e){var t=this._baseState;return i(null===t.explicit&&null===t.implicit),t.explicit=e,this},s.prototype.implicit=function(e){var t=this._baseState;return i(null===t.explicit&&null===t.implicit),t.implicit=e,this},s.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},s.prototype.key=function(e){var t=this._baseState;return i(null===t.key),t.key=e,this},s.prototype.any=function(){return this._baseState.any=!0,this},s.prototype.choice=function(e){var t=this._baseState;return i(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},s.prototype.contains=function(e){var t=this._baseState;return i(null===t.use),t.contains=e,this},s.prototype._decode=function(e,t){var i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,t));var n,o=i.default,s=!0,a=null;if(null!==i.key&&(a=e.enterKey(i.key)),i.optional){var u=null;if(null!==i.explicit?u=i.explicit:null!==i.implicit?u=i.implicit:null!==i.tag&&(u=i.tag),null!==u||i.any){if(s=this._peekTag(e,u,i.any),e.isError(s))return s}else{var h=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),s=!0}catch(e){s=!1}e.restore(h)}}if(i.obj&&s&&(n=e.enterObject()),s){if(null!==i.explicit){var f=this._decodeTag(e,i.explicit);if(e.isError(f))return f;e=f}var l=e.offset;if(null===i.use&&null===i.choice){if(i.any)h=e.save();var c=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(c))return c;i.any?o=e.raw(h):e=c}if(t&&t.track&&null!==i.tag&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(o=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(o))return o;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(r){r._decode(e,t)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){var d=new r(o);o=this._getUse(i.contains,e._reporterState.obj)._decode(d,t)}}return i.obj&&s&&(o=e.leaveObject(n)),null===i.key||null===o&&!0!==s?null!==a&&e.exitKey(a):e.leaveKey(a,i.key,o),o},s.prototype._decodeGeneric=function(e,t,r){var i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},s.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),i(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},s.prototype._decodeChoice=function(e,t){var r=this._baseState,i=null,n=!1;return Object.keys(r.choice).some((function(o){var s=e.save(),a=r.choice[o];try{var u=a._decode(e,t);if(e.isError(u))return!1;i={type:o,value:u},n=!0}catch(t){return e.restore(s),!1}return!0}),this),n?i:e.error("Choice not matched")},s.prototype._createEncoderBuffer=function(e){return new t(e,this.reporter)},s.prototype._encode=function(e,t,r){var i=this._baseState;if(null===i.default||i.default!==e){var n=this._encodeValue(e,t,r);if(void 0!==n&&!this._skipDefault(n,t,r))return n}},s.prototype._encodeValue=function(t,r,i){var n=this._baseState;if(null===n.parent)return n.children[0]._encode(t,r||new e);var o=null;if(this.reporter=r,n.optional&&void 0===t){if(null===n.default)return;t=n.default}var s=null,a=!1;if(n.any)o=this._createEncoderBuffer(t);else if(n.choice)o=this._encodeChoice(t,r);else if(n.contains)s=this._getUse(n.contains,i)._encode(t,r),a=!0;else if(n.children)s=n.children.map((function(e){if("null_"===e._baseState.tag)return e._encode(null,r,t);if(null===e._baseState.key)return r.error("Child should have a key");var i=r.enterKey(e._baseState.key);if("object"!=typeof t)return r.error("Child expected, but input is not object");var n=e._encode(t[e._baseState.key],r,t);return r.leaveKey(i),n}),this).filter((function(e){return e})),s=this._createEncoderBuffer(s);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return r.error("Too many args for : "+n.tag);if(!Array.isArray(t))return r.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(e){var i=this._baseState;return this._getUse(i.args[0],t)._encode(e,r)}),u))}else null!==n.use?o=this._getUse(n.use,i)._encode(t,r):(s=this._encodePrimitive(n.tag,t),a=!0);if(!n.any&&null===n.choice){var h=null!==n.implicit?n.implicit:n.tag,f=null===n.implicit?"universal":"context";null===h?null===n.use&&r.error("Tag could be omitted only for .use()"):null===n.use&&(o=this._encodeComposite(h,a,f,s))}return null!==n.explicit&&(o=this._encodeComposite(n.explicit,!1,"context",o)),o},s.prototype._encodeChoice=function(e,t){var r=this._baseState,n=r.choice[e.type];return n||i(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},s.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.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,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},s.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},s.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)},node}function requireBase(){return hasRequiredBase||(hasRequiredBase=1,(e=base).Reporter=requireReporter().Reporter,e.DecoderBuffer=requireBuffer().DecoderBuffer,e.EncoderBuffer=requireBuffer().EncoderBuffer,e.Node=requireNode()),base;var e}var constants={},der={},hasRequiredDer$2,hasRequiredConstants;function requireDer$2(){return hasRequiredDer$2||(hasRequiredDer$2=1,e=der,t=requireConstants(),e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t._reverse(e.tagClass),e.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"},e.tagByName=t._reverse(e.tag)),der;var e,t}function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,(e=constants)._reverse=function(e){var t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);var i=e[r];t[i]=r})),t},e.der=requireDer$2()),constants;var e}var decoders={},der_1$1,hasRequiredDer$1,pem$1,hasRequiredPem$1,hasRequiredDecoders;function requireDer$1(){if(hasRequiredDer$1)return der_1$1;hasRequiredDer$1=1;var e=requireInherits_browser(),t=requireAsn1$1(),r=t.base,i=t.bignum,n=t.constants.der;function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new s,this.tree._init(e.body)}function s(e){r.Node.call(this,"der",e)}function a(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var i=n.tagClass[r>>6],o=!(32&r);if(31&~r)r&=31;else{var s=r;for(r=0;!(128&~s);){if(s=e.readUInt8(t),e.isError(s))return s;r<<=7,r|=127&s}}return{cls:i,primitive:o,tag:r,tagStr:n.tag[r]}}function u(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(!(128&i))return i;var n=127&i;if(n>4)return e.error("length octect is too long");i=0;for(var o=0;o<n;o++){i<<=8;var s=e.readUInt8(r);if(e.isError(s))return s;i|=s}return i}return der_1$1=o,o.prototype.decode=function(e,t){return e instanceof r.DecoderBuffer||(e=new r.DecoderBuffer(e,t)),this.tree._decode(e,t)},e(s,r.Node),s.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;var i=e.save(),n=a(e,'Failed to peek tag: "'+t+'"');return e.isError(n)?n:(e.restore(i),n.tag===t||n.tagStr===t||n.tagStr+"of"===t||r)},s.prototype._decodeTag=function(e,t,r){var i=a(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;var n=u(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(n))return n;if(!r&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(i.primitive||null!==n)return e.skip(n,'Failed to match body of: "'+t+'"');var o=e.save(),s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(s)?s:(n=e.offset-o.offset,e.restore(o),e.skip(n,'Failed to match body of: "'+t+'"'))},s.prototype._skipUntilEnd=function(e,t){for(;;){var r=a(e,t);if(e.isError(r))return r;var i,n=u(e,r.primitive,t);if(e.isError(n))return n;if(i=r.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===r.tagStr)break}},s.prototype._decodeList=function(e,t,r,i){for(var n=[];!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var s=r.decode(e,"der",i);if(e.isError(s)&&o)break;n.push(s)}return n},s.prototype._decodeStr=function(e,t){if("bitstr"===t){var r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}if("bmpstr"===t){var i=e.raw();if(i.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var n="",o=0;o<i.length/2;o++)n+=String.fromCharCode(i.readUInt16BE(2*o));return n}if("numstr"===t){var s=e.raw().toString("ascii");return this._isNumstr(s)?s:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var a=e.raw().toString("ascii");return this._isPrintstr(a)?a:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},s.prototype._decodeObjid=function(e,t,r){for(var i,n=[],o=0;!e.isEmpty();){var s=e.readUInt8();o<<=7,o|=127&s,128&s||(n.push(o),o=0)}128&s&&n.push(o);var a=n[0]/40|0,u=n[0]%40;if(i=r?n:[a,u].concat(n.slice(1)),t){var h=t[i.join(" ")];void 0===h&&(h=t[i.join(".")]),void 0!==h&&(i=h)}return i},s.prototype._decodeTime=function(e,t){var r=e.raw().toString();if("gentime"===t)var i=0|r.slice(0,4),n=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");i=0|r.slice(0,2),n=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),u=0|r.slice(10,12);i=i<70?2e3+i:1900+i}return Date.UTC(i,n-1,o,s,a,u,0)},s.prototype._decodeNull=function(e){return null},s.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},s.prototype._decodeInt=function(e,t){var r=e.raw(),n=new i(r);return t&&(n=t[n.toString(10)]||n),n},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree},der_1$1}function requirePem$1(){if(hasRequiredPem$1)return pem$1;hasRequiredPem$1=1;var e=requireInherits_browser(),t=requireDist().Buffer,r=requireDer$1();function i(e){r.call(this,e),this.enc="pem"}return e(i,r),pem$1=i,i.prototype.decode=function(e,i){for(var n=e.toString().split(/[\r\n]+/g),o=i.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,a=-1,u=-1,h=0;h<n.length;h++){var f=n[h].match(s);if(null!==f&&f[2]===o){if(-1!==a){if("END"!==f[1])break;u=h;break}if("BEGIN"!==f[1])break;a=h}}if(-1===a||-1===u)throw new Error("PEM section not found for: "+o);var l=n.slice(a+1,u).join("");l.replace(/[^a-z0-9\+\/=]+/gi,"");var c=new t(l,"base64");return r.prototype.decode.call(this,c,i)},pem$1}function requireDecoders(){return hasRequiredDecoders||(hasRequiredDecoders=1,(e=decoders).der=requireDer$1(),e.pem=requirePem$1()),decoders;var e}var encoders={},der_1,hasRequiredDer,pem,hasRequiredPem,hasRequiredEncoders,hasRequiredAsn1$1,certificate,hasRequiredCertificate,hasRequiredAsn1;function requireDer(){if(hasRequiredDer)return der_1;hasRequiredDer=1;var e=requireInherits_browser(),t=requireDist().Buffer,r=requireAsn1$1(),i=r.base,n=r.constants.der;function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new s,this.tree._init(e.body)}function s(e){i.Node.call(this,"der",e)}function a(e){return e<10?"0"+e:e}return der_1=o,o.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},e(s,i.Node),s.prototype._encodeComposite=function(e,r,i,o){var s,a=function(e,t,r,i){var o;"seqof"===e?e="seq":"setof"===e&&(e="set");if(n.tagByName.hasOwnProperty(e))o=n.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return i.error("Unknown tag: "+e);o=e}if(o>=31)return i.error("Multi-octet tag encoding unsupported");t||(o|=32);return o|=n.tagClassByName[r||"universal"]<<6,o}(e,r,i,this.reporter);if(o.length<128)return(s=new t(2))[0]=a,s[1]=o.length,this._createEncoderBuffer([s,o]);for(var u=1,h=o.length;h>=256;h>>=8)u++;(s=new t(2+u))[0]=a,s[1]=128|u;h=1+u;for(var f=o.length;f>0;h--,f>>=8)s[h]=255&f;return this._createEncoderBuffer([s,o])},s.prototype._encodeStr=function(e,r){if("bitstr"===r)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===r){for(var i=new t(2*e.length),n=0;n<e.length;n++)i.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(i)}return"numstr"===r?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===r?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(r)||"objDesc"===r?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+r+" unsupported")},s.prototype._encodeObjid=function(e,r,i){if("string"==typeof e){if(!r)return this.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=r[e].split(/[\s\.]+/g);for(var n=0;n<e.length;n++)e[n]|=0}else if(Array.isArray(e)){e=e.slice();for(n=0;n<e.length;n++)e[n]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!i){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(n=0;n<e.length;n++){var s=e[n];for(o++;s>=128;s>>=7)o++}var a=new t(o),u=a.length-1;for(n=e.length-1;n>=0;n--){s=e[n];for(a[u--]=127&s;(s>>=7)>0;)a[u--]=128|127&s}return this._createEncoderBuffer(a)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[a(i.getFullYear()),a(i.getUTCMonth()+1),a(i.getUTCDate()),a(i.getUTCHours()),a(i.getUTCMinutes()),a(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[a(i.getFullYear()%100),a(i.getUTCMonth()+1),a(i.getUTCDate()),a(i.getUTCHours()),a(i.getUTCMinutes()),a(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(e,r){if("string"==typeof e){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=r[e]}if("number"!=typeof e&&!t.isBuffer(e)){var i=e.toArray();!e.sign&&128&i[0]&&i.unshift(0),e=new t(i)}if(t.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new t(n);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]);n=1;for(var s=e;s>=256;s>>=8)n++;for(s=(o=new Array(n)).length-1;s>=0;s--)o[s]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new t(o))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0},der_1}function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var e=requireInherits_browser(),t=requireDer();function r(e){t.call(this,e),this.enc="pem"}return e(r,t),pem=r,r.prototype.encode=function(e,r){for(var i=t.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+r.label+"-----"],o=0;o<i.length;o+=64)n.push(i.slice(o,o+64));return n.push("-----END "+r.label+"-----"),n.join("\n")},pem}function requireEncoders(){return hasRequiredEncoders||(hasRequiredEncoders=1,(e=encoders).der=requireDer(),e.pem=requirePem()),encoders;var e}function requireAsn1$1(){return hasRequiredAsn1$1||(hasRequiredAsn1$1=1,(e=asn1).bignum=requireBn$2(),e.define=requireApi().define,e.base=requireBase(),e.constants=requireConstants(),e.decoders=requireDecoders(),e.encoders=requireEncoders()),asn1;var e}function requireCertificate(){if(hasRequiredCertificate)return certificate;hasRequiredCertificate=1;var e=requireAsn1$1(),t=e.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),r=e.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),i=e.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),n=e.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())})),o=e.define("RelativeDistinguishedName",(function(){this.setof(r)})),s=e.define("RDNSequence",(function(){this.seqof(o)})),a=e.define("Name",(function(){this.choice({rdnSequence:this.use(s)})})),u=e.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(t),this.key("notAfter").use(t))})),h=e.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),f=e.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(i),this.key("issuer").use(a),this.key("validity").use(u),this.key("subject").use(a),this.key("subjectPublicKeyInfo").use(n),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),l=e.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(f),this.key("signatureAlgorithm").use(i),this.key("signatureValue").bitstr())}));return certificate=l}function requireAsn1(){if(hasRequiredAsn1)return asn1$1;hasRequiredAsn1=1;var e=requireAsn1$1();asn1$1.certificate=requireCertificate();var t=e.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));asn1$1.RSAPrivateKey=t;var r=e.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));asn1$1.RSAPublicKey=r;var i=e.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),n=e.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())}));asn1$1.PublicKey=n;var o=e.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(i),this.key("subjectPrivateKey").octstr())}));asn1$1.PrivateKey=o;var s=e.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));asn1$1.EncryptedPrivateKey=s;var a=e.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));asn1$1.DSAPrivateKey=a,asn1$1.DSAparam=e.define("DSAparam",(function(){this.int()}));var u=e.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})})),h=e.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(u),this.key("publicKey").optional().explicit(1).bitstr())}));return asn1$1.ECPrivateKey=h,asn1$1.signature=e.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())})),asn1$1}const require$$1={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var safeBuffer={exports:{}},hasRequiredSafeBuffer,fixProc,hasRequiredFixProc,parseAsn1,hasRequiredParseAsn1;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,function(e,t){var r=requireDist(),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),n(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}(safeBuffer,safeBuffer.exports)),safeBuffer.exports}function requireFixProc(){if(hasRequiredFixProc)return fixProc;hasRequiredFixProc=1;var e=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,t=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,i=requireEvp_bytestokey(),n=requireBrowser$7(),o=requireSafeBuffer().Buffer;return fixProc=function(s,a){var u,h=s.toString(),f=h.match(e);if(f){var l="aes"+f[1],c=o.from(f[2],"hex"),d=o.from(f[3].replace(/[\r\n]/g,""),"base64"),p=i(a,c.slice(0,8),parseInt(f[1],10)).key,m=[],g=n.createDecipheriv(l,p,c);m.push(g.update(d)),m.push(g.final()),u=o.concat(m)}else{var y=h.match(r);u=o.from(y[2].replace(/[\r\n]/g,""),"base64")}return{tag:h.match(t)[1],data:u}}}function requireParseAsn1(){if(hasRequiredParseAsn1)return parseAsn1;hasRequiredParseAsn1=1;var e=requireAsn1(),t=require$$1,r=requireFixProc(),i=requireBrowser$7(),n=requireBrowser$8(),o=requireSafeBuffer().Buffer;function s(s){var a;"object"!=typeof s||o.isBuffer(s)||(a=s.passphrase,s=s.key),"string"==typeof s&&(s=o.from(s));var u,h,f=r(s,a),l=f.tag,c=f.data;switch(l){case"CERTIFICATE":h=e.certificate.decode(c,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(h||(h=e.PublicKey.decode(c,"der")),u=h.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return e.RSAPublicKey.decode(h.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return h.subjectPrivateKey=h.subjectPublicKey,{type:"ec",data:h};case"1.2.840.10040.4.1":return h.algorithm.params.pub_key=e.DSAparam.decode(h.subjectPublicKey.data,"der"),{type:"dsa",data:h.algorithm.params};default:throw new Error("unknown key id "+u)}case"ENCRYPTED PRIVATE KEY":c=function(e,r){var s=e.algorithm.decrypt.kde.kdeparams.salt,a=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),u=t[e.algorithm.decrypt.cipher.algo.join(".")],h=e.algorithm.decrypt.cipher.iv,f=e.subjectPrivateKey,l=parseInt(u.split("-")[1],10)/8,c=n.pbkdf2Sync(r,s,a,l,"sha1"),d=i.createDecipheriv(u,c,h),p=[];return p.push(d.update(f)),p.push(d.final()),o.concat(p)}(c=e.EncryptedPrivateKey.decode(c,"der"),a);case"PRIVATE KEY":switch(u=(h=e.PrivateKey.decode(c,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return e.RSAPrivateKey.decode(h.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:h.algorithm.curve,privateKey:e.ECPrivateKey.decode(h.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return h.algorithm.params.priv_key=e.DSAparam.decode(h.subjectPrivateKey,"der"),{type:"dsa",params:h.algorithm.params};default:throw new Error("unknown key id "+u)}case"RSA PUBLIC KEY":return e.RSAPublicKey.decode(c,"der");case"RSA PRIVATE KEY":return e.RSAPrivateKey.decode(c,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:e.DSAPrivateKey.decode(c,"der")};case"EC PRIVATE KEY":return{curve:(c=e.ECPrivateKey.decode(c,"der")).parameters.value,privateKey:c.privateKey};default:throw new Error("unknown key type "+l)}}return s.signature=e.signature,parseAsn1=s}const require$$4={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var hasRequiredSign,verify_1,hasRequiredVerify,browser$5,hasRequiredBrowser$4;function requireSign(){if(hasRequiredSign)return sign.exports;hasRequiredSign=1;var e=requireSafeBuffer$3().Buffer,t=requireBrowser$9(),r=requireBrowserifyRsa(),i=requireElliptic().ec,n=requireBn$4(),o=requireParseAsn1(),s=require$$4;function a(r,i,n,o){if((r=e.from(r.toArray())).length<i.byteLength()){var s=e.alloc(i.byteLength()-r.length);r=e.concat([s,r])}var a=n.length,h=function(t,r){t=u(t,r),t=t.mod(r);var i=e.from(t.toArray());if(i.length<r.byteLength()){var n=e.alloc(r.byteLength()-i.length);i=e.concat([n,i])}return i}(n,i),f=e.alloc(a);f.fill(1);var l=e.alloc(a);return l=t(o,l).update(f).update(e.from([0])).update(r).update(h).digest(),f=t(o,l).update(f).digest(),{k:l=t(o,l).update(f).update(e.from([1])).update(r).update(h).digest(),v:f=t(o,l).update(f).digest()}}function u(e,t){var r=new n(e),i=(e.length<<3)-t.bitLength();return i>0&&r.ishrn(i),r}function h(r,i,n){var o,s;do{for(o=e.alloc(0);8*o.length<r.bitLength();)i.v=t(n,i.k).update(i.v).digest(),o=e.concat([o,i.v]);s=u(o,r),i.k=t(n,i.k).update(i.v).update(e.from([0])).digest(),i.v=t(n,i.k).update(i.v).digest()}while(-1!==s.cmp(r));return s}function f(e,t,r,i){return e.toRed(n.mont(r)).redPow(t).fromRed().mod(i)}return sign.exports=function(t,l,c,d,p){var m=o(l);if(m.curve){if("ecdsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");return function(t,r){var n=s[r.curve.join(".")];if(!n)throw new Error("unknown curve "+r.curve.join("."));var o=new i(n).keyFromPrivate(r.privateKey),a=o.sign(t);return e.from(a.toDER())}(t,m)}if("dsa"===m.type){if("dsa"!==d)throw new Error("wrong private key type");return function(t,r,i){var o,s=r.params.priv_key,l=r.params.p,c=r.params.q,d=r.params.g,p=new n(0),m=u(t,c).mod(c),g=!1,y=a(s,c,t,i);for(;!1===g;)p=f(d,o=h(c,y,i),l,c),0===(g=o.invm(c).imul(m.add(s.mul(p))).mod(c)).cmpn(0)&&(g=!1,p=new n(0));return function(t,r){t=t.toArray(),r=r.toArray(),128&t[0]&&(t=[0].concat(t));128&r[0]&&(r=[0].concat(r));var i=t.length+r.length+4,n=[48,i,2,t.length];return n=n.concat(t,[2,r.length],r),e.from(n)}(p,g)}(t,m,c)}if("rsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");if(void 0!==l.padding&&1!==l.padding)throw new Error("illegal or unsupported padding mode");t=e.concat([p,t]);for(var g=m.modulus.byteLength(),y=[0,1];t.length+y.length+1<g;)y.push(255);y.push(0);for(var b=-1;++b<t.length;)y.push(t[b]);return r(y,m)},sign.exports.getKey=a,sign.exports.makeKey=h,sign.exports}function requireVerify(){if(hasRequiredVerify)return verify_1;hasRequiredVerify=1;var e=requireSafeBuffer$3().Buffer,t=requireBn$4(),r=requireElliptic().ec,i=requireParseAsn1(),n=require$$4;function o(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=0)throw new Error("invalid sig")}return verify_1=function(s,a,u,h,f){var l=i(u);if("ec"===l.type){if("ecdsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");return function(e,t,i){var o=n[i.data.algorithm.curve.join(".")];if(!o)throw new Error("unknown curve "+i.data.algorithm.curve.join("."));var s=new r(o),a=i.data.subjectPrivateKey.data;return s.verify(t,e,a)}(s,a,l)}if("dsa"===l.type){if("dsa"!==h)throw new Error("wrong public key type");return function(e,r,n){var s=n.data.p,a=n.data.q,u=n.data.g,h=n.data.pub_key,f=i.signature.decode(e,"der"),l=f.s,c=f.r;o(l,a),o(c,a);var d=t.mont(s),p=l.invm(a),m=u.toRed(d).redPow(new t(r).mul(p).mod(a)).fromRed().mul(h.toRed(d).redPow(c.mul(p).mod(a)).fromRed()).mod(s).mod(a);return 0===m.cmp(c)}(s,a,l)}if("rsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");a=e.concat([f,a]);for(var c=l.modulus.byteLength(),d=[1],p=0;a.length+d.length+2<c;)d.push(255),p+=1;d.push(0);for(var m=-1;++m<a.length;)d.push(a[m]);d=e.from(d);var g=t.mont(l.modulus);s=(s=new t(s).toRed(g)).redPow(new t(l.publicExponent)),s=e.from(s.fromRed().toArray());var y=p<8?1:0;for(c=Math.min(s.length,d.length),s.length!==d.length&&(y=1),m=-1;++m<c;)y|=s[m]^d[m];return 0===y}}function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$5;hasRequiredBrowser$4=1;var e=requireSafeBuffer$3().Buffer,t=requireBrowser$a(),r=requireReadableBrowser(),i=requireInherits_browser(),n=requireSign(),o=requireVerify(),s=require$$6;function a(e){r.Writable.call(this);var i=s[e];if(!i)throw new Error("Unknown message digest");this._hashType=i.hash,this._hash=t(i.hash),this._tag=i.id,this._signType=i.sign}function u(e){r.Writable.call(this);var i=s[e];if(!i)throw new Error("Unknown message digest");this._hash=t(i.hash),this._tag=i.id,this._signType=i.sign}function h(e){return new a(e)}function f(e){return new u(e)}return Object.keys(s).forEach((function(t){s[t].id=e.from(s[t].id,"hex"),s[t.toLowerCase()]=s[t]})),i(a,r.Writable),a.prototype._write=function(e,t,r){this._hash.update(e),r()},a.prototype.update=function(t,r){return this._hash.update("string"==typeof t?e.from(t,r):t),this},a.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),i=n(r,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i},i(u,r.Writable),u.prototype._write=function(e,t,r){this._hash.update(e),r()},u.prototype.update=function(t,r){return this._hash.update("string"==typeof t?e.from(t,r):t),this},u.prototype.verify=function(t,r,i){var n="string"==typeof r?e.from(r,i):r;this.end();var s=this._hash.digest();return o(n,s,t,this._signType,this._tag)},browser$5={Sign:h,Verify:f,createSign:h,createVerify:f}}var bn$3={exports:{}},bn$2=bn$3.exports,hasRequiredBn$1,browser$4,hasRequiredBrowser$3;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$3,bn$2)),bn$3.exports}function requireBrowser$3(){if(hasRequiredBrowser$3)return browser$4;hasRequiredBrowser$3=1;var e=requireElliptic(),t=requireBn$1();browser$4=function(e){return new i(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function i(t){this.curveType=r[t],this.curveType||(this.curveType={name:t}),this.curve=new e.ec(this.curveType.name),this.keys=void 0}function n(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new Buffer(e);if(r&&i.length<r){var n=new Buffer(r-i.length);n.fill(0),i=Buffer.concat([n,i])}return t?i.toString(t):i}return r.p224=r.secp224r1,r.p256=r.secp256r1=r.prime256v1,r.p192=r.secp192r1=r.prime192v1,r.p384=r.secp384r1,r.p521=r.secp521r1,i.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},i.prototype.computeSecret=function(e,t,r){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),n(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},i.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),n(r,e)},i.prototype.getPrivateKey=function(e){return n(this.keys.getPrivate(),e)},i.prototype.setPublicKey=function(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this.keys._importPublic(e),this},i.prototype.setPrivateKey=function(e,r){r=r||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,r));var i=new t(e);return i=i.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(i),this},browser$4}var browser$3={},mgf,hasRequiredMgf,xor,hasRequiredXor;function requireMgf(){if(hasRequiredMgf)return mgf;hasRequiredMgf=1;var e=requireBrowser$a(),t=requireSafeBuffer$9().Buffer;function r(e){var r=t.allocUnsafe(4);return r.writeUInt32BE(e,0),r}return mgf=function(i,n){for(var o,s=t.alloc(0),a=0;s.length<n;)o=r(a++),s=t.concat([s,e("sha1").update(i).update(o).digest()]);return s.slice(0,n)}}function requireXor(){return hasRequiredXor?xor:(hasRequiredXor=1,xor=function(e,t){for(var r=e.length,i=-1;++i<r;)e[i]^=t[i];return e})}var bn$1={exports:{}},bn=bn$1.exports,hasRequiredBn,withPublic_1,hasRequiredWithPublic,publicEncrypt,hasRequiredPublicEncrypt,privateDecrypt,hasRequiredPrivateDecrypt,hasRequiredBrowser$2;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:requireDist().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return e.cmp(t)<0?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,i):(this._parseBase(e,t,n),"le"===i&&this._initArray(this.toArray(),t,i)))},n.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},n.prototype._initArray=function(e,t,i){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,a=0;if("be"===i)for(n=e.length-1,o=0;n>=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(n=0,o=0;n<e.length;n+=3)s=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=67108863&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,s=o%i,a=Math.min(o,o-s)+r,h=0,f=r;f<a;f+=i)h=u(e,f,f+i,t),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var l=1;for(h=u(e,f,e.length,t),f=0;f<s;f++)l*=t;this.imuln(l),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},n.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},n.prototype.clone=function(){var e=new n(null);return this.copy(e),e},n.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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 c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<i;h++){for(var f=u>>>26,l=67108863&u,c=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=c;d++){var p=h-d|0;f+=(s=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}n.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var n=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<n|o)).toString(16);o=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?h[6-u.length]+u+i:u+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=f[e],d=l[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(e);i=(p=p.idivn(d)).isZero()?m+i:h[c-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.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},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,h=new e(o),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-n;a++)h[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),h[o-a-1]=s}return h},Math.clz32?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},n.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return 0!==this.negative},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},n.prototype.ior=function(e){return r(!(this.negative|e.negative)),this.iuor(e)},n.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},n.prototype.iand=function(e){return r(!(this.negative|e.negative)),this.iuand(e)},n.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},n.prototype.ixor=function(e){return r(!(this.negative|e.negative)),this.iuxor(e)},n.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return i>0&&(this.words[n]=~this.words[n]&67108863>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<n:this.words[i]&~(1<<n),this.strip()},n.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},n.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},n.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 r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,s=0;s<i.length;s++)o=(t=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,s=e.words,a=t.words,u=r.words,h=0,f=0|s[0],l=8191&f,c=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,M=0|s[4],S=8191&M,E=M>>>13,R=0|s[5],A=8191&R,q=R>>>13,C=0|s[6],P=8191&C,B=C>>>13,I=0|s[7],O=8191&I,k=I>>>13,T=0|s[8],N=8191&T,x=T>>>13,j=0|s[9],$=8191&j,D=j>>>13,U=0|a[0],L=8191&U,F=U>>>13,z=0|a[1],K=8191&z,W=z>>>13,H=0|a[2],G=8191&H,J=H>>>13,V=0|a[3],Q=8191&V,Z=V>>>13,Y=0|a[4],X=8191&Y,ee=Y>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],oe=8191&ne,se=ne>>>13,ae=0|a[7],ue=8191&ae,he=ae>>>13,fe=0|a[8],le=8191&fe,ce=fe>>>13,de=0|a[9],pe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(h+(i=Math.imul(l,L))|0)+((8191&(n=(n=Math.imul(l,F))+Math.imul(c,L)|0))<<13)|0;h=((o=Math.imul(c,F))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(p,L),n=(n=Math.imul(p,F))+Math.imul(m,L)|0,o=Math.imul(m,F);var ye=(h+(i=i+Math.imul(l,K)|0)|0)+((8191&(n=(n=n+Math.imul(l,W)|0)+Math.imul(c,K)|0))<<13)|0;h=((o=o+Math.imul(c,W)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,L),n=(n=Math.imul(y,F))+Math.imul(b,L)|0,o=Math.imul(b,F),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,W)|0;var be=(h+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,J)|0)+Math.imul(c,G)|0))<<13)|0;h=((o=o+Math.imul(c,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(w,L),n=(n=Math.imul(w,F))+Math.imul(_,L)|0,o=Math.imul(_,F),i=i+Math.imul(y,K)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,J)|0;var ve=(h+(i=i+Math.imul(l,Q)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,L),n=(n=Math.imul(S,F))+Math.imul(E,L)|0,o=Math.imul(E,F),i=i+Math.imul(w,K)|0,n=(n=n+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,J)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,Z)|0;var we=(h+(i=i+Math.imul(l,X)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(c,X)|0))<<13)|0;h=((o=o+Math.imul(c,ee)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,L),n=(n=Math.imul(A,F))+Math.imul(q,L)|0,o=Math.imul(q,F),i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,W)|0,i=i+Math.imul(w,G)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,Z)|0,i=i+Math.imul(p,X)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,ee)|0;var _e=(h+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(c,re)|0))<<13)|0;h=((o=o+Math.imul(c,ie)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(P,L),n=(n=Math.imul(P,F))+Math.imul(B,L)|0,o=Math.imul(B,F),i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(q,K)|0,o=o+Math.imul(q,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,J)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,Z)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,Z)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ie)|0;var Me=(h+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,se)|0)+Math.imul(c,oe)|0))<<13)|0;h=((o=o+Math.imul(c,se)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(O,L),n=(n=Math.imul(O,F))+Math.imul(k,L)|0,o=Math.imul(k,F),i=i+Math.imul(P,K)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(q,G)|0,o=o+Math.imul(q,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(w,X)|0,n=(n=n+Math.imul(w,ee)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(h+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(c,ue)|0))<<13)|0;h=((o=o+Math.imul(c,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(N,L),n=(n=Math.imul(N,F))+Math.imul(x,L)|0,o=Math.imul(x,F),i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,W)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(q,Q)|0,o=o+Math.imul(q,Z)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,ee)|0,i=i+Math.imul(w,re)|0,n=(n=n+Math.imul(w,ie)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,he)|0;var Ee=(h+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(c,le)|0))<<13)|0;h=((o=o+Math.imul(c,ce)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul($,L),n=(n=Math.imul($,F))+Math.imul(D,L)|0,o=Math.imul(D,F),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,W)|0,i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,Z)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,Z)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(q,X)|0,o=o+Math.imul(q,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ie)|0,i=i+Math.imul(w,oe)|0,n=(n=n+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,he)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,he)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(m,le)|0,o=o+Math.imul(m,ce)|0;var Re=(h+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,me)|0)+Math.imul(c,pe)|0))<<13)|0;h=((o=o+Math.imul(c,me)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul($,K),n=(n=Math.imul($,W))+Math.imul(D,K)|0,o=Math.imul(D,W),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,Z)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(P,X)|0,n=(n=n+Math.imul(P,ee)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(q,re)|0,o=o+Math.imul(q,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,i=i+Math.imul(w,ue)|0,n=(n=n+Math.imul(w,he)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,he)|0,i=i+Math.imul(y,le)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,ce)|0;var Ae=(h+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul($,G),n=(n=Math.imul($,J))+Math.imul(D,G)|0,o=Math.imul(D,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,Z)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,Z)|0,i=i+Math.imul(O,X)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(P,re)|0,n=(n=n+Math.imul(P,ie)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,se)|0)+Math.imul(q,oe)|0,o=o+Math.imul(q,se)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,he)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,he)|0,i=i+Math.imul(w,le)|0,n=(n=n+Math.imul(w,ce)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,ce)|0;var qe=(h+(i=i+Math.imul(y,pe)|0)|0)+((8191&(n=(n=n+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;h=((o=o+Math.imul(b,me)|0)+(n>>>13)|0)+(qe>>>26)|0,qe&=67108863,i=Math.imul($,Q),n=(n=Math.imul($,Z))+Math.imul(D,Q)|0,o=Math.imul(D,Z),i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(P,oe)|0,n=(n=n+Math.imul(P,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(q,ue)|0,o=o+Math.imul(q,he)|0,i=i+Math.imul(S,le)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,ce)|0;var Ce=(h+(i=i+Math.imul(w,pe)|0)|0)+((8191&(n=(n=n+Math.imul(w,me)|0)+Math.imul(_,pe)|0))<<13)|0;h=((o=o+Math.imul(_,me)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul($,X),n=(n=Math.imul($,ee))+Math.imul(D,X)|0,o=Math.imul(D,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ie)|0,i=i+Math.imul(O,oe)|0,n=(n=n+Math.imul(O,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,i=i+Math.imul(P,ue)|0,n=(n=n+Math.imul(P,he)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,he)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(q,le)|0,o=o+Math.imul(q,ce)|0;var Pe=(h+(i=i+Math.imul(S,pe)|0)|0)+((8191&(n=(n=n+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;h=((o=o+Math.imul(E,me)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul($,re),n=(n=Math.imul($,ie))+Math.imul(D,re)|0,o=Math.imul(D,ie),i=i+Math.imul(N,oe)|0,n=(n=n+Math.imul(N,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,i=i+Math.imul(O,ue)|0,n=(n=n+Math.imul(O,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0,i=i+Math.imul(P,le)|0,n=(n=n+Math.imul(P,ce)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,ce)|0;var Be=(h+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,me)|0)+Math.imul(q,pe)|0))<<13)|0;h=((o=o+Math.imul(q,me)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul($,oe),n=(n=Math.imul($,se))+Math.imul(D,oe)|0,o=Math.imul(D,se),i=i+Math.imul(N,ue)|0,n=(n=n+Math.imul(N,he)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,he)|0,i=i+Math.imul(O,le)|0,n=(n=n+Math.imul(O,ce)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,ce)|0;var Ie=(h+(i=i+Math.imul(P,pe)|0)|0)+((8191&(n=(n=n+Math.imul(P,me)|0)+Math.imul(B,pe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul($,ue),n=(n=Math.imul($,he))+Math.imul(D,ue)|0,o=Math.imul(D,he),i=i+Math.imul(N,le)|0,n=(n=n+Math.imul(N,ce)|0)+Math.imul(x,le)|0,o=o+Math.imul(x,ce)|0;var Oe=(h+(i=i+Math.imul(O,pe)|0)|0)+((8191&(n=(n=n+Math.imul(O,me)|0)+Math.imul(k,pe)|0))<<13)|0;h=((o=o+Math.imul(k,me)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul($,le),n=(n=Math.imul($,ce))+Math.imul(D,le)|0,o=Math.imul(D,ce);var ke=(h+(i=i+Math.imul(N,pe)|0)|0)+((8191&(n=(n=n+Math.imul(N,me)|0)+Math.imul(x,pe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863;var Te=(h+(i=Math.imul($,pe))|0)+((8191&(n=(n=Math.imul($,me))+Math.imul(D,pe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,u[0]=ge,u[1]=ye,u[2]=be,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Me,u[7]=Se,u[8]=Ee,u[9]=Re,u[10]=Ae,u[11]=qe,u[12]=Ce,u[13]=Pe,u[14]=Be,u[15]=Ie,u[16]=Oe,u[17]=ke,u[18]=Te,0!==h&&(u[19]=h,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=c),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?c(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var a=67108863&i,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var f=o-h,l=(0|e.words[f])*(0|t.words[h]),c=67108863&l;a=67108863&(c=c+a|0),n+=(s=(s=s+(l/67108864|0)|0)+(c>>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=n.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var s=0;s<o;s++)i[s]=t[e[s]],n[s]=r[e[s]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),f=0;f<n;f+=a)for(var l=u,c=h,d=0;d<s;d++){var p=r[f+d],m=i[f+d],g=r[f+d+s],y=i[f+d+s],b=l*g-c*y;y=l*y+c*g,g=b,r[f+d]=p+g,i[f+d]=m+y,r[f+d+s]=p-g,i[f+d+s]=m-y,d!==a&&(b=u*l-h*c,c=u*c+h*l,l=b)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,i,n){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<n;++s)i[s]=0;r(0===o),r(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),a=new Array(i),u=new Array(i),h=new Array(i),f=new Array(i),l=new Array(i),c=r.words;c.length=i,this.convert13b(e.words,e.length,s,i),this.convert13b(t.words,t.length,h,i),this.transform(s,o,a,u,i,n),this.transform(h,o,f,l,i,n);for(var d=0;d<i;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,i),this.transform(a,u,c,o,i,n),this.conjugate(c,o,i),this.normalize13b(c,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},n.prototype.mul=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},n.prototype.mulf=function(e){var t=new n(null);return t.words=new Array(this.length+e.length),p(this,e,t)},n.prototype.imul=function(e){return this.clone().mulTo(e,this)},n.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,i=0;i<this.length;i++){var n=(0|this.words[i])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var o=r.sqr();i<t.length;i++,o=o.sqr())0!==t[i]&&(r=r.mul(o));return r},n.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,i=e%26,n=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<i;this.words[t]=u|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},n.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},n.prototype.iushrn=function(e,t,i){var n;r("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=i;if(n-=s,n=Math.max(0,n),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var f=0;for(h=this.length-1;h>=0&&(0!==f||h>=n);h--){var l=0|this.words[h];this.words[h]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,n=1<<t;return!(this.length<=i||!(this.words[i]&n))},n.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},n.prototype.maskn=function(e){return this.clone().imaskn(e)},n.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},n.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},n.prototype.addn=function(e){return this.clone().iaddn(e)},n.prototype.subn=function(e){return this.clone().isubn(e)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(e,t,i){var n,o,s=e.length+i;this._expand(s);var a=0;for(n=0;n<e.length;n++){o=(0|this.words[n+i])+a;var u=(0|e.words[n])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+i]=67108863&o}for(;n<this.length-i;n++)a=(o=(0|this.words[n+i])+a)>>26,this.words[n+i]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,n=0;n<this.length;n++)a=(o=-(0|this.words[n])+a)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var a,u=i.length-o.length;if("mod"!==t){(a=new n(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var f=i.clone()._ishlnsubmul(o,1,u);0===f.negative&&(i=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var c=67108864*(0|i.words[o.length+l])+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);a&&(a.words[l]=c)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},n.prototype.divmod=function(e,t,i){return r(!e.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):this.negative&e.negative?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+67108864*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new n(1),s=new n(0),a=new n(0),u=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var f=i.clone(),l=t.clone();!t.isZero();){for(var c=0,d=1;!(t.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(f),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(f),u.isub(l)),a.iushrn(1),u.iushrn(1);t.cmp(i)>=0?(t.isub(i),o.isub(a),s.isub(u)):(i.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new n(1),a=new n(0),u=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var h=0,f=1;!(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,c=1;!(i.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(i.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return!(1&this.words[0])},n.prototype.isOdd=function(){return!(1&~this.words[0])},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=n,this;for(var o=n,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},n.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},n.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return-1===this.cmpn(e)},n.prototype.lt=function(e){return-1===this.cmp(e)},n.prototype.lten=function(e){return this.cmpn(e)<=0},n.prototype.lte=function(e){return this.cmp(e)<=0},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new M(e)},n.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)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(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 v(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=n._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 S(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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 n(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var s=0|e.words[n];e.words[n-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[n-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,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(v,y),i(w,y),i(_,y),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new v;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},M.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){r(!(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new n(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new n(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),c=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(l,new n(1).iushln(p-g-1));c=c.redMul(y),l=y.redSqr(),d=d.redMul(l),p=g}return c},M.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},M.prototype.pow=function(e,t){if(t.isZero())return new n(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new n(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var h=t.words[i],f=u-1;f>=0;f--){var l=h>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===i&&0===f)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new S(e)},i(S,M),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(bn$1,bn)),bn$1.exports}function requireWithPublic(){if(hasRequiredWithPublic)return withPublic_1;hasRequiredWithPublic=1;var e=requireBn(),t=requireSafeBuffer$9().Buffer;return withPublic_1=function(r,i){return t.from(r.toRed(e.mont(i.modulus)).redPow(new e(i.publicExponent)).fromRed().toArray())}}function requirePublicEncrypt(){if(hasRequiredPublicEncrypt)return publicEncrypt;hasRequiredPublicEncrypt=1;var e=requireParseAsn1(),t=requireBrowser$b(),r=requireBrowser$a(),i=requireMgf(),n=requireXor(),o=requireBn(),s=requireWithPublic(),a=requireBrowserifyRsa(),u=requireSafeBuffer$9().Buffer;return publicEncrypt=function(h,f,l){var c;c=h.padding?h.padding:l?1:4;var d,p=e(h);if(4===c)d=function(e,s){var a=e.modulus.byteLength(),h=s.length,f=r("sha1").update(u.alloc(0)).digest(),l=f.length,c=2*l;if(h>a-c-2)throw new Error("message too long");var d=u.alloc(a-h-c-2),p=a-l-1,m=t(l),g=n(u.concat([f,d,u.alloc(1,1),s],p),i(m,p)),y=n(m,i(g,l));return new o(u.concat([u.alloc(1),y,g],a))}(p,f);else if(1===c)d=function(e,r,i){var n,s=r.length,a=e.modulus.byteLength();if(s>a-11)throw new Error("message too long");n=i?u.alloc(a-s-3,255):function(e){var r,i=u.allocUnsafe(e),n=0,o=t(2*e),s=0;for(;n<e;)s===o.length&&(o=t(2*e),s=0),(r=o[s++])&&(i[n++]=r);return i}(a-s-3);return new o(u.concat([u.from([0,i?1:2]),n,u.alloc(1),r],a))}(p,f,l);else{if(3!==c)throw new Error("unknown padding");if((d=new o(f)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return l?a(d,p):s(d,p)}}function requirePrivateDecrypt(){if(hasRequiredPrivateDecrypt)return privateDecrypt;hasRequiredPrivateDecrypt=1;var e=requireParseAsn1(),t=requireMgf(),r=requireXor(),i=requireBn(),n=requireBrowserifyRsa(),o=requireBrowser$a(),s=requireWithPublic(),a=requireSafeBuffer$9().Buffer;return privateDecrypt=function(u,h,f){var l;l=u.padding?u.padding:f?1:4;var c,d=e(u),p=d.modulus.byteLength();if(h.length>p||new i(h).cmp(d.modulus)>=0)throw new Error("decryption error");c=f?s(new i(h),d):n(h,d);var m=a.alloc(p-c.length);if(c=a.concat([m,c],p),4===l)return function(e,i){var n=e.modulus.byteLength(),s=o("sha1").update(a.alloc(0)).digest(),u=s.length;if(0!==i[0])throw new Error("decryption error");var h=i.slice(1,u+1),f=i.slice(u+1),l=r(h,t(f,u)),c=r(f,t(l,n-u-1));if(function(e,t){e=a.from(e),t=a.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n<i;)r+=e[n]^t[n];return r}(s,c.slice(0,u)))throw new Error("decryption error");var d=u;for(;0===c[d];)d++;if(1!==c[d++])throw new Error("decryption error");return c.slice(d)}(d,c);if(1===l)return function(e,t,r){var i=t.slice(0,2),n=2,o=0;for(;0!==t[n++];)if(n>=t.length){o++;break}var s=t.slice(2,n-1);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(n)}(0,c,f);if(3===l)return c;throw new Error("unknown padding")}}function requireBrowser$2(){return hasRequiredBrowser$2||(hasRequiredBrowser$2=1,(e=browser$3).publicEncrypt=requirePublicEncrypt(),e.privateDecrypt=requirePrivateDecrypt(),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}),browser$3;var e}var browser$2={},hasRequiredBrowser$1,hasRequiredCryptoBrowserify;function requireBrowser$1(){if(hasRequiredBrowser$1)return browser$2;function e(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}hasRequiredBrowser$1=1;var t=requireSafeBuffer$9(),r=requireBrowser$b(),i=t.Buffer,n=t.kMaxLength,o=commonjsGlobal.crypto||commonjsGlobal.msCrypto,s=Math.pow(2,32)-1;function a(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>s||e<0)throw new TypeError("offset must be a uint32");if(e>n||e>t)throw new RangeError("offset out of range")}function u(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>s||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>n)throw new RangeError("buffer too small")}function h(e,t,i,n){if(process$1.browser){var s=e.buffer,a=new Uint8Array(s,t,i);return o.getRandomValues(a),n?void process$1.nextTick((function(){n(null,e)})):e}if(!n)return r(i).copy(e,t),e;r(i,(function(r,i){if(r)return n(r);i.copy(e,t),n(null,e)}))}return o&&o.getRandomValues||!process$1.browser?(browser$2.randomFill=function(e,t,r,n){if(!(i.isBuffer(e)||e instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)n=t,t=0,r=e.length;else if("function"==typeof r)n=r,r=e.length-t;else if("function"!=typeof n)throw new TypeError('"cb" argument must be a function');return a(t,e.length),u(r,t,e.length),h(e,t,r,n)},browser$2.randomFillSync=function(e,t,r){void 0===t&&(t=0);if(!(i.isBuffer(e)||e instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');a(t,e.length),void 0===r&&(r=e.length-t);return u(r,t,e.length),h(e,t,r)}):(browser$2.randomFill=e,browser$2.randomFillSync=e),browser$2}function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=requireBrowser$b(),cryptoBrowserify.createHash=cryptoBrowserify.Hash=requireBrowser$a(),cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=requireBrowser$9();var e=requireAlgos(),t=Object.keys(e),r=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(t);cryptoBrowserify.getHashes=function(){return r};var i=requireBrowser$8();cryptoBrowserify.pbkdf2=i.pbkdf2,cryptoBrowserify.pbkdf2Sync=i.pbkdf2Sync;var n=requireBrowser$6();cryptoBrowserify.Cipher=n.Cipher,cryptoBrowserify.createCipher=n.createCipher,cryptoBrowserify.Cipheriv=n.Cipheriv,cryptoBrowserify.createCipheriv=n.createCipheriv,cryptoBrowserify.Decipher=n.Decipher,cryptoBrowserify.createDecipher=n.createDecipher,cryptoBrowserify.Decipheriv=n.Decipheriv,cryptoBrowserify.createDecipheriv=n.createDecipheriv,cryptoBrowserify.getCiphers=n.getCiphers,cryptoBrowserify.listCiphers=n.listCiphers;var o=requireBrowser$5();cryptoBrowserify.DiffieHellmanGroup=o.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=o.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=o.getDiffieHellman,cryptoBrowserify.createDiffieHellman=o.createDiffieHellman,cryptoBrowserify.DiffieHellman=o.DiffieHellman;var s=requireBrowser$4();cryptoBrowserify.createSign=s.createSign,cryptoBrowserify.Sign=s.Sign,cryptoBrowserify.createVerify=s.createVerify,cryptoBrowserify.Verify=s.Verify,cryptoBrowserify.createECDH=requireBrowser$3();var a=requireBrowser$2();cryptoBrowserify.publicEncrypt=a.publicEncrypt,cryptoBrowserify.privateEncrypt=a.privateEncrypt,cryptoBrowserify.publicDecrypt=a.publicDecrypt,cryptoBrowserify.privateDecrypt=a.privateDecrypt;var u=requireBrowser$1();return cryptoBrowserify.randomFill=u.randomFill,cryptoBrowserify.randomFillSync=u.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/browserify/crypto-browserify")},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var core=core$1.exports,hasRequiredCore;function requireCore(){return hasRequiredCore||(hasRequiredCore=1,core$1.exports=(e=e||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==commonjsGlobal&&commonjsGlobal.crypto&&(r=commonjsGlobal.crypto),!r&&"function"==typeof commonjsRequire)try{r=requireCryptoBrowserify()}catch(e){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),o={},s=o.lib={},a=s.Base=function(){return{extend:function(e){var t=n(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)}}}(),u=s.WordArray=a.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,i=this.sigBytes,n=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o<n;o++){var s=r[o>>>2]>>>24-o%4*8&255;t[i+o>>>2]|=s<<24-(i+o)%4*8}else for(var a=0;a<n;a+=4)t[i+a>>>2]=r[a>>>2];return this.sigBytes+=n,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(i());return new u.init(t,e)}}),h=o.enc={},f=h.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n<r;n++){var o=t[n>>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i+=2)r[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new u.init(r,t/2)}},l=h.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n<r;n++){var o=t[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new u.init(r,t)}},c=h.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},d=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,i=this._data,n=i.words,o=i.sigBytes,s=this.blockSize,a=o/(4*s),h=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,f=e.min(4*h,o);if(h){for(var l=0;l<h;l+=s)this._doProcessBlock(n,l);r=n.splice(0,h),i.sigBytes-=f}return new u.init(r,f)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new p.HMAC.init(e,r).finalize(t)}}});var p=o.algo={};return o}(Math),e)),core$1.exports;var e}var encBase64$1={exports:{}},encBase64=encBase64$1.exports,hasRequiredEncBase64;function requireEncBase64(){return hasRequiredEncBase64||(hasRequiredEncBase64=1,encBase64$1.exports=(e=requireCore(),function(){var t=e,r=t.lib.WordArray;function i(e,t,i){for(var n=[],o=0,s=0;s<t;s++)if(s%4){var a=i[e.charCodeAt(s-1)]<<s%4*2|i[e.charCodeAt(s)]>>>6-s%4*2;n[o>>>2]|=a<<24-o%4*8,o++}return r.create(n,o)}t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,i=this._map;e.clamp();for(var n=[],o=0;o<r;o+=3)for(var s=(t[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,a=0;a<4&&o+.75*a<r;a++)n.push(i.charAt(s>>>6*(3-a)&63));var u=i.charAt(64);if(u)for(;n.length%4;)n.push(u);return n.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o<r.length;o++)n[r.charCodeAt(o)]=o}var s=r.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return i(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64)),encBase64$1.exports;var e}var md5$1={exports:{}},md5=md5$1.exports,hasRequiredMd5;function requireMd5(){return hasRequiredMd5||(hasRequiredMd5=1,md5$1.exports=(e=requireCore(),function(t){var r=e,i=r.lib,n=i.WordArray,o=i.Hasher,s=r.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=s.MD5=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var i=t+r,n=e[i];e[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,s=e[t+0],u=e[t+1],d=e[t+2],p=e[t+3],m=e[t+4],g=e[t+5],y=e[t+6],b=e[t+7],v=e[t+8],w=e[t+9],_=e[t+10],M=e[t+11],S=e[t+12],E=e[t+13],R=e[t+14],A=e[t+15],q=o[0],C=o[1],P=o[2],B=o[3];q=h(q,C,P,B,s,7,a[0]),B=h(B,q,C,P,u,12,a[1]),P=h(P,B,q,C,d,17,a[2]),C=h(C,P,B,q,p,22,a[3]),q=h(q,C,P,B,m,7,a[4]),B=h(B,q,C,P,g,12,a[5]),P=h(P,B,q,C,y,17,a[6]),C=h(C,P,B,q,b,22,a[7]),q=h(q,C,P,B,v,7,a[8]),B=h(B,q,C,P,w,12,a[9]),P=h(P,B,q,C,_,17,a[10]),C=h(C,P,B,q,M,22,a[11]),q=h(q,C,P,B,S,7,a[12]),B=h(B,q,C,P,E,12,a[13]),P=h(P,B,q,C,R,17,a[14]),q=f(q,C=h(C,P,B,q,A,22,a[15]),P,B,u,5,a[16]),B=f(B,q,C,P,y,9,a[17]),P=f(P,B,q,C,M,14,a[18]),C=f(C,P,B,q,s,20,a[19]),q=f(q,C,P,B,g,5,a[20]),B=f(B,q,C,P,_,9,a[21]),P=f(P,B,q,C,A,14,a[22]),C=f(C,P,B,q,m,20,a[23]),q=f(q,C,P,B,w,5,a[24]),B=f(B,q,C,P,R,9,a[25]),P=f(P,B,q,C,p,14,a[26]),C=f(C,P,B,q,v,20,a[27]),q=f(q,C,P,B,E,5,a[28]),B=f(B,q,C,P,d,9,a[29]),P=f(P,B,q,C,b,14,a[30]),q=l(q,C=f(C,P,B,q,S,20,a[31]),P,B,g,4,a[32]),B=l(B,q,C,P,v,11,a[33]),P=l(P,B,q,C,M,16,a[34]),C=l(C,P,B,q,R,23,a[35]),q=l(q,C,P,B,u,4,a[36]),B=l(B,q,C,P,m,11,a[37]),P=l(P,B,q,C,b,16,a[38]),C=l(C,P,B,q,_,23,a[39]),q=l(q,C,P,B,E,4,a[40]),B=l(B,q,C,P,s,11,a[41]),P=l(P,B,q,C,p,16,a[42]),C=l(C,P,B,q,y,23,a[43]),q=l(q,C,P,B,w,4,a[44]),B=l(B,q,C,P,S,11,a[45]),P=l(P,B,q,C,A,16,a[46]),q=c(q,C=l(C,P,B,q,d,23,a[47]),P,B,s,6,a[48]),B=c(B,q,C,P,b,10,a[49]),P=c(P,B,q,C,R,15,a[50]),C=c(C,P,B,q,g,21,a[51]),q=c(q,C,P,B,S,6,a[52]),B=c(B,q,C,P,p,10,a[53]),P=c(P,B,q,C,_,15,a[54]),C=c(C,P,B,q,u,21,a[55]),q=c(q,C,P,B,v,6,a[56]),B=c(B,q,C,P,A,10,a[57]),P=c(P,B,q,C,y,15,a[58]),C=c(C,P,B,q,E,21,a[59]),q=c(q,C,P,B,m,6,a[60]),B=c(B,q,C,P,M,10,a[61]),P=c(P,B,q,C,d,15,a[62]),C=c(C,P,B,q,w,21,a[63]),o[0]=o[0]+q|0,o[1]=o[1]+C|0,o[2]=o[2]+P|0,o[3]=o[3]+B|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296),s=i;r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,u=a.words,h=0;h<4;h++){var f=u[h];u[h]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function h(e,t,r,i,n,o,s){var a=e+(t&r|~t&i)+n+s;return(a<<o|a>>>32-o)+t}function f(e,t,r,i,n,o,s){var a=e+(t&i|r&~i)+n+s;return(a<<o|a>>>32-o)+t}function l(e,t,r,i,n,o,s){var a=e+(t^r^i)+n+s;return(a<<o|a>>>32-o)+t}function c(e,t,r,i,n,o,s){var a=e+(r^(t|~i))+n+s;return(a<<o|a>>>32-o)+t}r.MD5=o._createHelper(u),r.HmacMD5=o._createHmacHelper(u)}(Math),e.MD5)),md5$1.exports;var e}var evpkdf$1={exports:{}},sha1$1={exports:{}},sha1=sha1$1.exports,hasRequiredSha1;function requireSha1(){return hasRequiredSha1||(hasRequiredSha1=1,sha1$1.exports=(a=requireCore(),t=(e=a).lib,r=t.WordArray,i=t.Hasher,n=e.algo,o=[],s=n.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],s=r[2],a=r[3],u=r[4],h=0;h<80;h++){if(h<16)o[h]=0|e[t+h];else{var f=o[h-3]^o[h-8]^o[h-14]^o[h-16];o[h]=f<<1|f>>>31}var l=(i<<5|i>>>27)+u+o[h];l+=h<20?1518500249+(n&s|~n&a):h<40?1859775393+(n^s^a):h<60?(n&s|n&a|s&a)-1894007588:(n^s^a)-899497514,u=a,a=s,s=n<<30|n>>>2,n=i,i=l}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),e.SHA1=i._createHelper(s),e.HmacSHA1=i._createHmacHelper(s),a.SHA1)),sha1$1.exports;var e,t,r,i,n,o,s,a}var hmac$1={exports:{}},hmac=hmac$1.exports,hasRequiredHmac;function requireHmac(){return hasRequiredHmac||(hasRequiredHmac=1,hmac$1.exports=(e=requireCore(),r=(t=e).lib.Base,i=t.enc.Utf8,void(t.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,u=s.words,h=0;h<r;h++)a[h]^=1549556828,u[h]^=909522486;o.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))),hmac$1.exports;var e,t,r,i}var evpkdf=evpkdf$1.exports,hasRequiredEvpkdf;function requireEvpkdf(){return hasRequiredEvpkdf||(hasRequiredEvpkdf=1,evpkdf$1.exports=(a=requireCore(),requireSha1(),requireHmac(),t=(e=a).lib,r=t.Base,i=t.WordArray,n=e.algo,o=n.MD5,s=n.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,o=n.hasher.create(),s=i.create(),a=s.words,u=n.keySize,h=n.iterations;a.length<u;){r&&o.update(r),r=o.update(e).finalize(t),o.reset();for(var f=1;f<h;f++)r=o.finalize(r),o.reset();s.concat(r)}return s.sigBytes=4*u,s}}),e.EvpKDF=function(e,t,r){return s.create(r).compute(e,t)},a.EvpKDF)),evpkdf$1.exports;var e,t,r,i,n,o,s,a}var cipherCore$1={exports:{}},cipherCore=cipherCore$1.exports,hasRequiredCipherCore;function requireCipherCore(){return hasRequiredCipherCore||(hasRequiredCipherCore=1,cipherCore$1.exports=(e=requireCore(),requireEvpkdf(),void(e.lib.Cipher||function(t){var r=e,i=r.lib,n=i.Base,o=i.WordArray,s=i.BufferedBlockAlgorithm,a=r.enc;a.Utf8;var u=a.Base64,h=r.algo.EvpKDF,f=i.Cipher=s.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?v:y}return function(t){return{encrypt:function(r,i,n){return e(i).encrypt(t,r,i,n)},decrypt:function(r,i,n){return e(i).decrypt(t,r,i,n)}}}}()});i.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=r.mode={},c=i.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=l.CBC=function(){var e=c.extend();function r(e,r,i){var n,o=this._iv;o?(n=o,this._iv=t):n=this._prevBlock;for(var s=0;s<i;s++)e[r+s]^=n[s]}return e.Encryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;r.call(this,e,t,n),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),e.Decryptor=e.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,o=e.slice(t,t+n);i.decryptBlock(e,t),r.call(this,e,t,n),this._prevBlock=o}}),e}(),p=(r.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,i=r-e.sigBytes%r,n=i<<24|i<<16|i<<8|i,s=[],a=0;a<i;a+=4)s.push(n);var u=o.create(s,i);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};i.BlockCipher=f.extend({cfg:f.cfg.extend({mode:d,padding:p}),reset:function(){var e;f.reset.call(this);var t=this.cfg,r=t.iv,i=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(i,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var m=i.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(r.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(u)},parse:function(e){var t,r=u.parse(e),i=r.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=o.create(i.slice(2,4)),i.splice(0,4),r.sigBytes-=16),m.create({ciphertext:r,salt:t})}},y=i.SerializableCipher=n.extend({cfg:n.extend({format:g}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),o=n.finalize(t),s=n.cfg;return m.create({ciphertext:o,key:r,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(r,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),b=(r.kdf={}).OpenSSL={execute:function(e,t,r,i,n){if(i||(i=o.random(8)),n)s=h.create({keySize:t+r,hasher:n}).compute(e,i);else var s=h.create({keySize:t+r}).compute(e,i);var a=o.create(s.words.slice(t),4*r);return s.sigBytes=4*t,m.create({key:s,iv:a,salt:i})}},v=i.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:b}),encrypt:function(e,t,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,e.keySize,e.ivSize,i.salt,i.hasher);i.iv=n.iv;var o=y.encrypt.call(this,e,t,n.key,i);return o.mixIn(n),o},decrypt:function(e,t,r,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var n=i.kdf.execute(r,e.keySize,e.ivSize,t.salt,i.hasher);return i.iv=n.iv,y.decrypt.call(this,e,t,n.key,i)}})}()))),cipherCore$1.exports;var e}var aes$1=aes$3.exports,hasRequiredAes;function requireAes(){return hasRequiredAes||(hasRequiredAes=1,aes$3.exports=(e=requireCore(),requireEncBase64(),requireMd5(),requireEvpkdf(),requireCipherCore(),function(){var t=e,r=t.lib.BlockCipher,i=t.algo,n=[],o=[],s=[],a=[],u=[],h=[],f=[],l=[],c=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,i=0;for(t=0;t<256;t++){var p=i^i<<1^i<<2^i<<3^i<<4;p=p>>>8^255&p^99,n[r]=p,o[p]=r;var m=e[r],g=e[m],y=e[g],b=257*e[p]^16843008*p;s[r]=b<<24|b>>>8,a[r]=b<<16|b>>>16,u[r]=b<<8|b>>>24,h[r]=b,b=16843009*y^65537*g^257*m^16843008*r,f[p]=b<<24|b>>>8,l[p]=b<<16|b>>>16,c[p]=b<<8|b>>>24,d[p]=b,r?(r=m^e[e[e[y^m]]],i^=e[e[i]]):r=i=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=i.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,i=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s<i;s++)s<r?o[s]=t[s]:(h=o[s-1],s%r?r>6&&s%r==4&&(h=n[h>>>24]<<24|n[h>>>16&255]<<16|n[h>>>8&255]<<8|n[255&h]):(h=n[(h=h<<8|h>>>24)>>>24]<<24|n[h>>>16&255]<<16|n[h>>>8&255]<<8|n[255&h],h^=p[s/r|0]<<24),o[s]=o[s-r]^h);for(var a=this._invKeySchedule=[],u=0;u<i;u++){if(s=i-u,u%4)var h=o[s];else h=o[s-4];a[u]=u<4||s<=4?h:f[n[h>>>24]]^l[n[h>>>16&255]]^c[n[h>>>8&255]]^d[n[255&h]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,u,h,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,l,c,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,o,s,a){for(var u=this._nRounds,h=e[t]^r[0],f=e[t+1]^r[1],l=e[t+2]^r[2],c=e[t+3]^r[3],d=4,p=1;p<u;p++){var m=i[h>>>24]^n[f>>>16&255]^o[l>>>8&255]^s[255&c]^r[d++],g=i[f>>>24]^n[l>>>16&255]^o[c>>>8&255]^s[255&h]^r[d++],y=i[l>>>24]^n[c>>>16&255]^o[h>>>8&255]^s[255&f]^r[d++],b=i[c>>>24]^n[h>>>16&255]^o[f>>>8&255]^s[255&l]^r[d++];h=m,f=g,l=y,c=b}m=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[l>>>8&255]<<8|a[255&c])^r[d++],g=(a[f>>>24]<<24|a[l>>>16&255]<<16|a[c>>>8&255]<<8|a[255&h])^r[d++],y=(a[l>>>24]<<24|a[c>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^r[d++],b=(a[c>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&l])^r[d++],e[t]=m,e[t+1]=g,e[t+2]=y,e[t+3]=b},keySize:8});t.AES=r._createHelper(m)}(),e.AES)),aes$3.exports;var e}var aesExports=requireAes();const aes=getDefaultExportFromCjs(aesExports),__CJS__import__1__$2=_mergeNamespaces({__proto__:null,default:aes},[aesExports]);var encUtf8$2={exports:{}},encUtf8$1=encUtf8$2.exports,hasRequiredEncUtf8;function requireEncUtf8(){return hasRequiredEncUtf8||(hasRequiredEncUtf8=1,encUtf8$2.exports=requireCore().enc.Utf8),encUtf8$2.exports}var encUtf8Exports=requireEncUtf8();const encUtf8=getDefaultExportFromCjs(encUtf8Exports),__CJS__import__2__=_mergeNamespaces({__proto__:null,default:encUtf8},[encUtf8Exports]);let AES,ENC;AES=aes||__CJS__import__1__$2,ENC=encUtf8||__CJS__import__2__;const CryptoController={encrypt:(e,t)=>AES.encrypt(JSON.stringify(e),t).toString(),decrypt:(e,t)=>AES.decrypt(e,t).toString(ENC)};function canBeSerialized(e){if(!(e instanceof CoreManager.getParseObject()))return!0;const t=e.attributes;for(const e in t){if(!canBeSerializedHelper(t[e]))return!1}return!0}function canBeSerializedHelper(e){if("object"!=typeof e)return!0;if(e instanceof ParseRelation)return!0;if(e instanceof CoreManager.getParseObject())return!!e.id;if(e instanceof ParseFile)return!!e.url();if(Array.isArray(e)){for(let t=0;t<e.length;t++)if(!canBeSerializedHelper(e[t]))return!1;return!0}for(const t in e)if(!canBeSerializedHelper(e[t]))return!1;return!0}const encoded={"&":"&","<":"<",">":">","/":"/","'":"'",'"':"""};function escape$1(e){return e.replace(/[&<>\/'"]/g,(function(e){return encoded[e]}))}function parseDate(e){const t=new RegExp("^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2})T([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})(.([0-9]+))?Z$").exec(e);if(!t)return null;const r=parseInt(t[1])||0,i=(parseInt(t[2])||1)-1,n=parseInt(t[3])||0,o=parseInt(t[4])||0,s=parseInt(t[5])||0,a=parseInt(t[6])||0,u=parseInt(t[8])||0;return new Date(Date.UTC(r,i,n,o,s,a,u))}function resolvingPromise(){let e,t;const r=new Promise(((r,i)=>{e=r,t=i}));return r.resolve=e,r.reject=t,r}function when(e){let t;const r=Array.isArray(e);t=r?e:arguments;let i=t.length,n=!1;const o=[],s=r?[o]:o,a=[];if(o.length=t.length,a.length=t.length,0===i)return Promise.resolve(s);const u=resolvingPromise(),h=function(){i--,i<=0&&(n?u.reject(a):u.resolve(s))},f=function(e,t){e&&"function"==typeof e.then?e.then((function(e){o[t]=e,h()}),(function(e){a[t]=e,n=!0,h()})):(o[t]=e,h())};for(let e=0;e<t.length;e++)f(t[e],e);return u}function continueWhile(e,t){return e()?t().then((()=>continueWhile(e,t))):Promise.resolve()}const DEFAULT_PIN="_default",PIN_PREFIX="parsePin_",OBJECT_PREFIX="Parse_LDS_";function isLocalDatastoreKey(e){return!(!e||e!==DEFAULT_PIN&&!e.startsWith(PIN_PREFIX)&&!e.startsWith(OBJECT_PREFIX))}let uuid;requireCryptoBrowserify(),uuid=()=>globalThis.crypto.randomUUID();const uuidv4=uuid;function arrayContainsObject(e,t){if(e.indexOf(t)>-1)return!0;const r=CoreManager.getParseObject();for(let i=0;i<e.length;i++)if(e[i]instanceof r&&e[i].className===t.className&&e[i]._getId()===t._getId())return!0;return!1}function unique(e){const t=[];return e.forEach((e=>{e instanceof CoreManager.getParseObject()?arrayContainsObject(t,e)||t.push(e):t.indexOf(e)<0&&t.push(e)})),t}function opFromJSON(e){if(!e||!e.__op)return null;switch(e.__op){case"Delete":return new UnsetOp;case"Increment":return new IncrementOp(e.amount);case"Add":return new AddOp(decode(e.objects));case"AddUnique":return new AddUniqueOp(decode(e.objects));case"Remove":return new RemoveOp(decode(e.objects));case"AddRelation":{const t=decode(e.objects);return Array.isArray(t)?new RelationOp(t,[]):new RelationOp([],[])}case"RemoveRelation":{const t=decode(e.objects);return Array.isArray(t)?new RelationOp([],t):new RelationOp([],[])}case"Batch":{let t=[],r=[];for(let i=0;i<e.ops.length;i++)"AddRelation"===e.ops[i].__op?t=t.concat(decode(e.ops[i].objects)):"RemoveRelation"===e.ops[i].__op&&(r=r.concat(decode(e.ops[i].objects)));return new RelationOp(t,r)}}return null}class Op{applyTo(e){}mergeWith(e){}toJSON(e){}}class SetOp extends Op{constructor(e){super(),this._value=e}applyTo(){return this._value}mergeWith(){return new SetOp(this._value)}toJSON(e){return encode(this._value,!1,!0,void 0,e)}}class UnsetOp extends Op{applyTo(){}mergeWith(){return new UnsetOp}toJSON(){return{__op:"Delete"}}}class IncrementOp extends Op{constructor(e){if(super(),"number"!=typeof e)throw new TypeError("Increment Op must be initialized with a numeric amount.");this._amount=e}applyTo(e){if(void 0===e)return this._amount;if("number"!=typeof e)throw new TypeError("Cannot increment a non-numeric value.");return this._amount+e}mergeWith(e){if(!e)return this;if(e instanceof SetOp)return new SetOp(this.applyTo(e._value));if(e instanceof UnsetOp)return new SetOp(this._amount);if(e instanceof IncrementOp)return new IncrementOp(this.applyTo(e._amount));throw new Error("Cannot merge Increment Op with the previous Op")}toJSON(){return{__op:"Increment",amount:this._amount}}}class AddOp extends Op{constructor(e){super(),this._value=Array.isArray(e)?e:[e]}applyTo(e){if(null==e)return this._value;if(Array.isArray(e))return e.concat(this._value);throw new Error("Cannot add elements to a non-array value")}mergeWith(e){if(!e)return this;if(e instanceof SetOp)return new SetOp(this.applyTo(e._value));if(e instanceof UnsetOp)return new SetOp(this._value);if(e instanceof AddOp)return new AddOp(this.applyTo(e._value));throw new Error("Cannot merge Add Op with the previous Op")}toJSON(){return{__op:"Add",objects:encode(this._value,!1,!0)}}}class AddUniqueOp extends Op{constructor(e){super(),this._value=unique(Array.isArray(e)?e:[e])}applyTo(e){if(null==e)return this._value||[];if(Array.isArray(e)){const t=CoreManager.getParseObject(),r=[];return this._value.forEach((i=>{i instanceof t?arrayContainsObject(e,i)||r.push(i):e.indexOf(i)<0&&r.push(i)})),e.concat(r)}throw new Error("Cannot add elements to a non-array value")}mergeWith(e){if(!e)return this;if(e instanceof SetOp)return new SetOp(this.applyTo(e._value));if(e instanceof UnsetOp)return new SetOp(this._value);if(e instanceof AddUniqueOp)return new AddUniqueOp(this.applyTo(e._value));throw new Error("Cannot merge AddUnique Op with the previous Op")}toJSON(){return{__op:"AddUnique",objects:encode(this._value,!1,!0)}}}class RemoveOp extends Op{constructor(e){super(),this._value=unique(Array.isArray(e)?e:[e])}applyTo(e){if(null==e)return[];if(Array.isArray(e)){const t=CoreManager.getParseObject(),r=e.concat([]);for(let e=0;e<this._value.length;e++){let i=r.indexOf(this._value[e]);for(;i>-1;)r.splice(i,1),i=r.indexOf(this._value[e]);if(this._value[e]instanceof t&&this._value[e].id)for(let i=0;i<r.length;i++)r[i]instanceof t&&this._value[e].id===r[i].id&&(r.splice(i,1),i--)}return r}throw new Error("Cannot remove elements from a non-array value")}mergeWith(e){if(!e)return this;if(e instanceof SetOp)return new SetOp(this.applyTo(e._value));if(e instanceof UnsetOp)return new UnsetOp;if(e instanceof RemoveOp){const t=CoreManager.getParseObject(),r=e._value.concat([]);for(let e=0;e<this._value.length;e++)this._value[e]instanceof t?arrayContainsObject(r,this._value[e])||r.push(this._value[e]):r.indexOf(this._value[e])<0&&r.push(this._value[e]);return new RemoveOp(r)}throw new Error("Cannot merge Remove Op with the previous Op")}toJSON(){return{__op:"Remove",objects:encode(this._value,!1,!0)}}}class RelationOp extends Op{constructor(e,t){super(),this._targetClassName=null,Array.isArray(e)&&(this.relationsToAdd=unique(e.map(this._extractId,this))),Array.isArray(t)&&(this.relationsToRemove=unique(t.map(this._extractId,this)))}_extractId(e){if("string"==typeof e)return e;if(!e.id)throw new Error("You cannot add or remove an unsaved Parse Object from a relation");if(this._targetClassName||(this._targetClassName=e.className),this._targetClassName!==e.className)throw new Error("Tried to create a Relation with 2 different object types: "+this._targetClassName+" and "+e.className+".");return e.id}applyTo(e,t,r){if(!e){if(!t||!r)throw new Error("Cannot apply a RelationOp without either a previous value, or an object and a key");const e=new ParseRelation(t,r);return e.targetClassName=this._targetClassName,e}if(e instanceof ParseRelation){if(this._targetClassName)if(e.targetClassName){if(this._targetClassName!==e.targetClassName)throw new Error("Related object must be a "+e.targetClassName+", but a "+this._targetClassName+" was passed in.")}else e.targetClassName=this._targetClassName;return e}throw new Error("Relation cannot be applied to a non-relation field")}mergeWith(e){if(!e)return this;if(e instanceof UnsetOp)throw new Error("You cannot modify a relation after deleting it.");if(e instanceof SetOp&&e._value instanceof ParseRelation)return this;if(e instanceof RelationOp){if(e._targetClassName&&e._targetClassName!==this._targetClassName)throw new Error("Related object must be of class "+e._targetClassName+", but "+(this._targetClassName||"null")+" was passed in.");const t=e.relationsToAdd.concat([]);this.relationsToRemove.forEach((e=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)})),this.relationsToAdd.forEach((e=>{t.indexOf(e)<0&&t.push(e)}));const r=e.relationsToRemove.concat([]);this.relationsToAdd.forEach((e=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)})),this.relationsToRemove.forEach((e=>{r.indexOf(e)<0&&r.push(e)}));const i=new RelationOp(t,r);return i._targetClassName=this._targetClassName,i}throw new Error("Cannot merge Relation Op with the previous Op")}toJSON(){const e=e=>({__type:"Pointer",className:this._targetClassName,objectId:e});let t=null,r=null,i=null;return this.relationsToAdd.length>0&&(t=this.relationsToAdd.map(e),r={__op:"AddRelation",objects:t}),this.relationsToRemove.length>0&&(t=this.relationsToRemove.map(e),i={__op:"RemoveRelation",objects:t}),r&&i?{__op:"Batch",ops:[r,i]}:r||i||{}}}CoreManager.setParseOp({Op:Op,opFromJSON:opFromJSON,SetOp:SetOp,UnsetOp:UnsetOp,IncrementOp:IncrementOp,AddOp:AddOp,RelationOp:RelationOp,RemoveOp:RemoveOp,AddUniqueOp:AddUniqueOp});class TaskQueue{constructor(){this.queue=[]}enqueue(e){const t=resolvingPromise();return this.queue.push({task:e,_completion:t}),1===this.queue.length&&e().then((()=>{this._dequeue(),t.resolve()}),(e=>{this._dequeue(),t.reject(e)})),t}_dequeue(){if(this.queue.shift(),this.queue.length){const e=this.queue[0];e.task().then((()=>{this._dequeue(),e._completion.resolve()}),(t=>{this._dequeue(),e._completion.reject(t)}))}}}function defaultState(){return{serverData:Object.create(null),pendingOps:[Object.create(null)],objectCache:Object.create(null),tasks:new TaskQueue,existed:!1}}function setServerData$2(e,t){for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(isDangerousKey(r)||(void 0!==t[r]?e[r]=t[r]:delete e[r]))}function setPendingOp$2(e,t,r){if(isDangerousKey(t))return;const i=e.length-1;r?e[i][t]=r:delete e[i][t]}function pushPendingState$2(e){e.push(Object.create(null))}function popPendingState$2(e){const t=e.shift();return e.length||(e[0]=Object.create(null)),t}function mergeFirstPendingState$2(e){const t=popPendingState$2(e),r=e[0];for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&!isDangerousKey(e))if(r[e]&&t[e]){const i=r[e].mergeWith(t[e]);i&&(r[e]=i)}else r[e]=t[e]}function estimateAttribute$2(e,t,r,i){if(isDangerousKey(i))return;let n=e[i];for(let e=0;e<t.length;e++)t[e][i]&&(t[e][i]instanceof RelationOp?r.id&&(n=t[e][i].applyTo(n,r,i)):n=t[e][i].applyTo(n));return n}function estimateAttributes$2(e,t,r){const i=Object.create(null);let n;for(n in e)i[n]=e[n];for(let e=0;e<t.length;e++)for(n in t[e])if(Object.prototype.hasOwnProperty.call(t[e],n)&&!isDangerousKey(n))if(t[e][n]instanceof RelationOp)r.id&&(i[n]=t[e][n].applyTo(i[n],r,n));else if(n.includes(".")){const r=n.split("."),o=r[r.length-1];let s=i;for(let e=0;e<r.length-1;e++){const t=r[e];if(t in s)Array.isArray(s[t])?s[t]=[...s[t]]:s[t]={...s[t]};else{const i=r[e+1];isNaN(i)?s[t]=Object.create(null):s[t]=[]}s=s[t]}s[o]=t[e][n].applyTo(s[o])}else i[n]=t[e][n].applyTo(i[n]);return i}function nestedSet(e,t,r){const i=t.split(".");for(let t=0;t<i.length-1;t++){const r=i[t];if(!(r in e)){const n=i[t+1];isNaN(n)?e[r]=Object.create(null):e[r]=[]}e=e[r]}void 0===r?delete e[i[i.length-1]]:e[i[i.length-1]]=r}function commitServerChanges$2(e,t,r){const i=CoreManager.getParseObject();for(const n in r){if(!Object.prototype.hasOwnProperty.call(r,n))continue;if(isDangerousKey(n))continue;const o=r[n];if(nestedSet(e,n,o),o&&"object"==typeof o&&!(o instanceof i)&&!(o instanceof ParseFile)&&!(o instanceof ParseRelation)){const e=encode(o,!1,!0);t[n]=JSON.stringify(e)}}}let objectState$1=Object.create(null);function getState$1(e){const t=objectState$1[e.className];return t&&t[e.id]||null}function initializeState$1(e,t){let r=getState$1(e);return r||(objectState$1[e.className]||(objectState$1[e.className]=Object.create(null)),t||(t=defaultState()),r=objectState$1[e.className][e.id]=t,r)}function removeState$1(e){const t=getState$1(e);return null===t?null:(delete objectState$1[e.className][e.id],t)}function getServerData$1(e){const t=getState$1(e);return t?t.serverData:{}}function setServerData$1(e,t){setServerData$2(initializeState$1(e).serverData,t)}function getPendingOps$1(e){const t=getState$1(e);return t?t.pendingOps:[{}]}function setPendingOp$1(e,t,r){setPendingOp$2(initializeState$1(e).pendingOps,t,r)}function pushPendingState$1(e){pushPendingState$2(initializeState$1(e).pendingOps)}function popPendingState$1(e){return popPendingState$2(initializeState$1(e).pendingOps)}function mergeFirstPendingState$1(e){mergeFirstPendingState$2(getPendingOps$1(e))}function getObjectCache$1(e){const t=getState$1(e);return t?t.objectCache:{}}function estimateAttribute$1(e,t){return estimateAttribute$2(getServerData$1(e),getPendingOps$1(e),e,t)}function estimateAttributes$1(e){return estimateAttributes$2(getServerData$1(e),getPendingOps$1(e),e)}function commitServerChanges$1(e,t){const r=initializeState$1(e);commitServerChanges$2(r.serverData,r.objectCache,t)}function enqueueTask$1(e,t){return initializeState$1(e).tasks.enqueue(t)}function clearAllState$1(){objectState$1=Object.create(null)}function duplicateState$1(e,t){t.id=e.id}const SingleInstanceStateController=Object.freeze(Object.defineProperty({__proto__:null,clearAllState:clearAllState$1,commitServerChanges:commitServerChanges$1,duplicateState:duplicateState$1,enqueueTask:enqueueTask$1,estimateAttribute:estimateAttribute$1,estimateAttributes:estimateAttributes$1,getObjectCache:getObjectCache$1,getPendingOps:getPendingOps$1,getServerData:getServerData$1,getState:getState$1,initializeState:initializeState$1,mergeFirstPendingState:mergeFirstPendingState$1,popPendingState:popPendingState$1,pushPendingState:pushPendingState$1,removeState:removeState$1,setPendingOp:setPendingOp$1,setServerData:setServerData$1},Symbol.toStringTag,{value:"Module"}));let objectState=new WeakMap;function getState(e){return objectState.get(e)||null}function initializeState(e,t){let r=getState(e);return r||(t||(t={serverData:{},pendingOps:[{}],objectCache:{},tasks:new TaskQueue,existed:!1}),r=t,objectState.set(e,r),r)}function removeState(e){const t=getState(e);return null===t?null:(objectState.delete(e),t)}function getServerData(e){const t=getState(e);return t?t.serverData:{}}function setServerData(e,t){setServerData$2(initializeState(e).serverData,t)}function getPendingOps(e){const t=getState(e);return t?t.pendingOps:[{}]}function setPendingOp(e,t,r){setPendingOp$2(initializeState(e).pendingOps,t,r)}function pushPendingState(e){pushPendingState$2(initializeState(e).pendingOps)}function popPendingState(e){return popPendingState$2(initializeState(e).pendingOps)}function mergeFirstPendingState(e){mergeFirstPendingState$2(getPendingOps(e))}function getObjectCache(e){const t=getState(e);return t?t.objectCache:{}}function estimateAttribute(e,t){return estimateAttribute$2(getServerData(e),getPendingOps(e),e,t)}function estimateAttributes(e){return estimateAttributes$2(getServerData(e),getPendingOps(e),e)}function commitServerChanges(e,t){const r=initializeState(e);commitServerChanges$2(r.serverData,r.objectCache,t)}function enqueueTask(e,t){return initializeState(e).tasks.enqueue(t)}function duplicateState(e,t){const r=initializeState(e),i=initializeState(t);for(const e in r.serverData)i.serverData[e]=r.serverData[e];for(let e=0;e<r.pendingOps.length;e++)for(const t in r.pendingOps[e])i.pendingOps[e][t]=r.pendingOps[e][t];for(const e in r.objectCache)i.objectCache[e]=r.objectCache[e];i.existed=r.existed}function clearAllState(){objectState=new WeakMap}const UniqueInstanceStateController=Object.freeze(Object.defineProperty({__proto__:null,clearAllState:clearAllState,commitServerChanges:commitServerChanges,duplicateState:duplicateState,enqueueTask:enqueueTask,estimateAttribute:estimateAttribute,estimateAttributes:estimateAttributes,getObjectCache:getObjectCache,getPendingOps:getPendingOps,getServerData:getServerData,getState:getState,initializeState:initializeState,mergeFirstPendingState:mergeFirstPendingState,popPendingState:popPendingState,pushPendingState:pushPendingState,removeState:removeState,setPendingOp:setPendingOp,setServerData:setServerData},Symbol.toStringTag,{value:"Module"}));function unsavedChildren(e,t){const r={objects:{},files:[]},i=e.className+":"+e._getId();r.objects[i]=!e.dirty()||e;const n=e.attributes;for(const e in n)"object"==typeof n[e]&&traverse(n[e],r,!1,!!t);const o=[];for(const e in r.objects)e!==i&&!0!==r.objects[e]&&o.push(r.objects[e]);return o.concat(r.files)}function traverse(e,t,r,i){if(e instanceof CoreManager.getParseObject()){if(!e.id&&r)throw new Error("Cannot create a pointer to an unsaved Object.");const n=e.className+":"+e._getId();if(!t.objects[n]){t.objects[n]=!e.dirty()||e;const r=e.attributes;for(const e in r)"object"==typeof r[e]&&traverse(r[e],t,!i,i)}}else if(e instanceof ParseFile)!e.url()&&t.files.indexOf(e)<0&&t.files.push(e);else if(!(e instanceof ParseRelation)){Array.isArray(e)&&e.forEach((e=>{"object"==typeof e&&traverse(e,t,r,i)}));for(const n in e)"object"==typeof e[n]&&traverse(e[n],t,r,i)}}const classMap=Object.create(null);let objectCount=0,singleInstance=!CoreManager.get("IS_NODE");function getServerUrlPath(){let e=CoreManager.get("SERVER_URL");"/"!==e[e.length-1]&&(e+="/");const t=e.replace(/https?:\/\//,"");return t.substr(t.indexOf("/"))}singleInstance?CoreManager.setObjectStateController(SingleInstanceStateController):CoreManager.setObjectStateController(UniqueInstanceStateController);class ParseObject{constructor(e,t,r){"function"==typeof this.initialize&&this.initialize.apply(this,arguments);let i=null;if(this._objCount=objectCount++,"string"==typeof e)this.className=e,t&&"object"==typeof t&&(i=t);else if(e&&"object"==typeof e){this.className=e.className,i={};for(const t in e)"className"!==t&&(i[t]=e[t]);t&&"object"==typeof t&&(r=t)}if(i)try{this.set(i,r)}catch(e){throw new Error("Can't create an invalid Parse Object")}CoreManager.get("NODE_LOGGING")&&(this[Symbol.for("nodejs.util.inspect.custom")]=function(){return`ParseObject: className: ${this.className}, id: ${this.id}\nAttributes: ${JSON.stringify(this.attributes,null,2)}`})}get attributes(){const e=CoreManager.getObjectStateController();return Object.freeze(e.estimateAttributes(this._getStateIdentifier()))}get createdAt(){return this._getServerData().createdAt}get updatedAt(){return this._getServerData().updatedAt}_getId(){if("string"==typeof this.id)return this.id;if("string"==typeof this._localId)return this._localId;const e="local"+uuidv4();return this._localId=e,e}_getStateIdentifier(){if(singleInstance){let e=this.id;return e||(e=this._getId()),{id:e,className:this.className}}return this}_getServerData(){return CoreManager.getObjectStateController().getServerData(this._getStateIdentifier())}_clearServerData(){const e=this._getServerData(),t={};for(const r in e)t[r]=void 0;CoreManager.getObjectStateController().setServerData(this._getStateIdentifier(),t)}_getPendingOps(){return CoreManager.getObjectStateController().getPendingOps(this._getStateIdentifier())}_clearPendingOps(e){const t=this._getPendingOps(),r=t[t.length-1];(e||Object.keys(r)).forEach((e=>{delete r[e]}))}_getDirtyObjectAttributes(){const e=this.attributes,t=CoreManager.getObjectStateController().getObjectCache(this._getStateIdentifier()),r={};for(const i in e){const n=e[i];if(n&&"object"==typeof n&&!(n instanceof ParseObject)&&!(n instanceof ParseFile)&&!(n instanceof ParseRelation))try{const e=encode(n,!1,!0),o=JSON.stringify(e);t[i]!==o&&(r[i]=n)}catch(e){r[i]=n}}return r}_toFullJSON(e,t){const r=this.toJSON(e,t);return r.__type="Object",r.className=this.className,r}_getSaveJSON(){const e=this._getPendingOps(),t=this._getDirtyObjectAttributes(),r={};let i;for(i in t){let n=!1;for(let t=0;t<e.length;t+=1)for(const r in e[t])if(r.includes(".")){if(r.split(".")[0]===i){n=!0;break}}n||(r[i]=new SetOp(t[i]).toJSON())}for(i in e[0])r[i]=e[0][i].toJSON();return r}_getSaveParams(){let e=this.id?"PUT":"POST";const t=this._getSaveJSON();let r="classes/"+this.className;return CoreManager.get("ALLOW_CUSTOM_OBJECT_ID")?this.createdAt?(e="PUT",r+="/"+this.id):(e="POST",t.objectId=this.id):this.id?r+="/"+this.id:"_User"===this.className&&(r="users"),{method:e,body:t,path:r}}_finishFetch(e){!this.id&&e.objectId&&(this.id=e.objectId);const t=CoreManager.getObjectStateController();t.initializeState(this._getStateIdentifier());const r={};for(const t in e)"ACL"===t?r[t]=new ParseACL(e[t]):"objectId"!==t&&(r[t]=decode(e[t]),r[t]instanceof ParseRelation&&r[t]._ensureParentAndKey(this,t));r.createdAt&&"string"==typeof r.createdAt&&(r.createdAt=parseDate(r.createdAt)),r.updatedAt&&"string"==typeof r.updatedAt&&(r.updatedAt=parseDate(r.updatedAt)),!r.updatedAt&&r.createdAt&&(r.updatedAt=r.createdAt),t.commitServerChanges(this._getStateIdentifier(),r)}_setExisted(e){const t=CoreManager.getObjectStateController().getState(this._getStateIdentifier());t&&(t.existed=e)}_migrateId(e){if(this._localId&&e)if(singleInstance){const t=CoreManager.getObjectStateController(),r=t.removeState(this._getStateIdentifier());this.id=e,delete this._localId,r&&t.initializeState(this._getStateIdentifier(),r)}else this.id=e,delete this._localId}_handleSaveResponse(e,t){const r={};let i;const n=CoreManager.getObjectStateController(),o=n.popPendingState(this._getStateIdentifier());for(i in o)o[i]instanceof RelationOp?r[i]=o[i].applyTo(void 0,this,i):i in e||(r[i]=o[i].applyTo(void 0));for(i in e)if("createdAt"!==i&&"updatedAt"!==i||"string"!=typeof e[i]){if("ACL"===i)r[i]=new ParseACL(e[i]);else if("objectId"!==i){const t=decode(e[i]);t&&Object.getPrototypeOf(t)===Object.prototype?r[i]={...this.attributes[i],...t}:r[i]=t,r[i]instanceof UnsetOp&&(r[i]=void 0)}}else r[i]=parseDate(e[i]);r.createdAt&&!r.updatedAt&&(r.updatedAt=r.createdAt),this._migrateId(e.objectId),201!==t&&this._setExisted(!0),n.commitServerChanges(this._getStateIdentifier(),r)}_handleSaveError(){CoreManager.getObjectStateController().mergeFirstPendingState(this._getStateIdentifier())}static _getClassMap(){return classMap}static _getRequestOptions(e={}){const t={};if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("request options must be of type Object");const{hasOwn:r}=Object;return r(e,"useMasterKey")&&(t.useMasterKey=!!e.useMasterKey),r(e,"useMaintenanceKey")&&(t.useMaintenanceKey=!!e.useMaintenanceKey),r(e,"sessionToken")&&"string"==typeof e.sessionToken&&(t.sessionToken=e.sessionToken),r(e,"installationId")&&"string"==typeof e.installationId&&(t.installationId=e.installationId),r(e,"transaction")&&"boolean"==typeof e.transaction&&(t.transaction=e.transaction),r(e,"batchSize")&&"number"==typeof e.batchSize&&(t.batchSize=e.batchSize),r(e,"context")&&"object"==typeof e.context&&(t.context=e.context),r(e,"include")&&(t.include=ParseObject.handleIncludeOptions(e)),r(e,"usePost")&&(t.usePost=e.usePost),r(e,"json")&&(t.json=e.json),t}initialize(){}toJSON(e,t){const r=this.id?this.className+":"+this.id:this;e=e||[r];const i={},n=this.attributes;for(const r in n)"createdAt"!==r&&"updatedAt"!==r||!n[r].toJSON?i[r]=encode(n[r],!1,!1,e,t):i[r]=n[r].toJSON();const o=this._getPendingOps();for(const e in o[0])e.indexOf(".")<0&&(i[e]=o[0][e].toJSON(t));return this.id&&(i.objectId=this.id),i}equals(e){return this===e||e instanceof ParseObject&&this.className===e.className&&this.id===e.id&&void 0!==this.id}dirty(e){if(!this.id)return!0;const t=this._getPendingOps(),r=this._getDirtyObjectAttributes();if(e){if(Object.hasOwn(r,e))return!0;for(let r=0;r<t.length;r++)if(Object.hasOwn(t[r],e))return!0;return!1}return 0!==Object.keys(t[0]).length||0!==Object.keys(r).length}dirtyKeys(){const e=this._getPendingOps(),t={};for(let r=0;r<e.length;r++)for(const i in e[r])t[i]=!0;const r=this._getDirtyObjectAttributes();for(const e in r)t[e]=!0;return Object.keys(t)}isDataAvailable(){const e=this._getServerData();return!!Object.keys(e).length}toPointer(){if(!this.id)throw new Error("Cannot create a pointer to an unsaved ParseObject");return{__type:"Pointer",className:this.className,objectId:this.id}}toOfflinePointer(){if(!this._localId)throw new Error("Cannot create a offline pointer to a saved ParseObject");return{__type:"Object",className:this.className,_localId:this._localId}}get(e){return this.attributes[e]}relation(e){const t=this.get(e);if(t){if(!(t instanceof ParseRelation))throw new Error("Called relation() on non-relation field "+e);return t._ensureParentAndKey(this,e),t}return new ParseRelation(this,e)}escape(e){let t=this.attributes[e];if(null==t)return"";if("string"!=typeof t){if("function"!=typeof t.toString)return"";t=t.toString()}return escape$1(t)}has(e){const t=this.attributes;return!!Object.hasOwn(t,e)&&null!=t[e]}set(e,t,r){let i={};const n={};if(e&&"object"==typeof e)i=e,r=t;else{if("string"!=typeof e)return this;i[e]=t}r=r||{};let o=[];"function"==typeof this.constructor.readOnlyAttributes&&(o=o.concat(this.constructor.readOnlyAttributes()));for(const e in i)if("createdAt"!==e&&"updatedAt"!==e){if(o.indexOf(e)>-1)throw new Error("Cannot modify readonly attribute: "+e);if(r.unset)n[e]=new UnsetOp;else if(i[e]instanceof Op)n[e]=i[e];else if(i[e]&&"object"==typeof i[e]&&"string"==typeof i[e].__op)n[e]=opFromJSON(i[e]);else if("objectId"===e||"id"===e)"string"==typeof i[e]&&(this.id=i[e]);else if("ACL"!==e||"object"!=typeof i[e]||i[e]instanceof ParseACL)if(i[e]instanceof ParseRelation){const t=new ParseRelation(this,e);t.targetClassName=i[e].targetClassName,n[e]=new SetOp(t)}else n[e]=new SetOp(i[e]);else n[e]=new SetOp(new ParseACL(i[e]))}const s=this.attributes,a={};for(const e in n)n[e]instanceof RelationOp?a[e]=n[e].applyTo(s[e],this,e):n[e]instanceof UnsetOp||(a[e]=n[e].applyTo(s[e]));if(!r.ignoreValidation){const e=this.validate(a);if(e)throw e}const u=this._getPendingOps(),h=u.length-1,f=CoreManager.getObjectStateController();for(const e in n){const t=n[e].mergeWith(u[h][e]);f.setPendingOp(this._getStateIdentifier(),e,t)}return this}unset(e,t){return(t=t||{}).unset=!0,this.set(e,null,t)}increment(e,t){if(void 0===t&&(t=1),"number"!=typeof t)throw new Error("Cannot increment by a non-numeric amount.");return this.set(e,new IncrementOp(t))}decrement(e,t){if(void 0===t&&(t=1),"number"!=typeof t)throw new Error("Cannot decrement by a non-numeric amount.");return this.set(e,new IncrementOp(-1*t))}add(e,t){return this.set(e,new AddOp([t]))}addAll(e,t){return this.set(e,new AddOp(t))}addUnique(e,t){return this.set(e,new AddUniqueOp([t]))}addAllUnique(e,t){return this.set(e,new AddUniqueOp(t))}remove(e,t){return this.set(e,new RemoveOp([t]))}removeAll(e,t){return this.set(e,new RemoveOp(t))}op(e){const t=this._getPendingOps();for(let r=0;r<t.length;r+=1)if(t[r][e])return t[r][e]}clone(){const e=new this.constructor(this.className);let t=this.attributes;if("function"==typeof this.constructor.readOnlyAttributes){const e=this.constructor.readOnlyAttributes()||[],r={};for(const i in t)e.indexOf(i)<0&&(r[i]=t[i]);t=r}return e.set&&e.set(t),e}newInstance(){const e=new this.constructor(this.className);if(e.id=this.id,singleInstance)return e;const t=CoreManager.getObjectStateController();return t&&t.duplicateState(this._getStateIdentifier(),e._getStateIdentifier()),e}isNew(){return!this.id}existed(){if(!this.id)return!1;const e=CoreManager.getObjectStateController().getState(this._getStateIdentifier());return!!e&&e.existed}async exists(e){if(!this.id)return!1;try{const t=new(CoreManager.getParseQuery())(this.className);return await t.get(this.id,e),!0}catch(e){if(e.code===ParseError.OBJECT_NOT_FOUND)return!1;throw e}}isValid(){return!this.validate(this.attributes)}validate(e){if(Object.hasOwn(e,"ACL")&&!(e.ACL instanceof ParseACL))return new ParseError(ParseError.OTHER_CAUSE,"ACL must be a Parse ACL.");for(const t in e)if(!/^[A-Za-z_][0-9A-Za-z_.]*$/.test(t))return new ParseError(ParseError.INVALID_KEY_NAME,`Invalid key name: ${t}`);return!1}getACL(){const e=this.get("ACL");return e instanceof ParseACL?e:null}setACL(e,t){return this.set("ACL",e,t)}revert(...e){let t;if(e.length){t=[];for(const r of e){if("string"!=typeof r)throw new Error("Parse.Object#revert expects either no, or a list of string, arguments.");t.push(r)}}this._clearPendingOps(t)}clear(){const e=this.attributes,t={};let r=["createdAt","updatedAt"];"function"==typeof this.constructor.readOnlyAttributes&&(r=r.concat(this.constructor.readOnlyAttributes()));for(const i in e)r.indexOf(i)<0&&(t[i]=!0);return this.set(t,{unset:!0})}fetch(e){const t=ParseObject._getRequestOptions(e);return CoreManager.getObjectController().fetch(this,!0,t)}fetchWithInclude(e,t){return(t=t||{}).include=e,this.fetch(t)}async saveEventually(e){try{await this.save(null,e)}catch(t){t.code===ParseError.CONNECTION_FAILED&&(await CoreManager.getEventuallyQueue().save(this,e),CoreManager.getEventuallyQueue().poll())}return this}async save(e,t,r){let i,n;"object"==typeof e||void 0===e?(i=e,"object"==typeof t&&(n=t)):(i={},i[e]=t,n=r),n=n||{},i&&this.set(i,n);const o=ParseObject._getRequestOptions(n),s=CoreManager.getObjectController(),a=!1!==n.cascadeSave?unsavedChildren(this):null;if(a&&a.length&&!0===n.transaction&&a.some((e=>e instanceof ParseObject))){const e=[],t=[];a.forEach((r=>{r instanceof ParseFile?e.push(r):t.push(r)})),t.push(this);return(e.length?s.save(e,o):Promise.resolve()).then((()=>s.save(t,o))).then((e=>e.pop()))}return await s.save(a,o),s.save(this,o)}async destroyEventually(e){try{await this.destroy(e)}catch(t){t.code===ParseError.CONNECTION_FAILED&&(await CoreManager.getEventuallyQueue().destroy(this,e),CoreManager.getEventuallyQueue().poll())}return this}destroy(e){if(!this.id)return Promise.resolve(void 0);const t=ParseObject._getRequestOptions(e);return CoreManager.getObjectController().destroy(this,t)}pin(){return ParseObject.pinAllWithName(DEFAULT_PIN,[this])}unPin(){return ParseObject.unPinAllWithName(DEFAULT_PIN,[this])}async isPinned(){const e=CoreManager.getLocalDatastore();if(!e.isEnabled)return Promise.reject("Parse.enableLocalDatastore() must be called first");const t=e.getKeyForObject(this);return(await e.fromPinWithName(t)).length>0}pinWithName(e){return ParseObject.pinAllWithName(e,[this])}unPinWithName(e){return ParseObject.unPinAllWithName(e,[this])}async fetchFromLocalDatastore(){const e=CoreManager.getLocalDatastore();if(!e.isEnabled)throw new Error("Parse.enableLocalDatastore() must be called first");const t=e.getKeyForObject(this),r=await e._serializeObject(t);if(!r)throw new Error("Cannot fetch an unsaved ParseObject");const i=ParseObject.fromJSON(r);return this._finishFetch(i.toJSON()),this}static _clearAllState(){CoreManager.getObjectStateController().clearAllState()}static fetchAll(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getObjectController().fetch(e,!0,r)}static fetchAllWithInclude(e,t,r){return(r=r||{}).include=t,ParseObject.fetchAll(e,r)}static fetchAllIfNeededWithInclude(e,t,r){return(r=r||{}).include=t,ParseObject.fetchAllIfNeeded(e,r)}static fetchAllIfNeeded(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getObjectController().fetch(e,!1,r)}static handleIncludeOptions(e){let t=[];return Array.isArray(e.include)?e.include.forEach((e=>{Array.isArray(e)?t=t.concat(e):t.push(e)})):t.push(e.include),t}static destroyAll(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getObjectController().destroy(e,r)}static saveAll(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getObjectController().save(e,r)}static createWithoutData(e){const t=new this;return t.id=e,t}static fromJSON(e,t,r){if(!e.className)throw new Error("Cannot create an object without a className");const i=classMap[e.className],n=i?new i(e.className):new ParseObject(e.className),o={};for(const t in e)"className"!==t&&"__type"!==t&&(o[t]=e[t],r&&n.set(t,e[t]));if(t){o.objectId&&(n.id=o.objectId);let e=null;"function"==typeof n._preserveFieldsOnFetch&&(e=n._preserveFieldsOnFetch()),n._clearServerData(),e&&n._finishFetch(e)}return n._finishFetch(o),e.objectId&&n._setExisted(!0),n}static registerSubclass(e,t){if("string"!=typeof e)throw new TypeError("The first argument must be a valid class name.");if(void 0===t)throw new TypeError("You must supply a subclass constructor.");if("function"!=typeof t)throw new TypeError("You must register the subclass constructor. Did you attempt to register an instance of the subclass?");classMap[e]=t,t.className||(t.className=e)}static unregisterSubclass(e){if("string"!=typeof e)throw new TypeError("The first argument must be a valid class name.");delete classMap[e]}static extend(e,t,r){if("string"!=typeof e){if(e&&"string"==typeof e.className)return ParseObject.extend(e.className,e,t);throw new Error("Parse.Object.extend's first argument should be the className.")}let i=e;"User"===i&&CoreManager.get("PERFORM_USER_REWRITE")&&(i="_User");let n=ParseObject.prototype;Object.hasOwn(this,"__super__")&&this.__super__&&(n=this.prototype);let o=function(e,t){if(this.className=i,this._objCount=objectCount++,"function"==typeof this.initialize&&this.initialize.apply(this,arguments),this._initializers)for(const e of this._initializers)e.apply(this,arguments);if(e&&"object"==typeof e)try{this.set(e||{},t)}catch(e){throw new Error("Can't create an invalid Parse Object")}};if(classMap[i]?o=classMap[i]:(o.extend=function(e,t,r){return"string"==typeof e?ParseObject.extend.call(o,e,t,r):ParseObject.extend.call(o,i,e,t)},o.createWithoutData=ParseObject.createWithoutData,o.className=i,o.__super__=n,o.prototype=Object.create(n,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}})),t)for(const e in t)"initialize"!==e?"className"!==e&&Object.defineProperty(o.prototype,e,{value:t[e],enumerable:!1,writable:!0,configurable:!0}):Object.defineProperty(o.prototype,"_initializers",{value:[...o.prototype._initializers||[],t[e]],enumerable:!1,writable:!0,configurable:!0});if(r)for(const e in r)"className"!==e&&Object.defineProperty(o,e,{value:r[e],enumerable:!1,writable:!0,configurable:!0});return classMap[i]=o,o}static enableSingleInstance(){singleInstance=!0,CoreManager.setObjectStateController(SingleInstanceStateController)}static disableSingleInstance(){singleInstance=!1,CoreManager.setObjectStateController(UniqueInstanceStateController)}static pinAll(e){return CoreManager.getLocalDatastore().isEnabled?ParseObject.pinAllWithName(DEFAULT_PIN,e):Promise.reject("Parse.enableLocalDatastore() must be called first")}static pinAllWithName(e,t){const r=CoreManager.getLocalDatastore();return r.isEnabled?r._handlePinAllWithName(e,t):Promise.reject("Parse.enableLocalDatastore() must be called first")}static unPinAll(e){return CoreManager.getLocalDatastore().isEnabled?ParseObject.unPinAllWithName(DEFAULT_PIN,e):Promise.reject("Parse.enableLocalDatastore() must be called first")}static unPinAllWithName(e,t){const r=CoreManager.getLocalDatastore();return r.isEnabled?r._handleUnPinAllWithName(e,t):Promise.reject("Parse.enableLocalDatastore() must be called first")}static unPinAllObjects(){const e=CoreManager.getLocalDatastore();return e.isEnabled?e.unPinWithName(DEFAULT_PIN):Promise.reject("Parse.enableLocalDatastore() must be called first")}static unPinAllObjectsWithName(e){const t=CoreManager.getLocalDatastore();return t.isEnabled?t.unPinWithName(PIN_PREFIX+e):Promise.reject("Parse.enableLocalDatastore() must be called first")}}const DefaultController$9={fetch(e,t,r){const i=CoreManager.getLocalDatastore();if(Array.isArray(e)){if(e.length<1)return Promise.resolve([]);const n=[],o=[];let s=null;const a=[];let u=null;if(e.forEach((e=>{u||(s||(s=e.className),s!==e.className&&(u=new ParseError(ParseError.INVALID_CLASS_NAME,"All objects should be of the same class")),e.id||(u=new ParseError(ParseError.MISSING_OBJECT_ID,"All objects must have an ID")),!t&&e.isDataAvailable()||(o.push(e.id),n.push(e)),a.push(e))})),u)return Promise.reject(u);const h=new(CoreManager.getParseQuery())(s);return h.containedIn("objectId",o),r&&r.include&&h.include(r.include),h._limit=o.length,h.find(r).then((async e=>{const r={};e.forEach((e=>{r[e.id]=e}));for(let e=0;e<n.length;e++){const i=n[e];if((!i||!i.id||!r[i.id])&&t)return Promise.reject(new ParseError(ParseError.OBJECT_NOT_FOUND,"All objects must exist on the server."))}if(!singleInstance)for(let e=0;e<a.length;e++){const t=a[e];if(t&&t.id&&r[t.id]){const i=t.id;t._finishFetch(r[i].toJSON()),a[e]=r[i]}}for(const e of a)await i._updateObjectIfPinned(e);return Promise.resolve(a)}))}if(e instanceof ParseObject){if(!e.id)return Promise.reject(new ParseError(ParseError.MISSING_OBJECT_ID,"Object does not have an ID"));const t=CoreManager.getRESTController(),n={};return r&&r.include&&(n.include=r.include.join()),t.request("GET","classes/"+e.className+"/"+e._getId(),n,r).then((async t=>(e._clearPendingOps(),e._clearServerData(),e._finishFetch(t),await i._updateObjectIfPinned(e),e)))}return Promise.resolve(void 0)},async destroy(e,t){if(t&&t.batchSize&&t.transaction)throw new ParseError(ParseError.OTHER_CAUSE,"You cannot use both transaction and batchSize options simultaneously.");let r=t&&t.batchSize?t.batchSize:CoreManager.get("REQUEST_BATCH_SIZE");const i=CoreManager.getLocalDatastore(),n=CoreManager.getRESTController();if(Array.isArray(e)){if(t&&t.transaction&&e.length>1&&(r=e.length),e.length<1)return Promise.resolve([]);const o=[[]];e.forEach((e=>{e.id&&(o[o.length-1].push(e),o[o.length-1].length>=r&&o.push([]))})),0===o[o.length-1].length&&o.pop();let s=Promise.resolve();const a=[];return o.forEach((e=>{const r=e.map((e=>({method:"DELETE",path:getServerUrlPath()+"classes/"+e.className+"/"+e._getId(),body:{}}))),i=t&&t.transaction&&r.length>1?{requests:r,transaction:!0}:{requests:r};s=s.then((()=>n.request("POST","batch",i,t).then((t=>{for(let r=0;r<t.length;r++)if(t[r]&&Object.hasOwn(t[r],"error")){const i=new ParseError(t[r].error.code,t[r].error.error);i.object=e[r],a.push(i)}}))))})),s.then((async()=>{if(a.length){const e=new ParseError(ParseError.AGGREGATE_ERROR);return e.errors=a,Promise.reject(e)}for(const t of e)await i._destroyObjectIfPinned(t);return Promise.resolve(e)}))}return e instanceof ParseObject?n.request("DELETE","classes/"+e.className+"/"+e._getId(),{},t).then((async()=>(await i._destroyObjectIfPinned(e),Promise.resolve(e)))):Promise.resolve(e)},save(e,t){if(t&&t.batchSize&&t.transaction)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"You cannot use both transaction and batchSize options simultaneously."));let r=t&&t.batchSize?t.batchSize:CoreManager.get("REQUEST_BATCH_SIZE");const i=CoreManager.getLocalDatastore(),n={},o=CoreManager.getRESTController(),s=CoreManager.getObjectStateController(),a=CoreManager.get("ALLOW_CUSTOM_OBJECT_ID");if((t=t||{}).returnStatus=t.returnStatus||!0,Array.isArray(e)){if(e.length<1)return Promise.resolve([]);let u=e.concat();for(let t=0;t<e.length;t++){const r=e[t];r instanceof ParseObject&&(u=u.concat(unsavedChildren(r,!0)))}u=unique(u);const h=[];let f=[];if(u.forEach((e=>{e instanceof ParseFile?h.push(e.save(t)):e instanceof ParseObject&&f.push(e)})),t&&t.transaction&&f.length>1){if(f.some((e=>!canBeSerialized(e))))return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Tried to save a transactional batch containing an object with unserializable attributes."));r=f.length}return Promise.all(h).then((()=>{let u=null;return continueWhile((()=>f.length>0),(()=>{const e=[],i=[];if(f.forEach((t=>{if(a&&Object.hasOwn(t,"id")&&!t.id)throw new ParseError(ParseError.MISSING_OBJECT_ID,"objectId must not be empty or null");e.length<r&&canBeSerialized(t)?e.push(t):i.push(t)})),f=i,e.length<1)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Tried to save a batch with a cycle."));const h=resolvingPromise(),l=[],c=[];return e.forEach(((e,t)=>{const r=resolvingPromise();l.push(r);s.pushPendingState(e._getStateIdentifier()),c.push(s.enqueueTask(e._getStateIdentifier(),(function(){return r.resolve(),h.then((r=>{if(Object.hasOwn(r[t],"success")){const i=r[t].success.objectId,o=r[t]._status;delete r[t]._status,delete r[t]._headers,n[i]=e._localId,e._handleSaveResponse(r[t].success,o)}else{if(!u&&Object.hasOwn(r[t],"error")){const e=r[t].error;u=new ParseError(e.code,e.error),f=[]}e._handleSaveError()}}))})))})),when(l).then((()=>{const r=e.map((e=>{const t=e._getSaveParams();return t.path=getServerUrlPath()+t.path,t})),i=t&&t.transaction&&r.length>1?{requests:r,transaction:!0}:{requests:r};return o.request("POST","batch",i,t)})).then(h.resolve,(e=>{h.reject(new ParseError(ParseError.INCORRECT_TYPE,e.message))})),when(c)})).then((async()=>{if(u)return Promise.reject(u);for(const t of e)t instanceof ParseObject&&(await i._updateLocalIdForObject(n[t.id],t),await i._updateObjectIfPinned(t));return Promise.resolve(e)}))}))}if(e instanceof ParseObject){if(a&&Object.hasOwn(e,"id")&&!e.id)throw new ParseError(ParseError.MISSING_OBJECT_ID,"objectId must not be empty or null");e._getId();const r=e._localId,n=e,u=function(){const e=n._getSaveParams();return o.request(e.method,e.path,e.body,t).then((e=>{const t=e._status;delete e._status,delete e._headers,n._handleSaveResponse(e,t)}),(e=>(n._handleSaveError(),Promise.reject(e))))};return s.pushPendingState(e._getStateIdentifier()),s.enqueueTask(e._getStateIdentifier(),u).then((async()=>(await i._updateLocalIdForObject(r,e),await i._updateObjectIfPinned(e),e)),(e=>Promise.reject(e)))}return Promise.resolve(void 0)}};function equals(e,t){const r=Object.prototype.toString;if("[object Date]"===r.call(e)||"[object Date]"===r.call(t)){return+new Date(e)==+new Date(t)}if(typeof e!=typeof t)return!1;if(!e||"object"!=typeof e)return e===t;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(!equals(e[r],t[r]))return!1;return!0}const i=CoreManager.getParseObject();if(e instanceof ParseACL||e instanceof ParseFile||e instanceof ParseGeoPoint||e instanceof i)return e.equals(t);if(t instanceof i&&("Object"===e.__type||"Pointer"===e.__type))return e.objectId===t.id&&e.className===t.className;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(!equals(e[r],t[r]))return!1;return!0}function contains(e,t){if(t&&t.__type&&("Pointer"===t.__type||"Object"===t.__type)){for(const r in e){const i=e[r];if("string"==typeof i&&i===t.objectId)return!0;if(i.className===t.className&&i.objectId===t.objectId)return!0}return!1}if(Array.isArray(t))for(const r of t)if(contains(e,r))return!0;return e.indexOf(t)>-1}function transformObject(e){return e._toFullJSON?e._toFullJSON():e}function matchesQuery(e,t,r,i){if(t.className!==e)return!1;let n=t,o=i;t.toJSON&&(n=t.toJSON()),i.toJSON&&(o=i.toJSON().where),n.className=e;for(const t in o)if(!matchesKeyConstraints(e,n,r,t,o[t]))return!1;return!0}function equalObjectsGeneric(e,t,r){if(Array.isArray(e)){for(let i=0;i<e.length;i++)if(r(e[i],t))return!0;return!1}return r(e,t)}function relativeTimeToDate(e,t=new Date){let r=(e=e.toLowerCase()).split(" ");r=r.filter((e=>""!==e));const i="in"===r[0],n="ago"===r[r.length-1];if(!i&&!n&&"now"!==e)return{status:"error",info:"Time should either start with 'in' or end with 'ago'"};if(i&&n)return{status:"error",info:"Time cannot have both 'in' and 'ago'"};if(r=i?r.slice(1):r.slice(0,r.length-1),r.length%2!=0&&"now"!==e)return{status:"error",info:"Invalid time string. Dangling unit or number."};const o=[];for(;r.length;)o.push([r.shift(),r.shift()]);let s=0;for(const[e,t]of o){const r=Number(e);if(!Number.isInteger(r))return{status:"error",info:`'${e}' is not an integer.`};switch(t){case"yr":case"yrs":case"year":case"years":s+=31536e3*r;break;case"wk":case"wks":case"week":case"weeks":s+=604800*r;break;case"d":case"day":case"days":s+=86400*r;break;case"hr":case"hrs":case"hour":case"hours":s+=3600*r;break;case"min":case"mins":case"minute":case"minutes":s+=60*r;break;case"sec":case"secs":case"second":case"seconds":s+=r;break;default:return{status:"error",info:`Invalid interval: '${t}'`}}}const a=1e3*s;return i?{status:"success",info:"future",result:new Date(t.valueOf()+a)}:n?{status:"success",info:"past",result:new Date(t.valueOf()-a)}:{status:"success",info:"present",result:new Date(t.valueOf())}}function matchesKeyConstraints(e,t,r,i,n){if(null===n)return!1;if(i.indexOf(".")>=0){const o=i.split("."),s=o[0],a=o.slice(1).join(".");return matchesKeyConstraints(e,t[s]||{},r,a,n)}let o,s;if("$or"===i){for(o=0;o<n.length;o++)if(matchesQuery(e,t,r,n[o]))return!0;return!1}if("$and"===i){for(o=0;o<n.length;o++)if(!matchesQuery(e,t,r,n[o]))return!1;return!0}if("$nor"===i){for(o=0;o<n.length;o++)if(matchesQuery(e,t,r,n[o]))return!1;return!0}if("$relatedTo"===i)return!1;if(!/^[A-Za-z][0-9A-Za-z_]*$/.test(i))throw new ParseError(ParseError.INVALID_KEY_NAME,`Invalid Key: ${i}`);if("object"!=typeof n)return Array.isArray(t[i])?t[i].indexOf(n)>-1:t[i]===n;if(n.__type)return"Pointer"===n.__type?equalObjectsGeneric(t[i],n,(function(e,t){return void 0!==e&&t.className===e.className&&t.objectId===e.objectId})):equalObjectsGeneric(decode(t[i]),decode(n),equals);for(const e in n){if(s=n[e],s?.__type&&(s=decode(s)),s?.$relativeTime){const e=relativeTimeToDate(s.$relativeTime);if("success"!==e.status)throw new ParseError(ParseError.INVALID_JSON,`bad $relativeTime (${i}) value. ${e.info}`);s=e.result}switch(("[object Date]"===toString.call(s)||"string"==typeof s&&"Invalid Date"!==new Date(s).toString())&&(t[i]=new Date(t[i].iso?t[i].iso:t[i])),e){case"$lt":if(t[i]>=s)return!1;break;case"$lte":if(t[i]>s)return!1;break;case"$gt":if(t[i]<=s)return!1;break;case"$gte":if(t[i]<s)return!1;break;case"$ne":if(equals(t[i],s))return!1;break;case"$in":if(!contains(s,t[i]))return!1;break;case"$nin":if(contains(s,t[i]))return!1;break;case"$all":for(o=0;o<s.length;o++)if(t[i].indexOf(s[o])<0)return!1;break;case"$exists":{const e=void 0!==t[i],r=n.$exists;if("boolean"!=typeof n.$exists)break;if(!e&&r||e&&!r)return!1;break}case"$regex":{if("object"==typeof s)return s.test(t[i]);let e="",r=-2,o=s.indexOf("\\Q");for(;o>-1;)e+=s.substring(r+2,o),r=s.indexOf("\\E",o),r>-1&&(e+=s.substring(o+2,r).replace(/\\\\\\\\E/g,"\\E").replace(/\W/g,"\\$&")),o=s.indexOf("\\Q",r);e+=s.substring(Math.max(o,r+2));let a=n.$options||"";a=a.replace("x","").replace("s","");if(!new RegExp(e,a).test(t[i]))return!1;break}case"$nearSphere":if(!s||!t[i])return!1;return s.radiansTo(t[i])<=(n.$maxDistance||1/0);case"$within":{if(!s||!t[i])return!1;const e=s.$box[0],r=s.$box[1];return!(e.latitude>r.latitude||e.longitude>r.longitude)&&(t[i].latitude>e.latitude&&t[i].latitude<r.latitude&&t[i].longitude>e.longitude&&t[i].longitude<r.longitude)}case"$options":case"$maxDistance":break;case"$select":{const e=r.filter(((e,t,r)=>matchesQuery(s.query.className,e,r,s.query.where)));for(let r=0;r<e.length;r+=1){const n=transformObject(e[r]);return equals(t[i],n[s.key])}return!1}case"$dontSelect":{const e=r.filter(((e,t,r)=>matchesQuery(s.query.className,e,r,s.query.where)));for(let r=0;r<e.length;r+=1){const n=transformObject(e[r]);return!equals(t[i],n[s.key])}return!1}case"$inQuery":{const e=r.filter(((e,t,r)=>matchesQuery(s.className,e,r,s.where)));for(let r=0;r<e.length;r+=1){const n=transformObject(e[r]);if(t[i].className===n.className&&t[i].objectId===n.objectId)return!0}return!1}case"$notInQuery":{const e=r.filter(((e,t,r)=>matchesQuery(s.className,e,r,s.where)));for(let r=0;r<e.length;r+=1){const n=transformObject(e[r]);if(t[i].className===n.className&&t[i].objectId===n.objectId)return!1}return!0}case"$containedBy":for(const e of t[i])if(!contains(s,e))return!1;return!0;case"$geoWithin":if(s.$polygon){const e=s.$polygon.map((e=>[e.latitude,e.longitude]));return new ParsePolygon(e).containsPoint(t[i])}if(s.$centerSphere){const[e,r]=s.$centerSphere,n=new ParseGeoPoint({latitude:e[1],longitude:e[0]});return new ParseGeoPoint(t[i]).radiansTo(n)<=r}return!1;case"$geoIntersects":{const e=new ParsePolygon(t[i].coordinates),r=new ParseGeoPoint(s.$point);return e.containsPoint(r)}default:return!1}}return!0}function validateQuery(e){let t=e;e.toJSON&&(t=e.toJSON().where);const r=["$and","$or","$nor","_rperm","_wperm","_perishable_token","_email_verify_token","_email_verify_token_expires_at","_account_lockout_expires_at","_failed_login_count"];Object.keys(t).forEach((e=>{if(t&&t[e]&&t[e].$regex&&"string"==typeof t[e].$options&&!t[e].$options.match(/^[imxs]+$/))throw new ParseError(ParseError.INVALID_QUERY,`Bad $options value for query: ${t[e].$options}`);if(r.indexOf(e)<0&&!e.match(/^[a-zA-Z][a-zA-Z0-9_\.]*$/))throw new ParseError(ParseError.INVALID_KEY_NAME,`Invalid key name: ${e}`)}))}CoreManager.setParseObject(ParseObject),CoreManager.setObjectController(DefaultController$9);const OfflineQuery={matchesQuery:matchesQuery,validateQuery:validateQuery};function quote(e){return"\\Q"+e.replace("\\E","\\E\\\\E\\Q")+"\\E"}function _getClassNameFromQueries(e){let t=null;return e.forEach((e=>{if(t||(t=e.className),t!==e.className)throw new Error("All queries must be for the same class.")})),t}function handleSelectResult(e,t){const r={};if(t.forEach((t=>{const i=-1!==t.indexOf(".");if(i||Object.hasOwn(e,t)){if(i){const i=t.split(".");let n=e,o=r;i.forEach(((e,t,r)=>{n&&!Object.hasOwn(n,e)&&(n[e]=void 0),n&&"object"==typeof n&&(n=n[e]),t<r.length-1&&(o[e]||(o[e]={}),o=o[e])}))}}else e[t]=void 0})),Object.keys(r).length>0){copyMissingDataWithMask(CoreManager.getObjectStateController().getServerData({id:e.objectId,className:e.className}),e,r,!1)}}function copyMissingDataWithMask(e,t,r,i){if(i)for(const r in e)Object.hasOwn(e,r)&&!Object.hasOwn(t,r)&&(t[r]=e[r]);for(const i in r)void 0!==t[i]&&null!==t[i]&&null!=e&©MissingDataWithMask(e[i],t[i],r[i],!0)}function handleOfflineSort(e,t,r){let i=r[0];const n="-"===i.slice(0,1);if(n&&(i=i.substring(1)),"_created_at"===i&&(i="createdAt"),"_updated_at"===i&&(i="updatedAt"),!/^[A-Za-z][0-9A-Za-z_]*$/.test(i)||"password"===i)throw new ParseError(ParseError.INVALID_KEY_NAME,`Invalid Key: ${i}`);const o=e.get(i),s=t.get(i);if(o<s)return n?1:-1;if(o>s)return n?-1:1;if(r.length>1){return handleOfflineSort(e,t,r.slice(1))}return 0}class ParseQuery{constructor(e){if("string"==typeof e)"User"===e&&CoreManager.get("PERFORM_USER_REWRITE")?this.className="_User":this.className=e;else if(e instanceof ParseObject)this.className=e.className;else{if("function"!=typeof e)throw new TypeError("A ParseQuery must be constructed with a ParseObject or class name.");{const t=e;if("string"==typeof t.className)this.className=t.className;else{const e=new t;this.className=e.className}}}this._where={},this._watch=[],this._include=[],this._exclude=[],this._count=!1,this._limit=-1,this._skip=0,this._readPreference=null,this._includeReadPreference=null,this._subqueryReadPreference=null,this._queriesLocalDatastore=!1,this._localDatastorePinName=null,this._extraOptions={},this._xhrRequest={task:null,onchange:()=>{}},this._comment=null}_orQuery(e){const t=e.map((e=>e.toJSON().where));return this._where.$or=t,this}_andQuery(e){const t=e.map((e=>e.toJSON().where));return this._where.$and=t,this}_norQuery(e){const t=e.map((e=>e.toJSON().where));return this._where.$nor=t,this}_addCondition(e,t,r){return this._where[e]&&"string"!=typeof this._where[e]||(this._where[e]={}),this._where[e][t]=encode(r,!1,!0),this}_regexStartWith(e){return"^"+quote(e)}async _handleOfflineQuery(e){OfflineQuery.validateQuery(this);const t=CoreManager.getLocalDatastore();let r,i=(await t._serializeObjectsFromPinName(this._localDatastorePinName)).map(((e,t,r)=>{const i=ParseObject.fromJSON(e,!1);return e._localId&&!e.objectId&&(i._localId=e._localId),OfflineQuery.matchesQuery(this.className,i,r,this)?i:null})).filter((e=>null!==e));if(e.keys){let t=e.keys.split(",");const r=["className","objectId","createdAt","updatedAt","ACL"];t=t.concat(r),i=i.map((e=>{const r=e._toFullJSON();return Object.keys(r).forEach((e=>{t.includes(e)||delete r[e]})),ParseObject.fromJSON(r,!1)}))}if(e.order){const t=e.order.split(",");i.sort(((e,r)=>handleOfflineSort(e,r,t)))}e.count&&(r=i.length),e.skip&&(i=e.skip>=i.length?[]:i.splice(e.skip,i.length));let n=i.length;return 0!==e.limit&&e.limit<i.length&&(n=e.limit),i=i.splice(0,n),"number"==typeof r?{results:i,count:r}:i}toJSON(){const e={where:this._where};this._watch.length&&(e.watch=this._watch.join(",")),this._include.length&&(e.include=this._include.join(",")),this._exclude.length&&(e.excludeKeys=this._exclude.join(",")),this._select&&(e.keys=this._select.join(",")),this._count&&(e.count=1),this._limit>=0&&(e.limit=this._limit),this._skip>0&&(e.skip=this._skip),this._order&&(e.order=this._order.join(",")),this._readPreference&&(e.readPreference=this._readPreference),this._includeReadPreference&&(e.includeReadPreference=this._includeReadPreference),this._subqueryReadPreference&&(e.subqueryReadPreference=this._subqueryReadPreference),this._hint&&(e.hint=this._hint),this._explain&&(e.explain=!0),this._comment&&(e.comment=this._comment);for(const t in this._extraOptions)e[t]=this._extraOptions[t];return e}withJSON(e){e.where&&(this._where=e.where),e.watch&&(this._watch=e.watch.split(",")),e.include&&(this._include=e.include.split(",")),e.keys&&(this._select=e.keys.split(",")),e.excludeKeys&&(this._exclude=e.excludeKeys.split(",")),e.count&&(this._count=1===e.count),e.limit&&(this._limit=e.limit),e.skip&&(this._skip=e.skip),e.order&&(this._order=e.order.split(",")),e.readPreference&&(this._readPreference=e.readPreference),e.includeReadPreference&&(this._includeReadPreference=e.includeReadPreference),e.subqueryReadPreference&&(this._subqueryReadPreference=e.subqueryReadPreference),e.hint&&(this._hint=e.hint),e.explain&&(this._explain=!!e.explain),e.comment&&(this._comment=e.comment);for(const t in e)Object.hasOwn(e,t)&&-1===["where","include","keys","count","limit","skip","order","readPreference","includeReadPreference","subqueryReadPreference","hint","explain","comment"].indexOf(t)&&(this._extraOptions[t]=e[t]);return this}static fromJSON(e,t){return new ParseQuery(e).withJSON(t)}get(e,t){this.equalTo("objectId",e);const r=ParseObject._getRequestOptions(t);return this.first(r).then((e=>{if(e)return e;const t=new ParseError(ParseError.OBJECT_NOT_FOUND,"Object not found.");return Promise.reject(t)}))}find(e){const t=ParseObject._getRequestOptions(e);this._setRequestTask(t);const r=CoreManager.getQueryController(),i=this._select;return this._queriesLocalDatastore?this._handleOfflineQuery(this.toJSON()):r.find(this.className,this.toJSON(),t).then((e=>{if(this._explain)return e.results;const r=e.results?.map((r=>{const n=e.className||this.className;return r.className||(r.className=n),i&&handleSelectResult(r,i),t.json?r:ParseObject.fromJSON(r,!i)})),n=e.count;return"number"==typeof n?{results:r,count:n}:r}))}async findAll(e){let t=[];return await this.eachBatch((e=>{t=[...t,...e]}),e),t}count(e){e=e||{};const t=ParseObject._getRequestOptions(e);this._setRequestTask(t);const r=CoreManager.getQueryController(),i=this.toJSON();return i.limit=0,i.count=1,r.find(this.className,i,t).then((e=>e.count))}distinct(e){const t={useMasterKey:!0};this._setRequestTask(t);const r={distinct:e,where:this._where,hint:this._hint};return CoreManager.getQueryController().aggregate(this.className,r,t).then((e=>e.results))}aggregate(e){if(!Array.isArray(e)&&"object"!=typeof e)throw new Error("Invalid pipeline must be Array or Object");Object.keys(this._where||{}).length&&(Array.isArray(e)||(e=[e]),e.unshift({$match:this._where}));const t={pipeline:e,hint:this._hint,explain:this._explain,readPreference:this._readPreference},r={useMasterKey:!0};this._setRequestTask(r);return CoreManager.getQueryController().aggregate(this.className,t,r).then((e=>e.results))}first(e={}){const t=ParseObject._getRequestOptions(e);this._setRequestTask(t);const r=CoreManager.getQueryController(),i=this.toJSON();i.limit=1;const n=this._select;return this._queriesLocalDatastore?this._handleOfflineQuery(i).then((e=>{if(e[0])return e[0]})):r.find(this.className,i,t).then((e=>{const r=e.results;if(r[0])return r[0].className||(r[0].className=this.className),n&&handleSelectResult(r[0],n),t.json?r[0]:ParseObject.fromJSON(r[0],!n)}))}eachBatch(e,t){if(t=t||{},this._order||this._skip||this._limit>=0){const e="Cannot iterate on a query with sort, skip, or limit.";return Promise.reject(e)}const r=ParseQuery.fromJSON(this.className,this.toJSON());r.ascending("objectId"),r._limit=t.batchSize||100;const i=ParseObject._getRequestOptions(t);let n=!1,o=[];return continueWhile((()=>!n),(async()=>{const[t]=await Promise.all([r.find(i),Promise.resolve(o.length>0&&e(o))]);t.length>=r._limit?(i.json?r.greaterThan("objectId",t[t.length-1].objectId):r.greaterThan("objectId",t[t.length-1].id),o=t):t.length>0?(await Promise.resolve(e(t)),n=!0):n=!0}))}each(e,t){return this.eachBatch((t=>{let r=Promise.resolve();return t.forEach((t=>{r=r.then((()=>e(t)))})),r}),t)}hint(e){return void 0===e&&delete this._hint,this._hint=e,this}explain(e=!0){if("boolean"!=typeof e)throw new Error("You can only set explain to a boolean value");return this._explain=e,this}async map(e,t){const r=[];let i=0;return await this.each((t=>Promise.resolve(e(t,i,this)).then((e=>{r.push(e),i+=1}))),t),r}async reduce(e,t,r){let i=t,n=0;if(await this.each((r=>0===n&&void 0===t?(i=r,void(n+=1)):Promise.resolve(e(i,r,n)).then((e=>{i=e,n+=1}))),r),0===n&&void 0===t)throw new TypeError("Reducing empty query result set with no initial value");return i}async filter(e,t){const r=[];let i=0;return await this.each((t=>Promise.resolve(e(t,i,this)).then((e=>{e&&r.push(t),i+=1}))),t),r}equalTo(e,t){return e&&"object"==typeof e?(Object.entries(e).forEach((([e,t])=>this.equalTo(e,t))),this):void 0===t?this.doesNotExist(e):(this._where[e]=encode(t,!1,!0),this)}notEqualTo(e,t){return e&&"object"==typeof e?(Object.entries(e).forEach((([e,t])=>this.notEqualTo(e,t))),this):this._addCondition(e,"$ne",t)}lessThan(e,t){return this._addCondition(e,"$lt",t)}greaterThan(e,t){return this._addCondition(e,"$gt",t)}lessThanOrEqualTo(e,t){return this._addCondition(e,"$lte",t)}greaterThanOrEqualTo(e,t){return this._addCondition(e,"$gte",t)}containedIn(e,t){return this._addCondition(e,"$in",t)}notContainedIn(e,t){return this._addCondition(e,"$nin",t)}containedBy(e,t){return this._addCondition(e,"$containedBy",t)}containsAll(e,t){return this._addCondition(e,"$all",t)}containsAllStartingWith(e,t){Array.isArray(t)||(t=[t]);const r=t.map((e=>({$regex:this._regexStartWith(e)})));return this.containsAll(e,r)}exists(e){return this._addCondition(e,"$exists",!0)}doesNotExist(e){return this._addCondition(e,"$exists",!1)}matches(e,t,r){return this._addCondition(e,"$regex",t),r||(r=""),"string"!=typeof t&&(t.ignoreCase&&(r+="i"),t.multiline&&(r+="m")),r.length&&this._addCondition(e,"$options",r),this}matchesQuery(e,t){const r=t.toJSON();return r.className=t.className,this._addCondition(e,"$inQuery",r)}doesNotMatchQuery(e,t){const r=t.toJSON();return r.className=t.className,this._addCondition(e,"$notInQuery",r)}matchesKeyInQuery(e,t,r){const i=r.toJSON();return i.className=r.className,this._addCondition(e,"$select",{key:t,query:i})}doesNotMatchKeyInQuery(e,t,r){const i=r.toJSON();return i.className=r.className,this._addCondition(e,"$dontSelect",{key:t,query:i})}contains(e,t){if("string"!=typeof t)throw new Error("The value being searched for must be a string.");return this._addCondition(e,"$regex",quote(t))}fullText(e,t,r){if(r=r||{},!e)throw new Error("A key is required.");if(!t)throw new Error("A search term is required");if("string"!=typeof t)throw new Error("The value being searched for must be a string.");const i={};i.$term=t;for(const e in r)switch(e){case"language":i.$language=r[e];break;case"caseSensitive":i.$caseSensitive=r[e];break;case"diacriticSensitive":i.$diacriticSensitive=r[e];break;default:throw new Error(`Unknown option: ${e}`)}return this._addCondition(e,"$text",{$search:i})}sortByTextScore(){return this.ascending("$score"),this.select(["$score"]),this}startsWith(e,t,r){if("string"!=typeof t)throw new Error("The value being searched for must be a string.");return this.matches(e,this._regexStartWith(t),r)}endsWith(e,t,r){if("string"!=typeof t)throw new Error("The value being searched for must be a string.");return this.matches(e,quote(t)+"$",r)}near(e,t){return t instanceof ParseGeoPoint||(t=new ParseGeoPoint(t)),this._addCondition(e,"$nearSphere",t)}withinRadians(e,t,r,i){return i||void 0===i?(this.near(e,t),this._addCondition(e,"$maxDistance",r)):this._addCondition(e,"$geoWithin",{$centerSphere:[[t.longitude,t.latitude],r]})}withinMiles(e,t,r,i){return this.withinRadians(e,t,r/3958.8,i)}withinKilometers(e,t,r,i){return this.withinRadians(e,t,r/6371,i)}withinGeoBox(e,t,r){return t instanceof ParseGeoPoint||(t=new ParseGeoPoint(t)),r instanceof ParseGeoPoint||(r=new ParseGeoPoint(r)),this._addCondition(e,"$within",{$box:[t,r]}),this}withinPolygon(e,t){return this._addCondition(e,"$geoWithin",{$polygon:t})}polygonContains(e,t){return this._addCondition(e,"$geoIntersects",{$point:t})}ascending(...e){return this._order=[],this.addAscending.apply(this,e)}addAscending(...e){return this._order||(this._order=[]),e.forEach((e=>{Array.isArray(e)&&(e=e.join()),this._order=this._order.concat(e.replace(/\s/g,"").split(","))})),this}descending(...e){return this._order=[],this.addDescending.apply(this,e)}addDescending(...e){return this._order||(this._order=[]),e.forEach((e=>{Array.isArray(e)&&(e=e.join()),this._order=this._order.concat(e.replace(/\s/g,"").split(",").map((e=>"-"+e)))})),this}skip(e){if("number"!=typeof e||e<0)throw new Error("You can only skip by a positive number");return this._skip=e,this}limit(e){if("number"!=typeof e)throw new Error("You can only set the limit to a numeric value");return this._limit=e,this}withCount(e=!0){if("boolean"!=typeof e)throw new Error("You can only set withCount to a boolean value");return this._count=e,this}include(...e){return e.forEach((e=>{Array.isArray(e)?this._include=this._include.concat(e):this._include.push(e)})),this}includeAll(){return this.include("*")}select(...e){return this._select||(this._select=[]),e.forEach((e=>{Array.isArray(e)?this._select=this._select.concat(e):this._select.push(e)})),this}exclude(...e){return e.forEach((e=>{Array.isArray(e)?this._exclude=this._exclude.concat(e):this._exclude.push(e)})),this}watch(...e){return e.forEach((e=>{Array.isArray(e)?this._watch=this._watch.concat(e):this._watch.push(e)})),this}readPreference(e,t,r){return this._readPreference=e,this._includeReadPreference=t||null,this._subqueryReadPreference=r||null,this}async subscribe(e){const t=await CoreManager.getUserController().currentUserAsync();e||(e=t&&t.getSessionToken()||void 0);const r=await CoreManager.getLiveQueryController().getDefaultLiveQueryClient();r.shouldOpen()&&r.open();const i=r.subscribe(this,e);return i.subscribePromise.then((()=>i))}static or(...e){const t=_getClassNameFromQueries(e),r=new ParseQuery(t);return r._orQuery(e),r}static and(...e){const t=_getClassNameFromQueries(e),r=new ParseQuery(t);return r._andQuery(e),r}static nor(...e){const t=_getClassNameFromQueries(e),r=new ParseQuery(t);return r._norQuery(e),r}fromNetwork(){return this._queriesLocalDatastore=!1,this._localDatastorePinName=null,this}fromLocalDatastore(){return this.fromPinWithName(null)}fromPin(){return this.fromPinWithName(DEFAULT_PIN)}fromPinWithName(e){return CoreManager.getLocalDatastore().checkIfEnabled()&&(this._queriesLocalDatastore=!0,this._localDatastorePinName=e),this}cancel(){return this._xhrRequest.task&&"function"==typeof this._xhrRequest.task.abort?(this._xhrRequest.task._aborted=!0,this._xhrRequest.task.abort(),this._xhrRequest.task=null,this._xhrRequest.onchange=()=>{},this):(this._xhrRequest.onchange=()=>this.cancel(),this)}_setRequestTask(e){e.requestTask=e=>{this._xhrRequest.task=e,this._xhrRequest.onchange()}}comment(e){if(null==e)return delete this._comment,this;if("string"!=typeof e)throw new Error("The value of a comment to be sent with this query must be a string.");return this._comment=e,this}}const DefaultController$8={find:(e,t,r)=>CoreManager.getRESTController().request("GET","classes/"+e,t,r),aggregate:(e,t,r)=>CoreManager.getRESTController().request("GET","aggregate/"+e,t,r)};CoreManager.setParseQuery(ParseQuery),CoreManager.setQueryController(DefaultController$8);const Storage={async:()=>!!CoreManager.getStorageController().async,getItem(e){const t=CoreManager.getStorageController();if(1===t.async)throw new Error("Synchronous storage is not supported by the current storage controller");return t.getItem(e)},getItemAsync(e){const t=CoreManager.getStorageController();return 1===t.async?t.getItemAsync(e):Promise.resolve(t.getItem(e))},setItem(e,t){const r=CoreManager.getStorageController();if(1===r.async)throw new Error("Synchronous storage is not supported by the current storage controller");return r.setItem(e,t)},setItemAsync(e,t){const r=CoreManager.getStorageController();return 1===r.async?r.setItemAsync(e,t):Promise.resolve(r.setItem(e,t))},removeItem(e){const t=CoreManager.getStorageController();if(1===t.async)throw new Error("Synchronous storage is not supported by the current storage controller");return t.removeItem(e)},removeItemAsync(e){const t=CoreManager.getStorageController();return 1===t.async?t.removeItemAsync(e):Promise.resolve(t.removeItem(e))},getAllKeys(){const e=CoreManager.getStorageController();if(1===e.async)throw new Error("Synchronous storage is not supported by the current storage controller");return e.getAllKeys()},getAllKeysAsync(){const e=CoreManager.getStorageController();return 1===e.async?e.getAllKeysAsync():Promise.resolve(e.getAllKeys())},generatePath(e){if(!CoreManager.get("APPLICATION_ID"))throw new Error("You need to call Parse.initialize before using Parse.");if("string"!=typeof e)throw new Error("Tried to get a Storage path that was not a String.");return"/"===e[0]&&(e=e.substr(1)),"Parse/"+CoreManager.get("APPLICATION_ID")+"/"+e},_clear(){const e=CoreManager.getStorageController();Object.hasOwn(e,"clear")&&e.clear()}},QUEUE_KEY="Parse/Eventually/Queue";let queueCache=[],dirtyCache=!0,polling;const EventuallyQueue={save(e,t){return this.enqueue("save",e,t)},destroy(e,t){return this.enqueue("destroy",e,t)},generateQueueId(e,t){t._getId();const{className:r,id:i,_localId:n}=t;return[e,r,i,t.get("hash")||n].join("_")},async enqueue(e,t,r){const i=await this.getQueue(),n=this.generateQueueId(e,t);let o=this.queueItemExists(i,n);if(o>-1)for(const e in i[o].object)void 0===t.get(e)&&t.set(e,i[o].object[e]);else o=i.length;return i[o]={queueId:n,action:e,object:t.toJSON(),serverOptions:r||{},id:t.id,className:t.className,hash:t.get("hash"),createdAt:new Date},this.setQueue(i)},store:e=>Storage.setItemAsync(QUEUE_KEY,JSON.stringify(e)),load:()=>Storage.getItemAsync(QUEUE_KEY),async getQueue(){return dirtyCache&&(queueCache=JSON.parse(await this.load()||"[]"),dirtyCache=!1),queueCache},setQueue(e){return queueCache=e,this.store(queueCache)},async remove(e){const t=await this.getQueue(),r=this.queueItemExists(t,e);r>-1&&(t.splice(r,1),await this.setQueue(t))},clear(){return queueCache=[],this.store([])},queueItemExists:(e,t)=>e.findIndex((e=>e.queueId===t)),async length(){return(await this.getQueue()).length},async sendQueue(){const e=[...await this.getQueue()];if(0===e.length)return!1;for(let t=0;t<e.length;t+=1){const r=e[t],{id:i,hash:n,className:o}=r,s=ParseObject.extend(o);i?await this.process.byId(s,r):n?await this.process.byHash(s,r):await this.process.create(s,r)}return!0},async sendQueueCallback(e,t){if(!e)return this.remove(t.queueId);switch(t.action){case"save":if(void 0!==e.updatedAt&&e.updatedAt>new Date(t.object.createdAt))return this.remove(t.queueId);try{await e.save(t.object,t.serverOptions),await this.remove(t.queueId)}catch(e){e.code!==ParseError.CONNECTION_FAILED&&await this.remove(t.queueId)}break;case"destroy":try{await e.destroy(t.serverOptions),await this.remove(t.queueId)}catch(e){e.code!==ParseError.CONNECTION_FAILED&&await this.remove(t.queueId)}}},poll(e){polling||(polling=setInterval((()=>{CoreManager.getRESTController().request("GET","health").then((({status:e})=>{if("ok"===e)return this.stopPoll(),this.sendQueue()})).catch((e=>e))}),e||2e3))},stopPoll(){clearInterval(polling),polling=void 0},isPolling:()=>!!polling,_setPolling(e){polling=e},process:{create(e,t){const r=new e;return EventuallyQueue.sendQueueCallback(r,t)},async byId(e,t){const{sessionToken:r}=t.serverOptions,i=new ParseQuery(e);i.equalTo("objectId",t.id);const n=await i.find({sessionToken:r});return EventuallyQueue.sendQueueCallback(n[0],t)},async byHash(e,t){const{sessionToken:r}=t.serverOptions,i=new ParseQuery(e);i.equalTo("hash",t.hash);const n=await i.find({sessionToken:r});return n.length>0?EventuallyQueue.sendQueueCallback(n[0],t):EventuallyQueue.process.create(e,t)}}};function promisifyRequest(e){return new Promise(((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)}))}function createStore(e,t){let r;return(i,n)=>(()=>{if(r)return r;const i=indexedDB.open(e);return i.onupgradeneeded=()=>i.result.createObjectStore(t),r=promisifyRequest(i),r.then((e=>{e.onclose=()=>r=void 0}),(()=>{})),r})().then((e=>n(e.transaction(t,i).objectStore(t))))}let defaultGetStoreFunc,IndexedDBStorageController$1;function defaultGetStore(){return defaultGetStoreFunc||(defaultGetStoreFunc=createStore("keyval-store","keyval")),defaultGetStoreFunc}function get(e,t=defaultGetStore()){return t("readonly",(t=>promisifyRequest(t.get(e))))}function set(e,t,r=defaultGetStore()){return r("readwrite",(r=>(r.put(t,e),promisifyRequest(r.transaction))))}function del(e,t=defaultGetStore()){return t("readwrite",(t=>(t.delete(e),promisifyRequest(t.transaction))))}function clear(e=defaultGetStore()){return e("readwrite",(e=>(e.clear(),promisifyRequest(e.transaction))))}function eachCursor(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},promisifyRequest(e.transaction)}function keys(e=defaultGetStore()){return e("readonly",(e=>{if(e.getAllKeys)return promisifyRequest(e.getAllKeys());const t=[];return eachCursor(e,(e=>t.push(e.key))).then((()=>t))}))}if("undefined"!=typeof window&&window.indexedDB)try{const e=createStore("parseDB","parseStore");IndexedDBStorageController$1={async:1,getItemAsync:t=>get(t,e),setItemAsync:(t,r)=>set(t,r,e),removeItemAsync:t=>del(t,e),getAllKeysAsync:()=>keys(e),clear:()=>clear(e)}}catch(e){IndexedDBStorageController$1=void 0}else IndexedDBStorageController$1=void 0;const IndexedDBStorageController=IndexedDBStorageController$1,DEVICE_TYPES={IOS:"ios",MACOS:"macos",TVOS:"tvos",FCM:"fcm",ANDROID:"android",WEB:"web"};class ParseInstallation extends ParseObject{constructor(e){if(super("_Installation"),e&&"object"==typeof e)try{this.set(e||{})}catch(e){throw new Error("Can't create an invalid Installation")}}get appIdentifier(){return this.get("appIdentifier")}get appVersion(){return this.get("appVersion")}get appName(){return this.get("appName")}get badge(){return this.get("badge")}get channels(){return this.get("channels")}get deviceToken(){return this.get("deviceToken")}get deviceType(){return this.get("deviceType")}get GCMSenderId(){return this.get("GCMSenderId")}get installationId(){return this.get("installationId")}get localeIdentifier(){return this.get("localeIdentifier")}get parseVersion(){return this.get("parseVersion")}get pushType(){return this.get("pushType")}get timeZone(){return this.get("timeZone")}static get DEVICE_TYPES(){return DEVICE_TYPES}async fetch(...e){try{await super.fetch.apply(this,e)}catch(t){if(t.code!==ParseError.OBJECT_NOT_FOUND)throw t;delete this.id,this._getId(),this._markAllFieldsDirty(),await super.save.apply(this,e)}return await CoreManager.getInstallationController().updateInstallationOnDisk(this),this}async save(...e){try{await super.save.apply(this,e)}catch(t){if(t.code!==ParseError.OBJECT_NOT_FOUND)throw t;delete this.id,this._getId(),this._markAllFieldsDirty(),await super.save.apply(this,e)}return await CoreManager.getInstallationController().updateInstallationOnDisk(this),this}_markAllFieldsDirty(){for(const[e,t]of Object.entries(this.attributes))this.set(e,t)}static currentInstallation(){return CoreManager.getInstallationController().currentInstallation()}}ParseObject.registerSubclass("_Installation",ParseInstallation);const CURRENT_INSTALLATION_KEY="currentInstallation",CURRENT_INSTALLATION_ID_KEY="currentInstallationId";let iidCache=null,currentInstallationCache=null,currentInstallationCacheMatchesDisk=!1;const InstallationController={async updateInstallationOnDisk(e){const t=Storage.generatePath(CURRENT_INSTALLATION_KEY);await Storage.setItemAsync(t,JSON.stringify(e.toJSON())),this._setCurrentInstallationCache(e)},async currentInstallationId(){if("string"==typeof iidCache)return iidCache;const e=Storage.generatePath(CURRENT_INSTALLATION_ID_KEY);let t=await Storage.getItemAsync(e);return t?(iidCache=t,t):(t=uuidv4(),Storage.setItemAsync(e,t).then((()=>(iidCache=t,t))))},async currentInstallation(){if(currentInstallationCache)return currentInstallationCache;if(currentInstallationCacheMatchesDisk)return null;const e=Storage.generatePath(CURRENT_INSTALLATION_KEY);let t=await Storage.getItemAsync(e);if(currentInstallationCacheMatchesDisk=!0,t){t=JSON.parse(t),t.className="_Installation";const e=ParseInstallation.fromJSON(t);return currentInstallationCache=e,e}const r=await this.currentInstallationId(),i=new ParseInstallation;return i.set("deviceType",ParseInstallation.DEVICE_TYPES.WEB),i.set("installationId",r),i.set("parseVersion",CoreManager.get("VERSION")),currentInstallationCache=i,await Storage.setItemAsync(e,JSON.stringify(i.toJSON())),i},_clearCache(){iidCache=null,currentInstallationCache=null,currentInstallationCacheMatchesDisk=!1},_setInstallationIdCache(e){iidCache=e},_setCurrentInstallationCache(e,t=!0){currentInstallationCache=e,currentInstallationCacheMatchesDisk=t}};let useXDomainRequest=!1;function getPath(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),t.startsWith("/")||(t="/"+t),e+t}function ajaxIE9(e,t,r,i,n){return new Promise(((i,o)=>{const s=new XDomainRequest;s.onload=function(){let e;try{e=JSON.parse(s.responseText)}catch(e){o(e)}e&&i({response:e})},s.onerror=s.ontimeout=function(){const e={responseText:JSON.stringify({code:ParseError.X_DOMAIN_REQUEST,error:"IE's XDomainRequest does not supply error info."})};o(e)},s.onprogress=function(){n&&"function"==typeof n.progress&&n.progress(s.responseText)},s.open(e,t),s.send(r),n&&"function"==typeof n.requestTask&&n.requestTask(s)}))}"undefined"==typeof XDomainRequest||"withCredentials"in new XMLHttpRequest||(useXDomainRequest=!0);const RESTController={async ajax(e,t,r,i,n){if(useXDomainRequest)return ajaxIE9(e,t,r,i,n);if("function"!=typeof fetch)throw new Error("Cannot make a request: Fetch API not found.");const o=resolvingPromise(),s=CoreManager.get("IDEMPOTENCY")&&["POST","PUT"].includes(e),a=s?uuidv4():"";let u=0;const h=async function(){const f=new AbortController,{signal:l}=f;"string"!=typeof(i=i||{})["Content-Type"]&&(i["Content-Type"]="text/plain"),CoreManager.get("IS_NODE")&&(i["User-Agent"]="Parse/"+CoreManager.get("VERSION")+" (NodeJS "+process$1.versions.node+")"),s&&(i["X-Parse-Request-Id"]=a);const c=CoreManager.get("REQUEST_HEADERS");for(const e in c)i[e]=c[e];n&&"function"==typeof n.requestTask&&n.requestTask(f);try{const s={method:e,headers:i,signal:l,redirect:"manual"};r&&(s.body=r,"undefined"!=typeof ReadableStream&&r instanceof ReadableStream&&(s.duplex="half"));const a=await fetch(t,s),{status:f}=a;if(f>=200&&f<300){let e;const t={};if((a.headers.get("access-control-expose-headers")||"").split(", ").forEach((e=>{e&&a.headers.has(e)&&(t[e]=a.headers.get(e))})),n&&"function"==typeof n.progress&&a.body){const t=a.body.getReader(),r=+a.headers.get("Content-Length")||0;if(0===r)n.progress(null,null,null),e=await a.json();else{let i=0;const o=[];for(;;){const{done:e,value:s}=await t.read();if(e)break;o.push(s),i+=s?.length||0,n.progress(i/r,i,r)}const s=new Uint8Array(i);let a=0;for(const e of o)s.set(e,a),a+=e.length;const u=(new TextDecoder).decode(s);e=JSON.parse(u)}}else e=await a.json();o.resolve({status:f,response:e,headers:t})}else if(f>=400&&f<500){const e=await a.json();o.reject(e)}else if([301,302,303,307,308].includes(f)){const t=a.headers.get("location");o.resolve({status:f,location:t,method:303===f?"GET":e,dropBody:303===f})}else if(f>=500||0===f){if(!("undefined"!=typeof ReadableStream&&r instanceof ReadableStream)&&++u<CoreManager.get("REQUEST_ATTEMPT_LIMIT")){const e=Math.round(125*Math.random()*Math.pow(2,u));setTimeout(h,e)}else if(0===f)o.reject("Unable to connect to the Parse API");else{const e=await a.json();o.reject(e)}}else o.reject(a)}catch(e){"AbortError"===e.name?o.resolve({response:{results:[]},status:0}):"ECONNREFUSED"===e.cause?.code?o.reject("Unable to connect to the Parse API"):o.reject(e)}};return h(),o},request(e,t,r,i){i=i||{};const n=getPath(CoreManager.get("SERVER_URL"),t),o={};if(r&&"object"==typeof r)for(const e in r)o[e]=r[e];const s=i.context;void 0!==s&&(o._context=s),"POST"!==e&&(o._method=e,e="POST"),o._ApplicationId=CoreManager.get("APPLICATION_ID");const a=CoreManager.get("JAVASCRIPT_KEY");a&&(o._JavaScriptKey=a),o._ClientVersion=CoreManager.get("VERSION");let u=i.useMasterKey;if(void 0===u&&(u=CoreManager.get("USE_MASTER_KEY")),u){if(!CoreManager.get("MASTER_KEY"))throw new Error("Cannot use the Master Key, it has not been provided.");delete o._JavaScriptKey,o._MasterKey=CoreManager.get("MASTER_KEY")}i.useMaintenanceKey&&(o._MaintenanceKey=CoreManager.get("MAINTENANCE_KEY")),CoreManager.get("FORCE_REVOCABLE_SESSION")&&(o._RevocableSession="1");const h=i.installationId;let f;if(h&&"string"==typeof h)f=Promise.resolve(h);else{f=CoreManager.getInstallationController().currentInstallationId()}return f.then((e=>{o._InstallationId=e;const t=CoreManager.getUserController();return i&&"string"==typeof i.sessionToken?Promise.resolve(i.sessionToken):t?t.currentUserAsync().then((e=>e?Promise.resolve(e.getSessionToken()):Promise.resolve(null))):Promise.resolve(null)})).then((r=>{r&&(o._SessionToken=r);const s=JSON.stringify(o);return RESTController.ajax(e,n,s,{},i).then((async e=>{if(e.location){let r=getPath(e.location,t),n=e.method,o=e.dropBody?void 0:s;for(let a=0;a<5;a+=1){const a=await RESTController.ajax(n,r,o,{},i);if(!a.location){e=a;break}r=getPath(a.location,t),n=a.method,o=a.dropBody?void 0:s}}const{response:r,status:n,headers:o}=e;return i.returnStatus?{...r,_status:n,_headers:o}:r}))})).catch(RESTController.handleError)},handleError(e){let t;return t=e.code||e.error||e.message?new ParseError(e.code,e.error||e.message):new ParseError(ParseError.CONNECTION_FAILED,"XMLHttpRequest failed: "+JSON.stringify(e)),Promise.reject(t)}};function track(e,t){if(0===(e=(e=(e=e||"").replace(/^\s*/,"")).replace(/\s*$/,"")).length)throw new TypeError("A name for the custom event must be provided");for(const e in t)if("string"!=typeof e||"string"!=typeof t[e])throw new TypeError('track() dimensions expects keys and values of type "string".');return CoreManager.getAnalyticsController().track(e,t)}const DefaultController$7={track(e,t){const r="events/"+e;return CoreManager.getRESTController().request("POST",r,{dimensions:t})}};CoreManager.setAnalyticsController(DefaultController$7);const Analytics=Object.freeze(Object.defineProperty({__proto__:null,track:track},Symbol.toStringTag,{value:"Module"}));function isRevocableSession(e){return e.indexOf("r:")>-1}const CURRENT_USER_KEY="currentUser";let canUseCurrentUser=!CoreManager.get("IS_NODE"),currentUserCacheMatchesDisk=!1,currentUserCache=null;const authProviders={};class ParseUser extends ParseObject{constructor(e){if(super("_User"),e&&"object"==typeof e)try{this.set(e||{})}catch(e){throw new Error("Can't create an invalid Parse User")}}_upgradeToRevocableSession(e){const t=ParseObject._getRequestOptions(e);return CoreManager.getUserController().upgradeToRevocableSession(this,t)}linkWith(e,t,r={}){let i;if(r.sessionToken=r.sessionToken||this.getSessionToken()||"","string"==typeof e)if(i=e,authProviders[e])e=authProviders[e];else{const t={restoreAuthentication:()=>!0,getAuthType:()=>i};authProviders[t.getAuthType()]=t,e=t}else i=e.getAuthType();if(t&&Object.hasOwn(t,"authData")){const e=this.get("authData")||{};if("object"!=typeof e)throw new Error("Invalid type: authData field should be an object");e[i]=t.authData;const n=e.anonymous;this.stripAnonymity();return CoreManager.getUserController().linkWith(this,e,r).catch((t=>{throw delete e[i],this.restoreAnonimity(n),t}))}return new Promise(((t,i)=>{e.authenticate({success:(e,n)=>{const o={};o.authData=n,this.linkWith(e,o,r).then((()=>{t(this)}),(e=>{i(e)}))},error:(e,t)=>{i(t)}})}))}_linkWith(e,t,r={}){return this.linkWith(e,t,r)}_synchronizeAuthData(e){if(!this.isCurrent()||!e)return;let t;"string"==typeof e?(t=e,e=authProviders[t]):t=e.getAuthType();const r=this.get("authData");if(!e||!r||"object"!=typeof r)return;e.restoreAuthentication(r[t])||this._unlinkFrom(e)}_synchronizeAllAuthData(){const e=this.get("authData");if("object"==typeof e)for(const t in e)this._synchronizeAuthData(t)}_cleanupAuthData(){if(!this.isCurrent())return;const e=this.get("authData");if("object"==typeof e)for(const t in e)e[t]||delete e[t]}_unlinkFrom(e,t){return this.linkWith(e,{authData:null},t).then((()=>(this._synchronizeAuthData(e),Promise.resolve(this))))}_isLinked(e){let t;t="string"==typeof e?e:e.getAuthType();const r=this.get("authData")||{};return"object"==typeof r&&!!r[t]}_logOutWithAll(){const e=this.get("authData");if("object"==typeof e)for(const t in e)this._logOutWith(t)}_logOutWith(e){this.isCurrent()&&("string"==typeof e&&(e=authProviders[e]),e&&e.deauthenticate&&e.deauthenticate())}_preserveFieldsOnFetch(){return{sessionToken:this.get("sessionToken")}}isCurrent(){const e=ParseUser.current();return!!e&&e.id===this.id}async isCurrentAsync(){const e=await ParseUser.currentAsync();return!!e&&e.id===this.id}stripAnonymity(){const e=this.get("authData");e&&"object"==typeof e&&Object.hasOwn(e,"anonymous")&&(e.anonymous=null)}restoreAnonimity(e){if(e){this.get("authData").anonymous=e}}getUsername(){const e=this.get("username");return null==e||"string"==typeof e?e:""}setUsername(e){this.stripAnonymity(),this.set("username",e)}setPassword(e){this.set("password",e)}getEmail(){const e=this.get("email");return null==e||"string"==typeof e?e:""}setEmail(e){return this.set("email",e)}getSessionToken(){const e=this.get("sessionToken");return null==e||"string"==typeof e?e:""}authenticated(){const e=ParseUser.current();return!!this.get("sessionToken")&&!!e&&e.id===this.id}signUp(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getUserController().signUp(this,e,r)}logIn(e={}){const t=ParseObject._getRequestOptions(e);Object.hasOwn(t,"usePost")||(t.usePost=!0);return CoreManager.getUserController().logIn(this,t)}async save(...e){await super.save.apply(this,e);return await this.isCurrentAsync()?CoreManager.getUserController().updateUserOnDisk(this):this}async destroy(...e){await super.destroy.apply(this,e);return await this.isCurrentAsync()?CoreManager.getUserController().removeUserFromDisk():this}async fetch(...e){await super.fetch.apply(this,e);return await this.isCurrentAsync()?CoreManager.getUserController().updateUserOnDisk(this):this}async fetchWithInclude(...e){await super.fetchWithInclude.apply(this,e);return await this.isCurrentAsync()?CoreManager.getUserController().updateUserOnDisk(this):this}verifyPassword(e,t){const r=this.getUsername()||"";return ParseUser.verifyPassword(r,e,t)}static readOnlyAttributes(){return["sessionToken"]}static extend(e,t){if(e)for(const t in e)"className"!==t&&Object.defineProperty(ParseUser.prototype,t,{value:e[t],enumerable:!1,writable:!0,configurable:!0});if(t)for(const e in t)"className"!==e&&Object.defineProperty(ParseUser,e,{value:t[e],enumerable:!1,writable:!0,configurable:!0});return ParseUser}static current(){if(!canUseCurrentUser)return null;return CoreManager.getUserController().currentUser()}static currentAsync(){if(!canUseCurrentUser)return Promise.resolve(null);return CoreManager.getUserController().currentUserAsync()}static signUp(e,t,r,i){(r=r||{}).username=e,r.password=t;return new this(r).signUp({},i)}static logIn(e,t,r){if("string"!=typeof e)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Username must be a string."));if("string"!=typeof t)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Password must be a string."));const i=new this;return i._finishFetch({username:e,password:t}),i.logIn(r)}static logInWithAdditionalAuth(e,t,r,i){if("string"!=typeof e)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Username must be a string."));if("string"!=typeof t)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Password must be a string."));if("[object Object]"!==Object.prototype.toString.call(r))return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Auth must be an object."));const n=new this;return n._finishFetch({username:e,password:t,authData:r}),n.logIn(i)}static loginAs(e){if(!e)throw new ParseError(ParseError.USERNAME_MISSING,"Cannot log in as user with an empty user id");const t=CoreManager.getUserController(),r=new this;return t.loginAs(r,e)}static become(e,t){if(!canUseCurrentUser)throw new Error("It is not memory-safe to become a user in a server environment");const r=ParseObject._getRequestOptions(t);r.sessionToken=e;const i=CoreManager.getUserController(),n=new this;return i.become(n,r)}static me(e,t){const r=CoreManager.getUserController(),i=ParseObject._getRequestOptions(t);i.sessionToken=e;const n=new this;return r.me(n,i)}static hydrate(e){const t=CoreManager.getUserController(),r=new this;return t.hydrate(r,e)}static logInWith(e,t,r){return(new this).linkWith(e,t,r)}static logOut(e){return CoreManager.getUserController().logOut(e)}static requestPasswordReset(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getUserController().requestPasswordReset(e,r)}static requestEmailVerification(e,t){const r=ParseObject._getRequestOptions(t);return CoreManager.getUserController().requestEmailVerification(e,r)}static verifyPassword(e,t,r){if("string"!=typeof e)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Username must be a string."));if("string"!=typeof t)return Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Password must be a string."));return CoreManager.getUserController().verifyPassword(e,t,r||{})}static allowCustomUserClass(e){CoreManager.set("PERFORM_USER_REWRITE",!e)}static enableRevocableSession(e){if(e=e||{},CoreManager.set("FORCE_REVOCABLE_SESSION",!0),canUseCurrentUser){const t=ParseUser.current();if(t)return t._upgradeToRevocableSession(e)}return Promise.resolve()}static enableUnsafeCurrentUser(){canUseCurrentUser=!0}static disableUnsafeCurrentUser(){canUseCurrentUser=!1}static _registerAuthenticationProvider(e){authProviders[e.getAuthType()]=e,ParseUser.currentAsync().then((t=>{t&&t._synchronizeAuthData(e.getAuthType())}))}static _logInWith(e,t,r){return(new this).linkWith(e,t,r)}static _clearCache(){currentUserCache=null,currentUserCacheMatchesDisk=!1}static _setCurrentUserCache(e){currentUserCache=e}}ParseObject.registerSubclass("_User",ParseUser);const DefaultController$6={updateUserOnDisk(e){const t=Storage.generatePath(CURRENT_USER_KEY),r=e.toJSON();delete r.password,r.className="_User";let i=JSON.stringify(r);if(CoreManager.get("ENCRYPTED_USER")){i=CoreManager.getCryptoController().encrypt(r,CoreManager.get("ENCRYPTED_KEY"))}return Storage.setItemAsync(t,i).then((()=>e))},removeUserFromDisk(){const e=Storage.generatePath(CURRENT_USER_KEY);return currentUserCacheMatchesDisk=!0,currentUserCache=null,Storage.removeItemAsync(e)},setCurrentUser:e=>(currentUserCache=e,e._cleanupAuthData(),e._synchronizeAllAuthData(),DefaultController$6.updateUserOnDisk(e)),currentUser(){if(currentUserCache)return currentUserCache;if(currentUserCacheMatchesDisk)return null;if(Storage.async())throw new Error("Cannot call currentUser() when using a platform with an async storage system. Call currentUserAsync() instead.");const e=Storage.generatePath(CURRENT_USER_KEY);let t=Storage.getItem(e);if(currentUserCacheMatchesDisk=!0,!t)return currentUserCache=null,null;if(CoreManager.get("ENCRYPTED_USER")){t=CoreManager.getCryptoController().decrypt(t,CoreManager.get("ENCRYPTED_KEY"))}t=JSON.parse(t),t.className||(t.className="_User"),t._id&&(t.objectId!==t._id&&(t.objectId=t._id),delete t._id),t._sessionToken&&(t.sessionToken=t._sessionToken,delete t._sessionToken);const r=ParseObject.fromJSON(t);return currentUserCache=r,r._synchronizeAllAuthData(),r},currentUserAsync(){if(currentUserCache)return Promise.resolve(currentUserCache);if(currentUserCacheMatchesDisk)return Promise.resolve(null);const e=Storage.generatePath(CURRENT_USER_KEY);return Storage.getItemAsync(e).then((e=>{if(currentUserCacheMatchesDisk=!0,!e)return currentUserCache=null,Promise.resolve(null);if(CoreManager.get("ENCRYPTED_USER")){e=CoreManager.getCryptoController().decrypt(e.toString(),CoreManager.get("ENCRYPTED_KEY"))}(e=JSON.parse(e)).className||(e.className="_User"),e._id&&(e.objectId!==e._id&&(e.objectId=e._id),delete e._id),e._sessionToken&&(e.sessionToken=e._sessionToken,delete e._sessionToken);const t=ParseObject.fromJSON(e);return currentUserCache=t,t._synchronizeAllAuthData(),Promise.resolve(t)}))},signUp(e,t,r){const i=t&&t.username||e.get("username"),n=t&&t.password||e.get("password");return i&&i.length?n&&n.length?e.save(t,r).then((()=>(e._finishFetch({password:void 0}),canUseCurrentUser?DefaultController$6.setCurrentUser(e):e))):Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Cannot sign up user with an empty password.")):Promise.reject(new ParseError(ParseError.OTHER_CAUSE,"Cannot sign up user with an empty username."))},logIn(e,t){const r=CoreManager.getRESTController(),i=CoreManager.getObjectStateController(),n={username:e.get("username"),password:e.get("password"),authData:e.get("authData")};return r.request(t.usePost?"POST":"GET","login",n,t).then((t=>(e._migrateId(t.objectId),e._setExisted(!0),i.setPendingOp(e._getStateIdentifier(),"username",void 0),i.setPendingOp(e._getStateIdentifier(),"password",void 0),t.password=void 0,e._finishFetch(t),canUseCurrentUser?DefaultController$6.setCurrentUser(e):Promise.resolve(e))))},loginAs:(e,t)=>CoreManager.getRESTController().request("POST","loginAs",{userId:t},{useMasterKey:!0}).then((t=>(e._finishFetch(t),e._setExisted(!0),canUseCurrentUser?DefaultController$6.setCurrentUser(e):Promise.resolve(e)))),become:(e,t)=>CoreManager.getRESTController().request("GET","users/me",{},t).then((t=>(e._finishFetch(t),e._setExisted(!0),DefaultController$6.setCurrentUser(e)))),hydrate:(e,t)=>(e._finishFetch(t),e._setExisted(!0),t.sessionToken&&canUseCurrentUser?DefaultController$6.setCurrentUser(e):Promise.resolve(e)),me:(e,t)=>CoreManager.getRESTController().request("GET","users/me",{},t).then((t=>(e._finishFetch(t),e._setExisted(!0),e))),logOut(e){const t=CoreManager.getRESTController();return e?.sessionToken?t.request("POST","logout",{},e):DefaultController$6.currentUserAsync().then((e=>{const r=Storage.generatePath(CURRENT_USER_KEY);let i=Storage.removeItemAsync(r);if(null!==e){const r=e.getSessionToken();r&&isRevocableSession(r)&&(i=i.then((()=>t.request("POST","logout",{},{sessionToken:r})))),e._logOutWithAll(),e._finishFetch({sessionToken:void 0})}return currentUserCacheMatchesDisk=!0,currentUserCache=null,i}))},requestPasswordReset:(e,t)=>CoreManager.getRESTController().request("POST","requestPasswordReset",{email:e},t),async upgradeToRevocableSession(e,t){const r=e.getSessionToken();if(!r)return Promise.reject(new ParseError(ParseError.SESSION_MISSING,"Cannot upgrade a user with no session token"));t.sessionToken=r;const i=CoreManager.getRESTController(),n=await i.request("POST","upgradeToRevocableSession",{},t);e._finishFetch({sessionToken:n?.sessionToken||""});return await e.isCurrentAsync()?DefaultController$6.setCurrentUser(e):Promise.resolve(e)},linkWith:(e,t,r)=>e.save({authData:t},r).then((()=>canUseCurrentUser?DefaultController$6.setCurrentUser(e):e)),verifyPassword(e,t,r){const i=CoreManager.getRESTController(),n={username:e,password:t,...void 0!==r.ignoreEmailVerification&&{ignoreEmailVerification:r.ignoreEmailVerification}};return i.request("GET","verifyPassword",n,r)},requestEmailVerification:(e,t)=>CoreManager.getRESTController().request("POST","verificationEmailRequest",{email:e},t)};CoreManager.setParseUser(ParseUser),CoreManager.setUserController(DefaultController$6);let registered=!1;const AnonymousUtils={isLinked(e){const t=this._getAuthProvider();return e._isLinked(t.getAuthType())},logIn(e){const t=this._getAuthProvider();return ParseUser.logInWith(t.getAuthType(),t.getAuthData(),e)},link(e,t){const r=this._getAuthProvider();return e.linkWith(r.getAuthType(),r.getAuthData(),t)},isRegistered:()=>registered,_getAuthProvider(){const e={restoreAuthentication:()=>!0,getAuthType:()=>"anonymous",getAuthData:()=>({authData:{id:uuidv4()}})};return registered||(ParseUser._registerAuthenticationProvider(e),registered=!0),e}};function run(e,t,r){if("string"!=typeof e||0===e.length)throw new TypeError("Cloud function name must be a string.");const i=ParseObject._getRequestOptions(r);return CoreManager.getCloudController().run(e,t,i)}function getJobsData(){return CoreManager.getCloudController().getJobsData({useMasterKey:!0})}function startJob(e,t){if("string"!=typeof e||0===e.length)throw new TypeError("Cloud job name must be a string.");return CoreManager.getCloudController().startJob(e,t,{useMasterKey:!0})}function getJobStatus(e){return new ParseQuery("_JobStatus").get(e,{useMasterKey:!0})}const DefaultController$5={run(e,t,r){const i=CoreManager.getRESTController(),n=encode(t,!0);return i.request("POST","functions/"+e,n,r).then((e=>{if("object"==typeof e&&Object.keys(e).length>0&&!Object.hasOwn(e,"result"))throw new ParseError(ParseError.INVALID_JSON,"The server returned an invalid response.");const t=decode(e);return t&&Object.hasOwn(t,"result")?Promise.resolve(t.result):Promise.resolve(void 0)}))},getJobsData:e=>CoreManager.getRESTController().request("GET","cloud_code/jobs/data",null,e),async startJob(e,t,r){const i=CoreManager.getRESTController(),n=encode(t,!0);r.returnStatus=!0;const o=await i.request("POST","jobs/"+e,n,r);return o._headers?.["X-Parse-Job-Status-Id"]}};CoreManager.setCloudController(DefaultController$5);const Cloud=Object.freeze(Object.defineProperty({__proto__:null,getJobStatus:getJobStatus,getJobsData:getJobsData,run:run,startJob:startJob},Symbol.toStringTag,{value:"Module"}));class ParseRole extends ParseObject{constructor(e,t){super("_Role"),"string"==typeof e&&t instanceof ParseACL&&(this.setName(e),this.setACL(t))}getName(){const e=this.get("name");return null==e||"string"==typeof e?e:""}setName(e,t){return this._validateName(e),this.set("name",e,t)}getUsers(){return this.relation("users")}getRoles(){return this.relation("roles")}_validateName(e){if("string"!=typeof e)throw new ParseError(ParseError.OTHER_CAUSE,"A role's name must be a String.");if(!/^[0-9a-zA-Z\-_ ]+$/.test(e))throw new ParseError(ParseError.OTHER_CAUSE,"A role's name can be only contain alphanumeric characters, _, -, and spaces.")}validate(e,t){const r=super.validate(e,t);if(r)return r;if("name"in e&&e.name!==this.getName()){const t=e.name;if(this.id&&this.id!==e.objectId)return new ParseError(ParseError.OTHER_CAUSE,"A role's name can only be set before it has been saved.");try{this._validateName(t)}catch(e){return e}}return!1}}CoreManager.setParseRole(ParseRole),ParseObject.registerSubclass("_Role",ParseRole);const PUBLIC_KEY="*",VALID_PERMISSIONS=new Map;VALID_PERMISSIONS.set("get",{}),VALID_PERMISSIONS.set("find",{}),VALID_PERMISSIONS.set("count",{}),VALID_PERMISSIONS.set("create",{}),VALID_PERMISSIONS.set("update",{}),VALID_PERMISSIONS.set("delete",{}),VALID_PERMISSIONS.set("addField",{});const VALID_PERMISSIONS_EXTENDED=new Map;VALID_PERMISSIONS_EXTENDED.set("protectedFields",{});class ParseCLP{constructor(e){this.permissionsMap={};for(const[e,t]of VALID_PERMISSIONS.entries()){this.permissionsMap[e]=Object.assign({},t);const r=e.charAt(0).toUpperCase()+e.slice(1);this[`get${r}RequiresAuthentication`]=function(){return this._getAccess(e,"requiresAuthentication")},this[`set${r}RequiresAuthentication`]=function(t){this._setAccess(e,"requiresAuthentication",t)},this[`get${r}PointerFields`]=function(){return this._getAccess(e,"pointerFields",!1)},this[`set${r}PointerFields`]=function(t){this._setArrayAccess(e,"pointerFields",t)},this[`get${r}Access`]=function(t){return this._getAccess(e,t)},this[`set${r}Access`]=function(t,r){this._setAccess(e,t,r)},this[`getPublic${r}Access`]=function(){return this[`get${r}Access`](PUBLIC_KEY)},this[`setPublic${r}Access`]=function(e){this[`set${r}Access`](PUBLIC_KEY,e)},this[`getRole${r}Access`]=function(e){return this[`get${r}Access`](this._getRoleName(e))},this[`setRole${r}Access`]=function(e,t){this[`set${r}Access`](this._getRoleName(e),t)}}for(const[e,t]of VALID_PERMISSIONS_EXTENDED.entries())this.permissionsMap[e]=Object.assign({},t);if(e&&"object"==typeof e)if(e instanceof ParseUser)this.setReadAccess(e,!0),this.setWriteAccess(e,!0);else if(e instanceof ParseRole)this.setRoleReadAccess(e,!0),this.setRoleWriteAccess(e,!0);else for(const t in e){const r=e[t],i=!!VALID_PERMISSIONS.get(t),n=!!VALID_PERMISSIONS_EXTENDED.get(t),o=["readUserFields","writeUserFields"].includes(t);if("string"!=typeof t||!(i||n||o))throw new TypeError("Tried to create an CLP with an invalid permission type.");if(o){if(r.every((e=>"string"==typeof e))){this.permissionsMap[t]=r;continue}throw new TypeError("Tried to create an CLP with an invalid permission value.")}for(const e in r){const i=r[e];if("boolean"!=typeof i&&!n&&"pointerFields"!==e)throw new TypeError("Tried to create an CLP with an invalid permission value.");this.permissionsMap[t][e]=i}}else if("function"==typeof e)throw new TypeError("ParseCLP constructed with a function. Did you forget ()?")}toJSON(){return{...this.permissionsMap}}equals(e){if(!(e instanceof ParseCLP))return!1;const t=Object.keys(this.permissionsMap),r=Object.keys(e.permissionsMap);if(t.length!==r.length)return!1;for(const t in this.permissionsMap){if(!e.permissionsMap[t])return!1;const r=Object.keys(this.permissionsMap[t]),i=Object.keys(e.permissionsMap[t]);if(r.length!==i.length)return!1;for(const r in this.permissionsMap[t]){if(!e.permissionsMap[t][r])return!1;if(this.permissionsMap[t][r]!==e.permissionsMap[t][r])return!1}}return!0}_getRoleName(e){let t=e;if(e instanceof ParseRole&&(t=e.getName()),"string"!=typeof t)throw new TypeError("role must be a Parse.Role or a String");return`role:${t}`}_parseEntity(e){let t=e;if(t instanceof ParseUser){if(t=t.id,!t)throw new Error("Cannot get access for a Parse.User without an id.")}else t instanceof ParseRole&&(t=this._getRoleName(t));if("string"!=typeof t)throw new TypeError("userId must be a string.");return t}_setAccess(e,t,r){if(t=this._parseEntity(t),"boolean"!=typeof r)throw new TypeError("allowed must be either true or false.");if(!this.permissionsMap[e][t]){if(!r)return;this.permissionsMap[e][t]={}}r?this.permissionsMap[e][t]=!0:delete this.permissionsMap[e][t]}_getAccess(e,t,r=!0){t=this._parseEntity(t);const i=this.permissionsMap[e][t];return r?!!i&&!!this.permissionsMap[e][t]:i}_setArrayAccess(e,t,r){t=this._parseEntity(t);if(this.permissionsMap[e][t]||(this.permissionsMap[e][t]=[]),!r||Array.isArray(r)&&0===r.length)delete this.permissionsMap[e][t];else{if(!Array.isArray(r)||!r.every((e=>"string"==typeof e)))throw new TypeError("fields must be an array of strings or undefined.");this.permissionsMap[e][t]=r}}_setGroupPointerPermission(e,t){if(this.permissionsMap[e]||(this.permissionsMap[e]=[]),!t||Array.isArray(t)&&0===t.length)delete this.permissionsMap[e];else{if(!Array.isArray(t)||!t.every((e=>"string"==typeof e)))throw new TypeError(`${e}.pointerFields must be an array of strings or undefined.`);this.permissionsMap[e]=t}}_getGroupPointerPermissions(e){return this.permissionsMap[e]||[]}setReadUserFields(e){this._setGroupPointerPermission("readUserFields",e)}getReadUserFields(){return this._getGroupPointerPermissions("readUserFields")||[]}setWriteUserFields(e){this._setGroupPointerPermission("writeUserFields",e)}getWriteUserFields(){return this._getGroupPointerPermissions("writeUserFields")||[]}setProtectedFields(e,t){this._setArrayAccess("protectedFields",e,t)}getProtectedFields(e){return this._getAccess("protectedFields",e,!1)}setReadAccess(e,t){this._setAccess("find",e,t),this._setAccess("get",e,t),this._setAccess("count",e,t)}getReadAccess(e){return this._getAccess("find",e)&&this._getAccess("get",e)&&this._getAccess("count",e)}setWriteAccess(e,t){this._setAccess("create",e,t),this._setAccess("update",e,t),this._setAccess("delete",e,t),this._setAccess("addField",e,t)}getWriteAccess(e){return this._getAccess("create",e)&&this._getAccess("update",e)&&this._getAccess("delete",e)&&this._getAccess("addField",e)}setPublicReadAccess(e){this.setReadAccess(PUBLIC_KEY,e)}getPublicReadAccess(){return this.getReadAccess(PUBLIC_KEY)}setPublicWriteAccess(e){this.setWriteAccess(PUBLIC_KEY,e)}getPublicWriteAccess(){return this.getWriteAccess(PUBLIC_KEY)}setPublicProtectedFields(e){this.setProtectedFields(PUBLIC_KEY,e)}getPublicProtectedFields(){return this.getProtectedFields(PUBLIC_KEY)}getRoleReadAccess(e){return this.getReadAccess(this._getRoleName(e))}getRoleWriteAccess(e){return this.getWriteAccess(this._getRoleName(e))}setRoleReadAccess(e,t){this.setReadAccess(this._getRoleName(e),t)}setRoleWriteAccess(e,t){this.setWriteAccess(this._getRoleName(e),t)}getRoleProtectedFields(e){return this.getProtectedFields(this._getRoleName(e))}setRoleProtectedFields(e,t){this.setProtectedFields(this._getRoleName(e),t)}}var eventsExports=requireEvents();const events=getDefaultExportFromCjs(eventsExports),__CJS__import__1__$1=_mergeNamespaces({__proto__:null,default:events},[eventsExports]);let EventEmitter$1;try{EventEmitter$1=(events||__CJS__import__1__$1).EventEmitter}catch(e){}const EventEmitter=EventEmitter$1;class ParseConfig{constructor(){this.attributes={},this._escapedAttributes={}}get(e){return this.attributes[e]}escape(e){const t=this._escapedAttributes[e];if(t)return t;const r=this.attributes[e];let i="";return null!=r&&(i=escape$1(r.toString())),this._escapedAttributes[e]=i,i}static current(){return CoreManager.getConfigController().current()}static get(e){return CoreManager.getConfigController().get(e)}static save(e,t){const r=CoreManager.getConfigController();return r.save(e,t).then((()=>r.get({useMasterKey:!0})),(e=>Promise.reject(e)))}static _clearCache(){currentConfig=null}}let currentConfig=null;const CURRENT_CONFIG_KEY="currentConfig";function decodePayload(e){try{const t=JSON.parse(e);if(t&&"object"==typeof t)return decode(t)}catch(e){return null}}const DefaultController$4={current(){if(currentConfig)return currentConfig;const e=new ParseConfig,t=Storage.generatePath(CURRENT_CONFIG_KEY);if(!Storage.async()){const r=Storage.getItem(t);if(r){const t=decodePayload(r);t&&(e.attributes=t,currentConfig=e)}return e}return Storage.getItemAsync(t).then((t=>{if(t){const r=decodePayload(t);r&&(e.attributes=r,currentConfig=e)}return e}))},get:e=>CoreManager.getRESTController().request("GET","config",{},e).then((e=>{if(!e||!e.params){const e=new ParseError(ParseError.INVALID_JSON,"Config JSON response invalid.");return Promise.reject(e)}const t=new ParseConfig;t.attributes={};for(const r in e.params)t.attributes[r]=decode(e.params[r]);return currentConfig=t,Storage.setItemAsync(Storage.generatePath(CURRENT_CONFIG_KEY),JSON.stringify(e.params)).then((()=>t))})),save(e,t){const r=CoreManager.getRESTController(),i={};for(const t in e)i[t]=encode(e[t]);return r.request("PUT","config",{params:i,masterKeyOnly:t},{useMasterKey:!0}).then((e=>{if(e&&e.result)return Promise.resolve();{const e=new ParseError(ParseError.INTERNAL_SERVER_ERROR,"Error occured updating Config.");return Promise.reject(e)}}))}};CoreManager.setConfigController(DefaultController$4);let initialized=!1,requestedPermissions,initOptions;const provider={authenticate(e){"undefined"==typeof FB&&e.error(this,"Facebook SDK not found."),FB.login((t=>{t.authResponse?e.success&&e.success(this,{id:t.authResponse.userID,access_token:t.authResponse.accessToken,expiration_date:new Date(1e3*t.authResponse.expiresIn+(new Date).getTime()).toJSON()}):e.error&&e.error(this,t)}),{scope:requestedPermissions})},restoreAuthentication(e){if(e){const t={};if(initOptions)for(const e in initOptions)t[e]=initOptions[e];t.status=!1;const r=FB.getAuthResponse();r&&r.userID!==e.id&&FB.logout(),FB.init(t)}return!0},getAuthType:()=>"facebook",deauthenticate(){this.restoreAuthentication(null)}},FacebookUtils={init(e){if("undefined"==typeof FB)throw new Error("The Facebook JavaScript SDK must be loaded before calling init.");if(initOptions={},e)for(const t in e)initOptions[t]=e[t];if(initOptions.status&&"undefined"!=typeof console){(console.warn||console.log||function(){}).call(console,'The "status" flag passed into FB.init, when set to true, can interfere with Parse Facebook integration, so it has been suppressed. Please call FB.getLoginStatus() explicitly if you require this behavior.')}initOptions.status=!1,FB.init(initOptions),ParseUser._registerAuthenticationProvider(provider),initialized=!0},isLinked:e=>e._isLinked("facebook"),logIn(e,t){if(!e||"string"==typeof e){if(!initialized)throw new Error("You must initialize FacebookUtils before calling logIn.");return requestedPermissions=e,ParseUser.logInWith("facebook",t)}const r={authData:e};return ParseUser.logInWith("facebook",r,t)},link(e,t,r){if(!t||"string"==typeof t){if(!initialized)throw new Error("You must initialize FacebookUtils before calling link.");return requestedPermissions=t,e.linkWith("facebook",r)}const i={authData:t};return e.linkWith("facebook",i,r)},unlink:function(e,t){if(!initialized)throw new Error("You must initialize FacebookUtils before calling unlink.");return e._unlinkFrom("facebook",t)},_getAuthProvider:()=>provider},DefaultController$3={get(e,t,r){let i="hooks/"+e;return t&&(i+="/"+t,r&&(i+="/"+r)),this.sendRequest("GET",i)},create(e){let t;if(e.functionName&&e.url)t="hooks/functions";else{if(!(e.className&&e.triggerName&&e.url))return Promise.reject({error:"invalid hook declaration",code:143});t="hooks/triggers"}return this.sendRequest("POST",t,e)},remove(e){let t;if(e.functionName)t="hooks/functions/"+e.functionName,delete e.functionName;else{if(!e.className||!e.triggerName)return Promise.reject({error:"invalid hook declaration",code:143});t="hooks/triggers/"+e.className+"/"+e.triggerName,delete e.className,delete e.triggerName}return this.sendRequest("PUT",t,{__op:"Delete"})},update(e){let t;if(e.functionName&&e.url)t="hooks/functions/"+e.functionName,delete e.functionName;else{if(!(e.className&&e.triggerName&&e.url))return Promise.reject({error:"invalid hook declaration",code:143});t="hooks/triggers/"+e.className+"/"+e.triggerName,delete e.className,delete e.triggerName}return this.sendRequest("PUT",t,e)},sendRequest:(e,t,r)=>CoreManager.getRESTController().request(e,t,r,{useMasterKey:!0}).then((e=>{const t=decode(e);return t?Promise.resolve(t):Promise.reject(new ParseError(ParseError.INVALID_JSON,"The server returned an invalid response."))}))};CoreManager.setHooksController(DefaultController$3);const LocalDatastoreController$1={async fromPinWithName(e){const t=await Storage.getItemAsync(e);if(!t)return[];return JSON.parse(t)},pinWithName(e,t){const r=JSON.stringify(t);return Storage.setItemAsync(e,r)},unPinWithName:e=>Storage.removeItemAsync(e),getAllContents:async()=>(await Storage.getAllKeysAsync()).reduce((async(e,t)=>{const r=await e;if(isLocalDatastoreKey(t)){const e=await Storage.getItemAsync(t);try{r[t]=JSON.parse(e)}catch(e){console.error("Error getAllContents: ",e)}}return r}),Promise.resolve({})),getRawStorage:async()=>(await Storage.getAllKeysAsync()).reduce((async(e,t)=>{const r=await e,i=await Storage.getItemAsync(t);return r[t]=i,r}),Promise.resolve({})),async clear(){const e=await Storage.getAllKeysAsync(),t=[];for(const r of e)isLocalDatastoreKey(r)&&t.push(r);const r=t.map(this.unPinWithName);return Promise.all(r)}};let LocalDatastoreController=LocalDatastoreController$1;const LocalDatastore={isEnabled:!1,isSyncing:!1,fromPinWithName:e=>CoreManager.getLocalDatastoreController().fromPinWithName(e),pinWithName:async(e,t)=>CoreManager.getLocalDatastoreController().pinWithName(e,t),unPinWithName:async e=>CoreManager.getLocalDatastoreController().unPinWithName(e),_getAllContents:()=>CoreManager.getLocalDatastoreController().getAllContents(),_getRawStorage:async()=>CoreManager.getLocalDatastoreController().getRawStorage(),_clear:async()=>CoreManager.getLocalDatastoreController().clear(),async _handlePinAllWithName(e,t){const r=this.getPinName(e),i=[],n=[];for(const e of t){const t=this._getChildren(e),r=this.getKeyForObject(e),o=e._toFullJSON(void 0,!0);e._localId&&(o._localId=e._localId),t[r]=o;for(const e in t)n.push(e),i.push(this.pinWithName(e,[t[e]]))}const o=this.fromPinWithName(r),[s]=await Promise.all([o,i]),a=[...new Set([...s||[],...n])];return this.pinWithName(r,a)},async _handleUnPinAllWithName(e,t){const r=await this._getAllContents(),i=this.getPinName(e),n=[];let o=[];for(const e of t){const t=this._getChildren(e),r=this.getKeyForObject(e);o.push(r,...Object.keys(t))}o=[...new Set(o)];let s=r[i]||[];s=s.filter((e=>!o.includes(e))),0==s.length?(n.push(this.unPinWithName(i)),delete r[i]):(n.push(this.pinWithName(i,s)),r[i]=s);for(const e of o){let t=!1;for(const i in r)if(i===DEFAULT_PIN||i.startsWith(PIN_PREFIX)){if((r[i]||[]).includes(e)){t=!0;break}}t||n.push(this.unPinWithName(e))}return Promise.all(n)},_getChildren(e){const t={},r=e._toFullJSON(void 0,!0);for(const e in r)r[e]&&r[e].__type&&"Object"===r[e].__type&&this._traverse(r[e],t);return t},_traverse(e,t){if(e.objectId){{const r=this.getKeyForObject(e);if(t[r])return;t[r]=e}for(const r in e){let i=e[r];e[r]||(i=e),i.__type&&"Object"===i.__type&&this._traverse(i,t)}}},async _serializeObjectsFromPinName(e){const t=await this._getAllContents(),r=[];for(const e in t)e.startsWith(OBJECT_PREFIX)&&r.push(t[e][0]);if(!e)return r;const i=t[this.getPinName(e)];if(!Array.isArray(i))return[];const n=i.map((e=>this.fromPinWithName(e)));let o=await Promise.all(n);return o=[].concat(...o),o.filter((e=>null!=e))},async _serializeObject(e,t){let r=t;if(r||(r=await this._getAllContents()),!r[e]||0===r[e].length)return null;const i=r[e][0],n=[],o={};let s=0;for(o[s]=i,n.push(s);0!==n.length;){const e=o[n.shift()];for(const t in e){const i=e[t];if(i.__type&&"Object"===i.__type){const a=this.getKeyForObject(i);if(r[a]&&r[a].length>0){const i=r[a][0];s++,o[s]=i,e[t]=i,n.push(s)}}}}return i},async _updateObjectIfPinned(e){if(!this.isEnabled)return;const t=this.getKeyForObject(e),r=await this.fromPinWithName(t);return r&&0!==r.length?this.pinWithName(t,[e._toFullJSON()]):void 0},async _destroyObjectIfPinned(e){if(!this.isEnabled)return;const t=await this._getAllContents(),r=this.getKeyForObject(e);if(!t[r])return;const i=[this.unPinWithName(r)];delete t[r];for(const e in t)if(e===DEFAULT_PIN||e.startsWith(PIN_PREFIX)){let n=t[e]||[];n.includes(r)&&(n=n.filter((e=>e!==r)),0==n.length?(i.push(this.unPinWithName(e)),delete t[e]):(i.push(this.pinWithName(e,n)),t[e]=n))}return Promise.all(i)},async _updateLocalIdForObject(e,t){if(!this.isEnabled)return;const r=`${OBJECT_PREFIX}${t.className}_${e}`,i=this.getKeyForObject(t),n=await this.fromPinWithName(r);if(!n||0===n.length)return;const o=[this.unPinWithName(r),this.pinWithName(i,n)],s=await this._getAllContents();for(const e in s)if(e===DEFAULT_PIN||e.startsWith(PIN_PREFIX)){let t=s[e]||[];t.includes(r)&&(t=t.filter((e=>e!==r)),t.push(i),o.push(this.pinWithName(e,t)),s[e]=t)}return Promise.all(o)},async updateFromServer(){if(!this.checkIfEnabled()||this.isSyncing)return;const e=await this._getAllContents(),t=[];for(const r in e)r.startsWith(OBJECT_PREFIX)&&t.push(r);if(0===t.length)return;this.isSyncing=!0;const r={};for(const e of t){let[,,t,i]=e.split("_");5===e.split("_").length&&"User"===e.split("_")[3]&&(t="_User",i=e.split("_")[4]),i.startsWith("local")||(t in r||(r[t]=new Set),r[t].add(i))}const i=Object.keys(r).map((e=>{const t=Array.from(r[e]),i=new ParseQuery(e);return i.limit(t.length),1===t.length?i.equalTo("objectId",t[0]):i.containedIn("objectId",t),i.find()}));try{const e=await Promise.all(i),t=[].concat.apply([],e).map((e=>{const t=this.getKeyForObject(e);return this.pinWithName(t,e._toFullJSON())}));await Promise.all(t),this.isSyncing=!1}catch(e){console.error("Error syncing LocalDatastore: ",e),this.isSyncing=!1}},getKeyForObject(e){const t=e.objectId||e._getId();return`${OBJECT_PREFIX}${e.className}_${t}`},getPinName:e=>e&&e!==DEFAULT_PIN?PIN_PREFIX+e:DEFAULT_PIN,checkIfEnabled(){return this.isEnabled||console.error("Parse.enableLocalDatastore() must be called first"),this.isEnabled}};function send(e,t={}){if(e.where&&e.where instanceof ParseQuery&&(e.where=e.where.toJSON().where),e.push_time&&"object"==typeof e.push_time&&(e.push_time=e.push_time.toJSON()),e.expiration_time&&"object"==typeof e.expiration_time&&(e.expiration_time=e.expiration_time.toJSON()),e.expiration_time&&e.expiration_interval)throw new Error("expiration_time and expiration_interval cannot both be set.");const r={useMasterKey:!0};return Object.hasOwn(t,"useMasterKey")&&(r.useMasterKey=t.useMasterKey),CoreManager.getPushController().send(e,r)}function getPushStatus(e,t={}){const r={useMasterKey:!0};Object.hasOwn(t,"useMasterKey")&&(r.useMasterKey=t.useMasterKey);return new ParseQuery("_PushStatus").get(e,r)}CoreManager.setLocalDatastoreController(LocalDatastoreController),CoreManager.setLocalDatastore(LocalDatastore);const DefaultController$2={async send(e,t){t.returnStatus=!0;const r=await CoreManager.getRESTController().request("POST","push",e,t);return r._headers?.["X-Parse-Push-Status-Id"]}};CoreManager.setPushController(DefaultController$2);const Push=Object.freeze(Object.defineProperty({__proto__:null,getPushStatus:getPushStatus,send:send},Symbol.toStringTag,{value:"Module"})),FIELD_TYPES=["String","Number","Boolean","Bytes","Date","File","GeoPoint","Polygon","Array","Object","Pointer","Relation"];class ParseSchema{constructor(e){"string"==typeof e&&("User"===e&&CoreManager.get("PERFORM_USER_REWRITE")?this.className="_User":this.className=e),this._fields={},this._indexes={}}static all(){return CoreManager.getSchemaController().get("").then((e=>{if(0===e.results.length)throw new Error("Schema not found.");return e.results}))}get(){this.assertClassName();return CoreManager.getSchemaController().get(this.className).then((e=>{if(!e)throw new Error("Schema not found.");return e}))}save(){this.assertClassName();const e=CoreManager.getSchemaController(),t={className:this.className,fields:this._fields,indexes:this._indexes,classLevelPermissions:this._clp};return e.create(this.className,t)}update(){this.assertClassName();const e=CoreManager.getSchemaController(),t={className:this.className,fields:this._fields,indexes:this._indexes,classLevelPermissions:this._clp};return this._fields={},this._indexes={},e.update(this.className,t)}delete(){this.assertClassName();return CoreManager.getSchemaController().delete(this.className)}purge(){this.assertClassName();return CoreManager.getSchemaController().purge(this.className)}assertClassName(){if(!this.className)throw new Error("You must set a Class Name before making any request.")}setCLP(e){return this._clp=e instanceof ParseCLP?e.toJSON():e,this}addField(e,t,r){if(t=t||"String",r=r||{},!e)throw new Error("field name may not be null.");if(-1===FIELD_TYPES.indexOf(t))throw new Error(`${t} is not a valid type.`);if("Pointer"===t)return this.addPointer(e,r.targetClass,r);if("Relation"===t)return this.addRelation(e,r.targetClass);const i={type:t};return"boolean"==typeof r.required&&(i.required=r.required),void 0!==r.defaultValue&&(i.defaultValue=r.defaultValue),"Date"===t&&r&&r.defaultValue&&(i.defaultValue={__type:"Date",iso:new Date(r.defaultValue)}),"Bytes"===t&&r&&r.defaultValue&&(i.defaultValue={__type:"Bytes",base64:r.defaultValue}),this._fields[e]=i,this}addIndex(e,t){if(!e)throw new Error("index name may not be null.");if(!t)throw new Error("index may not be null.");return this._indexes[e]=t,this}addString(e,t){return this.addField(e,"String",t)}addNumber(e,t){return this.addField(e,"Number",t)}addBoolean(e,t){return this.addField(e,"Boolean",t)}addBytes(e,t){return this.addField(e,"Bytes",t)}addDate(e,t){return this.addField(e,"Date",t)}addFile(e,t){return this.addField(e,"File",t)}addGeoPoint(e,t){return this.addField(e,"GeoPoint",t)}addPolygon(e,t){return this.addField(e,"Polygon",t)}addArray(e,t){return this.addField(e,"Array",t)}addObject(e,t){return this.addField(e,"Object",t)}addPointer(e,t,r){if(!e)throw new Error("field name may not be null.");if(!t)throw new Error("You need to set the targetClass of the Pointer.");const i={type:"Pointer",targetClass:t};return"boolean"==typeof r?.required&&(i.required=r.required),void 0!==r?.defaultValue&&(i.defaultValue=r.defaultValue,r.defaultValue instanceof ParseObject&&(i.defaultValue=r.defaultValue.toPointer())),this._fields[e]=i,this}addRelation(e,t){if(!e)throw new Error("field name may not be null.");if(!t)throw new Error("You need to set the targetClass of the Relation.");return this._fields[e]={type:"Relation",targetClass:t},this}deleteField(e){return this._fields[e]={__op:"Delete"},this}deleteIndex(e){return this._indexes[e]={__op:"Delete"},this}}const DefaultController$1={send:(e,t,r={})=>CoreManager.getRESTController().request(t,`schemas/${e}`,r,{useMasterKey:!0}),get(e){return this.send(e,"GET")},create(e,t){return this.send(e,"POST",t)},update(e,t){return this.send(e,"PUT",t)},delete(e){return this.send(e,"DELETE")},purge:e=>CoreManager.getRESTController().request("DELETE",`purge/${e}`,{},{useMasterKey:!0})};CoreManager.setSchemaController(DefaultController$1);class ParseSession extends ParseObject{constructor(e){if(super("_Session"),e&&"object"==typeof e)try{this.set(e||{})}catch(e){throw new Error("Can't create an invalid Session")}}getSessionToken(){const e=this.get("sessionToken");return"string"==typeof e?e:""}static readOnlyAttributes(){return["createdWith","expiresAt","installationId","restricted","sessionToken","user"]}static current(e){const t=CoreManager.getSessionController(),r=ParseObject._getRequestOptions(e);return ParseUser.currentAsync().then((e=>e?(r.sessionToken=e.getSessionToken(),t.getSession(r)):Promise.reject("There is no current user.")))}static isCurrentSessionRevocable(){const e=ParseUser.current();return!!e&&isRevocableSession(e.getSessionToken()||"")}}ParseObject.registerSubclass("_Session",ParseSession);const DefaultController={getSession(e){const t=CoreManager.getRESTController(),r=new ParseSession;return t.request("GET","sessions/me",{},e).then((e=>(r._finishFetch(e),r._setExisted(!0),r)))}};CoreManager.setSessionController(DefaultController);class LiveQuerySubscription{constructor(e,t,r,i){this.id=e,this.query=t,this.sessionToken=r,this.client=i,this.subscribePromise=resolvingPromise(),this.unsubscribePromise=resolvingPromise(),this.subscribed=!1;const n=CoreManager.getEventEmitter();this.emitter=new n,this.on=(e,t)=>this.emitter.on(e,t),this.emit=(e,...t)=>this.emitter.emit(e,...t),this.on("error",(()=>{}))}unsubscribe(){return CoreManager.getLiveQueryController().getDefaultLiveQueryClient().then((e=>(this.emit("close"),e.unsubscribe(this))))}find(){this.client&&this.client.connectPromise.then((()=>{this.client.socket.send(JSON.stringify({op:"query",requestId:this.id}))}))}}const CLIENT_STATE={INITIALIZED:"initialized",CONNECTING:"connecting",CONNECTED:"connected",CLOSED:"closed",RECONNECTING:"reconnecting",DISCONNECTED:"disconnected"},OP_TYPES={CONNECT:"connect",SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe"},OP_EVENTS={CONNECTED:"connected",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed",ERROR:"error",RESULT:"result"},CLIENT_EMMITER_TYPES={CLOSE:"close",ERROR:"error",OPEN:"open"},SUBSCRIPTION_EMMITER_TYPES={OPEN:"open",CLOSE:"close",ERROR:"error",RESULT:"result"},generateInterval=e=>Math.random()*Math.min(30,Math.pow(2,e)-1)*1e3;class LiveQueryClient{constructor({applicationId:e,serverURL:t,javascriptKey:r,masterKey:i,sessionToken:n,installationId:o}){if(!t||0!==t.indexOf("ws"))throw new Error("You need to set a proper Parse LiveQuery server url before using LiveQueryClient");this.reconnectHandle=null,this.attempts=1,this.id=0,this.requestId=1,this.serverURL=t,this.applicationId=e,this.javascriptKey=r||void 0,this.masterKey=i||void 0,this.sessionToken=n||void 0,this.installationId=o||void 0,this.additionalProperties=!0,this.connectPromise=resolvingPromise(),this.subscriptions=new Map,this.state=CLIENT_STATE.INITIALIZED;const s=CoreManager.getEventEmitter();this.emitter=new s,this.on=(e,t)=>this.emitter.on(e,t),this.emit=(e,...t)=>this.emitter.emit(e,...t),this.on("error",(()=>{}))}shouldOpen(){return this.state===CLIENT_STATE.INITIALIZED||this.state===CLIENT_STATE.DISCONNECTED}subscribe(e,t){if(!e)return;const r=e.className,i=e.toJSON(),n=i.where,o=i.keys?.split(","),s=i.watch?.split(","),a={op:OP_TYPES.SUBSCRIBE,requestId:this.requestId,query:{className:r,where:n,keys:o,watch:s},sessionToken:void 0};t&&(a.sessionToken=t);const u=new LiveQuerySubscription(this.requestId,e,t,this);return this.subscriptions.set(this.requestId,u),this.requestId+=1,this.connectPromise.then((()=>{this.socket.send(JSON.stringify(a))})).catch((e=>{u.subscribePromise.reject(e)})),u}async unsubscribe(e){if(!e)return;const t={op:OP_TYPES.UNSUBSCRIBE,requestId:e.id};return this.connectPromise.then((()=>this.socket.send(JSON.stringify(t)))).then((()=>e.unsubscribePromise))}open(){const e=CoreManager.getWebSocketController();e?(this.state!==CLIENT_STATE.RECONNECTING&&(this.state=CLIENT_STATE.CONNECTING),this.socket=new e(this.serverURL),this.socket.closingPromise=resolvingPromise(),this.socket.onopen=()=>{this._handleWebSocketOpen()},this.socket.onmessage=e=>{this._handleWebSocketMessage(e)},this.socket.onclose=e=>{this.socket.closingPromise?.resolve(e),this._handleWebSocketClose()},this.socket.onerror=e=>{this._handleWebSocketError(e)}):this.emit(CLIENT_EMMITER_TYPES.ERROR,"Can not find WebSocket implementation")}resubscribe(){this.subscriptions.forEach(((e,t)=>{const r=e.query,i=r.toJSON(),n=i.where,o=i.keys?.split(","),s=i.watch?.split(","),a=r.className,u=e.sessionToken,h={op:OP_TYPES.SUBSCRIBE,requestId:t,query:{className:a,where:n,keys:o,watch:s},sessionToken:void 0};u&&(h.sessionToken=u),this.connectPromise.then((()=>{this.socket.send(JSON.stringify(h))}))}))}async close(){if(this.state!==CLIENT_STATE.INITIALIZED&&this.state!==CLIENT_STATE.DISCONNECTED){this.state=CLIENT_STATE.DISCONNECTED,this.socket?.close();for(const e of this.subscriptions.values())e.subscribed=!1,e.emit(SUBSCRIPTION_EMMITER_TYPES.CLOSE);return this._handleReset(),this.emit(CLIENT_EMMITER_TYPES.CLOSE),this.socket?.closingPromise}}_handleReset(){this.attempts=1,this.id=0,this.requestId=1,this.connectPromise=resolvingPromise(),this.subscriptions=new Map}_handleWebSocketOpen(){const e={op:OP_TYPES.CONNECT,applicationId:this.applicationId,javascriptKey:this.javascriptKey,masterKey:this.masterKey,sessionToken:this.sessionToken,installationId:void 0};this.additionalProperties&&(e.installationId=this.installationId),this.socket.send(JSON.stringify(e))}_handleWebSocketMessage(e){let t=e.data;"string"==typeof t&&(t=JSON.parse(t));let r=null;t.requestId&&(r=this.subscriptions.get(t.requestId)||null);const i={clientId:t.clientId,installationId:t.installationId};switch(t.op){case OP_EVENTS.CONNECTED:this.state===CLIENT_STATE.RECONNECTING&&this.resubscribe(),this.emit(CLIENT_EMMITER_TYPES.OPEN),this.id=t.clientId,this.connectPromise.resolve(),this.state=CLIENT_STATE.CONNECTED;break;case OP_EVENTS.SUBSCRIBED:r&&(this.attempts=1,r.subscribed=!0,r.subscribePromise.resolve(),setTimeout((()=>r.emit(SUBSCRIPTION_EMMITER_TYPES.OPEN,i)),200));break;case OP_EVENTS.ERROR:{const e=new ParseError(t.code,t.error);this.id||(this.connectPromise.reject(e),this.state=CLIENT_STATE.DISCONNECTED),t.requestId?r&&(r.subscribePromise.reject(e),setTimeout((()=>r.emit(SUBSCRIPTION_EMMITER_TYPES.ERROR,t.error)),200)):this.emit(CLIENT_EMMITER_TYPES.ERROR,t.error),"Additional properties not allowed"===t.error&&(this.additionalProperties=!1),t.reconnect&&this._handleReconnect();break}case OP_EVENTS.UNSUBSCRIBED:r&&(this.subscriptions.delete(t.requestId),r.subscribed=!1,r.unsubscribePromise.resolve());break;case OP_EVENTS.RESULT:if(r){const e=t.results.map((e=>(!e.className&&r.query&&(e.className=r.query.className),ParseObject.fromJSON(e,!1))));r.emit(SUBSCRIPTION_EMMITER_TYPES.RESULT,e)}break;default:{if(!r)break;let e=!1;if(t.original){e=!0,delete t.original.__type;for(const e in t.original)e in t.object||(t.object[e]=void 0);t.original=ParseObject.fromJSON(t.original,!1)}delete t.object.__type;const n=ParseObject.fromJSON(t.object,(!r.query||!r.query._select)&&e);t.original?r.emit(t.op,n,t.original,i):r.emit(t.op,n,i);const o=CoreManager.getLocalDatastore();e&&o.isEnabled&&o._updateObjectIfPinned(n).then((()=>{}))}}}_handleWebSocketClose(){if(this.state!==CLIENT_STATE.DISCONNECTED){this.state=CLIENT_STATE.CLOSED,this.emit(CLIENT_EMMITER_TYPES.CLOSE);for(const e of this.subscriptions.values())e.emit(SUBSCRIPTION_EMMITER_TYPES.CLOSE);this._handleReconnect()}}_handleWebSocketError(e){this.emit(CLIENT_EMMITER_TYPES.ERROR,e);for(const t of this.subscriptions.values())t.emit(SUBSCRIPTION_EMMITER_TYPES.ERROR,e);this._handleReconnect()}_handleReconnect(){if(this.state===CLIENT_STATE.DISCONNECTED)return;this.state=CLIENT_STATE.RECONNECTING;const e=generateInterval(this.attempts);this.reconnectHandle&&clearTimeout(this.reconnectHandle),this.reconnectHandle=setTimeout((()=>{this.attempts++,this.connectPromise=resolvingPromise(),this.open()}).bind(this),e)}}function getLiveQueryClient(){return CoreManager.getLiveQueryController().getDefaultLiveQueryClient()}class LiveQuery{constructor(){const e=CoreManager.getEventEmitter();this.emitter=new e,this.on=(e,t)=>this.emitter.on(e,t),this.emit=(e,...t)=>this.emitter.emit(e,...t),this.on("error",(()=>{}))}async open(){(await getLiveQueryClient()).open()}async close(){(await getLiveQueryClient()).close()}}let defaultLiveQueryClient;const DefaultLiveQueryController={setDefaultLiveQueryClient(e){defaultLiveQueryClient=e},async getDefaultLiveQueryClient(){if(defaultLiveQueryClient)return defaultLiveQueryClient;const[e,t]=await Promise.all([CoreManager.getUserController().currentUserAsync(),CoreManager.getInstallationController().currentInstallationId()]),r=e?e.getSessionToken():void 0;let i=CoreManager.get("LIVEQUERY_SERVER_URL");if(i&&0!==i.indexOf("ws"))throw new Error("You need to set a proper Parse LiveQuery server url before using LiveQueryClient");if(!i){const e=CoreManager.get("SERVER_URL");i=(0===e.indexOf("https")?"wss://":"ws://")+e.replace(/^https?:\/\//,""),CoreManager.set("LIVEQUERY_SERVER_URL",i)}const n=CoreManager.get("APPLICATION_ID"),o=CoreManager.get("JAVASCRIPT_KEY"),s=CoreManager.get("MASTER_KEY");defaultLiveQueryClient=new LiveQueryClient({applicationId:n,serverURL:i,javascriptKey:o,masterKey:s,sessionToken:r,installationId:t});const a=CoreManager.getLiveQuery();return defaultLiveQueryClient.on("error",(e=>{a.emit("error",e)})),defaultLiveQueryClient.on("open",(()=>{a.emit("open")})),defaultLiveQueryClient.on("close",(()=>{a.emit("close")})),defaultLiveQueryClient},_clearCachedDefaultClient(){defaultLiveQueryClient=null}};CoreManager.setLiveQueryController(DefaultLiveQueryController);const StorageController$3={async:0,getItem:e=>localStorage.getItem(e),setItem(e,t){try{localStorage.setItem(e,t)}catch(e){console.log(e.message)}},removeItem(e){localStorage.removeItem(e)},getAllKeys(){const e=[];for(let t=0;t<localStorage.length;t+=1)e.push(localStorage.key(t));return e},clear(){localStorage.clear()}},memMap={},StorageController$2={async:0,getItem:e=>Object.hasOwn(memMap,e)?memMap[e]:null,setItem(e,t){memMap[e]=String(t)},removeItem(e){delete memMap[e]},getAllKeys:()=>Object.keys(memMap),clear(){for(const e in memMap)Object.hasOwn(memMap,e)&&delete memMap[e]}};let StorageController$1=StorageController$2;StorageController$1=StorageController$3;const StorageController=StorageController$1;var browser$1,hasRequiredBrowser;function requireBrowser(){return hasRequiredBrowser?browser$1:(hasRequiredBrowser=1,browser$1=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")})}var browserExports=requireBrowser();const browser=getDefaultExportFromCjs(browserExports),__CJS__import__0__=_mergeNamespaces({__proto__:null,default:browser},[browserExports]);class SocketWeapp{constructor(e){this.onopen=()=>{},this.onmessage=()=>{},this.onclose=()=>{},this.onerror=()=>{},wx.onSocketOpen((()=>{this.onopen()})),wx.onSocketMessage((e=>{this.onmessage(e)})),wx.onSocketClose((e=>{this.onclose(e)})),wx.onSocketError((e=>{this.onerror(e)})),wx.connectSocket({url:e})}send(e){wx.sendSocketMessage({data:e})}close(){wx.closeSocket()}}const __CJS__import__1__=Object.freeze(Object.defineProperty({__proto__:null,default:SocketWeapp},Symbol.toStringTag,{value:"Module"}));let WebSocketController$1;try{WebSocketController$1="function"==typeof WebSocket||"object"==typeof WebSocket?WebSocket:null}catch(e){}const WebSocketController=WebSocketController$1;var define_process_env_default={};const Parse={ACL:ParseACL,Analytics:Analytics,AnonymousUtils:AnonymousUtils,Cloud:Cloud,CLP:ParseCLP,CoreManager:CoreManager,Config:ParseConfig,Error:ParseError,FacebookUtils:FacebookUtils,File:ParseFile,GeoPoint:ParseGeoPoint,Polygon:ParsePolygon,Installation:ParseInstallation,LocalDatastore:LocalDatastore,Object:ParseObject,Op:{Set:SetOp,Unset:UnsetOp,Increment:IncrementOp,Add:AddOp,Remove:RemoveOp,AddUnique:AddUniqueOp,Relation:RelationOp},Push:Push,Query:ParseQuery,Relation:ParseRelation,Role:ParseRole,Schema:ParseSchema,Session:ParseSession,Storage:Storage,User:ParseUser,LiveQueryClient:LiveQueryClient,IndexedDB:void 0,Hooks:void 0,Parse:void 0,set EventuallyQueue(e){CoreManager.setEventuallyQueue(e)},get EventuallyQueue(){return CoreManager.getEventuallyQueue()},initialize(e,t){CoreManager.get("IS_NODE")&&!define_process_env_default.SERVER_RENDERING&&console.log("It looks like you're using the browser version of the SDK in a node.js environment. You should require('parse/node') instead."),Parse._initialize(e,t)},_initialize(e,t,r,i){CoreManager.set("APPLICATION_ID",e),CoreManager.set("JAVASCRIPT_KEY",t),CoreManager.set("MAINTENANCE_KEY",i),CoreManager.set("MASTER_KEY",r),CoreManager.set("USE_MASTER_KEY",!1),CoreManager.setIfNeeded("EventEmitter",EventEmitter),CoreManager.setIfNeeded("LiveQuery",new LiveQuery),CoreManager.setIfNeeded("CryptoController",CryptoController),CoreManager.setIfNeeded("EventuallyQueue",EventuallyQueue),CoreManager.setIfNeeded("InstallationController",InstallationController),CoreManager.setIfNeeded("LocalDatastoreController",LocalDatastoreController),CoreManager.setIfNeeded("StorageController",StorageController),CoreManager.setIfNeeded("WebSocketController",WebSocketController),Parse.IndexedDB=CoreManager.setIfNeeded("IndexedDBStorageController",IndexedDBStorageController)},setAsyncStorage(e){CoreManager.setAsyncStorage(e)},setLocalDatastoreController(e){CoreManager.setLocalDatastoreController(e)},getServerHealth:()=>CoreManager.getRESTController().request("GET","health"),set applicationId(e){CoreManager.set("APPLICATION_ID",e)},get applicationId(){return CoreManager.get("APPLICATION_ID")},set javaScriptKey(e){CoreManager.set("JAVASCRIPT_KEY",e)},get javaScriptKey(){return CoreManager.get("JAVASCRIPT_KEY")},set masterKey(e){CoreManager.set("MASTER_KEY",e)},get masterKey(){return CoreManager.get("MASTER_KEY")},set maintenanceKey(e){CoreManager.set("MAINTENANCE_KEY",e)},get maintenanceKey(){return CoreManager.get("MAINTENANCE_KEY")},set serverURL(e){CoreManager.set("SERVER_URL",e)},get serverURL(){return CoreManager.get("SERVER_URL")},set LiveQuery(e){CoreManager.setLiveQuery(e)},get LiveQuery(){return CoreManager.getLiveQuery()},set liveQueryServerURL(e){CoreManager.set("LIVEQUERY_SERVER_URL",e)},get liveQueryServerURL(){return CoreManager.get("LIVEQUERY_SERVER_URL")},set encryptedUser(e){CoreManager.set("ENCRYPTED_USER",e)},get encryptedUser(){return CoreManager.get("ENCRYPTED_USER")},set secret(e){CoreManager.set("ENCRYPTED_KEY",e)},get secret(){return CoreManager.get("ENCRYPTED_KEY")},set idempotency(e){CoreManager.set("IDEMPOTENCY",e)},get idempotency(){return CoreManager.get("IDEMPOTENCY")},set allowCustomObjectId(e){CoreManager.set("ALLOW_CUSTOM_OBJECT_ID",e)},get allowCustomObjectId(){return CoreManager.get("ALLOW_CUSTOM_OBJECT_ID")},set nodeLogging(e){CoreManager.set("NODE_LOGGING",e)},get nodeLogging(){return CoreManager.get("NODE_LOGGING")},_request:(...e)=>CoreManager.getRESTController().request.apply(null,e),_ajax:(...e)=>CoreManager.getRESTController().ajax.apply(null,e),_decode:(e,t)=>decode(t),_encode:(e,t,r)=>encode(e,r),_getInstallationId:()=>CoreManager.getInstallationController().currentInstallationId(),enableLocalDatastore(e,t){this.applicationId?this.LocalDatastore.isEnabled||(this.LocalDatastore.isEnabled=!0,(e||void 0===e)&&CoreManager.getEventuallyQueue().poll(t||2e3)):console.log("'enableLocalDatastore' must be called after 'initialize'")},isLocalDatastoreEnabled(){return this.LocalDatastore.isEnabled},dumpLocalDatastore(){return this.LocalDatastore.isEnabled?Parse.LocalDatastore._getAllContents():(console.log("Parse.enableLocalDatastore() must be called first"),Promise.resolve({}))},enableEncryptedUser(){this.encryptedUser=!0},isEncryptedUserEnabled(){return this.encryptedUser}};CoreManager.setRESTController(RESTController),globalThis.Parse=Parse,Parse.Parse=Parse}));
|